Excuse me waiter, but I didn't order trace with this app
- Posted by Greg Haberek <ghaberek at gmail.com> Mar 15, 2006
- 521 views
I think I found a lingering trace(1) call in Win32Lib. Run this code and see what you think (requires EuGrid)
include Win32Lib.ew include EuGrid.ew without warning without trace -- note the 'without trace' constant Days = {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"} constant Main = create( Window, "Calendar", 0, Center, Center, 640, 480, 0 ), Title = create( CText, "", Main, 0, 0, 0, 0, 0 ), Grid = EGW_CreateGrid( Main, 0, 0, 1, 1, EGW_True ) VOID = EGW_SetGridProperty( Grid, EGW_ROW_HEADER_WIDTH, 0 ) VOID = EGW_SetGridProperty( Grid, EGW_ALLOW_COL_RESIZE, EGW_False ) sequence Cols, Rows Cols = repeat(0, 7) for i = 1 to length( Days ) do Cols[i] = EGW_AddColumn( Grid, Days[i], 100, i, EGW_STATIC, i ) VOID = EGW_SetColumnProperty( Grid, Cols[i], EGW_COL_ALIGN, EGW_CENTER ) end for Rows = repeat({}, 5) for i = 1 to 5 do Rows[i] = EGW_AddDataRow( Grid, repeat("",7), EGW_LAST ) end for procedure Main_onResize( integer pSelf, integer pEvent, sequence pParams ) sequence rect object x, y, cx, cy rect = getClientRect( Main ) -- a little creative positioning :) cx = floor( (rect[3]-20) / 7 ) * 7 - 3 cy = floor( (rect[4]-40) / 5 ) * 5 - 6 x = {0.5,-floor(cx/2)} y = {0.5,-floor(cy/2)+10} -- resize, but don't force repaint setRect( Grid, x, y, cx, cy, w32False ) end procedure setHandler( Main, w32HResize, routine_id("Main_onResize") ) procedure Grid_onResize( integer pSelf, integer pEvent, sequence pParams ) sequence rect integer width, height -- here we're forcing the rows -- and columns to fill the grid rect = getClientRect( Grid ) width = floor( rect[3] / 7 ) height = floor( (rect[4] - 20) / 5 ) for i = 1 to length( Cols ) do VOID = EGW_SetColumnProperty( Grid, Cols[i], EGW_COL_WIDTH, width ) end for VOID = EGW_SetGridProperty( Grid, EGW_ROW_HEIGHT, height ) -- now repaint repaintWindow( Grid ) end procedure setHandler( Grid, w32HResize, routine_id("Grid_onResize") ) WinMain( Main, Normal )