->      First the question:  Let's say that we have a TAction 
->setup named, "StyleAct" which will when executed set an 
->integer var to one of four possible values.  By default the 
->value is -1.  Then when executed the first time it sets the 
->value to 0, on the second execution the value is set to 1, 
->and finally on the third execution the value gets set to 2.  
->If executed again the value goes back to -1 and starts all over again.

Why not use an enumerated type here.  Such as:

TStyleAction = (saStateOne, saStateTwo, saStateThree, saStateFour);

Somewhere in the form code:

property Style : TStyleAction read FStyleAction write FStyleAction;
(Intentionally not using setter proc here).

Then when the button is clicked do 

If Style <> High(Style) then Style := Succ(Style) else Style :=
Low(Style);

->      Now my question has to do with the best way of 
->providing a means by which the user can select and set the 
->value he or she currently wants via the execution of this 
->TAction.  And in this particular case I chose a single button 
->on a toolbar which allows the user to click thru the four 
->settings in turn and then back to the first again.  And the 
->visual indication of this is provided by 4 different glyphs, 
->or as is the case here, by altering the TAction's ImageIndex 
->at each click of the button.  But should the glyph seen at 
->anytime reflect the current style that the interface is set 
->to OR should it reflect what the style will be IF the user 
->clicks it?  I've seen programs that use both methods, and 
->even a few poorly designed ones that use both in the same 
->application! <g>  But I'd like to hear what others think 
->about this and what they usually do or would do in this same 
->kind of situation.  I'd appreciate any comments on this at all!

I would use a drop down menu button that indicates it has a drop down
menu - ala little black down arrow(many free components available to do
this) with the menu items setting the relevant display style, and also
setting the button caption / glyph to something that represents the
current style.  If you use my suggestion above you can also change the
Style by doing something like:

Form.Style := TStyleAction(DropdownMenuItem.ItemIdex) if it has some
such property, or use the Tag property or something.
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to