From d4baf8e789feb025124934122737e155b510a40e Mon Sep 17 00:00:00 2001 From: John Luke Date: Sun, 10 Aug 2003 02:49:38 +0000 Subject: [PATCH] 2003-08-09 John Luke * en/Gtk/Entry.xml: add example svn path=/trunk/gtk-sharp/; revision=17210 --- doc/ChangeLog | 4 + doc/en/Gtk/Entry.xml | 203 ++++++++++++++++++++++++++++++------------- 2 files changed, 146 insertions(+), 61 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0d1d9726a..99325715e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2003-08-09 John Luke + + * en/Gtk/Entry.xml: add example + 2003-08-06 John Luke * en/Gtk/Notebook.xml: add example, see references diff --git a/doc/en/Gtk/Entry.xml b/doc/en/Gtk/Entry.xml index 84529f8f6..994b23cd9 100644 --- a/doc/en/Gtk/Entry.xml +++ b/doc/en/Gtk/Entry.xml @@ -14,6 +14,68 @@ See also the widget for displaying and editing large amounts of text. + + +using System; +using Gtk; +using GtkSharp; + +class EntrySample +{ + Entry entry; + + static void Main () + { + new EntrySample (); + } + + EntrySample () + { + Application.Init (); + + Window win = new Window ("EntrySample"); + win.SetDefaultSize (200, 150); + win.DeleteEvent += new DeleteEventHandler (OnWinDelete); + + VBox vbox = new VBox (false, 1); + win.Add (vbox); + + entry = new Entry ("hello world"); + entry.Editable = true; + entry.Visibility = true; + vbox.Add (entry); + + CheckButton editable = new CheckButton ("Editable"); + editable.Toggled += new EventHandler (OnEditableToggled); + editable.Active = true; + vbox.Add (editable); + + CheckButton visibility = new CheckButton ("Visibility"); + visibility.Toggled += new EventHandler (OnVisibilityToggled); + visibility.Active = true; + vbox.Add (visibility); + + win.ShowAll (); + Application.Run (); + } + + void OnEditableToggled (object obj, EventArgs args) + { + entry.Editable = !entry.Editable; + } + + void OnVisibilityToggled (object obj, EventArgs args) + { + entry.Visibility = !entry.Visibility; + } + + void OnWinDelete (object obj, DeleteEventArgs args) + { + Application.Quit (); + } +} + + Gtk.Widget @@ -50,8 +112,8 @@ See also the widget for displaying and editing lar System.Int32 - - + + Add arbitrary text to the entry. the text to add @@ -70,8 +132,8 @@ See also the widget for displaying and editing lar System.Void - - + + Specific implementation of Gtk.CellEditable.StartEditing for the Entry widget. @@ -109,9 +171,9 @@ See also the widget for displaying and editing lar System.Void - - - + + + Specific implementation of Gtk.Editable.SelectRegion for the Entry widget. @@ -128,9 +190,9 @@ See also the widget for displaying and editing lar - - - + + + Specific implementation of Gtk.Editable.GetChars for the Entry widget. The index of the first character to get, (zero-indexed). @@ -148,9 +210,9 @@ See also the widget for displaying and editing lar System.Void - - - + + + Specific implementation of Gtk.Editable.DeleteText for the Entry widget. @@ -189,9 +251,9 @@ See also the widget for displaying and editing lar System.Boolean - - - + + + Get the the positions of the start and end of the current selection, if there is one. output variable for the character index of the selection start @@ -234,9 +296,9 @@ See also the widget for displaying and editing lar System.Void - - - + + + Obtains the position of the PangoLayout used to render text in the entry, in widget coordinates. X offset output of the layout @@ -264,8 +326,8 @@ See also the widget for displaying and editing lar Constructor - - + + Internal constructor Pointer to the C object. @@ -304,8 +366,7 @@ See also the widget for displaying and editing lar System.Boolean - - + Implements the concrete version of Gtk.Editable.IsEditable, to determine if the text of the Entry can be edited. true to allow editing of the Entry, false otherwise. @@ -321,8 +382,7 @@ See also the widget for displaying and editing lar System.Int32 - - + The position of the cursor. the new cursor position, in characters. @@ -356,8 +416,7 @@ See also the widget for displaying and editing lar System.Boolean - - + Determine whether to display characters entered, or whether to mask them. true to display characters in the Entry, false to mask them @@ -375,8 +434,7 @@ See also the widget for displaying and editing lar System.Int32 - - + The maximum number of characters that can be placed in this Entry. How many characters to limit this Entry to @@ -424,8 +482,7 @@ See also the widget for displaying and editing lar System.String - - + Manipulate the current text contents of an Entry. The new string to display in the Entry - overwrites any existing text in the widget. @@ -453,8 +510,7 @@ See also the widget for displaying and editing lar System.Int32 - - + Changes the size request of the entry to be about the right size for characters. Requested width, in characters @@ -472,8 +528,7 @@ See also the widget for displaying and editing lar System.Boolean - - + Whether or not this Entry is editable. @@ -495,8 +550,7 @@ See also the widget for displaying and editing lar System.Boolean - - + Determine whether to activate the 'default widget' in the window when the return key is pressed. set to to activate the default button when enter is pressed, otherwise @@ -517,8 +571,7 @@ See also the widget for displaying and editing lar System.Boolean - - + Whether or not this Entry should be surrounded by a 3D frame. @@ -533,7 +586,9 @@ See also the widget for displaying and editing lar Event - System.EventHandler + + System.EventHandler + Implements the WidgetRemoved method of the interface. This will effectively destroy the Entry. @@ -543,7 +598,9 @@ See also the widget for displaying and editing lar Event - System.EventHandler + + System.EventHandler + Implements the EditingDone method of the interface. @@ -553,7 +610,9 @@ See also the widget for displaying and editing lar Event - GtkSharp.TextInsertedHandler + + GtkSharp.TextInsertedHandler + Connect to this event to be notified when text is inserted into the Entry. @@ -563,7 +622,9 @@ See also the widget for displaying and editing lar Event - GtkSharp.TextDeletedHandler + + GtkSharp.TextDeletedHandler + Connect to this event to be notified when text is deleted from the Entry. @@ -573,7 +634,9 @@ See also the widget for displaying and editing lar Event - System.EventHandler + + System.EventHandler + When the contents of the Entry change, this event is fired. @@ -583,7 +646,9 @@ See also the widget for displaying and editing lar Event - GtkSharp.MoveCursorHandler + + GtkSharp.MoveCursorHandler + Connect to this event handler to be notified when the cursor of an Entry moves. @@ -593,7 +658,9 @@ See also the widget for displaying and editing lar Event - System.EventHandler + + System.EventHandler + Connect to this event to be notified when the user 'cuts' a selection in the Entry. @@ -603,7 +670,9 @@ See also the widget for displaying and editing lar Event - System.EventHandler + + System.EventHandler + Connect to this event to be notified when the user hits 'return'. @@ -615,7 +684,9 @@ See also the widget for displaying and editing lar Event - GtkSharp.DeleteFromCursorHandler + + GtkSharp.DeleteFromCursorHandler + Connect to this event to find out when text is deleted from the Entry by the user. @@ -627,7 +698,9 @@ See also the widget for displaying and editing lar Event - System.EventHandler + + System.EventHandler + Connect to this event to be notified when the clipboard contents are pasted into this Entry. @@ -639,7 +712,9 @@ See also the widget for displaying and editing lar Event - System.EventHandler + + System.EventHandler + Connect to this event to be notified when the contents of the Entry are copied to the clipboard. @@ -651,7 +726,9 @@ See also the widget for displaying and editing lar Event - GtkSharp.PopulatePopupHandler + + GtkSharp.PopulatePopupHandler + To be added @@ -663,7 +740,9 @@ See also the widget for displaying and editing lar Event - System.EventHandler + + System.EventHandler + Connect to this event to discover when the Overwrite state has been changed by the user. This is usually done by pressing the 'Insert' key on a keyboard. @@ -675,7 +754,9 @@ See also the widget for displaying and editing lar Event - GtkSharp.InsertAtCursorHandler + + GtkSharp.InsertAtCursorHandler + Connect to this event to discover when text is inserted at the cursor position - usually when the user types something in. @@ -691,9 +772,9 @@ See also the widget for displaying and editing lar System.Void - - - + + + To be added To be added: an object of type 'string' @@ -706,8 +787,8 @@ See also the widget for displaying and editing lar Constructor - - + + Internal constructor GLib type for the type @@ -722,8 +803,8 @@ See also the widget for displaying and editing lar Constructor - - + + To be added To be added: an object of type 'string' @@ -732,4 +813,4 @@ See also the widget for displaying and editing lar - + \ No newline at end of file