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
data/ext/wxStatusBar.hpp
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxStatusBar.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 26.02.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXSTATUSBAR_HPP_
|
|
9
|
+
#define WXSTATUSBAR_HPP_
|
|
10
|
+
|
|
11
|
+
#include "wxControl.hpp"
|
|
12
|
+
|
|
13
|
+
extern VALUE rb_cWXStatusBar;
|
|
14
|
+
|
|
15
|
+
DLL_LOCAL void Init_WXStatusBar(VALUE rb_mWX);
|
|
16
|
+
|
|
17
|
+
#endif /* WXSTATUSBAR_HPP_ */
|
data/ext/wxStream.cpp
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxStream.cpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 22.02.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
#include "wxStream.hpp"
|
|
8
|
+
#if wxUSE_STREAMS
|
|
9
|
+
wxFileOffset RubyInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode)
|
|
10
|
+
{
|
|
11
|
+
return NUM2INT(rb_funcall(mRuby,rb_intern("seek"),2,INT2NUM(seek),INT2NUM(mode)));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
wxFileOffset RubyInputStream::OnSysTell() const
|
|
15
|
+
{
|
|
16
|
+
return NUM2INT(rb_funcall(mRuby,rb_intern("tell"),0));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
bool RubyInputStream::IsSeekable() const
|
|
20
|
+
{
|
|
21
|
+
return rb_respond_to(mRuby,rb_intern("seek"));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
bool RubyInputStream::Eof() const
|
|
25
|
+
{
|
|
26
|
+
return RTEST(rb_funcall(mRuby,rb_intern("eof?"),0));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
bool RubyInputStream::CanRead() const
|
|
30
|
+
{
|
|
31
|
+
return !Eof() && !RTEST(rb_funcall(mRuby,rb_intern("closed?"),0));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
size_t RubyInputStream::OnSysRead(void *buffer, size_t size)
|
|
35
|
+
{
|
|
36
|
+
VALUE str = rb_funcall(mRuby,rb_intern("read"),1,INT2NUM(size));
|
|
37
|
+
size_t s = RSTRING_LEN(str);
|
|
38
|
+
memcpy(buffer, RSTRING_PTR(str), s);
|
|
39
|
+
return s;
|
|
40
|
+
}
|
|
41
|
+
#endif
|
data/ext/wxStream.hpp
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxStream.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 22.02.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXSTREAM_HPP_
|
|
9
|
+
#define WXSTREAM_HPP_
|
|
10
|
+
|
|
11
|
+
#include "main.hpp"
|
|
12
|
+
#if wxUSE_STREAMS
|
|
13
|
+
class RubyInputStream : public wxInputStream
|
|
14
|
+
{
|
|
15
|
+
public:
|
|
16
|
+
RubyInputStream(VALUE obj) : mRuby(obj) {}
|
|
17
|
+
|
|
18
|
+
bool Eof() const;
|
|
19
|
+
bool CanRead() const;
|
|
20
|
+
bool IsSeekable() const;
|
|
21
|
+
|
|
22
|
+
protected:
|
|
23
|
+
size_t OnSysRead(void *buffer, size_t size);
|
|
24
|
+
wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode);
|
|
25
|
+
wxFileOffset OnSysTell() const;
|
|
26
|
+
private:
|
|
27
|
+
VALUE mRuby;
|
|
28
|
+
};
|
|
29
|
+
//
|
|
30
|
+
//class RubyOutputStream :virtual public wxOutputStream
|
|
31
|
+
//{
|
|
32
|
+
//public:
|
|
33
|
+
// RubyOutputStream(VALUE obj);
|
|
34
|
+
//
|
|
35
|
+
// bool IsSeekable() const {
|
|
36
|
+
// return true;
|
|
37
|
+
// }
|
|
38
|
+
//protected:
|
|
39
|
+
// size_t OnSysWrite(const void *buffer, size_t bufsize);
|
|
40
|
+
// wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode);
|
|
41
|
+
// wxFileOffset OnSysTell() const;
|
|
42
|
+
//private:
|
|
43
|
+
// VALUE mRuby;
|
|
44
|
+
//};
|
|
45
|
+
#endif
|
|
46
|
+
#endif /* WXSTREAM_HPP_ */
|
data/ext/wxTaskBar.cpp
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxTaskBar.cpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 14.04.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#include "wxTaskBar.hpp"
|
|
9
|
+
#include "wxEvtHandler.hpp"
|
|
10
|
+
#include "wxBitmap.hpp"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
VALUE rb_cWXTaskBar;
|
|
14
|
+
#if wxUSE_TASKBARICON
|
|
15
|
+
|
|
16
|
+
#define _self unwrap<RubyTaskBarIcon*>(self)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const wxIcon& RubyTaskBarIcon::GetIcon() const {return *mIcon;}
|
|
20
|
+
bool RubyTaskBarIcon::SetIcon(const wxIcon& icon,const wxString& tool)
|
|
21
|
+
{
|
|
22
|
+
mIcon = &icon;
|
|
23
|
+
if(icon.IsOk())
|
|
24
|
+
return wxTaskBarIcon::SetIcon(icon,mTooltip);
|
|
25
|
+
else
|
|
26
|
+
RemoveIcon();
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
wxString RubyTaskBarIcon::GetToolTip() const {return mTooltip;}
|
|
31
|
+
void RubyTaskBarIcon::SetToolTip(const wxString& tooltip)
|
|
32
|
+
{
|
|
33
|
+
mTooltip = tooltip;
|
|
34
|
+
if(mIcon->IsOk())
|
|
35
|
+
wxTaskBarIcon::SetIcon(*mIcon,mTooltip);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
namespace RubyWX {
|
|
40
|
+
namespace TaskBar {
|
|
41
|
+
|
|
42
|
+
APP_PROTECT(RubyTaskBarIcon)
|
|
43
|
+
|
|
44
|
+
macro_attr(Menu,wxMenu*)
|
|
45
|
+
macro_attr(Icon,wxIcon)
|
|
46
|
+
macro_attr(ToolTip,wxString)
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#endif
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/* Document-attr: menu
|
|
55
|
+
* the menu of the TaskBar. WX::Menu
|
|
56
|
+
*/
|
|
57
|
+
/* Document-attr: icon
|
|
58
|
+
* the icon of the TaskBar. WX::Bitmap
|
|
59
|
+
*/
|
|
60
|
+
/* Document-attr: tooltip
|
|
61
|
+
* the tooltip of the TaskBar. String
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
DLL_LOCAL void Init_WXTaskBar(VALUE rb_mWX)
|
|
65
|
+
{
|
|
66
|
+
#if wxUSE_TASKBARICON
|
|
67
|
+
#if 0
|
|
68
|
+
rb_define_attr(rb_cWXTaskBar,"menu",1,1);
|
|
69
|
+
rb_define_attr(rb_cWXTaskBar,"icon",1,1);
|
|
70
|
+
rb_define_attr(rb_cWXTaskBar,"tooltip",1,1);
|
|
71
|
+
|
|
72
|
+
rb_mWXEvtHandler = rb_define_module_under(rb_mWX,"EvtHandler");
|
|
73
|
+
#endif
|
|
74
|
+
using namespace RubyWX::TaskBar;
|
|
75
|
+
|
|
76
|
+
rb_cWXTaskBar = rb_define_class_under(rb_mWX,"TaskBar",rb_cObject);
|
|
77
|
+
rb_define_alloc_func(rb_cWXTaskBar,_alloc);
|
|
78
|
+
|
|
79
|
+
rb_undef_method(rb_cWXTaskBar,"initialize_copy");
|
|
80
|
+
rb_undef_method(rb_cWXTaskBar,"_load");
|
|
81
|
+
rb_undef_method(rb_cWXTaskBar,"_dump");
|
|
82
|
+
|
|
83
|
+
rb_include_module(rb_cWXTaskBar,rb_mWXEvtHandler);
|
|
84
|
+
|
|
85
|
+
rb_define_attr_method(rb_cWXTaskBar,"menu",_getMenu,_setMenu);
|
|
86
|
+
rb_define_attr_method(rb_cWXTaskBar,"icon",_getIcon,_setIcon);
|
|
87
|
+
rb_define_attr_method(rb_cWXTaskBar,"tooltip",_getToolTip,_setToolTip);
|
|
88
|
+
|
|
89
|
+
registerInfo<wxTaskBarIcon>(rb_cWXTaskBar);
|
|
90
|
+
registerInfo<RubyTaskBarIcon>(rb_cWXTaskBar);
|
|
91
|
+
|
|
92
|
+
registerEventType("taskbar_move",wxEVT_TASKBAR_MOVE);
|
|
93
|
+
registerEventType("taskbar_left_down",wxEVT_TASKBAR_LEFT_DOWN);
|
|
94
|
+
registerEventType("taskbar_left_up",wxEVT_TASKBAR_LEFT_UP);
|
|
95
|
+
registerEventType("taskbar_right_down",wxEVT_TASKBAR_RIGHT_DOWN);
|
|
96
|
+
registerEventType("taskbar_right_up",wxEVT_TASKBAR_RIGHT_UP);
|
|
97
|
+
registerEventType("taskbar_left_dclick",wxEVT_TASKBAR_LEFT_DCLICK);
|
|
98
|
+
registerEventType("taskbar_right_dclick",wxEVT_TASKBAR_RIGHT_DCLICK);
|
|
99
|
+
registerEventType("taskbar_balloon_timeout",wxEVT_TASKBAR_BALLOON_TIMEOUT);
|
|
100
|
+
registerEventType("taskbar_balloon_click",wxEVT_TASKBAR_BALLOON_CLICK);
|
|
101
|
+
|
|
102
|
+
#endif
|
|
103
|
+
}
|
|
104
|
+
|
data/ext/wxTaskBar.hpp
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxTaskBar.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 14.04.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXTASKBAR_HPP_
|
|
9
|
+
#define WXTASKBAR_HPP_
|
|
10
|
+
|
|
11
|
+
#include "main.hpp"
|
|
12
|
+
extern VALUE rb_cWXTaskBar;
|
|
13
|
+
DLL_LOCAL void Init_WXTaskBar(VALUE rb_mWX);
|
|
14
|
+
|
|
15
|
+
#if wxUSE_TASKBARICON
|
|
16
|
+
|
|
17
|
+
#include <wx/taskbar.h>
|
|
18
|
+
|
|
19
|
+
class RubyTaskBarIcon : public wxTaskBarIcon {
|
|
20
|
+
|
|
21
|
+
public:
|
|
22
|
+
wxMenu* GetMenu() const {return mMenu;};
|
|
23
|
+
void SetMenu(wxMenu* menu) {mMenu = menu;};
|
|
24
|
+
|
|
25
|
+
const wxIcon& GetIcon() const;
|
|
26
|
+
bool SetIcon(const wxIcon& icon,const wxString& tool = wxString());
|
|
27
|
+
|
|
28
|
+
wxString GetToolTip() const;
|
|
29
|
+
void SetToolTip(const wxString& tooltip);
|
|
30
|
+
private:
|
|
31
|
+
wxMenu* mMenu;
|
|
32
|
+
const wxIcon* mIcon;
|
|
33
|
+
wxString mTooltip;
|
|
34
|
+
|
|
35
|
+
wxMenu* CreatePopupMenu() { return mMenu;}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
#endif /* WXTASKBAR_HPP_ */
|
data/ext/wxTextArea.cpp
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxTextArea.cpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 30.12.2013
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#include "wxTextArea.hpp"
|
|
9
|
+
#include "wxTextAttr.hpp"
|
|
10
|
+
#include "wxTextCtrl.hpp"
|
|
11
|
+
#include "wxRichTextCtrl.hpp"
|
|
12
|
+
#include "wxSearchCtrl.hpp"
|
|
13
|
+
#include "wxSTC.hpp"
|
|
14
|
+
|
|
15
|
+
VALUE rb_mWXTextArea;
|
|
16
|
+
|
|
17
|
+
#if wxUSE_TEXTCTRL
|
|
18
|
+
|
|
19
|
+
template <>
|
|
20
|
+
wxTextAreaBase* unwrap< wxTextAreaBase* >(const VALUE &obj)
|
|
21
|
+
{
|
|
22
|
+
if(rb_obj_is_kind_of(obj,rb_cWXTextCtrl))
|
|
23
|
+
return unwrap<wxTextCtrl*>(obj);
|
|
24
|
+
#if wxUSE_RICHTEXT
|
|
25
|
+
if(rb_obj_is_kind_of(obj,rb_cWXRichTextCtrl))
|
|
26
|
+
return unwrap<wxRichTextCtrl*>(obj);
|
|
27
|
+
#endif
|
|
28
|
+
#if wxUSE_SEARCHCTRL
|
|
29
|
+
if(rb_obj_is_kind_of(obj,rb_cWXSearchCtrl))
|
|
30
|
+
return unwrap<wxSearchCtrl*>(obj);
|
|
31
|
+
#endif
|
|
32
|
+
#if wxUSE_STC
|
|
33
|
+
if(rb_obj_is_kind_of(obj,rb_cWXSTC))
|
|
34
|
+
return unwrap<wxStyledTextCtrl*>(obj);
|
|
35
|
+
#endif
|
|
36
|
+
rb_raise(rb_eTypeError,"Unknown wxTextAreaBase: %s",rb_obj_classname(obj));
|
|
37
|
+
return NULL;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#define _self unwrap<wxTextAreaBase*>(self)
|
|
41
|
+
|
|
42
|
+
namespace RubyWX {
|
|
43
|
+
namespace TextArea {
|
|
44
|
+
|
|
45
|
+
macro_attr_bool(Modified)
|
|
46
|
+
|
|
47
|
+
macro_attr(DefaultStyle,wxTextAttr)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/*
|
|
51
|
+
* call-seq:
|
|
52
|
+
* initialize(parent, [options])
|
|
53
|
+
*
|
|
54
|
+
*
|
|
55
|
+
* ===Arguments
|
|
56
|
+
* * parent of this window or nil
|
|
57
|
+
*
|
|
58
|
+
* *options: Hash with possible options to set:
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
DLL_LOCAL VALUE _initialize(int argc,VALUE *argv,VALUE self)
|
|
62
|
+
{
|
|
63
|
+
VALUE parent,name,hash;
|
|
64
|
+
rb_scan_args(argc, argv, "11:",&parent,&name,&hash);
|
|
65
|
+
|
|
66
|
+
rb_call_super(argc,argv);
|
|
67
|
+
if(rb_obj_is_kind_of(hash,rb_cHash))
|
|
68
|
+
{
|
|
69
|
+
VALUE temp;
|
|
70
|
+
set_option(modified,Modified,bool)
|
|
71
|
+
set_option(default_style,DefaultStyle,wxTextAttr)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return self;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
VALUE _each_line_size(VALUE self)
|
|
79
|
+
{
|
|
80
|
+
return INT2NUM(_self->GetNumberOfLines());
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
VALUE _each_line(VALUE self)
|
|
84
|
+
{
|
|
85
|
+
RETURN_SIZED_ENUMERATOR(self,0,NULL,RUBY_METHOD_FUNC(_each_line_size));
|
|
86
|
+
|
|
87
|
+
int count = _self->GetNumberOfLines();
|
|
88
|
+
for(int i = 0; i < count; ++i)
|
|
89
|
+
{
|
|
90
|
+
rb_yield(wrap(_self->GetLineText(i)));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return self;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
VALUE _load_file(VALUE self,VALUE file)
|
|
97
|
+
{
|
|
98
|
+
if(!check_file_loadable(unwrap<wxString>(file)))
|
|
99
|
+
return Qfalse;
|
|
100
|
+
return wrap(_self->LoadFile(unwrap<wxString>(file)));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
VALUE _save_file(VALUE self,VALUE file)
|
|
104
|
+
{
|
|
105
|
+
if(!check_file_saveable(unwrap<wxString>(file)))
|
|
106
|
+
return Qfalse;
|
|
107
|
+
|
|
108
|
+
return wrap(_self->SaveFile(unwrap<wxString>(file)));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
#endif
|
|
116
|
+
|
|
117
|
+
DLL_LOCAL void Init_WXTextArea(VALUE rb_mWX)
|
|
118
|
+
{
|
|
119
|
+
#if 0
|
|
120
|
+
rb_define_attr(rb_mWXTextArea,"modified",1,1);
|
|
121
|
+
rb_define_attr(rb_mWXTextArea,"default_style",1,1);
|
|
122
|
+
#endif
|
|
123
|
+
|
|
124
|
+
#if wxUSE_TEXTCTRL
|
|
125
|
+
using namespace RubyWX::TextArea;
|
|
126
|
+
rb_mWXTextArea = rb_define_module_under(rb_mWX,"TextArea");
|
|
127
|
+
rb_define_method(rb_mWXTextArea,"each_line",RUBY_METHOD_FUNC(_each_line),0);
|
|
128
|
+
|
|
129
|
+
rb_define_method(rb_mWXTextArea,"initialize",RUBY_METHOD_FUNC(_initialize),-1);
|
|
130
|
+
|
|
131
|
+
rb_define_attr_method(rb_mWXTextArea,"modified",_getModified,_setModified);
|
|
132
|
+
rb_define_attr_method(rb_mWXTextArea,"default_style",_getDefaultStyle,_setDefaultStyle);
|
|
133
|
+
|
|
134
|
+
rb_define_method(rb_mWXTextArea,"load_file",RUBY_METHOD_FUNC(_load_file),1);
|
|
135
|
+
rb_define_method(rb_mWXTextArea,"save_file",RUBY_METHOD_FUNC(_save_file),1);
|
|
136
|
+
#endif
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
data/ext/wxTextArea.hpp
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxTextArea.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 30.12.2013
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXTEXTAREA_HPP_
|
|
9
|
+
#define WXTEXTAREA_HPP_
|
|
10
|
+
|
|
11
|
+
#include "wxControl.hpp"
|
|
12
|
+
|
|
13
|
+
extern VALUE rb_mWXTextArea;
|
|
14
|
+
|
|
15
|
+
void Init_WXTextArea(VALUE rb_mWX);
|
|
16
|
+
|
|
17
|
+
#if wxUSE_TEXTCTRL
|
|
18
|
+
#include <wx/textctrl.h>
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#endif /* WXTEXTAREA_HPP_ */
|
data/ext/wxTextAttr.cpp
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxTextAttr.cpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 27.04.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#include "wxTextAttr.hpp"
|
|
9
|
+
#include "wxColor.hpp"
|
|
10
|
+
#include "wxFont.hpp"
|
|
11
|
+
|
|
12
|
+
VALUE rb_cWXTextAttr;
|
|
13
|
+
|
|
14
|
+
#if wxUSE_TEXTCTRL
|
|
15
|
+
|
|
16
|
+
//find better way?
|
|
17
|
+
template <>
|
|
18
|
+
VALUE wrap< wxTextAttr >(wxTextAttr *attr )
|
|
19
|
+
{
|
|
20
|
+
return wrapTypedPtr(attr, rb_cWXTextAttr);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
template <>
|
|
24
|
+
wxTextAttr unwrap< wxTextAttr >(const VALUE &vcolor)
|
|
25
|
+
{
|
|
26
|
+
return *unwrapTypedPtr<wxTextAttr>(vcolor,rb_cWXTextAttr);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#define _self unwrap<wxTextAttr*>(self)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
//use this macro to automatically check the Has Methods
|
|
33
|
+
#define macro_textattr2(attr,attr2,type,flag,w) \
|
|
34
|
+
DLL_LOCAL VALUE _get##attr(VALUE self)\
|
|
35
|
+
{ \
|
|
36
|
+
return _self->Has##attr2() ? w<type>(_self->Get##attr()) : Qnil;\
|
|
37
|
+
}\
|
|
38
|
+
\
|
|
39
|
+
DLL_LOCAL VALUE _set##attr(VALUE self,VALUE other)\
|
|
40
|
+
{\
|
|
41
|
+
if(NIL_P(other))\
|
|
42
|
+
_self->RemoveFlag(wxTEXT_ATTR_##flag);\
|
|
43
|
+
else\
|
|
44
|
+
_self->Set##attr(un##w<type>(other));\
|
|
45
|
+
return other;\
|
|
46
|
+
}
|
|
47
|
+
#define macro_textattr(attr,type,flag,w) macro_textattr2(attr,attr,type,flag,w)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
namespace RubyWX {
|
|
51
|
+
namespace TextAttr {
|
|
52
|
+
|
|
53
|
+
APP_PROTECT(wxTextAttr)
|
|
54
|
+
|
|
55
|
+
macro_textattr(TextColour,wxColour,TEXT_COLOUR,wrap)
|
|
56
|
+
macro_textattr(BackgroundColour,wxColour,BACKGROUND_COLOUR,wrap)
|
|
57
|
+
macro_textattr(Alignment,wxTextAttrAlignment,ALIGNMENT,wrapenum)
|
|
58
|
+
|
|
59
|
+
macro_textattr(Tabs,wxArrayInt,TABS,wrap)
|
|
60
|
+
macro_textattr(LeftIndent,int,LEFT_INDENT,wrap)
|
|
61
|
+
macro_textattr(RightIndent,int,RIGHT_INDENT,wrap)
|
|
62
|
+
|
|
63
|
+
macro_textattr(FontSize,int,FONT_SIZE,wrap)
|
|
64
|
+
//macro_textattr(FontPointSize,int,wrap)
|
|
65
|
+
//macro_textattr(FontPixelSize,int,wrap)
|
|
66
|
+
macro_textattr2(FontStyle,Font,wxFontStyle,FONT_ITALIC,wrapenum)
|
|
67
|
+
macro_textattr(FontWeight,wxFontWeight,FONT_WEIGHT,wrapenum)
|
|
68
|
+
macro_textattr(FontFaceName,wxString,FONT_FACE,wrap)
|
|
69
|
+
macro_textattr(FontUnderlined,bool,FONT_UNDERLINE,wrap)
|
|
70
|
+
macro_textattr(FontStrikethrough,bool,FONT_STRIKETHROUGH,wrap)
|
|
71
|
+
macro_textattr(FontEncoding,wxFontEncoding,FONT_ENCODING,wrapenum)
|
|
72
|
+
macro_textattr(FontFamily,wxFontFamily,FONT_FAMILY,wrapenum)
|
|
73
|
+
|
|
74
|
+
macro_textattr(Font,wxFont,FONT,wrap)
|
|
75
|
+
|
|
76
|
+
macro_textattr(CharacterStyleName,wxString,CHARACTER_STYLE_NAME,wrap)
|
|
77
|
+
macro_textattr(ParagraphStyleName,wxString,PARAGRAPH_STYLE_NAME,wrap)
|
|
78
|
+
macro_textattr(ListStyleName,wxString,LIST_STYLE_NAME,wrap)
|
|
79
|
+
macro_textattr(ParagraphSpacingAfter,int,PARA_SPACING_AFTER,wrap)
|
|
80
|
+
macro_textattr(ParagraphSpacingBefore,int,PARA_SPACING_BEFORE,wrap)
|
|
81
|
+
macro_textattr(LineSpacing,wxTextAttrLineSpacing,LINE_SPACING,wrapenum)
|
|
82
|
+
|
|
83
|
+
macro_textattr(BulletStyle,wxTextAttrBulletStyle,BULLET_STYLE,wrapenum)
|
|
84
|
+
macro_textattr(BulletNumber,int,BULLET_NUMBER,wrap)
|
|
85
|
+
macro_textattr(BulletText,wxString,BULLET_TEXT,wrap)
|
|
86
|
+
macro_attr(BulletFont,wxString)
|
|
87
|
+
macro_textattr(BulletName,wxString,BULLET_NAME,wrap)
|
|
88
|
+
|
|
89
|
+
macro_textattr(URL,wxString,URL,wrap)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
*/
|
|
94
|
+
DLL_LOCAL VALUE _initialize_copy(VALUE self, VALUE other)
|
|
95
|
+
{
|
|
96
|
+
VALUE result = rb_call_super(1,&other);
|
|
97
|
+
_self->Copy(unwrap<wxTextAttr>(other));
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
#endif
|
|
105
|
+
|
|
106
|
+
/* Document-attr: text_color
|
|
107
|
+
* the text color of the TextAttr, WX::Color
|
|
108
|
+
*/
|
|
109
|
+
/* Document-attr: background_color
|
|
110
|
+
* the background color of the TextAttr, WX::Color
|
|
111
|
+
*/
|
|
112
|
+
/* Document-attr: alignment
|
|
113
|
+
* the alignment of the TextAttr, Symbol
|
|
114
|
+
*/
|
|
115
|
+
/* Document-attr: tabs
|
|
116
|
+
* the Tabs in the section of the TextAttr, [Integer*]
|
|
117
|
+
*/
|
|
118
|
+
/* Document-attr: left_indent
|
|
119
|
+
* the left indent of the TextAttr, Integer
|
|
120
|
+
*/
|
|
121
|
+
/* Document-attr: right_indent
|
|
122
|
+
* the right indent of the TextAttr, Integer
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
/* Document-attr: font_size
|
|
127
|
+
* the font size of the TextAttr, Integer
|
|
128
|
+
*/
|
|
129
|
+
/* Document-attr: font_family
|
|
130
|
+
* the font family of the TextAttr, Symbol
|
|
131
|
+
*/
|
|
132
|
+
/* Document-attr: font_style
|
|
133
|
+
* the font style of the TextAttr, Symbol
|
|
134
|
+
*/
|
|
135
|
+
/* Document-attr: font_weight
|
|
136
|
+
* the font weight of the TextAttr, Symbol
|
|
137
|
+
*/
|
|
138
|
+
/* Document-attr: font_facename
|
|
139
|
+
* the font face name of the TextAttr, String
|
|
140
|
+
*/
|
|
141
|
+
/* Document-attr: font_underlined
|
|
142
|
+
* true if the font is underlined. bool
|
|
143
|
+
*/
|
|
144
|
+
/* Document-attr: font_strikethrough
|
|
145
|
+
* true if the font is strikethrough. bool
|
|
146
|
+
*/
|
|
147
|
+
/* Document-attr: font_encoding
|
|
148
|
+
* the font encoding of the TextAttr, Encoding
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
/* Document-attr: font
|
|
152
|
+
* the font of the TextAttr, WX::Font
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
/* Document-attr: character_style_name
|
|
156
|
+
* the name of the character style. String
|
|
157
|
+
*/
|
|
158
|
+
/* Document-attr: paragraph_style_name
|
|
159
|
+
* the name of the paragraph style. String
|
|
160
|
+
*/
|
|
161
|
+
/* Document-attr: list_style_name
|
|
162
|
+
* the name of the list style. String
|
|
163
|
+
*/
|
|
164
|
+
/* Document-attr: paragraph_spacing_after
|
|
165
|
+
* the space in tenths of a millimeter after the paragraph. Integer
|
|
166
|
+
*/
|
|
167
|
+
/* Document-attr: paragraph_Spacing_before
|
|
168
|
+
* the space in tenths of a millimeter before the paragraph. Integer
|
|
169
|
+
*/
|
|
170
|
+
/* Document-attr: line_spacing
|
|
171
|
+
* the bullet style of the TextAttr, Symbol
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
/* Document-attr: bullet_style
|
|
175
|
+
* the bullet style of the TextAttr, Symbol
|
|
176
|
+
*/
|
|
177
|
+
/* Document-attr: bullet_number
|
|
178
|
+
* the bullet number of the TextAttr, Integer
|
|
179
|
+
*/
|
|
180
|
+
/* Document-attr: bullet_text
|
|
181
|
+
* the bullet text of the TextAttr, String
|
|
182
|
+
*/
|
|
183
|
+
/* Document-attr: bullet_font
|
|
184
|
+
* the bullet font of the TextAttr, String
|
|
185
|
+
*/
|
|
186
|
+
/* Document-attr: bullet_name
|
|
187
|
+
* the bullet name of the TextAttr, String
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
/* Document-attr: url
|
|
191
|
+
* the URL of the TextAttr, String
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
DLL_LOCAL void Init_WXTextAttr(VALUE rb_mWX)
|
|
196
|
+
{
|
|
197
|
+
#if 0
|
|
198
|
+
rb_define_attr(rb_cWXTextAttr,"text_color",1,1);
|
|
199
|
+
rb_define_attr(rb_cWXTextAttr,"background_color",1,1);
|
|
200
|
+
|
|
201
|
+
rb_define_attr(rb_cWXTextAttr,"alignment",1,1);
|
|
202
|
+
|
|
203
|
+
rb_define_attr(rb_cWXTextAttr,"tabs",1,1);
|
|
204
|
+
|
|
205
|
+
rb_define_attr(rb_cWXTextAttr,"left_indent",1,1);
|
|
206
|
+
rb_define_attr(rb_cWXTextAttr,"right_indent",1,1);
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
rb_define_attr(rb_cWXTextAttr,"font_size",1,1);
|
|
210
|
+
rb_define_attr(rb_cWXTextAttr,"font_style",1,1);
|
|
211
|
+
rb_define_attr(rb_cWXTextAttr,"font_weight",1,1);
|
|
212
|
+
rb_define_attr(rb_cWXTextAttr,"font_facename",1,1);
|
|
213
|
+
rb_define_attr(rb_cWXTextAttr,"font_underlined",1,1);
|
|
214
|
+
rb_define_attr(rb_cWXTextAttr,"font_strikethrough",1,1);
|
|
215
|
+
rb_define_attr(rb_cWXTextAttr,"font_encoding",1,1);
|
|
216
|
+
rb_define_attr(rb_cWXTextAttr,"font_family",1,1);
|
|
217
|
+
|
|
218
|
+
rb_define_attr(rb_cWXTextAttr,"font",1,1);
|
|
219
|
+
|
|
220
|
+
rb_define_attr(rb_cWXTextAttr,"character_style_name",1,1);
|
|
221
|
+
rb_define_attr(rb_cWXTextAttr,"paragraph_style_name",1,1);
|
|
222
|
+
rb_define_attr(rb_cWXTextAttr,"list_style_name",1,1);
|
|
223
|
+
rb_define_attr(rb_cWXTextAttr,"paragraph_spacing_after",1,1);
|
|
224
|
+
rb_define_attr(rb_cWXTextAttr,"paragraph_Spacing_before",1,1);
|
|
225
|
+
rb_define_attr(rb_cWXTextAttr,"line_spacing",1,1);
|
|
226
|
+
|
|
227
|
+
rb_define_attr(rb_cWXTextAttr,"bullet_style",1,1);
|
|
228
|
+
rb_define_attr(rb_cWXTextAttr,"bullet_number",1,1);
|
|
229
|
+
rb_define_attr(rb_cWXTextAttr,"bullet_text",1,1);
|
|
230
|
+
rb_define_attr(rb_cWXTextAttr,"bullet_font",1,1);
|
|
231
|
+
rb_define_attr(rb_cWXTextAttr,"bullet_name",1,1);
|
|
232
|
+
|
|
233
|
+
rb_define_attr(rb_cWXTextAttr,"url",1,1);
|
|
234
|
+
|
|
235
|
+
#endif
|
|
236
|
+
|
|
237
|
+
#if wxUSE_TEXTCTRL
|
|
238
|
+
using namespace RubyWX::TextAttr;
|
|
239
|
+
rb_cWXTextAttr = rb_define_class_under(rb_mWX,"TextAttr",rb_cObject);
|
|
240
|
+
rb_define_alloc_func(rb_cWXTextAttr,_alloc);
|
|
241
|
+
|
|
242
|
+
rb_define_private_method(rb_cWXTextAttr,"initialize_copy",RUBY_METHOD_FUNC(_initialize_copy),1);
|
|
243
|
+
|
|
244
|
+
rb_define_attr_method(rb_cWXTextAttr,"text_color",_getTextColour,_setTextColour);
|
|
245
|
+
rb_define_attr_method(rb_cWXTextAttr,"background_color",_getBackgroundColour,_setBackgroundColour);
|
|
246
|
+
|
|
247
|
+
rb_define_attr_method(rb_cWXTextAttr,"alignment",_getAlignment,_setAlignment);
|
|
248
|
+
|
|
249
|
+
rb_define_attr_method(rb_cWXTextAttr,"tabs",_getTabs,_setTabs);
|
|
250
|
+
|
|
251
|
+
rb_define_attr_method(rb_cWXTextAttr,"left_indent",_getLeftIndent,_setLeftIndent);
|
|
252
|
+
rb_define_attr_method(rb_cWXTextAttr,"right_indent",_getRightIndent,_setRightIndent);
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
rb_define_attr_method(rb_cWXTextAttr,"font_size",_getFontSize,_setFontSize);
|
|
256
|
+
rb_define_attr_method(rb_cWXTextAttr,"font_style",_getFontStyle,_setFontStyle);
|
|
257
|
+
rb_define_attr_method(rb_cWXTextAttr,"font_weight",_getFontWeight,_setFontWeight);
|
|
258
|
+
rb_define_attr_method(rb_cWXTextAttr,"font_facename",_getFontFaceName,_setFontFaceName);
|
|
259
|
+
rb_define_attr_method(rb_cWXTextAttr,"font_underlined",_getFontUnderlined,_setFontUnderlined);
|
|
260
|
+
rb_define_attr_method(rb_cWXTextAttr,"font_strikethrough",_getFontStrikethrough,_setFontStrikethrough);
|
|
261
|
+
rb_define_attr_method(rb_cWXTextAttr,"font_encoding",_getFontEncoding,_setFontEncoding);
|
|
262
|
+
rb_define_attr_method(rb_cWXTextAttr,"font_family",_getFontFamily,_setFontFamily);
|
|
263
|
+
|
|
264
|
+
rb_define_attr_method(rb_cWXTextAttr,"font",_getFont,_setFont);
|
|
265
|
+
|
|
266
|
+
rb_define_attr_method(rb_cWXTextAttr,"character_style_name",_getCharacterStyleName,_setCharacterStyleName);
|
|
267
|
+
rb_define_attr_method(rb_cWXTextAttr,"paragraph_style_name",_getParagraphStyleName,_setParagraphStyleName);
|
|
268
|
+
rb_define_attr_method(rb_cWXTextAttr,"list_style_name",_getListStyleName,_setListStyleName);
|
|
269
|
+
rb_define_attr_method(rb_cWXTextAttr,"paragraph_spacing_after",_getParagraphSpacingAfter,_setParagraphSpacingAfter);
|
|
270
|
+
rb_define_attr_method(rb_cWXTextAttr,"paragraph_Spacing_before",_getParagraphSpacingBefore,_setParagraphSpacingBefore);
|
|
271
|
+
rb_define_attr_method(rb_cWXTextAttr,"line_spacing",_getLineSpacing,_setLineSpacing);
|
|
272
|
+
|
|
273
|
+
rb_define_attr_method(rb_cWXTextAttr,"bullet_style",_getBulletStyle,_setBulletStyle);
|
|
274
|
+
rb_define_attr_method(rb_cWXTextAttr,"bullet_number",_getBulletNumber,_setBulletNumber);
|
|
275
|
+
rb_define_attr_method(rb_cWXTextAttr,"bullet_text",_getBulletText,_setBulletText);
|
|
276
|
+
rb_define_attr_method(rb_cWXTextAttr,"bullet_font",_getBulletFont,_setBulletFont);
|
|
277
|
+
rb_define_attr_method(rb_cWXTextAttr,"bullet_name",_getBulletName,_setBulletName);
|
|
278
|
+
|
|
279
|
+
rb_define_attr_method(rb_cWXTextAttr,"url",_getURL,_setURL);
|
|
280
|
+
|
|
281
|
+
registerType<wxTextAttr>(rb_cWXTextAttr);
|
|
282
|
+
|
|
283
|
+
registerEnum<wxTextAttrAlignment>("wxTextAttrAlignment")
|
|
284
|
+
->add(wxTEXT_ALIGNMENT_DEFAULT,"default")
|
|
285
|
+
->add(wxTEXT_ALIGNMENT_LEFT,"left")
|
|
286
|
+
->add(wxTEXT_ALIGNMENT_CENTER,"center")
|
|
287
|
+
->add(wxTEXT_ALIGNMENT_RIGHT,"right")
|
|
288
|
+
->add(wxTEXT_ALIGNMENT_JUSTIFIED,"justified");
|
|
289
|
+
|
|
290
|
+
registerEnum<wxTextAttrBulletStyle>("wxTextAttrBulletStyle")
|
|
291
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_NONE,"none")
|
|
292
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_ARABIC,"arabic")
|
|
293
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER,"letters_upper")
|
|
294
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER,"letters_lower")
|
|
295
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER,"roman_upper")
|
|
296
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER,"roman_lower")
|
|
297
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_SYMBOL,"symbol")
|
|
298
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_BITMAP,"bitmap")
|
|
299
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_PARENTHESES,"parentheses")
|
|
300
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_PERIOD,"period")
|
|
301
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_STANDARD,"standard")
|
|
302
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS,"right_parentheses")
|
|
303
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_OUTLINE,"outline")
|
|
304
|
+
|
|
305
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT,"align_left")
|
|
306
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT,"align_right")
|
|
307
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE,"align_center")
|
|
308
|
+
|
|
309
|
+
->add(wxTEXT_ATTR_BULLET_STYLE_CONTINUATION,"continuation");
|
|
310
|
+
|
|
311
|
+
registerEnum<wxTextAttrLineSpacing>("wxTextAttrLineSpacing",wxTEXT_ATTR_LINE_SPACING_NORMAL)
|
|
312
|
+
->add(wxTEXT_ATTR_LINE_SPACING_NORMAL,"normal")
|
|
313
|
+
->add(wxTEXT_ATTR_LINE_SPACING_HALF,"half")
|
|
314
|
+
->add(wxTEXT_ATTR_LINE_SPACING_TWICE,"twice");
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
#endif
|
|
319
|
+
|
|
320
|
+
}
|