nobody at rubyforge.org
2007-Jan-06 00:39 UTC
[Wxruby-development] [835] trunk/wxruby2/doc/textile: Updated documentation about TreeItemId
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type"
content="text/html; charset=utf-8" /><style
type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:'':'';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family:
verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;
font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding:
6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid;
padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family:
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch
.binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[835] trunk/wxruby2/doc/textile: Updated documentation about
TreeItemId</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>835</dd>
<dt>Author</dt> <dd>brokentoy</dd>
<dt>Date</dt> <dd>2007-01-05 19:39:19 -0500 (Fri, 05 Jan
2007)</dd>
</dl>
<h3>Log Message</h3>
<pre>Updated documentation about TreeItemId</pre>
<h3>Modified Paths</h3>
<ul>
<li><a
href="#trunkwxruby2doctextiletreectrltxtl">trunk/wxruby2/doc/textile/treectrl.txtl</a></li>
<li><a
href="#trunkwxruby2doctextiletreeeventtxtl">trunk/wxruby2/doc/textile/treeevent.txtl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwxruby2doctextiletreectrltxtl"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/doc/textile/treectrl.txtl (834 => 835)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/doc/textile/treectrl.txtl        2007-01-06
00:04:46 UTC (rev 834)
+++
trunk/wxruby2/doc/textile/treectrl.txtl        2007-01-06
00:39:19 UTC (rev 835)
</span><span class="lines">@@ -76,17 +76,35 @@
</span><span class="cx">
</span><span class="cx"> h2. Working with TreeCtrl items
</span><span class="cx">
</span><ins>+A TreeCtrl contains one, or more usually, many items.
As well as the
+text label and parent, tree items can have several other properties,
+such as being bold or italic, and icons for expanded and collapsed states.
+
</ins><span class="cx"> In wxRuby, individual items
(including branches) in a tree control are
</span><del>-referenced by TreeItemIds. These ids are returned by
methods such as
</del><ins>+referenced by *TreeItemIds*. These ids are returned by
methods such as
</ins><span class="cx">
"append_item":#TreeCtrl_appenditem which add items to a tree, and by
</span><span class="cx"> TreeEvents which can be queried
to find which item is being acted
</span><del>-upon. The ids can then be passed in as arguments to
methods which modify
-items within the tree, such as "set_item_text":#TreeCtrl_setitemtext.
-As well as the text label, tree items can have several other properties,
-such as being bold, italic, and icons for expanded and collapsed
-states. TreeItemIds which may be tested for validity by calling
-TreeItemId#is_ok.
</del><ins>+upon. The ids are passed in as arguments to methods
which modify items
+within the tree, such as "set_item_text":#TreeCtrl_setitemtext.
</ins><span class="cx">
</span><ins>+TreeItemIds are Integers, but the number itself is an
opaque identifier;
+you should not carry out arithmetic on it, or assume anything about the
+id of one item relative to another. The only useful operation that can
+be carried out on a TreeItemId is to test whether it refers to a valid
+item. If the id is equal to zero, then the id does not refer to a valid
+item. This is most useful when testing whether any item has been clicked
+as part of a "TreeEvent":treeevent.html handler; for example:
+
+ def on_tree_clicked(event)
+ if event.get_item.nonzero?
+ # .. an item was clicked, make it bold
+ set_item_bold(event.get_item)
+ else
+ # otherwise the click didn''t happen over an item
+ ...
+
+h3. Associating Ruby objects with TreeCtrl items
+
</ins><span class="cx"> TreeCtrls can be linked to non-GUI
application objects by using the
</span><span class="cx"> item_data methods. Methods which
add items to the tree all accept an
</span><span class="cx"> optional @item_data@ argument,
which may be any normal Ruby
</span></span></pre></div>
<a id="trunkwxruby2doctextiletreeeventtxtl"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/doc/textile/treeevent.txtl (834 => 835)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/doc/textile/treeevent.txtl        2007-01-06
00:04:46 UTC (rev 834)
+++
trunk/wxruby2/doc/textile/treeevent.txtl        2007-01-06
00:39:19 UTC (rev 835)
</span><span class="lines">@@ -14,11 +14,9 @@
</span><span class="cx">
</span><span class="cx"> h2. Event table macros
</span><span class="cx">
</span><del>-To process input from a tree control, use these event
handler macros to direct input to member
-functions that take a TreeEvent argument.
</del><ins>+To process input from a tree control, use these methods
to set up event
+handler blocks that take a TreeEvent argument.
</ins><span class="cx">
</span><del>-
-
</del><span class="cx">
|*evt_tree_begin_drag(id) { | event | ... }*|The
user has started dragging an item with the left mouse button. The event handler
must call *TreeEvent::Allow()* for the drag operation to continue.|
</span><span class="cx">
|*evt_tree_begin_rdrag(id) { | event | ... }*|The
user has started dragging an item with the right mouse button. The event handler
must call *TreeEvent::Allow()* for the drag operation to continue.|
</span><span class="cx">
|*evt_tree_begin_label_edit(id) { | event | ... }*|Begin
editing a label. This can be prevented by calling
"Veto()":notifyeventveto.html.|
</span><span class="lines">@@ -78,7 +76,8 @@
</span><span class="cx">
</span><span class="cx">
"TreeItemId":treeitemid.html *get_item*()
</span><span class="cx">
</span><del>-Returns the item (valid for all events).
</del><ins>+Returns the item (valid for all events). See
"TreeCtrl":treectrl.html
+for information about TreeItemIds.
</ins><span class="cx">
</span><span class="cx"> h3(#TreeEvent_getkeyevent).
TreeEvent#get_key_event
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>
Apparently Analagous Threads
- [741] trunk/wxruby2: Fix get_item_data, hiding TreeItemData messiness, fix GC-ing (Alex Fenton)
- [831] trunk/wxruby2: Use simple ruby Integers to represent TreeItemIds
- [965] branches/wxruby2/wxwidgets_282/doc/textile: Misc.
- [931] branches/wxruby2/wxwidgets_282/doc/textile/treectrl.txtl: Added insert_item_before documentation.
- [800] trunk/wxruby2/doc/textile/treectrl.txtl: TreeCtrl#traverse has moved to wx sugar
