Re: Forms 4.5 -- how to prevent default nav on open?

From: Interested <fake_at_nowhere.com>
Date: 1996/06/13
Message-ID: <31C05FB0.12A3_at_nowhere.com>#1/1


Matt Stahl wrote:
>
> I'm using Dev2K (Forms 4.5) under MS-Windows. When a form opens, focus
> automatically moves to the 1st navigable item. I'd like to open the form
> and just show a menu (i.e., don't display any blocks, and don't open any
> windows).
>
> After the user selects an item, then I'll open a window and navigate to a
> block.
>
> Question: How can I disable the automatic navigation?
>
> --
> Matthew G. Stahl | EMail: mgstahl_at_sonalysts.com
> Analyst | Voice: (860) 442-4355 x 112
> Sonalysts, Inc. | Fax: (860) 442-5080
> =================================================
> All opinions expressed are purely my own and do
> not reflect those of Sonalysts, Inc.
> =================================================

We've developed an application that has the behavior you desire. The user invokes MAIN.FMX. MAIN has a menu and a single window with "About"-type info (Application name, release level, copyright, etc.).

Here are the steps we took:

  1. Build a menu (e.g., APP_MENU.MMB) and attach the PL/SQL code to invoke the different forms of the application. We used the built-in OPEN_FORM();
  2. Develop MAIN.FMB:
  3. In the WHEN-NEW-FORM-INSTANCE trigger (at the form-level) insert the following code: replace_menu('APP_MENU'); :global.quit_all := 'N';

The global gets used in the last step.

        b. Create a window.

        c. Create a canvas with "About"-type info (Application name, release level, copyright, etc.). Attach this canvas to the window in step b.

        d. Create a control block (no base table) with a single button labelled "End Application". This is required because forms needs at least one navigable item to go to when the form starts. Put the button on the canvas and insert the following in the WHEN-BUTTTON-PRESSED trigger:

		:global.quit_all := 'Y';
		exit_form;

3. Develop the remaining forms in the application: Each form in the application needs the following code in the WHEN-WINDOW-ACTIVATED trigger at the form-level:

		if :global.quit_all = 'Y' then
			exit_form;
		end if;

This will cause each form to close as they receive the focus when the user presses the "End Application" button in MAIN.FMX.

Hope this helps.

Scott P. Escott
escotts_at_gecinc.com Received on Thu Jun 13 1996 - 00:00:00 CEST

Original text of this message