Display Menu Chain

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Display Menu Chain

Post by John »

According to the BR!Wiki - Drop down menus (built by Display Menu) will be cleared when you Chain to another new program. However in practice this is not happening for me. I believe the documentation is wrong and that Chain-ing to another program does not clear out the drop down menus. I want to correct the documentation but before I do I want to confirm that CHAIN is not supposta clear out the drop down menus.

Could someone please confirm or deny.

-John
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

Hi John,

I haven't seen my windows menus "stick" across a chain. Is your menu being created in a library function? Maybe that is an issue. (I haven't tried that myself)

My windows menu is created entirely inside of the BR program in which I'm using it. And if I chain out of that program, it disappears.

-- Susan
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Post by John »

okay Susan - Thank you. I'd better do more investigation and less document updating then... :)
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Post by John »

What version of BR! are you using, Susan?

I'm testing with older versions as far back as 4.03jx and the chain does not seem to clear out the drop down menus.

My test is very simple... my first program displays a menu and then chains to another which just pauses so i can see that they are still there (or not).

Hmmm... strange... perhaps there is an option related to this that I'm missing or something.
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

I'm using BR 4.20g. Maybe I did something in my program to clear the menus. I don't SEE anything like that. But it's always possible. I can try it again later the way that you did it - with a small stripped down test. I just don't have time right now. Sorry
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

There is an "R" option that can be added to the MENU STATUS tht causes a menu to persist across a chain statement. Check your status array to see if you ar retaining menu items.

==========================================
Menu Support
MENU SUPPORT (only for the Windows version)
When a user defined Windows menu is displayed, the Preferences menu is
suppressed. When the user defined menu is cleared, Preferences is restored.
Summary of menu syntax supported:
ON EVENT GOTO
INPUT MENU
INPUT MENU TEXT
INPUT MENU DATA
INPUT MENU STATUS
DISPLAY MENU ... EVENT lineno
DISPLAY MENU TEXT Used to update a menu.
DISPLAY MENU DATA ...
DISPLAY MENU STATUS
MENU$
MENU
This statement is ignored by during execution.
Sample menu definition statements:
00100 DIM M$(20), PGM$(20), STATUS$(20)
00110 DATA "&FILE", "", ""
00120 DATA " &New", "NEW", "E"
00130 DATA " &Save", "SAVE", "E"
--- additional indentations imply additional menu levels --
00140 DATA " &Quit", "QUIT", "E"
Business Rules Programmer's Manual
Chapter 12 Screen I/O 539 December 05, 2007
00150 DATA "&EDIT", "", "E"
00160 DATA " &Copy", "COPY", "E"
00170 DATA " &Cut", "CUT", "E"
00171 DATA " -","",""
00180 DATA " &Paste", "PASTE", "ED"
00190 DATA "&OPTIONS", "", "ET"
00200 DATA " &Verify", "", "CX"
00210 DATA " &Display Name", "", "C"
00220 DATA "&HELP", "HELP", "E"
00230 !
00240 I+=1
00250 INPUT M$(I),PGM$(I),STATUS$(I) EOF 260 : GOTO 240
MAT M$ contains text to display. Each space indent identifies a pulldown menu of
the item above.
If the text is "-", a line separator will be displayed.
MAT PGM$ is the data associated with the menu option MAT STATUS$
E = sends event if selected (activate ON MENU in program)
P = Protect (disable/grey out/inactive) menu item
C = make item a checkable item, selecting item displays a check mark before it.
X = used with C, item is checked.
R = Retain menu option even after the program ends, or chains to another program.
00260 DISPLAY MENU: MAT M$, MAT PGM$, MAT STATUS$ EVENT 400 ! displays
menu
00270 ON EVENT GOTO 400 IGNORE
00280 INPUT MENU: MAT M$,MAT PGM$,MAT STATUS$ ! gets current menu
settings
00290 INPUT MENU TEXT: MAT M$
00300 INPUT MENU DATA: MAT PGM$
00310 INPUT MENU STATUS: MAT STATUS$
00400 X$=MENU$ ! returns data ("PGM$") from the last menu option selected
00410 X=MENU ! returns the subscript of the last menu option selected
Selections without an "R" status do not stay active across program chains.
The following events remove a menu:
CLEAR ALL
DISPLAY MENU (with empty variables)
CHAIN, END, or STOP (and no item has a R status)
Since INPUT MENU doesn't wait for keyboard or mouse input, it is necessary to use
some other means for waiting (kstat$ or input fields). A menu click produces a
kstat$ value of 6200 and, beginning with release 3.92I, an FKEY value of 98.
When a user defined Windows menu is displayed,the Preferences menu is
suppressed. When the user defined menu is cleared, Preferences is restored.
===========================================
From the old Programmers manual.
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

Well done George! That shed TONS of light on it all! Thanks so much.

-- Susan
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Post by John »

Well - That is a great find - and it's just the kind of thing I was looking for

BUT - I don't think it affects me...

My test consist of two programs:
JB\Display_Menu
02100 dim m_a$(1)*256,m_b$(1)*256,m_c$(1)*256
02200 mat m_a$(0) : mat m_b$(0) : mat m_c$(0)
02300 let x=5000
02400 let fn_a('top',str$(x+=1),'E')
02500 let fn_a(' choice 1',str$(x+=1),'E')
02600 let fn_a(' choice 2',str$(x+=1),'E')
02700 let fn_a(' check 1 (C)',str$(x+=1),'C')
02800 let fn_a(' check 2 (CX)',str$(x+=1),'CX')
02820 let fn_a(' check 3 (EC)',str$(x+=1),'EC')
02840 let fn_a(' check 4 (ECX)',str$(x+=1),'ECX')
02860 print newpage
02880 print fields '5,5,Cc 70,,B99': '[Esc] End'
02882 display menu: mat m_a$,mat m_b$,mat m_c$
02890 do
03000 input fields '10,10,C 15,[D]S': pause$
03100 print fields '12,10,C 40,[W]': 'menu='&str$(menu)
03200 print fields '13,10,C40 ,[W]': 'menu$='&menu$
03300 print fields '14,10,C4 0,[W]': 'fkey='&str$(fkey)
03320 print 'control returned to the calling program'
03400 loop until fkey=99
03500 chain 'new_program/jb'
03600 def fn_a(a$*256,b$*256,c$*256)
03700 mat m_a$(udim(mat m_a$)+1) : let m_a$(udim(mat m_a$))=a$
03720 mat m_b$(udim(mat m_b$)+1) : let m_b$(udim(mat m_b$))=b$
03740 mat m_c$(udim(mat m_c$)+1) : let m_c$(udim(mat m_c$))=c$
04000 fnend ! fn_a

and
new_program/jb
00010 print 'in a new program' : pause

I don't believe I have any R attributes in my test... I wonder if a previous menu might have set an R flag and it's set for the whole session now... hmmm.

-John
Post Reply