Class: RubyMVC::Toolkit::WxRuby::MessageBox

Inherits:
Wx::MessageDialog
  • Object
show all
Includes:
Common
Defined in:
lib/ruby_mvc/toolkit/peers/wxruby/messagebox.rb

Instance Method Summary collapse

Methods included from Common

#title, #title=

Constructor Details

#initialize(message, options) ⇒ MessageBox

Returns a new instance of MessageBox.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ruby_mvc/toolkit/peers/wxruby/messagebox.rb', line 33

def initialize(message, options)
  opts = {}
  title = options[:title] || "Message"
  if parent = options[:parent]
    parent = parent.peer
  end
  case(options[:class])
  when :error
    flags = Wx::OK | Wx::ICON_ERROR
  when :info
    flags = Wx::OK | Wx::ICON_INFORMATION
  when :question
    flags = Wx::YES_NO | Wx::ICON_QUESTION
  else
    flags = Wx::OK | Wx::CANCEL
  end
  super(parent, message.to_s, title, flags)
end

Instance Method Details

#showObject



52
53
54
# File 'lib/ruby_mvc/toolkit/peers/wxruby/messagebox.rb', line 52

def show
  show_modal
end