Class: Fzeet::Application
- Inherits:
-
Object
- Object
- Fzeet::Application
- Defined in:
- lib/fzeet/windows.rb
Class Attribute Summary collapse
-
.accelerators ⇒ Object
readonly
Returns the value of attribute accelerators.
-
.authors ⇒ Object
Returns the value of attribute authors.
-
.devcaps ⇒ Object
readonly
Returns the value of attribute devcaps.
-
.dialogs ⇒ Object
readonly
Returns the value of attribute dialogs.
-
.images ⇒ Object
readonly
Returns the value of attribute images.
-
.name ⇒ Object
Returns the value of attribute name.
-
.quitWhenMainWindowCloses ⇒ Object
Returns the value of attribute quitWhenMainWindowCloses.
-
.version ⇒ Object
Returns the value of attribute version.
-
.window ⇒ Object
Returns the value of attribute window.
Class Method Summary collapse
Class Attribute Details
.accelerators ⇒ Object (readonly)
Returns the value of attribute accelerators.
56 57 58 |
# File 'lib/fzeet/windows.rb', line 56 def accelerators @accelerators end |
.authors ⇒ Object
Returns the value of attribute authors.
55 56 57 |
# File 'lib/fzeet/windows.rb', line 55 def @authors end |
.devcaps ⇒ Object (readonly)
Returns the value of attribute devcaps.
56 57 58 |
# File 'lib/fzeet/windows.rb', line 56 def devcaps @devcaps end |
.dialogs ⇒ Object (readonly)
Returns the value of attribute dialogs.
56 57 58 |
# File 'lib/fzeet/windows.rb', line 56 def dialogs @dialogs end |
.images ⇒ Object (readonly)
Returns the value of attribute images.
56 57 58 |
# File 'lib/fzeet/windows.rb', line 56 def images @images end |
.name ⇒ Object
Returns the value of attribute name.
55 56 57 |
# File 'lib/fzeet/windows.rb', line 55 def name @name end |
.quitWhenMainWindowCloses ⇒ Object
Returns the value of attribute quitWhenMainWindowCloses.
55 56 57 |
# File 'lib/fzeet/windows.rb', line 55 def quitWhenMainWindowCloses @quitWhenMainWindowCloses end |
.version ⇒ Object
Returns the value of attribute version.
55 56 57 |
# File 'lib/fzeet/windows.rb', line 55 def version @version end |
.window ⇒ Object
Returns the value of attribute window.
56 57 58 |
# File 'lib/fzeet/windows.rb', line 56 def window @window end |
Class Method Details
.quit(code = 0) ⇒ Object
97 98 99 100 101 102 |
# File 'lib/fzeet/windows.rb', line 97 def self.quit(code = 0) accelerators.each(&:dispose) images.values.each(&:dispose) Windows.PostQuitMessage(code) end |
.run(windowOrOpts = {}, &block) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/fzeet/windows.rb', line 65 def self.run(windowOrOpts = {}, &block) @window = case windowOrOpts when BasicWindow; windowOrOpts.tap { |window| block.call(window) if block } when Hash if windowOrOpts[:deferCreateWindow].tap { windowOrOpts.delete_if { |k, v| k == :deferCreateWindow } } Window.new(windowOrOpts, &block) else Window.new(windowOrOpts).tap { |window| block.call(window) if block } end else raise ArgumentError end return 0 if window.handle.null? @window.on(:destroy) { quit } if @quitWhenMainWindowCloses @window.show.update msg = Message.new while msg.get! msg.translate.dispatch unless (window.client && Windows.TranslateMDISysAccel(window.client.handle, msg) != 0) || accelerators.any? { |table| table.translate?(msg, @window) } || dialogs.any? { |dialog| dialog.dlgmsg?(msg) } end msg[:wParam] rescue Fzeet. %Q{#{$!}\n\n#{$!.backtrace.join("\n")}}, icon: :error end |