wxruby 1.9.6-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. data/LICENSE +53 -0
  2. data/README +297 -0
  3. data/lib/wx/accessors.rb +52 -0
  4. data/lib/wx/classes/acceleratortable.rb +28 -0
  5. data/lib/wx/classes/animation.rb +18 -0
  6. data/lib/wx/classes/app.rb +45 -0
  7. data/lib/wx/classes/artprovider.rb +31 -0
  8. data/lib/wx/classes/bitmap.rb +28 -0
  9. data/lib/wx/classes/busycursor.rb +12 -0
  10. data/lib/wx/classes/checklistbox.rb +45 -0
  11. data/lib/wx/classes/choice.rb +4 -0
  12. data/lib/wx/classes/clientdc.rb +13 -0
  13. data/lib/wx/classes/clipboard.rb +16 -0
  14. data/lib/wx/classes/colour.rb +47 -0
  15. data/lib/wx/classes/combobox.rb +4 -0
  16. data/lib/wx/classes/commandevent.rb +7 -0
  17. data/lib/wx/classes/controlwithitems.rb +10 -0
  18. data/lib/wx/classes/dc.rb +57 -0
  19. data/lib/wx/classes/event.rb +5 -0
  20. data/lib/wx/classes/evthandler.rb +921 -0
  21. data/lib/wx/classes/font.rb +118 -0
  22. data/lib/wx/classes/functions.rb +44 -0
  23. data/lib/wx/classes/gauge.rb +12 -0
  24. data/lib/wx/classes/grid.rb +138 -0
  25. data/lib/wx/classes/helpcontroller.rb +5 -0
  26. data/lib/wx/classes/htmlhelpcontroller.rb +5 -0
  27. data/lib/wx/classes/htmlwindow.rb +14 -0
  28. data/lib/wx/classes/icon.rb +21 -0
  29. data/lib/wx/classes/iconbundle.rb +3 -0
  30. data/lib/wx/classes/image.rb +31 -0
  31. data/lib/wx/classes/imagelist.rb +3 -0
  32. data/lib/wx/classes/listbox.rb +4 -0
  33. data/lib/wx/classes/listctrl.rb +21 -0
  34. data/lib/wx/classes/locale.rb +28 -0
  35. data/lib/wx/classes/mediactrl.rb +22 -0
  36. data/lib/wx/classes/menu.rb +62 -0
  37. data/lib/wx/classes/menuitem.rb +7 -0
  38. data/lib/wx/classes/object.rb +7 -0
  39. data/lib/wx/classes/paintdc.rb +12 -0
  40. data/lib/wx/classes/point.rb +48 -0
  41. data/lib/wx/classes/previewframe.rb +13 -0
  42. data/lib/wx/classes/rect.rb +10 -0
  43. data/lib/wx/classes/size.rb +49 -0
  44. data/lib/wx/classes/sound.rb +23 -0
  45. data/lib/wx/classes/styledtextctrl.rb +92 -0
  46. data/lib/wx/classes/textctrl.rb +14 -0
  47. data/lib/wx/classes/texturlevent.rb +6 -0
  48. data/lib/wx/classes/timer.rb +94 -0
  49. data/lib/wx/classes/toolbartool.rb +4 -0
  50. data/lib/wx/classes/treectrl.rb +44 -0
  51. data/lib/wx/classes/window.rb +82 -0
  52. data/lib/wx/classes/xmlresource.rb +37 -0
  53. data/lib/wx/keyword_ctors.rb +222 -0
  54. data/lib/wx/keyword_defs.rb +492 -0
  55. data/lib/wx/version.rb +3 -0
  56. data/lib/wx.rb +42 -0
  57. data/lib/wxruby2.so +0 -0
  58. data/samples/SAMPLES-LICENSE.TXT +18 -0
  59. data/samples/aui/aui.rb +1356 -0
  60. data/samples/bigdemo/About.rbw +39 -0
  61. data/samples/bigdemo/ColorPanel.rbw +23 -0
  62. data/samples/bigdemo/GridSimple.rbw +78 -0
  63. data/samples/bigdemo/MDIDemo.rbw +57 -0
  64. data/samples/bigdemo/PopupMenu.rbw +149 -0
  65. data/samples/bigdemo/ShapedWindow.rbw +131 -0
  66. data/samples/bigdemo/Sizers.rbw +543 -0
  67. data/samples/bigdemo/bigdemo.rb +823 -0
  68. data/samples/bigdemo/demoTemplate.rbw +33 -0
  69. data/samples/bigdemo/helpfile.htb +0 -0
  70. data/samples/bigdemo/icons/Test 015.jpg +0 -0
  71. data/samples/bigdemo/icons/Test 015.png +0 -0
  72. data/samples/bigdemo/icons/choice.bmp +0 -0
  73. data/samples/bigdemo/icons/choice.xpm +27 -0
  74. data/samples/bigdemo/icons/combo.bmp +0 -0
  75. data/samples/bigdemo/icons/combo.xpm +27 -0
  76. data/samples/bigdemo/icons/copy.xpm +25 -0
  77. data/samples/bigdemo/icons/cut.xpm +24 -0
  78. data/samples/bigdemo/icons/gauge.bmp +0 -0
  79. data/samples/bigdemo/icons/gauge.xpm +27 -0
  80. data/samples/bigdemo/icons/help.xpm +25 -0
  81. data/samples/bigdemo/icons/list.bmp +0 -0
  82. data/samples/bigdemo/icons/list.xpm +27 -0
  83. data/samples/bigdemo/icons/mondrian.ico +0 -0
  84. data/samples/bigdemo/icons/mondrian.xpm +44 -0
  85. data/samples/bigdemo/icons/new.xpm +24 -0
  86. data/samples/bigdemo/icons/ogl.ico +0 -0
  87. data/samples/bigdemo/icons/ogl.xpm +45 -0
  88. data/samples/bigdemo/icons/open.xpm +26 -0
  89. data/samples/bigdemo/icons/paste.bmp +0 -0
  90. data/samples/bigdemo/icons/paste.xpm +38 -0
  91. data/samples/bigdemo/icons/pointy.png +0 -0
  92. data/samples/bigdemo/icons/preview.xpm +26 -0
  93. data/samples/bigdemo/icons/print.xpm +26 -0
  94. data/samples/bigdemo/icons/radio.bmp +0 -0
  95. data/samples/bigdemo/icons/radio.xpm +27 -0
  96. data/samples/bigdemo/icons/robert.xpm +415 -0
  97. data/samples/bigdemo/icons/ruby.png +0 -0
  98. data/samples/bigdemo/icons/sashtest.ico +0 -0
  99. data/samples/bigdemo/icons/save.xpm +25 -0
  100. data/samples/bigdemo/icons/smiles.bmp +0 -0
  101. data/samples/bigdemo/icons/smiles.xpm +39 -0
  102. data/samples/bigdemo/icons/smiley.ico +0 -0
  103. data/samples/bigdemo/icons/smiley.xpm +42 -0
  104. data/samples/bigdemo/icons/stattext.xpm +24 -0
  105. data/samples/bigdemo/icons/test2.bmp +0 -0
  106. data/samples/bigdemo/icons/test2.png +0 -0
  107. data/samples/bigdemo/icons/test2.xpm +79 -0
  108. data/samples/bigdemo/icons/text.bmp +0 -0
  109. data/samples/bigdemo/icons/text.xpm +27 -0
  110. data/samples/bigdemo/icons/tog1.bmp +0 -0
  111. data/samples/bigdemo/icons/tog1.xpm +38 -0
  112. data/samples/bigdemo/icons/tog2.bmp +0 -0
  113. data/samples/bigdemo/icons/tog2.xpm +38 -0
  114. data/samples/bigdemo/icons/wxwin.ico +0 -0
  115. data/samples/bigdemo/icons/wxwin16x16.png +0 -0
  116. data/samples/bigdemo/icons/wxwin16x16.xpm +25 -0
  117. data/samples/bigdemo/icons/wxwin32x32.png +0 -0
  118. data/samples/bigdemo/icons/wxwin48x48.png +0 -0
  119. data/samples/bigdemo/run.rb +90 -0
  120. data/samples/bigdemo/tips.txt +7 -0
  121. data/samples/bigdemo/utils.rb +12 -0
  122. data/samples/bigdemo/wxArtProvider.rbw +281 -0
  123. data/samples/bigdemo/wxBitmapButton.rbw +65 -0
  124. data/samples/bigdemo/wxButton.rbw +64 -0
  125. data/samples/bigdemo/wxCalendarCtrl.rbw +60 -0
  126. data/samples/bigdemo/wxCheckBox.rbw +50 -0
  127. data/samples/bigdemo/wxCheckListBox.rbw +75 -0
  128. data/samples/bigdemo/wxChoice.rbw +47 -0
  129. data/samples/bigdemo/wxChoicebook.rbw +78 -0
  130. data/samples/bigdemo/wxColourDialog.rbw +31 -0
  131. data/samples/bigdemo/wxComboBox.rbw +77 -0
  132. data/samples/bigdemo/wxCursor.rbw +136 -0
  133. data/samples/bigdemo/wxDialog.rbw +74 -0
  134. data/samples/bigdemo/wxDirDialog.rbw +29 -0
  135. data/samples/bigdemo/wxDragImage.rbw +70 -0
  136. data/samples/bigdemo/wxFileDialog.rbw +37 -0
  137. data/samples/bigdemo/wxFileDialog_Save.rbw +35 -0
  138. data/samples/bigdemo/wxFindReplaceDialog.rbw +82 -0
  139. data/samples/bigdemo/wxFontDialog.rbw +173 -0
  140. data/samples/bigdemo/wxFrame.rbw +53 -0
  141. data/samples/bigdemo/wxGauge.rbw +71 -0
  142. data/samples/bigdemo/wxGenericDirCtrl.rbw +74 -0
  143. data/samples/bigdemo/wxGrid.rbw +66 -0
  144. data/samples/bigdemo/wxHtmlHelpController.rbw +52 -0
  145. data/samples/bigdemo/wxListBox.rbw +140 -0
  146. data/samples/bigdemo/wxListCtrl_virtual.rbw +107 -0
  147. data/samples/bigdemo/wxMDIWindows.rbw +50 -0
  148. data/samples/bigdemo/wxMenu.rbw +236 -0
  149. data/samples/bigdemo/wxMessageDialog.rbw +27 -0
  150. data/samples/bigdemo/wxMiniFrame.rbw +70 -0
  151. data/samples/bigdemo/wxMultipleChoiceDialog.rbw +32 -0
  152. data/samples/bigdemo/wxNotebook.rbw +136 -0
  153. data/samples/bigdemo/wxProgressDialog.rbw +43 -0
  154. data/samples/bigdemo/wxRadioBox.rbw +72 -0
  155. data/samples/bigdemo/wxRadioButton.rbw +125 -0
  156. data/samples/bigdemo/wxSashWindow.rbw +141 -0
  157. data/samples/bigdemo/wxScrolledMessageDialog.rbw +57 -0
  158. data/samples/bigdemo/wxScrolledWindow.rbw +199 -0
  159. data/samples/bigdemo/wxSingleChoiceDialog.rbw +33 -0
  160. data/samples/bigdemo/wxSlider.rbw +42 -0
  161. data/samples/bigdemo/wxSpinButton.rbw +50 -0
  162. data/samples/bigdemo/wxSpinCtrl.rbw +51 -0
  163. data/samples/bigdemo/wxSplitterWindow.rbw +63 -0
  164. data/samples/bigdemo/wxStaticBitmap.rbw +51 -0
  165. data/samples/bigdemo/wxStaticText.rbw +55 -0
  166. data/samples/bigdemo/wxStatusBar.rbw +126 -0
  167. data/samples/bigdemo/wxTextCtrl.rbw +149 -0
  168. data/samples/bigdemo/wxTextEntryDialog.rbw +31 -0
  169. data/samples/bigdemo/wxToggleButton.rbw +49 -0
  170. data/samples/bigdemo/wxToolBar.rbw +131 -0
  171. data/samples/bigdemo/wxTreeCtrl.rbw +190 -0
  172. data/samples/calendar/calendar.rb +271 -0
  173. data/samples/caret/caret.rb +282 -0
  174. data/samples/caret/mondrian.xpm +44 -0
  175. data/samples/controls/controls.rb +1136 -0
  176. data/samples/controls/get_item_sample.rb +87 -0
  177. data/samples/controls/icons/choice.xpm +27 -0
  178. data/samples/controls/icons/combo.xpm +27 -0
  179. data/samples/controls/icons/gauge.xpm +27 -0
  180. data/samples/controls/icons/list.xpm +27 -0
  181. data/samples/controls/icons/radio.xpm +27 -0
  182. data/samples/controls/icons/stattext.xpm +24 -0
  183. data/samples/controls/icons/text.xpm +27 -0
  184. data/samples/controls/mondrian.ico +0 -0
  185. data/samples/controls/mondrian.xpm +44 -0
  186. data/samples/controls/test2.bmp +0 -0
  187. data/samples/dialogs/dialogs.rb +723 -0
  188. data/samples/dialogs/tips.txt +18 -0
  189. data/samples/drawing/graphics_drawing.rb +235 -0
  190. data/samples/drawing/images.rb +37 -0
  191. data/samples/drawing/paperclip.png +0 -0
  192. data/samples/etc/activation.rb +102 -0
  193. data/samples/etc/choice.rb +67 -0
  194. data/samples/etc/miniframe.rb +79 -0
  195. data/samples/etc/sash.rb +130 -0
  196. data/samples/etc/scrollwin.rb +110 -0
  197. data/samples/etc/system_settings.rb +252 -0
  198. data/samples/etc/threaded.rb +72 -0
  199. data/samples/etc/wizard.rb +74 -0
  200. data/samples/event/event.rb +182 -0
  201. data/samples/grid/grid.rb +198 -0
  202. data/samples/grid/gridtablebase.rb +134 -0
  203. data/samples/html/html.rb +262 -0
  204. data/samples/listbook/listbook.rb +174 -0
  205. data/samples/listbook/listbook.xrc +370 -0
  206. data/samples/mdi/mdi.rb +82 -0
  207. data/samples/media/mediactrl.rb +167 -0
  208. data/samples/minimal/minimal.rb +77 -0
  209. data/samples/minimal/mondrian.ico +0 -0
  210. data/samples/minimal/mondrian.png +0 -0
  211. data/samples/minimal/nothing.rb +16 -0
  212. data/samples/opengl/cube.rb +117 -0
  213. data/samples/printing/mondrian.ico +0 -0
  214. data/samples/printing/mondrian.xpm +44 -0
  215. data/samples/printing/printing.rb +310 -0
  216. data/samples/sockets/SocketPackets.rb +27 -0
  217. data/samples/sockets/res/message-new.png +0 -0
  218. data/samples/sockets/res/user.png +0 -0
  219. data/samples/sockets/wxClient.rb +395 -0
  220. data/samples/sockets/wxServer.rb +422 -0
  221. data/samples/sockets/wxSocketGUI.rb +97 -0
  222. data/samples/text/mondrian.ico +0 -0
  223. data/samples/text/mondrian.xpm +44 -0
  224. data/samples/text/scintilla.rb +169 -0
  225. data/samples/text/textctrl.rb +113 -0
  226. data/samples/text/unicode.rb +242 -0
  227. data/samples/text/utf8.txt +15 -0
  228. data/samples/treectrl/icon1.xpm +79 -0
  229. data/samples/treectrl/icon2.xpm +53 -0
  230. data/samples/treectrl/icon3.xpm +79 -0
  231. data/samples/treectrl/icon4.xpm +43 -0
  232. data/samples/treectrl/icon5.xpm +79 -0
  233. data/samples/treectrl/treectrl.rb +1174 -0
  234. data/samples/xrc/samples.xrc +46 -0
  235. data/samples/xrc/xrc_sample.rb +96 -0
  236. metadata +313 -0
@@ -0,0 +1,492 @@
1
+ # = WxSugar - Keyword Constructors Classes
2
+ #
3
+ # This extension defines the keyword parameters for +new+ methods for
4
+ # widgets, windows and frames. It's for use with *Keyword Constructors*
5
+ # and is no use on its own - except if you are looking for a bug or want
6
+ # to add a missing class.
7
+ #
8
+ # For each class, the parameters *must* be declared in the order that
9
+ # they are supplied to wxRuby. A parameter is specified by a symbol
10
+ # name, and, optionally, a default argument which will of whatever type
11
+ # the wxRuby core library accepts. Because hashes are unordered in Ruby
12
+ # 1.8, if a default argument is specified, this must be the last in a
13
+ # list of parameters.
14
+ #
15
+ # Some common parameters to constructors such as size, position, title,
16
+ # id and so forth always have a standard default argumnet, which is
17
+ # defined in keyword_ctors. In these cases, it is not necessary to
18
+ # supply the default argument in the definition.
19
+ module Wx
20
+ @defined_kw_classes = {}
21
+
22
+ # accepts a string unadorned name of a WxWidgets class, and block, which
23
+ # defines the constructor parameters and style flags for that class.
24
+ # If the named class exists in the available WxRuby, the block is run and
25
+ # the class may use keyword constructors. If the class is not available, the
26
+ # block is ignored.
27
+ def self.define_keyword_ctors(klass_name, &block)
28
+ # check this class hasn't already been defined
29
+ if @defined_kw_classes[klass_name]
30
+ raise ArgumentError, "Keyword ctor for #{klass_name} already defined"
31
+ else
32
+ @defined_kw_classes[klass_name] = true
33
+ end
34
+
35
+ begin
36
+ klass = Wx::const_get(klass_name)
37
+ rescue NameError
38
+ return nil
39
+ end
40
+ klass.module_eval { include Wx::KeywordConstructor }
41
+ klass.instance_eval(&block)
42
+ end
43
+ end
44
+
45
+ # Window : base class for all widgets and frames
46
+ Wx::define_keyword_ctors('Window') do
47
+ wx_ctor_params :id, :pos, :size, :style
48
+ wx_ctor_params :name => 'window'
49
+ end
50
+
51
+
52
+ ### FRAMES
53
+
54
+ # wxTopLevelWindow ABSTRACT: Any top level window, dialog or frame
55
+
56
+ # Normal frame
57
+ Wx::define_keyword_ctors('Frame') do
58
+ wx_ctor_params :id, :title, :pos, :size, :style => Wx::DEFAULT_FRAME_STYLE
59
+ wx_ctor_params :name => 'frame'
60
+ end
61
+
62
+ # MDI child frame
63
+ Wx::define_keyword_ctors('MDIChildFrame') do
64
+ wx_ctor_params :id, :title, :pos, :size, :style => Wx::DEFAULT_FRAME_STYLE
65
+ wx_ctor_params :name => 'frame'
66
+ end
67
+
68
+ # MDI parent frame
69
+ Wx::define_keyword_ctors('MDIParentFrame') do
70
+ wx_ctor_params :id, :title, :pos, :size
71
+ wx_ctor_params :style => Wx::DEFAULT_FRAME_STYLE|Wx::VSCROLL|Wx::HSCROLL
72
+ wx_ctor_params :name => 'frame'
73
+ end
74
+
75
+ # wxMiniFrame A frame with a small title bar
76
+ Wx::define_keyword_ctors('MiniFrame') do
77
+ wx_ctor_params :id, :title, :pos, :size
78
+ wx_ctor_params :style => Wx::DEFAULT_FRAME_STYLE
79
+ wx_ctor_params :name => 'frame'
80
+ end
81
+
82
+ # wxSplashScreen Splash screen class
83
+ # FIXME - this probably won't work at present because the 'parent' arg
84
+ # comes in a funny place in this class's ctor
85
+ #
86
+ # Wx::define_keyword_ctors('SplashScreen') do
87
+ # wx_ctor_params :bitmap => Wx::NULL_BITMAP
88
+ # wx_ctor_params :splashstyle, :milliseconds, :id => 1
89
+ # wx_ctor_params :parent => nil
90
+ # wx_ctor_params :title => ''
91
+ # wx_ctor_params :pos, :size
92
+ # wx_ctor_params :style => Wx::SIMPLE_BORDER|Wx::FRAME_NO_TASKBAR|Wx::STAY_ON_TOP
93
+ # end
94
+
95
+ # wxPropertySheetDialog Property sheet dialog
96
+ # wxTipWindow Shows text in a small window
97
+
98
+ # wxWizard A wizard dialog
99
+ Wx::define_keyword_ctors('Wizard') do
100
+ wx_ctor_params :id, :title, :bitmap => Wx::NULL_BITMAP
101
+ wx_ctor_params :pos # NB - no size argument for this class
102
+ wx_ctor_params :style => Wx::DEFAULT_DIALOG_STYLE
103
+ end
104
+
105
+
106
+ # MISCELLANEOUS WINDOWS
107
+
108
+ # A window whose colour changes according to current user settings
109
+ Wx::define_keyword_ctors('Panel') do
110
+ wx_ctor_params :id, :pos, :size, :style => Wx::TAB_TRAVERSAL
111
+ wx_ctor_params :name => 'panel'
112
+ end
113
+
114
+ # wxScrolledWindow Window with automatically managed scrollbars
115
+ Wx::define_keyword_ctors('ScrolledWindow') do
116
+ wx_ctor_params :id, :pos, :size, :style => Wx::VSCROLL|Wx::HSCROLL
117
+ wx_ctor_params :name => 'scrolledWindow'
118
+ end
119
+
120
+ # wxGrid A grid (table) window
121
+ Wx::define_keyword_ctors('Grid') do
122
+ wx_ctor_params :id, :pos, :size, :style => Wx::WANTS_CHARS
123
+ wx_ctor_params :name => 'grid'
124
+ end
125
+
126
+ # Window which can be split vertically or horizontally
127
+ Wx::define_keyword_ctors('SplitterWindow') do
128
+ wx_ctor_params :id, :pos, :size, :style => Wx::SP_3D
129
+ wx_ctor_params :name => 'splitterWindow'
130
+ end
131
+
132
+ # Implements the status bar on a frame
133
+ Wx::define_keyword_ctors('StatusBar') do
134
+ wx_ctor_params :id, :style => Wx::ST_SIZEGRIP
135
+ wx_ctor_params :name => 'statusBar'
136
+ end
137
+
138
+ # Toolbar class
139
+ Wx::define_keyword_ctors('ToolBar') do
140
+ wx_ctor_params :id, :pos, :size, :style => Wx::TB_HORIZONTAL|Wx::NO_BORDER
141
+ wx_ctor_params :name => 'toolBar' # not as documented in Wx 2.6.3
142
+ end
143
+
144
+ # Notebook class
145
+ Wx::define_keyword_ctors('Notebook') do
146
+ wx_ctor_params :id, :pos, :size, :style, :name => 'noteBook'
147
+ end
148
+
149
+ # Similar to notebook but using list control - undocumented
150
+ Wx::define_keyword_ctors('Listbook') do
151
+ wx_ctor_params :id, :pos, :size, :style, :name => 'listBook'
152
+ end
153
+
154
+ # Similar to notebook but using choice control
155
+ Wx::define_keyword_ctors('Choicebook') do
156
+ wx_ctor_params :id, :pos, :size, :style, :name => 'choiceBook'
157
+ end
158
+
159
+ # wxSashWindow: Window with four optional sashes that can be dragged
160
+ Wx::define_keyword_ctors('SashWindow') do
161
+ wx_ctor_params :id, :pos, :size
162
+ wx_ctor_params :style => Wx::CLIP_CHILDREN|Wx::SW_3D
163
+ wx_ctor_params :name => 'sashWindow'
164
+ end
165
+
166
+ # wxSashLayoutWindow: Window that can be involved in an IDE-like layout
167
+ # arrangement
168
+ Wx::define_keyword_ctors('SashLayoutWindow') do
169
+ wx_ctor_params :id, :pos, :size
170
+ wx_ctor_params :style => Wx::CLIP_CHILDREN|Wx::SW_3D
171
+ wx_ctor_params :name => 'layoutWindow'
172
+ end
173
+
174
+ # wxVScrolledWindow: As wxScrolledWindow but supports lines of variable height
175
+
176
+ # wxWizardPage: A base class for the page in wizard dialog.
177
+ Wx::define_keyword_ctors('WizardPage') do
178
+ wx_ctor_params :bitmap => Wx::NULL_BITMAP
179
+ end
180
+
181
+ # wxWizardPageSimple: A page in wizard dialog.
182
+ Wx::define_keyword_ctors('WizardPageSimple') do
183
+ wx_ctor_params :prev => nil
184
+ wx_ctor_params :next => nil
185
+ wx_ctor_params :bitmap => Wx::NULL_BITMAP
186
+ end
187
+
188
+ ### DIALOGS
189
+ # wxDialog Base class for common dialogs
190
+ Wx::define_keyword_ctors('Dialog') do
191
+ wx_ctor_params :id, :title => ''
192
+ wx_ctor_params :pos, :size, :style => Wx::DEFAULT_DIALOG_STYLE
193
+ wx_ctor_params :name => 'dialogBox'
194
+ end
195
+
196
+ # wxColourDialog Colour chooser dialog
197
+ Wx::define_keyword_ctors('ColourDialog') do
198
+ wx_ctor_params :colour_data => nil
199
+ end
200
+
201
+ # wxDirDialog Directory selector dialog
202
+ Wx::define_keyword_ctors('DirDialog') do
203
+ wx_ctor_params :message => 'Choose a directory'
204
+ wx_ctor_params :default_path => ''
205
+ wx_ctor_params :style, :pos, :size, :name => 'wxDirCtrl'
206
+ end
207
+
208
+ # wxFileDialog File selector dialog
209
+ Wx::define_keyword_ctors('FileDialog') do
210
+ wx_ctor_params :message => 'Choose a file'
211
+ wx_ctor_params :default_dir => ''
212
+ wx_ctor_params :default_file => ''
213
+ wx_ctor_params :wildcard => '*.*'
214
+ wx_ctor_params :style, :pos
215
+ end
216
+
217
+ # wxFindReplaceDialog Text search/replace dialog
218
+ Wx::define_keyword_ctors('FindReplaceDialog') do
219
+ wx_ctor_params :find_replace_data => Wx::FindReplaceData.new()
220
+ wx_ctor_params :title => 'findReplaceDialog'
221
+ wx_ctor_params :style
222
+ end
223
+
224
+ # wxMultiChoiceDialog Dialog to get one or more selections from a list
225
+ # wxSingleChoiceDialog Dialog to get a single selection from a list and return the string
226
+
227
+ # Dialog to get a single line of text from the user
228
+ Wx::define_keyword_ctors('TextEntryDialog') do
229
+ wx_ctor_params :message => ''
230
+ wx_ctor_params :caption => 'Please enter text'
231
+ wx_ctor_params :default_value => ''
232
+ wx_ctor_params :style => Wx::OK|Wx::CANCEL|Wx::CENTRE
233
+ wx_ctor_params :pos
234
+ end
235
+
236
+ # wxPasswordEntryDialog Dialog to get a password from the user
237
+ # Wx::define_keyword_ctors('PasswordEntryDialog') do
238
+ # wx_ctor_params :message => ''
239
+ # wx_ctor_params :caption => 'Enter password'
240
+ # wx_ctor_params :default_value => ''
241
+ # wx_ctor_params :style => Wx::OK|Wx::CANCEL|Wx::CENTRE
242
+ # wx_ctor_params :pos
243
+ # end
244
+
245
+ # wxFontDialog Font chooser dialog
246
+ # wxPageSetupDialog Standard page setup dialog
247
+ Wx::define_keyword_ctors('PageSetupDialog') do
248
+ wx_ctor_params :data
249
+ end
250
+
251
+ # wxPrintDialog Standard print dialog
252
+ Wx::define_keyword_ctors('PrintDialog') do
253
+ wx_ctor_params :data
254
+ end
255
+
256
+
257
+ # Simple message box dialog
258
+ Wx::define_keyword_ctors('MessageDialog') do
259
+ wx_ctor_params :message => ''
260
+ wx_ctor_params :caption => 'Message box'
261
+ wx_ctor_params :style => Wx::OK|Wx::CANCEL
262
+ wx_ctor_params :pos
263
+ end
264
+
265
+ ### CONTROLS
266
+
267
+ # Push button control, displaying text
268
+ Wx::define_keyword_ctors('Button') do
269
+ wx_ctor_params :id, :label => ''
270
+ wx_ctor_params :pos, :size, :style
271
+ wx_ctor_params :validator, :name => 'button'
272
+ end
273
+
274
+ # Push button control, displaying a bitmap
275
+ Wx::define_keyword_ctors('BitmapButton') do
276
+ wx_ctor_params :id, :bitmap, :pos, :size, :style => Wx::BU_AUTODRAW
277
+ wx_ctor_params :validator, :name => 'button'
278
+ end
279
+
280
+ # A button which stays pressed when clicked by user.
281
+ Wx::define_keyword_ctors('ToggleButton') do
282
+ wx_ctor_params :id, :label, :pos, :size, :style
283
+ wx_ctor_params :validator, :name => 'checkBox'
284
+ end
285
+
286
+ # Control showing an entire calendar month
287
+ Wx::define_keyword_ctors('CalendarCtrl') do
288
+ wx_ctor_params :id, :date => Time.now()
289
+ wx_ctor_params :pos, :size, :style => Wx::CAL_SHOW_HOLIDAYS
290
+ wx_ctor_params :name => 'calendar'
291
+ end
292
+
293
+ # Checkbox control
294
+ Wx::define_keyword_ctors('CheckBox') do
295
+ wx_ctor_params :id, :label => ''
296
+ wx_ctor_params :pos, :size, :style
297
+ wx_ctor_params :validator, :name => 'checkBox'
298
+ end
299
+
300
+ # A listbox with a checkbox to the left of each item
301
+ Wx::define_keyword_ctors('CheckListBox') do
302
+ wx_ctor_params :id, :pos, :size, :choices, :style
303
+ wx_ctor_params :validator, :name => 'listBox'
304
+ end
305
+
306
+ # wxChoice Choice control (a combobox without the editable area)
307
+ Wx::define_keyword_ctors('Choice') do
308
+ wx_ctor_params :id, :pos, :size, :choices, :style
309
+ wx_ctor_params :validator, :name => 'choice'
310
+ end
311
+
312
+ # wxComboBox A choice with an editable area
313
+ Wx::define_keyword_ctors('ComboBox') do
314
+ wx_ctor_params :id, :value => ''
315
+ wx_ctor_params :pos, :size, :choices => []
316
+ wx_ctor_params :style
317
+ wx_ctor_params :validator, :name => 'comboBox'
318
+ end
319
+
320
+ # wxBitmapComboBox A choice with an editable area
321
+ Wx::define_keyword_ctors('BitmapComboBox') do
322
+ wx_ctor_params :id, :value => ''
323
+ wx_ctor_params :pos, :size, :choices => []
324
+ wx_ctor_params :style
325
+ wx_ctor_params :validator, :name => 'comboBox'
326
+ end
327
+
328
+ # wxDatePickerCtrl Small date picker control
329
+
330
+ # wxGauge A control to represent a varying quantity, such as time
331
+ # remaining
332
+ Wx::define_keyword_ctors('Gauge') do
333
+ wx_ctor_params :id, :range, :pos, :size, :style => Wx::GA_HORIZONTAL
334
+ wx_ctor_params :validator, :name => 'gauge'
335
+ end
336
+
337
+ # wxGenericDirCtrl A control for displaying a directory tree
338
+ Wx::define_keyword_ctors('GenericDirCtrl') do
339
+ # TODO :dir => Wx::DIR_DIALOG_DEFAULT_FOLDER_STR
340
+ wx_ctor_params :id, :dir => ''
341
+ wx_ctor_params :pos, :size,
342
+ :style => Wx::DIRCTRL_3D_INTERNAL|Wx::SUNKEN_BORDER
343
+ wx_ctor_params :filter => ''
344
+ wx_ctor_params :default_filter => 0
345
+ wx_ctor_params :name => 'genericDirCtrl'
346
+ end
347
+
348
+
349
+ # wxHtmlListBox A listbox showing HTML content
350
+ # wxListBox A list of strings for single or multiple selection
351
+ Wx::define_keyword_ctors('ListBox') do
352
+ wx_ctor_params :id, :pos, :size, :choices => []
353
+ wx_ctor_params :style
354
+ wx_ctor_params :validator, :name => 'listBox'
355
+ end
356
+
357
+ # wxListCtrl A control for displaying lists of strings and/or icons, plus a multicolumn report view
358
+ Wx::define_keyword_ctors('ListCtrl') do
359
+ wx_ctor_params :id, :pos, :size, :style => Wx::LC_ICON
360
+ wx_ctor_params :validator, :name => 'listCtrl'
361
+ end
362
+
363
+ # wxListView A simpler interface (facade for wxListCtrl in report mode
364
+
365
+ # wxTreeCtrl Tree (hierarchy) control
366
+ Wx::define_keyword_ctors('TreeCtrl') do
367
+ wx_ctor_params :id, :pos, :size, :style => Wx::TR_HAS_BUTTONS
368
+ wx_ctor_params :validator, :name => 'treeCtrl'
369
+ end
370
+
371
+ # wxSpinCtrl A spin control - i.e. spin button and text control
372
+ Wx::define_keyword_ctors('SpinCtrl') do
373
+ wx_ctor_params :id, :value => ''
374
+ wx_ctor_params :pos, :size, :style => Wx::SP_ARROW_KEYS
375
+ wx_ctor_params :min => 0
376
+ wx_ctor_params :max => 100
377
+ wx_ctor_params :initial => 0
378
+ wx_ctor_params :name => 'spinCtrl'
379
+ end
380
+
381
+ # One or more lines of non-editable text
382
+ Wx::define_keyword_ctors('StaticText') do
383
+ wx_ctor_params :id, :label, :pos, :size, :style, :name => 'staticText'
384
+ end
385
+
386
+ Wx::define_keyword_ctors('StaticBox') do
387
+ wx_ctor_params :id, :label, :pos, :size, :style, :name => 'staticBox'
388
+ end
389
+
390
+ Wx::define_keyword_ctors('StaticLine') do
391
+ wx_ctor_params :id, :pos, :size, :style => Wx::LI_HORIZONTAL
392
+ wx_ctor_params :name => 'staticBox'
393
+ end
394
+
395
+ # wxStaticBitmap A control to display a bitmap
396
+ Wx::define_keyword_ctors('StaticBitmap') do
397
+ wx_ctor_params :id, :label, :pos, :size, :style
398
+ end
399
+
400
+
401
+ # wxRadioBox A group of radio buttons
402
+ Wx::define_keyword_ctors('RadioBox') do
403
+ wx_ctor_params :id, :label => ''
404
+ wx_ctor_params :pos, :size, :choices => []
405
+ wx_ctor_params :major_dimension => 0
406
+ wx_ctor_params :style => Wx::RA_SPECIFY_COLS
407
+ wx_ctor_params :validator, :name => 'radioBox'
408
+ end
409
+
410
+ # wxRadioButton: A round button used with others in a mutually exclusive way
411
+ Wx::define_keyword_ctors('RadioButton') do
412
+ wx_ctor_params :id, :label => ''
413
+ wx_ctor_params :pos, :size, :style => 0
414
+ wx_ctor_params :validator, :name => 'radioButton'
415
+ end
416
+
417
+ # wxSlider A slider that can be dragged by the user
418
+ Wx::define_keyword_ctors('Slider') do
419
+ wx_ctor_params :id, :value => 0
420
+ wx_ctor_params :min_value, :max_value
421
+ wx_ctor_params :pos, :size, :style => Wx::SL_HORIZONTAL
422
+ wx_ctor_params :validator, :name => 'slider'
423
+ end
424
+
425
+ # wxSpinButton - Has two small up and down (or left and right) arrow buttons
426
+ Wx::define_keyword_ctors('SpinButton') do
427
+ wx_ctor_params :id, :pos, :size, :style => Wx::SP_HORIZONTAL
428
+ wx_ctor_params :name => 'spinButton'
429
+ end
430
+
431
+ # wxScrollBar - standalone scrollbar with arrows and thumb
432
+ Wx::define_keyword_ctors('ScrollBar') do
433
+ wx_ctor_params :id, :pos, :size, :style => Wx::SB_HORIZONTAL
434
+ wx_ctor_params :validator, :name => 'scrollBar'
435
+ end
436
+
437
+
438
+ # wxVListBox A listbox supporting variable height rows
439
+
440
+ # wxTextCtrl Single or multiline text editing control
441
+ Wx::define_keyword_ctors('TextCtrl') do
442
+ wx_ctor_params :id, :value => ''
443
+ wx_ctor_params :pos, :size, :style
444
+ wx_ctor_params :validator, :name => 'textCtrl'
445
+ end
446
+
447
+ # wxHtmlWindow - Control for displaying HTML
448
+ Wx::define_keyword_ctors('HtmlWindow') do
449
+ wx_ctor_params :id, :pos, :size, :style => Wx::HW_DEFAULT_STYLE
450
+ wx_ctor_params :name => 'htmlWindow'
451
+ end
452
+
453
+ # wxHyperTextCtrl - display a clickable URL
454
+ Wx::define_keyword_ctors('HyperlinkCtrl') do
455
+ wx_ctor_params :id, :label => ''
456
+ wx_ctor_params :url => ''
457
+ wx_ctor_params :pos, :size, :style => 0
458
+ wx_ctor_params :name => 'hyperlink'
459
+ end
460
+
461
+ Wx::define_keyword_ctors('StyledTextCtrl') do
462
+ wx_ctor_params :id, :pos, :size, :style => 0
463
+ wx_ctor_params :name => 'styledTextCtrl'
464
+ end
465
+
466
+
467
+ Wx::define_keyword_ctors('CollapsiblePane') do
468
+ wx_ctor_params :id, :label => ''
469
+ wx_ctor_params :pos, :size, :style => 0
470
+ wx_ctor_params :validator, :name => 'collapsiblePane'
471
+ end
472
+
473
+ Wx::define_keyword_ctors('MediaCtrl') do
474
+ wx_ctor_params :id, :filename => ''
475
+ wx_ctor_params :pos, :size, :style => 0
476
+ wx_ctor_params :backend => ''
477
+ wx_ctor_params :validator, :name => 'mediaCtrl'
478
+ end
479
+
480
+ Wx::define_keyword_ctors('SearchCtrl') do
481
+ wx_ctor_params :id, :value => ''
482
+ wx_ctor_params :pos, :size, :style => 0
483
+ wx_ctor_params :validator, :name => 'searchCtrl'
484
+ end
485
+
486
+
487
+ Wx::define_keyword_ctors('AnimationCtrl') do
488
+ wx_ctor_params :id, :anim
489
+ wx_ctor_params :pos, :size, :style => Wx::AC_DEFAULT_STYLE
490
+ wx_ctor_params :name => 'animationCtrl'
491
+ end
492
+
data/lib/wx/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module Wx
2
+ WXRUBY_VERSION = '1.9.6'
3
+ end
data/lib/wx.rb ADDED
@@ -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
+
data/lib/wxruby2.so ADDED
Binary file
@@ -0,0 +1,18 @@
1
+ wxRuby2 Sample Code
2
+ Copyright (c) 2004-2006 Kevin B. Smith
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software, to deal in the Software without restriction,
6
+ including without limitation the rights to use, copy, modify, merge,
7
+ publish, distribute, sublicense, and/or sell copies of any portion of
8
+ this Software, and to permit persons to whom the Software is furnished
9
+ to do so. This copyright notice need not be retained in any derived
10
+ work.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
16
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.