Module: Fzeet::ComboBoxMethods

Includes:
ListBoxMethods
Included in:
ComboBox, ComboBoxExMethods
Defined in:
lib/fzeet/windows/user/Control/ComboBox.rb

Instance Method Summary collapse

Methods included from ListBoxMethods

#append, #clear, #each, #length, #selected=

Instance Method Details

#[](i) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/fzeet/windows/user/Control/ComboBox.rb', line 78

def [](i)
	i = sendmsg(:getcursel) if i == :selected

	return '' if i == -1 || (len = textlen(i) + 1) == 1

	''.tap { |item|
		FFI::MemoryPointer.new(:char, len) { |buf|
			raise "GETLBTEXT failed." if sendmsg(:getlbtext, i, buf) == -1

			item << buf.read_string
		}
	}
end

#textlen(i) ⇒ Object



76
# File 'lib/fzeet/windows/user/Control/ComboBox.rb', line 76

def textlen(i) raise "GETLBTEXTLEN failed." if (len = sendmsg(:getlbtextlen, i)) == -1; len end