From: George H. <geo...@us...> - 2013-03-15 00:23:09
|
Update of /cvsroot/win32forth/win32forth/src In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12034 Modified Files: CONTROL.F Dialog.f GENERIC.F Window.f Log Message: moved style and addstyle: to control. moved on_init and on_done to generic-window and other factoring Index: Window.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/Window.f,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Window.f 14 Feb 2013 20:05:48 -0000 1.28 --- Window.f 15 Mar 2013 00:23:06 -0000 1.29 *************** *** 380,391 **** then ;M ! :M On_Init: ( -- ) ! \ *G Thing's to do during creation of the window. ! \ ** Default does nothing. ! ;M ! ! :M On_Done: ( -- ) ! \ *G Thing's to do when the window will be destroyed. Default does nothing. ! ;M \ *E Your On_Init: and On_Done: methods should look like this: --- 380,384 ---- then ;M ! \ *P On_Init: and On_Done were moved to Generic-Window. \ *E Your On_Init: and On_Done: methods should look like this: *************** *** 427,433 **** Close: [ self ] ;M - :M WM_CREATE ( hwnd msg wparam lparam -- res ) - On_Init: [ self ] 0 ;M - :M WM_DESTROY ( hwnd msg wparam lparam -- res ) On_Done: [ self ] --- 420,423 ---- *************** *** 882,897 **** hWnd Call EnableWindow drop ;M - :M GetWindowRect: ( -- left top right bottom ) - \ *G The GetWindowRect method retrieves the dimensions of the bounding rectangle of the window. - \ ** The dimensions are given in screen coordinates that are relative to the upper-left corner - \ of the screen. - hWnd - if EraseRect: WinRect - WinRect hWnd Call GetWindowRect ?win-error - Left: WinRect Top: WinRect - Right: WinRect Bottom: WinRect - else 0 0 0 0 - then ;M - :M SetTitle: { adr len \ temp$ -- } \ *G Set the window title. --- 872,875 ---- Index: Dialog.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/Dialog.f,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Dialog.f 9 Jun 2012 18:45:47 -0000 1.7 --- Dialog.f 15 Mar 2013 00:23:06 -0000 1.8 *************** *** 162,166 **** :M On_Init: ( hwndfocus -- f ) \ *G Init the dialog ! drop 1 ;M \ -------------------- Process Commands from Controls -------------------- --- 162,166 ---- :M On_Init: ( hwndfocus -- f ) \ *G Init the dialog ! drop true ;M \ -------------------- Process Commands from Controls -------------------- Index: CONTROL.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/CONTROL.F,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CONTROL.F 9 Jun 2012 18:45:47 -0000 1.13 --- CONTROL.F 15 Mar 2013 00:23:06 -0000 1.14 *************** *** 78,88 **** between and ; \ *W <a name="Control"></a> \ *S Generic Control class ! :Class Control <Super Generic-Window \ *G Generic control class. \n \ ** Since Control is a generic class it should not be used to create \ ** any instances. \ The following definition must directly precede old-wndproc to work correctly code (old-wndproc) ( ^control -- old-wndproc ) \ address of old window prodedure --- 78,92 ---- between and ; + in-system + \ *W <a name="Control"></a> \ *S Generic Control class ! |Class Control <Super Generic-Window \ *G Generic control class. \n \ ** Since Control is a generic class it should not be used to create \ ** any instances. + in-previous + \ The following definition must directly precede old-wndproc to work correctly code (old-wndproc) ( ^control -- old-wndproc ) \ address of old window prodedure *************** *** 101,104 **** --- 105,109 ---- int timerclosed? \ has popup been closed int auto-close? \ does info window automatically close after a time? + int style max-binfo 1+ bytes binfo *************** *** 141,144 **** --- 146,150 ---- 0 to handleofparent 0 to old-wndproc + 0 to style unique-id to id z" " to title *************** *** 175,178 **** --- 181,189 ---- [ WS_CHILD WS_VISIBLE or ] literal ;M + :M AddStyle: ( n -- ) + \ *G Set any additional style of the control. Must be done before the control + \ ** is created. + to style ;M + :M StartSize: ( -- width height ) \ *G Get the start size of this control. \n *************** *** 312,315 **** --- 323,340 ---- ;M + :M WM_DESTROY + On_Done: [ self ] + old-wndproc CallWindowProc + 0 to hWnd + ;M + + :M Enable: ( f -- ) + \ *G Enable the control. + ID EnableDlgItem: parent ;M + + :M Disable: ( -- ) + \ *G Disable the control. + false Enable: self ;M + ;Class \ *G End of Control class Index: GENERIC.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/GENERIC.F,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** GENERIC.F 9 Jun 2012 18:45:47 -0000 1.27 --- GENERIC.F 15 Mar 2013 00:23:06 -0000 1.28 *************** *** 181,185 **** :M ZeroWindow: ( -- ) ! \ *G Clear the window handle. Normally handled by the system. At all window \ ** handles are zeroed automatically in the image when saving. 0 to hWnd ;M --- 181,185 ---- :M ZeroWindow: ( -- ) ! \ *G Clear the window handle. Normally handled by the system. All window \ ** handles are zeroed automatically in the image when saving. 0 to hWnd ;M *************** *** 641,644 **** --- 641,658 ---- msg-chain chain-add DoDialogMsg + \ moved here for both windows and controls + + :M WM_CREATE ( hwnd msg wparam lparam -- res ) + On_Init: [ self ] false ;M + + :M On_Init: ( -- ) + \ *G Thing's to do during creation of the window. + \ ** Default does nothing. + ;M + + :M On_Done: ( -- ) + \ *G Thing's to do when the window will be destroyed. Default does nothing. + ;M + ;CLASS \ *G End of generic-window class |