Ticket #29 (closed enhancement: wontfix)

Opened 4 years ago

Last modified 4 years ago

scriptUI: Choice dialog with custom buttons

Reported by: jteh Owned by: jteh
Priority: minor Milestone: 2009.1
Component: Core Version: development
Keywords: Cc:
Operating system: Blocked by:
Blocking:

Description

There will probably be several uses for a dialog containing a list and several buttons. A links list is one example.

The current scriptUI code includes SingleChoiceDialog and LinksListDialog. It would make sense to abstract this code so that it can be used more generally and then sub-class to provide these dialogs.

For this new class:

  • The constructor should take:
    • title
    • message
    • choices: A list of choices
    • defaultChoice :index of default choice
    • buttons:
      • A list of buttons to display
      • Need some way of identifying which button was pressed
      • Callbacks might be nice, but might be tricky to implement, as the GUI ExternalExecuteEvent can only take one callback. Also, might actually make coding harder
      • Perhaps just return the index of the button that was pressed?
      • Cancel button will be added in addition to these buttons
      • How do we handle the case of just wanting a standard ButtonSizer with OK and Cancel buttons?
        • Maybe an empty buttons list?
    • defaultButton: Index of default button
      • The default button will get an ID of ID_OK
  • Callback will probably return (buttonIndex, selectedItemIndex, selectedItemText)

Change History

comment:1 Changed 4 years ago by mdcurran

Do we still need this? as the Links list is already implemented. Was this going to be used for a System Tray list? if so I'd suggest making a ticket for that and making this block that.

comment:2 Changed 4 years ago by jteh

  • Status changed from new to closed
  • Resolution set to wontfix

ON further reflection, this idea is probably overly complicated. It is probably easier to just make such dialogs for individual cases as required. This can be reopened if desired at a later point.

Note: See TracTickets for help on using tickets.