Oscar Ugolini
10-05-2012, 19:19
hi all...
i have made a window with a canvas control keep all window space.
i don't want check timer callback to render the canvas,
but only when i do some input, mouse click or keyboard, or when maximize/minimize the window...
When i maximize/restore window and check on select case CbMsg, %WM_SIZE or %WM_SIZING, like this:
...
hCtrl = Control Add Label, hDlg, %gCanvas, "TBGL canvas", 0, 42, 1024, 670
Control Set Resize hDlg, %gCanvas , 1, 1, 1, 1
Dialog Set Minsize hDlg, 1024, 768
TBGL_Render()
TBGL_BindCanvas(hCtrl)
Dialog Show Modal hDlg , Call DlgProc
...
...
Select Case CbMsg
...
Case %WM_SIZE
'''Control Set Focus hDlg, %gCanvas i try also set focus befor render
TBGL_UpdateCanvasProportions(hCtrl)
TBGL_Render()
Case %WM_SIZING
'''Control Set Focus hDlg, %gCanvas i try also set focus befor render
TBGL_UpdateCanvasProportions(hCtrl)
TBGL_Render()
...
The canvas don't keep proportions... and only when i click on it to move an object inside, the canvas show correct proportions...
With check of a "timer callback" like this:
...
Case %WM_TIMER
TBGL_Render()
...
i dont see the problem because always render on timer...
but i dont want use timer check...
How can update correctly the canvas without a timer, but on maximize/restore window?
Thanks all... and sorry for my english not perfect :)
i have made a window with a canvas control keep all window space.
i don't want check timer callback to render the canvas,
but only when i do some input, mouse click or keyboard, or when maximize/minimize the window...
When i maximize/restore window and check on select case CbMsg, %WM_SIZE or %WM_SIZING, like this:
...
hCtrl = Control Add Label, hDlg, %gCanvas, "TBGL canvas", 0, 42, 1024, 670
Control Set Resize hDlg, %gCanvas , 1, 1, 1, 1
Dialog Set Minsize hDlg, 1024, 768
TBGL_Render()
TBGL_BindCanvas(hCtrl)
Dialog Show Modal hDlg , Call DlgProc
...
...
Select Case CbMsg
...
Case %WM_SIZE
'''Control Set Focus hDlg, %gCanvas i try also set focus befor render
TBGL_UpdateCanvasProportions(hCtrl)
TBGL_Render()
Case %WM_SIZING
'''Control Set Focus hDlg, %gCanvas i try also set focus befor render
TBGL_UpdateCanvasProportions(hCtrl)
TBGL_Render()
...
The canvas don't keep proportions... and only when i click on it to move an object inside, the canvas show correct proportions...
With check of a "timer callback" like this:
...
Case %WM_TIMER
TBGL_Render()
...
i dont see the problem because always render on timer...
but i dont want use timer check...
How can update correctly the canvas without a timer, but on maximize/restore window?
Thanks all... and sorry for my english not perfect :)