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.
- checksums.yaml +7 -0
- data/.gitignore +49 -0
- data/COPYING +0 -0
- data/README.rdoc +0 -0
- data/Rakefile +100 -0
- data/VERSION +1 -0
- data/ext/extconf.rb +112 -0
- data/ext/main.cpp +432 -0
- data/ext/main.hpp +454 -0
- data/ext/rwx.cpp +472 -0
- data/ext/wxAboutDlg.cpp +213 -0
- data/ext/wxAboutDlg.hpp +19 -0
- data/ext/wxAnyButton.cpp +141 -0
- data/ext/wxAnyButton.hpp +17 -0
- data/ext/wxAnyChoiceDialog.cpp +93 -0
- data/ext/wxAnyChoiceDialog.hpp +19 -0
- data/ext/wxApp.cpp +205 -0
- data/ext/wxApp.hpp +48 -0
- data/ext/wxAui.hpp +19 -0
- data/ext/wxAuiBook.cpp +453 -0
- data/ext/wxAuiBook.hpp +21 -0
- data/ext/wxAuiManager.cpp +79 -0
- data/ext/wxAuiManager.hpp +18 -0
- data/ext/wxAuiPane.cpp +343 -0
- data/ext/wxAuiPane.hpp +29 -0
- data/ext/wxAuiToolBar.cpp +47 -0
- data/ext/wxAuiToolBar.hpp +17 -0
- data/ext/wxBitmap.cpp +368 -0
- data/ext/wxBitmap.hpp +60 -0
- data/ext/wxBitmapButton.cpp +82 -0
- data/ext/wxBitmapButton.hpp +17 -0
- data/ext/wxBitmapComboBox.cpp +284 -0
- data/ext/wxBitmapComboBox.hpp +22 -0
- data/ext/wxBitmapToggleButton.cpp +82 -0
- data/ext/wxBitmapToggleButton.hpp +17 -0
- data/ext/wxBookCtrl.cpp +633 -0
- data/ext/wxBookCtrl.hpp +22 -0
- data/ext/wxBoxSizer.cpp +60 -0
- data/ext/wxBoxSizer.hpp +17 -0
- data/ext/wxBrush.cpp +281 -0
- data/ext/wxBrush.hpp +28 -0
- data/ext/wxButton.cpp +85 -0
- data/ext/wxButton.hpp +17 -0
- data/ext/wxButtonToolBar.cpp +54 -0
- data/ext/wxButtonToolBar.hpp +21 -0
- data/ext/wxCalendarCtrl.cpp +91 -0
- data/ext/wxCalendarCtrl.hpp +17 -0
- data/ext/wxCalendarCtrlBase.cpp +55 -0
- data/ext/wxCalendarCtrlBase.hpp +26 -0
- data/ext/wxCalendarCtrlGeneric.cpp +102 -0
- data/ext/wxCalendarCtrlGeneric.hpp +21 -0
- data/ext/wxCheckBox.cpp +157 -0
- data/ext/wxCheckBox.hpp +17 -0
- data/ext/wxCheckListBox.cpp +191 -0
- data/ext/wxCheckListBox.hpp +20 -0
- data/ext/wxChoice.cpp +133 -0
- data/ext/wxChoice.hpp +30 -0
- data/ext/wxChoiceBook.cpp +90 -0
- data/ext/wxChoiceBook.hpp +23 -0
- data/ext/wxCollapsiblePane.cpp +110 -0
- data/ext/wxCollapsiblePane.hpp +21 -0
- data/ext/wxColor.cpp +435 -0
- data/ext/wxColor.hpp +38 -0
- data/ext/wxColorDialog.cpp +97 -0
- data/ext/wxColorDialog.hpp +19 -0
- data/ext/wxColorPicker.cpp +131 -0
- data/ext/wxColorPicker.hpp +20 -0
- data/ext/wxColorPickerWidget.cpp +105 -0
- data/ext/wxColorPickerWidget.hpp +20 -0
- data/ext/wxComboBox.cpp +214 -0
- data/ext/wxComboBox.hpp +22 -0
- data/ext/wxCommandEvent.cpp +45 -0
- data/ext/wxCommandEvent.hpp +16 -0
- data/ext/wxConfig.cpp +19 -0
- data/ext/wxConfig.hpp +17 -0
- data/ext/wxContextHelpButton.cpp +93 -0
- data/ext/wxContextHelpButton.hpp +21 -0
- data/ext/wxControl.cpp +90 -0
- data/ext/wxControl.hpp +15 -0
- data/ext/wxCursor.cpp +108 -0
- data/ext/wxCursor.hpp +25 -0
- data/ext/wxDC.cpp +252 -0
- data/ext/wxDC.hpp +18 -0
- data/ext/wxDataView.cpp +224 -0
- data/ext/wxDataView.hpp +45 -0
- data/ext/wxDataViewList.cpp +190 -0
- data/ext/wxDataViewList.hpp +17 -0
- data/ext/wxDatePicker.cpp +103 -0
- data/ext/wxDatePicker.hpp +22 -0
- data/ext/wxDialog.cpp +120 -0
- data/ext/wxDialog.hpp +17 -0
- data/ext/wxDirDialog.cpp +152 -0
- data/ext/wxDirDialog.hpp +20 -0
- data/ext/wxDirPicker.cpp +134 -0
- data/ext/wxDirPicker.hpp +28 -0
- data/ext/wxDirPickerWidget.cpp +127 -0
- data/ext/wxDirPickerWidget.hpp +20 -0
- data/ext/wxError.cpp +67 -0
- data/ext/wxError.hpp +17 -0
- data/ext/wxEvent.cpp +60 -0
- data/ext/wxEvent.hpp +17 -0
- data/ext/wxEvtHandler.cpp +291 -0
- data/ext/wxEvtHandler.hpp +85 -0
- data/ext/wxFileCtrl.cpp +98 -0
- data/ext/wxFileCtrl.hpp +17 -0
- data/ext/wxFileCtrlBase.cpp +219 -0
- data/ext/wxFileCtrlBase.hpp +33 -0
- data/ext/wxFileCtrlGeneric.cpp +106 -0
- data/ext/wxFileCtrlGeneric.hpp +19 -0
- data/ext/wxFileDialog.cpp +268 -0
- data/ext/wxFileDialog.hpp +19 -0
- data/ext/wxFileDirPicker.cpp +89 -0
- data/ext/wxFileDirPicker.hpp +29 -0
- data/ext/wxFileHistory.cpp +134 -0
- data/ext/wxFileHistory.hpp +20 -0
- data/ext/wxFilePicker.cpp +160 -0
- data/ext/wxFilePicker.hpp +28 -0
- data/ext/wxFilePickerWidget.cpp +139 -0
- data/ext/wxFilePickerWidget.hpp +20 -0
- data/ext/wxFont.cpp +542 -0
- data/ext/wxFont.hpp +37 -0
- data/ext/wxFontDialog.cpp +143 -0
- data/ext/wxFontDialog.hpp +21 -0
- data/ext/wxFontPicker.cpp +160 -0
- data/ext/wxFontPicker.hpp +21 -0
- data/ext/wxFontPickerWidget.cpp +128 -0
- data/ext/wxFontPickerWidget.hpp +20 -0
- data/ext/wxFrame.cpp +274 -0
- data/ext/wxFrame.hpp +17 -0
- data/ext/wxGauge.cpp +167 -0
- data/ext/wxGauge.hpp +17 -0
- data/ext/wxGrid.cpp +250 -0
- data/ext/wxGrid.hpp +43 -0
- data/ext/wxGridCellAttr.cpp +68 -0
- data/ext/wxGridCellAttr.hpp +26 -0
- data/ext/wxGridCellRenderer.cpp +120 -0
- data/ext/wxGridCellRenderer.hpp +30 -0
- data/ext/wxGridTable.cpp +111 -0
- data/ext/wxGridTable.hpp +47 -0
- data/ext/wxHyperLink.cpp +148 -0
- data/ext/wxHyperLink.hpp +20 -0
- data/ext/wxImage.cpp +884 -0
- data/ext/wxImage.hpp +24 -0
- data/ext/wxInfoBar.cpp +85 -0
- data/ext/wxInfoBar.hpp +21 -0
- data/ext/wxInfoBarBase.cpp +145 -0
- data/ext/wxInfoBarBase.hpp +21 -0
- data/ext/wxInfoBarGeneric.cpp +90 -0
- data/ext/wxInfoBarGeneric.hpp +21 -0
- data/ext/wxItemContainer.cpp +313 -0
- data/ext/wxItemContainer.hpp +17 -0
- data/ext/wxKeyEvent.cpp +35 -0
- data/ext/wxKeyEvent.hpp +16 -0
- data/ext/wxListBook.cpp +90 -0
- data/ext/wxListBook.hpp +21 -0
- data/ext/wxListBox.cpp +290 -0
- data/ext/wxListBox.hpp +29 -0
- data/ext/wxMenu.cpp +600 -0
- data/ext/wxMenu.hpp +17 -0
- data/ext/wxMenuBar.cpp +180 -0
- data/ext/wxMenuBar.hpp +17 -0
- data/ext/wxMenuItem.cpp +174 -0
- data/ext/wxMenuItem.hpp +17 -0
- data/ext/wxMessageDialog.cpp +91 -0
- data/ext/wxMessageDialog.hpp +19 -0
- data/ext/wxMessageDialogBase.cpp +152 -0
- data/ext/wxMessageDialogBase.hpp +18 -0
- data/ext/wxMessageDialogGeneric.cpp +91 -0
- data/ext/wxMessageDialogGeneric.hpp +19 -0
- data/ext/wxMouseEvent.cpp +60 -0
- data/ext/wxMouseEvent.hpp +16 -0
- data/ext/wxMultiChoiceDialog.cpp +143 -0
- data/ext/wxMultiChoiceDialog.hpp +19 -0
- data/ext/wxNoteBook.cpp +89 -0
- data/ext/wxNoteBook.hpp +21 -0
- data/ext/wxNotifyEvent.cpp +45 -0
- data/ext/wxNotifyEvent.hpp +16 -0
- data/ext/wxNumberEntryDialog.cpp +131 -0
- data/ext/wxNumberEntryDialog.hpp +20 -0
- data/ext/wxPalette.cpp +214 -0
- data/ext/wxPalette.hpp +24 -0
- data/ext/wxPanel.cpp +77 -0
- data/ext/wxPanel.hpp +19 -0
- data/ext/wxPasswordEntryDialog.cpp +141 -0
- data/ext/wxPasswordEntryDialog.hpp +20 -0
- data/ext/wxPen.cpp +323 -0
- data/ext/wxPen.hpp +37 -0
- data/ext/wxPickerBase.cpp +121 -0
- data/ext/wxPickerBase.hpp +28 -0
- data/ext/wxPoint.cpp +224 -0
- data/ext/wxPoint.hpp +40 -0
- data/ext/wxPreferences.cpp +149 -0
- data/ext/wxPreferences.hpp +18 -0
- data/ext/wxProgressDialog.cpp +171 -0
- data/ext/wxProgressDialog.hpp +20 -0
- data/ext/wxProperty.cpp +723 -0
- data/ext/wxProperty.hpp +16 -0
- data/ext/wxPropertyCell.cpp +99 -0
- data/ext/wxPropertyCell.hpp +16 -0
- data/ext/wxPropertyGrid.cpp +234 -0
- data/ext/wxPropertyGrid.hpp +20 -0
- data/ext/wxPropertyGridInterface.cpp +146 -0
- data/ext/wxPropertyGridInterface.hpp +33 -0
- data/ext/wxPropertyGridManager.cpp +257 -0
- data/ext/wxPropertyGridManager.hpp +20 -0
- data/ext/wxPropertyGridPage.cpp +65 -0
- data/ext/wxPropertyGridPage.hpp +20 -0
- data/ext/wxRadioBox.cpp +405 -0
- data/ext/wxRadioBox.hpp +20 -0
- data/ext/wxRadioButton.cpp +107 -0
- data/ext/wxRadioButton.hpp +16 -0
- data/ext/wxRearrangeCtrl.cpp +89 -0
- data/ext/wxRearrangeCtrl.hpp +20 -0
- data/ext/wxRearrangeDialog.cpp +122 -0
- data/ext/wxRearrangeDialog.hpp +20 -0
- data/ext/wxRearrangeList.cpp +94 -0
- data/ext/wxRearrangeList.hpp +20 -0
- data/ext/wxRect.cpp +281 -0
- data/ext/wxRect.hpp +29 -0
- data/ext/wxRichMessageDialog.cpp +91 -0
- data/ext/wxRichMessageDialog.hpp +21 -0
- data/ext/wxRichTextAttr.cpp +69 -0
- data/ext/wxRichTextAttr.hpp +28 -0
- data/ext/wxRichTextCtrl.cpp +484 -0
- data/ext/wxRichTextCtrl.hpp +21 -0
- data/ext/wxRichTextStyle.cpp +86 -0
- data/ext/wxRichTextStyle.hpp +25 -0
- data/ext/wxRichTextStyleSheet.cpp +497 -0
- data/ext/wxRichTextStyleSheet.hpp +21 -0
- data/ext/wxSTC.cpp +331 -0
- data/ext/wxSTC.hpp +21 -0
- data/ext/wxScrollEvent.cpp +43 -0
- data/ext/wxScrollEvent.hpp +16 -0
- data/ext/wxSearchCtrl.cpp +189 -0
- data/ext/wxSearchCtrl.hpp +21 -0
- data/ext/wxSimpleBook.cpp +89 -0
- data/ext/wxSimpleBook.hpp +21 -0
- data/ext/wxSingleChoiceDialog.cpp +147 -0
- data/ext/wxSingleChoiceDialog.hpp +19 -0
- data/ext/wxSize.cpp +206 -0
- data/ext/wxSize.hpp +32 -0
- data/ext/wxSizer.cpp +368 -0
- data/ext/wxSizer.hpp +23 -0
- data/ext/wxSizerItem.cpp +37 -0
- data/ext/wxSizerItem.hpp +18 -0
- data/ext/wxSlider.cpp +204 -0
- data/ext/wxSlider.hpp +21 -0
- data/ext/wxSpinButton.cpp +158 -0
- data/ext/wxSpinButton.hpp +20 -0
- data/ext/wxSpinCtrl.cpp +132 -0
- data/ext/wxSpinCtrl.hpp +21 -0
- data/ext/wxStartUpTip.cpp +44 -0
- data/ext/wxStartUpTip.hpp +16 -0
- data/ext/wxStaticBitmap.cpp +79 -0
- data/ext/wxStaticBitmap.hpp +17 -0
- data/ext/wxStaticBitmapBase.cpp +46 -0
- data/ext/wxStaticBitmapBase.hpp +22 -0
- data/ext/wxStaticBitmapGeneric.cpp +82 -0
- data/ext/wxStaticBitmapGeneric.hpp +17 -0
- data/ext/wxStaticBox.cpp +92 -0
- data/ext/wxStaticBox.hpp +22 -0
- data/ext/wxStaticLine.cpp +100 -0
- data/ext/wxStaticLine.hpp +22 -0
- data/ext/wxStaticText.cpp +82 -0
- data/ext/wxStaticText.hpp +21 -0
- data/ext/wxStatusBar.cpp +417 -0
- data/ext/wxStatusBar.hpp +17 -0
- data/ext/wxStream.cpp +41 -0
- data/ext/wxStream.hpp +46 -0
- data/ext/wxTaskBar.cpp +104 -0
- data/ext/wxTaskBar.hpp +41 -0
- data/ext/wxTextArea.cpp +141 -0
- data/ext/wxTextArea.hpp +21 -0
- data/ext/wxTextAttr.cpp +320 -0
- data/ext/wxTextAttr.hpp +28 -0
- data/ext/wxTextCtrl.cpp +177 -0
- data/ext/wxTextCtrl.hpp +30 -0
- data/ext/wxTextEntry.cpp +248 -0
- data/ext/wxTextEntry.hpp +19 -0
- data/ext/wxTextEntryDialog.cpp +133 -0
- data/ext/wxTextEntryDialog.hpp +20 -0
- data/ext/wxTimePicker.cpp +105 -0
- data/ext/wxTimePicker.hpp +22 -0
- data/ext/wxTimer.cpp +106 -0
- data/ext/wxTimer.hpp +16 -0
- data/ext/wxToggleButton.cpp +96 -0
- data/ext/wxToggleButton.hpp +21 -0
- data/ext/wxToolBar.cpp +85 -0
- data/ext/wxToolBar.hpp +17 -0
- data/ext/wxToolBarBase.cpp +615 -0
- data/ext/wxToolBarBase.hpp +17 -0
- data/ext/wxToolBarTool.cpp +179 -0
- data/ext/wxToolBarTool.hpp +16 -0
- data/ext/wxToolBook.cpp +96 -0
- data/ext/wxToolBook.hpp +23 -0
- data/ext/wxToplevel.cpp +125 -0
- data/ext/wxToplevel.hpp +25 -0
- data/ext/wxTreeBook.cpp +240 -0
- data/ext/wxTreeBook.hpp +21 -0
- data/ext/wxTreeCtrl.cpp +443 -0
- data/ext/wxTreeCtrl.hpp +66 -0
- data/ext/wxVariant.cpp +65 -0
- data/ext/wxVariant.hpp +17 -0
- data/ext/wxWindow.cpp +980 -0
- data/ext/wxWindow.hpp +35 -0
- data/ext/wxWizard.cpp +321 -0
- data/ext/wxWizard.hpp +19 -0
- data/ext/wxWizardPage.cpp +137 -0
- data/ext/wxWizardPage.hpp +38 -0
- data/ext/wxXRC.cpp +48 -0
- data/ext/wxXRC.hpp +21 -0
- data/old_tests/button.rb +56 -0
- data/old_tests/file.png +0 -0
- data/old_tests/green.xpm +25 -0
- data/old_tests/new16x16.png +0 -0
- data/old_tests/project.xml +10 -0
- data/old_tests/propertygrid.rb +51 -0
- data/old_tests/red.xpm +25 -0
- data/old_tests/ruby32x32.png +0 -0
- data/old_tests/status.rb +45 -0
- data/old_tests/test.rb +580 -0
- data/old_tests/wizard.xrc +40 -0
- data/old_tests/xrc.rb +38 -0
- data/rwx.gemspec +43 -0
- data/samples/controls/controls.rb +143 -0
- data/samples/controls/icons/choice.bmp +0 -0
- data/samples/controls/icons/choice.xpm +27 -0
- data/samples/controls/icons/combo.bmp +0 -0
- data/samples/controls/icons/combo.xpm +27 -0
- data/samples/controls/icons/gauge.bmp +0 -0
- data/samples/controls/icons/gauge.xpm +27 -0
- data/samples/controls/icons/list.bmp +0 -0
- data/samples/controls/icons/list.xpm +27 -0
- data/samples/controls/icons/radio.bmp +0 -0
- data/samples/controls/icons/radio.xpm +27 -0
- data/samples/controls/icons/stattext.xpm +24 -0
- data/samples/controls/icons/text.bmp +0 -0
- data/samples/controls/icons/text.xpm +27 -0
- data/samples/dialog/dialog_sample.rb +227 -0
- data/samples/sample.xpm +44 -0
- data/samples/widgets/icons/bmpbtn.xpm +37 -0
- data/samples/widgets/icons/bmpcombobox.xpm +54 -0
- data/samples/widgets/icons/button.xpm +54 -0
- data/samples/widgets/icons/checkbox.xpm +54 -0
- data/samples/widgets/icons/choice.xpm +27 -0
- data/samples/widgets/icons/choicebk.xpm +54 -0
- data/samples/widgets/icons/clrpicker.xpm +193 -0
- data/samples/widgets/icons/combobox.xpm +54 -0
- data/samples/widgets/icons/datepick.xpm +200 -0
- data/samples/widgets/icons/dirctrl.xpm +54 -0
- data/samples/widgets/icons/dirpicker.xpm +213 -0
- data/samples/widgets/icons/filepicker.xpm +214 -0
- data/samples/widgets/icons/fontpicker.xpm +185 -0
- data/samples/widgets/icons/gauge.xpm +54 -0
- data/samples/widgets/icons/hyperlnk.xpm +54 -0
- data/samples/widgets/icons/listbook.xpm +54 -0
- data/samples/widgets/icons/listbox.xpm +54 -0
- data/samples/widgets/icons/notebook.xpm +54 -0
- data/samples/widgets/icons/odcombobox.xpm +54 -0
- data/samples/widgets/icons/radiobox.xpm +54 -0
- data/samples/widgets/icons/scrolbar.xpm +54 -0
- data/samples/widgets/icons/slider.xpm +54 -0
- data/samples/widgets/icons/spinbtn.xpm +40 -0
- data/samples/widgets/icons/statbmp.xpm +40 -0
- data/samples/widgets/icons/statbox.xpm +54 -0
- data/samples/widgets/icons/stattext.xpm +54 -0
- data/samples/widgets/icons/text.xpm +54 -0
- data/samples/widgets/icons/timepick.xpm +207 -0
- data/samples/widgets/icons/toggle.xpm +54 -0
- data/samples/widgets/pages/colorpicker.rb +66 -0
- data/samples/widgets/pages/common.rb +17 -0
- data/samples/widgets/widgets.rb +29 -0
- data/samples/xrc/samples.xrc +46 -0
- data/samples/xrc/xrc_sample.rb +59 -0
- data/test/test_color.rb +64 -0
- metadata +470 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxAnyChoiceDialog.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 08.12.2013
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXANYCHOICEDIALOG_HPP_
|
|
9
|
+
#define WXANYCHOICEDIALOG_HPP_
|
|
10
|
+
|
|
11
|
+
#include "wxDialog.hpp"
|
|
12
|
+
|
|
13
|
+
extern VALUE rb_cWXAnyChoiceDialog;
|
|
14
|
+
|
|
15
|
+
void Init_WXAnyChoiceDialog(VALUE rb_mWX);
|
|
16
|
+
#if wxUSE_CHOICEDLG
|
|
17
|
+
#include <wx/choicdlg.h>
|
|
18
|
+
#endif
|
|
19
|
+
#endif /* WXANYCHOICEDIALOG_HPP_ */
|
data/ext/wxApp.cpp
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxApp.cpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 07.02.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#include "wxApp.hpp"
|
|
9
|
+
#include "wxColor.hpp"
|
|
10
|
+
#include "wxFont.hpp"
|
|
11
|
+
#include "wxBrush.hpp"
|
|
12
|
+
#include "wxPen.hpp"
|
|
13
|
+
#include "wxPropertyGrid.hpp"
|
|
14
|
+
|
|
15
|
+
#ifdef __WXMAC__
|
|
16
|
+
|
|
17
|
+
//#ifdef __WXCARBON__
|
|
18
|
+
#include <Carbon/Carbon.h>
|
|
19
|
+
//#else
|
|
20
|
+
//#include <Cocoa/Cocoa.h>
|
|
21
|
+
//#endif
|
|
22
|
+
extern "C" { void CPSEnableForegroundOperation(ProcessSerialNumber* psn); }
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
#define _self unwrap<wxApp*>(self)
|
|
26
|
+
VALUE rb_cWXApp;
|
|
27
|
+
|
|
28
|
+
bool ruby_app_inited;
|
|
29
|
+
|
|
30
|
+
template <>
|
|
31
|
+
wxApp* unwrap< wxApp* >(const VALUE &vapp)
|
|
32
|
+
{
|
|
33
|
+
return unwrapTypedPtr<RubyApp>(vapp, rb_cWXApp);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class AppAfter
|
|
38
|
+
{
|
|
39
|
+
public:
|
|
40
|
+
|
|
41
|
+
void operator()(wxEvent &evt)
|
|
42
|
+
{
|
|
43
|
+
wxDynamicCast(&evt,wxAsyncMethodCallEvent)->Execute();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
void operator()(wxAsyncMethodCallEvent &evt)
|
|
47
|
+
{
|
|
48
|
+
evt.Execute();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
void app_protected()
|
|
54
|
+
{
|
|
55
|
+
if(!ruby_app_inited)
|
|
56
|
+
rb_raise(rb_eArgError,"%s is not running.",rb_class2name(rb_cWXApp));\
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
RubyApp::RubyApp(VALUE klass)
|
|
61
|
+
{
|
|
62
|
+
mRuby = wrapTypedPtr(this,klass);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
bool RubyApp::OnInit()
|
|
66
|
+
{
|
|
67
|
+
wxApp::OnInit();
|
|
68
|
+
|
|
69
|
+
#ifdef __WXMAC__
|
|
70
|
+
ProcessSerialNumber psn;
|
|
71
|
+
|
|
72
|
+
GetCurrentProcess( &psn );
|
|
73
|
+
CPSEnableForegroundOperation( &psn );
|
|
74
|
+
SetFrontProcess( &psn );
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
RubyWX::Color::define_const();
|
|
78
|
+
RubyWX::Font::define_const();
|
|
79
|
+
RubyWX::Brush::define_const();
|
|
80
|
+
RubyWX::Pen::define_const();
|
|
81
|
+
|
|
82
|
+
#if wxUSE_INTL
|
|
83
|
+
wxLocale::CreateLanguagesDB();
|
|
84
|
+
mLocale = new wxLocale(wxLANGUAGE_DEFAULT);
|
|
85
|
+
mLocale->AddCatalog("wxstd");
|
|
86
|
+
#ifdef __LINUX__
|
|
87
|
+
mLocale->AddCatalog("fileutils");
|
|
88
|
+
#endif
|
|
89
|
+
#endif
|
|
90
|
+
#if wxUSE_PROPGRID
|
|
91
|
+
wxPropertyGrid::RegisterAdditionalEditors();
|
|
92
|
+
#endif
|
|
93
|
+
|
|
94
|
+
this->Bind(wxEVT_ASYNC_METHOD_CALL,AppAfter());
|
|
95
|
+
|
|
96
|
+
ruby_app_inited = true;
|
|
97
|
+
|
|
98
|
+
bool result = RTEST(rb_funcall(mRuby, rb_intern("on_init"), 0));
|
|
99
|
+
if(rb_block_given_p())
|
|
100
|
+
rb_obj_instance_eval(0, 0, mRuby);
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
int RubyApp::OnRun()
|
|
106
|
+
{
|
|
107
|
+
int result = wxApp::OnRun();
|
|
108
|
+
rb_funcall(mRuby, rb_intern("on_run"), 0);
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
int RubyApp::OnExit()
|
|
114
|
+
{
|
|
115
|
+
int result = wxApp::OnExit();
|
|
116
|
+
ruby_app_inited = false;
|
|
117
|
+
rb_funcall(mRuby, rb_intern("on_exit"), 0);
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
namespace RubyWX {
|
|
123
|
+
namespace App {
|
|
124
|
+
|
|
125
|
+
macro_attr(AppName,wxString)
|
|
126
|
+
macro_attr(AppDisplayName,wxString)
|
|
127
|
+
macro_attr(ClassName,wxString)
|
|
128
|
+
macro_attr(VendorName,wxString)
|
|
129
|
+
macro_attr(VendorDisplayName,wxString)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
DLL_LOCAL VALUE _alloc(VALUE self)
|
|
133
|
+
{
|
|
134
|
+
return (new RubyApp(self))->mRuby;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
DLL_LOCAL VALUE _main_loop(VALUE self)
|
|
139
|
+
{
|
|
140
|
+
wxChar* argv[] = { NULL};
|
|
141
|
+
int argc = 0;
|
|
142
|
+
return INT2NUM(wxEntry(argc, argv));
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
DLL_LOCAL VALUE _on_init(VALUE self)
|
|
146
|
+
{
|
|
147
|
+
return Qtrue; //For wxWidgets to continue
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
DLL_LOCAL VALUE _on_run(VALUE self)
|
|
151
|
+
{
|
|
152
|
+
return Qnil;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
DLL_LOCAL VALUE _on_exit(VALUE self)
|
|
156
|
+
{
|
|
157
|
+
return Qnil;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
DLL_LOCAL VALUE _wxExit(VALUE self)
|
|
161
|
+
{
|
|
162
|
+
app_protected();
|
|
163
|
+
wxExit();
|
|
164
|
+
return self;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
VALUE singleton_wxApp(VALUE self)
|
|
169
|
+
{
|
|
170
|
+
_main_loop(_alloc(rb_cWXApp));
|
|
171
|
+
return Qnil;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
DLL_LOCAL void Init_WXApp(VALUE rb_mWX)
|
|
179
|
+
{
|
|
180
|
+
using namespace RubyWX::App;
|
|
181
|
+
rb_cWXApp = rb_define_class_under(rb_mWX,"App",rb_cObject);
|
|
182
|
+
rb_define_alloc_func(rb_cWXApp,_alloc);
|
|
183
|
+
|
|
184
|
+
rb_define_attr_method(rb_cWXApp,"app_name",_getAppName,_setAppName);
|
|
185
|
+
rb_define_attr_method(rb_cWXApp,"app_display_name",_getAppDisplayName,_setAppDisplayName);
|
|
186
|
+
|
|
187
|
+
rb_define_attr_method(rb_cWXApp,"vendor_name",_getVendorName,_setVendorName);
|
|
188
|
+
rb_define_attr_method(rb_cWXApp,"vendor_display_name",_getVendorDisplayName,_setVendorDisplayName);
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
rb_define_method(rb_cWXApp,"main_loop",RUBY_METHOD_FUNC(_main_loop),0);
|
|
192
|
+
|
|
193
|
+
rb_define_method(rb_cWXApp,"on_init",RUBY_METHOD_FUNC(_on_init),0);
|
|
194
|
+
rb_define_method(rb_cWXApp,"on_run",RUBY_METHOD_FUNC(_on_run),0);
|
|
195
|
+
rb_define_method(rb_cWXApp,"on_exit",RUBY_METHOD_FUNC(_on_exit),0);
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
rb_define_singleton_method(rb_mWX,"App",RUBY_METHOD_FUNC(singleton_wxApp),0);
|
|
199
|
+
|
|
200
|
+
rb_define_module_function(rb_mWX,"exit",RUBY_METHOD_FUNC(_wxExit),0);
|
|
201
|
+
|
|
202
|
+
registerDataType(rb_cWXApp);
|
|
203
|
+
|
|
204
|
+
}
|
|
205
|
+
|
data/ext/wxApp.hpp
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxApp.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 07.02.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXAPP_HPP_
|
|
9
|
+
#define WXAPP_HPP_
|
|
10
|
+
|
|
11
|
+
#include "main.hpp"
|
|
12
|
+
|
|
13
|
+
extern bool ruby_app_inited;
|
|
14
|
+
extern VALUE rb_cWXApp;
|
|
15
|
+
void Init_WXApp(VALUE rb_mWX);
|
|
16
|
+
|
|
17
|
+
class RubyApp : public wxApp {
|
|
18
|
+
public:
|
|
19
|
+
RubyApp(VALUE klass);
|
|
20
|
+
|
|
21
|
+
virtual bool OnInit();
|
|
22
|
+
virtual int OnRun();
|
|
23
|
+
virtual int OnExit();
|
|
24
|
+
|
|
25
|
+
VALUE mRuby;
|
|
26
|
+
protected:
|
|
27
|
+
#if wxUSE_INTL
|
|
28
|
+
wxLocale *mLocale; // locale we'll be using
|
|
29
|
+
#endif
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
template <>
|
|
33
|
+
wxApp* unwrap< wxApp* >(const VALUE &vapp);
|
|
34
|
+
|
|
35
|
+
void app_protected();
|
|
36
|
+
|
|
37
|
+
#define APP_PROTECT(type) DLL_LOCAL VALUE _alloc(VALUE self)\
|
|
38
|
+
{\
|
|
39
|
+
app_protected();\
|
|
40
|
+
return wrapTypedPtr(new type,self);\
|
|
41
|
+
}
|
|
42
|
+
#define APP_PROTECT_NULL DLL_LOCAL VALUE _alloc(VALUE self)\
|
|
43
|
+
{\
|
|
44
|
+
app_protected();\
|
|
45
|
+
return wrapTypedPtr((void*)NULL,self);\
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
#endif /* WXAPP_HPP_ */
|
data/ext/wxAui.hpp
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxAui.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 26.03.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXAUI_HPP_
|
|
9
|
+
#define WXAUI_HPP_
|
|
10
|
+
|
|
11
|
+
#include "wxEvtHandler.hpp"
|
|
12
|
+
#if wxUSE_AUI
|
|
13
|
+
#include <wx/aui/aui.h>
|
|
14
|
+
#endif
|
|
15
|
+
#include "wxAuiManager.hpp"
|
|
16
|
+
#include "wxAuiPane.hpp"
|
|
17
|
+
#include "wxAuiBook.hpp"
|
|
18
|
+
#include "wxAuiToolBar.hpp"
|
|
19
|
+
#endif /* WXAUI_HPP_ */
|
data/ext/wxAuiBook.cpp
ADDED
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxAuiBook.cpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 30.03.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#include "wxBookCtrl.hpp"
|
|
10
|
+
#include "wxBitmap.hpp"
|
|
11
|
+
|
|
12
|
+
VALUE rb_cWXAuiNotebook;
|
|
13
|
+
|
|
14
|
+
#if wxUSE_AUI
|
|
15
|
+
#define _self unwrap<wxAuiNotebook*>(self)
|
|
16
|
+
|
|
17
|
+
namespace RubyWX {
|
|
18
|
+
namespace AuiNotebook {
|
|
19
|
+
|
|
20
|
+
APP_PROTECT(wxAuiNotebook)
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
* call-seq:
|
|
24
|
+
* AuiNoteBookCtrl.new(parent, name, [options])
|
|
25
|
+
* AuiNoteBookCtrl.new(parent, [options])
|
|
26
|
+
*
|
|
27
|
+
* creates a new AuiNoteBookCtrl widget.
|
|
28
|
+
* ===Arguments
|
|
29
|
+
* * parent of this window or nil
|
|
30
|
+
* * name is a String describing a resource in a loaded xrc
|
|
31
|
+
*
|
|
32
|
+
* *options: Hash with possible options to set
|
|
33
|
+
*/
|
|
34
|
+
DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
35
|
+
{
|
|
36
|
+
VALUE parent,name,hash;
|
|
37
|
+
|
|
38
|
+
rb_scan_args(argc, argv, "11:",&parent,&name,&hash);
|
|
39
|
+
if(!_created && !rb_obj_is_kind_of(name,rb_cString))
|
|
40
|
+
{
|
|
41
|
+
wxWindowID id(wxID_ANY);
|
|
42
|
+
int style(wxAUI_NB_DEFAULT_STYLE);
|
|
43
|
+
|
|
44
|
+
if(rb_obj_is_kind_of(hash,rb_cHash))
|
|
45
|
+
{
|
|
46
|
+
set_hash_option(hash,"id",id,unwrapID);
|
|
47
|
+
set_hash_option(hash,"style",style);
|
|
48
|
+
|
|
49
|
+
set_hash_flag_option(hash,"tap_split",wxAUI_NB_TAB_SPLIT,style);
|
|
50
|
+
set_hash_flag_option(hash,"tap_move",wxAUI_NB_TAB_MOVE,style);
|
|
51
|
+
set_hash_flag_option(hash,"tap_external_move",wxAUI_NB_TAB_EXTERNAL_MOVE,style);
|
|
52
|
+
set_hash_flag_option(hash,"tap_fixed_with",wxAUI_NB_TAB_FIXED_WIDTH,style);
|
|
53
|
+
set_hash_flag_option(hash,"scroll_buttons",wxAUI_NB_SCROLL_BUTTONS,style);
|
|
54
|
+
set_hash_flag_option(hash,"windowlist_button",wxAUI_NB_WINDOWLIST_BUTTON,style);
|
|
55
|
+
set_hash_flag_option(hash,"close_button",wxAUI_NB_CLOSE_BUTTON,style);
|
|
56
|
+
set_hash_flag_option(hash,"close_on_active_tab",wxAUI_NB_CLOSE_ON_ACTIVE_TAB,style);
|
|
57
|
+
set_hash_flag_option(hash,"close_on_all_tabs",wxAUI_NB_CLOSE_ON_ALL_TABS,style);
|
|
58
|
+
set_hash_flag_option(hash,"middle_click_close",wxAUI_NB_MIDDLE_CLICK_CLOSE,style);
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
_self->Create(unwrap<wxWindow*>(parent),id,wxDefaultPosition,wxDefaultSize,style);
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
rb_call_super(argc,argv);
|
|
67
|
+
return self;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/*
|
|
72
|
+
* call-seq:
|
|
73
|
+
* get_page_bitmap(pos) -> WX::Bitmap
|
|
74
|
+
*
|
|
75
|
+
* returns the bitmap of the given page.
|
|
76
|
+
* ===Arguments
|
|
77
|
+
* * pos is a Integer
|
|
78
|
+
*
|
|
79
|
+
* ===Return value
|
|
80
|
+
* WX::Bitmap
|
|
81
|
+
* === Exceptions
|
|
82
|
+
* [IndexError]
|
|
83
|
+
* * pos is greater than the count of pages
|
|
84
|
+
*/
|
|
85
|
+
DLL_LOCAL VALUE _get_page_bitmap(VALUE self,VALUE idx)
|
|
86
|
+
{
|
|
87
|
+
int cidx(NUM2INT(idx));
|
|
88
|
+
if(check_index(cidx,_self->GetPageCount()))
|
|
89
|
+
return wrap(_self->GetPageBitmap(cidx));
|
|
90
|
+
return Qnil;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
* call-seq:
|
|
95
|
+
* set_page_bitmap(pos,bitmap) -> self
|
|
96
|
+
*
|
|
97
|
+
* sets the bitmap of the given page.
|
|
98
|
+
* ===Arguments
|
|
99
|
+
* * pos is a Integer
|
|
100
|
+
* * bitmap is a WX::Bitmap
|
|
101
|
+
*
|
|
102
|
+
* ===Return value
|
|
103
|
+
* self
|
|
104
|
+
* === Exceptions
|
|
105
|
+
* [IndexError]
|
|
106
|
+
* * pos is greater than the count of pages
|
|
107
|
+
*/
|
|
108
|
+
DLL_LOCAL VALUE _set_page_bitmap(VALUE self,VALUE idx,VALUE str)
|
|
109
|
+
{
|
|
110
|
+
rb_check_frozen(self);
|
|
111
|
+
int cidx(NUM2INT(idx));
|
|
112
|
+
if(check_index(cidx,_self->GetPageCount()))
|
|
113
|
+
_self->SetPageBitmap(cidx,unwrap<wxBitmap>(str));
|
|
114
|
+
return self;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/*
|
|
118
|
+
* call-seq:
|
|
119
|
+
* get_page_tooltip(pos) -> String
|
|
120
|
+
*
|
|
121
|
+
* returns the tool tip of the given page.
|
|
122
|
+
* ===Arguments
|
|
123
|
+
* * pos is a Integer
|
|
124
|
+
*
|
|
125
|
+
* ===Return value
|
|
126
|
+
* String
|
|
127
|
+
* === Exceptions
|
|
128
|
+
* [IndexError]
|
|
129
|
+
* * pos is greater than the count of pages
|
|
130
|
+
*/
|
|
131
|
+
DLL_LOCAL VALUE _get_page_tooltip(VALUE self,VALUE idx)
|
|
132
|
+
{
|
|
133
|
+
int cidx(NUM2INT(idx));
|
|
134
|
+
if(check_index(cidx,_self->GetPageCount()))
|
|
135
|
+
return wrap(_self->GetPageToolTip(cidx));
|
|
136
|
+
return Qnil;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/*
|
|
140
|
+
* call-seq:
|
|
141
|
+
* set_page_tooltip(pos,tooltip) -> self
|
|
142
|
+
*
|
|
143
|
+
* sets the tool tip of the given page.
|
|
144
|
+
* ===Arguments
|
|
145
|
+
* * pos is a Integer
|
|
146
|
+
* * tooltip is a String
|
|
147
|
+
*
|
|
148
|
+
* ===Return value
|
|
149
|
+
* self
|
|
150
|
+
* === Exceptions
|
|
151
|
+
* [IndexError]
|
|
152
|
+
* * pos is greater than the count of pages
|
|
153
|
+
*/
|
|
154
|
+
DLL_LOCAL VALUE _set_page_tooltip(VALUE self,VALUE idx,VALUE str)
|
|
155
|
+
{
|
|
156
|
+
rb_check_frozen(self);
|
|
157
|
+
int cidx(NUM2INT(idx));
|
|
158
|
+
if(check_index(cidx,_self->GetPageCount()))
|
|
159
|
+
_self->SetPageToolTip(cidx,unwrap<wxString>(str));
|
|
160
|
+
return self;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
DLL_LOCAL bool check_imagelist(wxAuiNotebook* self, VALUE imageid, int& iid)
|
|
165
|
+
{
|
|
166
|
+
if(NIL_P(imageid))
|
|
167
|
+
return true;
|
|
168
|
+
if(rb_obj_is_kind_of(imageid,rb_cInteger))
|
|
169
|
+
{
|
|
170
|
+
iid = NUM2INT(imageid);
|
|
171
|
+
wxImageList *imglist = self->GetImageList();
|
|
172
|
+
if(imglist)
|
|
173
|
+
return check_index(iid,imglist->GetImageCount());
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
DLL_LOCAL bool check_window(VALUE self,VALUE hash, VALUE window, wxWindow*& w)
|
|
180
|
+
{
|
|
181
|
+
|
|
182
|
+
if(rb_obj_is_kind_of(window,rb_cClass) && rb_class_inherited(window,rb_cWXWindow)) {
|
|
183
|
+
VALUE argv2[] = {self, hash };
|
|
184
|
+
w = unwrap<wxWindow*>(rb_class_new_instance(2,argv2,window));
|
|
185
|
+
return true;
|
|
186
|
+
}else if(nil_check(window))
|
|
187
|
+
{
|
|
188
|
+
return window_parent_check(window,_self,w);
|
|
189
|
+
}
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/*
|
|
194
|
+
* call-seq:
|
|
195
|
+
* add_page(window, text, [select], [bitmap]) -> true/false
|
|
196
|
+
* add_page(WindowClass, text, [select], [bitmap],**options) [{|window| }] -> true/false
|
|
197
|
+
*
|
|
198
|
+
* adds a new page to the BookCtrl widget.
|
|
199
|
+
*
|
|
200
|
+
* ===Arguments
|
|
201
|
+
* * window is a WX::Window instance
|
|
202
|
+
* * text is the Label of the page. String
|
|
203
|
+
* * select is true/false and says if the new page should be selected
|
|
204
|
+
* * bitmap is a Integer and says the position of the bitmap in the image_list or a WX::Bitmap
|
|
205
|
+
* ===Return value
|
|
206
|
+
* true/false
|
|
207
|
+
* === Exceptions
|
|
208
|
+
* [IndexError]
|
|
209
|
+
* * bitmap is Integer and greater than the list of bitmaps in the image_list
|
|
210
|
+
* [TypeError]
|
|
211
|
+
* * window is nil
|
|
212
|
+
* [ArgumentError]
|
|
213
|
+
* * window does not have this BookCtrl as parent
|
|
214
|
+
*
|
|
215
|
+
*/
|
|
216
|
+
DLL_LOCAL VALUE _addPage(int argc,VALUE *argv,VALUE self)
|
|
217
|
+
{
|
|
218
|
+
VALUE window,text,select,imageid,hash;
|
|
219
|
+
wxWindow *w = NULL;
|
|
220
|
+
bool sel = false;
|
|
221
|
+
|
|
222
|
+
rb_scan_args(argc, argv, "22:",&window,&text,&select,&imageid,&hash);
|
|
223
|
+
|
|
224
|
+
rb_check_frozen(self);
|
|
225
|
+
|
|
226
|
+
if(!NIL_P(select))
|
|
227
|
+
sel = RTEST(select);
|
|
228
|
+
|
|
229
|
+
check_window(self,hash,window,w);
|
|
230
|
+
|
|
231
|
+
int iid = -1;
|
|
232
|
+
|
|
233
|
+
if(check_imagelist(_self,imageid,iid))
|
|
234
|
+
{
|
|
235
|
+
return wrap(_self->AddPage(w,unwrap<wxString>(text),sel,iid));
|
|
236
|
+
}else{
|
|
237
|
+
return wrap(_self->AddPage(w,unwrap<wxString>(text),sel,unwrap<wxBitmap>(imageid)));
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
/*
|
|
243
|
+
* call-seq:
|
|
244
|
+
* insert_page(pos, window, text, [select], [bitmap]) -> true/false
|
|
245
|
+
* insert_page(pos, WindowClass, text, [select], [bitmap],**options) [{|window| }] -> true/false
|
|
246
|
+
*
|
|
247
|
+
* inserts a new page to the BookCtrl widget into the given position.
|
|
248
|
+
*
|
|
249
|
+
* ===Arguments
|
|
250
|
+
* * pos is a Integer
|
|
251
|
+
* * window is a WX::Window instance
|
|
252
|
+
* * text is the Label of the page. String
|
|
253
|
+
* * select is true/false and says if the new page should be selected
|
|
254
|
+
* * bitmap is a Integer and says the position of the bitmap in the image_list, or a WX::Bitmap
|
|
255
|
+
* ===Return value
|
|
256
|
+
* true/false
|
|
257
|
+
* === Exceptions
|
|
258
|
+
* [IndexError]
|
|
259
|
+
* * pos is greater than the count of pages
|
|
260
|
+
* * bitmap is Integer and greater than the list of bitmaps in the image_list
|
|
261
|
+
* [TypeError]
|
|
262
|
+
* * window is nil
|
|
263
|
+
* [ArgumentError]
|
|
264
|
+
* * window does not have this BookCtrl as parent
|
|
265
|
+
*
|
|
266
|
+
*/
|
|
267
|
+
DLL_LOCAL VALUE _insertPage(int argc,VALUE *argv,VALUE self)
|
|
268
|
+
{
|
|
269
|
+
VALUE idx,window,text,select,imageid,hash;
|
|
270
|
+
wxWindow *w = NULL;
|
|
271
|
+
bool sel = false;
|
|
272
|
+
rb_scan_args(argc, argv, "32:",&idx,&window,&text,&select,&imageid,&hash);
|
|
273
|
+
|
|
274
|
+
rb_check_frozen(self);
|
|
275
|
+
|
|
276
|
+
if(!NIL_P(select))
|
|
277
|
+
sel = RTEST(select);
|
|
278
|
+
|
|
279
|
+
check_window(self,hash,window,w);
|
|
280
|
+
|
|
281
|
+
int cidx = NUM2INT(idx);
|
|
282
|
+
if(check_index(cidx,_self->GetPageCount()+1))
|
|
283
|
+
{
|
|
284
|
+
int iid = -1;
|
|
285
|
+
|
|
286
|
+
if(check_imagelist(_self,imageid,iid))
|
|
287
|
+
{
|
|
288
|
+
return wrap(_self->InsertPage(cidx,w,unwrap<wxString>(text),sel,iid));
|
|
289
|
+
}else{
|
|
290
|
+
return wrap(_self->InsertPage(cidx,w,unwrap<wxString>(text),sel,unwrap<wxBitmap>(imageid)));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return Qnil;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
/*
|
|
298
|
+
* call-seq:
|
|
299
|
+
* prepend_page(window, text, [select], [bitmap]) -> true/false
|
|
300
|
+
* prepend_page(WindowClass, text, [select], [bitmap],**options) [{|window| }] -> true/false
|
|
301
|
+
*
|
|
302
|
+
* prepends a new page to the BookCtrl widget.
|
|
303
|
+
*
|
|
304
|
+
* ===Arguments
|
|
305
|
+
* * window is a WX::Window instance
|
|
306
|
+
* * text is the Label of the page. String
|
|
307
|
+
* * select is true/false and says if the new page should be selected
|
|
308
|
+
* * bitmap is a Integer and says the position of the bitmap in the image_list or a WX::Bitmap
|
|
309
|
+
* ===Return value
|
|
310
|
+
* true/false
|
|
311
|
+
* === Exceptions
|
|
312
|
+
* [IndexError]
|
|
313
|
+
* * bitmap is Integer and greater than the list of bitmaps in the image_list
|
|
314
|
+
* [TypeError]
|
|
315
|
+
* * window is nil
|
|
316
|
+
* [ArgumentError]
|
|
317
|
+
* * window does not have this BookCtrl as parent
|
|
318
|
+
*
|
|
319
|
+
*/
|
|
320
|
+
DLL_LOCAL VALUE _prependPage(int argc,VALUE *argv,VALUE self)
|
|
321
|
+
{
|
|
322
|
+
VALUE window,text,select,imageid,hash;
|
|
323
|
+
wxWindow *w = NULL;
|
|
324
|
+
bool sel = false;
|
|
325
|
+
rb_scan_args(argc, argv, "22:",&window,&text,&select,&imageid,&hash);
|
|
326
|
+
|
|
327
|
+
rb_check_frozen(self);
|
|
328
|
+
|
|
329
|
+
if(!NIL_P(select))
|
|
330
|
+
sel = RTEST(select);
|
|
331
|
+
|
|
332
|
+
check_window(self,hash,window,w);
|
|
333
|
+
|
|
334
|
+
int iid = -1;
|
|
335
|
+
|
|
336
|
+
if(check_imagelist(_self,imageid,iid))
|
|
337
|
+
{
|
|
338
|
+
return wrap(_self->InsertPage(0,w,unwrap<wxString>(text),sel,iid));
|
|
339
|
+
}else{
|
|
340
|
+
return wrap(_self->InsertPage(0,w,unwrap<wxString>(text),sel,unwrap<wxBitmap>(imageid)));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
#endif
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
/* Document-const: TAB_SPLIT
|
|
352
|
+
* Allows the tab control to be split by dragging a tab.
|
|
353
|
+
*/
|
|
354
|
+
/* Document-const: TAB_MOVE
|
|
355
|
+
* Allows a tab to be moved horizontally by dragging.
|
|
356
|
+
*/
|
|
357
|
+
/* Document-const: TAB_EXTERNAL_MOVE
|
|
358
|
+
* Allows a tab to be moved to another tab control.
|
|
359
|
+
*/
|
|
360
|
+
/* Document-const: TAB_FIXED_WIDTH
|
|
361
|
+
* With this style, all tabs have the same width.
|
|
362
|
+
*/
|
|
363
|
+
|
|
364
|
+
/* Document-const: SCROLLBUTTONS
|
|
365
|
+
* With this style, left and right scroll buttons are displayed.
|
|
366
|
+
*/
|
|
367
|
+
/* Document-const: WINDOWLIST_BUTTON
|
|
368
|
+
* With this style, a drop-down list of windows is available.
|
|
369
|
+
*/
|
|
370
|
+
/* Document-const: CLOSE_BUTTON
|
|
371
|
+
* With this style, a close button is available on the tab bar.
|
|
372
|
+
*/
|
|
373
|
+
/* Document-const: CLOSE_ON_ACTIVE_TAB
|
|
374
|
+
* With this style, the close button is visible on the active tab.
|
|
375
|
+
*/
|
|
376
|
+
/* Document-const: CLOSE_ON_ALL_TABS
|
|
377
|
+
* With this style, the close button is visible on all tabs.
|
|
378
|
+
*/
|
|
379
|
+
/* Document-const: MIDDLE_CLICK_CLOSE
|
|
380
|
+
* With this style, middle click on a tab closes the tab.
|
|
381
|
+
*/
|
|
382
|
+
|
|
383
|
+
/* Document-const: DEFAULT_STYLE
|
|
384
|
+
* default style for this control.
|
|
385
|
+
*/
|
|
386
|
+
|
|
387
|
+
DLL_LOCAL void Init_WXAuiNoteBookCtrl(VALUE rb_mWX)
|
|
388
|
+
{
|
|
389
|
+
|
|
390
|
+
#if 0
|
|
391
|
+
rb_mWX = rb_define_module("WX");
|
|
392
|
+
rb_mWXEvtHandler = rb_define_module_under(rb_mWX,"EvtHandler");
|
|
393
|
+
|
|
394
|
+
rb_cWXWindow = rb_define_class_under(rb_mWX,"Window",rb_cObject);
|
|
395
|
+
rb_cWXControl = rb_define_class_under(rb_mWX,"Control",rb_cWXWindow);
|
|
396
|
+
rb_cWXBookCtrlBase = rb_define_class_under(rb_mWX,"BookCtrl",rb_cWXControl);
|
|
397
|
+
#endif
|
|
398
|
+
|
|
399
|
+
#if wxUSE_AUI
|
|
400
|
+
using namespace RubyWX::AuiNotebook;
|
|
401
|
+
rb_cWXAuiNotebook = rb_define_class_under(rb_mWX,"AuiNoteBookCtrl",rb_cWXBookCtrlBase);
|
|
402
|
+
rb_define_alloc_func(rb_cWXAuiNotebook,_alloc);
|
|
403
|
+
|
|
404
|
+
rb_define_method(rb_cWXAuiNotebook,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
|
405
|
+
|
|
406
|
+
rb_define_method(rb_cWXAuiNotebook,"add_page",RUBY_METHOD_FUNC(_addPage),-1);
|
|
407
|
+
rb_define_method(rb_cWXAuiNotebook,"insert_page",RUBY_METHOD_FUNC(_insertPage),-1);
|
|
408
|
+
rb_define_method(rb_cWXAuiNotebook,"prepend_page",RUBY_METHOD_FUNC(_prependPage),-1);
|
|
409
|
+
|
|
410
|
+
rb_define_method(rb_cWXAuiNotebook,"get_page_tooltip",RUBY_METHOD_FUNC(_get_page_tooltip),1);
|
|
411
|
+
rb_define_method(rb_cWXAuiNotebook,"set_page_tooltip",RUBY_METHOD_FUNC(_set_page_tooltip),2);
|
|
412
|
+
|
|
413
|
+
rb_define_method(rb_cWXAuiNotebook,"get_page_bitmap",RUBY_METHOD_FUNC(_get_page_bitmap),1);
|
|
414
|
+
rb_define_method(rb_cWXAuiNotebook,"set_page_bitmap",RUBY_METHOD_FUNC(_set_page_bitmap),2);
|
|
415
|
+
|
|
416
|
+
// rb_define_method(rb_cWXAuiNotebook,"each_page",RUBY_METHOD_FUNC(_each),0);
|
|
417
|
+
// rb_define_method(rb_cWXAuiNotebook,"page",RUBY_METHOD_FUNC(_page),1);
|
|
418
|
+
|
|
419
|
+
rb_define_const(rb_cWXAuiNotebook,"TAB_SPLIT",INT2NUM(wxAUI_NB_TAB_SPLIT));
|
|
420
|
+
rb_define_const(rb_cWXAuiNotebook,"TAB_MOVE",INT2NUM(wxAUI_NB_TAB_MOVE));
|
|
421
|
+
rb_define_const(rb_cWXAuiNotebook,"TAB_EXTERNAL_MOVE",INT2NUM(wxAUI_NB_TAB_EXTERNAL_MOVE));
|
|
422
|
+
rb_define_const(rb_cWXAuiNotebook,"TAB_FIXED_WIDTH",INT2NUM(wxAUI_NB_TAB_FIXED_WIDTH));
|
|
423
|
+
rb_define_const(rb_cWXAuiNotebook,"SCROLLBUTTONS",INT2NUM(wxAUI_NB_SCROLL_BUTTONS));
|
|
424
|
+
rb_define_const(rb_cWXAuiNotebook,"WINDOWLIST_BUTTON",INT2NUM(wxAUI_NB_WINDOWLIST_BUTTON));
|
|
425
|
+
rb_define_const(rb_cWXAuiNotebook,"CLOSE_BUTTON",INT2NUM(wxAUI_NB_CLOSE_BUTTON));
|
|
426
|
+
rb_define_const(rb_cWXAuiNotebook,"CLOSE_ON_ACTIVE_TAB",INT2NUM(wxAUI_NB_CLOSE_ON_ACTIVE_TAB));
|
|
427
|
+
rb_define_const(rb_cWXAuiNotebook,"CLOSE_ON_ALL_TABS",INT2NUM(wxAUI_NB_CLOSE_ON_ALL_TABS));
|
|
428
|
+
rb_define_const(rb_cWXAuiNotebook,"MIDDLE_CLICK_CLOSE",INT2NUM(wxAUI_NB_MIDDLE_CLICK_CLOSE));
|
|
429
|
+
rb_define_const(rb_cWXAuiNotebook,"DEFAULT_STYLE",INT2NUM(wxAUI_NB_DEFAULT_STYLE));
|
|
430
|
+
|
|
431
|
+
registerInfo<wxAuiNotebook>(rb_cWXAuiNotebook);
|
|
432
|
+
|
|
433
|
+
registerEventType("auinotebook_page_close", wxEVT_AUINOTEBOOK_PAGE_CLOSE,rb_cWXBookCtrlEvent);
|
|
434
|
+
registerEventType("auinotebook_page_changed", wxEVT_AUINOTEBOOK_PAGE_CHANGED,rb_cWXBookCtrlEvent);
|
|
435
|
+
registerEventType("auinotebook_page_changing", wxEVT_AUINOTEBOOK_PAGE_CHANGING,rb_cWXBookCtrlEvent);
|
|
436
|
+
registerEventType("auinotebook_page_closed", wxEVT_AUINOTEBOOK_PAGE_CLOSED,rb_cWXBookCtrlEvent);
|
|
437
|
+
registerEventType("auinotebook_button", wxEVT_AUINOTEBOOK_BUTTON,rb_cWXBookCtrlEvent);
|
|
438
|
+
registerEventType("auinotebook_begin_drag", wxEVT_AUINOTEBOOK_BEGIN_DRAG,rb_cWXBookCtrlEvent);
|
|
439
|
+
registerEventType("auinotebook_end_drag", wxEVT_AUINOTEBOOK_END_DRAG,rb_cWXBookCtrlEvent);
|
|
440
|
+
registerEventType("auinotebook_drag_motion", wxEVT_AUINOTEBOOK_DRAG_MOTION,rb_cWXBookCtrlEvent);
|
|
441
|
+
registerEventType("auinotebook_allow_dnd", wxEVT_AUINOTEBOOK_ALLOW_DND,rb_cWXBookCtrlEvent);
|
|
442
|
+
registerEventType("auinotebook_tab_middle_down", wxEVT_AUINOTEBOOK_TAB_MIDDLE_DOWN,rb_cWXBookCtrlEvent);
|
|
443
|
+
registerEventType("auinotebook_tab_middle_up", wxEVT_AUINOTEBOOK_TAB_MIDDLE_UP,rb_cWXBookCtrlEvent);
|
|
444
|
+
registerEventType("auinotebook_tab_right_down", wxEVT_AUINOTEBOOK_TAB_RIGHT_DOWN,rb_cWXBookCtrlEvent);
|
|
445
|
+
registerEventType("auinotebook_tab_right_up", wxEVT_AUINOTEBOOK_TAB_RIGHT_UP,rb_cWXBookCtrlEvent);
|
|
446
|
+
registerEventType("auinotebook_drag_done", wxEVT_AUINOTEBOOK_DRAG_DONE,rb_cWXBookCtrlEvent);
|
|
447
|
+
registerEventType("auinotebook_bg_dclick", wxEVT_AUINOTEBOOK_BG_DCLICK,rb_cWXBookCtrlEvent);
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
#endif
|
|
451
|
+
|
|
452
|
+
}
|
|
453
|
+
|