Add method to get a configured instance of the MainMenuRenderer class
The GetConfiguredMainMenuRenderer method NewMainMenuRenderer method is used to create a new instance of the MainMenuRenderer class and configure it with the settings of your Main Menu Form. If you want to customize the rendering of the menu you can create a class that implements the IMainMenuRenderer interface and create an instance of that class here.
...
| Code Block | ||
|---|---|---|
| ||
/*------------------------------------------------------------------------------
Purpose: Creates and configures a new instance of the MainMenuRenderer class
Notes:
@return The configured instance of the MainMenuRenderer class
------------------------------------------------------------------------------*/
METHOD PUBLIC IMainMenuRenderer GetConfiguredMainMenuRendererNewMainMenuRenderer ():
DEFINE VARIABLE oMainMenuRenderer AS MainMenuRenderer NO-UNDO.
oMainMenuRenderer = NEW MainMenuRenderer ().
oMainMenuRenderer:ConstantExplorerBarGroups = "":U.
oMainMenuRenderer:MenuTreeViewControlSortAlphabetical = FALSE.
oMainMenuRenderer:RenderRecentGroup = TRUE.
RETURN oMainMenuRenderer.
END METHOD . |
...
| Code Block | ||
|---|---|---|
| ||
oMainMenuRenderer = GetConfiguredMainMenuRendererNewMainMenuRenderer (). oMainMenuRenderer:RenderMenuStructure (THIS-OBJECT:ultraExplorerBar1, THIS-OBJECT:smartToolbarController1, THIS-OBJECT). |
...
| Code Block | ||
|---|---|---|
| ||
WHEN "Reload Menu":U THEN DO:
oMainMenuRenderer = GetConfiguredMainMenuRendererNewMainMenuRenderer ().
oMainMenuRenderer:RenderMenuStructure (THIS-OBJECT:ultraExplorerBar1,
THIS-OBJECT:smartToolbarController1,
THIS-OBJECT).
END. |
...