Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu Item on Main Frame - How do I enable it in one of my procedures? 1

Status
Not open for further replies.

emaduddeen

Programmer
Mar 22, 2007
184
0
0
US
Hi Everyone,

There is a menu item on the main frame that I would like to enable using code from one of my procedures. Can you tell me how to do this in code?

Thanks.

Emad


 
Hi Emad,

Store the reference of the Frame Window in the Frame procedure to a Global non-threaded &WINDOW variable.

Global Data :

AppFrameReference &WINDOW

App Frame Procedure - Init - after opening window :

AppFrameReference &= AppFrame

App Frame Procedure - Kill :

AppFrameReference &= NULL

Any Procedure (make sure that all menu options on the Frame have an use variable i.e. Field Equate Label (FEQ) / Use variable) :

AppFrameReference $ ?MenuFEQ {PROP:Hide} = True

Regards
 
Hi ShankarJ,

Thanks for the help.

I put the code in the embeds but get an "Unknown idenfifier ?Maintenance" error on the reference to my menu item I am trying to enable.

I tried:

AppFrameReference $ ?Maintenance {PROP:Disable} = False

Truly,
Emad
 
Hi Emad,

And ?Maintenace is the USE variable for the Menu Item?

Example : ?SYSForm in ...

ITEM('&Parameters'),USE(?SYSForm),MSG('Maintain System Parameters')

If your usage is correct, then the compiler is unable to resolve the AppFrame variables. Recent versions of the Clarion Compiler has been less forgiving. So, since FEQ's are basically numbers you need to store the FEQs into a Queue of LONGs, retrieve the Queue and use the LONG value. Or, just global LONG variables if they are only a few.

Regards
 
Hi Emad,

Forgot the example :

In Global Data :

glo:MaintMenuFEQ LONG

In AppFrame :

glo:MaintMenuFEQ = ?Maintenance

In Procedure :

AppFrameReference $ glo:MaintMenuFEQ {PROP:Disable} = False

Regards
 
Hi ShankarJ,

I don't fully understand the code so I will try to find out more from the help.

Adding the global variable did the trick.

Thanks!

Truly,
Emad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top