Creates a dropdown selection dialog with the specified message and options

     `default` must be one of the options.

     Returns the selected value.
340172
def select(message="", title="Lackey Input", options=None, default=None):
    
    if options is None or len(options) == 0:
        return ""
    if default is None:
        default = options[0]
    if default not in options:
        raise ValueError("<<default>> not in options[]")
    root = tk.Tk()
    input_text = tk.StringVar()
    input_text.set(message)
    PopupList(root, message, title, options, default, input_text)
    root.focus_force()
    root.mainloop()
    return str(input_text.get())
161127
public static Preference createSingleChoicePreference(
            String name,
            String label,
            SingleChoiceDisplay displayType,
            List<Option> options,
            String defaultValue) {
        SingleChoicePreferenceInput input = new SingleChoicePreferenceInput();
        input.setDefault(defaultValue);
        input.setDisplay(displayType);
        input.getOptions().addAll(options);

        Preference pref = new Preference();
        pref.setName(name);
        pref.setLabel(label);
        pref.setPreferenceInput(
                new JAXBElement<SingleChoicePreferenceInput>(
                        new QName("single-choice-parameter-input"),
                        SingleChoicePreferenceInput.class,
                        input));

        return pref;
    }
252909
function internal_default_rejected(message) {
	var newWorker = Object.create(this, {'default_rejected': {value: ignore_rejected}});
	return this.require(this.LOGGER).then(internal_logger.bind([newWorker, message]));
}
887169
public static UserMessage create (Name speaker, String message)
    {
        return new UserMessage(speaker, null, message, ChatCodes.DEFAULT_MODE);
    }
357946
protected function choice($message, $expectedValues, $default = null
    )
    {
        /** @var QuestionHelper $q */
        $q = $this->getHelperSet()->get('question');

        $question = new ChoiceQuestion(
            $message . ($default ? (sprintf(' [%s]', $default)) : '') . ' : ',
            $expectedValues,
            $default
        );

        $question->setMaxAttempts(5);

        $response = $q->ask($this->getInput(), $this->getOutput(), $question);

        return $response;
    }
1054054
function opt(options, name, defaultValue){
    return options && options[name]!==undefined ? options[name] : defaultValue;
}
1363707
def get_warning_choice(self, message, short_message,
                           style=wx.YES_NO | wx.NO_DEFAULT | wx.ICON_WARNING):
        """"""

        dlg = GMD.GenericMessageDialog(self.main_window, message,
                                       short_message, style)

        choice = dlg.ShowModal()

        dlg.Destroy()

        return choice == wx.ID_YES
132331
def showMessageDialog(title, text):
    '''
    
    '''
    dlg = QgsMessageOutput.createMessageOutput()
    dlg.setTitle(title)
    dlg.setMessage(text, QgsMessageOutput.MessageHtml)
    dlg.showMessage()
1120805
public String getOptionsHelpMessage() {
        String ls = System.getProperty("line.separator");
        usageMessage = "Available options:";
        StringBuilder sb = new StringBuilder(usageMessage);
        sb.append(ls);
        for (Option option : declaredOptions.values()) {
            String name = option.getName();
            int extraPadding = longestOptionNameLength - name.length();
            sb.append(" -").append(name);
            for (int i = 0; i < extraPadding; i++) {
                sb.append(' ');
            }
            sb.append(DEFAULT_PADDING).append(option.getDescription()).append(ls);
        }

        return sb.toString();
    }
739611
static SelectStatement forSelection(CFMetaData cfm, Selection selection)
    {
        return new SelectStatement(cfm, 0, defaultParameters, selection, null);
    }
1010506
def __choicebox(msg, title, choices):
    
    global boxRoot, __choiceboxResults, choiceboxWidget, defaultText
    global choiceboxWidget, choiceboxChoices
    # -------------------------------------------------------------------
    # If choices is a tuple, we make it a list so we can sort it.
    # If choices is already a list, we make a new list, so that when
    # we sort the choices, we don't affect the list object that we
    # were given.
    # -------------------------------------------------------------------
    choices = list(choices[:])

    if len(choices) == 0:
        choices = ["Program logic error - no choices were specified."]
    defaultButtons = ["OK", "Cancel"]

    choices = [str(c) for c in choices]

    # TODO RL: lines_to_show is set to a min and then set to 20 right after
    # that.  Figure out why.
    lines_to_show = min(len(choices), 20)
    lines_to_show = 20

    if title is None:
        title = ""

    # Initialize __choiceboxResults
    # This is the value that will be returned if the user clicks the close icon
    __choiceboxResults = None

    boxRoot = Tk()
    # RL: Removed so top-level program can be closed with an 'x'
    boxRoot.protocol('WM_DELETE_WINDOW', __choiceboxQuit)
    screen_width = boxRoot.winfo_screenwidth()
    screen_height = boxRoot.winfo_screenheight()
    root_width = int((screen_width * 0.8))
    root_height = int((screen_height * 0.5))
    root_xpos = int((screen_width * 0.1))
    root_ypos = int((screen_height * 0.05))

    boxRoot.title(title)
    boxRoot.iconname('Dialog')
    st.rootWindowPosition = "+0+0"
    boxRoot.geometry(st.rootWindowPosition)
    boxRoot.expand = NO
    boxRoot.minsize(root_width, root_height)
    st.rootWindowPosition = '+{0}+{1}'.format(root_xpos, root_ypos)
    boxRoot.geometry(st.rootWindowPosition)

    # ---------------- put the frames in the window --------------------------
    message_and_buttonsFrame = Frame(master=boxRoot)
    message_and_buttonsFrame.pack(side=TOP, fill=X, expand=NO)

    messageFrame = Frame(message_and_buttonsFrame)
    messageFrame.pack(side=LEFT, fill=X, expand=YES)

    buttonsFrame = Frame(message_and_buttonsFrame)
    buttonsFrame.pack(side=RIGHT, expand=NO, pady=0)

    choiceboxFrame = Frame(master=boxRoot)
    choiceboxFrame.pack(side=BOTTOM, fill=BOTH, expand=YES)

    # -------------------------- put the widgets in the frames ---------------

    # ---------- put a msg widget in the msg frame-------------------
    messageWidget = Message(
        messageFrame, anchor=NW, text=msg, width=int(root_width * 0.9))
    messageWidget.configure(
        font=(st.PROPORTIONAL_FONT_FAMILY, st.PROPORTIONAL_FONT_SIZE))
    messageWidget.pack(side=LEFT, expand=YES, fill=BOTH, padx='1m', pady='1m')

    # --------  put the choiceboxWidget in the choiceboxFrame ----------------
    choiceboxWidget = Listbox(choiceboxFrame, height=lines_to_show, borderwidth="1m", relief="flat", bg="white"
                              )

    if __choiceboxMultipleSelect:
        choiceboxWidget.configure(selectmode=MULTIPLE)

    choiceboxWidget.configure(
        font=(st.PROPORTIONAL_FONT_FAMILY, st.PROPORTIONAL_FONT_SIZE))

    # add a vertical scrollbar to the frame
    rightScrollbar = Scrollbar(
        choiceboxFrame, orient=VERTICAL, command=choiceboxWidget.yview)
    choiceboxWidget.configure(yscrollcommand=rightScrollbar.set)

    # add a horizontal scrollbar to the frame
    bottomScrollbar = Scrollbar(
        choiceboxFrame, orient=HORIZONTAL, command=choiceboxWidget.xview)
    choiceboxWidget.configure(xscrollcommand=bottomScrollbar.set)

    # pack the Listbox and the scrollbars.  Note that although we must define
    # the textArea first, we must pack it last, so that the bottomScrollbar will
    # be located properly.

    bottomScrollbar.pack(side=BOTTOM, fill=X)
    rightScrollbar.pack(side=RIGHT, fill=Y)

    choiceboxWidget.pack(
        side=LEFT, padx="1m", pady="1m", expand=YES, fill=BOTH)

    # ---------------------------------------------------
    # sort the choices
    # eliminate duplicates
    # put the choices into the choicebox Widget
    # ---------------------------------------------------

    choices = ut.lower_case_sort(choices)

    lastInserted = None
    choiceboxChoices = list()
    for choice in choices:
        if choice == lastInserted:
            continue
        else:
            choiceboxWidget.insert(END, choice)
            choiceboxChoices.append(choice)
            lastInserted = choice

    boxRoot.bind('<Any-Key>', KeyboardListener)

    # put the buttons in the buttonsFrame
    if len(choices):
        okButton = Button(
            buttonsFrame, takefocus=YES, text="OK", height=1, width=6)
        bindArrows(okButton)
        okButton.pack(
            expand=NO, side=TOP, padx='2m', pady='1m', ipady="1m", ipadx="2m")

        # for the commandButton, bind activation events to the activation event
        # handler
        commandButton = okButton
        handler = __choiceboxGetChoice
        for selectionEvent in st.STANDARD_SELECTION_EVENTS:
            commandButton.bind("<%s>" % selectionEvent, handler)

        # now bind the keyboard events
        choiceboxWidget.bind("<Return>", __choiceboxGetChoice)
        choiceboxWidget.bind("<Double-Button-1>", __choiceboxGetChoice)
    else:
        # now bind the keyboard events
        choiceboxWidget.bind("<Return>", __choiceboxCancel)
        choiceboxWidget.bind("<Double-Button-1>", __choiceboxCancel)

    cancelButton = Button(
        buttonsFrame, takefocus=YES, text="Cancel", height=1, width=6)
    bindArrows(cancelButton)
    cancelButton.pack(
        expand=NO, side=BOTTOM, padx='2m', pady='1m', ipady="1m", ipadx="2m")

    # for the commandButton, bind activation events to the activation event
    # handler
    commandButton = cancelButton
    handler = __choiceboxCancel
    for selectionEvent in st.STANDARD_SELECTION_EVENTS:
        commandButton.bind("<%s>" % selectionEvent, handler)

    # add special buttons for multiple select features
    if len(choices) and __choiceboxMultipleSelect:
        selectionButtonsFrame = Frame(messageFrame)
        selectionButtonsFrame.pack(side=RIGHT, fill=Y, expand=NO)

        selectAllButton = Button(
            selectionButtonsFrame, text="Select All", height=1, width=6)
        bindArrows(selectAllButton)

        selectAllButton.bind("<Button-1>", __choiceboxSelectAll)
        selectAllButton.pack(
            expand=NO, side=TOP, padx='2m', pady='1m', ipady="1m", ipadx="2m")

        clearAllButton = Button(
            selectionButtonsFrame, text="Clear All", height=1, width=6)
        bindArrows(clearAllButton)
        clearAllButton.bind("<Button-1>", __choiceboxClearAll)
        clearAllButton.pack(
            expand=NO, side=TOP, padx='2m', pady='1m', ipady="1m", ipadx="2m")

    # -------------------- bind some keyboard events -------------------------
    boxRoot.bind("<Escape>", __choiceboxCancel)

    # --------------------- the action begins --------------------------------
    # put the focus on the choiceboxWidget, and the select highlight on the
    # first item
    choiceboxWidget.select_set(0)
    choiceboxWidget.focus_force()

    # --- run it! -----
    boxRoot.mainloop()
    try:
        boxRoot.destroy()
    except:
        pass
    return __choiceboxResults
1019971
function _keySelect() {
            var filteredChoices;

            if (lxSelect.choicesViewMode === 'panes') {
                filteredChoices = lxSelect.panes[(lxSelect.panes.length - 1)];
                if (!lxSelect.isLeaf(filteredChoices[lxSelect.activeChoiceIndex])) {
                    return;
                }
            } else {
                filteredChoices = $filter('filterChoices')(lxSelect.choices, lxSelect.filter, lxSelect.filterModel);
            }

            if (filteredChoices.length && filteredChoices[lxSelect.activeChoiceIndex]) {
                lxSelect.toggleChoice(filteredChoices[lxSelect.activeChoiceIndex]);
            } else if (lxSelect.filterModel && lxSelect.allowNewValue) {
                if (angular.isArray(getSelectedModel())) {
                    var value = angular.isFunction(lxSelect.newValueTransform) ? lxSelect.newValueTransform(lxSelect.filterModel) : lxSelect.filterModel;
                    var identical = getSelectedModel().some(function (item) {
                        return angular.equals(item, value);
                    });

                    if (!identical) {
                        lxSelect.getSelectedModel().push(value);
                    }
                }

                lxSelect.filterModel = undefined;

                LxDropdownService.close('dropdown-' + lxSelect.uuid);
            }
        }
585336
function(title, message) {
            if (!message) {
                message = title;
                title = null;
            }

            return Dialogs.open(null, {
                "title": title,
                "message": message,
                "dialog": "confirm"
            });
        }
610848
@Override
    public String keyDefault(String keyName, String defaultValue) {

        if (hasConfigValue(keyName)) {
            return getConfigValue(keyName);
        }
        return m_messages.keyDefault(keyName, defaultValue);
    }
250451
def _build_default_options(self):
        "
        return [
            OptionDefault('model', None, inherit=True),
            OptionDefault('abstract', False, inherit=False),
            OptionDefault('strategy', enums.CREATE_STRATEGY, inherit=True),
            OptionDefault('inline_args', (), inherit=True),
            OptionDefault('exclude', (), inherit=True),
            OptionDefault('rename', {}, inherit=True),
        ]
541255
def yn_choice(msg, indent=4, fg_color='cyan', separator=''):
    
    _header, _footer = gen_separator(separator=separator)
    if _header:
        textui.puts(getattr(textui.colored, fg_color)(_header))
    with textui.indent(indent, quote=' {}'.format(' ')):
        textui.puts(textui.colored.green(msg))
    if _footer:
        textui.puts(getattr(textui.colored, fg_color)(_footer))

    c = click.confirm(
        click.style('Your Choice?[yn] (q-quit/b-back)?', fg='cyan'),
        default=True,
    )
    return c
1342604
public String getConfigurationOptionValue (String optionName, String defaultValue) {
		String optionValue;
		Node configurationOption = this.getConfigurationOption (optionName);
		if (configurationOption != null) {
			optionValue = configurationOption.getTextContent ();
		} else {
			optionValue = defaultValue;
		}
		return optionValue;
	}