2003-03-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* api/gtk-api.xml: changed DisplayOptions by SetDisplayOptions.
	* sources/Gtk.metadata: added rename hint for DisplayOptions. Moved
	GtkHTMLStream hints to 'misc' area (they were in 'rename' area).

	* gtk/Calendar.custom: added a .net style GetDate override.
	* sample/CalendarApp.cs: updated to new methods in the Calendar API.

svn path=/trunk/gtk-sharp/; revision=12799
This commit is contained in:
Gonzalo Paniagua Javier 2003-03-25 00:47:13 +00:00
parent 582723b68b
commit 7ab055de16
5 changed files with 59 additions and 25 deletions

View file

@ -1,3 +1,12 @@
2003-03-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* api/gtk-api.xml: changed DisplayOptions by SetDisplayOptions.
* sources/Gtk.metadata: added rename hint for DisplayOptions. Moved
GtkHTMLStream hints to 'misc' area (they were in 'rename' area).
* gtk/Calendar.custom: added a .net style GetDate override.
* sample/CalendarApp.cs: updated to new methods in the Calendar API.
2003-03-23 Martin Baulig <martin@ximian.com>
* glib/Object.cs (Dispose): Call `Objects.Remove (_obj)' here

View file

@ -1816,7 +1816,7 @@
<method name="ClearMarks" cname="gtk_calendar_clear_marks">
<return-type type="void"/>
</method>
<method name="DisplayOptions" cname="gtk_calendar_display_options">
<method name="SetDisplayOptions" cname="gtk_calendar_display_options">
<return-type type="void"/>
<parameters>
<parameter type="GtkCalendarDisplayOptions" name="flags"/>

16
gtk/Calendar.custom Normal file
View file

@ -0,0 +1,16 @@
// Gtk.Calendar.Custom - Gtk Calendar class customizations
//
// Author:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (c) 2003 Ximian, Inc. (http://www.ximian.com)
//
// This code is inserted after the automatically generated code.
public DateTime GetDate ()
{
uint year, month, day;
GetDate (out year, out month, out day);
return new DateTime ((int) year, (int) month + 1, (int) day);
}

View file

@ -16,7 +16,9 @@ namespace GtkSamples {
public static Calendar CreateCalendar ()
{
Calendar cal = new Calendar();
cal.DisplayOptions (CalendarDisplayOptions.ShowHeading | CalendarDisplayOptions.ShowDayNames | CalendarDisplayOptions.ShowWeekNumbers);
cal.DisplayOptions = CalendarDisplayOptions.ShowHeading |
CalendarDisplayOptions.ShowDayNames |
CalendarDisplayOptions.ShowWeekNumbers;
return cal;
}
@ -37,11 +39,7 @@ namespace GtkSamples {
static void DaySelected (object obj, EventArgs args)
{
Calendar activatedCalendar = (Calendar) obj;
uint year, month, day;
activatedCalendar.GetDate(out year, out month, out day);
// The month is zero-based, so tweak it before output
Console.WriteLine ("Selected date: {0}/{1}/{2}",
year, month+1, day);
Console.WriteLine (activatedCalendar.GetDate ().ToString ("yyyy/MM/dd"));
}
static void Window_Delete (object obj, DeleteEventArgs args)

View file

@ -317,6 +317,30 @@
</attribute>
</data>
</rule>
<rule>
<class name="GtkHTMLStream">
<method>Write</method>
</class>
<data>
<attribute target="param">
<filter level="name">buffer</filter>
<name>type</name>
<value>const-guchar*</value>
</attribute>
</data>
</rule>
<rule>
<class name="GtkHTMLStream">
<method>Write</method>
</class>
<data>
<attribute target="param">
<filter level="name">buffer</filter>
<name>array</name>
<value>1</value>
</attribute>
</data>
</rule>
<!-- constructor collision hints -->
@ -1425,26 +1449,13 @@
</data>
</rule>
<rule>
<class name="GtkHTMLStream">
<method>Write</method>
<class name="GtkCalendar">
<method>DisplayOptions</method>
</class>
<data>
<attribute target="param">
<filter level="name">buffer</filter>
<name>type</name>
<value>const-guchar*</value>
</attribute>
</data>
</rule>
<rule>
<class name="GtkHTMLStream">
<method>Write</method>
</class>
<data>
<attribute target="param">
<filter level="name">buffer</filter>
<name>array</name>
<value>1</value>
<attribute target="method">
<name>name</name>
<value>SetDisplayOptions</value>
</attribute>
</data>
</rule>