1. Excuse me waiter, but I didn't order trace with this app
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 )
2. Re: Excuse me waiter, but I didn't order trace with this app
> I think I found a lingering trace(1) call in Win32Lib. Run this code and see
> what you think (requires EuGrid)
I just ran that without problem.
What version of Win32Lib have you? Mine is:
--This is a version of win32lib v0.60.6 by David Cuny and friends that
has been
--modified by Sascha Zindel with corrections as posted on EuForum by
Derek Parnell.
I happened to have it open in an editor because I was making other
changes to it, and did a search for 'trace'. None found, except for
'without trace'.
--
Craig
3. Re: Excuse me waiter, but I didn't order trace with this app
Greg Haberek wrote:
>
>
> I think I found a lingering trace(1) call in Win32Lib. Run this code and see
> what you think (requires EuGrid)
Works fine for me also (using Win32Lib 60.6)
PeteS