Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Clijsters opened this issue Apr 27, 2016 · 0 comments
Open

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

Clijsters opened this issue Apr 27, 2016 · 0 comments

Comments

@Clijsters
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant