diff --git a/doc/ChangeLog b/doc/ChangeLog index 89e2719f1..adc267034 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,7 @@ 2003-07-27 John Luke * en/Gtk/CheckButton.xml: add small example, update + * en/Gtk/Combo.xml: add example, update * en/Gtk/TreeModelFlags.xml: * en/Gtk/RcFlags.xml: more documentation from diff --git a/doc/en/Gtk/Combo.xml b/doc/en/Gtk/Combo.xml index 8f3226020..f02d99b61 100644 --- a/doc/en/Gtk/Combo.xml +++ b/doc/en/Gtk/Combo.xml @@ -1,5 +1,5 @@ - + gtk-sharp 0.0.0.0 @@ -10,36 +10,77 @@ A text entry field with a dropdown list - The GtkCombo widget consists of a single-line text entry field and a + The widget consists of a single-line text entry field and a drop-down list. The drop-down list is displayed when the user clicks on a small arrow button to the right of the entry field. - The drop-down list is a GtkList widget and can be accessed using the - list member of the GtkCombo. List elements can contain arbitrary + The drop-down list is a widget and can be accessed using the + list member of the . List elements can contain arbitrary widgets, but if an element is not a plain label, then you must use - the gtk_list_set_item_string() function. This sets the string which + the function. This sets the string which will be placed in the text entry field when the item is selected. By default, the user can step through the items in the list using the arrow (cursor) keys, though this behaviour can be turned off with - gtk_combo_set_use_arrows(). + = . - Creating a GtkCombo widget with simple text items: + Creating a widget with simple text items: - Gtk.Combo MakeCombo () { - GLib.List l = new GLib.List (IntPtr.Zero, typeof(string)); - l.Append(Marshal.StringToHGlobalAnsi("String 1")); - l.Append(Marshal.StringToHGlobalAnsi("String 2")); - Gtk.Combo combo = new Gtk.Combo - (new GLib.Type((uint)TypeFundamentals.TypeString)); - combo.PopdownStrings = l; - return combo; - } +using System; +using System.Runtime.InteropServices; +using Gtk; +using GtkSharp; +using GLib; + +class ComboSample +{ + Combo combo; + + static void Main () + { + new ComboSample (); + } + + ComboSample () + { + Application.Init (); + + Window win = new Window ("ComboSample"); + win.DeleteEvent += new DeleteEventHandler (OnWinDelete); + + GLib.List l = new GLib.List (IntPtr.Zero, typeof (string)); + + for (int i =0; i < 5; i++) + { + l.Append (Marshal.StringToHGlobalAnsi("String " + i)); + } + + combo = new Combo (); + combo.PopdownStrings = l; + combo.DisableActivate (); + combo.Entry.Activated += new EventHandler (OnEntryActivated); + + win.Add (combo); + + win.ShowAll (); + Application.Run (); + } + + void OnEntryActivated (object o, EventArgs args) + { + Console.WriteLine (combo.Entry.Text); + } + + void OnWinDelete (object obj, DeleteEventArgs args) + { + Application.Quit (); + } +} See for more about GLib.List. @@ -73,11 +114,11 @@ System.Void - - + + Convenience function to set all of the items in the popup list. - To be added: an object of type 'string []' + an object of type [] To be added @@ -88,14 +129,14 @@ System.Void - - - + + + - Sets the string to place in the Gtk.Entry field when a particular list item is selected. This is needed if the list item is not a simple label. - To be added: an object of type 'Gtk.Item' - To be added: an object of type 'string' - To be added + Sets the string to place in the field when a particular list item is selected. + an object of type + an object of type + This is not needed if the list item is a simple . @@ -106,8 +147,9 @@ - Stops the Gtk.Combo widget from showing the popup list when the Gtk.Entry emits the "activate" signal, i.e. when the Return key is pressed. This may be useful if, for example, you want the Return key to close a dialog instead. - To be added + Disables showing the popup list on the activate event. + Stops the widget from showing the popup list when the emits the event, i.e. when the Return key is pressed. + This may be useful if, for example, you want the Return key to close a dialog instead. @@ -127,12 +169,12 @@ Constructor - - + + Internal constructor Pointer to the C object. - An instance of Combo, wrapping the C object. + An instance of , wrapping the C object. This is an internal constructor, and should not be used by user code. @@ -144,9 +186,9 @@ - Creates a new Combo. - To be added: an object of type 'Gtk.Combo' - To be added + Creates a new . + an object of type + This is the default contructor for @@ -156,8 +198,8 @@ System.UInt32 - The GLib Type for Gtk.Combo - The GLib Type for the Gtk.Combo class. + The for + The for the class. @@ -168,9 +210,9 @@ Gtk.Button - The Button asociated with the Combo. - To be added: an object of type 'Gtk.Button' - To be added + The asociated with the . + an object of type + @@ -180,9 +222,9 @@ Gtk.Entry - The Entry asociated with the Combo. - To be added: an object of type 'Gtk.Entry' - To be added + The asociated with the . + an object of type + @@ -191,13 +233,12 @@ GLib.List - - + Property to set all of the items in the popup list. - To be added: an object of type 'GLib.List' - To be added: an object of type 'GLib.List' - To be added + an object of type + an object of type + @@ -206,8 +247,7 @@ System.Boolean - - + Does nothing. ---- To get out ---- To be added: an object of type 'bool' @@ -221,12 +261,12 @@ System.Boolean - - + Specifies if the arrow (cursor) keys can be used to step through the items in the list. - To be added: an object of type 'bool' - TRUE if the arrow keys can be used to step through the items in the list. + an object of type + + if the arrow keys can be used to step through the items in the list. This is on by default. @@ -236,8 +276,7 @@ System.Boolean - - + To be added To be added: an object of type 'bool' @@ -251,13 +290,14 @@ System.Boolean - - + - Specifies whether the value entered in the text entry field must match one of the values in the list. If this is set then the user will not be able to perform any other action until a valid value has been entered. - TRUE if the value entered must match one of the values in the list. - TRUE if the value entered must match one of the values in the list. - To be added + Specifies whether the value entered in the text entry field must match one of the values in the list. + + if the value entered must match one of the values in the list. + + if the value entered must match one of the values in the list. + If this is set then the user will not be able to perform any other action until a valid value has been entered. @@ -266,12 +306,13 @@ System.Boolean - - + Specifies if an empty field is acceptable. - TRUE if an empty value is considered valid. - TRUE if an empty value is considered valid. + + if an empty value is considered valid. + + if an empty value is considered valid. To be added @@ -281,13 +322,14 @@ System.Boolean - - + - Specifies if the arrow (cursor) keys can be used to step through the items in the list. This is true by default. - TRUE if the arrow keys can be used to step through the items in the list. - TRUE if the arrow keys can be used to step through the items in the list. - To be added + Specifies if the arrow (cursor) keys can be used to step through the items in the list. + + if the arrow keys can be used to step through the items in the list. + + if the arrow keys can be used to step through the items in the list. + This is by default. @@ -296,12 +338,13 @@ System.Boolean - - + - Specifies whether the text entered into the Entry field and the text in the list items is case sensitive. - TRUE if the text in the list items is case sensitive. - TRUE if the text in the list items is case sensitive. + Specifies whether the text entered into the field and the text in the list items is case sensitive. + + if the text in the list items is case sensitive. + + if the text in the list items is case sensitive. This may be useful, for example, when you have set true ValueInList to limit the values entered, but you are not worried about differences in case. @@ -310,8 +353,8 @@ Constructor - - + + Internal constructor GLib type for the type @@ -322,4 +365,4 @@ - + \ No newline at end of file