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 Bar Items properties

Status
Not open for further replies.

SalehKiswani

IS-IT--Management
Jul 16, 2011
60
0
0
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
 
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
 
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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top