You can subscribe to this list here.
2003 |
Jan
(30) |
Feb
(20) |
Mar
(151) |
Apr
(86) |
May
(23) |
Jun
(25) |
Jul
(107) |
Aug
(141) |
Sep
(55) |
Oct
(85) |
Nov
(65) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(22) |
Feb
(18) |
Mar
(3) |
Apr
(16) |
May
(69) |
Jun
(3) |
Jul
(1) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(6) |
Dec
(1) |
2005 |
Jan
(2) |
Feb
(16) |
Mar
|
Apr
|
May
|
Jun
(47) |
Jul
(1) |
Aug
|
Sep
(6) |
Oct
(4) |
Nov
|
Dec
(34) |
2006 |
Jan
(39) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
(4) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
(26) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(5) |
Aug
(2) |
Sep
(8) |
Oct
(8) |
Nov
(22) |
Dec
(30) |
2009 |
Jan
(10) |
Feb
(13) |
Mar
(14) |
Apr
(14) |
May
(32) |
Jun
(25) |
Jul
(36) |
Aug
(10) |
Sep
(2) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(9) |
Feb
(4) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: <kr_...@us...> - 2003-08-23 20:05:03
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv10476/src/Port Modified Files: Window.hs Log Message: Simplification Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Window.hs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Window.hs 13 Jul 2003 10:21:27 -0000 1.13 --- Window.hs 23 Aug 2003 20:05:00 -0000 1.14 *************** *** 114,130 **** -- | Get the text of the title bar. getWindowTitle :: WindowHandle -> IO String ! getWindowTitle hwnd ! = do ctitle <- osGetWindowTitle hwnd ! title <- peekCString ctitle ! free ctitle ! return title ! foreign import ccall "osGetWindowTitle" osGetWindowTitle :: WindowHandle -> IO CString -- | Set the text of the title bar. setWindowTitle :: WindowHandle -> String -> IO () ! setWindowTitle hwnd title ! = withCString title $ \ctitle -> ! osSetWindowTitle hwnd ctitle ! foreign import ccall "osSetWindowTitle" osSetWindowTitle :: WindowHandle -> CString -> IO () -- | Make the window resizeable or not. --- 114,124 ---- -- | Get the text of the title bar. getWindowTitle :: WindowHandle -> IO String ! getWindowTitle hwnd = resultCString (osGetWindowTitle hwnd) ! foreign import ccall osGetWindowTitle :: WindowHandle -> IO CString -- | Set the text of the title bar. setWindowTitle :: WindowHandle -> String -> IO () ! setWindowTitle hwnd title = withCString title (osSetWindowTitle hwnd) ! foreign import ccall osSetWindowTitle :: WindowHandle -> CString -> IO () -- | Make the window resizeable or not. |
From: <kr_...@us...> - 2003-08-23 18:04:01
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv27090/gio/src/Graphics/UI/GIO Modified Files: Types.hs Log Message: addSize primitive Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Types.hs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Types.hs 23 Aug 2003 11:43:02 -0000 1.15 --- Types.hs 23 Aug 2003 18:03:57 -0000 1.16 *************** *** 17,21 **** Size(..), sz , sizeEncloses ! , maxSize, addh, addv, sizeDistance -- ** Point --- 17,21 ---- Size(..), sz , sizeEncloses ! , maxSize, addh, addv, addSize, sizeDistance -- ** Point |
From: <kr_...@us...> - 2003-08-23 18:04:00
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv27090/port/src/Port Modified Files: Types.hs Log Message: addSize primitive Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Types.hs 23 Aug 2003 16:11:44 -0000 1.30 --- Types.hs 23 Aug 2003 18:03:57 -0000 1.31 *************** *** 22,26 **** -- ** Sizes ! , Size(..), sz, sizeEncloses, maxSize, addh, addv, sizeDistance -- ** Rectangles --- 22,26 ---- -- ** Sizes ! , Size(..), sz, sizeEncloses, maxSize, addh, addv, addSize, sizeDistance -- ** Rectangles *************** *** 230,233 **** --- 230,236 ---- addv :: Size -> Size -> Size addv (Size w1 h1) (Size w2 h2) = Size (max w1 w2) (h1+h2) + + addSize :: Size -> Size -> Size + addSize (Size w1 h1) (Size w2 h2) = Size (w1+w2) (h1+h2) sizeDistance :: Point -> Point -> Size |
From: <kr_...@us...> - 2003-08-23 17:03:32
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv10651/src/Port Modified Files: Types.hs Log Message: A bit of formatting and derive instences of Eq and Show for PositionType Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Types.hs 23 Aug 2003 12:01:18 -0000 1.28 --- Types.hs 23 Aug 2003 16:10:47 -0000 1.29 *************** *** 708,713 **** DrawXor -> 2 ! data PositionType = PosLeft | PosTop | PosRight | PosBottom toCPositionType :: PositionType -> CInt --- 708,720 ---- DrawXor -> 2 + ----------------------------------------------------------------------------------------- + -- Drawmode + ----------------------------------------------------------------------------------------- ! data PositionType = PosLeft ! | PosTop ! | PosRight ! | PosBottom ! deriving (Eq,Show) toCPositionType :: PositionType -> CInt |
From: <kr_...@us...> - 2003-08-23 16:34:45
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv11050/src/Port Modified Files: Types.hs Log Message: Fix comments Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Types.hs 23 Aug 2003 16:10:47 -0000 1.29 --- Types.hs 23 Aug 2003 16:11:44 -0000 1.30 *************** *** 692,698 **** toCDocumentInterface MDI = 2 ! {----------------------------------------------------------------------------------------- ! Drawmode ! -----------------------------------------------------------------------------------------} -- | The drawing mode. data DrawMode = DrawCopy -- ^ Copy directly to the canvas --- 692,698 ---- toCDocumentInterface MDI = 2 ! ----------------------------------------------------------------------------------------- ! -- Drawmode ! ----------------------------------------------------------------------------------------- -- | The drawing mode. data DrawMode = DrawCopy -- ^ Copy directly to the canvas *************** *** 709,713 **** ----------------------------------------------------------------------------------------- ! -- Drawmode ----------------------------------------------------------------------------------------- --- 709,713 ---- ----------------------------------------------------------------------------------------- ! -- PositionType ----------------------------------------------------------------------------------------- |
From: <kr_...@us...> - 2003-08-23 12:14:47
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv8462/src/Port Modified Files: Types.hs Log Message: Add fromCPositionType function Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Types.hs 23 Aug 2003 11:05:58 -0000 1.27 --- Types.hs 23 Aug 2003 12:01:18 -0000 1.28 *************** *** 107,111 **** , toCDocumentInterface ! , toCPositionType , fromCInt, toCInt --- 107,111 ---- , toCDocumentInterface ! , toCPositionType, fromCPositionType , fromCInt, toCInt *************** *** 716,719 **** --- 716,725 ---- toCPositionType PosRight = 2 toCPositionType PosBottom = 3 + + fromCPositionType :: CInt -> PositionType + fromCPositionType 0 = PosLeft + fromCPositionType 1 = PosTop + fromCPositionType 2 = PosRight + fromCPositionType 3 = PosBottom {----------------------------------------------------------------------------------------- |
From: <kr_...@us...> - 2003-08-23 12:02:03
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv3797/src/Graphics/UI/GIO Modified Files: ToolBar.hs Types.hs Log Message: In GIO the PositionType should be exported from Types module instead of ToolBar Index: ToolBar.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/ToolBar.hs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ToolBar.hs 23 Aug 2003 11:05:59 -0000 1.5 --- ToolBar.hs 23 Aug 2003 11:43:02 -0000 1.6 *************** *** 20,24 **** , ToolDropDownButton, toolDropDownButtonAt, toolDropDownButton , ToolLine, toolLineAt, toolLine - , PositionType(..) ) where --- 20,23 ---- *************** *** 28,32 **** import Graphics.UI.GIO.Menu import qualified Graphics.UI.Port as Lib - import Graphics.UI.Port(PositionType(..)) -------------------------------------------------------------------- --- 27,30 ---- Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Types.hs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Types.hs 8 Jul 2003 20:36:26 -0000 1.14 --- Types.hs 23 Aug 2003 11:43:02 -0000 1.15 *************** *** 65,68 **** --- 65,71 ---- -- * Document interface , DocumentInterface(..) + + -- * PositionType + , PositionType(..) -- * Render |
From: <kr_...@us...> - 2003-08-23 11:25:24
|
Update of /cvsroot/htoolkit/port In directory sc8-pr-cvs1:/tmp/cvs-serv31781 Modified Files: makefile Log Message: bugfix: correct dependency checking Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/port/makefile,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** makefile 23 Aug 2003 09:33:23 -0000 1.33 --- makefile 23 Aug 2003 11:15:34 -0000 1.34 *************** *** 170,174 **** @-if test -f $(<D)/$(*F)_stub.h; then $(MV) $(<D)/$(*F)_stub.[ch] $(HOUTDIR)/$(*D); fi @# create dependency file ! @$(HC) $< $(HC-OPTIONS) -M -optdep-f -optdep$(*F).d -i$(IMPORTDIR) @sed -e 's|$(subst .hs,,$<)\.o|$(HOUTDIR)/$*\.o|' $(*F).d > $(HOUTDIR)/$*.d @rm $(*F).d --- 170,174 ---- @-if test -f $(<D)/$(*F)_stub.h; then $(MV) $(<D)/$(*F)_stub.[ch] $(HOUTDIR)/$(*D); fi @# create dependency file ! @$(HC) $< $(HC-OPTIONS) -M -optdep-f -optdep$(*F).d -i$(BUILDDIR) @sed -e 's|$(subst .hs,,$<)\.o|$(HOUTDIR)/$*\.o|' $(*F).d > $(HOUTDIR)/$*.d @rm $(*F).d |
From: <kr_...@us...> - 2003-08-23 11:06:03
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv30280/gio/src/Graphics/UI/GIO Modified Files: ToolBar.hs Log Message: The DockPlace type is renamed to PositionType. The new type should be used for both ToolBar and Notebook control. Index: ToolBar.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/ToolBar.hs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ToolBar.hs 23 Aug 2003 00:04:47 -0000 1.4 --- ToolBar.hs 23 Aug 2003 11:05:59 -0000 1.5 *************** *** 20,24 **** , ToolDropDownButton, toolDropDownButtonAt, toolDropDownButton , ToolLine, toolLineAt, toolLine ! , DockPlace(..) ) where --- 20,24 ---- , ToolDropDownButton, toolDropDownButtonAt, toolDropDownButton , ToolLine, toolLineAt, toolLine ! , PositionType(..) ) where *************** *** 28,32 **** import Graphics.UI.GIO.Menu import qualified Graphics.UI.Port as Lib ! import Graphics.UI.Port(DockPlace(..)) -------------------------------------------------------------------- --- 28,32 ---- import Graphics.UI.GIO.Menu import qualified Graphics.UI.Port as Lib ! import Graphics.UI.Port(PositionType(..)) -------------------------------------------------------------------- *************** *** 36,40 **** data ToolBar = ToolBar {htoolbar :: WindowHandle} ! toolBar :: String -> DockPlace -> Int -> Int -> Int -> [Prop ToolBar] -> IO ToolBar toolBar name place band_num band_position offset props = do bar <- do hwnd <- Lib.createToolBar name place band_num band_position offset --- 36,40 ---- data ToolBar = ToolBar {htoolbar :: WindowHandle} ! toolBar :: String -> PositionType -> Int -> Int -> Int -> [Prop ToolBar] -> IO ToolBar toolBar name place band_num band_position offset props = do bar <- do hwnd <- Lib.createToolBar name place band_num band_position offset |
From: <kr_...@us...> - 2003-08-23 11:06:02
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv30280/port/src/include Modified Files: ToolBar.h Types.h Log Message: The DockPlace type is renamed to PositionType. The new type should be used for both ToolBar and Notebook control. Index: ToolBar.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/ToolBar.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ToolBar.h 17 Aug 2003 18:15:09 -0000 1.6 --- ToolBar.h 23 Aug 2003 11:05:59 -0000 1.7 *************** *** 4,10 **** #include "Types.h" ! typedef enum {DockLeft=0, DockTop=1, DockRight=2, DockBottom=3} DockPlace; ! ! WindowHandle osCreateToolBar(char *name, DockPlace place, int band_num, int band_position, int offset); void osDestroyToolBar(WindowHandle toolbar); --- 4,8 ---- #include "Types.h" ! WindowHandle osCreateToolBar(char *name, PositionType place, int band_num, int band_position, int offset); void osDestroyToolBar(WindowHandle toolbar); Index: Types.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Types.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Types.h 17 Jul 2003 17:32:23 -0000 1.15 --- Types.h 23 Aug 2003 11:05:59 -0000 1.16 *************** *** 10,13 **** --- 10,15 ---- #include <string.h> + typedef enum {PosLeft=0, PosTop=1, PosRight=2, PosBottom=3} PositionType; + #ifdef WIN32_TARGET |
From: <kr_...@us...> - 2003-08-23 11:06:02
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv30280/port/src/cbits/Win32 Modified Files: ToolBar.c Log Message: The DockPlace type is renamed to PositionType. The new type should be used for both ToolBar and Notebook control. Index: ToolBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ToolBar.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ToolBar.c 17 Aug 2003 18:15:08 -0000 1.15 --- ToolBar.c 23 Aug 2003 11:05:59 -0000 1.16 *************** *** 761,765 **** }; ! WindowHandle osCreateToolBar(char *name, DockPlace place, int band_num, int band_position, int offset) { HWND hDockBar, hWnd; --- 761,765 ---- }; ! WindowHandle osCreateToolBar(char *name, PositionType place, int band_num, int band_position, int offset) { HWND hDockBar, hWnd; *************** *** 769,785 **** switch (place) { ! case DockLeft: hDockBar = pFrameData->hLeftBar; lStyle = VERT; break; ! case DockTop: hDockBar = pFrameData->hTopBar; lStyle = HORZ; break; ! case DockRight: hDockBar = pFrameData->hRightBar; lStyle = VERT; break; ! case DockBottom: hDockBar = pFrameData->hBottomBar; lStyle = HORZ; --- 769,785 ---- switch (place) { ! case PosLeft: hDockBar = pFrameData->hLeftBar; lStyle = VERT; break; ! case PosTop: hDockBar = pFrameData->hTopBar; lStyle = HORZ; break; ! case PosRight: hDockBar = pFrameData->hRightBar; lStyle = VERT; break; ! case PosBottom: hDockBar = pFrameData->hBottomBar; lStyle = HORZ; |
From: <kr_...@us...> - 2003-08-23 11:06:02
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv30280/port/src/cbits/GTK Modified Files: ToolBar.c Log Message: The DockPlace type is renamed to PositionType. The new type should be used for both ToolBar and Notebook control. Index: ToolBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/ToolBar.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ToolBar.c 22 Aug 2003 21:45:07 -0000 1.7 --- ToolBar.c 23 Aug 2003 11:05:59 -0000 1.8 *************** *** 4,8 **** #include "gtkdropdowntoolbutton.h" ! WindowHandle osCreateToolBar(char *name, DockPlace place, int band_num, int band_position, int offset) { GtkWidget *toolbar; --- 4,8 ---- #include "gtkdropdowntoolbutton.h" ! WindowHandle osCreateToolBar(char *name, PositionType place, int band_num, int band_position, int offset) { GtkWidget *toolbar; *************** *** 16,23 **** switch (place) { ! case DockLeft: placement = BONOBO_DOCK_LEFT; break; ! case DockTop: placement = BONOBO_DOCK_TOP; break; ! case DockRight: placement = BONOBO_DOCK_RIGHT; break; ! case DockBottom: placement = BONOBO_DOCK_BOTTOM; break; default: return NULL; } --- 16,23 ---- switch (place) { ! case PosLeft: placement = BONOBO_DOCK_LEFT; break; ! case PosTop: placement = BONOBO_DOCK_TOP; break; ! case PosRight: placement = BONOBO_DOCK_RIGHT; break; ! case PosBottom: placement = BONOBO_DOCK_BOTTOM; break; default: return NULL; } |
From: <kr_...@us...> - 2003-08-23 11:06:01
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv30280/port/src/Port Modified Files: ToolBar.hs Types.hs Log Message: The DockPlace type is renamed to PositionType. The new type should be used for both ToolBar and Notebook control. Index: ToolBar.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/ToolBar.hs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ToolBar.hs 17 Aug 2003 18:15:08 -0000 1.4 --- ToolBar.hs 23 Aug 2003 11:05:58 -0000 1.5 *************** *** 18,22 **** , destroyToolBar - , DockPlace(..) , insertToolButton , insertToolCheckButton --- 18,21 ---- *************** *** 43,58 **** import System.IO.Unsafe( unsafePerformIO ) ! data DockPlace = DockLeft | DockTop | DockRight | DockBottom ! ! toCDockPlace :: DockPlace -> Int ! toCDockPlace DockLeft = 0 ! toCDockPlace DockTop = 1 ! toCDockPlace DockRight = 2 ! toCDockPlace DockBottom = 3 ! ! createToolBar :: String -> DockPlace -> Int -> Int -> Int -> IO WindowHandle createToolBar name place band_num band_position offset = ! withCString name (\cname -> osCreateToolBar cname (toCDockPlace place) band_num band_position offset) ! foreign import ccall osCreateToolBar :: CString -> Int -> Int -> Int -> Int -> IO WindowHandle foreign import ccall "osDestroyToolBar" destroyToolBar :: WindowHandle -> IO () --- 42,49 ---- import System.IO.Unsafe( unsafePerformIO ) ! createToolBar :: String -> PositionType -> Int -> Int -> Int -> IO WindowHandle createToolBar name place band_num band_position offset = ! withCString name (\cname -> osCreateToolBar cname (toCPositionType place) band_num band_position offset) ! foreign import ccall osCreateToolBar :: CString -> CInt -> Int -> Int -> Int -> IO WindowHandle foreign import ccall "osDestroyToolBar" destroyToolBar :: WindowHandle -> IO () Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Types.hs 15 Jul 2003 19:00:28 -0000 1.26 --- Types.hs 23 Aug 2003 11:05:58 -0000 1.27 *************** *** 71,74 **** --- 71,77 ---- -- * Document interface , DocumentInterface(..) + + -- * PositionType + , PositionType(..) -- * Primitive Handles *************** *** 103,106 **** --- 106,111 ---- , toCDocumentInterface + + , toCPositionType , fromCInt, toCInt *************** *** 703,706 **** --- 708,719 ---- DrawXor -> 2 + + data PositionType = PosLeft | PosTop | PosRight | PosBottom + + toCPositionType :: PositionType -> CInt + toCPositionType PosLeft = 0 + toCPositionType PosTop = 1 + toCPositionType PosRight = 2 + toCPositionType PosBottom = 3 {----------------------------------------------------------------------------------------- |
From: <kr_...@us...> - 2003-08-23 09:33:27
|
Update of /cvsroot/htoolkit/port In directory sc8-pr-cvs1:/tmp/cvs-serv18125 Modified Files: makefile Log Message: fix dependency generation Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/port/makefile,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** makefile 23 Aug 2003 08:29:55 -0000 1.32 --- makefile 23 Aug 2003 09:33:23 -0000 1.33 *************** *** 178,185 **** $(COBJS): $(COUTDIR)/%.c.o: %.c ! $(CC) -o $@ -c $< $(CC-OPTIONS) -MD $(INCDIRS) ! # the following two rules edit the dependency files: only needed for gcc 2.xx ! # @sed -e 's|\(.*\)\.o|$(COUTDIR)\/\1\.c\.o|' $(*F).d > $(COUTDIR)/$*.c.d ! # @rm $(*F).d #-------------------------------------------------------------------------- --- 178,183 ---- $(COBJS): $(COUTDIR)/%.c.o: %.c ! $(CC) -o $@ -c $< $(CC-OPTIONS) -MD $(INCDIRS) ! @mv $(*F).d $(COUTDIR)/$(*F).c.d #-------------------------------------------------------------------------- |
From: <kr_...@us...> - 2003-08-23 08:30:53
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv9999/src/cbits/Win32 Modified Files: Menu.c Log Message: bugfix Index: Menu.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Menu.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Menu.c 17 Aug 2003 22:10:05 -0000 1.14 --- Menu.c 23 Aug 2003 08:30:50 -0000 1.15 *************** *** 122,125 **** --- 122,126 ---- int i, nCount; MenuHandle handle; + MENUITEMINFO mii; FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); |
From: <kr_...@us...> - 2003-08-23 08:29:58
|
Update of /cvsroot/htoolkit/port In directory sc8-pr-cvs1:/tmp/cvs-serv9773 Modified Files: makefile Log Message: exclude gtkdropdown*.c files from Win32 build Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/port/makefile,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** makefile 22 Aug 2003 21:45:07 -0000 1.31 --- makefile 23 Aug 2003 08:29:55 -0000 1.32 *************** *** 48,55 **** FileDialog.c ColorDialog.c FontDialog.c AboutDialog.c PopUp.c Canvas.c Menu.c ListBox.c \ Label.c Font.c RadioBox.c Timer.c Frame.c Message.c Slider.c ProgressBar.c ConfigKey.c \ ! ToolBar.c gtkdropdownbutton.c gtkdropdowntoolbutton.c ifeq "$(GUILIB)" "WIN32" CSRCS += MenuHandlesMap.c DockBar.c endif --- 48,57 ---- FileDialog.c ColorDialog.c FontDialog.c AboutDialog.c PopUp.c Canvas.c Menu.c ListBox.c \ Label.c Font.c RadioBox.c Timer.c Frame.c Message.c Slider.c ProgressBar.c ConfigKey.c \ ! ToolBar.c ifeq "$(GUILIB)" "WIN32" CSRCS += MenuHandlesMap.c DockBar.c + else + CSRCS += gtkdropdownbutton.c gtkdropdowntoolbutton.c endif |
From: <kr_...@us...> - 2003-08-22 22:16:10
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv26788/src/Graphics/UI/GIO Modified Files: Menu.hs Timer.hs Log Message: comments Index: Menu.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Menu.hs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Menu.hs 17 Aug 2003 18:15:09 -0000 1.12 --- Menu.hs 22 Aug 2003 22:16:07 -0000 1.13 *************** *** 8,12 **** Portability : portable ! Menus -} ----------------------------------------------------------------------------------------- --- 8,16 ---- Portability : portable ! The module contains all utilitites required for creation and management of menus. ! A menu is a list of items that specify options or groups of options (a submenu). ! Clicking a menu item opens a submenu or causes the application to carry out a command. ! A menu is arranged in a hierarchy. At the top level of the hierarchy is the menu bar; ! which contains a list of menus, which in turn can contain submenus. -} ----------------------------------------------------------------------------------------- *************** *** 25,29 **** -- ** Menu separator , MenuLine, menulineAt, menuline ! -- * internal , hmenu ) where --- 29,34 ---- -- ** Menu separator , MenuLine, menulineAt, menuline ! ! -- internal , hmenu ) where Index: Timer.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Timer.hs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Timer.hs 17 Jul 2003 19:30:05 -0000 1.9 --- Timer.hs 22 Aug 2003 22:16:07 -0000 1.10 *************** *** 8,12 **** Portability : portable ! Milli-second interval timers. -} ----------------------------------------------------------------------------------------- --- 8,15 ---- Portability : portable ! A timer is a nonvisual component that repeatedly measures a specified interval, ! in milliseconds. Each time the specified 'interval' elapses, the system ! generates the 'command' event. Because a timer's accuracy depends on the system ! clock rate and other system specific factors, the time-out value is only approximate. -} ----------------------------------------------------------------------------------------- *************** *** 30,34 **** getTimerHandle (Timer thandle) = thandle ! -- | Create a new timer with a 1 second interval. timer :: [Prop Timer] -> IO Timer timer props --- 33,37 ---- getTimerHandle (Timer thandle) = thandle ! -- | Create a new timer. timer :: [Prop Timer] -> IO Timer timer props |
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv21647/src/cbits/GTK Modified Files: ToolBar.c Added Files: gtkdropdownbutton.c gtkdropdownbutton.h gtkdropdowntoolbutton.c gtkdropdowntoolbutton.h Log Message: Better support for drop down tool button --- NEW FILE: gtkdropdownbutton.c --- /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /* * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> #include "gtkdropdownbutton.h" #define _(x) x #define CHILD_LEFT_SPACING 1 #define CHILD_RIGHT_SPACING 1 #define CHILD_TOP_SPACING 1 #define CHILD_BOTTOM_SPACING 1 typedef struct _GtkDropDownButtonProps GtkDropDownButtonProps; struct _GtkDropDownButtonProps { gboolean interior_focus; GtkRequisition indicator_size; GtkBorder indicator_spacing; gint focus_width; gint focus_pad; }; static const GtkDropDownButtonProps default_props = { TRUE, { 7, 13 }, { 1, 1, 1, 1 }, /* Left, right, top, bottom */ 1, 0 }; static void gtk_drop_down_button_class_init (GtkDropDownButtonClass *klass); static void gtk_drop_down_button_init (GtkDropDownButton *button); static void gtk_drop_down_button_destroy (GtkObject *object); static void gtk_drop_down_button_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gtk_drop_down_button_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void gtk_drop_down_button_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_drop_down_button_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void gtk_drop_down_button_paint (GtkWidget *widget, GdkRectangle *area); static gint gtk_drop_down_button_expose (GtkWidget *widget, GdkEventExpose *event); static gint gtk_drop_down_button_button_press (GtkWidget *widget, GdkEventButton *event); static gint gtk_drop_down_button_key_press (GtkWidget *widget, GdkEventKey *event); static void gtk_drop_down_button_position (GtkMenu *menu, gint *x, gint *y, gint *scroll_offet, gpointer user_data); static void gtk_drop_down_button_show_all (GtkWidget *widget); static void gtk_drop_down_button_hide_all (GtkWidget *widget); static gboolean gtk_drop_down_button_mnemonic_activate (GtkWidget *widget, gboolean group_cycling); enum { PROP_0, PROP_MENU, LAST_PROP }; static GtkButtonClass *parent_class = NULL; GType gtk_drop_down_button_get_type (void) { static GType option_menu_type = 0; if (!option_menu_type) { static const GTypeInfo option_menu_info = { sizeof (GtkDropDownButtonClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) gtk_drop_down_button_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof (GtkDropDownButton), 0, /* n_preallocs */ (GInstanceInitFunc) gtk_drop_down_button_init, }; option_menu_type = g_type_register_static (GTK_TYPE_BUTTON, "GtkDropDownButton", &option_menu_info, 0); } return option_menu_type; } static void gtk_drop_down_button_class_init (GtkDropDownButtonClass *class) { GObjectClass *gobject_class; GtkObjectClass *object_class; GtkWidgetClass *widget_class; GtkButtonClass *button_class; GtkContainerClass *container_class; gobject_class = (GObjectClass*) class; object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; button_class = (GtkButtonClass*) class; container_class = (GtkContainerClass*) class; parent_class = g_type_class_peek_parent (class); gobject_class->set_property = gtk_drop_down_button_set_property; gobject_class->get_property = gtk_drop_down_button_get_property; object_class->destroy = gtk_drop_down_button_destroy; widget_class->size_request = gtk_drop_down_button_size_request; widget_class->size_allocate = gtk_drop_down_button_size_allocate; widget_class->expose_event = gtk_drop_down_button_expose; widget_class->button_press_event = gtk_drop_down_button_button_press; widget_class->key_press_event = gtk_drop_down_button_key_press; widget_class->show_all = gtk_drop_down_button_show_all; widget_class->hide_all = gtk_drop_down_button_hide_all; widget_class->mnemonic_activate = gtk_drop_down_button_mnemonic_activate; g_object_class_install_property (gobject_class, PROP_MENU, g_param_spec_object ("menu", _("Menu"), _("The menu of options"), GTK_TYPE_MENU, G_PARAM_READABLE | G_PARAM_WRITABLE)); gtk_widget_class_install_style_property (widget_class, g_param_spec_boxed ("indicator_size", _("Indicator Size"), _("Size of dropdown indicator"), GTK_TYPE_REQUISITION, G_PARAM_READABLE)); gtk_widget_class_install_style_property (widget_class, g_param_spec_boxed ("indicator_spacing", _("Indicator Spacing"), _("Spacing around indicator"), GTK_TYPE_BORDER, G_PARAM_READABLE)); } static void gtk_drop_down_button_init (GtkDropDownButton *button) { GTK_WIDGET_SET_FLAGS (button, GTK_CAN_FOCUS); GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_DEFAULT | GTK_RECEIVES_DEFAULT); button->menu = NULL; } GtkWidget* gtk_drop_down_button_new (void) { return g_object_new (GTK_TYPE_DROP_DOWN_BUTTON, NULL); } GtkWidget* gtk_drop_down_button_get_menu (GtkDropDownButton *button) { g_return_val_if_fail (GTK_IS_DROP_DOWN_BUTTON (button), NULL); return button->menu; } static void gtk_drop_down_button_detacher (GtkWidget *widget, GtkMenu *menu) { GtkDropDownButton *button; g_return_if_fail (GTK_IS_DROP_DOWN_BUTTON (widget)); button = GTK_DROP_DOWN_BUTTON (widget); g_return_if_fail (button->menu == (GtkWidget*) menu); g_signal_handlers_disconnect_by_func (button->menu, gtk_widget_queue_draw, button); button->menu = NULL; g_object_notify (G_OBJECT (button), "menu"); } void gtk_drop_down_button_set_menu (GtkDropDownButton *button, GtkWidget *menu) { g_return_if_fail (GTK_IS_DROP_DOWN_BUTTON (button)); g_return_if_fail (GTK_IS_MENU (menu)); if (button->menu != menu) { if (button->menu) { if (GTK_MENU_SHELL (button->menu)->active) g_signal_emit_by_name (button->menu, "cancel", 0); gtk_menu_detach (GTK_MENU (button->menu)); } button->menu = menu; if (menu) { gtk_menu_attach_to_widget (GTK_MENU (menu), GTK_WIDGET (button), gtk_drop_down_button_detacher); g_signal_connect_swapped(button->menu, "selection_done", G_CALLBACK (gtk_widget_queue_draw), button); if (GTK_WIDGET (button)->parent) gtk_widget_queue_resize (GTK_WIDGET (button)); } g_object_notify (G_OBJECT (button), "menu"); } } static void gtk_drop_down_button_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GtkDropDownButton *button = GTK_DROP_DOWN_BUTTON (object); switch (prop_id) { case PROP_MENU: gtk_drop_down_button_set_menu (button, g_value_get_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gtk_drop_down_button_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GtkDropDownButton *button = GTK_DROP_DOWN_BUTTON (object); switch (prop_id) { case PROP_MENU: g_value_set_object (value, button->menu); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gtk_drop_down_button_destroy (GtkObject *object) { GtkDropDownButton *button; g_return_if_fail (GTK_IS_DROP_DOWN_BUTTON (object)); button = GTK_DROP_DOWN_BUTTON (object); if (button->menu) gtk_widget_destroy(button->menu); if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } static void gtk_drop_down_button_get_props (GtkDropDownButton *button, GtkDropDownButtonProps *props) { GtkRequisition *indicator_size; GtkBorder *indicator_spacing; gtk_widget_style_get (GTK_WIDGET (button), "indicator_size", &indicator_size, "indicator_spacing", &indicator_spacing, "interior_focus", &props->interior_focus, "focus_line_width", &props->focus_width, "focus_padding", &props->focus_pad, NULL); if (indicator_size) props->indicator_size = *indicator_size; else props->indicator_size = default_props.indicator_size; if (indicator_spacing) props->indicator_spacing = *indicator_spacing; else props->indicator_spacing = default_props.indicator_spacing; g_free (indicator_size); g_free (indicator_spacing); } static void gtk_drop_down_button_size_request (GtkWidget *widget, GtkRequisition *requisition) { GtkDropDownButton *button = GTK_DROP_DOWN_BUTTON (widget); GtkDropDownButtonProps props; gint tmp; GtkRequisition child_requisition = { 0, 0 }; gtk_drop_down_button_get_props (button, &props); if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child)) gtk_widget_size_request (GTK_BIN (button)->child, &child_requisition); requisition->width = ((GTK_CONTAINER (widget)->border_width + GTK_WIDGET (widget)->style->xthickness + props.focus_pad) * 2 + child_requisition.width + props.indicator_size.width + props.indicator_spacing.left + props.indicator_spacing.right + CHILD_LEFT_SPACING + CHILD_RIGHT_SPACING + props.focus_width * 2); requisition->height = ((GTK_CONTAINER (widget)->border_width + GTK_WIDGET (widget)->style->ythickness + props.focus_pad) * 2 + child_requisition.height + CHILD_TOP_SPACING + CHILD_BOTTOM_SPACING + props.focus_width * 2); tmp = (requisition->height - child_requisition.height + props.indicator_size.height + props.indicator_spacing.top + props.indicator_spacing.bottom); requisition->height = MAX (requisition->height, tmp); } static void gtk_drop_down_button_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkWidget *child; GtkButton *button = GTK_BUTTON (widget); GtkAllocation child_allocation; GtkDropDownButtonProps props; gint border_width; gtk_drop_down_button_get_props (GTK_DROP_DOWN_BUTTON (widget), &props); border_width = GTK_CONTAINER (widget)->border_width; widget->allocation = *allocation; if (GTK_WIDGET_REALIZED (widget)) gdk_window_move_resize (button->event_window, allocation->x + border_width, allocation->y + border_width, allocation->width - border_width * 2, allocation->height - border_width * 2); child = GTK_BIN (widget)->child; if (child && GTK_WIDGET_VISIBLE (child)) { gint xthickness = GTK_WIDGET (widget)->style->xthickness; gint ythickness = GTK_WIDGET (widget)->style->ythickness; child_allocation.x = widget->allocation.x + border_width + xthickness + props.focus_width + props.focus_pad + CHILD_LEFT_SPACING; child_allocation.y = widget->allocation.y + border_width + ythickness + props.focus_width + props.focus_pad + CHILD_TOP_SPACING; child_allocation.width = MAX (1, allocation->width - (border_width + xthickness + props.focus_width + props.focus_pad) * 2 - props.indicator_size.width - props.indicator_spacing.left - props.indicator_spacing.right - CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING); child_allocation.height = MAX (1, allocation->height - (border_width + ythickness + props.focus_width + props.focus_pad) * 2 - CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING); if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL) child_allocation.x += props.indicator_size.width + props.indicator_spacing.left + props.indicator_spacing.right; gtk_widget_size_allocate (child, &child_allocation); } } static void gtk_drop_down_button_paint (GtkWidget *widget, GdkRectangle *area) { GdkRectangle button_area; GtkDropDownButtonProps props; gint border_width; gint arrow_width, arrow_height; gint x,y; g_return_if_fail (GTK_IS_DROP_DOWN_BUTTON (widget)); g_return_if_fail (area != NULL); if (GTK_WIDGET_DRAWABLE (widget)) { border_width = GTK_CONTAINER (widget)->border_width; gtk_drop_down_button_get_props (GTK_DROP_DOWN_BUTTON (widget), &props); if (!GTK_MENU_SHELL (GTK_DROP_DOWN_BUTTON (widget)->menu)->active) _gtk_button_paint (GTK_BUTTON(widget), area, GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT, "dropdownbutton", "dropdownbuttondefault"); else { gtk_widget_set_state (widget, GTK_STATE_ACTIVE); _gtk_button_paint (GTK_BUTTON(widget), area, GTK_WIDGET_STATE (widget), GTK_SHADOW_IN, "dropdownbutton", "dropdownbuttondefault"); gtk_widget_set_state (widget, GTK_STATE_NORMAL); } arrow_width = props.indicator_size.width + (props.indicator_size.width % 2) - 1; arrow_height = arrow_width / 2 + 1; button_area.x = widget->allocation.x + border_width; button_area.y = widget->allocation.y + border_width; button_area.width = widget->allocation.width - 2 * border_width; button_area.height = widget->allocation.height - 2 * border_width; if (!props.interior_focus && GTK_WIDGET_HAS_FOCUS (widget)) { button_area.x += props.focus_width + props.focus_pad; button_area.y += props.focus_width + props.focus_pad; button_area.width -= 2 * (props.focus_width + props.focus_pad); button_area.height -= 2 * (props.focus_width + props.focus_pad); } if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL) x = button_area.x + props.indicator_spacing.right + widget->style->xthickness; else x = button_area.x + button_area.width - props.indicator_size.width - props.indicator_spacing.right - widget->style->xthickness; y = button_area.y + (button_area.height - arrow_height) / 2; gtk_draw_arrow (widget->style, widget->window, GTK_WIDGET_STATE (widget), GTK_SHADOW_NONE, GTK_ARROW_DOWN, TRUE, x,y,arrow_width,arrow_height); if (GTK_WIDGET_HAS_FOCUS (widget)) { if (props.interior_focus) { button_area.x += widget->style->xthickness + props.focus_pad; button_area.y += widget->style->ythickness + props.focus_pad; button_area.width -= 2 * (widget->style->xthickness + props.focus_pad) + props.indicator_spacing.left + props.indicator_spacing.right + props.indicator_size.width; button_area.height -= 2 * (widget->style->ythickness + props.focus_pad); if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL) button_area.x += props.indicator_spacing.left + props.indicator_spacing.right + props.indicator_size.width; } else { button_area.x -= props.focus_width + props.focus_pad; button_area.y -= props.focus_width + props.focus_pad; button_area.width += 2 * (props.focus_width + props.focus_pad); button_area.height += 2 * (props.focus_width + props.focus_pad); } gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget), area, widget, "dropdownbutton", button_area.x, button_area.y, button_area.width, button_area.height); } } } static gint gtk_drop_down_button_expose (GtkWidget *widget, GdkEventExpose *event) { g_return_val_if_fail (GTK_IS_DROP_DOWN_BUTTON (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); if (GTK_WIDGET_DRAWABLE (widget)) { gtk_drop_down_button_paint (widget, &event->area); if (GTK_BIN (widget)->child) gtk_container_propagate_expose (GTK_CONTAINER (widget), GTK_BIN (widget)->child, event); } return FALSE; } static gint gtk_drop_down_button_button_press (GtkWidget *widget, GdkEventButton *event) { GtkDropDownButton *button; g_return_val_if_fail (GTK_IS_DROP_DOWN_BUTTON (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); button = GTK_DROP_DOWN_BUTTON (widget); if ((event->type == GDK_BUTTON_PRESS) && (event->button == 1)) { gtk_menu_popup (GTK_MENU (button->menu), NULL, NULL, gtk_drop_down_button_position, button, event->button, event->time); return TRUE; } return FALSE; } static gint gtk_drop_down_button_key_press (GtkWidget *widget, GdkEventKey *event) { GtkDropDownButton *button; g_return_val_if_fail (GTK_IS_DROP_DOWN_BUTTON (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); button = GTK_DROP_DOWN_BUTTON (widget); switch (event->keyval) { case GDK_KP_Space: case GDK_space: gtk_menu_popup (GTK_MENU (button->menu), NULL, NULL, gtk_drop_down_button_position, button, 0, event->time); return TRUE; } return FALSE; } static void gtk_drop_down_button_position (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data) { GtkDropDownButton *button; GtkWidget *active; GtkWidget *widget; GtkRequisition requisition; gint screen_width; gint menu_xpos; gint menu_ypos; gint menu_width; g_return_if_fail (GTK_IS_DROP_DOWN_BUTTON (user_data)); button = GTK_DROP_DOWN_BUTTON (user_data); widget = GTK_WIDGET (button); gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition); menu_width = requisition.width; active = gtk_menu_get_active (GTK_MENU (button->menu)); gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos); menu_xpos += widget->allocation.x; menu_ypos += widget->allocation.y + widget->allocation.height - 2; screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget)); if (menu_xpos < 0) menu_xpos = 0; else if ((menu_xpos + menu_width) > screen_width) menu_xpos -= ((menu_xpos + menu_width) - screen_width); *x = menu_xpos; *y = menu_ypos; *push_in = TRUE; } static void gtk_drop_down_button_show_all (GtkWidget *widget) { GtkContainer *container; GtkDropDownButton *button; g_return_if_fail (GTK_IS_DROP_DOWN_BUTTON (widget)); container = GTK_CONTAINER (widget); button = GTK_DROP_DOWN_BUTTON (widget); gtk_widget_show (widget); gtk_container_foreach (container, (GtkCallback) gtk_widget_show_all, NULL); if (button->menu) gtk_widget_show_all (button->menu); } static void gtk_drop_down_button_hide_all (GtkWidget *widget) { GtkContainer *container; g_return_if_fail (GTK_IS_DROP_DOWN_BUTTON (widget)); container = GTK_CONTAINER (widget); gtk_widget_hide (widget); gtk_container_foreach (container, (GtkCallback) gtk_widget_hide_all, NULL); } static gboolean gtk_drop_down_button_mnemonic_activate (GtkWidget *widget, gboolean group_cycling) { gtk_widget_grab_focus (widget); return TRUE; } --- NEW FILE: gtkdropdownbutton.h --- /* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /* * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #ifndef __GTK_DROP_DOWN_BUTTON_H__ #define __GTK_DROP_DOWN_BUTTON_H__ #include <gdk/gdk.h> #include <gtk/gtkbutton.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define GTK_TYPE_DROP_DOWN_BUTTON (gtk_drop_down_button_get_type ()) #define GTK_DROP_DOWN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_DROP_DOWN_BUTTON, GtkDropDownButton)) #define GTK_DROP_DOWN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DROP_DOWN_BUTTON, GtkDropDownButtonClass)) #define GTK_IS_DROP_DOWN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DROP_DOWN_BUTTON)) #define GTK_IS_DROP_DOWN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DROP_DOWN_BUTTON)) #define GTK_DROP_DOWN_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_DROP_DOWN_BUTTON, GtkDropDownButtonClass)) typedef struct _GtkDropDownButton GtkDropDownButton; typedef struct _GtkDropDownButtonClass GtkDropDownButtonClass; struct _GtkDropDownButton { GtkButton button; GtkWidget *menu; }; struct _GtkDropDownButtonClass { GtkButtonClass parent_class; }; GType gtk_drop_down_button_get_type (void) G_GNUC_CONST; GtkWidget* gtk_drop_down_button_new (void); GtkWidget* gtk_drop_down_button_get_menu (GtkDropDownButton *option_menu); void gtk_drop_down_button_set_menu (GtkDropDownButton *option_menu, GtkWidget *menu); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __GTK_DROP_DOWN_BUTTON_H__ */ --- NEW FILE: gtkdropdowntoolbutton.c --- /* gtkdropdowntoolbutton.c * * Copyright (C) 2002 Anders Carlsson <and...@co...> * Copyright (C) 2002 James Henstridge <ja...@da...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include <gtk/gtk.h> #include "gtkdropdowntoolbutton.h" #include "gtkdropdownbutton.h" #define MENU_ID "gtk-drop-down-tool-button-menu-id" static void gtk_drop_down_tool_button_init (GtkDropDownToolButton *button); static void gtk_drop_down_tool_button_class_init (GtkDropDownToolButtonClass *klass); static gboolean gtk_drop_down_tool_button_create_menu_proxy (GtkToolItem *button); static GObjectClass *parent_class = NULL; GType gtk_drop_down_tool_button_get_type (void) { static GType type = 0; if (!type) { static const GTypeInfo type_info = { sizeof (GtkDropDownToolButtonClass), (GBaseInitFunc) 0, (GBaseFinalizeFunc) 0, (GClassInitFunc) gtk_drop_down_tool_button_class_init, (GClassFinalizeFunc) 0, NULL, sizeof (GtkDropDownToolButton), 0, /* n_preallocs */ (GInstanceInitFunc) gtk_drop_down_tool_button_init }; type = g_type_register_static (GTK_TYPE_TOOL_BUTTON, "GtkdropdownToolButton", &type_info, 0); } return type; } static void gtk_drop_down_tool_button_class_init (GtkDropDownToolButtonClass *klass) { GObjectClass *object_class; GtkToolItemClass *toolitem_class; GtkToolButtonClass *toolbutton_class; parent_class = g_type_class_peek_parent (klass); object_class = (GObjectClass *)klass; toolitem_class = (GtkToolItemClass *)klass; toolbutton_class = (GtkToolButtonClass *)klass; toolitem_class->create_menu_proxy = gtk_drop_down_tool_button_create_menu_proxy; toolbutton_class->button_type = GTK_TYPE_DROP_DOWN_BUTTON; } static void gtk_drop_down_tool_button_init (GtkDropDownToolButton *button) { } static gboolean gtk_drop_down_tool_button_create_menu_proxy (GtkToolItem *item) { GtkToolButton *tool_button = GTK_TOOL_BUTTON (item); GtkWidget *menu_item = NULL; GtkStockItem stock_item; gboolean use_mnemonic = TRUE; const char *label = ""; if (tool_button->label_widget && GTK_IS_LABEL (tool_button->label_widget)) label = gtk_label_get_label (GTK_LABEL (tool_button->label_widget)); else if (tool_button->label_text) { label = tool_button->label_text; use_mnemonic = tool_button->use_underline; } else if (tool_button->stock_id && gtk_stock_lookup (tool_button->stock_id, &stock_item)) label = stock_item.label; if (use_mnemonic) menu_item = gtk_menu_item_new_with_mnemonic (label); else menu_item = gtk_menu_item_new_with_label (label); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), GTK_DROP_DOWN_BUTTON(tool_button->button)->menu); gtk_tool_item_set_proxy_menu_item (item, MENU_ID, menu_item); return TRUE; } GtkToolItem * gtk_drop_down_tool_button_new (void) { GtkToolButton *button; button = g_object_new (GTK_TYPE_DROP_DOWN_TOOL_BUTTON, NULL); return GTK_TOOL_ITEM (button); } GtkToolItem * gtk_drop_down_tool_button_new_from_stock (const gchar *stock_id) { GtkToolButton *button; g_return_val_if_fail (stock_id != NULL, NULL); button = g_object_new (GTK_TYPE_DROP_DOWN_TOOL_BUTTON, "stock_id", stock_id, NULL); return GTK_TOOL_ITEM (button); } GtkWidget* gtk_drop_down_tool_button_get_menu(GtkDropDownToolButton *button) { return gtk_drop_down_button_get_menu(GTK_DROP_DOWN_BUTTON(GTK_TOOL_BUTTON(button)->button)); } void gtk_drop_down_tool_button_set_menu(GtkDropDownToolButton *button, GtkWidget *menu) { gtk_drop_down_button_set_menu(GTK_DROP_DOWN_BUTTON(GTK_TOOL_BUTTON(button)->button), menu); } --- NEW FILE: gtkdropdowntoolbutton.h --- /* gtkdropdowntoolbutton.h * * Copyright (C) 2002 Anders Carlsson <and...@co...> * Copyright (C) 2002 James Henstridge <ja...@da...> * Copyright (C) 2003 Soeren Sandmann <san...@da...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GTK_DROP_DOWN_TOOL_BUTTON_H__ #define __GTK_DROP_DOWN_TOOL_BUTTON_H__ G_BEGIN_DECLS #define GTK_TYPE_DROP_DOWN_TOOL_BUTTON (gtk_drop_down_tool_button_get_type ()) #define GTK_DROP_DOWN_TOOL_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_DROP_DOWN_TOOL_BUTTON, GtkDropDownToolButton)) #define GTK_DROP_DOWN_TOOL_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DROP_DOWN_TOOL_BUTTON, GtkDropDownToolButtonClass)) #define GTK_IS_DROP_DOWN_TOOL_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DROP_DOWN_TOOL_BUTTON)) #define GTK_IS_DROP_DOWN_TOOL_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GTK_TYPE_DROP_DOWN_TOOL_BUTTON)) #define GTK_DROP_DOWN_TOOL_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_DROP_DOWN_TOOL_BUTTON, GtkDropDownToolButtonClass)) typedef struct _GtkDropDownToolButton GtkDropDownToolButton; typedef struct _GtkDropDownToolButtonClass GtkDropDownToolButtonClass; struct _GtkDropDownToolButton { GtkToolButton parent; /*< private >*/ GtkWidget *menu_item; }; struct _GtkDropDownToolButtonClass { GtkToolButtonClass parent_class; }; GType gtk_drop_down_tool_button_get_type (void) G_GNUC_CONST; GtkToolItem *gtk_drop_down_tool_button_new (void); GtkToolItem *gtk_drop_down_tool_button_new_from_stock (const gchar *stock_id); GtkWidget* gtk_drop_down_tool_button_get_menu (GtkDropDownToolButton *button); void gtk_drop_down_tool_button_set_menu (GtkDropDownToolButton *button, GtkWidget *menu); G_END_DECLS #endif /* __GTK_dropdown_TOOL_BUTTON_H__ */ Index: ToolBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/ToolBar.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ToolBar.c 17 Aug 2003 22:02:46 -0000 1.6 --- ToolBar.c 22 Aug 2003 21:45:07 -0000 1.7 *************** *** 2,5 **** --- 2,6 ---- #include "Internals.h" #include "Handlers_stub.h" + #include "gtkdropdowntoolbutton.h" WindowHandle osCreateToolBar(char *name, DockPlace place, int band_num, int band_position, int offset) *************** *** 114,132 **** } - void tool_dropdown_button_clicked(GtkWidget *widget, gpointer user_data) - { - gtk_menu_popup(GTK_MENU(user_data), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time()); - } - ToolHandle osInsertToolDropDownButton(WindowHandle toolbar, MenuHandle hmenu, int pos) { ! GtkToolItem *item = gtk_tool_button_new("", gtk_image_new()); ! gtk_signal_connect (GTK_OBJECT(GTK_TOOL_BUTTON(item)->button), "clicked", ! GTK_SIGNAL_FUNC(tool_dropdown_button_clicked), ! hmenu); gtk_signal_connect (GTK_OBJECT(item), "destroy", GTK_SIGNAL_FUNC(handleToolDestroy), NULL); gtk_tool_button_set_label_widget(GTK_TOOL_BUTTON(item), gtk_label_new("")); gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, pos); gtk_widget_show_all(GTK_WIDGET(item)); --- 115,127 ---- } ToolHandle osInsertToolDropDownButton(WindowHandle toolbar, MenuHandle hmenu, int pos) { ! GtkToolItem *item = gtk_drop_down_tool_button_new(); ! gtk_drop_down_tool_button_set_menu(GTK_DROP_DOWN_TOOL_BUTTON(item), hmenu); gtk_signal_connect (GTK_OBJECT(item), "destroy", GTK_SIGNAL_FUNC(handleToolDestroy), NULL); gtk_tool_button_set_label_widget(GTK_TOOL_BUTTON(item), gtk_label_new("")); + gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(item), gtk_image_new()); gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, pos); gtk_widget_show_all(GTK_WIDGET(item)); |
From: <kr_...@us...> - 2003-08-22 21:45:12
|
Update of /cvsroot/htoolkit/port In directory sc8-pr-cvs1:/tmp/cvs-serv21647 Modified Files: makefile Log Message: Better support for drop down tool button Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/port/makefile,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** makefile 16 Aug 2003 09:54:28 -0000 1.30 --- makefile 22 Aug 2003 21:45:07 -0000 1.31 *************** *** 48,52 **** FileDialog.c ColorDialog.c FontDialog.c AboutDialog.c PopUp.c Canvas.c Menu.c ListBox.c \ Label.c Font.c RadioBox.c Timer.c Frame.c Message.c Slider.c ProgressBar.c ConfigKey.c \ ! ToolBar.c ifeq "$(GUILIB)" "WIN32" --- 48,52 ---- FileDialog.c ColorDialog.c FontDialog.c AboutDialog.c PopUp.c Canvas.c Menu.c ListBox.c \ Label.c Font.c RadioBox.c Timer.c Frame.c Message.c Slider.c ProgressBar.c ConfigKey.c \ ! ToolBar.c gtkdropdownbutton.c gtkdropdowntoolbutton.c ifeq "$(GUILIB)" "WIN32" |
From: <kr_...@us...> - 2003-08-22 09:42:19
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv5491 Modified Files: CheckBox.c RadioBox.c Window.c Log Message: Implementation for the new RadioBox API and for the CompoundControl under GNOME Index: CheckBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/CheckBox.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CheckBox.c 29 Mar 2003 08:12:18 -0000 1.5 --- CheckBox.c 21 Aug 2003 19:55:05 -0000 1.6 *************** *** 1,43 **** ! #include "CheckBox.h" ! #include "Internals.h" ! #include "Handlers_stub.h" ! ! WindowHandle osCreateCheckBox(WindowHandle window, char *title) ! { ! GtkWidget *check_btn; ! gchar *szText = toMnemonicString(title); ! ! check_btn = gtk_check_button_new_with_mnemonic(szText); ! gtk_fixed_put(GTK_FIXED(GTK_BIN(GTK_BIN(window)->child)->child), check_btn, 0, 0); ! gtk_signal_connect (GTK_OBJECT (check_btn), "toggled", ! GTK_SIGNAL_FUNC(handleControlCommand), ! NULL); ! gtk_widget_show(check_btn); ! rfree(szText); ! ! return check_btn; ! }; ! ! void osGetCheckBoxReqSize(WindowHandle checkbox, int *res) ! { ! int w,h; ! GtkRequisition requisition; ! ! gtk_widget_get_size_request(checkbox, &w,&h); ! gtk_widget_set_size_request(checkbox, -1,-1); ! gtk_widget_size_request(checkbox, &requisition); ! gtk_widget_set_size_request(checkbox, w, h); ! ! res[0] = requisition.width; ! res[1] = requisition.height; ! }; ! ! BOOL osGetCheckBoxState(WindowHandle checkbox) ! { ! return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox)); ! }; ! ! void osSetCheckBoxState(WindowHandle checkbox, BOOL state) ! { ! gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), state); ! }; --- 1,55 ---- ! #include "CheckBox.h" ! #include "Internals.h" ! #include "Handlers_stub.h" ! ! WindowHandle osCreateCheckBox(WindowHandle window) ! { ! GtkWidget *check_btn; ! ! check_btn = gtk_check_button_new_with_mnemonic(""); ! gtk_fixed_put(GTK_FIXED(GTK_BIN(GTK_BIN(window)->child)->child), check_btn, 0, 0); ! gtk_signal_connect (GTK_OBJECT (check_btn), "toggled", ! GTK_SIGNAL_FUNC(handleControlCommand), ! NULL); ! gtk_widget_show(check_btn); ! ! return check_btn; ! }; ! ! void osGetCheckBoxReqSize(WindowHandle checkbox, int *res) ! { ! int w,h; ! GtkRequisition requisition; ! ! gtk_widget_get_size_request(checkbox, &w,&h); ! gtk_widget_set_size_request(checkbox, -1,-1); ! gtk_widget_size_request(checkbox, &requisition); ! gtk_widget_set_size_request(checkbox, w, h); ! ! res[0] = requisition.width; ! res[1] = requisition.height; ! }; ! ! char *osGetCheckBoxText(WindowHandle button) ! { ! return fromMnemonicString(gtk_button_get_label(GTK_BUTTON(button))); ! }; ! ! void osSetCheckBoxText(WindowHandle button, char *txt) ! { ! gchar *szText = toMnemonicString(txt); ! GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); ! gtk_button_set_label(GTK_BUTTON(button), szText); ! handleWindowReLayout(window); ! rfree(szText); ! }; ! ! BOOL osGetCheckBoxState(WindowHandle checkbox) ! { ! return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox)); ! }; ! ! void osSetCheckBoxState(WindowHandle checkbox, BOOL state) ! { ! gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), state); ! }; Index: RadioBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/RadioBox.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RadioBox.c 29 Mar 2003 08:12:18 -0000 1.5 --- RadioBox.c 21 Aug 2003 19:55:05 -0000 1.6 *************** *** 1,56 **** ! #include "RadioBox.h" ! #include "Internals.h" ! #include "Handlers_stub.h" ! ! static GtkWidget *last_radio = NULL; ! ! WindowHandle osCreateRadioBox(WindowHandle window, BOOL isFirst, char *title) ! { ! GtkWidget *radio_btn; ! gchar *szText = toMnemonicString(title); ! ! if (isFirst) ! { ! radio_btn = gtk_radio_button_new_with_mnemonic (NULL, szText); ! } ! else ! { ! radio_btn = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(last_radio),szText); ! } ! ! gtk_fixed_put(GTK_FIXED(GTK_BIN(GTK_BIN(window)->child)->child), radio_btn, 0, 0); ! gtk_signal_connect (GTK_OBJECT (radio_btn), "toggled", ! GTK_SIGNAL_FUNC(handleControlCommand), ! NULL); ! gtk_widget_show(radio_btn); ! rfree(szText); ! ! last_radio = radio_btn; ! ! return radio_btn; ! }; ! ! void osGetRadioBoxReqSize(WindowHandle radio, int *res) ! { ! int w,h; ! GtkRequisition requisition; ! ! gtk_widget_get_size_request(radio, &w,&h); ! gtk_widget_set_size_request(radio, -1,-1); ! gtk_widget_size_request(radio, &requisition); ! gtk_widget_set_size_request(radio, w, h); ! ! res[0] = requisition.width; ! res[1] = requisition.height; ! }; ! ! BOOL osGetRadioBoxState(WindowHandle radio) ! { ! return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio)); ! }; ! ! void osSetRadioBoxState(WindowHandle radio, BOOL state) ! { ! gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio), state); ! GTK_TOGGLE_BUTTON(radio)->active = state; ! }; --- 1,69 ---- ! #include "RadioBox.h" ! #include "Internals.h" ! #include "Handlers_stub.h" ! ! WindowHandle osCreateRadioBox(WindowHandle window) ! { ! GtkWidget *radio_btn; ! ! radio_btn = gtk_radio_button_new_with_mnemonic (NULL, ""); ! ! gtk_fixed_put(GTK_FIXED(GTK_BIN(GTK_BIN(window)->child)->child), radio_btn, 0, 0); ! gtk_signal_connect (GTK_OBJECT (radio_btn), "toggled", ! GTK_SIGNAL_FUNC(handleControlCommand), ! NULL); ! gtk_widget_show(radio_btn); ! ! return radio_btn; ! }; ! ! void osGetRadioBoxReqSize(WindowHandle radio, int *res) ! { ! int w,h; ! GtkRequisition requisition; ! ! gtk_widget_get_size_request(radio, &w,&h); ! gtk_widget_set_size_request(radio, -1,-1); ! gtk_widget_size_request(radio, &requisition); ! gtk_widget_set_size_request(radio, w, h); ! ! res[0] = requisition.width; ! res[1] = requisition.height; ! }; ! ! char *osGetRadioBoxText(WindowHandle button) ! { ! return fromMnemonicString(gtk_button_get_label(GTK_BUTTON(button))); ! }; ! ! void osSetRadioBoxText(WindowHandle button, char *txt) ! { ! gchar *szText = toMnemonicString(txt); ! GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); ! gtk_button_set_label(GTK_BUTTON(button), szText); ! handleWindowReLayout(window); ! rfree(szText); ! }; ! ! BOOL osGetRadioBoxState(WindowHandle radio) ! { ! return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio)); ! }; ! ! void osSetRadioBoxState(WindowHandle radio, BOOL state) ! { ! gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio), state); ! GTK_TOGGLE_BUTTON(radio)->active = state; ! }; ! ! void osSetRadioBoxGroup(WindowHandle *handles) ! { ! WindowHandle *phandle; ! GSList *group = NULL; ! ! for (phandle = handles; *phandle; phandle++) ! { ! gtk_radio_button_set_group(GTK_RADIO_BUTTON(*phandle), group); ! group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(*phandle)); ! } ! } Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Window.c 16 Jul 2003 21:59:24 -0000 1.25 --- Window.c 21 Aug 2003 19:55:05 -0000 1.26 *************** *** 271,275 **** gnome_app_set_contents(GNOME_APP(gFrameWidget),sw); } ! gtk_widget_realize(viewport); gdk_window_set_events(viewport->window, gdk_window_get_events(viewport->window) --- 271,275 ---- gnome_app_set_contents(GNOME_APP(gFrameWidget),sw); } ! gtk_widget_realize(viewport); gdk_window_set_events(viewport->window, gdk_window_get_events(viewport->window) *************** *** 396,404 **** gtk_container_add(GTK_CONTAINER(frame), sw); ! gtk_widget_realize(viewport); gdk_window_set_events(viewport->window, gdk_window_get_events(viewport->window) | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); return sw; } --- 396,429 ---- gtk_container_add(GTK_CONTAINER(frame), sw); ! gtk_widget_realize(viewport); gdk_window_set_events(viewport->window, gdk_window_get_events(viewport->window) | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); return sw; + } + + WindowHandle osCreateCompoundControl(WindowHandle form) + { + GtkWidget *sw, *viewport; + + sw = create_generic_window(); + gtk_fixed_put(GTK_FIXED(GTK_BIN(GTK_BIN(form)->child)->child), sw, 0, 0); + + viewport = GTK_BIN(sw)->child; + gtk_widget_realize(viewport); + gdk_window_set_events(viewport->window, gdk_window_get_events(viewport->window) + | GDK_BUTTON_RELEASE_MASK + | GDK_POINTER_MOTION_MASK + | GDK_ENTER_NOTIFY_MASK + | GDK_LEAVE_NOTIFY_MASK); + gtk_widget_show_all(sw); + + return sw; + } + + void osGetCompoundControlReqSize(WindowHandle listbox, int *res) + { + res[0] = 10; + res[1] = 10; } |
From: <kr_...@us...> - 2003-08-22 07:17:48
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv15930/gio/src/Graphics/UI/GIO Modified Files: Controls.hs Log Message: Simplified API for RadioBox. The new API is much like the API for ToolGroup and MenuGroup Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Controls.hs 20 Aug 2003 22:22:30 -0000 1.20 --- Controls.hs 21 Aug 2003 17:34:02 -0000 1.21 *************** *** 61,76 **** , ProgressBar, hProgressBar, vProgressBar ! -- ** CheckGroup ! , CheckGroup, checkGroup, checkLayout ! -- ** RadioGroup ! , RadioGroup, radioGroup, radioLayout -- ** CompoundControl , CompoundControl, compoundControl - - -- * Primitive - , Check, check - , Radio, radio, radioSingleSelect ) where --- 61,72 ---- , ProgressBar, hProgressBar, vProgressBar ! -- ** CheckBox ! , CheckBox, checkBox ! -- ** RadioBox ! , RadioBox, radioBox, setRadioBoxGroup -- ** CompoundControl , CompoundControl, compoundControl ) where *************** *** 392,525 **** = newControlCommandEvent lbhandle ! {-------------------------------------------------------------------- ! Check group ! --------------------------------------------------------------------} ! -- | A check control group. ! data CheckGroup = CheckGroup{ checks :: [Check] ! , cgparent :: !WindowHandle ! , cglayout :: Var ([Check] -> Layout) ! } ! ! -- | Create a new check control group that is initially layed out vertically. ! -- The items are specified by their label, their initial check state and their ! -- event handlers (that receive the current check state as an argument). ! checkGroup :: Container w => [(String,Bool,Bool -> IO ())] -> [Prop CheckGroup] -> w -> IO CheckGroup ! checkGroup items props w ! = do cg <- do cs <- mapM (\(txt,c,cmd) -> check txt [checked =: c, on command =:: checkCommand cmd] w) items ! cglayout <- newVar vertical ! return (CheckGroup cs (hwindow w) cglayout) ! set cg props ! cs <- get cg selection ! set cg [selection =: cs] -- invoke all handlers once ! return cg ! where ! checkCommand cmd c ! = do ischecked <- get c checked ! cmd ischecked ! ! -- | Change the layout of the check controls. For example: ! -- ! -- > do w <- window [] ! -- > cg <- checkGroup [...] [checkLayout =: horizontal] w ! -- ! checkLayout :: Attr CheckGroup ([Check] -> Layout) ! checkLayout ! = newAttr (\w -> getVar (cglayout w)) ! (\w f -> do setVar (cglayout w) f; Port.fireWindowReLayout (cgparent w)) ! ! instance MultiSelect CheckGroup where ! selection ! = newAttr getter setter ! where ! getter w ! = do cs <- mapM (\c -> get c checked) (checks w) ! return (map fst (filter snd (zip [0..] cs))) ! ! setter w xs ! = mapM_ select (zip [0..] (checks w)) ! where ! select (idx,c) = set c [checked =: (elem idx xs)] ! ! instance Control CheckGroup where ! pack w = stdPackChangingLayout (cgparent w) (do f <- getVar (cglayout w); return (f (checks w))) ! ! ! {-------------------------------------------------------------------- ! Radio group ! --------------------------------------------------------------------} ! -- | A radio control group. Only ! -- one control can be selected at any time. ! data RadioGroup = RadioGroup{ radios :: [Radio] ! , commands:: [IO ()] ! , gparent :: !WindowHandle ! , gselect :: Var Int ! , glayout :: Var ([Radio] -> Layout) ! } ! ! -- | Create a new radio control group that is initially layed out vertically. ! radioGroup :: Container w => [(String,IO ())] -> [Prop RadioGroup] -> w -> IO RadioGroup ! radioGroup items props w ! = do rg <- do rs <- mapM (\(first,(txt,cmd)) -> radioEx first txt [] w) (zip (True:repeat False) items) ! glayout <- newVar vertical ! gselect <- newVar 0 ! return (RadioGroup rs (map snd items) (hwindow w) gselect glayout) ! mapM_ (select rg) (zip [0..] (radios rg)) ! set rg [selected =: 0] ! set rg props ! return rg ! where ! select rg (i,r) ! = set r [on command =: set rg [selected =: i]] ! ! ! -- | Change the layout of the radio controls. For example: ! -- ! -- > do w <- window [] ! -- > rg <- radioGroup [("red",set w [color =: red]),("blue",set w [color =: blue])] ! -- > [radioLayout =: horizontal] w ! -- ! radioLayout :: Attr RadioGroup ([Radio] -> Layout) ! radioLayout ! = newAttr (\w -> getVar (glayout w)) ! (\w f -> do setVar (glayout w) f; Port.fireWindowReLayout (gparent w)) ! ! instance SingleSelect RadioGroup where ! selected ! = newAttr (\w -> getVar (gselect w)) setter ! where ! setter w i ! = do setVar (gselect w) idx ! mapM_ (select idx) (zip [0..] (radios w)) ! (commands w) !! idx ! where ! idx = bounded 0 (length (radios w)) i ! ! select idx (i,r) ! = set r [checked =: (i==idx)] ! ! ! instance Control RadioGroup where ! pack w = stdPackChangingLayout (gparent w) (do f <- getVar (glayout w); return (f (radios w))) ! ! ! ! {-------------------------------------------------------------------- ! Check box ! --------------------------------------------------------------------} -- | A single check control. ! data Check = Check{ chandle :: !WindowHandle ! , cparent :: !WindowHandle ! } -- | Create a check control with a certain label. ! check :: Container w => String -> [Prop Check] -> w -> IO Check ! check txt props w ! = do c <- do hcheck <- Port.createCheckBox (hwindow w) txt ! return (Check hcheck (hwindow w)) set c props return c ! instance Checked Check where checked = newAttr (\w -> Port.getCheckBoxSelectState (chandle w)) (\w b -> do Port.setCheckBoxSelectState (chandle w) b --- 388,412 ---- = newControlCommandEvent lbhandle ! -------------------------------------------------------------------- ! -- Check box ! -------------------------------------------------------------------- -- | A single check control. ! data CheckBox = CheckBox ! { chandle :: !WindowHandle ! , cparent :: !WindowHandle ! } -- | Create a check control with a certain label. ! checkBox :: Container w => [Prop CheckBox] -> w -> IO CheckBox ! checkBox props w ! = do c <- do hcheck <- Port.createCheckBox (hwindow w) ! return (CheckBox hcheck (hwindow w)) set c props return c + instance Titled CheckBox where + title = newAttr (Port.getCheckBoxText . chandle) (Port.setCheckBoxText . chandle) ! instance Checked CheckBox where checked = newAttr (\w -> Port.getCheckBoxSelectState (chandle w)) (\w b -> do Port.setCheckBoxSelectState (chandle w) b *************** *** 527,540 **** cmd) ! instance Commanding Check where command = newControlCommandEvent chandle ! instance Able Check where enabled = newAttr (Port.getControlEnabled . chandle) (Port.setControlEnabled . chandle) ! instance ToolTip Check where tooltip = newAttr (Port.getControlTip . chandle) (Port.setControlTip . chandle) ! instance Control Check where pack w = stdPack (cparent w) (Port.getCheckBoxRequestSize (chandle w)) (Port.moveResizeControl (chandle w)) --- 414,427 ---- cmd) ! instance Commanding CheckBox where command = newControlCommandEvent chandle ! instance Able CheckBox where enabled = newAttr (Port.getControlEnabled . chandle) (Port.setControlEnabled . chandle) ! instance ToolTip CheckBox where tooltip = newAttr (Port.getControlTip . chandle) (Port.setControlTip . chandle) ! instance Control CheckBox where pack w = stdPack (cparent w) (Port.getCheckBoxRequestSize (chandle w)) (Port.moveResizeControl (chandle w)) *************** *** 543,597 **** -------------------------------------------------------------------- -- | A single radio control. ! data Radio = Radio{ rhandle :: !WindowHandle ! , rparent :: !WindowHandle ! } ! ! -- | Create a radio control with a certain label. ! radio :: Container w => String -> [Prop Radio] -> w -> IO Radio ! radio txt props w ! = radioEx True txt props w ! -- | Create a radio control. Takes an extra argument that specifies ! -- that this is the first control in a group. ! radioEx :: Container w => Bool -> String -> [Prop Radio] -> w -> IO Radio ! radioEx first txt props w ! = do r <- do hradio <- Port.createRadioBox (hwindow w) first txt ! return (Radio hradio (hwindow w)) set r props return r ! instance Checked Radio where checked = newAttr (\w -> Port.getRadioBoxSelectState (rhandle w)) (\w b -> Port.setRadioBoxSelectState (rhandle w) b) ! instance Commanding Radio where command = newControlCommandEvent rhandle ! instance Able Radio where enabled = newAttr (Port.getControlEnabled . rhandle) (Port.setControlEnabled . rhandle) ! instance ToolTip Radio where tooltip = newAttr (Port.getControlTip . rhandle) (Port.setControlTip . rhandle) ! instance Control Radio where pack w = stdPack (rparent w) (Port.getRadioBoxRequestSize (rhandle w)) (Port.moveResizeControl (rhandle w)) -- | Connect a list of radio controls such that only one of them is selected ! -- at any time. Installs a new command handler on each of the controls, so the ! -- behaviour is undefined when a command handler for a control is updated after ! -- calling 'radioSingleSelect'. ! radioSingleSelect :: [Radio] -> IO () ! radioSingleSelect rs ! = mapM_ cmd (zip [0..] rs) ! where ! cmd (i,r) = do io <- get r (on command) ! set r [on command =: do mapM_ uncheck (minus rs i); io] ! ! uncheck r = set r [checked =: False] - minus xs i = take i rs ++ drop (i+1) rs - -------------------------------------------------------------------- -- Slider --- 430,471 ---- -------------------------------------------------------------------- -- | A single radio control. ! data RadioBox = RadioBox ! { rhandle :: !WindowHandle ! , rparent :: !WindowHandle ! } ! -- | Create a radio control. ! radioBox :: Container w => [Prop RadioBox] -> w -> IO RadioBox ! radioBox props w ! = do r <- do hradio <- Port.createRadioBox (hwindow w) ! return (RadioBox hradio (hwindow w)) set r props return r + instance Titled RadioBox where + title = newAttr (Port.getRadioBoxText . rhandle) (Port.setRadioBoxText . rhandle) ! instance Checked RadioBox where checked = newAttr (\w -> Port.getRadioBoxSelectState (rhandle w)) (\w b -> Port.setRadioBoxSelectState (rhandle w) b) ! instance Commanding RadioBox where command = newControlCommandEvent rhandle ! instance Able RadioBox where enabled = newAttr (Port.getControlEnabled . rhandle) (Port.setControlEnabled . rhandle) ! instance ToolTip RadioBox where tooltip = newAttr (Port.getControlTip . rhandle) (Port.setControlTip . rhandle) ! instance Control RadioBox where pack w = stdPack (rparent w) (Port.getRadioBoxRequestSize (rhandle w)) (Port.moveResizeControl (rhandle w)) -- | Connect a list of radio controls such that only one of them is selected ! -- at any time. ! setRadioBoxGroup :: [RadioBox] -> IO () ! setRadioBoxGroup items = Port.setRadioBoxGroup (map rhandle items) -------------------------------------------------------------------- -- Slider |
From: <kr_...@us...> - 2003-08-22 06:27:33
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv7892/src/Graphics/UI/GIO Modified Files: Window.hs Log Message: bugfix: the "view" attribute is added to the export list Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Window.hs 20 Aug 2003 21:37:26 -0000 1.22 --- Window.hs 21 Aug 2003 20:09:45 -0000 1.23 *************** *** 11,15 **** -} ----------------------------------------------------------------------------------------- ! module Graphics.UI.GIO.Window (Window, window, dialog, runDialog) where import qualified Graphics.UI.Port as Lib --- 11,15 ---- -} ----------------------------------------------------------------------------------------- ! module Graphics.UI.GIO.Window (Window, window, dialog, view, runDialog) where import qualified Graphics.UI.Port as Lib *************** *** 114,121 **** -- | The size of the current view area. view :: Attr Window Size ! view = newAttr (Lib.getWindowViewSize . hwindow) (Lib.setWindowViewSize . hwindow) ! instance Dismissible Window where dismissWidget w = Lib.dismissWindow (hwindow w) --- 114,121 ---- -- | The size of the current view area. view :: Attr Window Size ! view = newAttr (Lib.getWindowViewSize . hwindow) (Lib.setWindowViewSize . hwindow) ! instance Dismissible Window where dismissWidget w = Lib.dismissWindow (hwindow w) |
From: <kr_...@us...> - 2003-08-22 04:48:38
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv2646/src/Graphics/UI/GIO Modified Files: Controls.hs Log Message: comments Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Controls.hs 20 Aug 2003 21:37:26 -0000 1.19 --- Controls.hs 20 Aug 2003 22:22:30 -0000 1.20 *************** *** 13,26 **** --- 13,73 ---- module Graphics.UI.GIO.Controls( -- * Controls + -- ** Button + -- | A button control is a small, rectangular child window that can be + -- clicked on and off. Buttons can be labeled or appear without text. + -- A button typically changes appearance when the user clicks it. Button, button + + -- ** Label + -- | A label control simply displays a text string and it can be used + -- to label other controls. A label control can\'t take input and can\'t provide output. , Label, label + + -- ** Entry + -- | An entry control is a rectangular widget in which the user can enter text. , Entry, entry, readOnly, visible + + -- ** Popup + -- | A popup control consists of a list box combined with a label control. + -- The list box portion of the control drop down only when the user selects + -- the drop-down arrow next to the control. The currently selected item in the + -- list box is displayed in the label control. , Popup, popup + + -- ** ListBox + -- | A list box displays a list of items, that the user can view and select. + -- In a single-selection list box, the user can select only one item. + -- In a multiple-selection list box, a range of items can be selected. + -- When the user selects an item, it is highlighted and the list box + -- the 'command' event is generated. , ListBox, listBox + + -- ** Slider + -- | A slider control is a widget containing a slider and tick marks. + -- When the user moves the slider, using either the mouse or the direction keys, + -- the control generates the 'command' event to indicate the change. + -- Slider controls are useful when you want the user to select a discrete value + -- in a given range. The slider can be vertical or horizontal. , Slider, hslider, vslider + + -- ** ProgressBar + -- | A progress bar control is a window that an application can use to + -- indicate the progress of a lengthy operation. It consists of a rectangle + -- that is gradually filled, from left to right, with the system specified color + -- as an operation progresses. A progress bar control has a range and a current + -- position. The range represents the entire duration of the operation, and the + -- current position represents the progress the application has made toward + -- completing the operation. , ProgressBar, hProgressBar, vProgressBar + + -- ** CheckGroup , CheckGroup, checkGroup, checkLayout + + -- ** RadioGroup , RadioGroup, radioGroup, radioLayout + + -- ** CompoundControl , CompoundControl, compoundControl + -- * Primitive , Check, check |
From: <kr_...@us...> - 2003-08-22 04:26:51
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv26881/port/src/include Modified Files: Window.h Log Message: Implementation for CompoundControl Index: Window.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Window.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Window.h 15 Jul 2003 19:00:30 -0000 1.8 --- Window.h 20 Aug 2003 21:37:27 -0000 1.9 *************** *** 66,69 **** --- 66,71 ---- WindowHandle osCreateWindow(); WindowHandle osCreateDialog(WindowHandle parent); + WindowHandle osCreateCompoundControl(WindowHandle form); + void osGetCompoundControlReqSize(WindowHandle listbox, int *res); void osSetWindowColor(WindowHandle window, int foreColor, int backColor, int hatchStyle, BitmapHandle patBmp); char *osGetWindowTitle(WindowHandle window); |
From: <kr_...@us...> - 2003-08-22 02:30:49
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv26881/port/src/cbits/Win32 Modified Files: Util.c Window.c Log Message: Implementation for CompoundControl Index: Util.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Util.c 15 Aug 2003 16:40:01 -0000 1.17 --- Util.c 20 Aug 2003 21:37:26 -0000 1.18 *************** *** 32,35 **** --- 32,36 ---- extern LRESULT CALLBACK HMDIFrameFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); extern LRESULT CALLBACK HMDIWindowFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); + extern LRESULT CALLBACK HCompoundControlFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); extern LRESULT CALLBACK HDialogFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); extern LRESULT CALLBACK HDockBarFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); *************** *** 110,113 **** --- 111,127 ---- wc.lpszMenuName = NULL; wc.lpszClassName = "HMDIWINDOW"; + RegisterClass(&wc); + + // CompoundControl class + wc.style = CS_DBLCLKS; + wc.lpfnWndProc = HCompoundControlFunction; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = ghModule; + wc.hIcon = NULL; + wc.hCursor = LoadCursor (NULL, IDC_ARROW); + wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE+1); // For best results (Petzold) + wc.lpszMenuName = NULL; + wc.lpszClassName = "HCOMPOUND"; RegisterClass(&wc); Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Window.c 17 Aug 2003 16:43:57 -0000 1.38 --- Window.c 20 Aug 2003 21:37:27 -0000 1.39 *************** *** 684,687 **** --- 684,692 ---- } + LRESULT CALLBACK HCompoundControlFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) + { + return HWindowSharedFunction(DefMDIChildProc, hWnd, uMsg, wParam, lParam); + } + void osInvalidateWindow(WindowHandle window) { *************** *** 779,782 **** --- 784,810 ---- return CreateDialogIndirectParam (ghModule, (LPCDLGTEMPLATE) dlgtemplate, parent, (DLGPROC) NULL, (LPARAM) 0); }; + + WindowHandle osCreateCompoundControl(WindowHandle form) + { + HWND hWnd; + + hWnd = CreateWindow( + "HCOMPOUND", + NULL, + WS_CHILD | WS_BORDER | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL, + 0,0,0,0, + form, + NULL, + ghModule, + NULL + ); + return checkWindow(hWnd, "HCOMPOUND"); + }; + + void osGetCompoundControlReqSize(WindowHandle listbox, int *res) + { + res[0] = 10; + res[1] = 10; + } void osSetWindowColor(WindowHandle window, int foreColor, int backColor, int hatchStyle, BitmapHandle patBmp) |