lib/wx/core/choicedlg.rb in wxruby3-1.2.1 vs lib/wx/core/choicedlg.rb in wxruby3-1.3.0

- old
+ new

@@ -12,13 +12,12 @@ def self.get_single_choice(message, caption, choices, parent = nil, initial_selection: 0, - x: Wx::DEFAULT_COORD, - y: Wx::DEFAULT_COORD) - dialog = Wx::SingleChoiceDialog.new(parent, message, caption, choices, nil, Wx::CHOICEDLG_STYLE, [x, y]) + pos: Wx::DEFAULT_POSITION) + dialog = Wx::SingleChoiceDialog.new(parent, message, caption, choices, Wx::CHOICEDLG_STYLE, pos) dialog.selection = initial_selection return dialog.show_modal == Wx::ID_OK ? dialog.get_string_selection : '' end @@ -26,13 +25,12 @@ def self.get_single_choice_index(message, caption, choices, parent = nil, initial_selection: 0, - x: Wx::DEFAULT_COORD, - y: Wx::DEFAULT_COORD) - dialog = Wx::SingleChoiceDialog.new(parent, message, caption, choices, nil, Wx::CHOICEDLG_STYLE, [x, y]) + pos: Wx::DEFAULT_POSITION) + dialog = Wx::SingleChoiceDialog.new(parent, message, caption, choices, Wx::CHOICEDLG_STYLE, pos) dialog.selection = initial_selection return dialog.show_modal == Wx::ID_OK ? dialog.get_selection : -1 end @@ -41,19 +39,18 @@ def self.get_selected_choices(message, caption, choices, parent = nil, initial_selections: [], - x: Wx::DEFAULT_COORD, - y: Wx::DEFAULT_COORD) - dialog = Wx::MultiChoiceDialog.new(parent, message, caption, choices, Wx::CHOICEDLG_STYLE, [x, y]) + pos: Wx::DEFAULT_POSITION) + dialog = Wx::MultiChoiceDialog.new(parent, message, caption, choices, Wx::CHOICEDLG_STYLE, pos) # call this even if selections array is empty and this then (correctly) # deselects the first item which is selected by default dialog.selections = initial_selections if dialog.show_modal != Wx::ID_OK - return [] + return nil end dialog.get_selections end