Class: Fzeet::SysLink

Inherits:
Control show all
Includes:
SysLinkMethods
Defined in:
lib/fzeet/windows/comctl/SysLink.rb

Constant Summary collapse

Prefix =
{
  xstyle: [:ws_ex_],
  style: [:lws_, :ws_],
  message: [:lm_, :ccm_, :wm_],
  notification: [: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) ⇒ SysLink

Returns a new instance of SysLink.



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

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

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

Class Method Details

.crackNotification(args) ⇒ Object



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

def self.crackNotification(args)
  case args[:notification]
  when Windows::NM_CLICK
    args[:link] = Windows::NMLINK.new(FFI::Pointer.new(args[:lParam]))

    args[:id] = Windows.WCSTOMBS(args[:link][:item][:szID])
    args[:url] = Windows.WCSTOMBS(args[:link][:item][:szUrl])
  end
end

Instance Method Details

#on(notification, &block) ⇒ Object



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

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

  self
end