Skip to content

Start Menu - Dynamically add Buttons ->OnLoad / at runtime #2

@clijsters

Description

@clijsters

The Buttons in StartMenu() are created hard coded for testing purposes.
The plan is to have a configuration file (XML / JSON), which holds the StartMenuEntries (NIY) in a maintainable format.

Each entry should have at least the following attributes assigned to it:

  • [String]Text
  • [String]Action
  • [Int]Slot
  • [Int]TabIndex (Slot() + 2)
  • [Bool]CreateNewInstance (Indicates, if Action is a new Process or a ScriptBlock)

Current favorite is XML.

These Buttons are injected either at initialization, or through a lambda in $menuForm.Add_Load({}), where the menu itself would parse the configuration. I think a injection would fit best, as I want to add configuration support to more routines, not only this one.

Idea: Two seperate Event Handlers listening for Button.Click. One performs the defined action, the other hides the menu. Currently, we are using one Handler, performing both actions sequental. Check if that would increase performance.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions