|
From: <kr_...@us...> - 2003-04-27 18:19:17
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv13973/port/src/Port
Modified Files:
Handlers.hs Window.hs
Log Message:
Proper event handling for dialogs
Index: Handlers.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Handlers.hs,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** Handlers.hs 23 Apr 2003 21:48:49 -0000 1.21
--- Handlers.hs 27 Apr 2003 18:19:13 -0000 1.22
***************
*** 278,282 ****
-- WindowDeactivate
-----------------------------------------------------------------------------------------
!
{-# NOINLINE handlersWindowDeactivate #-}
handlersWindowDeactivate :: MVar (PtrMap WindowHandle (IO ()))
--- 278,282 ----
-- WindowDeactivate
-----------------------------------------------------------------------------------------
!
{-# NOINLINE handlersWindowDeactivate #-}
handlersWindowDeactivate :: MVar (PtrMap WindowHandle (IO ()))
***************
*** 289,295 ****
setWindowDeactivateDefHandler :: WindowHandle -> IO ()
! setWindowDeactivateDefHandler hwnd
= setDefHandler hwnd handlersWindowDeactivate
!
getWindowDeactivateHandler :: WindowHandle -> IO (IO ())
getWindowDeactivateHandler hwnd
--- 289,295 ----
setWindowDeactivateDefHandler :: WindowHandle -> IO ()
! setWindowDeactivateDefHandler hwnd
= setDefHandler hwnd handlersWindowDeactivate
!
getWindowDeactivateHandler :: WindowHandle -> IO (IO ())
getWindowDeactivateHandler hwnd
***************
*** 300,307 ****
= invokeHandler hwnd handlersWindowDeactivate id
-----------------------------------------------------------------------------------------
-- WindowActivate
-----------------------------------------------------------------------------------------
!
{-# NOINLINE handlersWindowActivate #-}
handlersWindowActivate :: MVar (PtrMap WindowHandle (IO ()))
--- 300,311 ----
= invokeHandler hwnd handlersWindowDeactivate id
+ handleDialogDeactivate :: WindowHandle -> IO ()
+ handleDialogDeactivate hwnd
+ = invokeHandler hwnd handlersWindowDeactivate id
+
-----------------------------------------------------------------------------------------
-- WindowActivate
-----------------------------------------------------------------------------------------
!
{-# NOINLINE handlersWindowActivate #-}
handlersWindowActivate :: MVar (PtrMap WindowHandle (IO ()))
***************
*** 314,320 ****
setWindowActivateDefHandler :: WindowHandle -> IO ()
! setWindowActivateDefHandler hwnd
= setDefHandler hwnd handlersWindowActivate
!
getWindowActivateHandler :: WindowHandle -> IO (IO ())
getWindowActivateHandler hwnd
--- 318,324 ----
setWindowActivateDefHandler :: WindowHandle -> IO ()
! setWindowActivateDefHandler hwnd
= setDefHandler hwnd handlersWindowActivate
!
getWindowActivateHandler :: WindowHandle -> IO (IO ())
getWindowActivateHandler hwnd
***************
*** 327,330 ****
--- 331,338 ----
invokeHandler hwnd handlersWindowActivate id
+ handleDialogActivate :: WindowHandle -> IO ()
+ handleDialogActivate hwnd =
+ invokeHandler hwnd handlersWindowActivate id
+
-----------------------------------------------------------------------------------------
-- WindowPaint
***************
*** 342,348 ****
setWindowPaintDefHandler :: WindowHandle -> IO ()
! setWindowPaintDefHandler hwnd
= setDefHandler hwnd handlersWindowPaint
!
getWindowPaintHandler :: WindowHandle -> IO (CanvasHandle -> Rect -> IO ())
getWindowPaintHandler hwnd
--- 350,356 ----
setWindowPaintDefHandler :: WindowHandle -> IO ()
! setWindowPaintDefHandler hwnd
= setDefHandler hwnd handlersWindowPaint
!
getWindowPaintHandler :: WindowHandle -> IO (CanvasHandle -> Rect -> IO ())
getWindowPaintHandler hwnd
***************
*** 699,704 ****
foreign export ccall handleWindowMouse :: WindowHandle -> CInt -> CInt -> CInt -> CWord -> IO ()
foreign export ccall handleWindowKeyboard :: WindowHandle -> CInt -> CInt -> CWord -> IO ()
! foreign export ccall handleWindowDeactivate :: WindowHandle -> IO ()
! foreign export ccall handleWindowActivate :: WindowHandle -> IO ()
foreign export ccall handleWindowContextMenu :: WindowHandle -> CInt -> CInt -> CWord -> IO ()
foreign export ccall handleControlCommand :: WindowHandle -> IO ()
--- 707,714 ----
foreign export ccall handleWindowMouse :: WindowHandle -> CInt -> CInt -> CInt -> CWord -> IO ()
foreign export ccall handleWindowKeyboard :: WindowHandle -> CInt -> CInt -> CWord -> IO ()
! foreign export ccall handleWindowDeactivate :: WindowHandle -> IO ()
! foreign export ccall handleWindowActivate :: WindowHandle -> IO ()
! foreign export ccall handleDialogDeactivate :: WindowHandle -> IO ()
! foreign export ccall handleDialogActivate :: WindowHandle -> IO ()
foreign export ccall handleWindowContextMenu :: WindowHandle -> CInt -> CInt -> CWord -> IO ()
foreign export ccall handleControlCommand :: WindowHandle -> IO ()
***************
*** 709,711 ****
foreign export ccall handleTimerDestroy :: TimerHandle -> IO ()
foreign export ccall handleProcessDismiss :: IO ()
! foreign export ccall handleProcessDestroy :: IO ()
\ No newline at end of file
--- 719,721 ----
foreign export ccall handleTimerDestroy :: TimerHandle -> IO ()
foreign export ccall handleProcessDismiss :: IO ()
! foreign export ccall handleProcessDestroy :: IO ()
Index: Window.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Window.hs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Window.hs 26 Apr 2003 20:03:06 -0000 1.9
--- Window.hs 27 Apr 2003 18:19:13 -0000 1.10
***************
*** 100,105 ****
createDialog hparent = do
hwnd <- osCreateDialog hparent
! registerWindow hwnd
! setWindowPaintHandler hwnd onpaint
setWindowDismissHandler hwnd (destroyWindow hwnd)
return hwnd
--- 100,104 ----
createDialog hparent = do
hwnd <- osCreateDialog hparent
! setWindowPaintHandler hwnd onpaint
setWindowDismissHandler hwnd (destroyWindow hwnd)
return hwnd
|