nobody at rubyforge.org
2006-Dec-24 02:26 UTC
[Wxruby-development] [799] trunk/wxruby2: Fixed TreeItemId == method
<!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>[799] trunk/wxruby2: Fixed TreeItemId == method</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>799</dd>
<dt>Author</dt> <dd>brokentoy</dd>
<dt>Date</dt> <dd>2006-12-23 21:26:37 -0500 (Sat, 23 Dec
2006)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fixed TreeItemId == method</pre>
<h3>Modified Paths</h3>
<ul>
<li><a
href="#trunkwxruby2swigclassesTreeItemIdi">trunk/wxruby2/swig/classes/TreeItemId.i</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a
href="#trunkwxruby2libwxclassestreeitemidrb">trunk/wxruby2/lib/wx/classes/treeitemid.rb</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwxruby2libwxclassestreeitemidrb"></a>
<div class="addfile"><h4>Added:
trunk/wxruby2/lib/wx/classes/treeitemid.rb (0 => 799)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/lib/wx/classes/treeitemid.rb        
(rev 0)
+++
trunk/wxruby2/lib/wx/classes/treeitemid.rb        2006-12-24
02:26:37 UTC (rev 799)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+class Wx::TreeItemId
+ # Fix equality here because TreeCtrl methods don''t return identical
+ # TreeItemIds for repeated calls referring to the same item.
+ def ==(other)
+ return false unless other.is_a?(self.class)
+ return self.to_i == other.to_i
+ end
+end
</ins></span></pre></div>
<a id="trunkwxruby2swigclassesTreeItemIdi"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/swig/classes/TreeItemId.i (798 => 799)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/swig/classes/TreeItemId.i        2006-12-23
12:42:01 UTC (rev 798)
+++
trunk/wxruby2/swig/classes/TreeItemId.i        2006-12-24
02:26:37 UTC (rev 799)
</span><span class="lines">@@ -9,4 +9,12 @@
</span><span class="cx"> #include <wx/treectrl.h>
</span><span class="cx"> %}
</span><span class="cx">
</span><ins>+// returns the underlying opaque identifier as a ruby
fixnum
+%extend wxTreeItemId {
+ VALUE to_i()
+ {
+        return
INT2NUM( (int)self->m_pItem );
+ }
+}
+
</ins><span class="cx"> %include
"include/wxTreeItemId.h"
</span></span></pre>
</div>
</div>
</body>
</html>
Possibly Parallel Threads
- [831] trunk/wxruby2: Use simple ruby Integers to represent TreeItemIds
- [888] branches/wxruby2/wxwidgets_282/swig/shared/treeitemid_typemaps.i: Fix compile warning for TreeItemId typemap (Artur Kuptel)
- [779] trunk/wxruby2: Added TreeCtrl#traverse method and documentation
- [797] trunk/wxruby2/swig/classes/TreeCtrl.i: Traverse method moved to wxSugar
- [956] branches/wxruby2/wxwidgets_282: Additions to TreeCtrl API 2.6->2.8
