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.



59
60
61
62
63
# File 'lib/fzeet/windows/comctl/SysLink.rb', line 59

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



49
50
51
52
53
54
55
56
57
# File 'lib/fzeet/windows/comctl/SysLink.rb', line 49

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



65
66
67
68
69
# File 'lib/fzeet/windows/comctl/SysLink.rb', line 65

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

	self
end