marking active menu items

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

marking active menu items

Ralph Boland
I need to create a menu in which the selectable items (MenuItemMorphs)
are sometimes active and sometimes inactive. 
For inactive items nothing is done when they are selected from the menu.

Currently, I plan to indicate the difference by using a line (MenuLineMorph)
to separate the items into two groups with the active items above.
I consider this to be a poor solution for various reasons.  I wonder if anyone can propose
a better solution and preverably a more standard solution to this problem.
The simpler and more portable the solution the better.

Currently, I am using Squeak  3.6.  I will soon be porting to  3.7 so I can use a Squeak 3.7 solution.
Porting to 3.8 has been delayed because displaying a method in the debugger
displays the wrong text in a method.  The displayed text is off by one character for each assignment
operator preceding the displayed text. 
(The displayed text is the text of the current message send in the method)

I am using the Linux version of Squeak.

Thanks

Ralph Boland



Reply | Threaded
Open this post in threaded view
|

Re: marking active menu items

Hernan Tylim
To mark items on a menu in a disabled state this is what I use:

(not tested)

| menu |
menu := MenuMorph new.
menu add: aTitle target: anObject selector: aSelector
menu lastItem isEnabled: false

the #isEnabled: method is the one used when you type into a menu and
some items gets temporarily disabled. Note that because of this, if you
type into a menu and then delete the typing everything will get
reenabled, even your  manually disabled items, thus this isn't a perfect
solution either (But I doubt that there is one, short of modifying
MenuMorph and/or MenuItemMorph to support this kind of usage).

BTW, you can disable the preference that gives keyboard focus to menus.
Look into the preference panel for it.

Hope it helps

Regards,
Hernán

Ralph Boland wrote:

> I need to create a menu in which the selectable items (MenuItemMorphs)
> are sometimes active and sometimes inactive.
> For inactive items nothing is done when they are selected from the menu.
>
> Currently, I plan to indicate the difference by using a line
> (MenuLineMorph)
> to separate the items into two groups with the active items above.
> I consider this to be a poor solution for various reasons.  I wonder
> if anyone can propose
> a better solution and preverably a more standard solution to this
> problem.
> The simpler and more portable the solution the better.
>
> Currently, I am using Squeak  3.6.  I will soon be porting to  3.7 so
> I can use a Squeak 3.7 solution.
> Porting to 3.8 has been delayed because displaying a method in the
> debugger
> displays the wrong text in a method.  The displayed text is off by one
> character for each assignment
> operator preceding the displayed text.
> (The displayed text is the text of the current message send in the
> method)
>
> I am using the Linux version of Squeak.
>
> Thanks
>
> Ralph Boland
>
>------------------------------------------------------------------------
>
>
>  
>



Reply | Threaded
Open this post in threaded view
|

Re: marking active menu items

Chris Muller-2
In reply to this post by Ralph Boland
So I take it you are not interested in only showing
active items..  As far as I know, MenuItemMorphs don't
have a 'enabled' boolean but you could probably
subclass MenuItemMorph to add it..

Re: 3.8 debugger display issue..  I noticed an issue
in the debugger too related to the code it
*hightlights*, but only when Shout was enabled.  If
Shout is disabled in the Preferences (sorry can't try
it now myself, not at a Squeak computer) is it still a
problem?

 - Chris

> Message: 28
> Date: Wed, 18 Jan 2006 19:22:06 -0500
> From: Ralph Boland <[hidden email]>
> Subject: marking active menu items
> To: [hidden email]
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I need to create a menu in which the selectable
> items (MenuItemMorphs)
> are sometimes active and sometimes inactive.
> For inactive items nothing is done when they are
> selected from the menu.
>
> Currently, I plan to indicate the difference by
> using a line (MenuLineMorph)
>
> to separate the items into two groups with the
> active items above.
> I consider this to be a poor solution for various
> reasons.  I wonder if
> anyone can propose
> a better solution and preverably a more standard
> solution to this problem.
> The simpler and more portable the solution the
> better.
>
> Currently, I am using Squeak  3.6.  I will soon be
> porting to  3.7 so I can
> use a Squeak 3.7 solution.
> Porting to 3.8 has been delayed because displaying a
> method in the debugger
> displays the wrong text in a method.  The displayed
> text is off by one
> character for each assignment
> operator preceding the displayed text.
> (The displayed text is the text of the current
> message send in the method)
>
> I am using the Linux version of Squeak.
>
> Thanks
>
> Ralph Boland
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
>
http://liststest.squeakfoundation.org/pipermail/squeak-dev/attachments/20060118/093ecb16/attachment.html
>
> ------------------------------


Reply | Threaded
Open this post in threaded view
|

Re: marking active menu items

Marcus Denker

On 19.01.2006, at 19:17, Chris Muller wrote:

> So I take it you are not interested in only showing
> active items..  As far as I know, MenuItemMorphs don't
> have a 'enabled' boolean but you could probably
> subclass MenuItemMorph to add it..
>
> Re: 3.8 debugger display issue..  I noticed an issue
> in the debugger too related to the code it
> *hightlights*, but only when Shout was enabled.  If
> Shout is disabled in the Preferences (sorry can't try
> it now myself, not at a Squeak computer) is it still a
> problem?
>

I think this is because shout replaces _ by :=, I think
it even has a preference for turning that off, but I'm
not sure.

     marcus

Reply | Threaded
Open this post in threaded view
|

Re: marking active menu items

stéphane ducasse-2
In reply to this post by Chris Muller-2
> So I take it you are not interested in only showing
> active items..  As far as I know, MenuItemMorphs don't
> have a 'enabled' boolean but you could probably
> subclass MenuItemMorph to add it..

If you do what chris suggested it may be worth to do it in the  
MenuItemMorph
itself and send it to the morphic team so that it gets added to morphic

I think that this is a good functionality and we could avoid having  
subclass proliferation.
We are trying to see with lukas how to add icons to list items. This  
is a feature that would make
the browsers giving a lot more information.

Stef

Reply | Threaded
Open this post in threaded view
|

Re: marking active menu items

Hilaire Fernandes-5


stéphane ducasse a écrit :

>> So I take it you are not interested in only showing
>> active items..  As far as I know, MenuItemMorphs don't
>> have a 'enabled' boolean but you could probably
>> subclass MenuItemMorph to add it..
>
>
> If you do what chris suggested it may be worth to do it in the
> MenuItemMorph
> itself and send it to the morphic team so that it gets added to morphic
>
> I think that this is a good functionality and we could avoid having
> subclass proliferation.
> We are trying to see with lukas how to add icons to list items. This  is
> a feature that would make
> the browsers giving a lot more information.

A general mechanism where MenuItemMorph can be any kind of Morph will be
a very valuable addition. But may be it is already possible. I can try
to help if needed.

Hilaire


Reply | Threaded
Open this post in threaded view
|

Re: marking active menu items

Romain Robbes
In reply to this post by Chris Muller-2

Il giorno Jan 19, 2006, alle ore 7:17 PM, Chris Muller ha scritto:

> So I take it you are not interested in only showing
> active items..  As far as I know, MenuItemMorphs don't
> have a 'enabled' boolean but you could probably
> subclass MenuItemMorph to add it..

actually it does: you just have to call
MenuItemMorph >> isEnabled:

        Cheers,
                Romain

>
> Re: 3.8 debugger display issue..  I noticed an issue
> in the debugger too related to the code it
> *hightlights*, but only when Shout was enabled.  If
> Shout is disabled in the Preferences (sorry can't try
> it now myself, not at a Squeak computer) is it still a
> problem?
>
>  - Chris
>
>> Message: 28
>> Date: Wed, 18 Jan 2006 19:22:06 -0500
>> From: Ralph Boland <[hidden email]>
>> Subject: marking active menu items
>> To: [hidden email]
>> Message-ID:
>> <[hidden email]>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> I need to create a menu in which the selectable
>> items (MenuItemMorphs)
>> are sometimes active and sometimes inactive.
>> For inactive items nothing is done when they are
>> selected from the menu.
>>
>> Currently, I plan to indicate the difference by
>> using a line (MenuLineMorph)
>>
>> to separate the items into two groups with the
>> active items above.
>> I consider this to be a poor solution for various
>> reasons.  I wonder if
>> anyone can propose
>> a better solution and preverably a more standard
>> solution to this problem.
>> The simpler and more portable the solution the
>> better.
>>
>> Currently, I am using Squeak  3.6.  I will soon be
>> porting to  3.7 so I can
>> use a Squeak 3.7 solution.
>> Porting to 3.8 has been delayed because displaying a
>> method in the debugger
>> displays the wrong text in a method.  The displayed
>> text is off by one
>> character for each assignment
>> operator preceding the displayed text.
>> (The displayed text is the text of the current
>> message send in the method)
>>
>> I am using the Linux version of Squeak.
>>
>> Thanks
>>
>> Ralph Boland
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>>
> http://liststest.squeakfoundation.org/pipermail/squeak-dev/ 
> attachments/20060118/093ecb16/attachment.html
>>
>> ------------------------------
>
>

--
     Romain Robbes
     http://www.inf.unisi.ch/~robbes/