From 8f7e0a2cbde8bd769eb8bc509aa6eea4842ff986 Mon Sep 17 00:00:00 2001 From: Lee Mallabone Date: Fri, 28 Mar 2003 08:46:25 +0000 Subject: [PATCH] Second draft of Calendar docs. First one may have got messed up. svn path=/trunk/gtk-sharp/; revision=12880 --- doc/ChangeLog | 4 + doc/en/Gtk/Calendar.xml | 342 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 341 insertions(+), 5 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d1053395b..e1ed7ec02 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2003-03-28 Lee Mallabone + + * en/Gtk/Calendar.xml: Second draft. + 2003-03-27 Lee Mallabone * en/Gtk/Viewport.xml: First draft, includes custom constructor. diff --git a/doc/en/Gtk/Calendar.xml b/doc/en/Gtk/Calendar.xml index 551b2d3bf..fdf813f5a 100644 --- a/doc/en/Gtk/Calendar.xml +++ b/doc/en/Gtk/Calendar.xml @@ -7,11 +7,11 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - Display a calendar and/or allow the user to select a date. + Display a Calendar and/or allow the user to select a date. With a Calendar widget, dates are presented to the user one month at a time. Additional information and decorations can be added to the Calendar by using the enumeration with the property. Days can be highlighted on the Calendar with or . - The following example shows a method that creates a simple calendar displaying day names, headings and week numbers. (These are controlled by passing elements of the type to the method). + The following example shows a method that creates a simple Calendar displaying day names, headings and week numbers. // Create a calendar with some simple display options @@ -21,14 +21,346 @@ public Calendar CreateCalendar () cal.DisplayOptions = CalendarDisplayOptions.ShowHeading | CalendarDisplayOptions.ShowDayNames | CalendarDisplayOptions.ShowWeekNumbers; + cal.DaySelected += new EventHandler(HandleDaySelected); return cal; } - The following example shows a typical event handler or capturing the selected date whenever it changes. + The following example shows a typical event handler that outputs the date when one is selected. // Typical event handler for capturing the selected date -void DaySelected (object obj, EventArgs args) +void HandleDaySelected (object obj, EventArgs args) { - Ca \ No newline at end of file + Calendar activatedCalendar = (Calendar) obj; + Console.WriteLine (activatedCalendar.GetDate ().ToString ("yyyy/MM/dd")); +} + + + + + + Gtk.Widget + + + + Atk.Implementor + + + GLib.IWrapper + + + GLib.IWrapper + + + System.IDisposable + + + + + + + Method + + System.Boolean + + + + + + Removes a visual marker from the specified . + A day number from 1 to 31. + + + + + Visual markers are added to the Calendar with . + + + + + + Method + + System.Boolean + + + + + + Adds a visual marker to the specified . + A day number from 1 to 31. + + + + + + + + + Method + + System.Void + + + + + + Select a specified day on the displayed month. + A day number from 1 to 31. + + A value of 0 for the will unselect the currently selected day. + + + + + + Method + + System.Void + + + + Stops the Calendar from visually updating. + + If used before a large number of graphical updates, (such as calls to ), this method may prevent flicker. Once a batch of updates has taken place, call to render them. + + + + + + Method + + System.Void + + + + + + + + Get the selected date. + A variable to place the chosen year in. + A variable to place the chosen month in. + A variable to place the chosen day in. + + NOTE: That month number is ZERO based, (0-11), whereas the day is one based, (1-31). + An alternative way to get the date is with the method. + + + + + + Method + + System.Void + + + + Removes the effects of calling . + + This draws all graphical updates to the Calendar that have happened since a . + + + + + + Method + + System.Void + + + + Removes all visual marks that have been added to dates. + + + + + + Method + + System.Boolean + + + + + + + Shifts the Calendar to display the specified month. + A zero-based month number. + The year the month is in. + + + + + + + + + Method + + System.Void + + + + Disposes the resources associated with the object. + + + + + + Constructor + + + + + + Internal constructor + Pointer to the C object. + An instance of Calendar, wrapping the C object. + + This is an internal constructor, and should not be used by user code. + + + + + + Constructor + + + + Creates a new Calendar displaying the current month. + A new Calendar. + + + + + + Property + + System.UInt32 + + + The GLib Type for Gtk.Calendar + The GLib Type for the Gtk.Calendar class. + + + + + + Event + + + + Fired when the current year of the Calendar is increased. + This may happen when the user explicitly advances the year, or when advancing from December to January. + + + + + Event + + + + Fired when the user "double clicks" on a day. + + + + + + Event + + + + Fired when the current year of the Calendar is decreased. + This may happen when the user explicitly advances the year, or when clicking 'back' from January to December. + + + + + Event + + + + Fired when the current month changes. + + + + + + Event + + + + Fired when the month of the Calendar moves to the next one. + + + + + + Event + + + + Fired when a day is selected on the Calendar. + + + + + + Event + + + + Fired when the Calendar moves to the previous month. + + + + + + Constructor + + + + + + Internal constructor + GLib type for the type + Creates a new instance of Calendar, using the GLib-provided type + + This is a constructor used by derivative types of that would have their own GLib type assigned to it. This is not typically used by C# code. + + + + + + Property + + Gtk.CalendarDisplayOptions + + + + + + Set the display options for this Calendar. + One or more values from , combined using a bit-wise OR. + + This method allows fine control over which parts of the Calendar, such as day names, are displayed. The describe the choices in more detail. + + + + + + Method + + System.DateTime + + + + Get the selected date. + A DateTime object containing the selected day, month and year. + Selected date information can also be retrieved with the method. + + + + \ No newline at end of file