wxruby 1.9.3-universal-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. data/LICENSE +53 -0
  2. data/README +299 -0
  3. data/lib/wx.rb +42 -0
  4. data/lib/wx/accessors.rb +52 -0
  5. data/lib/wx/classes/app.rb +45 -0
  6. data/lib/wx/classes/artprovider.rb +31 -0
  7. data/lib/wx/classes/bitmap.rb +23 -0
  8. data/lib/wx/classes/checklistbox.rb +45 -0
  9. data/lib/wx/classes/choice.rb +4 -0
  10. data/lib/wx/classes/clientdc.rb +13 -0
  11. data/lib/wx/classes/clipboard.rb +16 -0
  12. data/lib/wx/classes/colour.rb +47 -0
  13. data/lib/wx/classes/combobox.rb +4 -0
  14. data/lib/wx/classes/commandevent.rb +7 -0
  15. data/lib/wx/classes/controlwithitems.rb +10 -0
  16. data/lib/wx/classes/event.rb +5 -0
  17. data/lib/wx/classes/evthandler.rb +894 -0
  18. data/lib/wx/classes/font.rb +118 -0
  19. data/lib/wx/classes/grid.rb +129 -0
  20. data/lib/wx/classes/helpcontroller.rb +5 -0
  21. data/lib/wx/classes/htmlhelpcontroller.rb +5 -0
  22. data/lib/wx/classes/htmlwindow.rb +6 -0
  23. data/lib/wx/classes/icon.rb +14 -0
  24. data/lib/wx/classes/image.rb +14 -0
  25. data/lib/wx/classes/listbox.rb +4 -0
  26. data/lib/wx/classes/listctrl.rb +21 -0
  27. data/lib/wx/classes/locale.rb +28 -0
  28. data/lib/wx/classes/mediactrl.rb +22 -0
  29. data/lib/wx/classes/menu.rb +62 -0
  30. data/lib/wx/classes/menuitem.rb +7 -0
  31. data/lib/wx/classes/object.rb +7 -0
  32. data/lib/wx/classes/paintdc.rb +12 -0
  33. data/lib/wx/classes/point.rb +48 -0
  34. data/lib/wx/classes/previewframe.rb +13 -0
  35. data/lib/wx/classes/rect.rb +5 -0
  36. data/lib/wx/classes/size.rb +49 -0
  37. data/lib/wx/classes/sound.rb +23 -0
  38. data/lib/wx/classes/styledtextctrl.rb +92 -0
  39. data/lib/wx/classes/textctrl.rb +14 -0
  40. data/lib/wx/classes/texturlevent.rb +6 -0
  41. data/lib/wx/classes/timer.rb +69 -0
  42. data/lib/wx/classes/treectrl.rb +44 -0
  43. data/lib/wx/classes/window.rb +49 -0
  44. data/lib/wx/classes/xmlresource.rb +16 -0
  45. data/lib/wx/keyword_ctors.rb +219 -0
  46. data/lib/wx/keyword_defs.rb +485 -0
  47. data/lib/wx/version.rb +3 -0
  48. data/lib/wxruby2.bundle +0 -0
  49. data/samples/SAMPLES-LICENSE.TXT +18 -0
  50. data/samples/aui/aui.rb +1360 -0
  51. data/samples/bigdemo/About.rbw +39 -0
  52. data/samples/bigdemo/ColorPanel.rbw +25 -0
  53. data/samples/bigdemo/GridSimple.rbw +80 -0
  54. data/samples/bigdemo/MDIDemo.rbw +59 -0
  55. data/samples/bigdemo/PopupMenu.rbw +151 -0
  56. data/samples/bigdemo/ShapedWindow.rbw +135 -0
  57. data/samples/bigdemo/Sizers.rbw +545 -0
  58. data/samples/bigdemo/bigdemo.rb +826 -0
  59. data/samples/bigdemo/demoTemplate.rbw +37 -0
  60. data/samples/bigdemo/helpfile.htb +0 -0
  61. data/samples/bigdemo/icons/Test 015.jpg +0 -0
  62. data/samples/bigdemo/icons/Test 015.png +0 -0
  63. data/samples/bigdemo/icons/choice.bmp +0 -0
  64. data/samples/bigdemo/icons/choice.xpm +27 -0
  65. data/samples/bigdemo/icons/combo.bmp +0 -0
  66. data/samples/bigdemo/icons/combo.xpm +27 -0
  67. data/samples/bigdemo/icons/copy.xpm +25 -0
  68. data/samples/bigdemo/icons/cut.xpm +24 -0
  69. data/samples/bigdemo/icons/gauge.bmp +0 -0
  70. data/samples/bigdemo/icons/gauge.xpm +27 -0
  71. data/samples/bigdemo/icons/help.xpm +25 -0
  72. data/samples/bigdemo/icons/list.bmp +0 -0
  73. data/samples/bigdemo/icons/list.xpm +27 -0
  74. data/samples/bigdemo/icons/mondrian.ico +0 -0
  75. data/samples/bigdemo/icons/mondrian.xpm +44 -0
  76. data/samples/bigdemo/icons/new.xpm +24 -0
  77. data/samples/bigdemo/icons/ogl.ico +0 -0
  78. data/samples/bigdemo/icons/ogl.xpm +45 -0
  79. data/samples/bigdemo/icons/open.xpm +26 -0
  80. data/samples/bigdemo/icons/paste.bmp +0 -0
  81. data/samples/bigdemo/icons/paste.xpm +38 -0
  82. data/samples/bigdemo/icons/pointy.png +0 -0
  83. data/samples/bigdemo/icons/preview.xpm +26 -0
  84. data/samples/bigdemo/icons/print.xpm +26 -0
  85. data/samples/bigdemo/icons/radio.bmp +0 -0
  86. data/samples/bigdemo/icons/radio.xpm +27 -0
  87. data/samples/bigdemo/icons/robert.xpm +415 -0
  88. data/samples/bigdemo/icons/ruby.png +0 -0
  89. data/samples/bigdemo/icons/sashtest.ico +0 -0
  90. data/samples/bigdemo/icons/save.xpm +25 -0
  91. data/samples/bigdemo/icons/smiles.bmp +0 -0
  92. data/samples/bigdemo/icons/smiles.xpm +39 -0
  93. data/samples/bigdemo/icons/smiley.ico +0 -0
  94. data/samples/bigdemo/icons/smiley.xpm +42 -0
  95. data/samples/bigdemo/icons/stattext.xpm +24 -0
  96. data/samples/bigdemo/icons/test2.bmp +0 -0
  97. data/samples/bigdemo/icons/test2.png +0 -0
  98. data/samples/bigdemo/icons/test2.xpm +79 -0
  99. data/samples/bigdemo/icons/text.bmp +0 -0
  100. data/samples/bigdemo/icons/text.xpm +27 -0
  101. data/samples/bigdemo/icons/tog1.bmp +0 -0
  102. data/samples/bigdemo/icons/tog1.xpm +38 -0
  103. data/samples/bigdemo/icons/tog2.bmp +0 -0
  104. data/samples/bigdemo/icons/tog2.xpm +38 -0
  105. data/samples/bigdemo/icons/wxwin.ico +0 -0
  106. data/samples/bigdemo/icons/wxwin16x16.png +0 -0
  107. data/samples/bigdemo/icons/wxwin16x16.xpm +25 -0
  108. data/samples/bigdemo/icons/wxwin32x32.png +0 -0
  109. data/samples/bigdemo/icons/wxwin48x48.png +0 -0
  110. data/samples/bigdemo/run.rb +94 -0
  111. data/samples/bigdemo/tips.txt +7 -0
  112. data/samples/bigdemo/utils.rb +12 -0
  113. data/samples/bigdemo/wxArtProvider.rbw +285 -0
  114. data/samples/bigdemo/wxBitmapButton.rbw +64 -0
  115. data/samples/bigdemo/wxButton.rbw +66 -0
  116. data/samples/bigdemo/wxCalendarCtrl.rbw +72 -0
  117. data/samples/bigdemo/wxCheckBox.rbw +52 -0
  118. data/samples/bigdemo/wxCheckListBox.rbw +77 -0
  119. data/samples/bigdemo/wxChoice.rbw +49 -0
  120. data/samples/bigdemo/wxChoicebook.rbw +80 -0
  121. data/samples/bigdemo/wxColourDialog.rbw +34 -0
  122. data/samples/bigdemo/wxComboBox.rbw +79 -0
  123. data/samples/bigdemo/wxCursor.rbw +140 -0
  124. data/samples/bigdemo/wxDialog.rbw +92 -0
  125. data/samples/bigdemo/wxDirDialog.rbw +32 -0
  126. data/samples/bigdemo/wxDragImage.rbw +74 -0
  127. data/samples/bigdemo/wxFileDialog.rbw +39 -0
  128. data/samples/bigdemo/wxFileDialog_Save.rbw +38 -0
  129. data/samples/bigdemo/wxFindReplaceDialog.rbw +85 -0
  130. data/samples/bigdemo/wxFontDialog.rbw +176 -0
  131. data/samples/bigdemo/wxFrame.rbw +55 -0
  132. data/samples/bigdemo/wxGauge.rbw +73 -0
  133. data/samples/bigdemo/wxGenericDirCtrl.rbw +78 -0
  134. data/samples/bigdemo/wxGrid.rbw +68 -0
  135. data/samples/bigdemo/wxHtmlHelpController.rbw +57 -0
  136. data/samples/bigdemo/wxListBox.rbw +142 -0
  137. data/samples/bigdemo/wxListCtrl_virtual.rbw +109 -0
  138. data/samples/bigdemo/wxMDIWindows.rbw +52 -0
  139. data/samples/bigdemo/wxMenu.rbw +238 -0
  140. data/samples/bigdemo/wxMessageDialog.rbw +30 -0
  141. data/samples/bigdemo/wxMiniFrame.rbw +74 -0
  142. data/samples/bigdemo/wxMultipleChoiceDialog.rbw +34 -0
  143. data/samples/bigdemo/wxNotebook.rbw +138 -0
  144. data/samples/bigdemo/wxProgressDialog.rbw +45 -0
  145. data/samples/bigdemo/wxRadioBox.rbw +74 -0
  146. data/samples/bigdemo/wxRadioButton.rbw +127 -0
  147. data/samples/bigdemo/wxSashWindow.rbw +145 -0
  148. data/samples/bigdemo/wxScrolledMessageDialog.rbw +59 -0
  149. data/samples/bigdemo/wxScrolledWindow.rbw +201 -0
  150. data/samples/bigdemo/wxSingleChoiceDialog.rbw +35 -0
  151. data/samples/bigdemo/wxSlider.rbw +44 -0
  152. data/samples/bigdemo/wxSpinButton.rbw +52 -0
  153. data/samples/bigdemo/wxSpinCtrl.rbw +53 -0
  154. data/samples/bigdemo/wxSplitterWindow.rbw +65 -0
  155. data/samples/bigdemo/wxStaticBitmap.rbw +53 -0
  156. data/samples/bigdemo/wxStaticText.rbw +57 -0
  157. data/samples/bigdemo/wxStatusBar.rbw +128 -0
  158. data/samples/bigdemo/wxTextCtrl.rbw +151 -0
  159. data/samples/bigdemo/wxTextEntryDialog.rbw +34 -0
  160. data/samples/bigdemo/wxToggleButton.rbw +51 -0
  161. data/samples/bigdemo/wxToolBar.rbw +133 -0
  162. data/samples/bigdemo/wxTreeCtrl.rbw +192 -0
  163. data/samples/calendar/calendar.rb +275 -0
  164. data/samples/caret/caret.rb +286 -0
  165. data/samples/caret/mondrian.xpm +44 -0
  166. data/samples/controls/controls.rb +1140 -0
  167. data/samples/controls/get_item_sample.rb +87 -0
  168. data/samples/controls/icons/choice.xpm +27 -0
  169. data/samples/controls/icons/combo.xpm +27 -0
  170. data/samples/controls/icons/gauge.xpm +27 -0
  171. data/samples/controls/icons/list.xpm +27 -0
  172. data/samples/controls/icons/radio.xpm +27 -0
  173. data/samples/controls/icons/stattext.xpm +24 -0
  174. data/samples/controls/icons/text.xpm +27 -0
  175. data/samples/controls/mondrian.ico +0 -0
  176. data/samples/controls/mondrian.xpm +44 -0
  177. data/samples/controls/test2.bmp +0 -0
  178. data/samples/dialogs/dialogs.rb +724 -0
  179. data/samples/dialogs/tips.txt +18 -0
  180. data/samples/drawing/graphics_drawing.rb +232 -0
  181. data/samples/drawing/images.rb +48 -0
  182. data/samples/drawing/paperclip.png +0 -0
  183. data/samples/etc/activation.rb +108 -0
  184. data/samples/etc/choice.rb +72 -0
  185. data/samples/etc/miniframe.rb +84 -0
  186. data/samples/etc/sash.rb +135 -0
  187. data/samples/etc/scrollwin.rb +116 -0
  188. data/samples/etc/system_settings.rb +258 -0
  189. data/samples/etc/threaded.rb +81 -0
  190. data/samples/etc/wizard.rb +79 -0
  191. data/samples/event/event.rb +184 -0
  192. data/samples/grid/grid.rb +202 -0
  193. data/samples/html/html.rb +264 -0
  194. data/samples/listbook/listbook.rb +181 -0
  195. data/samples/listbook/listbook.xrc +370 -0
  196. data/samples/mdi/mdi.rb +87 -0
  197. data/samples/media/mediactrl.rb +173 -0
  198. data/samples/minimal/minimal.rb +85 -0
  199. data/samples/minimal/mondrian.ico +0 -0
  200. data/samples/minimal/mondrian.png +0 -0
  201. data/samples/minimal/nothing.rb +21 -0
  202. data/samples/opengl/cube.rb +123 -0
  203. data/samples/printing/mondrian.ico +0 -0
  204. data/samples/printing/mondrian.xpm +44 -0
  205. data/samples/printing/printing.rb +484 -0
  206. data/samples/sockets/SocketPackets.rb +27 -0
  207. data/samples/sockets/res/message-new.png +0 -0
  208. data/samples/sockets/res/user.png +0 -0
  209. data/samples/sockets/wxClient.rb +395 -0
  210. data/samples/sockets/wxServer.rb +422 -0
  211. data/samples/sockets/wxSocketGUI.rb +97 -0
  212. data/samples/text/mondrian.ico +0 -0
  213. data/samples/text/mondrian.xpm +44 -0
  214. data/samples/text/scintilla.rb +174 -0
  215. data/samples/text/textctrl.rb +124 -0
  216. data/samples/text/unicode.rb +238 -0
  217. data/samples/text/utf8.txt +15 -0
  218. data/samples/treectrl/icon1.xpm +79 -0
  219. data/samples/treectrl/icon2.xpm +53 -0
  220. data/samples/treectrl/icon3.xpm +79 -0
  221. data/samples/treectrl/icon4.xpm +43 -0
  222. data/samples/treectrl/icon5.xpm +79 -0
  223. data/samples/treectrl/treectrl.rb +1180 -0
  224. data/samples/xrc/samples.xrc +46 -0
  225. data/samples/xrc/xrc_sample.rb +107 -0
  226. metadata +296 -0
data/LICENSE ADDED
@@ -0,0 +1,53 @@
1
+ wxRuby2
2
+ Copyright (c) 2004-2007 wxRuby Development Team
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in
12
+ all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+
22
+
23
+
24
+
25
+
26
+
27
+ ============================================================================
28
+ THE FOLLOWING IS NOT PART OF THE LICENSE, NOR IS IT LEGAL ADVICE!
29
+
30
+ wxRuby and wxWidgets
31
+ --------------------
32
+ Normally, wxRuby is distributed with a binary copy of wxWidgets. If you
33
+ distribute the wxRuby gem, you are bound to the requirements of the
34
+ copy of wxWidgets within. Fortunately, those requirements do not impose
35
+ any serious restrictions.
36
+
37
+
38
+ wxWidgets License Summary (from the wxWidgets README)
39
+ -----------------------------------------------------
40
+ In summary, the licence is LGPL plus a clause allowing unrestricted
41
+ distribution of application binaries. To answer a FAQ, you don't have to
42
+ distribute any source if you wish to write commercial applications using
43
+ wxWidgets.
44
+
45
+
46
+ Required Credits and Attribution
47
+ --------------------------------
48
+
49
+ Generally, neither wxWidgets nor wxRuby require attribution, beyond
50
+ retaining existing copyright notices. However, if you build your own
51
+ custom wxWidgets library, there may be portions that require specific
52
+ attributions or credits, such as TIFF or JPEG support. See the wxWidgets
53
+ README and license files for details.
data/README ADDED
@@ -0,0 +1,299 @@
1
+ README for wxruby2
2
+
3
+ Version 1.9.x
4
+
5
+ This is wxruby2, the second generation of wxRuby, a library
6
+ that allows Ruby programs to use the wxWidgets GUI toolkit.
7
+ It is released under a permissive MIT-style license
8
+ (see the LICENSE file for details).
9
+
10
+ This version is a beta release, in preparation for a stable release of
11
+ wxruby version 2.0.
12
+
13
+ ------------------------FAQ---------------------------
14
+
15
+ - What platforms and operating systems are supported in wxRuby2?
16
+
17
+ Currently the following are fully supported:
18
+
19
+ Windows NT/2000/XP/Vista (i686)
20
+ OS X 10.3+ (i686 and PowerPc)
21
+ Linux (i686 + AMD-64)
22
+
23
+ It is unlikely that support for old Windows OS's (3.1, 95, 98, ME)
24
+ will be added to wxRuby2 in the near future, as these operating
25
+ systems have very limited support for Unicode.
26
+
27
+ - Why would I choose wxruby over FXRuby, Ruby/GTK, or one of the other
28
+ GUI toolkits? Isn't wxruby arriving "too late"?
29
+
30
+ There are several great GUI toolkits available for Ruby, but we
31
+ like wxruby better because it has a combination of features that no
32
+ other toolkit has:
33
+
34
+ - Cross-platform (MSWindows, Mac OS X, Linux)
35
+ - Native widgets when possible
36
+ - Provides a wide selection of widgets
37
+ - Simple license that is compatible with proprietary and Free Software
38
+ - Mature foundation (wxWidgets has been around for over 10 years)
39
+
40
+ The really big feature is native widgets. The only other cross-platform
41
+ toolkits that use native widgets are either limited (Tk) or expensive if
42
+ you want to develop proprietary software (Qt). We are not saying that
43
+ those toolkits are bad! Just that wxruby offers a unique set of
44
+ features.
45
+
46
+ - Why are native widgets important or helpful?
47
+
48
+ For one thing, it means that end-users do not have to adjust to a
49
+ "foreign" interface. It also ensures maximum compatibility with
50
+ "assistive technology" such as screen readers for blind users.
51
+ It also allows apps to respect any themes the user may have chosen
52
+ through their operating system. No matter how hard a toolkit may try
53
+ to emulate a particular UI, there will always be differences in the
54
+ look or behavior.
55
+
56
+ - How does wxruby2 relate to wxruby (and the wxruby 0.6.0 release)?
57
+
58
+ wxruby2 is the "next generation" of wxruby. It is being developed
59
+ by the same wxruby team, and is intended to replace the older
60
+ code base. wxruby2 is built using SWIG, a powerful tool that makes
61
+ it much easier to create and maintain wrappers around C/C++ libraries.
62
+
63
+ - Why should I use wxruby2 instead of wxruby?
64
+
65
+ First, because development on the original wxruby codebase has stopped.
66
+ Everyone is working on wxruby2, so it will continue to improve. Beyond
67
+ that, wxruby2 has these advantages over wxruby 0.6.0:
68
+
69
+ - Available as binary gems for MSWindows, OS X, and Linux (GTK)
70
+ - Support for more classes, and more methods within classes
71
+ - Unicode support
72
+ - Vastly improved support for OS X
73
+ - Looks much better under Linux because it uses GTK+2
74
+ - Simpler and more permissive license
75
+ - Wraps wxWidgets 2.8.3 instead of the older 2.4 series
76
+
77
+ - Is wxruby2 ready for "production" use?
78
+
79
+ Yes, pretty much. This is a beta release, and there may be some bugs
80
+ in some methods, or memory leaks. This release includes all the
81
+ classes and features that are proposed for inclusion in wxruby 2.0.
82
+
83
+ It is considerably more stable and fully-featured than the old 0.6.0
84
+ release, which was never really stable enough for heavy-duty
85
+ production use.
86
+
87
+ - Does wxruby2 support the Xxx class?
88
+
89
+ See the "Documentation" section of the README file, or check the
90
+ wxruby web site: http://wxruby.org
91
+
92
+ - How are the wxruby 0.6.0 and wxruby2 licenses different?
93
+
94
+ wxruby 0.6.0 was released under the wxWindows license, which is a
95
+ modified LGPL. It is a good, fair license, allowing use in both Free
96
+ Software and proprietary applications. However, it is long and complex,
97
+ and is more appropriate for compiled code. wxruby2 is available under a
98
+ *very* simple MIT-style license, which allows just about any use with
99
+ very few restrictions.
100
+
101
+ - I am getting an error trying to compile wxruby2
102
+
103
+ Please double-check the requirements. You may be using the wrong
104
+ version of SWIG, wxWidgets, or some other tool. Double-check the
105
+ instructions on the wxRuby wiki (http://wxruby.rubyforge.org/)
106
+
107
+ If you need help, please ask your question on the wxruby mailing list
108
+ (see the link at http://wxruby.org).
109
+
110
+ - I am getting an error trying to run any wxruby2 application, such as
111
+ the samples that are included in the gem.
112
+
113
+ If you are using Linux, be sure you have configured your system to
114
+ have RUBYOPT=-rubygems. This can be done in .bashrc or /etc/environment,
115
+ depending on your distribution and preferences. [More details to follow].
116
+
117
+ - Why aren't the wx network, file, date, database and other non-GUI
118
+ classes supported?
119
+
120
+ Because Ruby has its own versions of each of them, providing
121
+ cross-platform abstractions of these functions with familiar syntax
122
+ and methods. We assume you are writing your application in Ruby, so it
123
+ makes sense to keep as much code as possible in Ruby. We have only
124
+ wrapped the wx classes that are necessary to write GUI code.
125
+
126
+ There may be some advantages to porting the Wx network classes into
127
+ ruby, if they work better with multi-(native)-threaded code. This is
128
+ currently under evaluation.
129
+
130
+ - Why has it taken so long for wxruby2 to be released?
131
+
132
+ Nobody is getting paid to develop wxruby, so each of the wxruby developers
133
+ are limited in the amount of time they can dedicate to the project. We are
134
+ always looking for more volunteers to help code, test, document, manage
135
+ the bug list, handle publicity, or do other necessary chores.
136
+
137
+ Wrapping wx is a big project that requires a wide variety of skills. As of
138
+ August 2006, the wxRuby project has about 30,000 lines of code, including
139
+ ruby, C++, and SWIG scripts. If we weren't using SWIG it would be far bigger.
140
+
141
+
142
+ For more details, see the project home page:
143
+ http://wxruby.org/
144
+
145
+
146
+ ------------------------USING WXRUBY---------------------------
147
+ INSTALLING:
148
+
149
+ wxRuby is available as binary gems for MS Windows, Mac OS X, and Linux
150
+ with GTK+ 2. Unless you wish to work on wxRuby itself, we strongly
151
+ recommend installing the gem rather than building from source.
152
+
153
+ REQUIREMENTS TO CREATE AND RUN WXRUBY APPS:
154
+
155
+ - Ruby 1.8
156
+ - MS Windows NT/2000/XP/Vista, Mac OS X 10.3+, or Linux with GTK+ 2,
157
+
158
+ SAMPLES:
159
+
160
+ There is a samples/ directory containing many small sample wxRuby apps
161
+ that demonstrate how to use various classes. A few samples do not work
162
+ across all platforms at this time.
163
+
164
+ The bigdemo sample is fairly comprehensive, but not all of the
165
+ sections work on all platforms.
166
+
167
+
168
+ WRITING YOUR OWN WXRUBY APP:
169
+
170
+ To use wxruby-swig in your app, use:
171
+ require 'wx'
172
+
173
+ samples/minimal.rb can be used as a template for creating your
174
+ own wxruby application.
175
+
176
+
177
+ DOCUMENTATION:
178
+
179
+ - wxRuby-specific API documentation can be found here:
180
+
181
+ http://wxruby.org/doc/
182
+
183
+ (Note: This documentation is auto-generated from the C++ wxWidgets API
184
+ docs. There are some broken links, some sample code in C++, and some
185
+ sections which do not apply to ruby. The documentation is continually
186
+ being improved.)
187
+
188
+ - The latest version of the documentation can be downloaded from the
189
+ wxRuby 'Files' section on Rubyforge.
190
+
191
+ http://www.rubyforge.org/frs/?group_id=35
192
+
193
+ - Tables summarizing which wx classes are and are not supported can
194
+ be found here:
195
+
196
+ http://wxruby.org/wiki/wiki.pl?ClassesSupportedByCategory
197
+
198
+ - Most wxWidgets and wxPython tutorials and references can also be used, if
199
+ you remember that wxRuby uses ruby_style_naming for methods and variables
200
+ instead of MixedCase as used by wxWidgets.
201
+
202
+
203
+
204
+ API DIFFERENCES FROM WXWIDGETS:
205
+ - In many cases, wxRuby follows the lead of wxPython (or in some cases,
206
+ wxPerl), adjusting certain method calls when the C++ style doesn't fit
207
+ dynamic languages.
208
+ - Since initialize is reserved in ruby, use SplitterWindow#init instead.
209
+ - Many wx classes have not been wrapped because native ruby classes work
210
+ as well or better. These include wxDateTime, wxString, networking
211
+ classes, database classes.
212
+ - log_message and log_status take a single string parameter,
213
+ rather than a format string followed by additional values
214
+ to be inserted. Use Ruby's sprintf if required.
215
+ - ScreenDC extends DC on all platforms, unlike in C++ wx.
216
+ This means that you cannot override any virtual methods that were
217
+ defined in PaintDC or WindowDC in a ruby subclass of ScreenDC.
218
+ [Need to verify if this is still true]
219
+ - BusyCursor can be used in a Ruby block to ensure the original cursor
220
+ is always restored.
221
+
222
+ ----------------------COMPILING WXRUBY--------------------------
223
+ REQUIREMENTS TO COMPILE/BUILD WXRUBY ITSELF
224
+
225
+ - rake
226
+ - SWIG, version 1.3.31. SWIG 1.3.29 or later may work; earlier version
227
+ definitely won't, nor will later versions such as 1.3.33
228
+ - wxWidgets 2.8.x SDK. See further information on the wxruby website for
229
+ recommended compile-time options for wxWidgets.
230
+
231
+
232
+ OBTAINING THE SOURCE:
233
+
234
+ Source code is hosted in Subversion at rubyforge.org. See the links on
235
+ the wxruby web site (http://wxruby.org). Check out the wxruby2
236
+ Subversion module (not the old wxruby module).
237
+
238
+
239
+ BUILDING:
240
+
241
+ From the top-level directory (typically wxruby2/),
242
+ just start the rake build with the command:
243
+
244
+ rake
245
+
246
+ There is no ./configure step, nor do you need to run ruby extconf.rb.
247
+
248
+
249
+ INSTALLING THE LIBRARY:
250
+
251
+ You can install the library using:
252
+ rake install
253
+
254
+ Note that on some systems you may need to be "root" to do this.
255
+ To manually install, copy all the files in the lib/ subdirectory
256
+ to somewhere on your ruby library path, such as a ruby extensions
257
+ directory.
258
+
259
+
260
+ PORTING TO OTHER PLATFORMS
261
+
262
+ Platform-dependent rakefiles are used to set up compiler-specific
263
+ settings. The following platforms are currently fully supported:
264
+
265
+ Mac OSX (gcc): rakemacosx.rb
266
+ MS Windows (VC++): rakemswin.rb
267
+ Linux (GTK2 + gcc): rakelinux.rb
268
+
269
+ For other platforms, you may need to edit the appropriate
270
+ platform-dependent rake file if your system is not yet supported, or if
271
+ it is unusual. These files are found in the rake subdirectory:
272
+
273
+ MS Windows BC++: rakebccwin.rb
274
+ MS Windows MingGW: rakemingw.rb
275
+ MS Windows Cygwin: rakecygwin.rb
276
+ NetBSD: rakenetbsd.rb
277
+
278
+ When editing a platform-dependent rakefile, you might
279
+ merely need to set one or more of the following variables:
280
+
281
+ $extra_cppflags
282
+ $extra_ldflags
283
+ $extra_objs
284
+ $extra_libs
285
+
286
+
287
+ CREDITS
288
+
289
+ Kevin Smith set up the wxruby2 project using SWIG and did much of the
290
+ work that still forms the core of the library in its present form. Over
291
+ the years dozens of volunteers have contributed invaluable patches and
292
+ new functionality. The list is too long to give here, but their
293
+ contributions are recorded in the wxruby mailing list archives.
294
+
295
+ -----------------------------------------------------------
296
+
297
+ LEAD MAINTAINER:
298
+ Alex Fenton
299
+ alex at pressure dot to
@@ -0,0 +1,42 @@
1
+ # Copyright 2004-2006 by Kevin Smith
2
+ # released under the MIT-style wxruby2 license
3
+
4
+ # This wrapper serves three functions:
5
+ # 1. It loads the binary library 'wxruby2.so' or 'wxruby.dll', while
6
+ # still allowing applications to just require 'wx'.
7
+ # 2. It sets up the version information
8
+ # 3. It loads in ruby extensions to the core Wx classes.
9
+
10
+
11
+ # load the binary library
12
+ require 'wxruby2'
13
+
14
+ # alias the module
15
+ Wx = Wxruby2
16
+
17
+ # Load the version information (should be bundled with all released versions)
18
+ begin
19
+ require 'wx/version'
20
+ rescue LoadError
21
+ Wx::WXRUBY_VERSION = '0.0.0'
22
+ end
23
+ # Convenience string for WxWidgets version info
24
+ Wx::WXWIDGETS_VERSION = '%i.%i.%i' % [ Wx::WXWIDGETS_MAJOR_VERSION,
25
+ Wx::WXWIDGETS_MINOR_VERSION,
26
+ Wx::WXWIDGETS_RELEASE_NUMBER ]
27
+
28
+
29
+ # Load in all the class extension methods written in ruby
30
+ # evthandler must be required first b/c it sets up methods modified elsewhere
31
+ require 'wx/classes/evthandler.rb'
32
+ class_files = File.join( File.dirname(__FILE__), 'wx', 'classes', '*.rb')
33
+ Dir.glob(class_files) do | class_file |
34
+ require 'wx/classes/' + class_file[/\w+\.rb$/]
35
+ end
36
+
37
+ # Load in syntax sweetner
38
+ require 'wx/accessors'
39
+ require 'wx/keyword_ctors'
40
+ require 'wx/keyword_defs'
41
+
42
+
@@ -0,0 +1,52 @@
1
+ # = WxSugar - Accessors
2
+ #
3
+ # The default WxRuby interface has lots and lots of methods like
4
+ #
5
+ # * get_position()
6
+ # * set_size(a_size)
7
+ # * is_checked()
8
+ #
9
+ # and so on. Methods that retrieve set, or query attributes of an object
10
+ # are more normally in Ruby called simply by the attribute name:
11
+ #
12
+ # * position()
13
+ # * size = a_size
14
+ # * checked?
15
+ #
16
+ # This extension creates an alias for every WxRuby instance method that
17
+ # begins with +get_+, +set_+ or +is_+. Note that if you are calling a
18
+ # 'setter' method on self, you must explicitly send the message to self:
19
+ #
20
+ # # set's self size to be 100px by 100px
21
+ # self.size = Wx::Size.new(100, 100)
22
+ # # only sets the value of a local variable 'size'
23
+ # size = Wx::Size.new
24
+
25
+ module WxRubyStyleAccessors
26
+ def method_missing(sym, *args)
27
+ case sym.to_s
28
+ when /^(.*)\=$/
29
+ meth = "set_#{$1}"
30
+ when /^(.*)\?$/
31
+ meth = "is_#{$1}"
32
+ else
33
+ meth = "get_#{sym}"
34
+ end
35
+ if respond_to?(meth)
36
+ send(meth, *args)
37
+ else
38
+ e = NoMethodError.new("undefined method '#{sym}' for #{self.inspect}")
39
+ e.set_backtrace(caller)
40
+ Kernel.raise e
41
+ end
42
+ end
43
+ end
44
+
45
+ all_classes = Wx::constants.collect { | c | Wx::const_get(c) }.grep(Class)
46
+
47
+ all_classes.each do | klass |
48
+ klass.class_eval do
49
+ include WxRubyStyleAccessors
50
+ extend WxRubyStyleAccessors
51
+ end
52
+ end
@@ -0,0 +1,45 @@
1
+ # Copyright 2004-2006 by Kevin Smith
2
+ # released under the MIT-style wxruby2 license
3
+
4
+ # Controller class which creates and manages all windows.
5
+ class Wx::App
6
+ # Convenience class method to create simple apps. Starts an
7
+ # application main_loop, setting up initial windows etc as specified
8
+ # in the passed block.
9
+ # block
10
+ def self.run(&block)
11
+ app_klass = Class.new(self)
12
+ app_klass.class_eval do
13
+ define_method(:on_init, &block)
14
+ end
15
+ the_app = app_klass.new
16
+ the_app.main_loop
17
+ end
18
+
19
+ # This is a class method in Wx, but permit it to be an instance method
20
+ # in wxRuby
21
+ def is_main_loop_running
22
+ Wx::App.is_main_loop_running
23
+ end
24
+
25
+ # This method handles failed assertions from within the WxWidgets C++
26
+ # code. These messages are only generated by a DEBUG build of
27
+ # WxRuby. Such messages usually indicate that the API is being used
28
+ # incorrectly; the file/line reference points to the place in the
29
+ # WxWidgets source code where the assertion was made.
30
+ define_method(:on_assert_failure) do | file, line, condition, message |
31
+ warn "Wx WARNING: #{message} (#{file}:#{line})"
32
+ end
33
+
34
+ # For use in development only, of no practical use in production code.
35
+ # This method causes Ruby's garbage collection to run (roughly) at
36
+ # interval +interval+ (seconds) - the default is 1, i.e. every
37
+ # second. This should help ferret out bugs in memory management more
38
+ # quickly.
39
+ def gc_stress(interval = 1)
40
+ t = Wx::Timer.new(self, 9999)
41
+ evt_timer(9999) { Thread.pass }
42
+ Thread.new { loop { sleep interval; GC.start } }
43
+ t.start(100)
44
+ end
45
+ end