From: <kr_...@us...> - 2004-05-29 23:00:56
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26069/port/src/Port Modified Files: Controls.hs Log Message: Complete support for splitters under Linux. The windows versions still isn't ready Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Controls.hs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Controls.hs 15 May 2004 06:45:45 -0000 1.30 --- Controls.hs 29 May 2004 23:00:10 -0000 1.31 *************** *** 1,3 **** ! {-# OPTIONS -fglasgow-exts -#include Button.h -#include CheckBox.h -#include EditBox.h -#include DateEntry.h -#include Label.h -#include ListBox.h -#include PopUp.h -#include RadioBox.h -#include Window.h -#include ProgressBar.h -#include Slider.h -#include Notebook.h -#include GroupBox.h -#include TrackBar.h #-} ----------------------------------------------------------------------------------------- {-| Module : Controls --- 1,3 ---- ! {-# OPTIONS -fglasgow-exts -#include Button.h -#include CheckBox.h -#include EditBox.h -#include DateEntry.h -#include Label.h -#include ListBox.h -#include PopUp.h -#include RadioBox.h -#include Window.h -#include ProgressBar.h -#include Slider.h -#include Notebook.h -#include GroupBox.h -#include TrackBar.h -#include Splitter.h #-} ----------------------------------------------------------------------------------------- {-| Module : Controls *************** *** 34,38 **** * CompoundControl ! * GroupBox --- 34,38 ---- * CompoundControl ! * GroupBox *************** *** 122,126 **** , createHorzSplitter, createVertSplitter , getSplitterRequestSize ! , setSplitterChildren ) where --- 122,127 ---- , createHorzSplitter, createVertSplitter , getSplitterRequestSize ! , getSplitterRange ! , getSplitterPosition, setSplitterPosition ) where *************** *** 135,139 **** ----------------------------------------------------------------------------------------- ! -- Generic -----------------------------------------------------------------------------------------} -- | Change the position and size of a control. --- 136,140 ---- ----------------------------------------------------------------------------------------- ! -- Generic -----------------------------------------------------------------------------------------} -- | Change the position and size of a control. *************** *** 341,345 **** foreign import ccall "osCreateListBox" createListBox :: WindowHandle -> Bool -> IO WindowHandle ! -- | Create a new checklist box. A "checklist box" displays a list of -- items where each item in the list has a check box next to it. -- The check list box is a similar to the normal list box with multi --- 342,346 ---- foreign import ccall "osCreateListBox" createListBox :: WindowHandle -> Bool -> IO WindowHandle ! -- | Create a new checklist box. A "checklist box" displays a list of -- items where each item in the list has a check box next to it. -- The check list box is a similar to the normal list box with multi *************** *** 619,627 **** ----------------------------------------------------------------------------------------- ! -- | Create a new horizontal splitter control. ! foreign import ccall "osCreateHorzSplitter" createHorzSplitter :: WindowHandle -> IO WindowHandle ! -- | Create a new vertical splitter control. ! foreign import ccall "osCreateVertSplitter" createVertSplitter :: WindowHandle -> IO WindowHandle getSplitterRequestSize :: WindowHandle -> IO Size --- 620,642 ---- ----------------------------------------------------------------------------------------- ! -- | Create a new horizontal or vertical splitter control. ! createHorzSplitter :: WindowHandle -- ^ The handle of the parent ! -> IO (WindowHandle,WindowHandle,WindowHandle) -- ^ The first handle in the tripple are the Splitter handle and the next ! -- two are the handles of first and second panes ! createHorzSplitter hwnd = allocaArray 2 $ \cpanes -> do ! hspl <- osCreateSplitter hwnd False cpanes ! [pane1,pane2] <- peekArray 2 cpanes ! return (hspl,pane1,pane2) ! -- | Create a new horizontal or vertical splitter control. ! createVertSplitter :: WindowHandle -- ^ The handle of the parent ! -> IO (WindowHandle,WindowHandle,WindowHandle) -- ^ The first handle in the tripple are the Splitter handle and the next ! -- two are the handles of first and second panes ! createVertSplitter hwnd = allocaArray 2 $ \cpanes -> do ! hspl <- osCreateSplitter hwnd True cpanes ! [pane1,pane2] <- peekArray 2 cpanes ! return (hspl,pane1,pane2) ! ! foreign import ccall osCreateSplitter :: WindowHandle -> Bool -> Ptr WindowHandle -> IO WindowHandle getSplitterRequestSize :: WindowHandle -> IO Size *************** *** 629,631 **** foreign import ccall osGetSplitterReqSize :: WindowHandle -> Ptr CInt -> IO () ! foreign import ccall "osSetSplitterChildren" setSplitterChildren :: WindowHandle -> WindowHandle -> WindowHandle -> IO () --- 644,654 ---- foreign import ccall osGetSplitterReqSize :: WindowHandle -> Ptr CInt -> IO () ! getSplitterRange :: WindowHandle -> IO (Int, Int) ! getSplitterRange hwnd = allocaArray 2 $ \ptr -> do ! pos <- osGetSplitterRange hwnd ptr ! [min,max] <- peekArray 2 ptr ! return (fromCInt min, fromCInt max) ! foreign import ccall osGetSplitterRange :: WindowHandle -> Ptr CInt -> IO () ! ! foreign import ccall "osSetSplitterPosition" setSplitterPosition :: WindowHandle -> Int -> IO () ! foreign import ccall "osGetSplitterPosition" getSplitterPosition :: WindowHandle -> IO Int |