From: Duncan C. <dun...@us...> - 2005-03-13 19:35:12
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30354/gtk/Graphics/UI/Gtk/Display Modified Files: Label.chs ProgressBar.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: ProgressBar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/ProgressBar.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ProgressBar.chs 25 Feb 2005 22:53:41 -0000 1.4 +++ ProgressBar.chs 13 Mar 2005 19:34:32 -0000 1.5 @@ -80,13 +80,19 @@ progressBarGetText, ProgressBarOrientation(..), progressBarSetOrientation, - progressBarGetOrientation + progressBarGetOrientation, + +-- * Properties + progressBarOrientation, + progressBarFraction, + progressBarPulseStep ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString +import System.Glib.Attributes (Attr(..)) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -184,3 +190,36 @@ progressBarGetOrientation pb = liftM (toEnum.fromIntegral) $ {#call unsafe progress_bar_get_orientation#} (toProgressBar pb) +-------------------- +-- Properties + +-- | Orientation and growth direction of the progress bar. +-- +-- Default value: 'ProgressLeftToRight' +-- +progressBarOrientation :: Attr ProgressBar ProgressBarOrientation +progressBarOrientation = Attr + progressBarGetOrientation + progressBarSetOrientation + +-- | The fraction of total work that has been completed. +-- +-- Allowed values: [0,1] +-- +-- Default value: 0 +-- +progressBarFraction :: Attr ProgressBar Double +progressBarFraction = Attr + progressBarGetFraction + progressBarSetFraction + +-- | The fraction of total progress to move the bouncing block when pulsed. +-- +-- Allowed values: [0,1] +-- +-- Default value: 0.1 +-- +progressBarPulseStep :: Attr ProgressBar Double +progressBarPulseStep = Attr + progressBarGetPulseStep + progressBarSetPulseStep Index: Label.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Display/Label.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Label.chs 25 Feb 2005 22:53:41 -0000 1.4 +++ Label.chs 13 Mar 2005 19:34:32 -0000 1.5 @@ -148,14 +148,22 @@ labelGetSelectable, labelSelectRegion, labelGetSelectionBounds, - labelGetLayoutOffsets + labelGetLayoutOffsets, + +-- * Properties + labelUseMarkup, + labelUseUnderline, + labelJustify, + labelSelectable, + labelLineWrap ) where import Monad (liftM) import System.Glib.FFI import System.Glib.UTFString -import System.Glib.GObject (makeNewGObject) +import System.Glib.Attributes (Attr(..)) +import System.Glib.GObject (makeNewGObject) import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#} {#import Graphics.UI.Gtk.Signals#} @@ -375,3 +383,52 @@ labelSetTextWithMnemonic l str = withUTFString str $ {#call label_set_text_with_mnemonic#} (toLabel l) + +-------------------- +-- Properties + +-- | The text of the label includes XML markup. See pango_parse_markup(). +-- +-- Default value: @False@ +-- +labelUseMarkup :: Attr Label Bool +labelUseMarkup = Attr + labelGetUseMarkup + labelSetUseMarkup + +-- | If set, an underline in the text indicates the next character should be +-- used for the mnemonic accelerator key. +-- +-- Default value: @False@ +-- +labelUseUnderline :: Attr Label Bool +labelUseUnderline = Attr + labelGetUseUnderline + labelSetUseUnderline + +-- | The alignment of the lines in the text of the label relative to each +-- other. This does NOT affect the alignment of the label within its +-- allocation. See 'Misc'::xalign for that. +-- +-- Default value: 'JustifyLeft' +-- +labelJustify :: Attr Label Justification +labelJustify = Attr + labelGetJustify + labelSetJustify + +-- | Whether the label text can be selected with the mouse. +-- +-- Default value: @False@ +-- +labelSelectable :: Attr Label Bool +labelSelectable = Attr + labelGetSelectable + labelSetSelectable + +-- | \'lineWrap\' property. See 'labelGetLineWrap' and 'labelSetLineWrap' +-- +labelLineWrap :: Attr Label Bool +labelLineWrap = Attr + labelGetLineWrap + labelSetLineWrap |