nobody at rubyforge.org
2006-Nov-13 07:21 UTC
[Wxruby-development] [735] trunk/wxruby2: Got the ''get_item_sample'' sample working had to add some missing ListCtrl constants.
<!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>[735] trunk/wxruby2: Got the ''get_item_sample''
sample working had to add some missing ListCtrl constants.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>735</dd>
<dt>Author</dt> <dd>seanlong</dd>
<dt>Date</dt> <dd>2006-11-13 02:21:40 -0500 (Mon, 13 Nov
2006)</dd>
</dl>
<h3>Log Message</h3>
<pre>Got the ''get_item_sample'' sample working had to add
some missing ListCtrl constants. </pre>
<h3>Modified Paths</h3>
<ul>
<li><a
href="#trunkwxruby2samplescontrolsget_item_samplerb">trunk/wxruby2/samples/controls/get_item_sample.rb</a></li>
<li><a
href="#trunkwxruby2swigRubyConstantsi">trunk/wxruby2/swig/RubyConstants.i</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwxruby2samplescontrolsget_item_samplerb"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/samples/controls/get_item_sample.rb (734 => 735)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/samples/controls/get_item_sample.rb        2006-11-13
07:05:34 UTC (rev 734)
+++
trunk/wxruby2/samples/controls/get_item_sample.rb        2006-11-13
07:21:40 UTC (rev 735)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><ins>+#!/usr/bin/env ruby
</ins><span class="cx"> # Written by Nobuaki Arima
</span><span class="cx">
</span><del>-require ''wxruby''
</del><ins>+require ''wx''
</ins><span class="cx">
</span><span class="cx"> ID = 1
</span><span class="cx">
</span><span class="lines">@@ -34,22 +35,28 @@
</span><span class="cx">
</span><span class="cx"> # test of get_item method
</span><span class="cx"> 0.upto(2) do |i|
</span><del>- item = list.get_item(i)
- print "ID:",item.get_id,"\n"
- print "column: ",item.get_column,"\n"
- print "text: ",item.get_text,"\n"
- print "text
color:",show_color(item.get_text_colour),"\n"
- print "BG color:
",show_color(item.get_background_colour),"\n"
- print "font: ",show_font(item.get_font),"\n\n"
</del><ins>+ item = Wx::ListItem.new()
+ item.set_id(i)
+ if list.get_item(item)
+ print "ID:",item.get_id,"\n"
+ print "column: ",item.get_column,"\n"
+ print "text: ",item.get_text,"\n"
+ print "text
color:",show_color(item.get_text_colour),"\n"
+ print "BG color:
",show_color(item.get_background_colour),"\n"
+ print "font: ",show_font(item.get_font),"\n\n"
+ end
</ins><span class="cx"> end
</span><span class="cx"> 0.upto(2) do |i|
</span><del>- item = list.get_item(i,1)
- print "ID:",item.get_id,"\n"
- print "column: ",item.get_column,"\n"
- print "text: ",item.get_text,"\n"
- print "text
color:",show_color(item.get_text_colour),"\n"
- print "BG color:
",show_color(item.get_background_colour),"\n"
- print "font: ",show_font(item.get_font),"\n\n"
</del><ins>+ item = Wx::ListItem.new()
+ item.set_id(i)
+ if list.get_item(item)
+ print "ID:",item.get_id,"\n"
+ print "column: ",item.get_column,"\n"
+ print "text: ",item.get_text,"\n"
+ print "text
color:",show_color(item.get_text_colour),"\n"
+ print "BG color:
",show_color(item.get_background_colour),"\n"
+ print "font: ",show_font(item.get_font),"\n\n"
+ end
</ins><span class="cx"> end
</span><span class="cx"> end
</span><span class="cx">
</span><span class="lines">@@ -73,7 +80,7 @@
</span><span class="cx"> def on_init
</span><span class="cx"> frame =
ListctrlFrame.new("Listctrl test",Wx::Point.new(50, 50),
Wx::Size.new(450, 340))
</span><span class="cx">
</span><del>- frame.show(TRUE)
</del><ins>+ frame.show(true)
</ins><span class="cx">
</span><span class="cx"> end
</span><span class="cx"> end
</span></span></pre></div>
<a id="trunkwxruby2swigRubyConstantsi"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/swig/RubyConstants.i (734 => 735)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/swig/RubyConstants.i        2006-11-13
07:05:34 UTC (rev 734)
+++
trunk/wxruby2/swig/RubyConstants.i        2006-11-13
07:21:40 UTC (rev 735)
</span><span class="lines">@@ -18,6 +18,7 @@
</span><span class="cx"> #include <wx/imagbmp.h>
</span><span class="cx"> #include <wx/sashwin.h>
</span><span class="cx"> #include <wx/prntbase.h>
</span><ins>+#include <wx/listbase.h>
</ins><span class="cx"> //#include <wx/dcbuffer.h>
</span><span class="cx">
</span><span class="cx"> // All of these exist on only one
platform, so in those
</span><span class="lines">@@ -1487,6 +1488,92 @@
</span><span class="cx"> // for compatibility only
</span><span class="cx"> #define wxLC_USER_TEXT
wxLC_VIRTUAL
</span><span class="cx">
</span><ins>+// Mask flags to tell app/GUI what fields of wxListItem
are valid
+#define wxLIST_MASK_STATE 0x0001
+#define wxLIST_MASK_TEXT 0x0002
+#define wxLIST_MASK_IMAGE 0x0004
+#define wxLIST_MASK_DATA 0x0008
+#define wxLIST_SET_ITEM 0x0010
+#define wxLIST_MASK_WIDTH 0x0020
+#define wxLIST_MASK_FORMAT 0x0040
+
+// State flags for indicating the state of an item
+#define wxLIST_STATE_DONTCARE 0x0000
+#define wxLIST_STATE_DROPHILITED 0x0001 // MSW only
+#define wxLIST_STATE_FOCUSED 0x0002
+#define wxLIST_STATE_SELECTED 0x0004
+#define wxLIST_STATE_CUT 0x0008 // MSW only
+#define wxLIST_STATE_DISABLED 0x0010 // OS2 only
+#define wxLIST_STATE_FILTERED 0x0020 // OS2 only
+#define wxLIST_STATE_INUSE 0x0040 // OS2 only
+#define wxLIST_STATE_PICKED 0x0080 // OS2 only
+#define wxLIST_STATE_SOURCE 0x0100 // OS2 only
+
+// Hit test flags, used in HitTest
+#define wxLIST_HITTEST_ABOVE 0x0001 // Above the client area.
+#define wxLIST_HITTEST_BELOW 0x0002 // Below the client area.
+#define wxLIST_HITTEST_NOWHERE 0x0004 // In the client area but below
the last item.
+#define wxLIST_HITTEST_ONITEMICON 0x0020 // On the bitmap associated
with an item.
+#define wxLIST_HITTEST_ONITEMLABEL 0x0080 // On the label (string)
associated with an item.
+#define wxLIST_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of
an item.
+#define wxLIST_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree
view item that is in a user-defined state.
+#define wxLIST_HITTEST_TOLEFT 0x0400 // To the left of the client
area.
+#define wxLIST_HITTEST_TORIGHT 0x0800 // To the right of the client
area.
+
+#define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON |
wxLIST_HITTEST_ONITEMLABEL | wxLIST_HITTEST_ONITEMSTATEICON)
+
+// Flags for GetNextItem (MSW only except wxLIST_NEXT_ALL)
+enum
+{
+ wxLIST_NEXT_ABOVE, // Searches for an item above the specified
item
+ wxLIST_NEXT_ALL, // Searches for subsequent item by index
+ wxLIST_NEXT_BELOW, // Searches for an item below the specified
item
+ wxLIST_NEXT_LEFT, // Searches for an item to the left of the
specified item
+ wxLIST_NEXT_RIGHT // Searches for an item to the right of the
specified item
+};
+
+// Alignment flags for Arrange (MSW only except wxLIST_ALIGN_LEFT)
+enum
+{
+ wxLIST_ALIGN_DEFAULT,
+ wxLIST_ALIGN_LEFT,
+ wxLIST_ALIGN_TOP,
+ wxLIST_ALIGN_SNAP_TO_GRID
+};
+
+// Column format (MSW only except wxLIST_FORMAT_LEFT)
+enum wxListColumnFormat
+{
+ wxLIST_FORMAT_LEFT,
+ wxLIST_FORMAT_RIGHT,
+ wxLIST_FORMAT_CENTRE,
+ wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
+};
+
+// Autosize values for SetColumnWidth
+enum
+{
+ wxLIST_AUTOSIZE = -1,
+ wxLIST_AUTOSIZE_USEHEADER = -2 // partly supported by generic version
+};
+
+// Flag values for GetItemRect
+enum
+{
+ wxLIST_RECT_BOUNDS,
+ wxLIST_RECT_ICON,
+ wxLIST_RECT_LABEL
+};
+
+// Flag values for FindItem (MSW only)
+enum
+{
+ wxLIST_FIND_UP,
+ wxLIST_FIND_DOWN,
+ wxLIST_FIND_LEFT,
+ wxLIST_FIND_RIGHT
+};
+
</ins><span class="cx"> //**
---------------------------------------------------------------------------- **
</span><span class="cx"> // Start constants from
wx/button.h
</span><span class="cx"> //**
---------------------------------------------------------------------------- **
</span></span></pre>
</div>
</div>
</body>
</html>
Seemingly Similar Threads
- [740] trunk/wxruby2: API - Make ListCtrl#get_item return a ListCtrl item corresponding to a row and
- [1008] trunk/wxruby2/samples/controls/get_item_sample.rb: ok method name changed to is_ok
- [823] trunk/wxruby2/doc/textile: Remove docs for some deprecated classes
- FW: Wx::ListCtrl#get_item method
- Problem with ListCtrl#get_item
