605 lines
79 KiB
HTML
605 lines
79 KiB
HTML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The Be Book - Classes And Methods - The Interface Kit</title><link rel="stylesheet" href="be_book.css" type="text/css" media="all" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./images/favicon.ico" /><!--[if IE]>
|
||
<link rel="stylesheet" type="text/css" href="be_book_ie.css" />
|
||
<![endif]--><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="Access, BeOS, BeBook, API" /><link rel="start" href="index.html" title="The Be Book" /><link rel="up" href="TheInterfaceKit.html" title="The Interface Kit" /><link rel="prev" href="BListItem.html" title="BListItem" /><link rel="next" href="BMenu.html" title="BMenu" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BListItem.html" title="BListItem"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheInterfaceKit.html" title="The Interface Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="BMenu.html" title="BMenu"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="headerTR"><div id="navigpeople"><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div><div class="navigboxed" id="navigindex"><a accesskey="i" href="ClassIndex.html" title="Index">I</a></div><div class="navigboxed" id="naviglang" title="English">en</div></div><div id="headerTC">The Be Book - Classes And Methods - The Interface Kit</div></div><div id="headerB">Prev: <a href="BListItem.html">BListItem</a> Up: <a href="TheInterfaceKit.html">The Interface Kit</a> Next: <a href="BMenu.html">BMenu</a></div><hr /></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView"></a>BListView</h2></div></div></div><a id="id988924" class="indexterm"></a><div class="classheader"><table border="0"><colgroup><col /><col /></colgroup><tbody><tr><td><table width="100%" border="0"><colgroup><col /><col /></colgroup><tbody><tr><td>Derived From:</td><td><a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>,
|
||
<a class="link" href="BInvoker.html" title="BInvoker"><code class="classname">BInvoker</code></a></td></tr><tr><td>Mix-in Classes:</td><td>–</td></tr><tr><td>Declared In:</td><td><code class="filename">interface/ListView.h</code></td></tr><tr><td>Library:</td><td><code class="filename">libbe.so</code></td></tr><tr><td>Allocation:</td><td>–</td></tr></tbody></table></td><td>
|
||
<a class="link overview" href="BListView_Overview.html" title="BListView">Class Overview</a>
|
||
<div class="toc"><ul><li><span class="section"><a href="BListView.html#BListView_ConstructorDestructor">Constructor and Destructor</a></span></li><li><span class="section"><a href="BListView.html#BListView_HookFunctions">Hook Functions</a></span></li><li><span class="section"><a href="BListView.html#BListView_MemberFunctions">Member Functions</a></span></li><li><span class="section"><a href="BListView.html#BListView_StaticFunctions">Static Functions</a></span></li><li><span class="section"><a href="BListView.html#BListView_ScriptingSupport">Scripting Support</a></span></li><li><span class="section"><a href="BListView.html#BListView_ArchivedFields">Archived Fields</a></span></li></ul></div>
|
||
</td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_ConstructorDestructor"></a>Constructor and Destructor</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_Constructor"></a>BListView()</h4></div></div></div><div class="synopsisgroup">
|
||
<code class="constructorsynopsis cpp"><span class="methodname">BListView</span>(<span class="methodparam"><span class="type"><a class="link" href="BRect.html" title="BRect"><code class="classname">BRect</code></a> </span><span class="parameter">frame</span></span>,<br /> <span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">name</span></span>,<br /> <span class="methodparam"><span class="type">list_view_type </span><span class="parameter">type</span><span class="initializer"> = <span class="constant">B_SINGLE_SELECTION_LIST</span></span></span>,<br /> <span class="methodparam"><span class="type">uint32 </span><span class="parameter">resizingMode</span><span class="initializer"> = <span class="constant">B_FOLLOW_LEFT</span> | <span class="constant">B_FOLLOW_TOP</span></span></span>,<br /> <span class="methodparam"><span class="type">uint32 </span><span class="parameter">flags</span><span class="initializer"> = <span class="constant">B_WILL_DRAW</span> | <span class="constant">B_NAVIGABLE</span> | <span class="constant">B_FRAME_EVENTS</span></span></span>);</code>
|
||
|
||
<code class="constructorsynopsis cpp"><span class="methodname">BListView</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">archive</span></span>);</code>
|
||
</div><p>
|
||
Initializes the new <code class="classname">BListView</code>. The
|
||
<code class="parameter">frame</code>, <code class="parameter">name</code>,
|
||
<code class="parameter">resizingMode</code>, and <code class="parameter">flags</code>
|
||
arguments are identical to those declared for the
|
||
<a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>
|
||
class and are
|
||
passed unchanged to the <a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>
|
||
<a class="link" href="BView.html#BView_Constructor" title="BView()">constructor</a>.
|
||
</p><p>
|
||
The list <code class="parameter">type</code> can be either:
|
||
</p><table class="variablelist constants"><thead><tr><th>Constant</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_SINGLE_SELECTION_LIST</code></span></p></td><td><p>The user can select only one item in the list at
|
||
a time. This is the default setting.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_MULTIPLE_SELECTION_LIST</code></span></p></td><td><p>The user can select any number of items by
|
||
holding down an <span class="keycap">Option</span> key (for discontinuous
|
||
selections) or a <span class="keycap">Shift</span> key
|
||
(for contiguous selections).</p></td></tr></tbody></table><p>
|
||
The list begins life empty. Call
|
||
<a class="link" href="BListView.html#BListView_AddItem" title="AddItem()"><code class="methodname">AddItem()</code></a> or
|
||
<a class="link" href="BListView.html#BListView_AddList" title="AddList()"><code class="methodname">AddList()</code></a> to put items in
|
||
the list. Call
|
||
<a class="link" href="BListView.html#BListView_Select" title="Select()"><code class="methodname">Select()</code></a>
|
||
to select one of the items so that it's
|
||
highlighted when the list is initially displayed to the user.
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_Destructor"></a>~BListView()</h4></div></div></div><code class="destructorsynopsis cpp"><span class="modifier">virtual </span><span class="methodname">~BListView</span>();</code><p>
|
||
Frees the selection and invocation messages, if any, and any memory
|
||
allocated to hold the list of items, but not the items themselves.
|
||
</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_HookFunctions"></a>Hook Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_AttachedToWindow"></a>AttachedToWindow()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">AttachedToWindow</span>();</code><p>
|
||
Sets up the <code class="classname">BListView</code> and makes the
|
||
<a class="link" href="BWindow.html" title="BWindow"><code class="classname">BWindow</code></a> to which it has become
|
||
attached the target for the messages it sends when items are selected or
|
||
invoked—provided another target hasn't already been set. In
|
||
addition, this function calls
|
||
<a class="link" href="BListItem.html#BListItem_Update" title="Update()"><code class="methodname">BListItem::Update()</code></a>
|
||
for each item in the list to give it a chance to adjust its layout. The
|
||
<code class="classname">BListView</code>'s vertical scroll bar is also
|
||
adjusted.</p><p>
|
||
This function is called for you when the <code class="classname">BListView</code> becomes part of a
|
||
window's view hierarchy.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BView.html#BView_AttachedToWindow" title="AttachedToWindow(), AllAttached()"><code class="methodname">BView::AttachedToWindow()</code></a>,
|
||
<a class="link" href="BInvoker.html#BInvoker_SetTarget" title="SetTarget(), Target(), IsTargetLocal(), Messenger()"><code class="methodname">BInvoker::SetTarget()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_Draw"></a>Draw()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">Draw</span>(<span class="methodparam"><span class="type"><a class="link" href="BRect.html" title="BRect"><code class="classname">BRect</code></a> </span><span class="parameter">updateRect</span></span>);</code><p>
|
||
Calls upon every item in the <code class="parameter">updateRect</code> area of the view to draw itself.
|
||
</p><p>
|
||
<code class="methodname">Draw()</code> is called for you whenever the list view is to be updated or
|
||
redisplayed; you don't need to call it yourself. You also don't need to
|
||
reimplement it; to change the way items are drawn, define a new version of
|
||
<a class="link" href="BListItem.html#BListItem_DrawItem" title="DrawItem()"><code class="methodname">DrawItem()</code></a> in a class derived from
|
||
<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BView.html#BView_Draw" title="Draw()"><code class="methodname">BView::Draw()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_FrameResized"></a>FrameResized()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">FrameResized</span>(<span class="methodparam"><span class="type">float </span><span class="parameter">width</span></span>,<br /> <span class="methodparam"><span class="type">float </span><span class="parameter">height</span></span>);</code><p>
|
||
Updates the on-screen display in response to a notification that the
|
||
<code class="classname">BListView</code>'s frame rectangle has been resized. In particular, this
|
||
function looks for a vertical scroll bar that's a sibling of the
|
||
<code class="classname">BListView</code>. It adjusts this scroll bar to reflect the way the list view
|
||
was resized, under the assumption that it must have the <code class="classname">BListView</code> as its
|
||
target.
|
||
</p><p>
|
||
<code class="methodname">FrameResized()</code> is called automatically at the appropriate times; you
|
||
shouldn't call it yourself.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BView.html#BView_FrameResized" title="FrameResized()"><code class="methodname">BView::FrameResized()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_InitiateDrag"></a>InitiateDrag()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">bool </span><span class="methodname">InitiateDrag</span>(<span class="methodparam"><span class="type"><a class="link" href="BPoint.html" title="BPoint"><code class="classname">BPoint</code></a> </span><span class="parameter">point</span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>,<br /> <span class="methodparam"><span class="type">bool </span><span class="parameter">wasSelected</span></span>);</code><p>
|
||
Implemented by derived classes to permit users to drag items. This
|
||
function is called from the <code class="classname">BListView</code>'s
|
||
<a class="link" href="BListView.html#BListView_MouseDown" title="MouseDown()"><code class="methodname">MouseDown()</code></a> function; it should
|
||
initiate the drag-and-drop operation and return <code class="constant">true</code>, or refuse to do so
|
||
and return <code class="constant">false</code>. By default, it always returns <code class="constant">false</code>.
|
||
</p><p>
|
||
The <code class="parameter">point</code> that's passed to
|
||
<code class="methodname">InitiateDrag()</code> is the same as the point passed
|
||
to <a class="link" href="BListView.html#BListView_MouseDown" title="MouseDown()"><code class="methodname">MouseDown()</code></a>;
|
||
it's where the cursor was located when the user pressed
|
||
the mouse button. The <code class="parameter">index</code> of the item under the cursor (the item that
|
||
would be dragged) is passed as the second argument, and the <code class="parameter">wasSelected</code>
|
||
flag indicates whether or not the item was selected before the mouse
|
||
button went down.
|
||
</p><p>
|
||
A <code class="classname">BListView</code> allows users to autoscroll the list by holding the mouse
|
||
button down and dragging outside its frame rectangle. If a derived class
|
||
implements <code class="methodname">InitiateDrag()</code> to drag an item each time the user moves the
|
||
mouse with a button down, it will hide this autoscrolling behavior.
|
||
Therefore, derived classes typically permit users to drag items only if
|
||
they're already selected (if <code class="parameter">wasSelected</code> is <code class="constant">true</code>). In other words, it
|
||
takes two mouse-down events to drag an item—one to select it and
|
||
one to begin dragging it.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BView.html#BView_DragMessage" title="DragMessage()"><code class="methodname">BView::DragMessage()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_KeyDown"></a>KeyDown()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">KeyDown</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">char* </span><span class="parameter">bytes</span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">numBytes</span></span>);</code><p>
|
||
Permits the user to operate the list using the following keys:
|
||
</p><div class="informaltable"><table border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Keys</th><th>Perform Action</th></tr></thead><tbody><tr><td><span class="keycap">Up Arrow</span> and <span class="keycap">Down Arrow</span></td><td>Select the items that are immediately before and
|
||
immediately after the currently selected item.</td></tr><tr><td><span class="keycap">Page Up</span> and <span class="keycap">Page Down</span></td><td>Select the items that are one viewful above and
|
||
below the currently selected item—or the first and last items if
|
||
there's no item a viewful away.</td></tr><tr><td><span class="keycap">Home</span> and <span class="keycap">End</span></td><td>Select the first and last items in the list.</td></tr><tr><td><span class="keycap">Enter</span> and the <span class="keycap">Space</span> bar</td><td>Invoke the current selection.</td></tr></tbody></table></div><p>
|
||
This function also incorporates the inherited
|
||
<a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a> version so that the
|
||
<span class="keycap">Tab</span> key can navigate to another view.
|
||
</p><p>
|
||
<code class="methodname">KeyDown()</code> is called to report
|
||
<code class="constant">B_KEY_DOWN</code> messages when the <code class="classname">BListView</code> is
|
||
the focus view of the active window; you shouldn't call it yourself.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BView.html#BView_KeyDown" title="KeyDown()"><code class="methodname">BView::KeyDown()</code></a>,
|
||
<a class="link" href="BListView.html#BListView_Select" title="Select()"><code class="methodname">Select()</code></a>,
|
||
<a class="link" href="BListView.html#BListView_Invoke" title="Invoke()"><code class="methodname">Invoke()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_MouseDown"></a>MouseDown()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">MouseDown</span>(<span class="methodparam"><span class="type"><a class="link" href="BPoint.html" title="BPoint"><code class="classname">BPoint</code></a> </span><span class="parameter">point</span></span>);</code><p>
|
||
Responds to <code class="constant">B_MOUSE_DOWN</code> messages by selecting items, invoking them (if
|
||
the mouse-down event is the second of a double-click), and autoscrolling
|
||
the list (when the user drags with a mouse button down). This function
|
||
also calls
|
||
<a class="link" href="BListView.html#BListView_InitiateDrag" title="InitiateDrag()"><code class="methodname">InitiateDrag()</code></a>
|
||
to give derived classes the opportunity to drag
|
||
items. You can implement that function; you shouldn't override (or call)
|
||
this one.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BView.html#BView_MouseDown" title="MouseDown()"><code class="methodname">BView::MouseDown()</code></a>,
|
||
<a class="link" href="BListView.html#BListView_Select" title="Select()"><code class="methodname">Select()</code></a>,
|
||
<a class="link" href="BListView.html#BListView_Invoke" title="Invoke()"><code class="methodname">Invoke()</code></a>,
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_SelectionChanged"></a>SelectionChanged()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">SelectionChanged</span>();</code><p>
|
||
Implemented by derived classes to do whatever they please when the
|
||
selection changes.
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_TargetedByScrollView"></a>TargetedByScrollView()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">TargetedByScrollView</span>(<span class="methodparam"><span class="type"><a class="link" href="BScrollView.html" title="BScrollView"><code class="classname">BScrollView</code></a>* </span><span class="parameter">view</span></span>);</code><p>
|
||
Notes the fact that the <code class="classname">BListView</code> is the target of a
|
||
<a class="link" href="BScrollView.html" title="BScrollView"><code class="classname">BScrollView</code></a> and
|
||
arranges for the border of the
|
||
<a class="link" href="BScrollView.html" title="BScrollView"><code class="classname">BScrollView</code></a>
|
||
to be highlighted when the <code class="classname">BListView</code> is the current
|
||
focus view of the active window.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BScrollView.html#BScrollView_SetBorderHighlighted" title="SetBorderHighlighted(), IsBorderHighlighted()"><code class="methodname">BScrollView::SetBorderHighlighted()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_WindowActivated"></a>WindowActivated()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">WindowActivated</span>(<span class="methodparam"><span class="type">bool </span><span class="parameter">active</span></span>);</code><p>
|
||
Makes sure that the
|
||
<a class="link" href="BScrollView.html" title="BScrollView"><code class="classname">BScrollView</code></a>
|
||
that targets the <code class="classname">BListView</code> is redrawn
|
||
when the window is activated and deactivated, if the <code class="classname">BListView</code> is the
|
||
current focus view. This gives the
|
||
<a class="link" href="BScrollView.html" title="BScrollView"><code class="classname">BScrollView</code></a>
|
||
a chance to highlight or unhighlight its border, as appropriate.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BView.html#BView_WindowActivated" title="WindowActivated()"><code class="methodname">BView::WindowActivated()</code></a>
|
||
</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_MemberFunctions"></a>Member Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_AddItem"></a>AddItem()</h4></div></div></div><div class="synopsisgroup">
|
||
<code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">bool </span><span class="methodname">AddItem</span>(<span class="methodparam"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="parameter">item</span></span>);</code>
|
||
|
||
<code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">bool </span><span class="methodname">AddItem</span>(<span class="methodparam"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="parameter">item</span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>);</code>
|
||
</div><p>
|
||
Adds an item to the <code class="classname">BListView</code> at <code class="parameter">index</code>—or, if no index is supplied,
|
||
at the end of the list. If necessary, additional memory is allocated to
|
||
accommodate the new item.
|
||
</p><p>
|
||
Adding an item never removes an item already in the list. If the item is
|
||
added at an index that's already occupied, items currently in the list
|
||
are bumped down one slot to make room.
|
||
</p><p>
|
||
If <code class="parameter">index</code> is out of range (greater than the current item count, or less
|
||
than zero), this function fails and returns <code class="constant">false</code>. Otherwise, it returns
|
||
<code class="constant">true</code>.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>,
|
||
<a class="link" href="BList.html#BList_AddItem" title="AddItem()"><code class="methodname">BList::AddItem()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_AddList"></a>AddList()</h4></div></div></div><div class="synopsisgroup">
|
||
<code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">bool </span><span class="methodname">AddList</span>(<span class="methodparam"><span class="type"><a class="link" href="BList.html" title="BList"><code class="classname">BList</code></a>* </span><span class="parameter">list</span></span>);</code>
|
||
|
||
<code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">bool </span><span class="methodname">AddList</span>(<span class="methodparam"><span class="type"><a class="link" href="BList.html" title="BList"><code class="classname">BList</code></a>* </span><span class="parameter">list</span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>);</code>
|
||
</div><p>
|
||
Adds the contents of another <code class="parameter">list</code> to this
|
||
<code class="classname">BListView</code>. The items from the
|
||
<a class="link" href="BList.html" title="BList"><code class="classname">BList</code></a> are inserted at
|
||
<code class="parameter">index</code>—or, if no index is given, they're
|
||
appended to the end of the list. If the index is out of range, the
|
||
function fails and returns <code class="constant">false</code>. If successful, it
|
||
returns <code class="constant">true</code>.
|
||
</p><p>
|
||
The <code class="classname">BListView</code> doesn't check to be sure that all the items it adds from
|
||
the list are pointers to
|
||
<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a> objects. It assumes that they are; if
|
||
the assumption is <code class="constant">false</code>, subsequent <code class="classname">BListView</code> operations will fail.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_AddItem" title="AddItem()"><code class="methodname">AddItem()</code></a>,
|
||
<a class="link" href="BList.html#BList_AddList" title="AddList()"><code class="methodname">BList::AddList()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_Archive"></a>Archive()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="methodname">Archive</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">archive</span></span>,<br /> <span class="methodparam"><span class="type">bool </span><span class="parameter">deep</span><span class="initializer"> = <span class="constant">true</span></span></span>) <span class="modifier">const</span>;</code><p>
|
||
Stores the <code class="classname">BListView</code> in the
|
||
<a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a> archive.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BArchivable.html#BArchivable_Archive" title="Archive()"><code class="methodname">BArchivable::Archive()</code></a>,
|
||
<a class="link" href="BListView.html#BListView_Instantiate" title="Instantiate()"><code class="methodname">Instantiate()</code></a>
|
||
static function
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_CountItems"></a>CountItems()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">CountItems</span>() <span class="modifier">const</span>;</code><p>
|
||
Returns the number of <a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>s
|
||
currently in the list.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BList.html#BList_CountItems" title="CountItems()"><code class="methodname">BList::CountItems</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_CurrentSelection"></a>CurrentSelection()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">CurrentSelection</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span><span class="initializer"> = 0</span></span>) <span class="modifier">const</span>;</code><p>
|
||
Returns the index of a currently selected item in the list, or a negative
|
||
number if no item is selected. The domain of the <code class="parameter">index</code> passed as an
|
||
argument is the current set of selected items; the first selected item is
|
||
at <code class="parameter">index</code> 0, the second at <code class="parameter">index</code> 1, and so on, even if the selection is
|
||
not contiguous. The domain of the returned index is the set of all items
|
||
in the list.
|
||
</p><p>
|
||
To get all currently selected items, increment the passed <code class="parameter">index</code> until the
|
||
function returns a negative number:
|
||
</p><pre class="programlisting example cpp"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>*</span> <code class="varname">item</code>;
|
||
<span class="type">int32</span> <code class="varname">selected</code>;
|
||
while ( (<code class="varname">selected</code> = <code class="varname">myListView</code>-><code class="methodname">CurrentSelection</code>(<code class="varname">i</code>)) >= 0 ) {
|
||
<code class="varname">item</code> = <code class="methodname">ItemAt</code>(<code class="varname">selected</code>);
|
||
. . .
|
||
}</pre><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_Select" title="Select()"><code class="methodname">Select()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_Deselect"></a><a id="BListView_DeselectAll"></a>
|
||
<a id="BListView_DeselectExcept"></a>
|
||
Deselect(), DeselectAll(), DeselectExcept()</h4></div></div></div><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">Deselect</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>);</code><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">DeselectAll</span>();</code><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">DeselectExcept</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">start</span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">finish</span></span>);</code><p>
|
||
These functions deselect the item at <code class="parameter">index</code>, all the items, or all the
|
||
items except those from index <code class="parameter">start</code> through index <code class="parameter">finish</code>.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_Select" title="Select()"><code class="methodname">Select()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_DoForEach"></a>DoForEach()</h4></div></div></div><div class="synopsisgroup">
|
||
<code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">DoForEach</span>(<span class="methodparam"><span class="type">bool </span>(*<span class="parameter">func</span>)(<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>*)</span>);</code>
|
||
|
||
<code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">DoForEach</span>(<span class="methodparam"><span class="type">bool </span>(*<span class="parameter">func</span>)(<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>*)</span>,<br /> <span class="methodparam"><span class="type">void* </span><span class="parameter">arg2</span></span>);</code>
|
||
</div><p>
|
||
Calls the <code class="parameter">func</code> function once for each item in the
|
||
<code class="classname">BListView</code>.
|
||
<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>s
|
||
are visited in order, beginning with the first one in the list (index 0)
|
||
and ending with the last. If a call to <code class="parameter">func</code> returns
|
||
<code class="constant">true</code>, the iteration
|
||
is stopped, even if some items have not yet been visited.
|
||
</p><p>
|
||
<code class="parameter">func</code> must be a function that takes one or two arguments. The first
|
||
argument is a pointer to the <a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>;
|
||
the second argument, if <code class="parameter">func</code>
|
||
requires one, is passed to <code class="methodname">DoForEach()</code> as <code class="parameter">arg2</code>.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BList.html#BList_DoForEach" title="DoForEach()"><code class="methodname">BList::DoForEach()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_HasItem"></a>HasItem()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">HasItem</span>(<span class="methodparam"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="parameter">item</span></span>) <span class="modifier">const</span>;</code><p>
|
||
Returns <code class="constant">true</code> if item is in the list, and <code class="constant">false</code> if not.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BList.html#BList_HasItem" title="HasItem()"><code class="methodname">BList::HasItem()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_IndexOf"></a>IndexOf()</h4></div></div></div><div class="synopsisgroup">
|
||
<code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">IndexOf</span>(<span class="methodparam"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="parameter">item</span></span>) <span class="modifier">const</span>;</code>
|
||
|
||
<code class="methodsynopsis cpp"><span class="type">int32 </span><span class="methodname">IndexOf</span>(<span class="methodparam"><span class="type"><a class="link" href="BPoint.html" title="BPoint"><code class="classname">BPoint</code></a>* </span><span class="parameter">point</span></span>) <span class="modifier">const</span>;</code>
|
||
</div><p>
|
||
Returns the index where a particular <code class="parameter">item</code>—or the item whose display
|
||
rectangle includes a particular <code class="parameter">point</code>—is located in the list. If
|
||
the item is in the list more than once, the index returned will be the
|
||
position of its first occurrence. To determine whether an item lies at
|
||
the specified point, only the y-coordinate value of the point is
|
||
considered.
|
||
</p><p>
|
||
If the <code class="parameter">item</code> isn't in the list or the y-coordinate of the <code class="parameter">point</code> doesn't
|
||
intersect with the data rectangle of the <code class="classname">BListView</code>, the return value will
|
||
be a negative number.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BList.html#BList_IndexOf" title="IndexOf()"><code class="methodname">BList::IndexOf()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_InvalidateItem"></a>InvalidateItem()</h4></div></div></div><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">InvalidateItem</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>);</code><p>
|
||
Invalidates the item at <code class="parameter">index</code> so that an update message will be sent
|
||
forcing the <code class="classname">BListView</code> to redraw it.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BView.html#BView_Invalidate" title="Invalidate()"><code class="methodname">BView::Invalidate()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_Invoke"></a>Invoke()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type">status_t </span><span class="methodname">Invoke</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">message</span><span class="initializer"> = <span class="constant">NULL</span></span></span>) <span class="modifier">const</span>;</code><p>
|
||
Augments the <a class="link" href="BInvoker.html" title="BInvoker"><code class="classname">BInvoker</code></a>
|
||
version of <a class="link" href="BInvoker.html#BInvoker_Invoke" title="Invoke(), InvokeNotify()"><code class="methodname">Invoke()</code></a> to add three pieces of
|
||
information to each message the <code class="classname">BListView</code> sends:
|
||
</p><div class="informaltable"><table border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Field</th><th>Type code</th><th>Description</th></tr></thead><tbody><tr><td><code class="varname">when</code></td><td><code class="constant">B_INT64_TYPE</code></td><td>When the message is sent, as measured by the number
|
||
of microseconds since 12:00:00 AM 1970.</td></tr><tr><td><code class="varname">source</code></td><td><code class="constant">B_POINTER_TYPE</code></td><td>A pointer to the <code class="classname">BListView</code> object.</td></tr><tr><td><code class="varname">index</code></td><td><code class="constant">B_INT32_TYPE</code></td><td>An array containing the index of every selected item.</td></tr></tbody></table></div><p>
|
||
This function is called to send both the selection message and the
|
||
invocation message. It can also be called from application code. The
|
||
default target of the message (established by
|
||
<a class="link" href="BListView.html#BListView_AttachedToWindow" title="AttachedToWindow()"><code class="methodname">AttachedToWindow()</code></a>) is the
|
||
<a class="link" href="BWindow.html" title="BWindow"><code class="classname">BWindow</code></a>
|
||
where the <code class="classname">BListView</code> is located.
|
||
</p><p>
|
||
What it means to "invoke" selected items depends entirely on the
|
||
invocation <a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>
|
||
and the receiver's response to it. This function does
|
||
nothing but send the message.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_Select" title="Select()"><code class="methodname">Select()</code></a>,
|
||
<a class="link" href="BListView.html#BListView_SetInvocationMessage" title="SetInvocationMessage(), InvocationMessage(), InvocationCommand()"><code class="methodname">SetInvocationMessage()</code></a>,
|
||
<a class="link" href="BInvoker.html#BInvoker_SetTarget" title="SetTarget(), Target(), IsTargetLocal(), Messenger()"><code class="methodname">BInvoker::SetTarget()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_IsItemSelected"></a>IsItemSelected()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">IsItemSelected</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>) <span class="modifier">const</span>;</code><p>
|
||
Returns <code class="constant">true</code> if the item at
|
||
<code class="parameter">index</code> is currently selected, and <code class="constant">false</code> if
|
||
it's not.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_CurrentSelection" title="CurrentSelection()"><code class="methodname">CurrentSelection()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_ItemAt"></a><a id="BListView_LastItem"></a>
|
||
<a id="BListView_FirstItem"></a>
|
||
ItemAt() , FirstItem() , LastItem()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="methodname">ItemAt</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>) <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="methodname">FirstItem</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="methodname">LastItem</span>() <span class="modifier">const</span>;</code><p>
|
||
The first of these functions returns the
|
||
<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a> at
|
||
<code class="parameter">index</code>, or <code class="constant">NULL</code> if
|
||
the index is out of range. The other two functions return the very first
|
||
and very last items in the list, or <code class="constant">NULL</code> if the list is empty. None of
|
||
the functions alters the contents of the list—they don't remove the
|
||
returned item.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_Items" title="Items()"><code class="methodname">Items()</code></a>,
|
||
<a class="link" href="BList.html#BList_ItemAt" title="ItemAt()"><code class="methodname">BList::ItemAt()</code></a>,
|
||
<a class="link" href="BList.html#BList_FirstItem" title="FirstItem()"><code class="methodname">BList::FirstItem()</code></a>,
|
||
<a class="link" href="BList.html#BList_LastItem" title="LastItem()"><code class="methodname">BList::LastItem()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_ItemFrame"></a>ItemFrame()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type"><a class="link" href="BRect.html" title="BRect"><code class="classname">BRect</code></a> </span><span class="methodname">ItemFrame</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>);</code><p>
|
||
Returns the frame rectangle of the
|
||
<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a> at
|
||
<code class="parameter">index</code>. The rectangle is
|
||
stated in the coordinate system of the <code class="classname">BListView</code> and defines the area
|
||
where the item is drawn. Items can differ in height, but all have the
|
||
same width.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListItem.html#BListItem_DrawItem" title="DrawItem()"><code class="methodname">DrawItem()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_Items"></a>Items()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">const </span><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>** </span><span class="methodname">Items</span>() <span class="modifier">const</span>;</code><p>
|
||
Returns a pointer to the <code class="classname">BListView</code>'s list of
|
||
<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>s. You can index
|
||
directly into the list of items if you're certain that the index is in
|
||
range:
|
||
</p><pre class="programlisting example cpp"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>*</span> <code class="varname">item</code> = <code class="methodname">Items</code>()[<code class="varname">index</code>];</pre><p>
|
||
Although the practice is discouraged, you can also step through the list
|
||
of items by incrementing the list pointer that
|
||
<code class="methodname">Items()</code> returns. Be aware
|
||
that the list isn't null-terminated—you have to detect the end of
|
||
the list by some other means. The simplest method is to count items:
|
||
</p><pre class="programlisting example cpp"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>**</span> <code class="varname">ptr</code> = <code class="varname">myListView</code>-><code class="methodname">Items</code>();
|
||
|
||
for ( <span class="type">long</span> <code class="varname">i</code> = <code class="varname">myListView</code>-><code class="methodname">CountItems</code>(); <code class="varname">i</code> > 0; <code class="varname">i</code>—)
|
||
{
|
||
. . .
|
||
*<code class="varname">ptr</code>++;
|
||
}</pre><p>
|
||
You should never use the items pointer to alter the contents of the list.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_DoForEach" title="DoForEach()"><code class="methodname">DoForEach()</code></a>,
|
||
<a class="link" href="BListView.html#BListView_SortItems" title="SortItems()"><code class="methodname">SortItems()</code></a>,
|
||
<a class="link" href="BList.html#BList_Items" title="Items()"><code class="methodname">BList::Items()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_MakeEmpty"></a><a id="BListView_IsEmpty"></a>
|
||
MakeEmpty(), IsEmpty()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">MakeEmpty</span>();</code><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">IsEmpty</span>() <span class="modifier">const</span>;</code><p>
|
||
<code class="methodname">MakeEmpty()</code> empties the <code class="classname">BListView</code>
|
||
of all its items, without freeing the
|
||
<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a> objects.
|
||
</p><p>
|
||
<code class="methodname">IsEmpty()</code> returns <code class="constant">true</code> if the
|
||
list is empty (if it contains no items),
|
||
and <code class="constant">false</code> otherwise.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_RemoveItem"><code class="methodname">RemoveItem()</code></a>,
|
||
<a class="link" href="BList.html#BList_MakeEmpty" title="MakeEmpty()"><code class="methodname">BList::MakeEmpty()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_MakeFocus"></a>MakeFocus()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">MakeFocus</span>(<span class="methodparam"><span class="type">bool </span><span class="parameter">focused</span><span class="initializer"> = <span class="constant">true</span></span></span>);</code><p>
|
||
Overrides the <a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a>
|
||
version of
|
||
<a class="link" href="BView.html#BView_MakeFocus" title="MakeFocus()"><code class="methodname">MakeFocus()</code></a>
|
||
to draw an indication that the
|
||
<code class="classname">BListView</code> has become the focus for keyboard events when the focused flag
|
||
is <code class="constant">true</code>, and to remove that indication when the flag is <code class="constant">false</code>.
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_MoveItem"></a><a id="BListView_SwapItems"></a>
|
||
<a id="BListView_ReplaceItem"></a>
|
||
MoveItem(), ReplaceItem(), SwapItems()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">MoveItem</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">from</span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">to</span></span>);</code><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">ReplaceItem</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>,<br /> <span class="methodparam"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="parameter">item</span></span>);</code><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">SwapItems</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index1</span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">index2</span></span>);</code><p>
|
||
<code class="methodname">MoveItem()</code> moves the item located at the index
|
||
<code class="parameter">from</code> to the index
|
||
specified by the <code class="parameter">to</code> argument.
|
||
</p><p>
|
||
<code class="methodname">ReplaceItem()</code> replaces the item located at the specifie
|
||
<code class="parameter">index</code> with the specified <code class="parameter">item</code>.
|
||
</p><p>
|
||
<code class="methodname">SwapItems()</code> swaps the items specified by
|
||
<code class="parameter">index1</code> and <code class="parameter">index2</code> in the list.
|
||
</p><p>
|
||
These functions return <code class="constant">true</code> if the requested operation is completed
|
||
successfully, or <code class="constant">false</code> if the operation failed (for example, if a
|
||
specified index is out of range).
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_RemoveItems"></a><a id="BListView_RemoveItem"></a>
|
||
RemoveItem(), RemoveItems()</h4></div></div></div><div class="synopsisgroup">
|
||
<code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="methodname">RemoveItem</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>);</code>
|
||
|
||
<code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="methodname">RemoveItem</span>(<span class="methodparam"><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="parameter">item</span></span>);</code>
|
||
</div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>* </span><span class="methodname">RemoveItems</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">count</span></span>);</code><p>
|
||
<code class="methodname">RemoveItem()</code> removes a single item from the
|
||
<code class="classname">BListView</code>. If passed an
|
||
<code class="parameter">index</code>, it removes the item at that index and returns it. If there's no
|
||
item at the index, it returns <code class="constant">NULL</code>. If passed an <code class="parameter">item</code>, this function
|
||
looks for that particular item in the list, removes it, and returns <code class="constant">true</code>.
|
||
If it can't find the item, it returns <code class="constant">false</code>. If the item is in the list
|
||
more than once, this function removes only its first occurrence.
|
||
</p><p>
|
||
<code class="methodname">RemoveItems()</code> removes <code class="parameter">count</code>
|
||
number of items from the <code class="classname">BListView</code>, beginning
|
||
with the item at <code class="parameter">index</code>. If the list doesn't contain
|
||
<code class="parameter">count</code> items between
|
||
<code class="parameter">index</code> and the end of the list, this function removes as many items as
|
||
there are.
|
||
</p><p>
|
||
The list is compacted after an item is removed. Therefore, you shouldn't
|
||
try to empty a list (or a range within a list) by removing items
|
||
incrementing indices. You should either start with the highest index and
|
||
move towards the head of the list, or remove at the same index (the
|
||
lowest in the range) some number of times. As an example of the latter,
|
||
the following code removes the first five items in the list:
|
||
</p><pre class="programlisting example cpp">for ( <span class="type">int32</span> <code class="varname">i</code> = 0; <code class="varname">i</code> <= 4; <code class="varname">i</code>++ )
|
||
<code class="varname">myListView</code>-><code class="methodname">RemoveItem</code>(0);</pre><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_MakeEmpty" title="MakeEmpty(), IsEmpty()"><code class="methodname">MakeEmpty()</code></a>,
|
||
<a class="link" href="BList.html#BList_RemoveItem" title="RemoveItem() , RemoveItems()"><code class="methodname">BList::RemoveItem()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_ScrollTo"></a>ScrollTo()</h4></div></div></div><div class="synopsisgroup">
|
||
<code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">ScrollTo</span>(<span class="methodparam"><span class="type"><a class="link" href="BPoint.html" title="BPoint"><code class="classname">BPoint</code></a> </span><span class="parameter">point</span></span>);</code>
|
||
|
||
<code class="methodsynopsis cpp"><span class="modifier">inline </span><span class="void">void </span><span class="methodname">ScrollTo</span>(<span class="methodparam"><span class="type">float </span><span class="parameter">x</span></span>,<br /> <span class="methodparam"><span class="type">float </span><span class="parameter">y</span></span>);</code>
|
||
</div><p>
|
||
Augments the <a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a> version of
|
||
<a class="link" href="BView.html#BView_ScrollTo"><code class="methodname">ScrollTo()</code></a> to do some class-internal
|
||
housekeeping when the list is scrolled. For all practical purposes, these
|
||
functions are identical to their <a class="link" href="BView.html" title="BView"><code class="classname">BView</code></a> counterparts.
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_ScrollToSelection"></a>ScrollToSelection()</h4></div></div></div><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">ScrollToSelection</span>();</code><p>
|
||
Scrolls the list so that the first item in the current selection is
|
||
visible.
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_Select"></a>Select()</h4></div></div></div><div class="synopsisgroup">
|
||
<code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">Select</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">index</span></span>,<br /> <span class="methodparam"><span class="type">bool </span><span class="parameter">extend</span><span class="initializer"> = <span class="constant">false</span></span></span>);</code>
|
||
|
||
<code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">Select</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">start</span></span>,<br /> <span class="methodparam"><span class="type">int32 </span><span class="parameter">finish</span></span>,<br /> <span class="methodparam"><span class="type">bool </span><span class="parameter">extend</span><span class="initializer"> = <span class="constant">false</span></span></span>);</code>
|
||
</div><p>
|
||
Selects the item located at <code class="parameter">index</code>—or all the items from the
|
||
<code class="parameter">start</code> index through the <code class="parameter">finish</code> index –
|
||
provided that none of the indices are out of range. If the <code class="parameter">extend</code>
|
||
flag is <code class="constant">false</code>, as it is by default, this
|
||
function removes the highlighting from the previously selected item(s)
|
||
and highlights the new selection. However, if the <code class="parameter">extend</code> flag is
|
||
<code class="constant">true</code>,
|
||
the newly selected items are added to the current selection.
|
||
</p><p>
|
||
If you want your newly-selected item to be scrolled into view, you must
|
||
call
|
||
<a class="link" href="BListView.html#BListView_ScrollToSelection" title="ScrollToSelection()"><code class="methodname">ScrollToSelection()</code></a>
|
||
after invoking <code class="methodname">Select()</code>. The <code class="methodname">Select()</code> function
|
||
itself does not do any scrolling.
|
||
</p><p>
|
||
<code class="methodname">Select()</code> can be called to set an initial selection in the list or change
|
||
the current selection. It permits the program to select a number of
|
||
items, even for a <code class="constant">B_SINGLE_SELECTION_LIST</code> list.
|
||
</p><p>
|
||
If you want to be informed of successful selections, you either have to
|
||
implement
|
||
<a class="link" href="BListView.html#BListView_SelectionChanged" title="SelectionChanged()"><code class="methodname">SelectionChanged()</code></a>
|
||
or supply a selection message (through
|
||
<a class="link" href="BListView.html#BListView_SetSelectionMessage" title="SetSelectionMessage(), SelectionMessage(), SelectionCommand()"><code class="methodname">SetSelectionMessage()</code></a>
|
||
). The former is invoked and the latter is sent when
|
||
an item is selected.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_Invoke" title="Invoke()"><code class="methodname">Invoke()</code></a>,
|
||
<a class="link" href="BListView.html#BListView_Deselect" title="Deselect(), DeselectAll(), DeselectExcept()"><code class="methodname">Deselect()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_SetInvocationMessage"></a><a id="BListView_InvocationMessage"></a>
|
||
<a id="BListView_InvocationCommand"></a>
|
||
SetInvocationMessage(), InvocationMessage(), InvocationCommand()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">SetInvocationMessage</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">message</span></span>);</code><code class="methodsynopsis cpp"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="methodname">InvocationMessage</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">uint32 </span><span class="methodname">InvocationCommand</span>() <span class="modifier">const</span>;</code><p>
|
||
These functions set and return information about the
|
||
<a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a> that the
|
||
<code class="classname">BListView</code> sends when currently selected items are invoked.
|
||
</p><p>
|
||
<code class="methodname">SetInvocationMessage()</code> assigns
|
||
<code class="parameter">message</code> to the <code class="classname">BListView</code>, freeing any
|
||
message previously assigned. The message becomes the responsibility of
|
||
the <code class="classname">BListView</code> object and will be freed only when it's replaced by another
|
||
message or the <code class="classname">BListView</code> is freed; you shouldn't free it yourself.
|
||
Passing a <code class="constant">NULL</code> pointer to this function deletes the current message
|
||
without replacing it.
|
||
</p><p>
|
||
When sending the message, the
|
||
<a class="link" href="BListView.html#BListView_Invoke" title="Invoke()"><code class="methodname">Invoke()</code></a>
|
||
function makes a copy of it and
|
||
adds two pieces of relevant information—"when" the message is sent
|
||
and the "source" <code class="classname">BListView</code>. These names should not be used for any data
|
||
that you add to the invocation <code class="parameter">message</code>.
|
||
</p><p>
|
||
<code class="methodname">InvocationMessage()</code> returns a pointer to the <a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a> and
|
||
<code class="methodname">InvocationCommand()</code> returns its <code class="varname">what</code> data member. The message belongs to
|
||
the <code class="classname">BListView</code>; it can be altered by adding or removing data, but it
|
||
shouldn't be deleted. To get rid of the current message, pass a <code class="constant">NULL</code>
|
||
pointer to <code class="methodname">SetInvocationMessage()</code>.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_Invoke" title="Invoke()"><code class="methodname">Invoke()</code></a>,
|
||
the <a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a> class
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_SetListType"></a><a id="BListView_ListType"></a>
|
||
SetListType() , ListType()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">SetListType</span>(<span class="methodparam"><span class="type">list_view_type </span><span class="parameter">type</span></span>);</code><code class="methodsynopsis cpp"><span class="type">list_view_type </span><span class="methodname">ListType</span>() <span class="modifier">const</span>;</code><p>
|
||
These functions set and return the list type—whether or not it
|
||
permits multiple selections. The <span class="type">list_view_type</span> must be either
|
||
<code class="constant">B_SINGLE_SELECTION_LIST</code> or <code class="constant">B_MULTIPLE_SELECTION_LIST</code>.
|
||
The type is first
|
||
set when the <code class="classname">BListView</code> is constructed.
|
||
</p><p>
|
||
See also: the <code class="classname">BListView</code>
|
||
<a class="link" href="BListView.html#BListView_Constructor" title="BListView()">constructor</a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_SetSelectionMessage"></a><a id="BListView_SelectionMessage"></a>
|
||
<a id="BListView_SelectionCommand"></a>
|
||
SetSelectionMessage(), SelectionMessage(), SelectionCommand()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">virtual </span><span class="void">void </span><span class="methodname">SetSelectionMessage</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">message</span></span>);</code><code class="methodsynopsis cpp"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="methodname">SelectionMessage</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">uint32 </span><span class="methodname">SelectionCommand</span>() <span class="modifier">const</span>;</code><p>
|
||
These functions set, and return information about, the message that a
|
||
<code class="classname">BListView</code> sends whenever a new item is selected. They're exact
|
||
counterparts to the functions described above under
|
||
<a class="link" href="BListView.html#BListView_SetInvocationMessage" title="SetInvocationMessage(), InvocationMessage(), InvocationCommand()"><code class="methodname">SetInvocationMessage()</code></a>,
|
||
except that the selection message is sent
|
||
whenever an item in the list is selected, rather than when invoked. It's
|
||
more common to take action (to initiate a message) when invoking an item
|
||
than when selecting one.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_Select" title="Select()"><code class="methodname">Select()</code></a>,
|
||
<a class="link" href="BListView.html#BListView_Invoke" title="Invoke()"><code class="methodname">Invoke()</code></a>,
|
||
the <a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a> class
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_SortItems"></a>SortItems()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">void* </span><span class="methodname">SortItems</span>(<span class="methodparam"><span class="type">int </span>(*<span class="parameter">compareFunc</span>)(<span class="modifier">const </span><span class="type">void* </span>, <span class="modifier">const </span><span class="type">void* </span>)</span>);</code><p>
|
||
Rearranges the items in the list. The items are sorted using the
|
||
<code class="parameter">compareFunc</code> comparison function passed as an argument. This function
|
||
should return a negative number if the first item is ordered before the
|
||
second, a positive number if the second comes before the first, and 0 if
|
||
the two items are ordered equivalently.
|
||
</p><p>
|
||
Although the comparison function is, in the usual manner for such
|
||
functions, declared to take two <span class="type">void*</span> arguments, each argument should be
|
||
a pointer to an item in the list—in other words, a pointer to a
|
||
<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>
|
||
pointer:
|
||
</p><pre class="programlisting example cpp"><span class="type">int</span> <code class="function">compare_func</code>(<span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>**</span> <code class="parameter">firstArg</code>, <span class="type"><a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>**</span> <code class="parameter">secondArg</code>);</pre><p>
|
||
See also:
|
||
<a class="link" href="BListView.html#BListView_Items" title="Items()"><code class="methodname">Items()</code></a>,
|
||
<a class="link" href="BList.html#BList_SortItems" title="SortItems()"><code class="methodname">BList::SortItems()</code></a>
|
||
</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_StaticFunctions"></a>Static Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_Instantiate"></a>Instantiate()</h4></div></div></div><code class="methodsynopsis cpp"><span class="modifier">static </span><span class="type"><a class="link" href="BArchivable.html" title="BArchivable"><code class="classname">BArchivable</code></a>* </span><span class="methodname">Instantiate</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">archive</span></span>);</code><p>
|
||
Returns a new <code class="classname">BListView</code> object, allocated by new and created with the
|
||
version of the constructor that takes a
|
||
<a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a> archive. However, if the
|
||
archive message doesn't contain data for a <code class="classname">BListView</code> object, this
|
||
function returns <code class="constant">NULL</code>.
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="BArchivable.html#BArchivable_Instantiate" title="Instantiate()"><code class="methodname">BArchivable::Instantiate()</code></a>,
|
||
<a class="link" href="TheSupportKit_Functions.html#instantiate_object" title="instantiate_object()"><code class="function">instantiate_object()</code></a>,
|
||
<a class="link" href="BListView.html#BListView_Archive" title="Archive()"><code class="methodname">Archive()</code></a>()
|
||
</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_ScriptingSupport"></a>Scripting Support</h3></div></div></div><p>
|
||
The <code class="classname">BListView</code> class implements the suite called "suite/vnd.Be-list-view"
|
||
consisting of the following messages:
|
||
</p><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_ScriptingItem"></a>The Item Property</h4></div></div></div><p>
|
||
The "Item" property refers to individual
|
||
<a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>s in the list.
|
||
</p><div class="informaltable"><table border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Message</th><th>Specifiers</th><th>Description</th></tr></thead><tbody><tr><td><code class="constant">B_COUNT_PROPERTIES</code></td><td><code class="constant">B_DIRECT_SPECIFIER</code></td><td>Returns the number of <a class="link" href="BListItem.html" title="BListItem"><code class="classname">BListItem</code></a>s
|
||
currently in the list.</td></tr><tr><td><code class="constant">B_EXECUTE_PROPERTY</code></td><td><code class="constant">B_INDEX_SPECIFIER</code>,<br />
|
||
<code class="constant">B_REVERSE_INDEX_SPECIFIER</code>,<br />
|
||
<code class="constant">B_RANGE_SPECIFIER</code>,<br />
|
||
<code class="constant">B_REVERSE_RANGE_SPECIFIER</code></td><td>Select and invoke the specified items, first
|
||
removing any existing selection.</td></tr></tbody></table></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_ScriptingSelection"></a>The Selection Property</h4></div></div></div><p>
|
||
The "Selection" property refers to the set of selected BListItems. If the
|
||
<code class="classname">BListView</code> is of type
|
||
<code class="constant">B_SINGLE_SELECTION_LIST</code>, then only one item can be
|
||
selected at any given instant; the list type cannot be overridden through
|
||
the scripting interface. Attempting to access multiple selected list
|
||
elements in a <code class="constant">B_SINGLE_SELECTION_LIST</code> results in an error.
|
||
</p><div class="informaltable"><table border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Message</th><th>Specifiers</th><th>Description</th></tr></thead><tbody><tr><td><code class="constant">B_COUNT_PROPERTIES</code></td><td><code class="constant">B_DIRECT_SPECIFIER</code></td><td>Returns <span class="type">int32</span> count of items in the selection.</td></tr><tr><td><code class="constant">B_EXECUTE_PROPERTY</code></td><td><code class="constant">B_DIRECT_SPECIFIER</code></td><td>Invoke items in selection.</td></tr><tr><td><code class="constant">B_GET_PROPERTY</code></td><td><code class="constant">B_DIRECT_SPECIFIER</code></td><td>Returns <span class="type">int32</span> indices of all items in the selection.</td></tr><tr><td><code class="constant">B_SET_PROPERTY</code></td><td><code class="constant">B_DIRECT_SPECIFIER</code>,<br />
|
||
<code class="constant">B_INDEX_SPECIFIER</code>,<br />
|
||
<code class="constant">B_REVERSE_INDEX_SPECIFIER</code>,<br />
|
||
<code class="constant">B_RANGE_SPECIFIER</code>,<br />
|
||
<code class="constant">B_REVERSE_RANGE_SPECIFIER</code></td><td>Extends current selection or deselects
|
||
specified items. Boolean field "data" chooses selection or deselection.</td></tr><tr><td><code class="constant">B_SET_PROPERTY</code></td><td><code class="constant">B_DIRECT_SPECIFIER</code></td><td>Select or deselect all items in the
|
||
selection. Boolean field "data" chooses selection or deselection.</td></tr></tbody></table></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BListView_ArchivedFields"></a>Archived Fields</h3></div></div></div><p>
|
||
The <a class="link" href="BListView.html#BListView_Archive" title="Archive()"><code class="methodname">Archive()</code></a>
|
||
function adds the following fields to its
|
||
<a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a> argument:
|
||
</p><div class="informaltable"><table border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Field</th><th>Type code</th><th>Description</th></tr></thead><tbody><tr><td><code class="varname">_lv_type</code></td><td><code class="constant">B_INT32_TYPE</code></td><td>The list type.</td></tr><tr><td><code class="varname">_l_items</code> (array)</td><td><code class="constant">B_MESSAGE_TYPE</code></td><td>List items in the list (deep copy only)</td></tr><tr><td><code class="varname">_msg</code></td><td><code class="constant">B_MESSAGE_TYPE</code></td><td>Invocation message.</td></tr><tr><td><code class="varname">_2nd_msg</code></td><td><code class="constant">B_MESSAGE_TYPE</code></td><td>Selection message.</td></tr></tbody></table></div><p>
|
||
Some of these fields may not be present if the setting they represent
|
||
isn't used, or is the default value. For example, if there is no
|
||
selection message, the <code class="varname">_2nd_msg</code> field won't be found in the archive.
|
||
</p></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BListItem.html">BListItem</a> Up: <a href="TheInterfaceKit.html">The Interface Kit</a> Next: <a href="BMenu.html">BMenu</a> </div><div id="footerB"><div id="footerBL"><a href="BListItem.html" title="BListItem"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheInterfaceKit.html" title="The Interface Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="BMenu.html" title="BMenu"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="footerBR"><div><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div></div><div id="footerBC"><a href="http://www.access-company.com/home.html" title="ACCESS Co."><img alt="Access Company" src="./images/access_logo.png" /></a></div></div></div><div id="licenseFooter"><div id="licenseFooterBL"><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/" title="Creative Commons License"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc-nd/3.0/88x31.png" /></a></div><div id="licenseFooterBR"><a href="./LegalNotice.html">Legal Notice</a></div><div id="licenseFooterBC"><span id="licenseText">This work is licensed under a
|
||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative
|
||
Commons Attribution-Non commercial-No Derivative Works 3.0 License</a>.</span></div></div></body></html>
|