Rod and David,

 

After reading Rod's reply, he's quite right; you could add or delete a menu
item in the same way I was using the .enable property.  I never thought
that could be what you meant with your question, but now that rod mentions
it, it's just as valid an interpretation.

 

I can't think of any reason why adding and deleting menu items is any less
desirable than enabling or disabling them.

 

Chip

 

 

From: Rod Hutton [mailto:[email protected]] 
Sent: Wednesday, November 27, 2013 11:15 AM
To: [email protected]
Subject: Re: Disabling a menu choice - how to?

 

Hello David,

Normally, as I've learned from Chip's classes (see class 13), you check or
uncheck menu items, and you can also disable and enable them, as necessary.

However, having looked at the manual, it is possible to remove and insert
menu items as well.  I've never used this approach in any of my apps, but I
suppose it is one approach.  I've pasted the relevant info from the manual
FYI.

hth,

Rod Hutton

Navigation:
The Window-Eyes Object Model
 >
Objects
 >
Menu
 >
Methods
Previous page
Return to chapter overview
Next page
Menu
 object methods allow you to perform actions on a
Menu
 object.
Methods
.
Delete
.
GetSubMenu
.
InsertItem
.
InsertMenu
Requirements
Window-Eyes 7.1 or greater.

On 11/26/13 9:28 PM, David wrote:

Developers,

I could need a bit of educated assistance, please.

 

I have an app, that was started out by using the WEScript Framework app.

 

I wanted to add a choice to the app menu of my app, and for the ease we will
call it

    MyMenuItem.

 

I entered the necessary information in the XML file, and modified the
MenuProc function in the app code - so it knows how to handle things, once
my new entry is selected. Everything works just like expected, this far.

 

Where my knowledge stops, is here. I want to make the new menu entry
available, only under certain conditions. Say for instance, I have a Boolean
variable, named

    ConditionMet

and only want to display the entry on the app menu, when this variable is
true. Cook it all down to something like this:

 

    If ConditionMet Then

        ' Need the code to make the menu entry visible.

    Else

        ' need the code to make the menu entry disappear.

    End If 'ConditionMet.

 

Allright, I know, it may not be all that simple. A couple of years of app
development, has taught me there likely will need to be a few lines extra of
codeing. Smile. Yet, I hope the above explains where my trouble has its
nest. 

 

More exactly, which variables (properties and methods), should I make use of
- so as to have the menu entry show up, and disappear. And, in the code,
where would I put the extra lines. As stated, the naked frame of the app,
was designed by WEScript Framework. So, if you happen to know exactly in
which Sub or Function the modification will be needed, I would be saved an
hour of searching through the lines of code. Smile.

 

Thanks for any ideas and input.

 

Reply via email to