From: Rod O. <rod...@us...> - 2006-06-06 20:24:23
|
Update of /cvsroot/win32forth/win32forth/demos In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1142/demos Modified Files: TabControlDemo.f Log Message: Rod: Eliminated flicker when resizing the window Index: TabControlDemo.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/demos/TabControlDemo.f,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TabControlDemo.f 4 Jun 2006 09:58:50 -0000 1.2 --- TabControlDemo.f 6 Jun 2006 17:41:15 -0000 1.3 *************** *** 19,28 **** --- 19,32 ---- :class TabControlEx <super TabControl + (( This has no effect for a control as the window class is already registered :M WndClassStyle: ( -- style ) \ Set the style member of the the WNDCLASS structure. CS_DBLCLKS ;M + )) :M Start: ( Parent -- ) Start: super + CS_DBLCLKS CS_GLOBALCLASS or GCL_STYLE hWnd Call SetClassLong drop + ( many controls don't have CS_HREDRAW and CS_VREDRAW set, this one does and will not redraw properly without help! ) DEFAULT_GUI_FONT call GetStockObject SetFont: self ;M *************** *** 57,68 **** LV_COLUMN lvc :M ReSize: ( -- ) \ Resize the controls within the main window. ! AutoSize: cTab ! ClientSize: cTab 2over d- ( x y w h ) ! 4dup Move: cFileList ! Move: cBrowserList ! ;M :M On_Size: ( -- ) --- 61,87 ---- LV_COLUMN lvc + :M WindowStyle: ( -- style ) + WindowStyle: super + WS_CLIPCHILDREN or + ;M + + :M WndClassStyle: ( -- style ) + \ Set the style member of the the WNDCLASS structure. + CS_DBLCLKS ;M + :M ReSize: ( -- ) \ Resize the controls within the main window. ! ClientSize: ctab \ get display area before size change ( l t r b ) ! AutoSize: cTab ! TempRect GetClientRect: cTab \ get whole client area after size change ! ( b ) TempRect.bottom 1 - min 0 TempRect 2! ! true TempRect InvalidateRect: cTab \ invalidate bottom edge ! ( r ) 0 swap TempRect.right 1 - min TempRect 2! ( l t ) 2drop ! true TempRect InvalidateRect: ctab \ invalidate right edge ! ClientSize: cTab 2over d- ( x y w h ) ! 4dup Move: cFileList ! Move: cBrowserList ! ;M :M On_Size: ( -- ) *************** *** 73,80 **** \ Show the listview control for the currently selected tab. GetSelectedTab: cTab 0= ! if SW_HIDE Show: cBrowserList ! SW_SHOW Show: cFileList ! else SW_HIDE Show: cFileList SW_SHOW Show: cBrowserList then ;M --- 92,101 ---- \ Show the listview control for the currently selected tab. GetSelectedTab: cTab 0= ! if ! SW_SHOW Show: cFileList \ show cFileList before hiding cBrowserList for less flicker ! SW_HIDE Show: cBrowserList ! else SW_SHOW Show: cBrowserList + SW_HIDE Show: cFileList then ;M |