From 053ce0b0121c3afbdd222653c290224b84da8d99 Mon Sep 17 00:00:00 2001 From: Lee Mallabone Date: Tue, 25 Mar 2003 22:32:50 +0000 Subject: [PATCH] First draft Calendar docs. svn path=/trunk/gtk-sharp/; revision=12832 --- doc/ChangeLog | 4 ++ doc/en/Gtk/Calendar.xml | 149 ++++++++++++++++++++++++++++++---------- 2 files changed, 116 insertions(+), 37 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 5f00eb7f8..44c940354 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2003-03-25 Lee Mallabone + + * en/Gtk/Calendar.xml: First draft docs, still need a little work. + 2003-03-24 Lee Mallabone * en/Gtk/HRuler.xml: diff --git a/doc/en/Gtk/Calendar.xml b/doc/en/Gtk/Calendar.xml index 3116b9603..842377efb 100644 --- a/doc/en/Gtk/Calendar.xml +++ b/doc/en/Gtk/Calendar.xml @@ -1,5 +1,5 @@ - + gtk-sharp 0.0.0.0 @@ -7,8 +7,36 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - To be added - To be added + 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). + + +// Create a calendar with some simple display options +public Calendar CreateCalendar () +{ + Calendar cal = new Calendar (); + cal.DisplayOptions = CalendarDisplayOptions.ShowHeading | + CalendarDisplayOptions.ShowDayNames | + CalendarDisplayOptions.ShowWeekNumbers; + return cal; +} + + + The following example shows a typical event handler or capturing the selected date whenever it changes. + + +// Typical event handler for capturing the selected date +void DaySelected (object obj, EventArgs args) +{ + Calendar activatedCalendar = (Calendar) obj; + Console.WriteLine (activatedCalendar.GetDate ().ToString ("yyyy/MM/dd")); +} + + + Gtk.Widget @@ -39,10 +67,14 @@ - To be added - To be added: an object of type 'uint' - To be added: an object of type 'bool' - To be added + Removes a visual marker from the specified . + A day number from 1 to 31. + + + + + Visual markers are added to the calendar with . + @@ -55,13 +87,15 @@ - To be added - To be added: an object of type 'uint' - To be added: an object of type 'bool' - To be added + Adds a visual marker to the specified . + A day number from 1 to 31. + + + + - + Method @@ -71,9 +105,11 @@ - To be added - To be added: an object of type 'Gtk.CalendarDisplayOptions' - To be added + 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. + @@ -86,9 +122,11 @@ - To be added - To be added: an object of type 'uint' - To be added + 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. + @@ -99,8 +137,10 @@ - To be added - To be added + 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. + @@ -115,11 +155,13 @@ - To be added - To be added: an object of type 'uint&' - To be added: an object of type 'uint&' - To be added: an object of type 'uint&' - To be added + Retrieve 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). + @@ -130,8 +172,10 @@ - To be added - To be added + Removes the effects of calling . + + This draws all graphical updates to the calendar that have happened since a . + @@ -142,8 +186,8 @@ - To be added - To be added + Removes all visual marks that have been added to dates. + @@ -157,11 +201,13 @@ - To be added - To be added: an object of type 'uint' - To be added: an object of type 'uint' - To be added: an object of type 'bool' - To be added + Shifts the calendar to display the specified month. + A zero-based month number. + The year the month is in. + + + + @@ -198,9 +244,9 @@ - To be added - To be added: an object of type 'Gtk.Calendar' - To be added + Creates a new calendar displaying the current month. + A new Calendar. + @@ -301,5 +347,34 @@ + + + Property + + Gtk.CalendarDisplayOptions + + + + + + To be added + To be added: an object of type 'Gtk.CalendarDisplayOptions' + To be added: an object of type 'Gtk.CalendarDisplayOptions' + To be added + + + + + Method + + System.DateTime + + + + To be added + To be added: an object of type 'DateTime' + To be added + + \ No newline at end of file