From: Duncan C. <dun...@us...> - 2005-03-13 19:35:14
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Entry Modified Files: Editable.chs.pp Entry.chs.pp EntryCompletion.chs.pp SpinButton.chs Log Message: Add properties. For the first round, just the easy properties that are implemented in terms of existing getter/setter functions and where there are no issues with NULL/Maybe types. Add Attributes file to glib package and modify Makefile.am accordingly. Index: SpinButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/SpinButton.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SpinButton.chs 25 Feb 2005 22:53:42 -0000 1.4 +++ SpinButton.chs 13 Mar 2005 19:34:33 -0000 1.5 @@ -84,6 +84,15 @@ spinButtonGetSnapToTicks, spinButtonUpdate, +-- * Properties + spinButtonAdjustment, + spinButtonDigits, + spinButtonSnapToTicks, + spinButtonNumeric, + spinButtonWrap, + spinButtonUpdatePolicy, + spinButtonValue, + -- * Signals onInput, afterInput, @@ -96,6 +105,7 @@ import Monad (liftM) import System.Glib.FFI +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -293,6 +303,74 @@ spinButtonUpdate sb = {#call spin_button_update#} (toSpinButton sb) -------------------- +-- Properties + +-- | The adjustment that holds the value of the spinbutton. +-- +spinButtonAdjustment :: Attr SpinButton Adjustment +spinButtonAdjustment = Attr + spinButtonGetAdjustment + spinButtonSetAdjustment + +-- | The number of decimal places to display. +-- +-- Allowed values: \<= 20 +-- +-- Default value: 0 +-- +spinButtonDigits :: Attr SpinButton Int +spinButtonDigits = Attr + spinButtonGetDigits + spinButtonSetDigits + +-- | Whether erroneous values are automatically changed to a spin button's +-- nearest step increment. +-- +-- Default value: @False@ +-- +spinButtonSnapToTicks :: Attr SpinButton Bool +spinButtonSnapToTicks = Attr + spinButtonGetSnapToTicks + spinButtonSetSnapToTicks + +-- | Whether non-numeric characters should be ignored. +-- +-- Default value: @False@ +-- +spinButtonNumeric :: Attr SpinButton Bool +spinButtonNumeric = Attr + spinButtonGetNumeric + spinButtonSetNumeric + +-- | Whether a spin button should wrap upon reaching its limits. +-- +-- Default value: @False@ +-- +spinButtonWrap :: Attr SpinButton Bool +spinButtonWrap = Attr + spinButtonGetWrap + spinButtonSetWrap + +-- | Whether the spin button should update always, or only when the value is +-- legal. +-- +-- Default value: 'UpdateAlways' +-- +spinButtonUpdatePolicy :: Attr SpinButton SpinButtonUpdatePolicy +spinButtonUpdatePolicy = Attr + spinButtonGetUpdatePolicy + spinButtonSetUpdatePolicy + +-- | Reads the current value, or sets a new value. +-- +-- Default value: 0 +-- +spinButtonValue :: Attr SpinButton Double +spinButtonValue = Attr + spinButtonGetValue + spinButtonSetValue + +-------------------- -- Signals -- | Install a custom input handler. Index: Entry.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/Entry.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Entry.chs.pp 25 Feb 2005 22:53:42 -0000 1.4 +++ Entry.chs.pp 13 Mar 2005 19:34:33 -0000 1.5 @@ -82,6 +82,17 @@ entryGetCompletion, #endif +-- * Properties + entryMaxLength, + entryVisibility, + entryHasFrame, + entryInvisibleChar, + entryActivatesDefault, + entryWidthChars, + entryText, + entryAlignment, + entryCompletion, + -- * Signals onEntryActivate, afterEntryActivate, @@ -102,8 +113,9 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) +import System.Glib.GObject (makeNewGObject) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) -import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -274,6 +286,93 @@ #endif -------------------- +-- Properties + +-- | Maximum number of characters for this entry. Zero if no maximum. +-- +-- Allowed values: [0,65535] +-- +-- Default value: 0 +-- +entryMaxLength :: Attr Entry Int +entryMaxLength = Attr + entryGetMaxLength + entrySetMaxLength + +-- | @False@ displays the \"invisible char\" instead of the actual text +-- (password mode). +-- +-- Default value: @True@ +-- +entryVisibility :: Attr Entry Bool +entryVisibility = Attr + entryGetVisibility + entrySetVisibility + +-- | @False@ removes outside bevel from entry. +-- +-- Default value: @True@ +-- +entryHasFrame :: Attr Entry Bool +entryHasFrame = Attr + entryGetHasFrame + entrySetHasFrame + +-- | The character to use when masking entry contents (in \"password mode\"). +-- +-- Default value: \'*\' +-- +entryInvisibleChar :: Attr Entry Char +entryInvisibleChar = Attr + entryGetInvisibleChar + entrySetInvisibleChar + +-- | Whether to activate the default widget (such as the default button in a +-- dialog) when Enter is pressed. +-- +-- Default value: @False@ +-- +entryActivatesDefault :: Attr Entry Bool +entryActivatesDefault = Attr + entryGetActivatesDefault + entrySetActivatesDefault + +-- | Number of characters to leave space for in the entry. +-- +-- Allowed values: >= -1 +-- +-- Default value: -1 +-- +entryWidthChars :: Attr Entry Int +entryWidthChars = Attr + entryGetWidthChars + entrySetWidthChars + +-- | The contents of the entry. +-- +-- Default value: \"\" +-- +entryText :: Attr Entry String +entryText = Attr + entryGetText + entrySetText + +-- | \'alignment\' property. See 'entryGetAlignment' and 'entrySetAlignment' +-- +entryAlignment :: Attr Entry Float +entryAlignment = Attr + entryGetAlignment + entrySetAlignment + +-- | \'completion\' property. See 'entryGetCompletion' and +-- 'entrySetCompletion' +-- +entryCompletion :: Attr Entry EntryCompletion +entryCompletion = Attr + entryGetCompletion + entrySetCompletion + +-------------------- -- Signals -- | Emitted when the user presses return within Index: Editable.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/Editable.chs.pp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Editable.chs.pp 25 Feb 2005 22:53:42 -0000 1.4 +++ Editable.chs.pp 13 Mar 2005 19:34:33 -0000 1.5 @@ -73,6 +73,10 @@ editableSetPosition, editableGetPosition, +-- * Properties + editablePosition, + editableEditable, + -- * Signals onEditableChanged, afterEditableChanged, @@ -84,6 +88,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) import System.Glib.GObject (makeNewGObject) {#import Graphics.UI.Gtk.Types#} @@ -201,7 +206,25 @@ editableGetEditable :: EditableClass ed => ed -> IO Bool editableGetEditable ed = liftM toBool $ {#call editable_get_editable#} (toEditable ed) - + +-------------------- +-- Properties + +-- | \'position\' property. See 'editableGetPosition' and +-- 'editableSetPosition' +-- +editablePosition :: Attr Editable Int +editablePosition = Attr + editableGetPosition + editableSetPosition + +-- | \'editable\' property. See 'editableGetEditable' and +-- 'editableSetEditable' +-- +editableEditable :: Attr Editable Bool +editableEditable = Attr + editableGetEditable + editableSetEditable -------------------- -- Signals Index: EntryCompletion.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Entry/EntryCompletion.chs.pp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- EntryCompletion.chs.pp 27 Feb 2005 19:42:06 -0000 1.5 +++ EntryCompletion.chs.pp 13 Mar 2005 19:34:33 -0000 1.6 @@ -69,6 +69,7 @@ -- * Types EntryCompletion, EntryCompletionClass, + castToEntryCompletion, -- * Constructors entryCompletionNew, @@ -84,8 +85,11 @@ entryCompletionInsertActionText, entryCompletionInsertActionMarkup, entryCompletionDeleteAction, - entryCompletionSetTextColumn + entryCompletionSetTextColumn, #endif + +-- * Properties + entryCompletionMinimumKeyLength ) where #if GTK_CHECK_VERSION(2,4,0) @@ -95,6 +99,7 @@ import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import System.Glib.GObject (makeNewGObject, mkFunPtrDestructor) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} @@ -195,4 +200,18 @@ dPtr <- mkFunPtrDestructor hPtr {# call gtk_entry_completion_set_match_func #} ec (castFunPtr hPtr) nullPtr dPtr + +-------------------- +-- Properties + +-- | Minimum length of the search key in order to look up matches. +-- +-- Allowed values: >= -1 +-- +-- Default value: 1 +-- +entryCompletionMinimumKeyLength :: Attr EntryCompletion Int +entryCompletionMinimumKeyLength = Attr + entryCompletionGetMinimumKeyLength + entryCompletionSetMinimumKeyLength #endif |