Class: Fzeet::MonthCalendar

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

Constant Summary collapse

Prefix =
{
  xstyle: [:ws_ex_],
  style: [:mcs_, :ws_],
  message: [:mcm_, :ccm_, :wm_],
  notification: [:mcn_, :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) ⇒ MonthCalendar

Returns a new instance of MonthCalendar.



104
105
106
107
108
# File 'lib/fzeet/windows/comctl/MonthCalendar.rb', line 104

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

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

Class Method Details

.crackNotification(args) ⇒ Object



96
97
98
99
100
101
102
# File 'lib/fzeet/windows/comctl/MonthCalendar.rb', line 96

def self.crackNotification(args)
  case args[:notification]
  when Windows::MCN_SELCHANGE
    args[:sc] = Windows::NMSELCHANGE.new(FFI::Pointer.new(args[:lParam]))
    args[:st1], args[:st2] = args[:sc][:stSelStart], args[:sc][:stSelEnd]
  end
end

Instance Method Details

#on(notification, &block) ⇒ Object



110
111
112
113
114
# File 'lib/fzeet/windows/comctl/MonthCalendar.rb', line 110

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

  self
end