Displaying the Navigation Toolbar
The vCshowNavBar check box on the Main Menu form displays the Navigation Toolbar. It uses the following Xbasic code.
if (vCshowNavBar = "yes") then dim global vcToolbarName as C vcToolbarName = show_nav_toolbar() else if (ui_modeless_dlg_exist(vcToolbarName) then ui_modeless_dlg_close(vcToolbarName) end if end if
The session variable vCshowNavBar is defined at the form level and initialized to "no". Consequently, the Navigation Toolbar does not display when the application starts. The first action is to create the variable vcToolbarName, which can later be used to test whether the toolbar is open.
if (vCshowNavBar = "yes") then dim global vcToolbarName as C
If the user wants to show the Navigation Toolbar, we call the function that opens it. The show_nav_toolbar() function returns the name of the toolbar.
vcToolbarName = show_nav_toolbar()
The alternative is that the user wants to close the toolbar. Before closing the toolbar, use the ui_modeless_dlg_exist() function to make sure that the user did not already close it.
else if (ui_modeless_dlg_exist(vcToolbarName) then
If we have established that the toolbar is still open, then close it.
ui_modeless_dlg_close(vcToolbarName) end if end if