Is it possible to change the visible position for toolbox external toolbar?
Aleksey Murushkin (Cloverleaf) (8233) 41 posts |
Hello. I have created a window with flag pain and attached it as external top left toolbar. |
nemo (145) 2546 posts |
A nested window is always inside the “outline” of the window (the outside of the window furniture). It cannot extend further than that. If you want a pane partially or wholly outside your main window, you must position it as a separate window, not a nested one. |
Rick Murray (539) 13840 posts |
Another example, this time from my Manga app. Note the toolbar at the bottom. It’s a separate window “nested” into the main window. |
Aleksey Murushkin (Cloverleaf) (8233) 41 posts |
So do you mean guys that the only way is to make this window separate and have a pain to always update its coordinates when i am moving/close/open/etc main window? |
nemo (145) 2546 posts |
Yes. There isn’t a way to connect two windows, only to insert one inside another. To make attached (not embedded) panes work, you must know the X,Y offset from one to another. I don’t use the Toolbox so I’ll describe how to do it using Wimp calls directly, but it’ll be similar with the Toolbox. On OpenWindow event: If the window to be opened/moved is your main window, calculate the required position of the pane from the given Now open your main window (behind your pane) and then after this Wimp_OpenWindow call check that the coordinates in the buffer match the requested If the coords don’t match, the pane will not be in the right place, so recalculate using the coordinates returned by the previous OpenWindow and use the pane’s own handle as its That’s it. In BASIC it often looks like: DEFPROCopenwindow(handle,x0,y0,x1,y1,sx,sy,behind) REM open panes first CASE handle OF WHEN main:PROCopenpane(pane,x0,y1,behind):behind=pane ENDCASE REM Now open the requested window !q=handle:q!4=x0:q!8=y0:q!12=x1:q!16=y1:q!20=sx:q!24=sy:q!28=behind SYS"Wimp_OpenWindow",,q REM And if it didn't open where we expected, move the pane IF q!4<>x0 OR q!8<>y0 OR q!12<>x1 OR q!16<>y1 THEN CASE handle OF WHEN main:PROCopenpane(pane,q!4,q!16,pane) ENDCASE ENDIF ENDPROC |