×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Menu Bar Items properties

Menu Bar Items properties

Menu Bar Items properties

(OP)
Hello

is there a template or a way to list the following properties for all items in a menu bar

From General Tab:
      Menu Text
      Use Variable

From Action Tab:
      Procedure Name

Thanx
 

RE: Menu Bar Items properties

Hi!

It is possible via a Template. Copy and paste the below into a file called Shankar.TPL and register it. Add it to your Frame procedure and you will have the queue FrameMenuQ available at runtime with all the info.

CODE

#!*****************************************************************************
#!*****************************************************************************
#TEMPLATE(SHANK_TPL, 'CUSTOM TEMPLATE OF SHANKAR'), FAMILY('ABC')
#!*****************************************************************************
#EXTENSION(ShankGenMenuQueue,'Generate Queue of MENU Options'),PROCEDURE
#!-----------------------------------------------------------------------------
#AT(%DataSectionAfterWindow), LAST
#!-----------------------------------------------------------------------------

FrameMenuQ        QUEUE,PRE(FMQ)
MenuUse             STRING(30)
MenuText            STRING(60)
MenuFEQ             LONG           
MenuProc            STRING(30)
            END

#ENDAT
#!---------------------------------------------------------------------
#AT(%WindowManagerMethodCodeSection,'Init','(),BYTE'),PRIORITY( 8001 )
#!---------------------------------------------------------------------
  DO BuildFrameMenuQ
#ENDAT
#!---------------------------------------------------------------------
#AT(%ProcedureRoutines)
#!---------------------------------------------------------------------
BuildFrameMenuQ  ROUTINE
  FREE(FrameMenuQ)

#FOR(%Control),WHERE(%ControlType='ITEM' AND %Control <> '' AND NOT EXTRACT(%ControlStatement,'SEPARATOR'))
  CLEAR(FrameMenuQ)
  FMQ:MenuUse  = '%Control'
  FMQ:MenuFEQ  = %Control
  FMQ:MenuText = %Control{PROP:Text}
  FMQ:MenuProc = '%ButtonProcedure'
  
  ADD(FrameMenuQ, FMQ:MenuUse)
  IF ERRORCODE() THEN MESSAGE('FrameMenuQ : ' & ERROR()).

#ENDFOR
#ENDAT
#!*****************************************************************************

Regards
 

RE: Menu Bar Items properties

(OP)
Thank you Shankar
 That was so useful and worked fine.

But I have a template which I created long time ago to list all the controls and their properties as a UTILITY.

when I used  %ButtonProcedure in that template , it gave me an error that it is not defined.
 

RE: Menu Bar Items properties

Hi!

The template symbol %ButtonProcedure is applicable ONLY for Buttoms & Menu Items since only these offer a choice of calling a procedure when pressed.

Regards
 

RE: Menu Bar Items properties

Hi!

Should be ButtoNs and not Buttoms. smile

Regards
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close