Class: Fzeet::PrintDialog
- Inherits:
-
Object
- Object
- Fzeet::PrintDialog
- 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 = {}) ⇒ PrintDialog
constructor
A new instance of PrintDialog.
- #show(window = Application.window) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ PrintDialog
Returns a new instance of PrintDialog.
243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/fzeet/windows/comdlg/PrintDialog.rb', line 243 def initialize(opts = {}) _opts = { } badopts = opts.keys - _opts.keys; raise "Bad option(s): #{badopts.join(', ')}." unless badopts.empty? _opts.merge!(opts) @struct = Windows::PRINTDLG.new @struct[:lStructSize] = 66 @struct[:hInstance] = Windows.GetModuleHandle(nil) @struct[:Flags] = Fzeet.flags([:returndc, :usedevmodecopiesandcollate], :pd_) end |
Instance Attribute Details
#struct ⇒ Object (readonly)
Returns the value of attribute struct.
257 258 259 |
# File 'lib/fzeet/windows/comdlg/PrintDialog.rb', line 257 def struct @struct end |
Instance Method Details
#show(window = Application.window) ⇒ Object
259 260 261 262 263 |
# File 'lib/fzeet/windows/comdlg/PrintDialog.rb', line 259 def show(window = Application.window) @struct[:hwndOwner] = window.handle DialogResult.new((Windows.PrintDlg(@struct) == 0) ? Windows::IDCANCEL : Windows::IDOK) end |