Class: Fzeet::DateTimePicker

Inherits:
Control
  • Object
show all
Includes:
DateTimePickerMethods
Defined in:
lib/fzeet/windows/comctl/DateTimePicker.rb

Constant Summary collapse

Prefix =
{
	xstyle: [:ws_ex_],
	style: [:dts_, :ws_],
	message: [:dtm_, :ccm_, :wm_],
	notification: [:dtn_, :nm_]
}

Constants included from WindowMethods

WindowMethods::EnumChildProc

Instance Attribute Summary

Attributes inherited from Control

#id, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Control

#dispose

Methods included from WindowMethods

#[], #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, #show, #size, #size=, #style, #style?, #text, #text=, #textlen, #topmost=, #topmost?, #update, #visible=, #visible?, #xstyle, #xstyle?

Methods included from Toggle

#toggle

Constructor Details

#initialize(parent, id, opts = {}, &block) ⇒ DateTimePicker

Returns a new instance of DateTimePicker.



77
78
79
80
81
# File 'lib/fzeet/windows/comctl/DateTimePicker.rb', line 77

def initialize(parent, id, opts = {}, &block)
	super('SysDateTimePick32', parent, id, opts)

	@parent.on(:notify, @id, &block) if block
end

Class Method Details

.crackNotification(args) ⇒ Object



69
70
71
72
73
74
75
# File 'lib/fzeet/windows/comctl/DateTimePicker.rb', line 69

def self.crackNotification(args)
	case args[:notification]
	when Windows::DTN_DATETIMECHANGE
		args[:dtc] = Windows::NMDATETIMECHANGE.new(FFI::Pointer.new(args[:lParam]))
		args[:st] = args[:dtc][:st] if args[:dtc][:dwFlags] == Windows::GDT_VALID
	end
end

Instance Method Details

#on(notification, &block) ⇒ Object



83
84
85
86
87
# File 'lib/fzeet/windows/comctl/DateTimePicker.rb', line 83

def on(notification, &block)
	@parent.on(:notify, @id, Fzeet.constant(notification, *self.class::Prefix[:notification]), &block)

	self
end