Toolbar question 
Author Message
 Toolbar question

Hi all,

I have a view that has a toolbar and a playground.
When I press some toolbar item I want to indicate in the Playground (with
the mouse) where I want to put the Shape (and the toolbar item should be
pressed through all process).

After #addShape command is executed in the Presenter the toolbar item become
unpressed (unchecked).

I want to have a toolbar item that remain pressed until I say it.

Is there any way to do that ?

Best Regards
Bruno Brasesco

Fri, 05 Dec 2003 04:41:48 GMT  
 Toolbar question

> I want to have a toolbar item that remain pressed until I say it.

> Is there any way to do that ?

It's done using the same #queryCommand: method that you use to
enable/disable commands -

YourShell>>queryCommand: aCommandQuery
    super queryCommand: aCommandQuery.
    aCommandQuery command == #startPositioningShape
        ifTrue: [aCommandQuery isChecked: self isPositioningShape]

where #startPositioningShape is the command sent by your toolbar button and
#isPositioningShape is a method answering true while the shape is being
positioned and you want the button so show as depressed.  ToolbarButton also
has an editable aspect, #isCheckStyle, which you can set but it doesn't
appear to make any difference to the operation of the button now, although I
think it _used_ to?.

It is possible to get the the button to maintain it's own checked/unchecked
state but I have found that it can get a bit confusing so I tend to have a
local instance variable to hold the button's state (i.e. the value returned
by #isPositioningShape above) for me.

You _might_ also have to do a little bit of fiddling to allow
Dolphin/Windows to visually update the button when you change the state of
the button programmatically, it depends on your application. It is easy
enough to work around so ask again if it is a problem.


Fri, 05 Dec 2003 06:43:31 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Another toolbar question...

2. Toolbar question?

3. Toolbar question

4. Toolbar button question

5. ToolBar Button, bitmap images

6. toolbar always on top?

7. Toolbar buttons

8. Fluffy toolbar icons

9. Toolbar button background color

10. Disabling Toolbar Buttons

11. Toolbar button enabling

12. Old XL graphics toolbar on Dyalog v.7 ???????????


Powered by phpBB® Forum Software