Class: Fzeet::ListView

Inherits:
Control show all
Includes:
ListViewMethods
Defined in:
lib/fzeet/windows/comctl/ListView.rb

Constant Summary collapse

Prefix =
{
	xstyle: [:lvs_ex_, :ws_ex_],
	style: [:lvs_, :ws_],
	message: [:lvm_, :ccm_, :wm_],
	notification: [:lvn_, :nm_]
}

Constants included from WindowMethods

WindowMethods::EnumChildProc

Instance Attribute Summary collapse

Attributes inherited from Control

#id, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ListViewMethods

#clear, #insertColumn, #insertItem, #sort, #xstyle, #xstyle?

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) ⇒ ListView

Returns a new instance of ListView.



448
449
450
451
452
453
454
455
456
# File 'lib/fzeet/windows/comctl/ListView.rb', line 448

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

	@header = Handle.wrap(FFI::Pointer.new(sendmsg(:getheader)), WindowMethods, HeaderMethods)

	@items = []

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

Instance Attribute Details

#headerObject (readonly)

Returns the value of attribute header.



458
459
460
# File 'lib/fzeet/windows/comctl/ListView.rb', line 458

def header
  @header
end

#itemsObject (readonly)

Returns the value of attribute items.



458
459
460
# File 'lib/fzeet/windows/comctl/ListView.rb', line 458

def items
  @items
end

Class Method Details

.crackNotification(args) ⇒ Object



440
441
442
443
444
445
446
# File 'lib/fzeet/windows/comctl/ListView.rb', line 440

def self.crackNotification(args)
	case args[:notification]
	when Windows::LVN_COLUMNCLICK
		args[:nmlv] = Windows::NMLISTVIEW.new(FFI::Pointer.new(args[:lParam]))
		args[:index] = args[:nmlv][:iSubItem]
	end
end

Instance Method Details

#on(notification, &block) ⇒ Object



460
461
462
463
464
# File 'lib/fzeet/windows/comctl/ListView.rb', line 460

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

	self
end