Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In our example, another ActiveX button was added to FRW_MAIN using the Form Designer. It does not matter where the button was placed or what size it is. The Frame Manager automatically configures the toolbar for you based on the information you provide. When FRW_MAIN is launched, the new button appears in the toolbar:

 

All that is needed now are the necessary sections of code within the FRW_MAIN_EVENTS commuter module that will launch this form. Here is what the Case statement might look like: 

Code Block
 Case Control EQ "PUB_TB_TEST"                       ; GoSub CLICK.PUB_TB_TEST

...

Here is what the specific gosub section might look like: 

Code Block
CLICK.PUB_TB_TEST: 
   Child = Start_MDIChild("DBW_TEST", @Window)  
return

...

The third method for launching an MDI Child is to use the Shortcut Bar control. Again, the Frame Manager is used to configure this:

...

With no additional coding necessary, this item will be automatically functional for the end user when the application is launched:

 

Step #3 - Configure the Toolbar Buttons with the Frame Manager

...

In order to provide a richer user interface experience, SRP FrameWorks was designed to enable and disable relevant menu items and toolbar buttons based on the status of the active MDI Child form. For instance, it would not make sense to have the Save or Delete buttons enabled if there were no MDI Child forms open or if the active form didn't have a record loaded. This is another feature that the Frame Manager was designed to configure:

...

After a component has been added to the Security Manager it is now available to the Group Access form (which is launched from within FRW_MAIN):

 

This image shows the built-in ADMIN group access profile. By default it has access to all components which have been pre-registered in the Security Manager. However, there is no access to Test Window since it was just registered to through the Security Manager. This means that any users with the ADMIN group access profile will not yet have access to this item. By default, Groups do not have access to new items registered in the Security Manager. To give the user access to this item just click on the dropdown button and select the desired access type: 

Type of AccessDescription
Full RightsUser has complete access to this item. If this is a form, the user has the ability to create, read, modify, and delete records.
Read OnlyUser can see but does not have access this item. If this is a form, the user has the ability to read records but not create, modify, or delete them.
Add/EditUser can create, read, and modify records but not delete them. (Applicable to forms only)
Edit OnlyUser can read and modify records but not create or delete them. (Applicable to forms only)
NoneUser does not have any access to this item. Menus, buttons, and shortcut items will be invisible.

...

Step #6 - Additional Features: Help Manager, Window Options (a.k.a. Softkeys)

...

You can use the Help Manager to easily create statusline and context sensitive help for your form and prompts. This form is designed to run from with FRW_MAIN so that end users can be given access it it. This is helpful if end users are used to document the system as they use it:

...

This code snippet shows how the case logic should appear in the commuter module: 

Code Block
 Case Control EQ Window 
   // This event is window specific. 
       
   Begin Case 
       Case Event EQ "CREATE"              ; GoSub CREATE 
       Case Event EQ "VSCROLL"             ; GoSub VSCROLL 
       Case Event EQ "FORMOPTS"            ; GoSub FORMOPTS
 

Here is a copy of the FORMOPTS gosub section as it appears in the DBW_SAMPLE3 commuter module:

 

 

 

Code Block
FORMOPTS: 
    // A type of SoftKey feature is available for all forms. First run the 
    // NDW_WINDOW_OPTIONS form, select a window, then add the softkey accelerator 
    // keys and descriptions. These will automatically appear in a popup when the 
    // user presses F6 or clicks on the Form Options button on the MDI Frame 
    // toolbar. If the end user selects an option from the popup or presses the 
    // appropriate accelerator keys then a special FORMOPTS event will be sent to 
    // the window's commuter module with the accelerator passed into Param1. 
    // It is up to the commuter to provide functionality (unlike AREV which 
    // offered a Code and Command prompt in the SoftKey definition form. 
    // @Window will always be the MDIFrame so the active MDI Child needs to 
    // be identified. 
    Window = Get_Property(@Window, "MDIACTIVE") 
    Softkey = Param1 
    If SoftKey EQ "F6" then 
        TypeOverride = "" 
        TypeOverride<8> = Get_Property(Window, "@FORM_OPTIONS") 
        TypeOverRide<28> = 1 ; // Select and highlight 1st 
        SoftKey = PopUp(@Window, TypeOverride, "WINDOW_OPTS")         
    end 

    Begin Case 
        Case SoftKey EQ "AF1" 
            // User pressed Alt-F1 
            Msg(@Window, "User pressed Alt-F1") 
            
        Case SoftKey EQ "AF2" 
            // User pressed Alt-F2 
            Msg(@Window, "User pressed Alt-F2") 
            
        Case SoftKey EQ "SF1" 
            // User pressed Shift-F1 
            Msg(@Window, "User pressed Shift-F1") 
            
        Case SoftKey EQ "SF2" 
            // User pressed Shift-F2 
            Msg(@Window, "User pressed Shift-F2") 
                
    End Case
return

...