rwx 0.0.1.dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +49 -0
  3. data/COPYING +0 -0
  4. data/README.rdoc +0 -0
  5. data/Rakefile +100 -0
  6. data/VERSION +1 -0
  7. data/ext/extconf.rb +112 -0
  8. data/ext/main.cpp +432 -0
  9. data/ext/main.hpp +454 -0
  10. data/ext/rwx.cpp +472 -0
  11. data/ext/wxAboutDlg.cpp +213 -0
  12. data/ext/wxAboutDlg.hpp +19 -0
  13. data/ext/wxAnyButton.cpp +141 -0
  14. data/ext/wxAnyButton.hpp +17 -0
  15. data/ext/wxAnyChoiceDialog.cpp +93 -0
  16. data/ext/wxAnyChoiceDialog.hpp +19 -0
  17. data/ext/wxApp.cpp +205 -0
  18. data/ext/wxApp.hpp +48 -0
  19. data/ext/wxAui.hpp +19 -0
  20. data/ext/wxAuiBook.cpp +453 -0
  21. data/ext/wxAuiBook.hpp +21 -0
  22. data/ext/wxAuiManager.cpp +79 -0
  23. data/ext/wxAuiManager.hpp +18 -0
  24. data/ext/wxAuiPane.cpp +343 -0
  25. data/ext/wxAuiPane.hpp +29 -0
  26. data/ext/wxAuiToolBar.cpp +47 -0
  27. data/ext/wxAuiToolBar.hpp +17 -0
  28. data/ext/wxBitmap.cpp +368 -0
  29. data/ext/wxBitmap.hpp +60 -0
  30. data/ext/wxBitmapButton.cpp +82 -0
  31. data/ext/wxBitmapButton.hpp +17 -0
  32. data/ext/wxBitmapComboBox.cpp +284 -0
  33. data/ext/wxBitmapComboBox.hpp +22 -0
  34. data/ext/wxBitmapToggleButton.cpp +82 -0
  35. data/ext/wxBitmapToggleButton.hpp +17 -0
  36. data/ext/wxBookCtrl.cpp +633 -0
  37. data/ext/wxBookCtrl.hpp +22 -0
  38. data/ext/wxBoxSizer.cpp +60 -0
  39. data/ext/wxBoxSizer.hpp +17 -0
  40. data/ext/wxBrush.cpp +281 -0
  41. data/ext/wxBrush.hpp +28 -0
  42. data/ext/wxButton.cpp +85 -0
  43. data/ext/wxButton.hpp +17 -0
  44. data/ext/wxButtonToolBar.cpp +54 -0
  45. data/ext/wxButtonToolBar.hpp +21 -0
  46. data/ext/wxCalendarCtrl.cpp +91 -0
  47. data/ext/wxCalendarCtrl.hpp +17 -0
  48. data/ext/wxCalendarCtrlBase.cpp +55 -0
  49. data/ext/wxCalendarCtrlBase.hpp +26 -0
  50. data/ext/wxCalendarCtrlGeneric.cpp +102 -0
  51. data/ext/wxCalendarCtrlGeneric.hpp +21 -0
  52. data/ext/wxCheckBox.cpp +157 -0
  53. data/ext/wxCheckBox.hpp +17 -0
  54. data/ext/wxCheckListBox.cpp +191 -0
  55. data/ext/wxCheckListBox.hpp +20 -0
  56. data/ext/wxChoice.cpp +133 -0
  57. data/ext/wxChoice.hpp +30 -0
  58. data/ext/wxChoiceBook.cpp +90 -0
  59. data/ext/wxChoiceBook.hpp +23 -0
  60. data/ext/wxCollapsiblePane.cpp +110 -0
  61. data/ext/wxCollapsiblePane.hpp +21 -0
  62. data/ext/wxColor.cpp +435 -0
  63. data/ext/wxColor.hpp +38 -0
  64. data/ext/wxColorDialog.cpp +97 -0
  65. data/ext/wxColorDialog.hpp +19 -0
  66. data/ext/wxColorPicker.cpp +131 -0
  67. data/ext/wxColorPicker.hpp +20 -0
  68. data/ext/wxColorPickerWidget.cpp +105 -0
  69. data/ext/wxColorPickerWidget.hpp +20 -0
  70. data/ext/wxComboBox.cpp +214 -0
  71. data/ext/wxComboBox.hpp +22 -0
  72. data/ext/wxCommandEvent.cpp +45 -0
  73. data/ext/wxCommandEvent.hpp +16 -0
  74. data/ext/wxConfig.cpp +19 -0
  75. data/ext/wxConfig.hpp +17 -0
  76. data/ext/wxContextHelpButton.cpp +93 -0
  77. data/ext/wxContextHelpButton.hpp +21 -0
  78. data/ext/wxControl.cpp +90 -0
  79. data/ext/wxControl.hpp +15 -0
  80. data/ext/wxCursor.cpp +108 -0
  81. data/ext/wxCursor.hpp +25 -0
  82. data/ext/wxDC.cpp +252 -0
  83. data/ext/wxDC.hpp +18 -0
  84. data/ext/wxDataView.cpp +224 -0
  85. data/ext/wxDataView.hpp +45 -0
  86. data/ext/wxDataViewList.cpp +190 -0
  87. data/ext/wxDataViewList.hpp +17 -0
  88. data/ext/wxDatePicker.cpp +103 -0
  89. data/ext/wxDatePicker.hpp +22 -0
  90. data/ext/wxDialog.cpp +120 -0
  91. data/ext/wxDialog.hpp +17 -0
  92. data/ext/wxDirDialog.cpp +152 -0
  93. data/ext/wxDirDialog.hpp +20 -0
  94. data/ext/wxDirPicker.cpp +134 -0
  95. data/ext/wxDirPicker.hpp +28 -0
  96. data/ext/wxDirPickerWidget.cpp +127 -0
  97. data/ext/wxDirPickerWidget.hpp +20 -0
  98. data/ext/wxError.cpp +67 -0
  99. data/ext/wxError.hpp +17 -0
  100. data/ext/wxEvent.cpp +60 -0
  101. data/ext/wxEvent.hpp +17 -0
  102. data/ext/wxEvtHandler.cpp +291 -0
  103. data/ext/wxEvtHandler.hpp +85 -0
  104. data/ext/wxFileCtrl.cpp +98 -0
  105. data/ext/wxFileCtrl.hpp +17 -0
  106. data/ext/wxFileCtrlBase.cpp +219 -0
  107. data/ext/wxFileCtrlBase.hpp +33 -0
  108. data/ext/wxFileCtrlGeneric.cpp +106 -0
  109. data/ext/wxFileCtrlGeneric.hpp +19 -0
  110. data/ext/wxFileDialog.cpp +268 -0
  111. data/ext/wxFileDialog.hpp +19 -0
  112. data/ext/wxFileDirPicker.cpp +89 -0
  113. data/ext/wxFileDirPicker.hpp +29 -0
  114. data/ext/wxFileHistory.cpp +134 -0
  115. data/ext/wxFileHistory.hpp +20 -0
  116. data/ext/wxFilePicker.cpp +160 -0
  117. data/ext/wxFilePicker.hpp +28 -0
  118. data/ext/wxFilePickerWidget.cpp +139 -0
  119. data/ext/wxFilePickerWidget.hpp +20 -0
  120. data/ext/wxFont.cpp +542 -0
  121. data/ext/wxFont.hpp +37 -0
  122. data/ext/wxFontDialog.cpp +143 -0
  123. data/ext/wxFontDialog.hpp +21 -0
  124. data/ext/wxFontPicker.cpp +160 -0
  125. data/ext/wxFontPicker.hpp +21 -0
  126. data/ext/wxFontPickerWidget.cpp +128 -0
  127. data/ext/wxFontPickerWidget.hpp +20 -0
  128. data/ext/wxFrame.cpp +274 -0
  129. data/ext/wxFrame.hpp +17 -0
  130. data/ext/wxGauge.cpp +167 -0
  131. data/ext/wxGauge.hpp +17 -0
  132. data/ext/wxGrid.cpp +250 -0
  133. data/ext/wxGrid.hpp +43 -0
  134. data/ext/wxGridCellAttr.cpp +68 -0
  135. data/ext/wxGridCellAttr.hpp +26 -0
  136. data/ext/wxGridCellRenderer.cpp +120 -0
  137. data/ext/wxGridCellRenderer.hpp +30 -0
  138. data/ext/wxGridTable.cpp +111 -0
  139. data/ext/wxGridTable.hpp +47 -0
  140. data/ext/wxHyperLink.cpp +148 -0
  141. data/ext/wxHyperLink.hpp +20 -0
  142. data/ext/wxImage.cpp +884 -0
  143. data/ext/wxImage.hpp +24 -0
  144. data/ext/wxInfoBar.cpp +85 -0
  145. data/ext/wxInfoBar.hpp +21 -0
  146. data/ext/wxInfoBarBase.cpp +145 -0
  147. data/ext/wxInfoBarBase.hpp +21 -0
  148. data/ext/wxInfoBarGeneric.cpp +90 -0
  149. data/ext/wxInfoBarGeneric.hpp +21 -0
  150. data/ext/wxItemContainer.cpp +313 -0
  151. data/ext/wxItemContainer.hpp +17 -0
  152. data/ext/wxKeyEvent.cpp +35 -0
  153. data/ext/wxKeyEvent.hpp +16 -0
  154. data/ext/wxListBook.cpp +90 -0
  155. data/ext/wxListBook.hpp +21 -0
  156. data/ext/wxListBox.cpp +290 -0
  157. data/ext/wxListBox.hpp +29 -0
  158. data/ext/wxMenu.cpp +600 -0
  159. data/ext/wxMenu.hpp +17 -0
  160. data/ext/wxMenuBar.cpp +180 -0
  161. data/ext/wxMenuBar.hpp +17 -0
  162. data/ext/wxMenuItem.cpp +174 -0
  163. data/ext/wxMenuItem.hpp +17 -0
  164. data/ext/wxMessageDialog.cpp +91 -0
  165. data/ext/wxMessageDialog.hpp +19 -0
  166. data/ext/wxMessageDialogBase.cpp +152 -0
  167. data/ext/wxMessageDialogBase.hpp +18 -0
  168. data/ext/wxMessageDialogGeneric.cpp +91 -0
  169. data/ext/wxMessageDialogGeneric.hpp +19 -0
  170. data/ext/wxMouseEvent.cpp +60 -0
  171. data/ext/wxMouseEvent.hpp +16 -0
  172. data/ext/wxMultiChoiceDialog.cpp +143 -0
  173. data/ext/wxMultiChoiceDialog.hpp +19 -0
  174. data/ext/wxNoteBook.cpp +89 -0
  175. data/ext/wxNoteBook.hpp +21 -0
  176. data/ext/wxNotifyEvent.cpp +45 -0
  177. data/ext/wxNotifyEvent.hpp +16 -0
  178. data/ext/wxNumberEntryDialog.cpp +131 -0
  179. data/ext/wxNumberEntryDialog.hpp +20 -0
  180. data/ext/wxPalette.cpp +214 -0
  181. data/ext/wxPalette.hpp +24 -0
  182. data/ext/wxPanel.cpp +77 -0
  183. data/ext/wxPanel.hpp +19 -0
  184. data/ext/wxPasswordEntryDialog.cpp +141 -0
  185. data/ext/wxPasswordEntryDialog.hpp +20 -0
  186. data/ext/wxPen.cpp +323 -0
  187. data/ext/wxPen.hpp +37 -0
  188. data/ext/wxPickerBase.cpp +121 -0
  189. data/ext/wxPickerBase.hpp +28 -0
  190. data/ext/wxPoint.cpp +224 -0
  191. data/ext/wxPoint.hpp +40 -0
  192. data/ext/wxPreferences.cpp +149 -0
  193. data/ext/wxPreferences.hpp +18 -0
  194. data/ext/wxProgressDialog.cpp +171 -0
  195. data/ext/wxProgressDialog.hpp +20 -0
  196. data/ext/wxProperty.cpp +723 -0
  197. data/ext/wxProperty.hpp +16 -0
  198. data/ext/wxPropertyCell.cpp +99 -0
  199. data/ext/wxPropertyCell.hpp +16 -0
  200. data/ext/wxPropertyGrid.cpp +234 -0
  201. data/ext/wxPropertyGrid.hpp +20 -0
  202. data/ext/wxPropertyGridInterface.cpp +146 -0
  203. data/ext/wxPropertyGridInterface.hpp +33 -0
  204. data/ext/wxPropertyGridManager.cpp +257 -0
  205. data/ext/wxPropertyGridManager.hpp +20 -0
  206. data/ext/wxPropertyGridPage.cpp +65 -0
  207. data/ext/wxPropertyGridPage.hpp +20 -0
  208. data/ext/wxRadioBox.cpp +405 -0
  209. data/ext/wxRadioBox.hpp +20 -0
  210. data/ext/wxRadioButton.cpp +107 -0
  211. data/ext/wxRadioButton.hpp +16 -0
  212. data/ext/wxRearrangeCtrl.cpp +89 -0
  213. data/ext/wxRearrangeCtrl.hpp +20 -0
  214. data/ext/wxRearrangeDialog.cpp +122 -0
  215. data/ext/wxRearrangeDialog.hpp +20 -0
  216. data/ext/wxRearrangeList.cpp +94 -0
  217. data/ext/wxRearrangeList.hpp +20 -0
  218. data/ext/wxRect.cpp +281 -0
  219. data/ext/wxRect.hpp +29 -0
  220. data/ext/wxRichMessageDialog.cpp +91 -0
  221. data/ext/wxRichMessageDialog.hpp +21 -0
  222. data/ext/wxRichTextAttr.cpp +69 -0
  223. data/ext/wxRichTextAttr.hpp +28 -0
  224. data/ext/wxRichTextCtrl.cpp +484 -0
  225. data/ext/wxRichTextCtrl.hpp +21 -0
  226. data/ext/wxRichTextStyle.cpp +86 -0
  227. data/ext/wxRichTextStyle.hpp +25 -0
  228. data/ext/wxRichTextStyleSheet.cpp +497 -0
  229. data/ext/wxRichTextStyleSheet.hpp +21 -0
  230. data/ext/wxSTC.cpp +331 -0
  231. data/ext/wxSTC.hpp +21 -0
  232. data/ext/wxScrollEvent.cpp +43 -0
  233. data/ext/wxScrollEvent.hpp +16 -0
  234. data/ext/wxSearchCtrl.cpp +189 -0
  235. data/ext/wxSearchCtrl.hpp +21 -0
  236. data/ext/wxSimpleBook.cpp +89 -0
  237. data/ext/wxSimpleBook.hpp +21 -0
  238. data/ext/wxSingleChoiceDialog.cpp +147 -0
  239. data/ext/wxSingleChoiceDialog.hpp +19 -0
  240. data/ext/wxSize.cpp +206 -0
  241. data/ext/wxSize.hpp +32 -0
  242. data/ext/wxSizer.cpp +368 -0
  243. data/ext/wxSizer.hpp +23 -0
  244. data/ext/wxSizerItem.cpp +37 -0
  245. data/ext/wxSizerItem.hpp +18 -0
  246. data/ext/wxSlider.cpp +204 -0
  247. data/ext/wxSlider.hpp +21 -0
  248. data/ext/wxSpinButton.cpp +158 -0
  249. data/ext/wxSpinButton.hpp +20 -0
  250. data/ext/wxSpinCtrl.cpp +132 -0
  251. data/ext/wxSpinCtrl.hpp +21 -0
  252. data/ext/wxStartUpTip.cpp +44 -0
  253. data/ext/wxStartUpTip.hpp +16 -0
  254. data/ext/wxStaticBitmap.cpp +79 -0
  255. data/ext/wxStaticBitmap.hpp +17 -0
  256. data/ext/wxStaticBitmapBase.cpp +46 -0
  257. data/ext/wxStaticBitmapBase.hpp +22 -0
  258. data/ext/wxStaticBitmapGeneric.cpp +82 -0
  259. data/ext/wxStaticBitmapGeneric.hpp +17 -0
  260. data/ext/wxStaticBox.cpp +92 -0
  261. data/ext/wxStaticBox.hpp +22 -0
  262. data/ext/wxStaticLine.cpp +100 -0
  263. data/ext/wxStaticLine.hpp +22 -0
  264. data/ext/wxStaticText.cpp +82 -0
  265. data/ext/wxStaticText.hpp +21 -0
  266. data/ext/wxStatusBar.cpp +417 -0
  267. data/ext/wxStatusBar.hpp +17 -0
  268. data/ext/wxStream.cpp +41 -0
  269. data/ext/wxStream.hpp +46 -0
  270. data/ext/wxTaskBar.cpp +104 -0
  271. data/ext/wxTaskBar.hpp +41 -0
  272. data/ext/wxTextArea.cpp +141 -0
  273. data/ext/wxTextArea.hpp +21 -0
  274. data/ext/wxTextAttr.cpp +320 -0
  275. data/ext/wxTextAttr.hpp +28 -0
  276. data/ext/wxTextCtrl.cpp +177 -0
  277. data/ext/wxTextCtrl.hpp +30 -0
  278. data/ext/wxTextEntry.cpp +248 -0
  279. data/ext/wxTextEntry.hpp +19 -0
  280. data/ext/wxTextEntryDialog.cpp +133 -0
  281. data/ext/wxTextEntryDialog.hpp +20 -0
  282. data/ext/wxTimePicker.cpp +105 -0
  283. data/ext/wxTimePicker.hpp +22 -0
  284. data/ext/wxTimer.cpp +106 -0
  285. data/ext/wxTimer.hpp +16 -0
  286. data/ext/wxToggleButton.cpp +96 -0
  287. data/ext/wxToggleButton.hpp +21 -0
  288. data/ext/wxToolBar.cpp +85 -0
  289. data/ext/wxToolBar.hpp +17 -0
  290. data/ext/wxToolBarBase.cpp +615 -0
  291. data/ext/wxToolBarBase.hpp +17 -0
  292. data/ext/wxToolBarTool.cpp +179 -0
  293. data/ext/wxToolBarTool.hpp +16 -0
  294. data/ext/wxToolBook.cpp +96 -0
  295. data/ext/wxToolBook.hpp +23 -0
  296. data/ext/wxToplevel.cpp +125 -0
  297. data/ext/wxToplevel.hpp +25 -0
  298. data/ext/wxTreeBook.cpp +240 -0
  299. data/ext/wxTreeBook.hpp +21 -0
  300. data/ext/wxTreeCtrl.cpp +443 -0
  301. data/ext/wxTreeCtrl.hpp +66 -0
  302. data/ext/wxVariant.cpp +65 -0
  303. data/ext/wxVariant.hpp +17 -0
  304. data/ext/wxWindow.cpp +980 -0
  305. data/ext/wxWindow.hpp +35 -0
  306. data/ext/wxWizard.cpp +321 -0
  307. data/ext/wxWizard.hpp +19 -0
  308. data/ext/wxWizardPage.cpp +137 -0
  309. data/ext/wxWizardPage.hpp +38 -0
  310. data/ext/wxXRC.cpp +48 -0
  311. data/ext/wxXRC.hpp +21 -0
  312. data/old_tests/button.rb +56 -0
  313. data/old_tests/file.png +0 -0
  314. data/old_tests/green.xpm +25 -0
  315. data/old_tests/new16x16.png +0 -0
  316. data/old_tests/project.xml +10 -0
  317. data/old_tests/propertygrid.rb +51 -0
  318. data/old_tests/red.xpm +25 -0
  319. data/old_tests/ruby32x32.png +0 -0
  320. data/old_tests/status.rb +45 -0
  321. data/old_tests/test.rb +580 -0
  322. data/old_tests/wizard.xrc +40 -0
  323. data/old_tests/xrc.rb +38 -0
  324. data/rwx.gemspec +43 -0
  325. data/samples/controls/controls.rb +143 -0
  326. data/samples/controls/icons/choice.bmp +0 -0
  327. data/samples/controls/icons/choice.xpm +27 -0
  328. data/samples/controls/icons/combo.bmp +0 -0
  329. data/samples/controls/icons/combo.xpm +27 -0
  330. data/samples/controls/icons/gauge.bmp +0 -0
  331. data/samples/controls/icons/gauge.xpm +27 -0
  332. data/samples/controls/icons/list.bmp +0 -0
  333. data/samples/controls/icons/list.xpm +27 -0
  334. data/samples/controls/icons/radio.bmp +0 -0
  335. data/samples/controls/icons/radio.xpm +27 -0
  336. data/samples/controls/icons/stattext.xpm +24 -0
  337. data/samples/controls/icons/text.bmp +0 -0
  338. data/samples/controls/icons/text.xpm +27 -0
  339. data/samples/dialog/dialog_sample.rb +227 -0
  340. data/samples/sample.xpm +44 -0
  341. data/samples/widgets/icons/bmpbtn.xpm +37 -0
  342. data/samples/widgets/icons/bmpcombobox.xpm +54 -0
  343. data/samples/widgets/icons/button.xpm +54 -0
  344. data/samples/widgets/icons/checkbox.xpm +54 -0
  345. data/samples/widgets/icons/choice.xpm +27 -0
  346. data/samples/widgets/icons/choicebk.xpm +54 -0
  347. data/samples/widgets/icons/clrpicker.xpm +193 -0
  348. data/samples/widgets/icons/combobox.xpm +54 -0
  349. data/samples/widgets/icons/datepick.xpm +200 -0
  350. data/samples/widgets/icons/dirctrl.xpm +54 -0
  351. data/samples/widgets/icons/dirpicker.xpm +213 -0
  352. data/samples/widgets/icons/filepicker.xpm +214 -0
  353. data/samples/widgets/icons/fontpicker.xpm +185 -0
  354. data/samples/widgets/icons/gauge.xpm +54 -0
  355. data/samples/widgets/icons/hyperlnk.xpm +54 -0
  356. data/samples/widgets/icons/listbook.xpm +54 -0
  357. data/samples/widgets/icons/listbox.xpm +54 -0
  358. data/samples/widgets/icons/notebook.xpm +54 -0
  359. data/samples/widgets/icons/odcombobox.xpm +54 -0
  360. data/samples/widgets/icons/radiobox.xpm +54 -0
  361. data/samples/widgets/icons/scrolbar.xpm +54 -0
  362. data/samples/widgets/icons/slider.xpm +54 -0
  363. data/samples/widgets/icons/spinbtn.xpm +40 -0
  364. data/samples/widgets/icons/statbmp.xpm +40 -0
  365. data/samples/widgets/icons/statbox.xpm +54 -0
  366. data/samples/widgets/icons/stattext.xpm +54 -0
  367. data/samples/widgets/icons/text.xpm +54 -0
  368. data/samples/widgets/icons/timepick.xpm +207 -0
  369. data/samples/widgets/icons/toggle.xpm +54 -0
  370. data/samples/widgets/pages/colorpicker.rb +66 -0
  371. data/samples/widgets/pages/common.rb +17 -0
  372. data/samples/widgets/widgets.rb +29 -0
  373. data/samples/xrc/samples.xrc +46 -0
  374. data/samples/xrc/xrc_sample.rb +59 -0
  375. data/test/test_color.rb +64 -0
  376. metadata +470 -0
@@ -0,0 +1,66 @@
1
+ /*
2
+ * wxTreeCtrl.hpp
3
+ *
4
+ * Created on: 12.03.2012
5
+ * Author: hanmac
6
+ */
7
+
8
+ #ifndef WXTREECTRL_HPP_
9
+ #define WXTREECTRL_HPP_
10
+
11
+ #include "wxControl.hpp"
12
+
13
+ extern VALUE rb_cWXTreeCtrl;
14
+
15
+ void Init_WXTreeCtrl(VALUE rb_mWX);
16
+ #if wxUSE_TREECTRL
17
+ #include <wx/treectrl.h>
18
+
19
+ class RubyTreeCtrlItem : public wxTreeItemData
20
+ {
21
+ public:
22
+ RubyTreeCtrlItem(wxTreeCtrl* tree,wxTreeItemId id);
23
+
24
+ ~RubyTreeCtrlItem();
25
+ VALUE getRuby(){ return mRuby; }
26
+
27
+ bool GetBold();
28
+ wxString GetText();
29
+ wxColour GetTextColour();
30
+ wxColour GetBackgroundColour();
31
+ wxFont GetFont();
32
+ int GetState();
33
+
34
+ void SetBold(const bool bold);
35
+ void SetText(const wxString& text);
36
+ void SetTextColour(const wxColour& col);
37
+ void SetBackgroundColour(const wxColour& col);
38
+ void SetFont(const wxFont& font);
39
+ void SetState(int state);
40
+
41
+ VALUE AppendItem(const wxString& text, int image = -1, int selImage = -1);
42
+ VALUE PrependItem(const wxString& text, int image = -1, int selImage = -1);
43
+
44
+ VALUE GetNextSibling();
45
+ VALUE GetPrevSibling();
46
+
47
+ void Delete();
48
+
49
+ void each();
50
+ VALUE compare(RubyTreeCtrlItem *other);
51
+
52
+ // wxTreeCtrl* getTree();
53
+ private:
54
+ void checkDestroyed();
55
+ VALUE mRuby;
56
+ wxTreeCtrl* mTree;
57
+
58
+ };
59
+
60
+ template <>
61
+ wxTreeItemId unwrap< wxTreeItemId >(const VALUE &vwindow);
62
+
63
+ VALUE wrap(wxTreeCtrl* tree, wxTreeItemId id);
64
+
65
+ #endif
66
+ #endif /* WXTREECTRL_HPP_ */
@@ -0,0 +1,65 @@
1
+ /*
2
+ * wxVariant.cpp
3
+ *
4
+ * Created on: 08.05.2012
5
+ * Author: hanmac
6
+ */
7
+ #include "wxVariant.hpp"
8
+ #include "wxDataView.hpp"
9
+ #include "wxFont.hpp"
10
+ template <>
11
+ VALUE wrap< wxVariant >(const wxVariant &var)
12
+ {
13
+ wxString type = var.GetType();
14
+ if(type == "null")
15
+ return Qnil;
16
+ if(type == "bool")
17
+ return wrap(var.GetBool());
18
+ else if(type == "string")
19
+ return wrap(var.GetString());
20
+
21
+ else if(type == "arrstring")
22
+ return wrap(var.GetArrayString());
23
+ else if(type == "long")
24
+ return LONG2NUM(var.GetLong());
25
+ else if(type == "wxFont")
26
+ return wrap((wxFont)var);
27
+ else if(type == "wxBitmap")
28
+ return wrap((wxBitmap)var);
29
+ else if(type == "wxIcon")
30
+ return wrap((wxIcon)var);
31
+ else
32
+ std::cout << "unknown VariantType: " << type << std::endl;
33
+ return Qnil;
34
+ }
35
+
36
+ wxVariant unwrapVariant(VALUE obj,const wxString &type)
37
+ {
38
+ wxVariant result;
39
+ if(type == "string")
40
+ result = unwrap<wxString>(obj);
41
+ else if(type == "arrstring")
42
+ result = unwrap<wxArrayString>(obj);
43
+ else if(type == "bool")
44
+ result = RTEST(obj);
45
+ else if(type == "long")
46
+ result = NUM2LONG(obj);
47
+ else if(type == "wxFont")
48
+ result = wxVariant(unwrap<wxFont>(obj));
49
+ #if wxUSE_DATAVIEWCTRL
50
+ else if(type == "wxDataViewIconText")
51
+ {
52
+ result = wxVariant(wxDataViewIconText(wxEmptyString,unwrap<wxIcon>(obj)));
53
+ }
54
+ #endif
55
+ else if(type == "wxBitmap")
56
+ result = wxVariant(unwrap<wxBitmap>(obj));
57
+ else if(type == "wxIcon")
58
+ result = wxVariant(unwrap<wxIcon>(obj));
59
+ else
60
+ std::cout << "unknown VariantType: " << type << std::endl;
61
+ return result;
62
+ }
63
+
64
+
65
+
@@ -0,0 +1,17 @@
1
+ /*
2
+ * wxVariant.hpp
3
+ *
4
+ * Created on: 08.05.2012
5
+ * Author: hanmac
6
+ */
7
+
8
+ #ifndef WXVARIANT_HPP_
9
+ #define WXVARIANT_HPP_
10
+
11
+ #include "main.hpp"
12
+
13
+ template <>
14
+ VALUE wrap< wxVariant >(const wxVariant &window);
15
+ wxVariant unwrapVariant(VALUE obj,const wxString &type);
16
+
17
+ #endif /* WXVARIANT_HPP_ */
@@ -0,0 +1,980 @@
1
+ /*
2
+ * wxWindow.cpp
3
+ *
4
+ * Created on: 04.02.2012
5
+ * Author: hanmac
6
+ */
7
+ #include "wxWindow.hpp"
8
+ #include "wxEvtHandler.hpp"
9
+ #include "wxProgressDialog.hpp"
10
+ #include "wxFont.hpp"
11
+ #include "wxColor.hpp"
12
+ #include "wxSizer.hpp"
13
+ #include "wxPoint.hpp"
14
+ #include "wxRect.hpp"
15
+ #include "wxDC.hpp"
16
+
17
+ #include "wxCursor.hpp"
18
+
19
+ #include "wxApp.hpp"
20
+
21
+ #include "wxAui.hpp"
22
+
23
+ #include <sstream>
24
+
25
+ #ifdef __WXGTK__
26
+ #include <gdk/gdk.h>
27
+ #include <gtk/gtk.h>
28
+ #include <gdk/gdkx.h>
29
+ #include <GL/glx.h>
30
+ #endif
31
+
32
+ #define _self unwrap<wxWindow*>(self)
33
+
34
+ VALUE rb_cWXWindow;
35
+
36
+ static std::map<ID,wxWindowID> idholder;
37
+
38
+ VALUE wrapID(wxWindowID val)
39
+ {
40
+ if(val == wxID_NONE)
41
+ return Qnil;
42
+
43
+ for(std::map<ID,wxWindowID>::const_iterator it = idholder.begin();
44
+ it != idholder.end();
45
+ it++)
46
+ {
47
+ if(it->second == val)
48
+ return ID2SYM(it->first);
49
+ }
50
+ #if wxUSE_XRC
51
+ wxString str(wxXmlResource::FindXRCIDById(val));
52
+ if(!str.IsEmpty()) {
53
+ ID id = rb_intern(str.c_str());
54
+ idholder.insert(std::make_pair(id,val));
55
+ return ID2SYM(id);
56
+ }
57
+ #endif
58
+ return INT2NUM(val);
59
+ }
60
+
61
+ wxWindowID unwrapID(const VALUE &val)
62
+ {
63
+ if(NIL_P(val))
64
+ return wxID_ANY;
65
+ if(SYMBOL_P(val))
66
+ {
67
+ ID id = SYM2ID(val);
68
+ std::map<ID,wxWindowID>::iterator it = idholder.find(id);
69
+ if(it != idholder.end())
70
+ return it->second;
71
+ else
72
+ {
73
+ wxWindowID newid;
74
+ #if wxUSE_XRC
75
+ newid = XRCID(rb_id2name(id));
76
+ #else
77
+ newid = wxNewId();
78
+ #endif
79
+ idholder.insert(std::make_pair(id,newid));
80
+ return newid;
81
+ }
82
+ }else
83
+ return NUM2INT(val);
84
+ }
85
+
86
+ void registerID(const char *name,wxWindowID id)
87
+ {
88
+ idholder.insert(std::make_pair(rb_intern(name),id));
89
+ }
90
+
91
+ #if wxUSE_TOOLTIPS
92
+
93
+ template <>
94
+ VALUE wrap< wxToolTip >(wxToolTip* window)
95
+ {
96
+ if(window)
97
+ return wrap(window->GetTip());
98
+ return Qnil;
99
+ }
100
+
101
+ template <>
102
+ wxToolTip* unwrap< wxToolTip* >(const VALUE &vwindow)
103
+ {
104
+ if(NIL_P(vwindow))
105
+ return NULL;
106
+ return new wxToolTip(unwrap<wxString>(vwindow));
107
+ }
108
+ #endif
109
+
110
+ namespace RubyWX {
111
+ namespace Window {
112
+
113
+ macro_attr(Label,wxString)
114
+ macro_attr(Name,wxString)
115
+ macro_attr_enum(WindowVariant,wxWindowVariant)
116
+ macro_attr_enum(LayoutDirection,wxLayoutDirection)
117
+
118
+ macro_attr_with_func(Id,wrapID,unwrapID)
119
+
120
+ macro_attr(Position,wxPoint)
121
+
122
+ macro_attr(Size,wxSize)
123
+ macro_attr(VirtualSize,wxSize)
124
+
125
+ macro_attr(ClientSize,wxSize)
126
+
127
+ macro_attr(MinSize,wxSize)
128
+ macro_attr(MinClientSize,wxSize)
129
+
130
+ macro_attr(MaxSize,wxSize)
131
+ macro_attr(MaxClientSize,wxSize)
132
+
133
+ macro_attr_enum(BackgroundStyle,wxBackgroundStyle)
134
+
135
+ macro_attr(Font,wxFont)
136
+ macro_attr(Cursor,wxCursor)
137
+
138
+ macro_attr_with_func(WindowStyleFlag,LONG2NUM,NUM2LONG)
139
+ macro_attr_with_func(ExtraStyle,LONG2NUM,NUM2LONG)
140
+
141
+ #if wxUSE_VALIDATORS
142
+ //macro_attr(Validator,wxValidator)
143
+ #endif // wxUSE_VALIDATORS
144
+ #if wxUSE_CARET
145
+ //macro_attr(Caret,wxCaret*)
146
+ #endif // wxUSE_CARET
147
+ #if wxUSE_HELP
148
+ macro_attr(HelpText,wxString)
149
+ #endif // wxUSE_HELP
150
+ #if wxUSE_TOOLTIPS
151
+ macro_attr(ToolTip,wxToolTip*)
152
+ #endif // wxUSE_TOOLTIPS
153
+ #if wxUSE_DRAG_AND_DROP
154
+ //macro_attr(DropTarget,wxDropTarget*)
155
+ #endif // wxUSE_DRAG_AND_DROP
156
+ macro_attr(AutoLayout,bool)
157
+ macro_attr(ThemeEnabled,bool)
158
+
159
+ macro_attr(Sizer,wxSizer*)
160
+ macro_attr(ContainingSizer,wxSizer*)
161
+
162
+ singlereturn_frozen(Show)
163
+ singlereturn_frozen(Hide)
164
+
165
+ singlereturn(IsShown)
166
+
167
+ singlereturn_frozen(Enable)
168
+ singlereturn_frozen(Disable)
169
+
170
+ singlereturn(IsEnabled)
171
+ singlereturn(IsThisEnabled)
172
+
173
+ singlefunc(Raise)
174
+ singlefunc(Lower)
175
+
176
+ singlefunc(Freeze)
177
+ singlefunc(Thaw)
178
+
179
+ singlereturn(IsFrozen)
180
+
181
+ singlefunc(CaptureMouse)
182
+ singlefunc(ReleaseMouse)
183
+
184
+ singlereturn(HasCapture)
185
+
186
+ singlefunc(Update)
187
+ singlefunc(Refresh)
188
+
189
+ singlereturn(HasMultiplePages)
190
+
191
+ singlefunc(Fit)
192
+ singlefunc(FitInside)
193
+ singlereturn_frozen(Layout)
194
+
195
+ singlereturn(GetParent)
196
+ singlereturn(GetGrandParent)
197
+
198
+ macro_attr(BackgroundColour,wxColour)
199
+ macro_attr(ForegroundColour,wxColour)
200
+
201
+ singlereturn_frozen(LineUp)
202
+ singlereturn_frozen(LineDown)
203
+ singlereturn_frozen(PageUp)
204
+ singlereturn_frozen(PageDown)
205
+
206
+ singlereturn_frozen(Destroy)
207
+ singlereturn_frozen(DestroyChildren)
208
+
209
+ singlereturn(IsBeingDeleted)
210
+
211
+ singlereturn(GetRect)
212
+
213
+ DLL_LOCAL VALUE _SetParent(VALUE self,VALUE parent)
214
+ {
215
+ rb_check_frozen(self);
216
+ _self->Reparent(unwrap<wxWindow*>(parent));
217
+ return parent;
218
+ }
219
+
220
+ DLL_LOCAL VALUE _SetRect(VALUE self,VALUE rect)
221
+ {
222
+ rb_check_frozen(self);
223
+ _self->SetSize(unwrap<wxRect>(rect));
224
+ return rect;
225
+ }
226
+
227
+
228
+ APP_PROTECT(wxWindow)
229
+
230
+
231
+ /*
232
+ * call-seq:
233
+ * Window.new(parent, name, [options])
234
+ * Window.new(parent, [options])
235
+ *
236
+ * creates a new Window widget.
237
+ * ===Arguments
238
+ * * parent of this window or nil
239
+ * * name is a String describing a resource in a loaded xrc
240
+ *
241
+ * * options: Hash with possible options to set:
242
+ * * name String
243
+ * * label String depends on the control what is shown
244
+ * * help_text String
245
+ * * tool_tip String
246
+ * * id Symbol or Integer
247
+ * * size WX::Size
248
+ * * position WX::Point
249
+ * * font WX::Font
250
+ * * cursor WX::Cursor
251
+ * * background_color WX::Color
252
+ * * foreground_color WX::Color
253
+ *
254
+ */
255
+ DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
256
+ {
257
+ VALUE parent,name,hash;
258
+ rb_scan_args(argc, argv, "11:",&parent,&name,&hash);
259
+ if(!_created) {
260
+ wxWindowID id(wxID_ANY);
261
+ if(rb_obj_is_kind_of(hash,rb_cHash))
262
+ set_hash_option(hash,"id",id,unwrapID);
263
+ #if wxUSE_XRC
264
+ if(!loadxrc(_self,name,unwrap<wxWindow*>(parent)))
265
+ #endif
266
+ _self->Create(unwrap<wxWindow*>(parent),id);
267
+
268
+ }
269
+
270
+ if(rb_obj_is_kind_of(hash,rb_cHash))
271
+ {
272
+ VALUE temp;
273
+ bool disabled = false;
274
+
275
+ set_option(extra_style,ExtraStyle,int)
276
+ set_option(name,Name,wxString)
277
+ set_option(label,Label,wxString)
278
+
279
+ #if wxUSE_HELP
280
+ set_option(help_text,HelpText,wxString)
281
+ #endif // wxUSE_HELP
282
+ #if wxUSE_TOOLTIPS
283
+ set_option(tool_tip,ToolTip,wxToolTip*)
284
+ #endif // wxUSE_TOOLTIPS
285
+
286
+ set_option(font,Font,wxFont)
287
+ set_option(cursor,Cursor,wxCursor)
288
+
289
+ set_option(background_color,BackgroundColour,wxColour)
290
+ set_option(foreground_color,ForegroundColour,wxColour)
291
+
292
+ set_option_func(id,Id,unwrapID)
293
+
294
+ set_option(size,Size,wxSize)
295
+ set_option(position,Position,wxPoint)
296
+
297
+ set_hash_option(hash,"disabled",disabled);
298
+ if(disabled)
299
+ _self->Disable();
300
+
301
+ }
302
+
303
+ if(rb_block_given_p())
304
+ rb_yield(self);
305
+ return self;
306
+ }
307
+
308
+ DLL_LOCAL VALUE _getchild(VALUE self,VALUE id)
309
+ {
310
+ return wrap(_self->FindWindow(unwrapID(id)));
311
+ }
312
+
313
+ DLL_LOCAL VALUE _GetHandle(VALUE self)
314
+ {
315
+ std::stringstream handleStream;
316
+ #if defined(__WXMSW__)
317
+ handleStream << (size_t)((HWND)_self->GetHandle());
318
+ #elif defined(__WXGTK__)
319
+ GtkWidget* widget = _self->GetHandle();
320
+ gtk_widget_realize( widget );
321
+ GdkWindow *window = gtk_widget_get_window(widget);
322
+ if(!window)
323
+ return Qnil;
324
+ Display* display = GDK_WINDOW_XDISPLAY( window );
325
+ if(!display)
326
+ return Qnil;
327
+ ::Window wid = GDK_WINDOW_XID(window);
328
+ // Window is a typedef for XID, which is a typedef for unsigned int
329
+ /* Get the right display (DisplayString() returns ":display.screen") */
330
+ std::string displayStr(DisplayString( display ));
331
+ displayStr = displayStr.substr( 1, ( displayStr.find( ".", 0 ) - 1 ) );
332
+ /* Put all together */
333
+ handleStream << displayStr << ':' << DefaultScreen( display ) << ':' << wid;
334
+
335
+ #endif
336
+ return wrap(wxString(handleStream.str()));
337
+ }
338
+
339
+
340
+
341
+ DLL_LOCAL VALUE _draw(int argc,VALUE *argv,VALUE self)
342
+ {
343
+ VALUE paint;
344
+ rb_scan_args(argc, argv, "01",&paint);
345
+ wxDC *dc;
346
+ if(NIL_P(paint) || RTEST(paint)) {
347
+ wxPaintDC *mdc = new wxPaintDC(_self);
348
+ _self->PrepareDC(*mdc);
349
+ #if wxUSE_GRAPHICS_CONTEXT
350
+ dc = new wxGCDC(*mdc);
351
+ _self->PrepareDC(*dc);
352
+ #else
353
+ dc = mdc;
354
+ #endif
355
+ } else {
356
+ wxClientDC *cdc = new wxClientDC(_self);
357
+ _self->PrepareDC(*cdc);
358
+ #if wxUSE_GRAPHICS_CONTEXT
359
+ dc = new wxGCDC(*cdc);
360
+ _self->PrepareDC(*dc);
361
+ #else
362
+ dc = cdc;
363
+ #endif
364
+ }
365
+
366
+ dc->Clear();
367
+ rb_yield(wrap(dc));
368
+ return self;
369
+ }
370
+
371
+ DLL_LOCAL VALUE _Close(int argc,VALUE *argv,VALUE self)
372
+ {
373
+ VALUE force;
374
+ rb_scan_args(argc, argv, "01",&force);
375
+ return wrap(_self->Close(RTEST(force)));
376
+ }
377
+
378
+ DLL_LOCAL VALUE _wxClass(VALUE self)
379
+ {
380
+ return wrap(wxString(_self->GetClassInfo()->GetClassName()));
381
+ }
382
+
383
+ DLL_LOCAL VALUE _IsDestroyed(VALUE self)
384
+ {
385
+ return wrap(RTYPEDDATA_DATA(self) == NULL);
386
+ }
387
+
388
+
389
+ #if wxUSE_MENUS
390
+ DLL_LOCAL VALUE _popupmenu(int argc,VALUE *argv,VALUE self)
391
+ {
392
+ VALUE menu,pos;
393
+ wxPoint cpoint;
394
+ if(rb_block_given_p())
395
+ {
396
+ rb_scan_args(argc, argv, "01",&pos);
397
+ menu = wrap(new wxMenu);
398
+ rb_yield(menu);
399
+ }else{
400
+ rb_scan_args(argc, argv, "11",&menu,&pos);
401
+ }
402
+ if(NIL_P(pos))
403
+ cpoint = wxDefaultPosition;
404
+ else
405
+ cpoint = unwrap<wxPoint>(pos);
406
+
407
+
408
+ return wrap(_self->PopupMenu(unwrap<wxMenu*>(menu),cpoint));
409
+ }
410
+ #endif
411
+
412
+ #if wxUSE_AUI
413
+ DLL_LOCAL VALUE _aui(VALUE self)
414
+ {
415
+ wxWindow *wnd = _self;
416
+ VALUE result = Qnil;
417
+ wxAuiManager *mgr = wxAuiManager::GetManager(wnd);
418
+ if(!mgr && rb_block_given_p())
419
+ {
420
+ result = wrap(new wxAuiManager(wnd));
421
+ }
422
+ if(rb_block_given_p())
423
+ rb_yield(result);
424
+ return result;
425
+ }
426
+ #endif
427
+
428
+ DLL_LOCAL VALUE _each_size(VALUE self)
429
+ {
430
+ return UINT2NUM(_self->GetChildren().GetCount());
431
+ }
432
+
433
+
434
+ DLL_LOCAL VALUE _each(VALUE self)
435
+ {
436
+ RETURN_SIZED_ENUMERATOR(self,0,NULL,RUBY_METHOD_FUNC(_each_size));
437
+ wxWindowList list = _self->GetChildren();
438
+ for(wxWindowList::iterator it = list.begin();it != list.end();++it)
439
+ {
440
+ rb_yield(wrap(*it));
441
+ }
442
+ return self;
443
+ }
444
+
445
+ DLL_LOCAL VALUE _GetMousePosition(VALUE self)
446
+ {
447
+ app_protected();
448
+
449
+ return wrap(wxGetMousePosition());
450
+ }
451
+
452
+ DLL_LOCAL VALUE _GetCapture(VALUE self)
453
+ {
454
+ app_protected();
455
+
456
+ return wrap(wxWindow::GetCapture());
457
+ }
458
+
459
+
460
+ DLL_LOCAL VALUE _ClientToScreen(VALUE self,VALUE point)
461
+ {
462
+ return wrap(_self->ClientToScreen(unwrap<wxPoint>(point)));
463
+ }
464
+
465
+ DLL_LOCAL VALUE _ScreenToClient(VALUE self,VALUE point)
466
+ {
467
+ return wrap(_self->ScreenToClient(unwrap<wxPoint>(point)));
468
+ }
469
+
470
+ DLL_LOCAL VALUE _ClientToWindowSize(VALUE self,VALUE point)
471
+ {
472
+ return wrap(_self->ClientToWindowSize(unwrap<wxSize>(point)));
473
+ }
474
+
475
+ DLL_LOCAL VALUE _WindowToClientSize(VALUE self,VALUE point)
476
+ {
477
+ return wrap(_self->WindowToClientSize(unwrap<wxSize>(point)));
478
+ }
479
+
480
+ }
481
+ }
482
+
483
+ /* Document-method: window_freeze
484
+ * call-seq:
485
+ * window_freeze -> self
486
+ *
487
+ * freeze the Window, frozen windows are not redrawn until they are thawed.
488
+ * ===Return value
489
+ * self
490
+ */
491
+
492
+ /* Document-method: window_thaw
493
+ * call-seq:
494
+ * window_thaw -> self
495
+ *
496
+ * thaw the Window, frozen windows are not redrawn until they are thawed.
497
+ * ===Return value
498
+ * self
499
+ */
500
+
501
+ /* Document-method: window_frozen?
502
+ * call-seq:
503
+ * window_frozen? -> true/false
504
+ *
505
+ * returns true if the Window is still frozen.
506
+ * ===Return value
507
+ * true/false
508
+ */
509
+
510
+
511
+ /* Document-method: show
512
+ * call-seq:
513
+ * show -> true/false
514
+ *
515
+ * shows the Window, returns true if the window was hidden before.
516
+ * ===Return value
517
+ * true/false
518
+ */
519
+
520
+ /* Document-method: hide
521
+ * call-seq:
522
+ * hide -> true/false
523
+ *
524
+ * hides the Window, returns true if the window was shown before.
525
+ * ===Return value
526
+ * true/false
527
+ */
528
+
529
+ /* Document-method: shown?
530
+ * call-seq:
531
+ * shown? -> true/false
532
+ *
533
+ * returns true if the window is shown.
534
+ * ===Return value
535
+ * true/false
536
+ */
537
+
538
+ /* Document-method: enable
539
+ * call-seq:
540
+ * enable -> true/false
541
+ *
542
+ * enable the Window, returns true if the window was disabled before.
543
+ * ===Return value
544
+ * true/false
545
+ */
546
+
547
+ /* Document-method: disable
548
+ * call-seq:
549
+ * disable -> true/false
550
+ *
551
+ * disable the Window, returns true if the window was enabled before.
552
+ * ===Return value
553
+ * true/false
554
+ */
555
+
556
+ /* Document-method: enabled?
557
+ * call-seq:
558
+ * enabled? -> true/false
559
+ *
560
+ * returns true if the window and parents are enabled.
561
+ * ===Return value
562
+ * true/false
563
+ */
564
+
565
+ /* Document-method: this_enabled?
566
+ * call-seq:
567
+ * this_enabled? -> true/false
568
+ *
569
+ * returns true if the window is enabled.
570
+ * ===Return value
571
+ * true/false
572
+ */
573
+
574
+
575
+ /* Document-method: line_up
576
+ * call-seq:
577
+ * line_up -> true/false
578
+ *
579
+ * scrolls this window one line up, returns true if window has changed.
580
+ * ===Return value
581
+ * true/false
582
+ */
583
+
584
+ /* Document-method: line_down
585
+ * call-seq:
586
+ * line_down -> true/false
587
+ *
588
+ * scrolls this window one line down, returns true if window has changed.
589
+ * ===Return value
590
+ * true/false
591
+ */
592
+
593
+ /* Document-method: page_up
594
+ * call-seq:
595
+ * page_up -> true/false
596
+ *
597
+ * scrolls this window one page up, returns true if window has changed.
598
+ * ===Return value
599
+ * true/false
600
+ */
601
+
602
+ /* Document-method: page_down
603
+ * call-seq:
604
+ * page_down -> true/false
605
+ *
606
+ * scrolls this window one page down, returns true if window has changed.
607
+ * ===Return value
608
+ * true/false
609
+ */
610
+
611
+ /* Document-attr: label
612
+ * the label of the Window, is mostly used for WX::Control windows. String
613
+ */
614
+ /* Document-attr: name
615
+ * the name of the Window, is not shown directly. String
616
+ */
617
+ /* Document-attr: parent
618
+ * the parent of the window, type: WX::Window or nil for no parent
619
+ */
620
+ /* Document-attr: id
621
+ * the WindowId of the Window, is Symbol for system or self defined Ids, and Integer for generated
622
+ */
623
+
624
+ /* Document-attr: background_color
625
+ * the WX::Color of the background, not all windows use them.
626
+ */
627
+ /* Document-attr: foreground_color
628
+ * the WX::Color of the foreground, not all windows use them.
629
+ */
630
+ /* Document-attr: font
631
+ * the WX::Font of the window, not all windows use them.
632
+ */
633
+ /* Document-attr: cursor
634
+ * the WX::Cursor of the window. Shown when the mouse is over this window.
635
+ */
636
+
637
+
638
+ /* Document-attr: size
639
+ * the size of this window. WX::Size
640
+ */
641
+ /* Document-attr: min_size
642
+ * the minimum size of this window. WX::Size
643
+ */
644
+ /* Document-attr: max_size
645
+ * the maximum size of this window. WX::Size
646
+ */
647
+
648
+ /* Document-attr: client_size
649
+ * the size of this window. WX::Size
650
+ */
651
+ /* Document-attr: min_client_size
652
+ * the minimum client size of this window. WX::Size
653
+ */
654
+ /* Document-attr: max_client_size
655
+ * the maximum client size of this window. WX::Size
656
+ */
657
+
658
+
659
+ /* Document-attr: help_text
660
+ * the help text of this window, not always available. String
661
+ */
662
+ /* Document-attr: tool_tip
663
+ * the tool tip of this window, not always available. String
664
+ */
665
+
666
+ DLL_LOCAL void Init_WXWindow(VALUE rb_mWX)
667
+ {
668
+ using namespace RubyWX::Window;
669
+ #if 0
670
+ rb_mWX = rb_define_module("WX");
671
+ rb_mWXEvtHandler = rb_define_module_under(rb_mWX,"EvtHandler");
672
+
673
+ rb_define_attr(rb_cWXWindow, "label",1,1);
674
+ rb_define_attr(rb_cWXWindow, "name",1,1);
675
+ rb_define_attr(rb_cWXWindow, "parent",1,1);
676
+
677
+ rb_define_attr(rb_cWXWindow, "id",1,1);
678
+
679
+ rb_define_attr(rb_cWXWindow, "window_variant",1,1);
680
+ rb_define_attr(rb_cWXWindow, "layout_direction",1,1);
681
+ rb_define_attr(rb_cWXWindow, "background_style",1,1);
682
+
683
+ rb_define_attr(rb_cWXWindow, "size",1,1);
684
+ rb_define_attr(rb_cWXWindow, "min_size",1,1);
685
+ rb_define_attr(rb_cWXWindow, "max_size",1,1);
686
+
687
+ rb_define_attr(rb_cWXWindow, "client_size",1,1);
688
+ rb_define_attr(rb_cWXWindow, "min_client_size",1,1);
689
+ rb_define_attr(rb_cWXWindow, "max_client_size",1,1);
690
+
691
+ rb_define_attr(rb_cWXWindow, "sizer",1,1);
692
+ rb_define_attr(rb_cWXWindow, "containing_sizer",1,1);
693
+
694
+ rb_define_attr(rb_cWXWindow, "background_color",1,1);
695
+ rb_define_attr(rb_cWXWindow, "foreground_color",1,1);
696
+
697
+ rb_define_attr(rb_cWXWindow, "font",1,1);
698
+ rb_define_attr(rb_cWXWindow, "cursor",1,1);
699
+
700
+ rb_define_attr(rb_cWXWindow, "help_text",1,1);
701
+ rb_define_attr(rb_cWXWindow, "tool_tip",1,1);
702
+
703
+ #endif
704
+
705
+ rb_cWXWindow = rb_define_class_under(rb_mWX,"Window",rb_cObject);
706
+ rb_define_alloc_func(rb_cWXWindow,_alloc);
707
+
708
+ rb_undef_method(rb_cWXWindow,"initialize_copy");
709
+ rb_undef_method(rb_cWXWindow,"_load");
710
+ rb_undef_method(rb_cWXWindow,"_dump");
711
+
712
+ rb_define_method(rb_cWXWindow,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
713
+
714
+ rb_include_module(rb_cWXWindow,rb_mWXEvtHandler);
715
+
716
+ rb_define_attr_method(rb_cWXWindow, "label",_getLabel,_setLabel);
717
+ rb_define_attr_method(rb_cWXWindow, "name",_getName,_setName);
718
+ rb_define_attr_method(rb_cWXWindow, "parent",_GetParent,_SetParent);
719
+
720
+ rb_define_attr_method(rb_cWXWindow, "id",_getId,_setId);
721
+
722
+ rb_define_attr_method(rb_cWXWindow, "window_variant",_getWindowVariant,_setWindowVariant);
723
+ rb_define_attr_method(rb_cWXWindow, "layout_direction",_getLayoutDirection,_setLayoutDirection);
724
+ rb_define_attr_method(rb_cWXWindow, "background_style",_getBackgroundStyle,_setBackgroundStyle);
725
+
726
+ rb_define_attr_method(rb_cWXWindow, "size",_getSize,_setSize);
727
+ rb_define_attr_method(rb_cWXWindow, "min_size",_getMinSize,_setMinSize);
728
+ rb_define_attr_method(rb_cWXWindow, "max_size",_getMaxSize,_setMaxSize);
729
+
730
+ rb_define_attr_method(rb_cWXWindow, "client_size",_getClientSize,_setClientSize);
731
+ rb_define_attr_method(rb_cWXWindow, "min_client_size",_getMinClientSize,_setMinClientSize);
732
+ rb_define_attr_method(rb_cWXWindow, "max_client_size",_getMaxClientSize,_setMaxClientSize);
733
+
734
+ rb_define_attr_method(rb_cWXWindow, "virtual_size",_getVirtualSize,_setVirtualSize);
735
+
736
+ rb_define_attr_method(rb_cWXWindow, "position",_getPosition,_setPosition);
737
+ rb_define_attr_method(rb_cWXWindow, "rect",_GetRect,_SetRect);
738
+
739
+ rb_define_attr_method(rb_cWXWindow, "sizer",_getSizer,_setSizer);
740
+ rb_define_attr_method(rb_cWXWindow, "containing_sizer",_getContainingSizer,_setContainingSizer);
741
+
742
+ rb_define_attr_method(rb_cWXWindow, "background_color",_getBackgroundColour,_setBackgroundColour);
743
+ rb_define_attr_method(rb_cWXWindow, "foreground_color",_getForegroundColour,_setForegroundColour);
744
+
745
+ rb_define_attr_method(rb_cWXWindow, "font",_getFont,_setFont);
746
+ rb_define_attr_method(rb_cWXWindow, "cursor",_getCursor,_setCursor);
747
+ #if wxUSE_HELP
748
+ rb_define_attr_method(rb_cWXWindow, "help_text",_getHelpText,_setHelpText);
749
+ #endif // wxUSE_HELP
750
+ #if wxUSE_TOOLTIPS
751
+ rb_define_attr_method(rb_cWXWindow, "tool_tip",_getToolTip,_setToolTip);
752
+ #endif // wxUSE_TOOLTIPS
753
+
754
+ rb_define_method(rb_cWXWindow,"show",RUBY_METHOD_FUNC(_Show),0);
755
+ rb_define_method(rb_cWXWindow,"hide",RUBY_METHOD_FUNC(_Hide),0);
756
+
757
+ rb_define_method(rb_cWXWindow,"shown?",RUBY_METHOD_FUNC(_IsShown),0);
758
+
759
+ rb_define_method(rb_cWXWindow,"enable",RUBY_METHOD_FUNC(_Enable),0);
760
+ rb_define_method(rb_cWXWindow,"disable",RUBY_METHOD_FUNC(_Disable),0);
761
+
762
+ rb_define_method(rb_cWXWindow,"enabled?",RUBY_METHOD_FUNC(_IsEnabled),0);
763
+ rb_define_method(rb_cWXWindow,"this_enabled?",RUBY_METHOD_FUNC(_IsThisEnabled),0);
764
+
765
+ rb_define_method(rb_cWXWindow,"window_raise",RUBY_METHOD_FUNC(_Raise),0);
766
+ rb_define_method(rb_cWXWindow,"window_lower",RUBY_METHOD_FUNC(_Lower),0);
767
+
768
+ rb_define_method(rb_cWXWindow,"window_freeze",RUBY_METHOD_FUNC(_Freeze),0);
769
+ rb_define_method(rb_cWXWindow,"window_frozen?",RUBY_METHOD_FUNC(_IsFrozen),0);
770
+ rb_define_method(rb_cWXWindow,"window_thaw",RUBY_METHOD_FUNC(_Thaw),0);
771
+
772
+
773
+ rb_define_method(rb_cWXWindow,"[]",RUBY_METHOD_FUNC(_getchild),1);
774
+
775
+ rb_define_method(rb_cWXWindow,"wx_class",RUBY_METHOD_FUNC(_wxClass),0);
776
+
777
+ rb_define_method(rb_cWXWindow,"each_child",RUBY_METHOD_FUNC(_each),0);
778
+
779
+ rb_define_method(rb_cWXWindow,"fit",RUBY_METHOD_FUNC(_Fit),0);
780
+ rb_define_method(rb_cWXWindow,"fit_inside",RUBY_METHOD_FUNC(_FitInside),0);
781
+ rb_define_method(rb_cWXWindow,"layout",RUBY_METHOD_FUNC(_Layout),0);
782
+
783
+ rb_define_method(rb_cWXWindow,"update",RUBY_METHOD_FUNC(_Update),0);
784
+ rb_define_method(rb_cWXWindow,"refresh",RUBY_METHOD_FUNC(_Refresh),0);
785
+
786
+ rb_define_method(rb_cWXWindow,"line_up",RUBY_METHOD_FUNC(_LineUp),0);
787
+ rb_define_method(rb_cWXWindow,"line_down",RUBY_METHOD_FUNC(_LineDown),0);
788
+
789
+ rb_define_method(rb_cWXWindow,"page_up",RUBY_METHOD_FUNC(_PageUp),0);
790
+ rb_define_method(rb_cWXWindow,"page_down",RUBY_METHOD_FUNC(_PageDown),0);
791
+
792
+
793
+ rb_define_method(rb_cWXWindow,"capture_mouse",RUBY_METHOD_FUNC(_CaptureMouse),0);
794
+ rb_define_method(rb_cWXWindow,"release_mouse",RUBY_METHOD_FUNC(_ReleaseMouse),0);
795
+ rb_define_method(rb_cWXWindow,"capture?",RUBY_METHOD_FUNC(_HasCapture),0);
796
+
797
+ rb_define_method(rb_cWXWindow,"handle",RUBY_METHOD_FUNC(_GetHandle),0);
798
+
799
+ rb_define_method(rb_cWXWindow,"draw",RUBY_METHOD_FUNC(_draw),-1);
800
+ rb_define_method(rb_cWXWindow,"close",RUBY_METHOD_FUNC(_Close),-1);
801
+ rb_define_method(rb_cWXWindow,"destroy",RUBY_METHOD_FUNC(_Destroy),0);
802
+ rb_define_method(rb_cWXWindow,"destroy_children",RUBY_METHOD_FUNC(_DestroyChildren),0);
803
+
804
+ rb_define_method(rb_cWXWindow,"destroyed?",RUBY_METHOD_FUNC(_IsDestroyed),0);
805
+ rb_define_method(rb_cWXWindow,"deleted?",RUBY_METHOD_FUNC(_IsBeingDeleted),0);
806
+
807
+ #if wxUSE_MENUS
808
+ rb_define_method(rb_cWXWindow,"popup_menu",RUBY_METHOD_FUNC(_popupmenu),-1);
809
+ #endif
810
+ #if wxUSE_AUI
811
+ rb_define_method(rb_cWXWindow,"aui",RUBY_METHOD_FUNC(_aui),0);
812
+ #endif
813
+
814
+ rb_define_module_function(rb_mWX,"mouse_position",RUBY_METHOD_FUNC(_GetMousePosition),0);
815
+ rb_define_module_function(rb_mWX,"capture",RUBY_METHOD_FUNC(_GetCapture),0);
816
+
817
+ rb_define_method(rb_cWXWindow,"client_to_screen",RUBY_METHOD_FUNC(_ClientToScreen),1);
818
+ rb_define_method(rb_cWXWindow,"screen_to_client",RUBY_METHOD_FUNC(_ScreenToClient),1);
819
+
820
+ rb_define_method(rb_cWXWindow,"client_to_window_size",RUBY_METHOD_FUNC(_ClientToWindowSize),1);
821
+ rb_define_method(rb_cWXWindow,"window_to_client_size",RUBY_METHOD_FUNC(_WindowToClientSize),1);
822
+
823
+
824
+ registerInfo<wxWindow>(rb_cWXWindow);
825
+
826
+ registerID("open",wxID_OPEN);
827
+ registerID("close",wxID_CLOSE);
828
+ registerID("new",wxID_NEW);
829
+ registerID("save",wxID_SAVE);
830
+ registerID("save_as",wxID_SAVEAS);
831
+ registerID("revert",wxID_REVERT);
832
+ registerID("exit",wxID_EXIT);
833
+ registerID("undo",wxID_UNDO);
834
+ registerID("redo",wxID_REDO);
835
+ registerID("help",wxID_HELP);
836
+ registerID("print",wxID_PRINT);
837
+ registerID("print_setup",wxID_PRINT_SETUP);
838
+ registerID("page_setup",wxID_PAGE_SETUP);
839
+ registerID("preview",wxID_PREVIEW);
840
+ registerID("about",wxID_ABOUT);
841
+ registerID("help_contents",wxID_HELP_CONTENTS);
842
+ registerID("help_index",wxID_HELP_INDEX);
843
+ registerID("help_search",wxID_HELP_SEARCH);
844
+ registerID("help_commands",wxID_HELP_COMMANDS);
845
+ registerID("help_procedurs",wxID_HELP_PROCEDURES);
846
+ registerID("help_context",wxID_HELP_CONTEXT);
847
+ registerID("close_all",wxID_CLOSE_ALL);
848
+ registerID("preferences",wxID_PREFERENCES);
849
+
850
+ registerID("edit",wxID_EDIT);
851
+ registerID("cut",wxID_CUT);
852
+ registerID("copy",wxID_COPY);
853
+ registerID("paste",wxID_PASTE);
854
+ registerID("clear",wxID_CLEAR);
855
+ registerID("find",wxID_FIND);
856
+ registerID("duplicate",wxID_DUPLICATE);
857
+ registerID("select_all",wxID_SELECTALL);
858
+ registerID("delete",wxID_DELETE);
859
+ registerID("replace",wxID_REPLACE);
860
+ registerID("replace_all",wxID_REPLACE_ALL);
861
+ registerID("properties",wxID_PROPERTIES);
862
+
863
+ registerID("view_details",wxID_VIEW_DETAILS);
864
+ registerID("view_largeicons",wxID_VIEW_LARGEICONS);
865
+ registerID("view_smallicons",wxID_VIEW_SMALLICONS);
866
+ registerID("view_list",wxID_VIEW_LIST);
867
+ registerID("view_sortdate",wxID_VIEW_SORTDATE);
868
+ registerID("view_sortname",wxID_VIEW_SORTNAME);
869
+ registerID("view_sortsize",wxID_VIEW_SORTSIZE);
870
+ registerID("view_sorttype",wxID_VIEW_SORTTYPE);
871
+
872
+ registerID("file",wxID_FILE);
873
+ registerID("file1",wxID_FILE1);
874
+ registerID("file2",wxID_FILE2);
875
+ registerID("file3",wxID_FILE3);
876
+ registerID("file4",wxID_FILE4);
877
+ registerID("file5",wxID_FILE5);
878
+ registerID("file6",wxID_FILE6);
879
+ registerID("file7",wxID_FILE7);
880
+ registerID("file8",wxID_FILE8);
881
+ registerID("file9",wxID_FILE9);
882
+
883
+ /* Standard button and menu IDs */
884
+ registerID("ok",wxID_OK);
885
+ registerID("cancel",wxID_CANCEL);
886
+ registerID("apply",wxID_APPLY);
887
+ registerID("yes",wxID_YES);
888
+ registerID("no",wxID_NO);
889
+ registerID("static",wxID_STATIC);
890
+ registerID("forward",wxID_FORWARD);
891
+ registerID("backward",wxID_BACKWARD);
892
+ registerID("default",wxID_DEFAULT);
893
+ registerID("more",wxID_MORE);
894
+ registerID("setup",wxID_SETUP);
895
+ registerID("reset",wxID_RESET);
896
+ registerID("context_help",wxID_CONTEXT_HELP);
897
+ registerID("yes_to_all",wxID_YESTOALL);
898
+ registerID("no_to_all",wxID_NOTOALL);
899
+ registerID("abort",wxID_ABORT);
900
+ registerID("retry",wxID_RETRY);
901
+ registerID("ignore",wxID_IGNORE);
902
+ registerID("add",wxID_ADD);
903
+ registerID("remove",wxID_REMOVE);
904
+
905
+ registerID("up",wxID_UP);
906
+ registerID("down",wxID_DOWN);
907
+ registerID("home",wxID_HOME);
908
+ registerID("refresh",wxID_REFRESH);
909
+ registerID("stop",wxID_STOP);
910
+ registerID("index",wxID_INDEX);
911
+
912
+ registerID("bold",wxID_BOLD);
913
+ registerID("italic",wxID_ITALIC);
914
+ registerID("justify_center",wxID_JUSTIFY_CENTER);
915
+ registerID("justify_fill",wxID_JUSTIFY_FILL);
916
+ registerID("justify_right",wxID_JUSTIFY_RIGHT);
917
+ registerID("justify_left",wxID_JUSTIFY_LEFT);
918
+ registerID("underline",wxID_UNDERLINE);
919
+ registerID("indent",wxID_INDENT);
920
+ registerID("unindent",wxID_UNINDENT);
921
+ registerID("zoom_100",wxID_ZOOM_100);
922
+ registerID("zoom_fit",wxID_ZOOM_FIT);
923
+ registerID("zoom_in",wxID_ZOOM_IN);
924
+ registerID("zoom_out",wxID_ZOOM_OUT);
925
+ registerID("undelete",wxID_UNDELETE);
926
+ registerID("revert_to_saved",wxID_REVERT_TO_SAVED);
927
+ registerID("cdrom",wxID_CDROM);
928
+ registerID("convert",wxID_CONVERT);
929
+ registerID("execute",wxID_EXECUTE);
930
+ registerID("floppy",wxID_FLOPPY);
931
+ registerID("harddisk",wxID_HARDDISK);
932
+ registerID("bottom",wxID_BOTTOM);
933
+ registerID("first",wxID_FIRST);
934
+ registerID("last",wxID_LAST);
935
+ registerID("top",wxID_TOP);
936
+ registerID("info",wxID_INFO);
937
+ registerID("jump_to",wxID_JUMP_TO);
938
+ registerID("network",wxID_NETWORK);
939
+ registerID("select_color",wxID_SELECT_COLOR);
940
+ registerID("select_font",wxID_SELECT_FONT);
941
+ registerID("sort_asc",wxID_SORT_ASCENDING);
942
+ registerID("sort_desc",wxID_SORT_DESCENDING);
943
+ registerID("spell_check",wxID_SPELL_CHECK);
944
+ registerID("strikethrough",wxID_STRIKETHROUGH);
945
+
946
+ /* System menu IDs (used by wxUniv): */
947
+ registerID("system_menu",wxID_SYSTEM_MENU);
948
+ registerID("close_frame",wxID_CLOSE_FRAME);
949
+ registerID("move_frame",wxID_MOVE_FRAME);
950
+ registerID("resize_frame",wxID_RESIZE_FRAME);
951
+ registerID("maximize_frame",wxID_MAXIMIZE_FRAME);
952
+ registerID("iconize_frame",wxID_ICONIZE_FRAME);
953
+ registerID("restore_frame",wxID_RESTORE_FRAME);
954
+
955
+ registerEventType("paint",wxEVT_PAINT);
956
+ registerEventType("erase_background",wxEVT_ERASE_BACKGROUND);
957
+
958
+
959
+ registerEventType("move",wxEVT_MOVE);
960
+ registerEventType("size",wxEVT_SIZE);
961
+ registerEventType("sizing",wxEVT_SIZING);
962
+
963
+
964
+ registerEnum<wxWindowVariant>("wxWindowVariant")
965
+ ->add(wxWINDOW_VARIANT_NORMAL, "normal")
966
+ ->add(wxWINDOW_VARIANT_SMALL, "small")
967
+ ->add(wxWINDOW_VARIANT_MINI, "mini")
968
+ ->add(wxWINDOW_VARIANT_LARGE, "large");
969
+
970
+ registerEnum<wxLayoutDirection>("wxLayoutDirection")
971
+ ->add(wxLayout_Default, "default")
972
+ ->add(wxLayout_LeftToRight, "left_to_right")
973
+ ->add(wxLayout_RightToLeft, "right_to_left");
974
+
975
+ registerEnum<wxBackgroundStyle>("wxBackgroundStyle")
976
+ ->add(wxBG_STYLE_ERASE, "erase")
977
+ ->add(wxBG_STYLE_SYSTEM, "system")
978
+ ->add(wxBG_STYLE_PAINT, "paint");
979
+
980
+ }