From: <kr_...@us...> - 2003-11-15 10:34:17
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv1675/src/Graphics/UI/GIO Modified Files: Attributes.hs Menu.hs Process.hs Window.hs Added Files: StatusBar.hs Log Message: Extended StatusBar API. Added support for tooltips for menu items --- NEW FILE: StatusBar.hs --- ----------------------------------------------------------------------------------------- {-| Module : StatusBar Copyright : (c) Krasimir Angelov 2003 License : BSD-style Maintainer : ka2...@ya... Stability : provisional Portability : portable Defines an API for status bar creation. A status bar is a horizontal band at the bottom of an application window in which the application can display various kinds of status information. -} ----------------------------------------------------------------------------------------- module Graphics.UI.GIO.StatusBar ( StatusBar, sb , pushStatusBarContext, popStatusBarContext, withStatus ) where import qualified Graphics.UI.Port as Lib import Graphics.UI.GIO.Types import Graphics.UI.GIO.Attributes data StatusBar = StatusBar sb :: StatusBar sb = StatusBar instance Visible StatusBar where visible = newAttr (\sb -> Lib.getStatusBarVisible) (\sb -> Lib.setStatusBarVisible) instance Titled StatusBar where title = newAttr (\sb -> Lib.getStatusBarTitle) (\sb -> Lib.setStatusBarTitle) pushStatusBarContext :: StatusBar -> IO () pushStatusBarContext sb = Lib.pushStatusBarContext popStatusBarContext :: StatusBar -> IO () popStatusBarContext sb = Lib.popStatusBarContext withStatus :: StatusBar -> String -> IO a -> IO a withStatus sb txt action = do pushStatusBarContext sb set sb [title =: txt] r <- action popStatusBarContext sb return r Index: Attributes.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Attributes.hs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Attributes.hs 31 Aug 2003 12:56:25 -0000 1.18 --- Attributes.hs 15 Nov 2003 10:34:14 -0000 1.19 *************** *** 80,83 **** --- 80,86 ---- -- ** Positioned , Positioned, pos + + -- ** Visible + , Visible, visible -- ** Selection *************** *** 299,302 **** --- 302,309 ---- -- | The widget position pos :: Attr w Int + + -- | Widgets that can be visible/invisible. + class Visible w where + visible :: Attr w Bool -- | Widgets that can be checked. Index: Menu.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Menu.hs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Menu.hs 31 Aug 2003 12:56:25 -0000 1.15 --- Menu.hs 15 Nov 2003 10:34:14 -0000 1.16 *************** *** 144,147 **** --- 144,150 ---- instance HasIcon MenuItem where icon = newStdAttr hitem Lib.getMenuItemBitmap Lib.setMenuItemBitmap + + instance ToolTip MenuItem where + tooltip = newStdAttr hitem Lib.getMenuTip Lib.setMenuTip instance Positioned MenuItem where *************** *** 204,207 **** --- 207,213 ---- instance Accelerated MenuRadioItem where accel = newStdAttr hradioitem Lib.getMenuItemAccel Lib.setMenuItemAccel + + instance ToolTip MenuRadioItem where + tooltip = newStdAttr hradioitem Lib.getMenuTip Lib.setMenuTip -- | The 'setMenuRadioGroup' function specifies a set of mutually exclusive options. *************** *** 249,252 **** --- 255,261 ---- instance Accelerated MenuCheck where accel = newStdAttr hcheck Lib.getMenuItemAccel Lib.setMenuItemAccel + + instance ToolTip MenuCheck where + tooltip = newStdAttr hcheck Lib.getMenuTip Lib.setMenuTip instance Positioned MenuCheck where Index: Process.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Process.hs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Process.hs 14 Nov 2003 22:36:28 -0000 1.6 --- Process.hs 15 Nov 2003 10:34:14 -0000 1.7 *************** *** 17,21 **** ( Process, pc , start, quit, halt ! , ConfigKey(..), configKey, configKeyDef, visibleStatusBar ) where --- 17,21 ---- ( Process, pc , start, quit, halt ! , ConfigKey(..), configKey, configKeyDef ) where *************** *** 65,70 **** configKeyDef :: ConfigKey a => String -> a -> Attr Process a configKeyDef name defvalue = newAttr (\p -> Lib.getConfigKeyDef name defvalue) (\p v -> Lib.setConfigKey name v) - - visibleStatusBar :: Attr Process Bool - visibleStatusBar = newAttr (\p -> Lib.getStatusBarVisible) (\p -> Lib.setStatusBarVisible) --- 65,67 ---- Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Window.hs 15 Oct 2003 18:14:09 -0000 1.31 --- Window.hs 15 Nov 2003 10:34:14 -0000 1.32 *************** *** 121,127 **** view = newStdAttr hwindow Lib.getWindowViewSize Lib.setWindowViewSize ! -- | The attribute controls whether the window is visible ! visible :: Attr Window Bool ! visible = newStdAttr hwindow Lib.getWindowVisible Lib.setWindowVisible instance Dismissible Window where --- 121,126 ---- view = newStdAttr hwindow Lib.getWindowViewSize Lib.setWindowViewSize ! instance Visible Window where ! visible = newStdAttr hwindow Lib.getWindowVisible Lib.setWindowVisible instance Dismissible Window where |