Class: Fzeet::PageSetupDialog
- Inherits:
-
Object
- Object
- Fzeet::PageSetupDialog
- Defined in:
- lib/fzeet/windows/comdlg/PrintDialog.rb
Instance Attribute Summary collapse
-
#struct ⇒ Object
readonly
Returns the value of attribute struct.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ PageSetupDialog
constructor
A new instance of PageSetupDialog.
- #show(window = Application.window) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ PageSetupDialog
Returns a new instance of PageSetupDialog.
200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/fzeet/windows/comdlg/PrintDialog.rb', line 200 def initialize(opts = {}) _opts = { } badopts = opts.keys - _opts.keys; raise "Bad option(s): #{badopts.join(', ')}." unless badopts.empty? _opts.merge!(opts) @struct = Windows::PAGESETUPDLG.new @struct[:lStructSize] = @struct.size @struct[:hInstance] = Windows.GetModuleHandle(nil) @struct[:Flags] = Fzeet.flags(0, :psd_) end |
Instance Attribute Details
#struct ⇒ Object (readonly)
Returns the value of attribute struct.
214 215 216 |
# File 'lib/fzeet/windows/comdlg/PrintDialog.rb', line 214 def struct @struct end |
Instance Method Details
#show(window = Application.window) ⇒ Object
216 217 218 219 220 |
# File 'lib/fzeet/windows/comdlg/PrintDialog.rb', line 216 def show(window = Application.window) @struct[:hwndOwner] = window.handle DialogResult.new((Windows.PageSetupDlg(@struct) == 0) ? Windows::IDCANCEL : Windows::IDOK) end |