Re: Nested Wimp
- From: Alan Adams <alan.adams@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 04 Feb 2006 19:04:37 GMT
In message <e7aefff34d.colin@colin/granville.gmx.co.uk>
Colin Granville <colin.granville@xxxxxxxxx> wrote:
In message <d38eeaf34d.root@xxxxxxxxxxxxxxxx>
Erik Groenhuis <erikgspm@xxxxxxxxxxxx> wrote:
As Colin Granville <colin.granville@xxxxxxxxx> wrote:
On a window open event for the main window:
1) take note of the behind window_handle.
2) make the behind window_handle the main window_handle (ie
open it behind itself) and open the window.
3) read the state of the main window. (only necessary if using
the toolbox. If using templates the open window data will
modified to the current state when the window is opened)
4) Open the pane using main window_state to position it but set
behind to the original behind window_handle (from (1)).
5) if you have another pane use the pane window_handle from (4)
as behind and open that window
6) Open the main window again with the data from (3) and using
the window_handle of the last pane opened as the behind
window_handle.
And now we're back in the realm of clever opening of the windows to get
the pane to appear at the right position on top of the main window.
I was just pointing out how to do it without the nested wimp as the
person I replied to was having problems.
See <http://www.pinknoise.demon.co.uk/Docs/Arc/Wimp/pane.c.html>.
looks complicated to me.
You don't need to make exceptions for different values of behind it's
simple enough
open window behind self
open pane behind original behind
open window behind pane
Yes you can use the nested wimp but for a simple single toolbarstyle
Seeing how the extra flags in the nested window manager are supposed to
attach the pane to the main window, and the parent window handle is
passed in R3, all the above should be unnecessary. I would expect it to
be handled automatically by the nested window manager.
Note, by the way, that for the extra flags word in Wimp_OpenWindow (at
R1 + 32) to work, bit 0 in R4 must be set.
pane in a window it's hardly matters which one you use.
It is easier with the nested wimp, sufficiently so to be worth doing for
even a simple pane I would suggest.
It took me a while to get it working, because I got confused about how to
pass TASK in R2.
"Wimp_OpenWindow",,"TASK", doesn't work
DIM magic%
$magic%="TASK"+CHR$(0)
"Wimp_OpenWindow",,magic%, doesn't work
DIM magic% 5
$magic%="TASK"+CHR$(0)
"Wimp_OpenWindow",,!magic%, does work
magic%=&4B534154
"Wimp_OpenWindow",,magic%, does work
Note that none of the above produce an error message - the non-working ones
just don't produce nested wimp behaviour.
What I have got to work is:
Load both windows from template
Create and Open main window, with R2=TASK, R3=-1, R4=0
Find the position of the space for the pane, and apply it to pane.
(without this step, it works provided the windows were correctly positioned
in the template file, and the main window doesn't get repositioned when it
opens, due to partly being off screen etc.)
Set the byte at R2+32 to &FF to suppress the line round the pane
Create and Open pane window, with R2=TASK, R3=handle of main, R4=align%
where:
align%=%01<<16: REM child left to visible left
align%+=%10<<22: REM child top to visible top
In response to open window messages, open the main window with R2=TASK,
R3=-1, R4=0
The only other thing required, and it is required with and without the
nested wimp, is to handle the scroll events, and scroll vertically by an
amount reduced to take accoumt of the area hidden by the pane.
It is essential that the width of the pane is exactly the same as the
visible area of the main window, otherwise when the main window is scrolled
horizontally the pane scrolls by a different amount.
That's it. It just took a bit of working out to find the necessary steps.
--
Alan Adams, from Northamptonshire
alan.adams@xxxxxxxxxxxxxxxxxxxxxxxxxxx
http://www.nckc.org.uk/
.
- Follow-Ups:
- Re: Nested Wimp
- From: Erik Groenhuis
- Re: Nested Wimp
- From: Andrew Hill
- Re: Nested Wimp
- References:
- Re: Dragging and Wimp_OpenWindow
- From: Erik Groenhuis
- Re: Dragging and Wimp_OpenWindow
- From: Ste (news)
- Re: Dragging and Wimp_OpenWindow
- From: Alan Adams
- Re: Dragging and Wimp_OpenWindow
- From: Andrew Hill
- Re: Dragging and Wimp_OpenWindow
- From: Alan Adams
- Re: Dragging and Wimp_OpenWindow
- From: Andrew Hill
- Nested Wimp - was Dragging and Wimp_OpenWindow
- From: Alan Adams
- Re: Nested Wimp
- From: Erik Groenhuis
- Re: Nested Wimp
- From: Alan Adams
- Re: Nested Wimp
- From: Colin Granville
- Re: Nested Wimp
- From: Erik Groenhuis
- Re: Nested Wimp
- From: Colin Granville
- Re: Dragging and Wimp_OpenWindow
- Prev by Date: Re: Low-level Sprite access
- Next by Date: Re: Nested Wimp - was Dragging and Wimp_OpenWindow
- Previous by thread: Re: Nested Wimp
- Next by thread: Re: Nested Wimp
- Index(es):
Relevant Pages
|
Loading