nobody at rubyforge.org
2007-Jan-06 00:02 UTC
[Wxruby-development] [833] trunk/wxruby2/swig/classes: Fix the inheritance chain of wxIcon (varies cross-platform)
<!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>[833] trunk/wxruby2/swig/classes: Fix the inheritance chain of
wxIcon (varies cross-platform)</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>833</dd>
<dt>Author</dt> <dd>brokentoy</dd>
<dt>Date</dt> <dd>2007-01-05 19:02:24 -0500 (Fri, 05 Jan
2007)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix the inheritance chain of wxIcon (varies
cross-platform)</pre>
<h3>Modified Paths</h3>
<ul>
<li><a
href="#trunkwxruby2swigclassesIconi">trunk/wxruby2/swig/classes/Icon.i</a></li>
<li><a
href="#trunkwxruby2swigclassesincludeparentsrb">trunk/wxruby2/swig/classes/include/parents.rb</a></li>
<li><a
href="#trunkwxruby2swigclassesincludewxIconh">trunk/wxruby2/swig/classes/include/wxIcon.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwxruby2swigclassesIconi"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/swig/classes/Icon.i (832 => 833)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/swig/classes/Icon.i        2007-01-05
23:22:38 UTC (rev 832)
+++
trunk/wxruby2/swig/classes/Icon.i        2007-01-06
00:02:24 UTC (rev 833)
</span><span class="lines">@@ -11,9 +11,17 @@
</span><span class="cx">
</span><span class="cx"> %import
"include/wxObject.h"
</span><span class="cx"> %import
"include/wxGDIObject.h"
</span><del>-// the following might eventually be helpful for MSWin?
</del><ins>+
+// inheritance pattern is slightly different across platforms
+// GTK: Icon < Bitmap < GDIOBject
+// OS X: Icon < GDIObject
+// Windows: Icon < GDIImage < GDIObject (no public class GDIImage)
+#if defined(__WXGTK__)
+%import "include/wxBitmap.h"
+#endif
+
+// #if defined(__WXMSW__)
</ins><span class="cx"> // %import
"include/wxGDIImage.h"
</span><del>-// the following works on GTK but not MS Win
-// %import "include/wxBitmap.h"
</del><ins>+// #endif
</ins><span class="cx">
</span><span class="cx"> %include
"include/wxIcon.h"
</span></span></pre></div>
<a id="trunkwxruby2swigclassesincludeparentsrb"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/swig/classes/include/parents.rb (832 => 833)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/swig/classes/include/parents.rb        2007-01-05
23:22:38 UTC (rev 832)
+++
trunk/wxruby2/swig/classes/include/parents.rb        2007-01-06
00:02:24 UTC (rev 833)
</span><span class="lines">@@ -145,7 +145,6 @@
</span><span class="cx">
''wxHtmlWinTagHandler'' =>
''wxHtmlTagHandler'',
</span><span class="cx">
''wxHtmlWindow'' => ''wxScrolledWindow'',
</span><span class="cx">
''wxIPV4address'' => ''wxSockAddress'',
</span><del>- ''wxIcon'' =>
''wxBitmap'',
</del><span class="cx">
''wxIconizeEvent'' => ''wxEvent'',
</span><span class="cx">
''wxIdleEvent'' => ''wxEvent'',
</span><span class="cx"> ''wxImage''
=> ''wxObject'',
</span><span class="lines">@@ -316,3 +315,9 @@
</span><span class="cx">
''wxZlibInputStream'' =>
''wxFilterInputStream'',
</span><span class="cx">
''wxZlibOutputStream'' =>
''wxFilterOutputStream'',
</span><span class="cx"> }
</span><ins>+
+if RUBY_PLATFORM =~ /linux/
+ $parents[''wxIcon''] = ''wxBitmap''
+else
+ $parents[''wxIcon''] = ''wxGDIObject''
+end
</ins></span></pre></div>
<a id="trunkwxruby2swigclassesincludewxIconh"></a>
<div class="modfile"><h4>Modified:
trunk/wxruby2/swig/classes/include/wxIcon.h (832 => 833)</h4>
<pre class="diff"><span>
<span class="info">---
trunk/wxruby2/swig/classes/include/wxIcon.h        2007-01-05
23:22:38 UTC (rev 832)
+++
trunk/wxruby2/swig/classes/include/wxIcon.h        2007-01-06
00:02:24 UTC (rev 833)
</span><span class="lines">@@ -37,6 +37,11 @@
</span><span class="cx"> bool operator!=(const
wxIcon& icon) const { return !(*this == icon); }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+// on GTK this method is inherited from Bitmap, not
defined here
+#ifndef __WXGTK__
+        bool
Ok() const;
+#endif
+
</ins><span class="cx"> // create from bitmap (which
should have a mask unless it''s monochrome):
</span><span class="cx"> // there shouldn''t
be any implicit bitmap -> icon conversion (i.e. no
</span><span class="cx"> // ctors, assignment
operators...), but it''s ok to have such function
</span></span></pre>
</div>
</div>
</body>
</html>
Maybe Matching Threads
- [955] branches/wxruby2/wxwidgets_282/swig/classes/include/wxIcon.h: Change Icon.ok to Icon.is_ok (2.8)
- [841] trunk/wxruby2/swig/classes: Added PasswordEntryDialog
- [1103] trunk/wxruby2: Added 2.8 methods to StaticBitmap & document them; cleanup header file
- Latest tarball doesn''t compile
- [827] trunk/wxruby2/swig: Moved NULL objects into constants so they can be used for default args
