From: Duncan C. <dun...@us...> - 2005-02-25 01:12:14
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24163/gtk/Graphics/UI/Gtk/Entry Modified Files: Editable.chs.pp Entry.chs.pp EntryCompletion.chs.pp HScale.chs SpinButton.chs VScale.chs Log Message: Add more module level documentation and tidy up exiting documentation. Also add/modify section headers. Also LGPL'ify remaining modules with permission from Matthew Walton. Index: SpinButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/SpinButton.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SpinButton.chs 12 Feb 2005 17:19:22 -0000 1.2 +++ SpinButton.chs 25 Feb 2005 01:11:33 -0000 1.3 @@ -28,11 +28,37 @@ -- the keyboard. -- module Graphics.UI.Gtk.Entry.SpinButton ( +-- * Description +-- +-- | A 'SpinButton' is an ideal way to allow the user to set the value of some +-- attribute. Rather than having to directly type a number into a 'Entry', +-- 'SpinButton' allows the user to click on one of two arrows to increment or +-- decrement the displayed value. A value can still be typed in, with the bonus +-- that it can be checked to ensure it is in a given range. +-- +-- The main properties of a 'SpinButton' are through a 'Adjustment'. See the +-- 'Adjustment' section for more details about an adjustment's properties. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Entry' +-- | +----SpinButton +-- @ + +-- * Types SpinButton, SpinButtonClass, castToSpinButton, + +-- * Constructors spinButtonNew, spinButtonNewWithRange, + +-- * Methods spinButtonConfigure, spinButtonSetAdjustment, spinButtonGetAdjustment, @@ -57,6 +83,8 @@ spinButtonSetSnapToTicks, spinButtonGetSnapToTicks, spinButtonUpdate, + +-- * Signals onInput, afterInput, onOutput, @@ -79,7 +107,8 @@ -- GtkSpinbutton implements the GtkEditable interface instance EditableClass SpinButton --- methods +-------------------- +-- Constructors -- | Create a new SpinButton. -- @@ -105,6 +134,9 @@ liftM castPtr $ {#call unsafe spin_button_new_with_range#} (realToFrac min) (realToFrac max) (realToFrac step) +-------------------- +-- Methods + -- | Change the settings of a SpinButton. -- spinButtonConfigure :: SpinButtonClass sb => sb -> Adjustment -> Double -> @@ -258,7 +290,8 @@ spinButtonUpdate :: SpinButtonClass sb => sb -> IO () spinButtonUpdate sb = {#call spin_button_update#} (toSpinButton sb) --- signals +-------------------- +-- Signals -- | Install a custom input handler. -- Index: Editable.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/Editable.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Editable.chs.pp 12 Feb 2005 17:19:22 -0000 1.2 +++ Editable.chs.pp 25 Feb 2005 01:11:33 -0000 1.3 @@ -19,26 +19,46 @@ -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- +-- TODO +-- +-- Find out if \"insert-text\" signal is useful and how to bind it. It is +-- tricky because it has an in-out parameter. +-- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- --- * This is an interface for simple single-line text editing widgets. It is --- implemented by "Entry" and "SpinButton". --- --- * TODO --- --- * Find out if \"insert-text\" signal is useful and how to bind it. It is --- tricky because it has an in-out parameter. +-- This is an interface for simple single-line text editing widgets. It is +-- implemented by "Entry" and "SpinButton". -- module Graphics.UI.Gtk.Entry.Editable ( - -- * Data types +-- * Description +-- +-- | The 'Editable' interface is an interface which should be implemented by +-- text editing widgets, such as 'Entry'. +-- It contains functions for generically manipulating an editable +-- widget, a large number of action signals used for key bindings, and several +-- signals that an application can connect to to modify the behavior of a +-- widget. +-- +-- As an example of the latter usage, by connecting the following handler to +-- \"insert_text\", an application can convert all entry into a widget into +-- uppercase. + +-- * Class Hierarchy +-- | +-- @ +-- | GInterface +-- | +----Editable +-- @ + +-- * Types Editable, EditableClass, castToEditable, - -- * Methods +-- * Methods editableSelectRegion, editableGetSelectionBounds, editableInsertText, @@ -52,8 +72,8 @@ editableGetEditable, editableSetPosition, editableGetPosition, - - -- * Signals + +-- * Signals onEditableChanged, afterEditableChanged, onDeleteText, @@ -71,6 +91,9 @@ {# context lib="gtk" prefix="gtk" #} +-------------------- +-- Methods + -- | Select a span of text. -- -- * A negative @end@ position will make the selection extend to the @@ -180,7 +203,8 @@ liftM toBool $ {#call editable_get_editable#} (toEditable ed) --- signals +-------------------- +-- Signals -- | Emitted when the settings of the 'Editable' widget changes. -- Index: HScale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/HScale.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- HScale.chs 12 Feb 2005 17:19:22 -0000 1.2 +++ HScale.chs 25 Feb 2005 01:11:33 -0000 1.3 @@ -27,9 +27,31 @@ -- A horizontal slider widget for selecting a value from a range. -- module Graphics.UI.Gtk.Entry.HScale ( +-- * Description +-- +-- | The 'HScale' widget is used to allow the user to select a value using a +-- horizontal slider. To create one, use 'hScaleNewWithRange'. +-- +-- The position to show the current value, and the number of decimal places +-- shown can be set using the parent 'Scale' class's functions. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Range' +-- | +----'Scale' +-- | +----HScale +-- @ + +-- * Types HScale, HScaleClass, castToHScale, + +-- * Constructors hScaleNew, hScaleNewWithRange ) where @@ -43,7 +65,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new HScale widget. -- Index: Entry.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/Entry.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Entry.chs.pp 12 Feb 2005 17:19:22 -0000 1.2 +++ Entry.chs.pp 25 Feb 2005 01:11:33 -0000 1.3 @@ -19,23 +19,45 @@ -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- +-- TODO +-- +-- A couple of signals are not bound because I could not figure out what +-- they mean. Some of them do not seem to be emitted at all. +-- -- | -- Maintainer : gtk...@li... -- Stability : provisional -- Portability : portable (depends on GHC) -- --- * This widget lets the user enter a single line of text. --- --- * TODO --- --- * A couple of signals are not bound because I could not figure out what --- they mean. Some of them do not seem to be emitted at all. +-- A single line text entry field. -- module Graphics.UI.Gtk.Entry.Entry ( +-- * Description +-- +-- | The 'Entry' widget is a single line text entry widget. A fairly large set +-- of key bindings are supported by default. If the entered text is longer than +-- the allocation of the widget, the widget will scroll so that the cursor +-- position is visible. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----Entry +-- | +----'SpinButton' +-- @ + +-- * Types Entry, EntryClass, castToEntry, + +-- * Constructors entryNew, + +-- * Methods entrySetText, entryGetText, #ifndef DISABLE_DEPRECATED @@ -59,6 +81,8 @@ entrySetCompletion, entryGetCompletion, #endif + +-- * Signals onEntryActivate, afterEntryActivate, onCopyClipboard, @@ -88,13 +112,17 @@ -- GtkEntry implements the GtkEditable interface instance EditableClass Entry --- methods +-------------------- +-- Constructors -- | Create a new 'Entry' widget. -- entryNew :: IO Entry entryNew = makeNewObject mkEntry $ liftM castPtr $ {#call unsafe entry_new#} +-------------------- +-- Methods + -- | Set the text of the 'Entry' widget. -- entrySetText :: EntryClass ec => ec -> String -> IO () @@ -243,8 +271,8 @@ {#call gtk_entry_get_completion#} (toEntry ec) #endif - --- signals +-------------------- +-- Signals -- | Emitted when the user presses return within -- the 'Entry' field. Index: VScale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/VScale.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- VScale.chs 12 Feb 2005 17:19:22 -0000 1.2 +++ VScale.chs 25 Feb 2005 01:11:33 -0000 1.3 @@ -27,9 +27,31 @@ -- A vertical slider widget for selecting a value from a range. -- module Graphics.UI.Gtk.Entry.VScale ( +-- * Description +-- +-- | The 'VScale' widget is used to allow the user to select a value using a +-- vertical slider. To create one, use 'hScaleNewWithRange'. +-- +-- The position to show the current value, and the number of decimal places +-- shown can be set using the parent 'Scale' class's functions. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Range' +-- | +----'Scale' +-- | +----VScale +-- @ + +-- * Types VScale, VScaleClass, castToVScale, + +-- * Constructors vScaleNew, vScaleNewWithRange ) where @@ -43,7 +65,8 @@ {# context lib="gtk" prefix="gtk" #} --- methods +-------------------- +-- Constructors -- | Create a new VScale widget. -- Index: EntryCompletion.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/EntryCompletion.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- EntryCompletion.chs.pp 12 Feb 2005 17:19:22 -0000 1.2 +++ EntryCompletion.chs.pp 25 Feb 2005 01:11:33 -0000 1.3 @@ -29,10 +29,51 @@ -- * Added in GTK+ 2.4 -- module Graphics.UI.Gtk.Entry.EntryCompletion ( +-- * Description +-- +-- | 'EntryCompletion' is an auxiliary object to be used in conjunction with +-- 'Entry' to provide the completion functionality. It implements the +-- 'CellLayout' interface, to allow the user to add extra cells to the +-- 'TreeView' with completion matches. +-- +-- \"Completion functionality\" means that when the user modifies the text +-- in the entry, 'EntryCompletion' checks which rows in the model match the +-- current content of the entry, and displays a list of matches. By default, +-- the matching is done by comparing the entry text case-insensitively against +-- the text column of the model (see 'entryCompletionSetTextColumn'), but this +-- can be overridden with a custom match function (see +-- 'entryCompletionSetMatchFunc'). +-- +-- When the user selects a completion, the content of the entry is updated. +-- By default, the content of the entry is replaced by the text column of the +-- model, but this can be overridden by connecting to the ::match-selected +-- signal and updating the entry in the signal handler. Note that you should +-- return @True@ from the signal handler to suppress the default behaviour. +-- +-- To add completion functionality to an entry, use 'entrySetCompletion'. +-- +-- In addition to regular completion matches, which will be inserted into +-- the entry when they are selected, 'EntryCompletion' also allows to display +-- \"actions\" in the popup window. Their appearance is similar to menuitems, +-- to differentiate them clearly from completion strings. When an action is +-- selected, the ::action-activated signal is emitted. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----EntryCompletion +-- @ + #if GTK_CHECK_VERSION(2,4,0) +-- * Types EntryCompletion, EntryCompletionClass, + +-- * Constructors entryCompletionNew, + +-- * Methods entryCompletionGetEntry, entryCompletionSetModel, entryCompletionGetModel, @@ -62,11 +103,17 @@ {# context lib="gtk" prefix="gtk" #} +-------------------- +-- Constructors + entryCompletionNew :: IO EntryCompletion entryCompletionNew = makeNewGObject mkEntryCompletion $ liftM castPtr $ {# call gtk_entry_completion_new #} +-------------------- +-- Methods + entryCompletionGetEntry :: EntryCompletion -> IO (Maybe Entry) entryCompletionGetEntry ec = do entryPtr <- {# call gtk_entry_completion_get_entry #} ec |