An FXHeader control may be placed over a table
of other widgets to provide a caption and icon. Each caption comprises a
label and an optional icon; in addition, an arrow may be shown to indicate
whether the items in that column are sorted, and if so, whether they are
sorted in increasing or decreasing order.
Events
The following messages are sent by FXHeader to
its target:
SEL_CHANGED: | sent continuously while a header item is being resized, if the
HEADER_TRACKING option was specified, or at the end of the resize
if HEADER_TRACKING was not specfied. The message data is an
integer indicating the index of the item being resized.
|
SEL_COMMAND: | sent when a header item is clicked; the message data is an integer
indicating the index of the current item.
|
SEL_LEFTBUTTONPRESS: | sent when the left mouse button goes down; the message data is an FXEvent instance.
|
SEL_LEFTBUTTONRELEASE: | sent when the left mouse button goes up; the message data is an FXEvent instance.
|
SEL_REPLACED: | sent when a header item is about to be replaced; the message data is an
Integer indicating the index of the item to be replaced.
|
SEL_INSERTED: | sent after a header item is inserted; the message data is an Integer
indicating the index of the item that was inserted.
|
SEL_DELETED: | sent when a header item is about to be removed; the message data is an
Integer indicating the index of the item to be removed.
|
Header style options
HEADER_BUTTON: | Button style can be clicked
|
HEADER_HORIZONTAL: | Horizontal header control (default)
|
HEADER_VERTICAL: | Vertical header control
|
HEADER_TRACKING: | Tracks continuously while moving
|
HEADER_NORMAL: | Normal options, same as HEADER_HORIZONTAL|FRAME_NORMAL
|
Message identifiers
font |
[RW] |
Text font [FXFont]
|
headerStyle |
[RW] |
Header style options [Integer]
|
helpText |
[RW] |
Status line help text for this header
|
numItems |
[R] |
Number of items [Integer]
|
textColor |
[RW] |
Text color [FXColor]
|
Enumerable
new(p, tgt=nil, sel=0, opts=HEADER_NORMAL, x=0, y=0, w=0, h=0, pl=DEFAULT_PAD, pr=DEFAULT_PAD, pt=DEFAULT_PAD, pb=DEFAULT_PAD) {|theHeader| ...}
|
Construct new header control
Return the item (a FXHeaderItem instance)
at the given index. Raises IndexError if index is out of bounds.
Replace the item at index with a (possibly subclassed) item and
return the index of the replaced item. If notify is true,
a SEL_REPLACED message is sent to the header’s message
target before the item is replaced. Raises IndexError if index is
out of bounds.
Replace the item at index with a new item with the specified text,
icon, size and user data object, and return the index of the replaced item.
The new item is created by calling the FXHeader#createItem method. If
notify is true, a SEL_REPLACED message is sent
to the header’s message target before the item is replaced. Raises
IndexError if index is out of bounds.
Insert a new (possibly subclassed) item at the specified index and
return the index of the inserted item. If notify is true,
a SEL_INSERTED message is sent to the header’s message
target after the item is inserted. Raises IndexError if index is
out of bounds.
Insert a new item at the specified index with the specified text,
icon, size and user data object, and return the index of the inserted item.
The new item is created by calling the FXHeader#createItem method. If
notify is true, a SEL_INSERTED message is sent
to the header’s message target after the item is inserted. Raises
IndexError if index is out of bounds.
Append a (possibly subclassed) item to the list and return the index of the
appended item. If notify is true, a SEL_INSERTED
message is sent to the header’s message target after the item is
appended.
Append a new item with the specified text, icon, size and user data object,
and return the index of the appended item. The new item is created by
calling the FXHeader#createItem method. If notify is
true, a SEL_INSERTED message is sent to the
header’s message target after the item is appended.
Prepend a (possibly subclassed) item to the list and return the index of
the prepended item. If notify is true, a
SEL_INSERTED message is sent to the header’s message target
after the item is appended.
Prepend a new item with the specified text, icon, size and user data
object, and return the index of the appended item. The new item is created
by calling the FXHeader#createItem method. If notify is
true, a SEL_INSERTED message is sent to the
header’s message target after the item is appended.
Remove the item at the specified index from this header. If notify
is true, a SEL_DELETED message is sent to the
header’s message target before the item is removed. Raises IndexError
if index is out of bounds.
Remove all items from this header. If notify is true, a
SEL_DELETED message is sent to the header’s message target
before each item is removed.
Return the index of the item at the given pixel-offset from the left (or
top, if it’s a vertical header). Returns -1 if the specified
offset is out of bounds.
Change text label for item at index. Raises IndexError if index is
out of bounds.
Get text of item at index. Raises IndexError if index is out of
bounds.
Change icon of item at index. Raises IndexError if index is out of
bounds.
Return icon of item at index. Raises IndexError if index is out of
bounds.
Change size of item at index. Raises IndexError if index is out of
bounds.
Return size of item at index. Raises IndexError if index is out of
bounds.
Return the offset (in pixels) of the left side of the item at index. (If
it’s a vertical header, return the offset of the top side of the
item). Raises IndexError if index is out of bounds.
Change user data object of item at index. Raises IndexError if
index is out of bounds.
Return user data for item at index. Raises IndexError if index is
out of bounds.
Change arrow (sort) direction for item at index, where dir is
either FALSE, TRUE or MAYBE. If dir is
TRUE, the arrow will point up; if dir is FALSE,
the arrow points down; and if dir is MAYBE, no arrow is
drawn. Raises IndexError if index is out of bounds.
Return sort direction for the item at index, one of FALSE,
TRUE or MAYBE. If dir is TRUE, the
arrow will point up; if dir is FALSE, the arrow points
down; and if dir is MAYBE, no arrow is drawn. Raises
IndexError if index is out of bounds.
Returns true if the specified header item’s arrow points up. Raises
IndexError if index is out of bounds.
Returns true if the specified header item’s arrow points down. Raises
IndexError if index is out of bounds.
Returns true if the specified header item does not display any arrow.
Raises IndexError if index is out of bounds.
Calls block once for each item in the list, passing a reference to that
item as a parameter.