From: <kr_...@us...> - 2004-05-06 10:27:55
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23600/gio/src/Graphics/UI/GIO Modified Files: Types.hs Window.hs Log Message: Support for the Center/CenterOnParent/Mouse positioning Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Types.hs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Types.hs 16 Nov 2003 13:26:55 -0000 1.18 --- Types.hs 6 May 2004 10:27:47 -0000 1.19 *************** *** 69,72 **** --- 69,75 ---- , PositionType(..) + -- * WindowPosition + , WindowPosition(..) + -- * Render Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Window.hs 16 Nov 2003 09:24:21 -0000 1.33 --- Window.hs 6 May 2004 10:27:47 -0000 1.34 *************** *** 11,15 **** -} ----------------------------------------------------------------------------------------- ! module Graphics.UI.GIO.Window (Window, window, dialog, view, runDialog, showWindow, hideWindow) where import qualified Graphics.UI.Port as Lib --- 11,15 ---- -} ----------------------------------------------------------------------------------------- ! module Graphics.UI.GIO.Window (Window, window, dialog, view, windowPos, runDialog, showWindow, hideWindow) where import qualified Graphics.UI.Port as Lib *************** *** 22,26 **** {-------------------------------------------------------------------- ! --------------------------------------------------------------------} -- | A main window widget. --- 22,26 ---- {-------------------------------------------------------------------- ! --------------------------------------------------------------------} -- | A main window widget. *************** *** 32,36 **** , vbufferMode :: Var BufferMode , vpaint :: Var PaintFunction ! , vlayout :: Var Layout } --- 32,36 ---- , vbufferMode :: Var BufferMode , vpaint :: Var PaintFunction ! , vlayout :: Var Layout } *************** *** 121,124 **** --- 121,130 ---- view = newStdAttr hwindow Lib.getWindowViewSize Lib.setWindowViewSize + -- | The 'windowPos' attribute is a write only and allows to set the position of the window. + -- The position can be specified using the exact bounding rectangle or in a way relative + -- to the parent window or to the screen. + windowPos :: Attr Window WindowPosition + windowPos = writeAttr "windowPos" (\w pos -> Lib.setWindowPosition (hwindow w) pos) + instance Visible Window where visible = newStdAttr hwindow Lib.getWindowVisible Lib.setWindowVisible *************** *** 133,143 **** instance Dimensions Window where ! frame = newStdAttr hwindow Lib.getWindowFrame Lib.setWindowFrame instance Drawn Window where pen = newAttr (getVar . vpen) (\w pen -> setVar (vpen w) pen >> recolorWindow w) ! bufferMode = newStdAttr vbufferMode getVar setVar ! instance HasFont Window where font = mapAttr penFont (\pen c -> pen{penFont=c}) pen --- 139,149 ---- instance Dimensions Window where ! frame = newStdAttr hwindow Lib.getWindowRect (\hwnd rect -> Lib.setWindowPosition hwnd (WinPosExact rect)) instance Drawn Window where pen = newAttr (getVar . vpen) (\w pen -> setVar (vpen w) pen >> recolorWindow w) ! bufferMode = newStdAttr vbufferMode getVar setVar ! instance HasFont Window where font = mapAttr penFont (\pen c -> pen{penFont=c}) pen |