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,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxChoiceBook.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 15.04.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXCHOICEBOOK_HPP_
|
|
9
|
+
#define WXCHOICEBOOK_HPP_
|
|
10
|
+
|
|
11
|
+
#include "wxEvtHandler.hpp"
|
|
12
|
+
|
|
13
|
+
extern VALUE rb_cWXChoicebook;
|
|
14
|
+
|
|
15
|
+
void Init_WXChoiceBookCtrl(VALUE rb_mWX);
|
|
16
|
+
|
|
17
|
+
#if wxUSE_CHOICEBOOK
|
|
18
|
+
#include <wx/choicebk.h>
|
|
19
|
+
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#endif /* WXCHOICEBOOK_HPP_ */
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxCollapsiblePane.cpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 06.04.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#include "wxEvtHandler.hpp"
|
|
9
|
+
#include "wxControl.hpp"
|
|
10
|
+
#include "wxCollapsiblePane.hpp"
|
|
11
|
+
#include "wxCommandEvent.hpp"
|
|
12
|
+
|
|
13
|
+
VALUE rb_cWXCollapsiblePane, rb_cWXCollapsiblePaneEvent;
|
|
14
|
+
|
|
15
|
+
#if wxUSE_COLLPANE
|
|
16
|
+
#define _self unwrap<wxCollapsiblePane*>(self)
|
|
17
|
+
|
|
18
|
+
namespace RubyWX {
|
|
19
|
+
namespace CollapsiblePane {
|
|
20
|
+
|
|
21
|
+
APP_PROTECT(wxCollapsiblePane)
|
|
22
|
+
|
|
23
|
+
macro_attr_bool2(Collapsed,Collapse)
|
|
24
|
+
singlereturn(GetPane)
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* call-seq:
|
|
28
|
+
* CollapsiblePane.new(parent, name, [options])
|
|
29
|
+
* CollapsiblePane.new(parent, [options])
|
|
30
|
+
*
|
|
31
|
+
* creates a new Window widget.
|
|
32
|
+
* ===Arguments
|
|
33
|
+
* * parent of this window or nil
|
|
34
|
+
* * name is a String describing a resource in a loaded xrc
|
|
35
|
+
*
|
|
36
|
+
* *options: Hash with possible options to set
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
40
|
+
{
|
|
41
|
+
VALUE parent,name,hash;
|
|
42
|
+
rb_scan_args(argc, argv, "11:",&parent,&name,&hash);
|
|
43
|
+
if(!_created && !rb_obj_is_kind_of(name,rb_cString)){
|
|
44
|
+
wxWindowID id(wxID_ANY);
|
|
45
|
+
int style(wxCP_DEFAULT_STYLE);
|
|
46
|
+
wxString label;
|
|
47
|
+
|
|
48
|
+
if(rb_obj_is_kind_of(hash,rb_cHash))
|
|
49
|
+
{
|
|
50
|
+
set_hash_option(hash,"id",id,unwrapID);
|
|
51
|
+
set_hash_option(hash,"style",style);
|
|
52
|
+
set_hash_option(hash,"label",label);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
_self->Create(unwrap<wxWindow*>(parent), id, label,
|
|
56
|
+
wxDefaultPosition, wxDefaultSize, style
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
rb_call_super(argc,argv);
|
|
61
|
+
return self;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
namespace Event
|
|
65
|
+
{
|
|
66
|
+
#undef _self
|
|
67
|
+
#define _self unwrapTypedPtr<wxCollapsiblePaneEvent>(self,rb_cWXCollapsiblePaneEvent)
|
|
68
|
+
macro_attr(Collapsed,bool)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
#endif
|
|
74
|
+
|
|
75
|
+
DLL_LOCAL void Init_WXCollapsiblePane(VALUE rb_mWX)
|
|
76
|
+
{
|
|
77
|
+
#if 0
|
|
78
|
+
rb_mWX = rb_define_module("WX");
|
|
79
|
+
rb_cWXWindow = rb_define_class_under(rb_mWX,"Window",rb_cObject);
|
|
80
|
+
rb_cWXControl = rb_define_class_under(rb_mWX,"Control",rb_cWXWindow);
|
|
81
|
+
|
|
82
|
+
rb_define_attr(rb_cWXCollapsiblePane,"collapsed",1,1);
|
|
83
|
+
rb_define_attr(rb_cWXCollapsiblePaneEvent,"collapsed",1,1);
|
|
84
|
+
#endif
|
|
85
|
+
#if wxUSE_COLLPANE
|
|
86
|
+
using namespace RubyWX::CollapsiblePane;
|
|
87
|
+
rb_cWXCollapsiblePane = rb_define_class_under(rb_mWX,"CollapsiblePane",rb_cWXControl);
|
|
88
|
+
rb_define_alloc_func(rb_cWXCollapsiblePane,_alloc);
|
|
89
|
+
|
|
90
|
+
rb_define_method(rb_cWXCollapsiblePane,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
|
91
|
+
|
|
92
|
+
rb_define_attr_method(rb_cWXCollapsiblePane,"collapsed",_getCollapsed,_setCollapsed);
|
|
93
|
+
|
|
94
|
+
rb_define_method(rb_cWXCollapsiblePane,"pane",RUBY_METHOD_FUNC(_GetPane),0);
|
|
95
|
+
|
|
96
|
+
rb_cWXCollapsiblePaneEvent = rb_define_class_under(rb_cWXEvent,"CollapsiblePane",rb_cWXCommandEvent);
|
|
97
|
+
|
|
98
|
+
rb_define_attr_method(rb_cWXCollapsiblePaneEvent,"collapsed",Event::_getCollapsed,Event::_setCollapsed);
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
registerInfo<wxCollapsiblePane>(rb_cWXCollapsiblePane);
|
|
102
|
+
|
|
103
|
+
registerEventType("collapsiblepane_changed",wxEVT_COLLAPSIBLEPANE_CHANGED,rb_cWXCollapsiblePaneEvent);
|
|
104
|
+
#endif
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxCollapsiblePane.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 19.07.2014
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXCOLLAPSIBLEPANE_HPP_
|
|
9
|
+
#define WXCOLLAPSIBLEPANE_HPP_
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
#include "wxWindow.hpp"
|
|
13
|
+
|
|
14
|
+
extern VALUE rb_cWXCollapsiblePane;
|
|
15
|
+
DLL_LOCAL void Init_WXCollapsiblePane(VALUE rb_mWX);
|
|
16
|
+
|
|
17
|
+
#if wxUSE_COLLPANE
|
|
18
|
+
#include <wx/collpane.h>
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#endif /* WXCOLLAPSIBLEPANE_HPP_ */
|
data/ext/wxColor.cpp
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxColor.cpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 15.02.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#include "wxColor.hpp"
|
|
9
|
+
|
|
10
|
+
#define _self unwrap<wxColor*>(self)
|
|
11
|
+
|
|
12
|
+
VALUE rb_cWXColor;
|
|
13
|
+
ID rwxID_red,rwxID_blue,rwxID_green,rwxID_alpha;
|
|
14
|
+
|
|
15
|
+
template <>
|
|
16
|
+
VALUE wrap< wxColor >(wxColor *color )
|
|
17
|
+
{
|
|
18
|
+
return wrapTypedPtr(color, rb_cWXColor);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
template <>
|
|
22
|
+
bool is_wrapable< wxColor >(const VALUE &vcolor)
|
|
23
|
+
{
|
|
24
|
+
if (rb_obj_is_kind_of(vcolor, rb_cWXColor) ||
|
|
25
|
+
rb_obj_is_kind_of(vcolor, rb_cString) || FIXNUM_P(vcolor)){
|
|
26
|
+
return true;
|
|
27
|
+
} else if(rb_respond_to(vcolor,rwxID_red) &&
|
|
28
|
+
rb_respond_to(vcolor,rwxID_blue) &&
|
|
29
|
+
rb_respond_to(vcolor,rwxID_green)){
|
|
30
|
+
return true;
|
|
31
|
+
}else
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
template <>
|
|
36
|
+
wxColor* unwrap< wxColor* >(const VALUE &vcolor)
|
|
37
|
+
{
|
|
38
|
+
return unwrapTypedPtr<wxColor>(vcolor, rb_cWXColor);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
void set_color_part(char& cv,const VALUE &val, const ID &id)
|
|
42
|
+
{
|
|
43
|
+
VALUE tmp = rb_funcall(val,id,0);
|
|
44
|
+
if(FIXNUM_P(tmp))
|
|
45
|
+
cv = NUM2CHR(tmp);
|
|
46
|
+
else
|
|
47
|
+
cv = NUM2DBL(tmp) * 256;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
template <>
|
|
51
|
+
wxColor unwrap< wxColor >(const VALUE &vcolor)
|
|
52
|
+
{
|
|
53
|
+
if(rb_obj_is_kind_of(vcolor, rb_cString)){
|
|
54
|
+
wxLogNull logNo;
|
|
55
|
+
wxString name(unwrap<wxString>(vcolor));
|
|
56
|
+
wxColor col(name);
|
|
57
|
+
if(!col.IsOk())
|
|
58
|
+
rb_raise(
|
|
59
|
+
rb_eTypeError,
|
|
60
|
+
"%"PRIsVALUE" is not valid %"PRIsVALUE, vcolor, rb_cWXColor
|
|
61
|
+
);
|
|
62
|
+
return col;
|
|
63
|
+
}else if(FIXNUM_P(vcolor))
|
|
64
|
+
return wxColor(FIX2LONG(vcolor));
|
|
65
|
+
else if(!rb_obj_is_kind_of(vcolor, rb_cWXColor) &&
|
|
66
|
+
rb_respond_to(vcolor,rwxID_red) &&
|
|
67
|
+
rb_respond_to(vcolor,rwxID_green) &&
|
|
68
|
+
rb_respond_to(vcolor,rwxID_blue)){
|
|
69
|
+
char red,green,blue,alpha(wxALPHA_OPAQUE);
|
|
70
|
+
wxColor color;
|
|
71
|
+
|
|
72
|
+
set_color_part(red, vcolor, rwxID_red);
|
|
73
|
+
set_color_part(green, vcolor, rwxID_green);
|
|
74
|
+
set_color_part(blue, vcolor, rwxID_blue);
|
|
75
|
+
|
|
76
|
+
if(rb_respond_to(vcolor,rwxID_alpha)) {
|
|
77
|
+
set_color_part(alpha, vcolor, rwxID_alpha);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
color.Set(red, green, blue, alpha);
|
|
81
|
+
|
|
82
|
+
return color;
|
|
83
|
+
}else{
|
|
84
|
+
return *unwrap<wxColor*>(vcolor);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
namespace RubyWX {
|
|
91
|
+
namespace Color {
|
|
92
|
+
DLL_LOCAL VALUE _alloc(VALUE self) {
|
|
93
|
+
return wrap(new wxColor);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
void define_const()
|
|
97
|
+
{
|
|
98
|
+
if(rb_const_defined(rb_cWXColor,rb_intern("BLACK")))
|
|
99
|
+
return;
|
|
100
|
+
|
|
101
|
+
rb_define_const(rb_cWXColor,"BLACK",wrap(wxBLACK));
|
|
102
|
+
rb_define_const(rb_cWXColor,"BLUE",wrap(wxBLUE));
|
|
103
|
+
rb_define_const(rb_cWXColor,"CYAN",wrap(wxCYAN));
|
|
104
|
+
rb_define_const(rb_cWXColor,"GREEN",wrap(wxGREEN));
|
|
105
|
+
rb_define_const(rb_cWXColor,"YELLOW",wrap(wxYELLOW));
|
|
106
|
+
rb_define_const(rb_cWXColor,"LIGHT_GREY",wrap(wxLIGHT_GREY));
|
|
107
|
+
rb_define_const(rb_cWXColor,"RED",wrap(wxRED));
|
|
108
|
+
rb_define_const(rb_cWXColor,"WHITE",wrap(wxWHITE));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
DLL_LOCAL VALUE _getRed(VALUE self)
|
|
112
|
+
{
|
|
113
|
+
if(_self->IsOk())
|
|
114
|
+
return CHR2FIX(_self->Red());
|
|
115
|
+
else
|
|
116
|
+
return CHR2FIX(0);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
DLL_LOCAL VALUE _getGreen(VALUE self)
|
|
120
|
+
{
|
|
121
|
+
if(_self->IsOk())
|
|
122
|
+
return CHR2FIX(_self->Green());
|
|
123
|
+
else
|
|
124
|
+
return CHR2FIX(0);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
DLL_LOCAL VALUE _getBlue(VALUE self)
|
|
128
|
+
{
|
|
129
|
+
if(_self->IsOk())
|
|
130
|
+
return CHR2FIX(_self->Blue());
|
|
131
|
+
else
|
|
132
|
+
return CHR2FIX(0);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
DLL_LOCAL VALUE _getAlpha(VALUE self)
|
|
136
|
+
{
|
|
137
|
+
if(_self->IsOk())
|
|
138
|
+
return CHR2FIX(_self->Alpha());
|
|
139
|
+
else
|
|
140
|
+
return CHR2FIX(0);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
DLL_LOCAL char val_to_char(VALUE val)
|
|
144
|
+
{
|
|
145
|
+
char cval(0);
|
|
146
|
+
if(FIXNUM_P(val))
|
|
147
|
+
cval = NUM2CHR(val);
|
|
148
|
+
else
|
|
149
|
+
cval = NUM2DBL(val) * 256;
|
|
150
|
+
return cval;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
DLL_LOCAL VALUE _setRed(VALUE self,VALUE val)
|
|
154
|
+
{
|
|
155
|
+
rb_check_frozen(self);
|
|
156
|
+
|
|
157
|
+
if(_self->IsOk())
|
|
158
|
+
_self->Set(val_to_char(val),_self->Green(),_self->Blue(),_self->Alpha());
|
|
159
|
+
else
|
|
160
|
+
_self->Set(val_to_char(val),0,0,0);
|
|
161
|
+
return val;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
DLL_LOCAL VALUE _setGreen(VALUE self,VALUE val)
|
|
165
|
+
{
|
|
166
|
+
rb_check_frozen(self);
|
|
167
|
+
if(_self->IsOk())
|
|
168
|
+
_self->Set(_self->Red(),val_to_char(val),_self->Blue(),_self->Alpha());
|
|
169
|
+
else
|
|
170
|
+
_self->Set(0,val_to_char(val),0,0);
|
|
171
|
+
return val;
|
|
172
|
+
}
|
|
173
|
+
DLL_LOCAL VALUE _setBlue(VALUE self,VALUE val)
|
|
174
|
+
{
|
|
175
|
+
rb_check_frozen(self);
|
|
176
|
+
if(_self->IsOk())
|
|
177
|
+
_self->Set(_self->Red(),_self->Green(),val_to_char(val),_self->Alpha());
|
|
178
|
+
else
|
|
179
|
+
_self->Set(0,0,val_to_char(val),0);
|
|
180
|
+
return val;
|
|
181
|
+
}
|
|
182
|
+
DLL_LOCAL VALUE _setAlpha(VALUE self,VALUE val)
|
|
183
|
+
{
|
|
184
|
+
rb_check_frozen(self);
|
|
185
|
+
|
|
186
|
+
int red(0), green(0), blue(0), alpha(0);
|
|
187
|
+
|
|
188
|
+
if(_self->IsOk()) {
|
|
189
|
+
red = _self->Red();
|
|
190
|
+
green = _self->Green();
|
|
191
|
+
blue = _self->Blue();
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if(!RTEST(val))
|
|
195
|
+
alpha = wxALPHA_OPAQUE;
|
|
196
|
+
else if(val == Qtrue)
|
|
197
|
+
alpha = wxALPHA_TRANSPARENT;
|
|
198
|
+
else
|
|
199
|
+
alpha = val_to_char(val);
|
|
200
|
+
|
|
201
|
+
_self->Set(red, green, blue, alpha);
|
|
202
|
+
return val;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
DLL_LOCAL VALUE _tos(VALUE self)
|
|
206
|
+
{
|
|
207
|
+
return wrap(wxToString(*_self));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
DLL_LOCAL VALUE _name(VALUE self)
|
|
211
|
+
{
|
|
212
|
+
if(wxColourDatabase *database = wxTheColourDatabase) {
|
|
213
|
+
wxString name(database->FindName(*_self).MakeLower());
|
|
214
|
+
if(name.empty())
|
|
215
|
+
return Qnil;
|
|
216
|
+
return wrap(name);
|
|
217
|
+
}
|
|
218
|
+
return Qnil;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
/*
|
|
223
|
+
* call-seq:
|
|
224
|
+
* Color.new(red,green,blue[,alpha])
|
|
225
|
+
*
|
|
226
|
+
* creates a new Color Object.
|
|
227
|
+
*/
|
|
228
|
+
DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
229
|
+
{
|
|
230
|
+
VALUE red,green,blue,alpha;
|
|
231
|
+
rb_scan_args(argc, argv, "31",&red,&green,&blue,&alpha);
|
|
232
|
+
_setRed(self,red);
|
|
233
|
+
_setGreen(self,green);
|
|
234
|
+
_setBlue(self,blue);
|
|
235
|
+
_setAlpha(self, alpha);
|
|
236
|
+
return self;
|
|
237
|
+
}
|
|
238
|
+
/*
|
|
239
|
+
*/
|
|
240
|
+
DLL_LOCAL VALUE _initialize_copy(VALUE self, VALUE other)
|
|
241
|
+
{
|
|
242
|
+
VALUE result = rb_call_super(1,&other);
|
|
243
|
+
_setRed(self,_getRed(other));
|
|
244
|
+
_setGreen(self,_getGreen(other));
|
|
245
|
+
_setBlue(self,_getBlue(other));
|
|
246
|
+
_setAlpha(self,_getAlpha(other));
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/*
|
|
251
|
+
* call-seq:
|
|
252
|
+
* inspect -> String
|
|
253
|
+
*
|
|
254
|
+
* Human-readable description.
|
|
255
|
+
* ===Return value
|
|
256
|
+
* String
|
|
257
|
+
*/
|
|
258
|
+
DLL_LOCAL VALUE _inspect(VALUE self)
|
|
259
|
+
{
|
|
260
|
+
return rb_sprintf( "%s(%d, %d, %d, %d)",
|
|
261
|
+
rb_obj_classname( self ),
|
|
262
|
+
FIX2INT(_getRed(self)),
|
|
263
|
+
FIX2INT(_getGreen(self)),
|
|
264
|
+
FIX2INT(_getBlue(self)),
|
|
265
|
+
FIX2INT(_getAlpha(self))
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/*
|
|
270
|
+
* call-seq:
|
|
271
|
+
* marshal_dump -> Array
|
|
272
|
+
*
|
|
273
|
+
* Provides marshalling support for use by the Marshal library.
|
|
274
|
+
* ===Return value
|
|
275
|
+
* Array
|
|
276
|
+
*/
|
|
277
|
+
DLL_LOCAL VALUE _marshal_dump(VALUE self)
|
|
278
|
+
{
|
|
279
|
+
VALUE ptr[4];
|
|
280
|
+
ptr[0] = _getRed(self);
|
|
281
|
+
ptr[1] = _getGreen(self);
|
|
282
|
+
ptr[2] = _getBlue(self);
|
|
283
|
+
ptr[3] = _getAlpha(self);
|
|
284
|
+
return rb_ary_new4(4, ptr);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/*
|
|
288
|
+
* call-seq:
|
|
289
|
+
* marshal_load(array) -> nil
|
|
290
|
+
*
|
|
291
|
+
* Provides marshalling support for use by the Marshal library.
|
|
292
|
+
*
|
|
293
|
+
*
|
|
294
|
+
*/
|
|
295
|
+
DLL_LOCAL VALUE _marshal_load(VALUE self, VALUE data)
|
|
296
|
+
{
|
|
297
|
+
_setRed(self, RARRAY_AREF(data,0));
|
|
298
|
+
_setGreen(self, RARRAY_AREF(data,1));
|
|
299
|
+
_setBlue(self, RARRAY_AREF(data,2));
|
|
300
|
+
_setAlpha(self, RARRAY_AREF(data,3));
|
|
301
|
+
return Qnil;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
struct equal_obj {
|
|
305
|
+
wxColor* self;
|
|
306
|
+
VALUE other;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
VALUE _equal_block(equal_obj *obj)
|
|
310
|
+
{
|
|
311
|
+
return wrap(*obj->self == unwrap<wxColor>(obj->other));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
VALUE _equal_rescue(VALUE val)
|
|
315
|
+
{
|
|
316
|
+
return Qfalse;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/*
|
|
320
|
+
* call-seq:
|
|
321
|
+
* == color -> bool
|
|
322
|
+
*
|
|
323
|
+
* compares two colors.
|
|
324
|
+
*
|
|
325
|
+
*
|
|
326
|
+
*/
|
|
327
|
+
DLL_LOCAL VALUE _equal(VALUE self, VALUE other)
|
|
328
|
+
{
|
|
329
|
+
equal_obj obj;
|
|
330
|
+
obj.self = _self;
|
|
331
|
+
obj.other = other;
|
|
332
|
+
|
|
333
|
+
return rb_rescue(
|
|
334
|
+
RUBY_METHOD_FUNC(_equal_block),(VALUE)&obj,
|
|
335
|
+
RUBY_METHOD_FUNC(_equal_rescue),Qnil
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
/*
|
|
346
|
+
* Document-class: WX::Color
|
|
347
|
+
*
|
|
348
|
+
* This class represents an Color.
|
|
349
|
+
*/
|
|
350
|
+
|
|
351
|
+
/* Document-attr: red
|
|
352
|
+
* returns the red value of Color.
|
|
353
|
+
*/
|
|
354
|
+
/* Document-attr: blue
|
|
355
|
+
* returns the blue value of Color.
|
|
356
|
+
*/
|
|
357
|
+
/* Document-attr: green
|
|
358
|
+
* returns the green value of Color.
|
|
359
|
+
*/
|
|
360
|
+
/* Document-attr: alpha
|
|
361
|
+
* returns the alpha value of Color.
|
|
362
|
+
*/
|
|
363
|
+
|
|
364
|
+
/* Document-const: BLACK
|
|
365
|
+
* predefined Color constant.
|
|
366
|
+
*/
|
|
367
|
+
/* Document-const: BLUE
|
|
368
|
+
* predefined Color constant.
|
|
369
|
+
*/
|
|
370
|
+
/* Document-const: CYAN
|
|
371
|
+
* predefined Color constant.
|
|
372
|
+
*/
|
|
373
|
+
/* Document-const: GREEN
|
|
374
|
+
* predefined Color constant.
|
|
375
|
+
*/
|
|
376
|
+
/* Document-const: YELLOW
|
|
377
|
+
* predefined Color constant.
|
|
378
|
+
*/
|
|
379
|
+
/* Document-const: LIGHT_GREY
|
|
380
|
+
* predefined Color constant.
|
|
381
|
+
*/
|
|
382
|
+
/* Document-const: RED
|
|
383
|
+
* predefined Color constant.
|
|
384
|
+
*/
|
|
385
|
+
/* Document-const: WHITE
|
|
386
|
+
* predefined Color constant.
|
|
387
|
+
*/
|
|
388
|
+
DLL_LOCAL void Init_WXColor(VALUE rb_mWX)
|
|
389
|
+
{
|
|
390
|
+
using namespace RubyWX::Color;
|
|
391
|
+
rb_cWXColor = rb_define_class_under(rb_mWX,"Color",rb_cObject);
|
|
392
|
+
|
|
393
|
+
#if 0
|
|
394
|
+
rb_define_attr(rb_cWXColor,"red",1,1);
|
|
395
|
+
rb_define_attr(rb_cWXColor,"green",1,1);
|
|
396
|
+
rb_define_attr(rb_cWXColor,"blue",1,1);
|
|
397
|
+
rb_define_attr(rb_cWXColor,"alpha",1,1);
|
|
398
|
+
|
|
399
|
+
rb_define_const(rb_cWXColor,"BLACK",wrap(wxBLACK));
|
|
400
|
+
rb_define_const(rb_cWXColor,"BLUE",wrap(wxBLUE));
|
|
401
|
+
rb_define_const(rb_cWXColor,"CYAN",wrap(wxCYAN));
|
|
402
|
+
rb_define_const(rb_cWXColor,"GREEN",wrap(wxGREEN));
|
|
403
|
+
rb_define_const(rb_cWXColor,"YELLOW",wrap(wxYELLOW));
|
|
404
|
+
rb_define_const(rb_cWXColor,"LIGHT_GREY",wrap(wxLIGHT_GREY));
|
|
405
|
+
rb_define_const(rb_cWXColor,"RED",wrap(wxRED));
|
|
406
|
+
rb_define_const(rb_cWXColor,"WHITE",wrap(wxWHITE));
|
|
407
|
+
#endif
|
|
408
|
+
|
|
409
|
+
rb_define_alloc_func(rb_cWXColor,_alloc);
|
|
410
|
+
|
|
411
|
+
rb_define_method(rb_cWXColor,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
|
412
|
+
rb_define_private_method(rb_cWXColor,"initialize_copy",RUBY_METHOD_FUNC(_initialize_copy),1);
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
rb_define_attr_method(rb_cWXColor,"red",_getRed,_setRed);
|
|
416
|
+
rb_define_attr_method(rb_cWXColor,"green",_getGreen,_setGreen);
|
|
417
|
+
rb_define_attr_method(rb_cWXColor,"blue",_getBlue,_setBlue);
|
|
418
|
+
rb_define_attr_method(rb_cWXColor,"alpha",_getAlpha,_setAlpha);
|
|
419
|
+
|
|
420
|
+
rb_define_method(rb_cWXColor,"to_s",RUBY_METHOD_FUNC(_tos),0);
|
|
421
|
+
rb_define_method(rb_cWXColor,"name",RUBY_METHOD_FUNC(_name),0);
|
|
422
|
+
rb_define_method(rb_cWXColor,"inspect",RUBY_METHOD_FUNC(_inspect),0);
|
|
423
|
+
|
|
424
|
+
rb_define_method(rb_cWXColor,"marshal_dump",RUBY_METHOD_FUNC(_marshal_dump),0);
|
|
425
|
+
rb_define_method(rb_cWXColor,"marshal_load",RUBY_METHOD_FUNC(_marshal_load),1);
|
|
426
|
+
|
|
427
|
+
rb_define_method(rb_cWXColor,"==",RUBY_METHOD_FUNC(_equal),1);
|
|
428
|
+
|
|
429
|
+
rwxID_red = rb_intern("red");
|
|
430
|
+
rwxID_blue = rb_intern("blue");
|
|
431
|
+
rwxID_green = rb_intern("green");
|
|
432
|
+
rwxID_alpha = rb_intern("alpha");
|
|
433
|
+
|
|
434
|
+
registerType<wxColor>(rb_cWXColor, true);
|
|
435
|
+
}
|