Class: Fzeet::FontDialog
Constant Summary
collapse
- DialogStruct =
Windows::CHOOSEFONT
- HookProc =
-> *args { CommonDialog::HookProc.(*args.unshift(DialogStruct)) }
WindowMethods::EnumChildProc
Instance Attribute Summary
Attributes inherited from CommonDialog
#struct
Instance Method Summary
collapse
crackMessage, #hookProc, #on
#[], #capture=, #capture?, #dialog=, #dialog?, #dlgmsg?, #drawMenuBar, #eachChild, #enabled=, #enabled?, #focus=, #focus?, #invalidate, #location, #location=, #long, #menu, #menu=, #message, #paint, #position, #position=, #postmsg, #question, #rect, #reframe, #sendmsg, #size, #size=, #style, #style?, #text, #text=, #textlen, #topmost=, #topmost?, #update, #visible=, #visible?, #xstyle, #xstyle?
Methods included from Toggle
#toggle
Constructor Details
#initialize(opts = {}) ⇒ FontDialog
Returns a new instance of FontDialog.
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
# File 'lib/fzeet/windows/comdlg/FontDialog.rb', line 84
def initialize(opts = {})
_opts = {
font: Control::Font,
color: 0
}
badopts = opts.keys - _opts.keys; raise "Bad option(s): #{badopts.join(', ')}." unless badopts.empty?
_opts.merge!(opts)
@struct = DialogStruct.new
@struct[:lStructSize] = @struct.size
@struct[:hInstance] = Windows.GetModuleHandle(nil)
@struct[:lpLogFont] = _opts[:font].logfont.pointer
@struct[:Flags] = Fzeet.flags([:enablehook, :both, :inittologfontstruct, :effects], :cf_)
@struct[:rgbColors] = _opts[:color]
@struct[:lCustData] = object_id
@struct[:lpfnHook] = HookProc
super()
end
|
Instance Method Details
#color ⇒ Object
112
|
# File 'lib/fzeet/windows/comdlg/FontDialog.rb', line 112
def color; @struct[:rgbColors] end
|
#show(window = Application.window) ⇒ Object