From: <kr_...@us...> - 2003-03-26 08:54:59
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv28204a/src/Graphics/UI/GIO Modified Files: Attributes.hs Events.hs Window.hs Log Message: Added support for ProcessDismiss and ProcessDestroy events Index: Attributes.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Attributes.hs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Attributes.hs 25 Mar 2003 23:35:07 -0000 1.5 --- Attributes.hs 26 Mar 2003 08:54:55 -0000 1.6 *************** *** 40,44 **** -- * Attributes and properties Attr, Prop ! , set, get, with, (=:), (~:), (=::), (~::) -- * Common widget classes --- 40,44 ---- -- * Attributes and properties Attr, Prop ! , set1, set, get, with, (=:), (~:), (=::), (~::) -- * Common widget classes Index: Events.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Events.hs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Events.hs 25 Mar 2003 23:37:02 -0000 1.5 --- Events.hs 26 Mar 2003 08:54:55 -0000 1.6 *************** *** 9,13 **** Many widgets can respond to /events/. ! There are many basic events: 'closing', 'mouse', 'keyboard', 'paint', etc. Not all widgets respond to every event and the events are divided in seperate classes, like 'Reactive' and 'Commanding'. --- 9,13 ---- Many widgets can respond to /events/. ! There are many basic events: 'mouse', 'keyboard', 'paint', etc. Not all widgets respond to every event and the events are divided in seperate classes, like 'Reactive' and 'Commanding'. *************** *** 66,72 **** -- ** Reactive , Reactive ! , closing, mouse, keyboard -- ** Form ! , Form, dismiss, activate, deactivate, scroll, resize -- ** Paint , Paint, paint, repaint --- 66,75 ---- -- ** Reactive , Reactive ! , mouse, keyboard -- ** Form ! , Form, activate, deactivate, scroll, resize ! -- ** Deadly ! , Deadly ! , destroy, dismiss -- ** Paint , Paint, paint, repaint *************** *** 88,101 **** -- * Internal -- ** Standard events ! -- *** Forms ! , newDismissEvent , newActivateEvent , newDeactivateEvent , newScrollEvent , newResizeEvent ! -- *** Reactive ! , newClosingEvent , newMouseEvent , newKeyboardEvent -- *** Controls , newControlCommandEvent --- 91,104 ---- -- * Internal -- ** Standard events ! -- *** Forms , newActivateEvent , newDeactivateEvent , newScrollEvent , newResizeEvent ! -- *** Reactive , newMouseEvent , newKeyboardEvent + , newDismissEvent + , newDestroyEvent -- *** Controls , newControlCommandEvent *************** *** 148,153 **** -- | A form is a visible window on the screen. class Form w where - -- | The 'dismiss' event is called when the user tries to close the form. - dismiss :: Event w (IO ()) activate :: Event w (IO ()) deactivate:: Event w (IO ()) --- 151,154 ---- *************** *** 155,163 **** resize :: Event w (Size -> IO ()) ! -- | Reactive widgets react to mouse and keyboard events and fire the 'closing' event ! -- when they are closed. class Reactive w where - -- | The closing event is triggered when a widget is closed. - closing :: Event w (IO ()) mouse :: Event w (MouseEvent -> IO ()) keyboard :: Event w (KeyboardEvent -> IO ()) --- 156,168 ---- resize :: Event w (Size -> IO ()) ! -- | The Deadly widgets can be destroyed and dissmissed ! class Deadly w where ! -- | The 'dismiss' event is called when the user tries to close the form. ! dismiss :: Event w (IO ()) ! -- | The destroy event is triggered when a widget is destroied. ! destroy :: Event w (IO ()) ! ! -- | Reactive widgets react to mouse and keyboard events class Reactive w where mouse :: Event w (MouseEvent -> IO ()) keyboard :: Event w (KeyboardEvent -> IO ()) *************** *** 318,324 **** --------------------------------------------------------------------} -- Forms ! newDismissEvent, newActivateEvent, newDeactivateEvent :: StdWindowEvent w (IO ()) ! newDismissEvent = stdWindowEvent Lib.getWindowDismissHandler Lib.setWindowDismissHandler Lib.setWindowDismissDefHandler newActivateEvent = stdWindowEvent Lib.getWindowActivateHandler Lib.setWindowActivateHandler Lib.setWindowActivateDefHandler newDeactivateEvent= stdWindowEvent Lib.getWindowDeactivateHandler Lib.setWindowDeactivateHandler Lib.setWindowDeactivateDefHandler --- 323,330 ---- --------------------------------------------------------------------} -- Forms ! newActivateEvent :: StdWindowEvent w (IO ()) newActivateEvent = stdWindowEvent Lib.getWindowActivateHandler Lib.setWindowActivateHandler Lib.setWindowActivateDefHandler + + newDeactivateEvent:: StdWindowEvent w (IO ()) newDeactivateEvent= stdWindowEvent Lib.getWindowDeactivateHandler Lib.setWindowDeactivateHandler Lib.setWindowDeactivateDefHandler *************** *** 330,336 **** -- Reactive - newClosingEvent :: StdWindowEvent w (IO ()) - newClosingEvent = stdWindowEvent Lib.getWindowDestroyHandler Lib.setWindowDestroyHandler Lib.setWindowDestroyDefHandler - newMouseEvent :: StdWindowEvent w (MouseEvent -> IO ()) newMouseEvent = stdWindowEvent Lib.getWindowMouseHandler Lib.setWindowMouseHandler Lib.setWindowMouseDefHandler --- 336,339 ---- *************** *** 339,342 **** --- 342,352 ---- newKeyboardEvent = stdWindowEvent Lib.getWindowKeyboardHandler Lib.setWindowKeyboardHandler Lib.setWindowKeyboardDefHandler + -- Deadly + newDismissEvent :: StdWindowEvent w (IO ()) + newDismissEvent = stdWindowEvent Lib.getWindowDismissHandler Lib.setWindowDismissHandler Lib.setWindowDismissDefHandler + + newDestroyEvent :: StdWindowEvent w (IO ()) + newDestroyEvent = stdWindowEvent Lib.getWindowDestroyHandler Lib.setWindowDestroyHandler Lib.setWindowDestroyDefHandler + -- commands newControlCommandEvent :: StdWindowEvent w (IO ()) *************** *** 358,362 **** newMenuEvent getMenuHandle = newEvent (Lib.getMenuCommandHandler . getMenuHandle) (Lib.setMenuCommandHandler . getMenuHandle) (Lib.setMenuCommandDefHandler . getMenuHandle) - {-------------------------------------------------------------------- --- 368,371 ---- Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Window.hs 25 Mar 2003 23:37:03 -0000 1.6 --- Window.hs 26 Mar 2003 08:54:55 -0000 1.7 *************** *** 173,186 **** instance Reactive Window where - closing = newClosingEvent hwindow mouse = newMouseEvent hwindow keyboard = newKeyboardEvent hwindow ! instance Form Window where ! dismiss = newDismissEvent hwindow activate = newActivateEvent hwindow deactivate= newDeactivateEvent hwindow scroll = newScrollEvent hwindow resize = newResizeEvent hwindow instance Paint Window where --- 173,188 ---- instance Reactive Window where mouse = newMouseEvent hwindow keyboard = newKeyboardEvent hwindow ! instance Form Window where activate = newActivateEvent hwindow deactivate= newDeactivateEvent hwindow scroll = newScrollEvent hwindow resize = newResizeEvent hwindow + + instance Deadly Window where + dismiss = newDismissEvent hwindow + destroy = newDestroyEvent hwindow instance Paint Window where |