[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|             PRMBAR              |
+---------------------------------+
PRMBAR(<expC>, <expN>)

-----------------------------------
Returns prompt of popup option.
Return value - Character
-----------------------------------

Menu popups are created with the DEFINE POPUP and DEFINE BAR commands.
The DEFINE POPUP command creates the menu popup, while DEFINE BAR
creates the options that fill the popup.  PRMBAR() returns the option
text from the PROMPT clause of a DEFINE BAR command.

<expC>
        <expC> is the popup name and <expN> is the bar number of the menu
popup.  Both the popup and the bar must be defined before using PRMBAR()
or an error message will be displayed.  A popup does not have to be
active for PRMBAR() to return the PROMPT text.

<expN>
        The bar number <expN> must be a positive number, a memory variable or
array element containing a positive number or an expression that
evaluates to a positive number.

        If the PROMPT contains the hot key (\<) or disabled option (\)
designator, just the text of the PROMPT is returned - the designator is
removed.  PRMBAR() returns the null string ("") when a PROMPT used to
create a menu popup separator (\-) is specified.  The null string is
also returned if the PROMPT was created without any text.

+---------------------------------+
|         Program Example         |
+---------------------------------+
In example below menu pad is added to the system menu.  Popup ENVIRO is
defined with four pads to change status of items indicated.  Mark is
placed by each bar when associated item is turned on and removed when
associated item is turned off.

* Name this program PRMBAR.PRG
CLEAR
SET TALK OFF
DEFINE PAD enviro OF _MSYSMENU PROMPT 'E\<nviro' ;
        KEY ALT+N, 'ALT+N'
ON PAD enviro OF _MSYSMENU ACTIVATE POPUP enviro

DEFINE POPUP enviro MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF enviro  PROMPT '\<Status Bar'
DEFINE BAR 2 OF enviro  PROMPT '\<Clock'
DEFINE BAR 3 OF enviro  PROMPT '\<Extended Video'
DEFINE BAR 4 OF enviro  PROMPT 'St\<icky'
ON SELECTION POPUP enviro DO enviropop IN prmbar.prg
FOR i = 1 TO CNTBAR('enviro')
        DO CASE
        CASE PRMBAR('enviro', i) = 'Status Bar'
                SET MARK OF BAR i OF enviro TO  SET('STATUS') = 'ON'
        CASE PRMBAR('enviro', i) = 'Clock'
                SET MARK OF BAR i OF enviro TO  SET('CLOCK') = 'ON'
        CASE PRMBAR('enviro', i) = 'Extended Video'
                SET MARK OF BAR i OF enviro TO  SROW() > 25
        CASE PRMBAR('enviro', i) = 'Sticky'
                SET MARK OF BAR i OF enviro TO  SET('STICKY') = 'ON'
        ENDCASE
ENDFOR

PROCEDURE enviropop
DO CASE
CASE PROMPT() = 'Status'
        IF MRKBAR('enviro',BAR())
                SET STATUS OFF
                SET MARK OF BAR BAR() OF enviro TO .F.
        ELSE
                SET STATUS ON
                SETMARK OF BAR BAR() OF enviro TO .T.
        ENDIF
CASE PROMPT() = 'Clock'
        IF MRKBAR('enviro',BAR())
                SET CLOCK OFF
                SET MARK OF BAR BAR() OF enviro TO .F.
        ELSE
                SET CLOCK ON
                SET MARK OF BAR BAR() OF enviro TO .T.
        ENDIF
CASE PROMPT() = 'Extended Video'
        IF MRKBAR('enviro',BAR())
                SET DISPLAY TO VGA25
                SET MARK OF BAR BAR() OF enviro TO .F.
        ELSE
                SET DISPLAY TO VGA50
                SET MARK OF BAR BAR() OF enviro TO .T.
        ENDIF
CASE PROMPT() = 'Sticky'
        IF MRKBAR('enviro',BAR())
                SET STICKY OFF
                SET MARK OF BAR BAR() OF enviro TO .F.
        ELSE
                SET STICKY ON
                SET MARK OF BAR BAR() OF enviro TO .T.
        ENDIF
ENDCASE

-----------------------------------

See Also:  CNTBAR(), GETBAR(), DEFINE BAR, DEFINE POPUP, MRKBAR()

-----------------------------------

See Also: CNTBAR() GETBAR() DEFINE BAR DEFINE POPUP MRKBAR()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson