comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » CW_PDMENU enhancement
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
CW_PDMENU enhancement [message #2818] Mon, 03 October 1994 08:12 Go to next message
meinel is currently offline  meinel
Messages: 14
Registered: February 1994
Junior Member
I have added a button sensitivity switch to CW_PDMENU. I use it for
putting menu item separators in pull-down menus.

NAME:
MY_PDMENU

PURPOSE:
MY_PDMENU is a compound widget that simplifies creating pull-down
menus. It has a simpler interface than the XPDMENU procedure, and
includes a button sensitivity feature not found in CW_PDMENU.

CALLING SEQUENCE:
widget = MY_PDMENU(Parent, Desc)

INPUTS:
Parent: The ID of the parent widget
Desc: An array of structures, each of which has the following
definition:

{MY_PDMENU_S, flags:0, name:'', sense:0}

"flags" and "name" are the same as used in CW_PDMENU.
The "sense" tag specifies the sensitivity of the button.

EXAMPLE:
The following is the description of a menu bar with one button.
"File" is a pull-down menu containing "Open...", "New" and "Quit".
"--------" is a desensitized item used as a separator.

;make sure MY_PDMENU_S is defined
junk = {MY_PDMENU_S, flags:0, name:'', sense:0}

;The description
desc = [{MY_PDMENU_S, 3, 'File', 1}, $
{MY_PDMENU_S, 0, 'Open...', 1}, $
{MY_PDMENU_S, 0, 'New', 1}, $
{MY_PDMENU_S, 0, '--------', 0}, $
{MY_PDMENU_S, 2, 'Quit', 1}]

;Create the widget
base = widget_base()
menu = MY_PDMENU(base, desc, /RETURN_FULL_NAME)
WIDGET_CONTROL, /REALIZE, base
repeat begin
ev = WIDGET_EVENT(base)
print, ev.value
end until ev.value eq 'File.Quit'
WIDGET_CONTROL, /DESTROY, base
end

The modifications that are made to CW_PDMENU are:

Globally replace CW_PDMENU with MY_PDMENU

In PRO MY_PDMENU_BUILD add the line
sensitive = desc(cur).sense
after the line "dname = desc(cur).name"

Change
WIDGET_CONTROL, new, SET_UVALUE=uvalue
to
WIDGET_CONTROL, new, SET_UVALUE=uvalue, SENSITIVE=sensitive

Ed
meinel@aero.org
Re: CW_PDMENU enhancement [message #2944 is a reply to message #2818] Thu, 06 October 1994 09:42 Go to previous message
mcook is currently offline  mcook
Messages: 12
Registered: March 1994
Junior Member
Where is your widget?

Mark
mcook@lobby.ti.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: simple questions: position and strings
Next Topic: compile messages

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 12:30:11 PDT 2025

Total time taken to generate the page: 0.32012 seconds