Class: Fidgit::FileDialog
- Inherits:
-
DialogState
- Object
- Chingu::GameState
- GuiState
- DialogState
- Fidgit::FileDialog
- Defined in:
- lib/fidgit/states/file_dialog.rb
Overview
A simple dialog that manages a message with a set of buttons beneath it.
Constant Summary
Constants inherited from DialogState
DialogState::DEFAULT_BACKGROUND_COLOR, DialogState::DEFAULT_BORDER_COLOR, DialogState::DEFAULT_SHADOW_COLOR, DialogState::DEFAULT_SHADOW_OFFSET
Constants inherited from GuiState
Instance Attribute Summary
Attributes inherited from GuiState
Instance Method Summary collapse
-
#initialize(type, options = {}, &block) ⇒ FileDialog
constructor
A new instance of FileDialog.
Methods inherited from DialogState
Methods inherited from GuiState
clear, #clear, #cursor, #distance, #draw, #draw_frame, #draw_rect, #file_dialog, #finalize, #flush, #hide, #hide_menu, #menu, #message, #setup, #show, #show_menu, #t, #tool_tip_delay, #unset_mouse_over, #update, #write_tree
Constructor Details
#initialize(type, options = {}, &block) ⇒ FileDialog
Returns a new instance of FileDialog.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fidgit/states/file_dialog.rb', line 4 def initialize(type, = {}, &block) = { show: true, background_color: DEFAULT_BACKGROUND_COLOR, border_color: DEFAULT_BORDER_COLOR, }.merge! super() vertical align: :center, padding: 0 do |packer| FileBrowser.new(type, { parent: packer }.merge!()) do |sender, result, file_name| hide block.call result, file_name if block end end show if [:show] end |