From: <kr_...@us...> - 2003-08-21 21:39:24
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv15930/port/src/Port 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/port/src/Port/Controls.hs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Controls.hs 20 Aug 2003 21:37:26 -0000 1.17 --- Controls.hs 21 Aug 2003 17:34:01 -0000 1.18 *************** *** 55,64 **** --- 55,67 ---- -- * Check box , createCheckBox, getCheckBoxRequestSize + , getCheckBoxText, setCheckBoxText , getCheckBoxSelectState , setCheckBoxSelectState -- * Radio item , createRadioBox, getRadioBoxRequestSize + , getRadioBoxText, setRadioBoxText , setRadioBoxSelectState , getRadioBoxSelectState + , setRadioBoxGroup -- * Pop up box , createPopUp, getPopUpRequestSize *************** *** 147,151 **** ----------------------------------------------------------------------------------------- -- | Create a button control. An event handler for button clicks can be ! -- installed with 'registerButtonClick'. foreign import ccall "osCreateButton" createButton :: WindowHandle -> IO WindowHandle --- 150,154 ---- ----------------------------------------------------------------------------------------- -- | Create a button control. An event handler for button clicks can be ! -- installed with 'setControlCommandHandler'. foreign import ccall "osCreateButton" createButton :: WindowHandle -> IO WindowHandle *************** *** 170,179 **** -- CheckBox ----------------------------------------------------------------------------------------- ! -- | Create a check box with a label. ! -- An event handler for check box clicks can be ! -- installed with 'registerCheckBoxClick'. ! createCheckBox :: WindowHandle -> String -> IO WindowHandle ! createCheckBox hwnd label = withCString label (osCreateCheckBox hwnd) ! foreign import ccall osCreateCheckBox :: WindowHandle -> CString -> IO WindowHandle getCheckBoxRequestSize :: WindowHandle -> IO Size --- 173,179 ---- -- CheckBox ----------------------------------------------------------------------------------------- ! -- | Create a check box. An event handler for check box clicks can be ! -- installed with 'setControlCommandHandler'. ! foreign import ccall "osCreateCheckBox" createCheckBox :: WindowHandle -> IO WindowHandle getCheckBoxRequestSize :: WindowHandle -> IO Size *************** *** 181,184 **** --- 181,192 ---- foreign import ccall osGetCheckBoxReqSize :: WindowHandle -> Ptr CInt -> IO () + getCheckBoxText :: WindowHandle -> IO String + getCheckBoxText hwnd = resultCString (osGetCheckBoxText hwnd) + foreign import ccall osGetCheckBoxText :: WindowHandle -> IO CString + + setCheckBoxText :: WindowHandle -> String -> IO () + setCheckBoxText hwnd txt = withCString txt (osSetCheckBoxText hwnd) + foreign import ccall osSetCheckBoxText :: WindowHandle -> CString -> IO () + getCheckBoxSelectState :: WindowHandle -> IO Bool getCheckBoxSelectState hwnd *************** *** 228,235 **** -- radio control of its group and a label as its arguments. -- An event handler for radio box clicks can be ! -- installed with 'registerRadioBoxClick'. ! createRadioBox :: WindowHandle -> Bool -> String -> IO WindowHandle ! createRadioBox hwnd selected label = withCString label (osCreateRadioBox hwnd selected) ! foreign import ccall osCreateRadioBox :: WindowHandle -> Bool -> CString -> IO WindowHandle getRadioBoxRequestSize :: WindowHandle -> IO Size --- 236,241 ---- -- radio control of its group and a label as its arguments. -- An event handler for radio box clicks can be ! -- installed with 'setControlCommandHandler'. ! foreign import ccall "osCreateRadioBox" createRadioBox :: WindowHandle -> IO WindowHandle getRadioBoxRequestSize :: WindowHandle -> IO Size *************** *** 237,240 **** --- 243,254 ---- foreign import ccall osGetRadioBoxReqSize :: WindowHandle -> Ptr CInt -> IO () + getRadioBoxText :: WindowHandle -> IO String + getRadioBoxText hwnd = resultCString (osGetRadioBoxText hwnd) + foreign import ccall osGetRadioBoxText :: WindowHandle -> IO CString + + setRadioBoxText :: WindowHandle -> String -> IO () + setRadioBoxText hwnd txt = withCString txt (osSetRadioBoxText hwnd) + foreign import ccall osSetRadioBoxText :: WindowHandle -> CString -> IO () + getRadioBoxSelectState :: WindowHandle -> IO Bool getRadioBoxSelectState hwnd *************** *** 247,250 **** --- 261,268 ---- foreign import ccall osSetRadioBoxState :: WindowHandle -> CBool -> IO () + setRadioBoxGroup :: [WindowHandle] -> IO () + setRadioBoxGroup handles = withArray0 nullHandle handles osSetRadioBoxGroup + foreign import ccall osSetRadioBoxGroup :: Ptr WindowHandle -> IO () + ----------------------------------------------------------------------------------------- *************** *** 254,258 **** -- selection are allowed. -- An event handler for list box clicks can be ! -- installed with 'registerListBoxClick'. foreign import ccall "osCreateListBox" createListBox :: WindowHandle -> Bool -> IO WindowHandle --- 272,276 ---- -- selection are allowed. -- An event handler for list box clicks can be ! -- installed with 'setControlCommandHandler'. foreign import ccall "osCreateListBox" createListBox :: WindowHandle -> Bool -> IO WindowHandle *************** *** 308,312 **** -- | Create a new popup box. -- An event handler for pop up clicks can be ! -- installed with 'registerPopUpClick'. foreign import ccall "osCreatePopUp" createPopUp :: WindowHandle -> IO WindowHandle --- 326,330 ---- -- | Create a new popup box. -- An event handler for pop up clicks can be ! -- installed with 'setControlCommandHandler'. foreign import ccall "osCreatePopUp" createPopUp :: WindowHandle -> IO WindowHandle |