|
From: <kr_...@us...> - 2003-03-26 15:40:23
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv16051/port/src/Port
Modified Files:
Controls.hs Window.hs
Log Message:
This commit implements instances for Able type class for all kinds of windows and controls.
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Controls.hs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Controls.hs 27 Jan 2003 22:02:38 -0000 1.8
--- Controls.hs 26 Mar 2003 15:39:47 -0000 1.9
***************
*** 31,34 ****
--- 31,35 ----
moveResizeControl
, getControlFrame
+ , setControlEnabled, getControlEnabled
-- * Label
, createLabel, getLabelRequestSize
***************
*** 67,72 ****
! {-----------------------------------------------------------------------------------------
!
-----------------------------------------------------------------------------------------}
-- | Change the position and size of a control.
--- 68,73 ----
! -----------------------------------------------------------------------------------------
! -- Generic
-----------------------------------------------------------------------------------------}
-- | Change the position and size of a control.
***************
*** 84,90 ****
foreign import ccall osGetControlRect :: WindowHandle -> Ptr CInt -> IO ()
! {-----------------------------------------------------------------------------------------
!
! -----------------------------------------------------------------------------------------}
-- | Create a label (i.e. just text).
foreign import ccall "osCreateLabel" createLabel :: WindowHandle -> IO WindowHandle
--- 85,94 ----
foreign import ccall osGetControlRect :: WindowHandle -> Ptr CInt -> IO ()
! foreign import ccall unsafe "osSetControlEnabled" setControlEnabled :: WindowHandle -> Bool -> IO ()
! foreign import ccall unsafe "osGetControlEnabled" getControlEnabled :: WindowHandle -> IO Bool
!
! -----------------------------------------------------------------------------------------
! -- Label
! -----------------------------------------------------------------------------------------
-- | Create a label (i.e. just text).
foreign import ccall "osCreateLabel" createLabel :: WindowHandle -> IO WindowHandle
***************
*** 107,113 ****
foreign import ccall osSetLabelText :: WindowHandle -> CString -> IO ()
! {-----------------------------------------------------------------------------------------
!
! -----------------------------------------------------------------------------------------}
-- | Create a button control. An event handler for button clicks can be
-- installed with 'registerButtonClick'.
--- 111,117 ----
foreign import ccall osSetLabelText :: WindowHandle -> CString -> IO ()
! -----------------------------------------------------------------------------------------
! -- Button
! -----------------------------------------------------------------------------------------
-- | Create a button control. An event handler for button clicks can be
-- installed with 'registerButtonClick'.
***************
*** 131,137 ****
foreign import ccall osSetButtonText :: WindowHandle -> CString -> IO ()
! {-----------------------------------------------------------------------------------------
!
! -----------------------------------------------------------------------------------------}
-- | Create a check box with a label.
-- An event handler for check box clicks can be
--- 135,141 ----
foreign import ccall osSetButtonText :: WindowHandle -> CString -> IO ()
! -----------------------------------------------------------------------------------------
! -- CheckBox
! -----------------------------------------------------------------------------------------
-- | Create a check box with a label.
-- An event handler for check box clicks can be
***************
*** 158,164 ****
! {-----------------------------------------------------------------------------------------
!
! -----------------------------------------------------------------------------------------}
-- | Create an edit control.
foreign import ccall "osCreateEdit" createEdit :: WindowHandle -> IO WindowHandle
--- 162,168 ----
! -----------------------------------------------------------------------------------------
! -- EditBox
! -----------------------------------------------------------------------------------------
-- | Create an edit control.
foreign import ccall "osCreateEdit" createEdit :: WindowHandle -> IO WindowHandle
***************
*** 179,185 ****
foreign import ccall osSetEditText :: WindowHandle -> CString -> IO ()
! {-----------------------------------------------------------------------------------------
! Radio box
! -----------------------------------------------------------------------------------------}
-- | Create a radio box. Takes a parent window handle, whether it is the first
-- radio control of its group and a label as its arguments.
--- 183,189 ----
foreign import ccall osSetEditText :: WindowHandle -> CString -> IO ()
! -----------------------------------------------------------------------------------------
! -- RadioBox
! -----------------------------------------------------------------------------------------
-- | Create a radio box. Takes a parent window handle, whether it is the first
-- radio control of its group and a label as its arguments.
***************
*** 208,214 ****
! {-----------------------------------------------------------------------------------------
! List box
! -----------------------------------------------------------------------------------------}
-- | Create a new list box. Takes an boolean argument that is 'True' when multiple
-- selection are allowed.
--- 212,218 ----
! -----------------------------------------------------------------------------------------
! -- ListBox
! -----------------------------------------------------------------------------------------
-- | Create a new list box. Takes an boolean argument that is 'True' when multiple
-- selection are allowed.
***************
*** 265,271 ****
foreign import ccall osSetListBoxItemSelectState :: WindowHandle -> CInt -> CBool -> IO ()
! {-----------------------------------------------------------------------------------------
! Popup
! -----------------------------------------------------------------------------------------}
-- | Create a new popup box.
-- An event handler for pop up clicks can be
--- 269,275 ----
foreign import ccall osSetListBoxItemSelectState :: WindowHandle -> CInt -> CBool -> IO ()
! -----------------------------------------------------------------------------------------
! -- Popup
! -----------------------------------------------------------------------------------------
-- | Create a new popup box.
-- An event handler for pop up clicks can be
Index: Window.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Window.hs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Window.hs 24 Mar 2003 16:58:33 -0000 1.6
--- Window.hs 26 Mar 2003 15:39:48 -0000 1.7
***************
*** 28,35 ****
, setWindowColor
, setWindowDomainSize
! , setWindowViewSize, getWindowViewSize
! , setWindowTitle, getWindowTitle
! , setWindowPageSize, getWindowPageSize
! , setWindowLineSize, getWindowLineSize
-- * Canvas
, getWindowCanvasHandle
--- 28,36 ----
, setWindowColor
, setWindowDomainSize
! , setWindowViewSize, getWindowViewSize
! , setWindowTitle, getWindowTitle
! , setWindowPageSize, getWindowPageSize
! , setWindowLineSize, getWindowLineSize
! , setWindowEnabled, getWindowEnabled
-- * Canvas
, getWindowCanvasHandle
***************
*** 212,215 ****
--- 213,219 ----
osSetWindowLineSize hwnd cw ch
foreign import ccall osSetWindowLineSize :: WindowHandle -> CInt -> CInt -> IO ()
+
+ foreign import ccall unsafe "osSetWindowEnabled" setWindowEnabled :: WindowHandle -> Bool -> IO ()
+ foreign import ccall unsafe "osGetWindowEnabled" getWindowEnabled :: WindowHandle -> IO Bool
-- | Get a canvas handle to draw directly on the window. In general however, one should
|