Power Objects Menu Creation Syntax Fails to Produce a New Menu
Date: 1996/03/21
Message-ID: <31523B08.65DE_at_violet.berkeley.edu>#1/1
I am trying to create a new menu bar based on the instructions found in Power Objects Developer's Guide and other reference materials. From what I can see my syntax matches the models I have considered to a "t", but when I run the application (via the development interface) the initial form opens but I see no new menu item and no alteration to the default menu. Below, I have provided the three areas I have entered code with the hopes of creating the new menu.
Usually, there is something I have overlooked or the author's have failed to mention which explains the failure. My hope is one of the members of this list will be able to point out my error. THANKS!
Hagen Finley
Berkeley, CA
These are my (Declarations):
'Declare base value for all menu id's
CONST cmdEntry = cmd_FirstUserCommand + 1
'Assign menu IDS
CONST cmdText = cmdEntry + 1
CONST cmdBook = cmdEntry + 2
CONST cmdChapter = cmdEntry + 3
CONST cmdBiblio = cmdEntry + 4
CONST cmdMain = cmdEntry + 5
CONST cmdBrowse = cmdEntry + 6
CONST cmdQuery = cmdEntry + 7
This is the DoCommand() Syntax:
SELECT CASE cmdCode
CASE cmdText
frmLogicPracticeEntry.OpenWindow() DoCommand = TRUE CASE cmdBook frmLogicPracticeBook.OpenWindow() DoCommand = TRUE CASE cmdChapter frmLogicPracticeChapter.OpenWindow() DoCommand = TRUE CASE cmdBiblio frmLogicPracticeBiblio.OpenWindow() DoCommand = TRUE CASE cmdMain frmLogicPractice.OpenWindow() DoCommand = TRUE CASE cmdBrowse frmLogicPracticeBrowse.OpenWindow() DoCommand = TRUE CASE cmdQuery frmLogicPracticeReportGenerator.OpenWindow() DoCommand = TRUE
END SELECT This is the OnLoad() Syntax I am using:
'Define new Menu Bar
DIM mbrBourdieu AS Object
DIM mnuEntry AS Object
mbrBourdieu = NEW MenuBar
mnuEntry = NEW Menu
'Add standard menu features
mbrBourdieu.SysDefaultMenuBar()
'Create Entry Menu
mnuEntry.Label = "E&ntry" mnuEntry.AppendMenuItem("&Text Entry", cmdText, 0, NULL) mnuEntry.AppendMenuItem("&Book Title Entry", cmdBook, 0, NULL) mnuEntry.AppendMenuItem("&Chapter Title Entry", cmdChapter, 0, NULL) mnuEntry.AppendMenuItem("Biblio&graphy Entry", cmdBiblio, 0, NULL) mnuEntry.AppendMenuItem("&Main View", cmdMain, 0, NULL) mnuEntry.AppendMenuItem("B&rowse", cmdBrowse, 0, NULL) mnuEntry.AppendMenuItem("&Query Builder", cmdQuery, 0, NULL)
'Add Menu Bar
mbrBourdieu.InsertMenu(3, mnuEntry)
'Associate forms with menu
frmLogicPracticeEntry.SetMenuBar(mbrBourdieu) frmLogicPracticeBook.SetMenuBar(mbrBourdieu) frmLogicPracticeChapter.SetMenuBar(mbrBourdieu) frmLogicPracticeBiblio.SetMenuBar(mbrBourdieu) frmLogicPractice.SetMenuBar(mbrBourdieu) frmLogicPracticeBrowse.SetMenuBar(mbrBourdieu) frmLogicPracticeReportGenerator.SetMenuBar(mbrBourdieu)
'Open initial form
frmLogicPractice.OpenWindow() Received on Thu Mar 21 1996 - 00:00:00 CET