From: Dirk B. <db...@us...> - 2006-05-14 09:54:29
|
Update of /cvsroot/win32forth/win32forth/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12484/src Modified Files: CHILDWND.F Window.f Log Message: Changed the window class. Now every window will become it's own window class name and it's own window class. Note: If the window class name is set with SetClassName: before the Start: method is called no default class name will be set. Index: Window.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/Window.f,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Window.f 13 May 2006 08:31:24 -0000 1.12 --- Window.f 14 May 2006 09:54:12 -0000 1.13 *************** *** 15,18 **** --- 15,19 ---- 0 value DefaultMenuBar \ Global default menubar + 0 value ClassNameID \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ *************** *** 92,98 **** ['] noop to dbl-click-func ['] noop to track-func ! s" ForthAppWindow" WindowClassName place ! WindowClassName +NULL ! addr: WinRect to wRect ;M --- 93,98 ---- ['] noop to dbl-click-func ['] noop to track-func ! WindowClassName MAXSTRING erase \ clear the class name ! addr: WinRect to wRect ;M *************** *** 225,229 **** dup @ \ window object pointer from ! \ first cell of CREATEPARMS 4 pick ( obj hwnd ) --- 225,229 ---- dup @ \ window object pointer from ! \ first cell of CREATEPARMS 4 pick ( obj hwnd ) *************** *** 263,267 **** ;Record ! : default-window-class ( -- ) \ fill in the defaults for the window class WndClassStyle: [ self ] to Style TheWndProc to wndProc --- 263,268 ---- ;Record ! : default-window-class ( -- ) ! \ Fill in the defaults for the window class. WndClassStyle: [ self ] to Style TheWndProc to wndProc *************** *** 275,282 **** WindowClassName 1+ to ClassName ; ! : register-the-class ( -- f ) \ register the class structure WndClass Call RegisterClass ; ! : register-frame-window ( -- f ) \ init the class and register it default-window-class register-the-class ; --- 276,300 ---- WindowClassName 1+ to ClassName ; ! : register-the-class ( -- f ) ! \ Register the window class. WndClass Call RegisterClass ; ! : default-class-name ( -- ) ! \ The a default window class name for this window. Every window ! \ will become it's own class name and it's own window class. ! \ Note: If the window class name is set with SetClassName: before ! \ the Start: method is called no default class name will be set. ! WindowClassName c@ 0= ! if s" w32fWindow-" WindowClassName place ! ClassNameID (.) WindowClassName +place ! WindowClassName +null ! 1 +to ClassNameID ! then ! \ cr ." The WindowClassName is: " WindowClassName count type ! ; ! ! : register-frame-window ( -- f ) ! \ Init the window class and register it. ! default-class-name default-window-class register-the-class ; *************** *** 308,311 **** --- 326,330 ---- ExWindowStyle: [ self ] \ extended window style Call CreateWindowEx + EraseRect: WinRect ; *************** *** 326,337 **** \ ** set the style member of the the WNDCLASS structure associated with the window. \ ** Default style is CS_DBLCLKS, CS_HREDRAW and CS_VREDRAW. [ CS_DBLCLKS CS_HREDRAW CS_VREDRAW or or ] literal ;M - : SetWndClassStyle ( -- ) - \ Set the style member of the the WNDCLASS structure associated with the window. - WndClassStyle: [ self ] GCL_STYLE SetClassLong: self ; - :M Start: ( -- ) \ *G Create the window. \ The default window class is appropriate for frame windows. Child \ windows will define their own window class. \n --- 345,359 ---- \ ** set the style member of the the WNDCLASS structure associated with the window. \ ** Default style is CS_DBLCLKS, CS_HREDRAW and CS_VREDRAW. + \ *P To prevent flicker on sizing of the window your method should return CS_DBLCLKS + \ ** only. [ CS_DBLCLKS CS_HREDRAW CS_VREDRAW or or ] literal ;M :M Start: ( -- ) \ *G Create the window. + \ *P Before the window is created a default window class name for this window will + \ ** be set. Every window will become it's own class name and it's own window class. + \ ** Note: If the window class name is set with SetClassName: before the Start: method + \ ** is called no default class name will be set. + \ The default window class is appropriate for frame windows. Child \ windows will define their own window class. \n *************** *** 344,349 **** if register-frame-window drop create-frame-window dup to hWnd ! if ! SW_SHOWNORMAL Show: self Update: self then --- 366,370 ---- if register-frame-window drop create-frame-window dup to hWnd ! if SW_SHOWNORMAL Show: self Update: self then *************** *** 352,356 **** :M On_Init: ( -- ) ! \ *G Thing's to do during creation of the window. Default does nothing. ;M --- 373,380 ---- :M On_Init: ( -- ) ! \ *G Thing's to do during creation of the window. ! \ ** The Default is setting the WNDCLASS style to the value ! \ ** the WndClassStyle: method returns. ! \ SetWndClassStyle ;M ;M *************** *** 397,404 **** Close: [ self ] ;M ! :M WM_CREATE On_Init: [ self ] 0 ;M ! :M WM_DESTROY On_Done: [ self ] DefWindowProc: [ self ] --- 421,428 ---- 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 ] DefWindowProc: [ self ] *************** *** 406,423 **** ;M ! :M SetClassName: ( adr len -- ) \ *G Set the window class name. WindowClassName place WindowClassName +NULL ;M ! :M GetClassName: ( -- adr len ) \ *G Get the window class name. WindowClassName count ;M ! :M SetParent: ( hwndParent -- ) \ *G Set owner window (0 if no parent). to Parent ;M ! :M ParentWindow: ( -- hwndparent | 0 if no parent ) \ *G Get owner window. Parent ;M --- 430,451 ---- ;M ! :M SetClassName: ( addr len -- ) \ *G Set the window class name. WindowClassName place WindowClassName +NULL ;M ! :M GetClassName: ( -- addr len ) \ *G Get the window class name. WindowClassName count ;M ! :M SetParent: ( Parent -- ) \ *G Set owner window (0 if no parent). + \ ** Note: The parent is the object address of the parent window + \ ** class not the window handle. to Parent ;M ! :M ParentWindow: ( -- Parent | 0 if no parent ) \ *G Get owner window. + \ ** Note: The parent is the object address of the parent window + \ ** class not the window handle. Parent ;M *************** *** 441,445 **** :M ExWindowStyle: ( -- extended_style ) \ *G User windows should override the ExWindowStyle: method to ! \ ** set the extended window style. Default is null. 0 ;M --- 469,473 ---- :M ExWindowStyle: ( -- extended_style ) \ *G User windows should override the ExWindowStyle: method to ! \ ** set the extended window style. Default is NULL. 0 ;M Index: CHILDWND.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/CHILDWND.F,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CHILDWND.F 13 May 2006 08:31:24 -0000 1.5 --- CHILDWND.F 14 May 2006 09:54:12 -0000 1.6 *************** *** 12,28 **** :CLASS Child-Window <Super Window \ *G Child-Window is the base class for all child windows. ! \ *P The windows have a parent, which is the object address, ! \ ** not the window handle. This allows the child to send messages ! \ ** to its parent. - \ int Parent \ window object that is the parent int id \ id for this child window - :M Classinit: ( -- ) - ClassInit: super - s" ChildWindow" WindowClassName place - WindowClassName +NULL - ;M - :M GetParent: ( -- parent ) \ *G Get the object address of the parent window. --- 12,21 ---- :CLASS Child-Window <Super Window \ *G Child-Window is the base class for all child windows. ! \ *P The windows has a parent, which is the object address, ! \ ** not the window handle. This allows the child to send ! \ ** messages to its parent. int id \ id for this child window :M GetParent: ( -- parent ) \ *G Get the object address of the parent window. *************** *** 61,66 **** NULL to hbrBackground NULL to MenuName WindowClassName 1+ to ClassName ! WndClass Call RegisterClass ; : create-child-window ( -- hWnd ) --- 54,64 ---- NULL to hbrBackground NULL to MenuName + + \ Set the window class name for this child window. Every window + \ will become it's own class name and it's own window class. + default-class-name WindowClassName 1+ to ClassName ! ! register-the-class ; : create-child-window ( -- hWnd ) *************** *** 95,100 **** register-child-window drop create-child-window dup to hWnd ! if ! SW_SHOWNORMAL Show: self then ;M --- 93,97 ---- register-child-window drop create-child-window dup to hWnd ! if SW_SHOWNORMAL Show: self then ;M |