Toolbox: redrawing an button that needs help

Toolbox: redrawing an button that needs help

Post by Andrew Donaldso » Sun, 27 Jan 2002 06:13:16



I'm trying to redraw a button gadget manually in a Toolbox program.
The button is in a toolbar. I've set the button's 'Needs help' icon
flag. Should I get a Wimp_Poll redraw window request for the toolbar
window, but only for the area covered by this button?

If I unset the toolbar's 'Auto-redraw' flag I get a redraw window
request for the whole toolbar and can draw the button, but another
button I'm using as a background is then plotted over the top of it.

(Some context may explain what I'm trying to do. The programs draws
maps, or will if I ever finish it. The main window contains the map.
The toolbar shows information about the map. I want to show where in
the world the main-window map is located. I'm using a button with a
sprite of the world as the background. On top of this is the 'Needs
help' button, which is unfilled and I'm trying to draw a rectangle in
it to indicate the map's location.)

If I set the toolbar's 'Auto-redraw' flag, I don't seem to get redraw
requests at all. If I even use a single button with the world sprite
and 'Needs help' set, the sprite is plotted over my rectangle.

Do I have a major misunderstanding of how 'Needs help' buttons/icons
should be redrawn? The P/TRMs seem a bit short on information about
this. Or is there a far better way of implementing this?

Any help gratefully received (the button and I are similar that way),

Andrew

 
 
 

Toolbox: redrawing an button that needs help

Post by Darren Sal » Mon, 28 Jan 2002 03:56:49


I demand that Andrew Donaldson may or may not have written...

Quote:> I'm trying to redraw a button gadget manually in a Toolbox program. The
> button is in a toolbar. I've set the button's 'Needs help' icon flag.
> Should I get a Wimp_Poll redraw window request for the toolbar window, but
> only for the area covered by this button?

No. That bit means that when that icon is plotted, the window background
and any icons between are plotted first.

Quote:> If I unset the toolbar's 'Auto-redraw' flag I get a redraw window request
> for the whole toolbar and can draw the button, but another button I'm using
> as a background is then plotted over the top of it.

Then you also need to draw that.

Alternatively, use a sprite in your workspace and render to that (see
OS_SpriteOp 60); have the button point to that sprite. You'll need to set the
window's sprite area pointer or, if the icon is an indirected sprite, its
sprite area pointer (which is where the validation string pointer would be in
an indirected text icon).

[snip]

--
| Darren Salt        | d youmustbejoking,demon,co,uk | nr. Ashington, | Acorn
| RPC, Spec+3, A3010 | s zap,tartarus,org            | Northumberland | Club

|   We've got Shearer, you haven't

The Windows Experience: "Oh no, not *again*..."

 
 
 

Toolbox: redrawing an button that needs help

Post by Andrew Donaldso » Mon, 28 Jan 2002 20:16:20




Quote:> > I'm trying to redraw a button gadget manually in a Toolbox
> > program. The button is in a toolbar. I've set the button's 'Needs
> > help' icon flag. Should I get a Wimp_Poll redraw window request
> > for the toolbar window, but only for the area covered by this
> > button?

> No. That bit means that when that icon is plotted, the window
> background and any icons between are plotted first.

Ah, I think I understand now. Not the most informative of flag names,
then :-)

Come to think of it, it explains why I was having trouble arranging
the buttons in ResEd too...

Quote:> > If I unset the toolbar's 'Auto-redraw' flag I get a redraw window
> > request for the whole toolbar and can draw the button, but another
> > button I'm using as a background is then plotted over the top of
> > it.

> Then you also need to draw that.

Yes, that's what I'm now doing - drawing both directly to the toolbar
window.

Quote:

> Alternatively, use a sprite in your workspace and render to that
> (see OS_SpriteOp 60); have the button point to that sprite. You'll
> need to set the window's sprite area pointer or, if the icon is an
> indirected sprite, its sprite area pointer (which is where the
> validation string pointer would be in an indirected text icon).

Nice idea - that would save my program the work of mode-independent
sprite plotting, and I can use the same code to save the program
output as a sprite...

Thanks,

Andrew

 
 
 

1. Window Redraw probs - need some help

I've created a window with several child windows that need to change their
size everytime the parent window is resized using either the adjust icon or
the toggle icon.

The parent window has been created so that it needs help redrawing from
Wimp_poll  and this works fine.

However I am experiencing two problems.

1) Just after my routine to update all the rectangles of the parent window
(within Wimp_PollRedraw loop) I adjust the size of the child window and
re-open them, but it does not always pick up when parent window has been
redrawn and fails to update the child windows? Why is this? It usually
happens if I change the size of the window very quickly with the mouse. How
do I get round this?

2) When the parent window needs redrawing due to the toggle button been
clicked, the child windows size is based on the parent window size prior to
the size adjustment caused by the toggle button. How do I get round this one
so that they are based on the parent windows size after the toggle button
has been clicked?

Any help would be much appreciated, as its really getting on my nerves.

Regards
Alan

------------------------------------------------------------
Introducing Tagline 2 - Coming to an Email near you soon.

2. Anyone have these games

3. Help, need to redraw a gadget with plot routines

4. Question about Sendmail, Perl, and CGI

5. Icons needing redraw help

6. Weston Digital WD-SC8320 and A2000 - please help!

7. Help, please: PC Software needs 3-button mouse

8. Is there a way to draw arrows graphically?

9. Toolbox displayfield not redrawing

10. Toolbox Button gadgets - setting icon_flags problem.

11. Toolbox Radio Buttons

12. Toolbox Acion Buttons and Wimp Mouse Clicks query

13. Toolbox toolaction buttons