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,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxWizardPage.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 06.04.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXWIZARDPAGE_HPP_
|
|
9
|
+
#define WXWIZARDPAGE_HPP_
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
#include "wxPanel.hpp"
|
|
13
|
+
|
|
14
|
+
extern VALUE rb_cWXWizardPage;
|
|
15
|
+
void Init_WXWizardPage(VALUE rb_mWX);
|
|
16
|
+
|
|
17
|
+
#if wxUSE_WIZARDDLG
|
|
18
|
+
#include <wx/wizard.h>
|
|
19
|
+
|
|
20
|
+
class RubyWizardPage : public wxWizardPageSimple {
|
|
21
|
+
public:
|
|
22
|
+
RubyWizardPage();
|
|
23
|
+
|
|
24
|
+
wxWizardPage* GetPrev() const;
|
|
25
|
+
wxWizardPage* GetNext() const;
|
|
26
|
+
|
|
27
|
+
wxBitmap GetBitmap() const { return m_bitmap; }
|
|
28
|
+
void SetBitmap(const wxBitmap& bitmap ) { m_bitmap = bitmap; }
|
|
29
|
+
private:
|
|
30
|
+
bool mutable rubycall;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
template <>
|
|
34
|
+
wxWizardPage* unwrap<wxWizardPage*>(const VALUE &arg);
|
|
35
|
+
|
|
36
|
+
#endif
|
|
37
|
+
|
|
38
|
+
#endif /* WXWIZARDPAGE_HPP_ */
|
data/ext/wxXRC.cpp
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxXRC.cpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 04.11.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#include "wxWizard.hpp"
|
|
10
|
+
|
|
11
|
+
#if wxUSE_XRC
|
|
12
|
+
|
|
13
|
+
namespace RubyWX {
|
|
14
|
+
namespace XRC {
|
|
15
|
+
|
|
16
|
+
DLL_LOCAL VALUE _xrc_load_file(VALUE self,VALUE name)
|
|
17
|
+
{
|
|
18
|
+
wxXmlResource *old = wxXmlResource::Get();
|
|
19
|
+
if(rb_block_given_p())
|
|
20
|
+
wxXmlResource::Set(new wxXmlResource);
|
|
21
|
+
wxXmlResource::Get()->InitAllHandlers();
|
|
22
|
+
wxXmlResource::Get()->LoadFile(unwrap<wxString>(name));
|
|
23
|
+
if(rb_block_given_p())
|
|
24
|
+
{
|
|
25
|
+
rb_yield(Qnil);
|
|
26
|
+
wxXmlResource::Get()->Unload(unwrap<wxString>(name));
|
|
27
|
+
wxXmlResource::Get()->ClearHandlers();
|
|
28
|
+
wxXmlResource::Set(old);
|
|
29
|
+
}
|
|
30
|
+
return self;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#endif
|
|
37
|
+
|
|
38
|
+
DLL_LOCAL void Init_WXXRC(VALUE rb_mWX)
|
|
39
|
+
{
|
|
40
|
+
#if wxUSE_XRC
|
|
41
|
+
using namespace RubyWX::XRC;
|
|
42
|
+
|
|
43
|
+
rb_define_module_function(rb_mWX,"xrc_load_file",RUBY_METHOD_FUNC(_xrc_load_file),1);
|
|
44
|
+
#endif
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
data/ext/wxXRC.hpp
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* wxXRC.hpp
|
|
3
|
+
*
|
|
4
|
+
* Created on: 04.11.2012
|
|
5
|
+
* Author: hanmac
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef WXXRC_HPP_
|
|
9
|
+
#define WXXRC_HPP_
|
|
10
|
+
|
|
11
|
+
#include "wxDialog.hpp"
|
|
12
|
+
|
|
13
|
+
DLL_LOCAL void Init_WXXRC(VALUE rb_mWX);
|
|
14
|
+
|
|
15
|
+
#if wxUSE_XRC
|
|
16
|
+
#include <wx/xrc/xh_all.h>
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
#endif /* WXXRC_HPP_ */
|
data/old_tests/button.rb
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#Encoding: UTF-8
|
|
2
|
+
require "../ext/rwx"
|
|
3
|
+
|
|
4
|
+
STDERR.reopen("file.log","w")
|
|
5
|
+
|
|
6
|
+
class A < WX::App
|
|
7
|
+
def on_init
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@frame = WX::Frame.new(nil)
|
|
11
|
+
#@frame.title = "hallo"
|
|
12
|
+
|
|
13
|
+
@proc = proc {|e|
|
|
14
|
+
p "-----Frame-Bind-----"
|
|
15
|
+
p e,e.id, e.event_type,e.event_object
|
|
16
|
+
}
|
|
17
|
+
@frame.bind(:button_clicked,&@proc)
|
|
18
|
+
@frame.bind(:checkbox_clicked,&@proc)
|
|
19
|
+
|
|
20
|
+
@frame.bind(:filepicker_changed){|e| p e.path }
|
|
21
|
+
|
|
22
|
+
#@frame.bind(:sizing){|e| p "sizing";@frame.call_after { p "after sizing" };e.skip }
|
|
23
|
+
#@frame.bind(:paint,&@proc)
|
|
24
|
+
|
|
25
|
+
@frame.sizer = WX::BoxSizer.new {|siz|
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
siz.add(WX::Button.new(@frame,id: :ok) {|button|
|
|
29
|
+
button.bind(:button_clicked) {|e|
|
|
30
|
+
p "-----Button-Bind-----"
|
|
31
|
+
p "button clicked"
|
|
32
|
+
WX.about_box(nil)
|
|
33
|
+
button.call_after {
|
|
34
|
+
p "-----After-Bind-----"
|
|
35
|
+
p "after"
|
|
36
|
+
}
|
|
37
|
+
e.skip
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
siz.add(WX::CheckBox.new(@frame,label: "checkbox" ) {|checkbox|
|
|
41
|
+
checkbox.bind(:checkbox_clicked) {|e| p "checkbox #{e.checked? ? '' : 'un'}checked" }
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
siz.add(WX::Button.new(@frame,id: :cancel) {|button|
|
|
45
|
+
button.bind(:button_clicked) {button.call(:filepicker_changed) {|e| e.path="abc"}}
|
|
46
|
+
})
|
|
47
|
+
siz.add(WX::CheckBox.new(@frame,id: :open,label: "checkbox" ))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
@frame.show
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
A.new.main_loop
|
data/old_tests/file.png
ADDED
|
Binary file
|
data/old_tests/green.xpm
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* XPM */
|
|
2
|
+
static const char *const green_xpm[] = {
|
|
3
|
+
/* columns rows colors chars-per-pixel */
|
|
4
|
+
"32 15 4 1",
|
|
5
|
+
". c Black",
|
|
6
|
+
" c None",
|
|
7
|
+
"o c #404040",
|
|
8
|
+
"X c #00FF00",
|
|
9
|
+
/* pixels */
|
|
10
|
+
" ",
|
|
11
|
+
" ",
|
|
12
|
+
" ... ... ",
|
|
13
|
+
" ..XXX.. ..ooo.. ",
|
|
14
|
+
" .XXXXXXX. .ooooooo. ",
|
|
15
|
+
" .XXXXXXX. .ooooooo. ",
|
|
16
|
+
" .XXXXXXXXX. .ooooooooo. ",
|
|
17
|
+
" .XXXXXXXXX. .ooooooooo. ",
|
|
18
|
+
" .XXXXXXXXX. .ooooooooo. ",
|
|
19
|
+
" .XXXXXXX. .ooooooo. ",
|
|
20
|
+
" .XXXXXXX. .ooooooo. ",
|
|
21
|
+
" ..XXX.. ..ooo.. ",
|
|
22
|
+
" ... ... ",
|
|
23
|
+
" ",
|
|
24
|
+
" "
|
|
25
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#Encoding: UTF-8
|
|
2
|
+
require "../ext/rwx"
|
|
3
|
+
|
|
4
|
+
#STDERR.reopen("file.log","w")
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class A < WX::App
|
|
8
|
+
def on_init
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# #f = WX::Font.new(10,:script)
|
|
13
|
+
# #p f.faceName
|
|
14
|
+
@frame = WX::Frame.new(nil)
|
|
15
|
+
@frame.title = "hallo"
|
|
16
|
+
|
|
17
|
+
pg = WX::PropertyGridManager.new(@frame,
|
|
18
|
+
:style => WX::PropertyGridManager::TOOLBAR,
|
|
19
|
+
:extra_style => WX::PropertyGridManager::EX_MODE_BUTTONS
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
# pg = WX::PropertyGrid.new(@frame)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
p WX::CursorProperty.ancestors
|
|
26
|
+
|
|
27
|
+
fp = pg.append(WX::SystemColorProperty)
|
|
28
|
+
#fp.value_image = "ruby32x32.png"
|
|
29
|
+
|
|
30
|
+
p fp.value
|
|
31
|
+
p fp.each_attributes.to_a
|
|
32
|
+
|
|
33
|
+
#exit
|
|
34
|
+
|
|
35
|
+
p fp.each_child.map {|pr| pr.class}
|
|
36
|
+
p fp.each_child.map {|pr| pr.type}
|
|
37
|
+
p fp.each_child.map {|pr| pr.wxclass}
|
|
38
|
+
p fp.each_child.map {|pr| pr.value}
|
|
39
|
+
|
|
40
|
+
# p fp.each_child.map {|pr| pr.type}
|
|
41
|
+
# fp.each_child.map {|pr| p pr.each_choices.to_a}
|
|
42
|
+
|
|
43
|
+
p WX::Property::find("IntProperty")
|
|
44
|
+
@frame.show
|
|
45
|
+
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
A.new.main_loop
|
|
50
|
+
|
|
51
|
+
# "ruby32x32.png"
|
data/old_tests/red.xpm
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* XPM */
|
|
2
|
+
static const char *const red_xpm[] = {
|
|
3
|
+
/* columns rows colors chars-per-pixel */
|
|
4
|
+
"32 15 4 1",
|
|
5
|
+
". c Black",
|
|
6
|
+
" c None",
|
|
7
|
+
"X c #404040",
|
|
8
|
+
"o c #FF0000",
|
|
9
|
+
/* pixels */
|
|
10
|
+
" ",
|
|
11
|
+
" ",
|
|
12
|
+
" ... ... ",
|
|
13
|
+
" ..XXX.. ..ooo.. ",
|
|
14
|
+
" .XXXXXXX. .ooooooo. ",
|
|
15
|
+
" .XXXXXXX. .ooooooo. ",
|
|
16
|
+
" .XXXXXXXXX. .ooooooooo. ",
|
|
17
|
+
" .XXXXXXXXX. .ooooooooo. ",
|
|
18
|
+
" .XXXXXXXXX. .ooooooooo. ",
|
|
19
|
+
" .XXXXXXX. .ooooooo. ",
|
|
20
|
+
" .XXXXXXX. .ooooooo. ",
|
|
21
|
+
" ..XXX.. ..ooo.. ",
|
|
22
|
+
" ... ... ",
|
|
23
|
+
" ",
|
|
24
|
+
" "
|
|
25
|
+
};
|
|
Binary file
|
data/old_tests/status.rb
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#Encoding: UTF-8
|
|
2
|
+
require "../ext/rwx"
|
|
3
|
+
|
|
4
|
+
STDERR.reopen("file.log","w")
|
|
5
|
+
|
|
6
|
+
class MyStatusBar < WX::StatusBar
|
|
7
|
+
def initialize(*)
|
|
8
|
+
super
|
|
9
|
+
self.fields_count = 4
|
|
10
|
+
self.set_status_width(0,150)
|
|
11
|
+
self.set_status_width(1,32)
|
|
12
|
+
p self.get_status_width(0)
|
|
13
|
+
p self.get_status_width(1)
|
|
14
|
+
@check = WX::CheckBox.new(self,:label => "&Toggle clock" )
|
|
15
|
+
@check.rect = self.get_field_rect(0)
|
|
16
|
+
@check.bind(:checkbox_clicked) {|e|@bitmap.bitmap = e.checked? ? "green.xpm" : "red.xpm" }
|
|
17
|
+
@bitmap = WX::StaticBitmap.new(self,:bitmap => "red.xpm" )
|
|
18
|
+
@bitmap.position = self.get_field_rect(1).position
|
|
19
|
+
refresh
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class A < WX::App
|
|
24
|
+
def on_init
|
|
25
|
+
|
|
26
|
+
@frame = WX::Frame.new(nil)
|
|
27
|
+
|
|
28
|
+
@frame.sizer = WX::BoxSizer.new {|siz|
|
|
29
|
+
|
|
30
|
+
siz.add(WX::Button.new(@frame,:id => :ok) {|button|
|
|
31
|
+
button.bind(:button_clicked) {|e|
|
|
32
|
+
@frame.statusbar.fields_count = 2
|
|
33
|
+
@frame.statusbar.each_statuspane.with_index {|pane,i| pane.text = "ABC#{i}" }
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
@frame.statusbar = MyStatusBar.new(@frame)
|
|
40
|
+
@frame.show
|
|
41
|
+
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
A.new.main_loop
|
data/old_tests/test.rb
ADDED
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
#Encoding: UTF-8
|
|
2
|
+
require "../ext/rwx"
|
|
3
|
+
require "../../tiled_tmx/map"
|
|
4
|
+
require "nokogiri"
|
|
5
|
+
|
|
6
|
+
module TiledTmx
|
|
7
|
+
class Tileset
|
|
8
|
+
|
|
9
|
+
def images
|
|
10
|
+
if @images.nil?
|
|
11
|
+
@images = []
|
|
12
|
+
image = WX::Image.new(@source.to_s)
|
|
13
|
+
@margin.step(image.height-1,@tileheight + @spacing) {|iy|
|
|
14
|
+
@margin.step(image.width-1,@tilewidth + @spacing) {|ix|
|
|
15
|
+
@images << image[WX::Rect.new(ix,iy,@tilewidth,@tileheight)]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
end
|
|
19
|
+
return @images
|
|
20
|
+
end
|
|
21
|
+
def draw(id,x,y,z,opacity,rot,x_scale,y_scale,&block)
|
|
22
|
+
block.call.draw_bitmap(images[id].scale(x_scale,y_scale) * opacity,x,y)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
STDERR.reopen("file.log","w")
|
|
29
|
+
|
|
30
|
+
class MapDialog < WX::Dialog
|
|
31
|
+
|
|
32
|
+
def initialize(parent)
|
|
33
|
+
super(parent,:title => "Map Properies",:style => DEFAULT_STYLE | RESIZE_BORDER)
|
|
34
|
+
|
|
35
|
+
self.sizer = WX::BoxSizer.new {|box|
|
|
36
|
+
box.orientation = true
|
|
37
|
+
sbs = WX::StaticBox.new(self,:label => "Eigenschaften:").containing_sizer
|
|
38
|
+
sbs.orientation = true
|
|
39
|
+
sbs.add(create_text_sizer("Name:"))
|
|
40
|
+
sbs.add(WX::TextCtrl.new(self),:expand => true)
|
|
41
|
+
sbs.add(create_text_sizer("Anzeigename:"))
|
|
42
|
+
sbs.add(WX::TextCtrl.new(self),:expand => true)
|
|
43
|
+
|
|
44
|
+
sbs.add(create_text_sizer("Abmessungen:"))
|
|
45
|
+
sbs.add(WX::BoxSizer.new {|siz|
|
|
46
|
+
siz.add(WX::SpinCtrl.new(self))
|
|
47
|
+
siz.add(create_text_sizer("×"))
|
|
48
|
+
siz.add(WX::SpinCtrl.new(self))
|
|
49
|
+
},:expand => true)
|
|
50
|
+
|
|
51
|
+
box.add(sbs,:expand => true)
|
|
52
|
+
|
|
53
|
+
sbs = WX::StaticBox.new(self,:label => "SystemSwitches:").containing_sizer
|
|
54
|
+
sbs.orientation = true
|
|
55
|
+
#sizer.orientation = true
|
|
56
|
+
sbs.add(WX::CheckBox.new(self,:label => "Rennverbot ändern:"))
|
|
57
|
+
sbs.add(WX::BoxSizer.new {|siz|
|
|
58
|
+
siz.add(WX::Choice.new(self,:items =>["An","Aus","Eltern-Map"],:select=>0))
|
|
59
|
+
},:expand => true)
|
|
60
|
+
sbs.add(WX::CheckBox.new(self,:label => "Speicherverbot ändern:"))
|
|
61
|
+
sbs.add(WX::BoxSizer.new {|siz|
|
|
62
|
+
siz.add(WX::RadioButton.new(self,:label => "An",:group => true,:disabled=>true))
|
|
63
|
+
siz.add(WX::RadioButton.new(self,:label => "Aus",:disabled=>true))
|
|
64
|
+
siz.add(WX::RadioButton.new(self,:label => "Eltern-Map",:disabled=>true))
|
|
65
|
+
},:expand => true)
|
|
66
|
+
|
|
67
|
+
sbs.add(WX::BoxSizer.new {|siz|
|
|
68
|
+
siz.add(WX::RadioButton.new(self,:label => "An",:group => true,:disabled=>true))
|
|
69
|
+
siz.add(WX::RadioButton.new(self,:label => "Aus",:disabled=>true))
|
|
70
|
+
siz.add(WX::RadioButton.new(self,:label => "Eltern-Map",:disabled=>true))
|
|
71
|
+
},:expand => true)
|
|
72
|
+
|
|
73
|
+
box.add(sbs,:expand => true)
|
|
74
|
+
box.add(create_button_sizer(:ok,:cancel,:help,:apply),:expand => true)
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
fit
|
|
78
|
+
layout
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
class TilesetGridTable < WX::GridTable
|
|
84
|
+
|
|
85
|
+
attr_reader :set
|
|
86
|
+
|
|
87
|
+
def initialize(set)
|
|
88
|
+
@set = set
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def rows
|
|
92
|
+
return @set.height / (@set.tileheight + @set.spacing)
|
|
93
|
+
end
|
|
94
|
+
def cols
|
|
95
|
+
return @set.width / (@set.tilewidth + @set.spacing)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def [](row,col)
|
|
99
|
+
return @set.images[row * cols + col]
|
|
100
|
+
end
|
|
101
|
+
def typename(x,y)
|
|
102
|
+
return "string"
|
|
103
|
+
end
|
|
104
|
+
def tilesize
|
|
105
|
+
@size ||= WX::Size.new(@set.tilewidth-9,@set.tileheight-6)
|
|
106
|
+
#@size ||= WX::Size.new(@set.tilewidth,@set.tileheight)
|
|
107
|
+
return @size
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
class TilesetGridRenderer < WX::GridCellRenderer
|
|
113
|
+
def draw(grid,att,dc,rect,row,col,selected)
|
|
114
|
+
dc.draw_bitmap(grid.table[row,col],rect.x,rect.y)
|
|
115
|
+
end
|
|
116
|
+
def best_size(grid,att,dc,row,col)
|
|
117
|
+
return grid.table.tilesize
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
class Cat < WX::CategoryProperty
|
|
122
|
+
def initialize
|
|
123
|
+
self.name = "Font1"
|
|
124
|
+
self.label = "Font2"
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
class A < WX::App
|
|
129
|
+
def on_init
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
#
|
|
133
|
+
# #f = WX::Font.new(10,:script)
|
|
134
|
+
# #p f.faceName
|
|
135
|
+
@frame = WX::Frame.new(nil)
|
|
136
|
+
@frame.title = "hallo"
|
|
137
|
+
|
|
138
|
+
# pen1 = WX::Pen.new
|
|
139
|
+
# pen2 = WX::Pen.new
|
|
140
|
+
# pen1.width = 2
|
|
141
|
+
# p pen2.color
|
|
142
|
+
# #p @frame.icon
|
|
143
|
+
# @history = WX::FileHistory.new
|
|
144
|
+
# @history << "b" << "a"
|
|
145
|
+
# #f= @frame.font
|
|
146
|
+
# #p f.weight
|
|
147
|
+
# #c = WX::Control.new
|
|
148
|
+
# #g = WX::Gauge.new(@frame)
|
|
149
|
+
# #g = WX::Gauge.allocate
|
|
150
|
+
# #g.range = 10
|
|
151
|
+
# #g.value = 5
|
|
152
|
+
# #@history.save
|
|
153
|
+
# #g.foregroundColour = WX::Color.new(255,0,0)
|
|
154
|
+
# # g.foregroundColour
|
|
155
|
+
# #g.pulse
|
|
156
|
+
# #g.pulse
|
|
157
|
+
@frame.menuBar = WX::Menu::Bar.new(nil) {|m|
|
|
158
|
+
m.append("Datei") {|menu|
|
|
159
|
+
menu << :new
|
|
160
|
+
menu.appendNormal(:open) {|e|
|
|
161
|
+
|
|
162
|
+
p e.id
|
|
163
|
+
wiz = WX::Wizard.new(@frame)
|
|
164
|
+
pages = []
|
|
165
|
+
pages << wiz.addPage(WX::WizardPage) {|page| }
|
|
166
|
+
#pages << wiz.addPage(MyPage) {|page| p page}
|
|
167
|
+
pages << wiz.addPage(WX::WizardPage,:id => :hello) {|page|}
|
|
168
|
+
wiz.chainPages(*pages)
|
|
169
|
+
#
|
|
170
|
+
wiz.showPage(pages[0])
|
|
171
|
+
wiz.show_modal
|
|
172
|
+
#wiz.runWizard(pages[0])
|
|
173
|
+
}
|
|
174
|
+
# menu.appendNormal("last files") {|o| @history >> o }
|
|
175
|
+
# menu << 5003
|
|
176
|
+
menu.appendNormal(:about) {|e|
|
|
177
|
+
WX.about_box(
|
|
178
|
+
:icon => "ruby32x32.png",
|
|
179
|
+
:developers => "Hanmac",
|
|
180
|
+
:translators => "Quintus <sutniuq@gmx.net>",
|
|
181
|
+
:artists => ["Tango project ( http://tango.freedesktop.org )",
|
|
182
|
+
"Yukihiro Matsumoto ( http://www.rubyidentity.org )"],
|
|
183
|
+
:copyright => "Copyright © 2010 OpenRubyRMK Team",
|
|
184
|
+
:web_site => "http://devel.pegasus-alpha.eu/projects/openrubyrmk"
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
menu.appendNormal(:exit) {
|
|
188
|
+
@frame.close(false)#(true)
|
|
189
|
+
#WX.exit
|
|
190
|
+
}
|
|
191
|
+
@frame.bind(:menu_selected) {|e| p e.id}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
}
|
|
195
|
+
# #i=WX::Image.new("new16x16.png")
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
t = @frame.createToolBar
|
|
199
|
+
|
|
200
|
+
# #t.addNormal(WX::TimePickerCtrl)
|
|
201
|
+
# #t.addNormal(WX::RadioButton) {|g| g.label_text = "abc" }
|
|
202
|
+
#t.addNormal(WX::ColorPicker){|g|
|
|
203
|
+
# g.bind(:colorpicker_changed) {|e| p e.color }
|
|
204
|
+
#}
|
|
205
|
+
#t.addNormal(WX::Slider){|g|
|
|
206
|
+
# g.value = 5
|
|
207
|
+
# g.max = 10
|
|
208
|
+
#}
|
|
209
|
+
#t.addNormal(WX::Button,:id => :cancel)
|
|
210
|
+
|
|
211
|
+
#t.addNormal(WX::FontPicker) {|g|
|
|
212
|
+
# }
|
|
213
|
+
# t.addNormal(WX::StaticBitmap) {|g|
|
|
214
|
+
# g.bitmap = "new16x16.png"
|
|
215
|
+
# }
|
|
216
|
+
|
|
217
|
+
# t.addNormal(WX::HyperLink) {|g|
|
|
218
|
+
# g.label = "abc"
|
|
219
|
+
# g.url = "http://google.de"
|
|
220
|
+
# }
|
|
221
|
+
# #time = Time.now
|
|
222
|
+
# #c=WX::TimePickerCtrl.new(@frame)
|
|
223
|
+
# #c.value = time
|
|
224
|
+
# #p time, c.value
|
|
225
|
+
#
|
|
226
|
+
# #c=WX::RadioButton.new(@frame)
|
|
227
|
+
# #c.label_text = "abc"
|
|
228
|
+
## t.addNormal(WX::TimePickerCtrl.new(t))
|
|
229
|
+
#
|
|
230
|
+
sc = WX::ColorPicker.new(@frame)
|
|
231
|
+
|
|
232
|
+
sc.each_child {|c| p c}
|
|
233
|
+
|
|
234
|
+
t.addNormal(:new,nil) {|e|
|
|
235
|
+
MapDialog.new(@frame).show_modal
|
|
236
|
+
}
|
|
237
|
+
# #@t = WX::Timer.new() {|e| p e }
|
|
238
|
+
# #@t.start(2000)
|
|
239
|
+
# #WX::ProgressDialog.new(nil,:title=>"title") { |pd|p 1; pd.update(50,"message") }
|
|
240
|
+
# #@p.update(50,"message")
|
|
241
|
+
# #@p.pulse("pulseing")
|
|
242
|
+
#
|
|
243
|
+
# #WX.busy {
|
|
244
|
+
# # gets
|
|
245
|
+
# #}
|
|
246
|
+
# }
|
|
247
|
+
#t.addNormal(-1,nil,"new16x16.png"){
|
|
248
|
+
# #p WX.dir_dialog
|
|
249
|
+
# d=WX::DirDialog.new(@frame)
|
|
250
|
+
# #d.path = ".."
|
|
251
|
+
# d.show_modal
|
|
252
|
+
# #p d.path
|
|
253
|
+
#
|
|
254
|
+
# #cdlg=WX::ColorDialog.new(@frame)
|
|
255
|
+
# #cdlg.custom_colors = [WX::Color.new(255,0,0)]
|
|
256
|
+
# #cdlg.show_modal
|
|
257
|
+
#}
|
|
258
|
+
# t.addRadio(5003,nil,"new16x16.png")
|
|
259
|
+
# t.addRadio(5003,nil,"new16x16.png")
|
|
260
|
+
#
|
|
261
|
+
#
|
|
262
|
+
# #p t.each_tool.to_a
|
|
263
|
+
t.realize
|
|
264
|
+
|
|
265
|
+
#p @frame.createStatusBar
|
|
266
|
+
# popup = WX::Menu.new("") {|menu| menu.appendNormal(:new_menu,"new Map") }
|
|
267
|
+
doc = File.open("project.xml"){|f| Nokogiri::XML(f) }
|
|
268
|
+
|
|
269
|
+
#=begin
|
|
270
|
+
|
|
271
|
+
@frame.aui {|aui|
|
|
272
|
+
##
|
|
273
|
+
## tb = WX::ToolBar.new(@frame)
|
|
274
|
+
## tb.addNormal(:new,nil)
|
|
275
|
+
##
|
|
276
|
+
aui.add(WX::ChoiceBookCtrl.new(@frame,:id=>:tilemap))
|
|
277
|
+
|
|
278
|
+
WX::TreeCtrl.new(@frame,:id=>:treemap) {|tc|
|
|
279
|
+
tc.root(doc.root[:name]) {|item|
|
|
280
|
+
add_map_to_tree(item,doc.root)
|
|
281
|
+
}
|
|
282
|
+
tc.bind(:tree_item_activated) {|e|
|
|
283
|
+
map = e.item.instance_variable_get(:@map)
|
|
284
|
+
@frame[:paint].add_page(WX::Window,e.item.text) {|pwnd|
|
|
285
|
+
pwnd.instance_variable_set(:@map,map)
|
|
286
|
+
pwnd.bind(:paint) {
|
|
287
|
+
pwnd.draw {|dc|
|
|
288
|
+
x = 10
|
|
289
|
+
y = 10
|
|
290
|
+
map.draw(x,y,0) { dc }
|
|
291
|
+
|
|
292
|
+
pen = WX::Pen.new
|
|
293
|
+
pen.color = WX::Color.new(255,0,0)
|
|
294
|
+
dc.pen = pen
|
|
295
|
+
|
|
296
|
+
brush = WX::Brush.new
|
|
297
|
+
brush.color = WX::Color.new(255,0,0,128)
|
|
298
|
+
dc.brush = brush
|
|
299
|
+
|
|
300
|
+
point = pwnd.screen_to_client(WX.mouse_position)
|
|
301
|
+
xi = (point.x - x) / map.tilewidth
|
|
302
|
+
yi = (point.y - y)/ map.tileheight
|
|
303
|
+
x += xi * map.tilewidth
|
|
304
|
+
y += yi * map.tileheight
|
|
305
|
+
grid = @frame[:tilemap].current_page
|
|
306
|
+
#p grid.selected_cells, grid.selected_topleft, grid.selected_bottomright
|
|
307
|
+
if xi >= 0 && xi < map.width && yi >= 0 && yi < map.height && grid.selection?
|
|
308
|
+
|
|
309
|
+
cells = grid.selected_cells
|
|
310
|
+
unless cells.empty?
|
|
311
|
+
x_off = (cells.map {|x,y| x}.minmax.inject(:+) / 2.0).ceil
|
|
312
|
+
y_off = (cells.map {|x,y| y}.minmax.inject(:+) / 2.0).ceil
|
|
313
|
+
|
|
314
|
+
cells.each {|xi,yi|
|
|
315
|
+
rect = WX::Rect.new(
|
|
316
|
+
x + (xi-x_off)*map.tilewidth,
|
|
317
|
+
y + (yi-y_off)*map.tileheight,
|
|
318
|
+
map.tilewidth,map.tileheight
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
dc.draw_rectangle(rect)
|
|
322
|
+
dc.draw_bitmap(grid.table[yi,xi] * 0.5,
|
|
323
|
+
rect.x,rect.y)
|
|
324
|
+
|
|
325
|
+
}
|
|
326
|
+
end
|
|
327
|
+
# tl = grid.selected_topleft
|
|
328
|
+
# br = grid.selected_bottomright
|
|
329
|
+
#
|
|
330
|
+
# tl.size.times {|i|
|
|
331
|
+
|
|
332
|
+
# rect = WX::Rect.new(
|
|
333
|
+
# x + map.tilewidth * (tl[i][0] - tl[0][0]),
|
|
334
|
+
# y + map.tileheight * (br[i][1] - br[0][1]),
|
|
335
|
+
# map.tilewidth * (br[i][0] - tl[i][0] + 1),
|
|
336
|
+
# map.tileheight * (br[i][1] - tl[i][1] + 1)
|
|
337
|
+
# )
|
|
338
|
+
# dc.draw_rectangle(rect)
|
|
339
|
+
|
|
340
|
+
# tl[i][0].upto(br[i][0]).with_index {|xi,xii|
|
|
341
|
+
# tl[i][1].upto(br[i][1]).with_index {|yi,yii|
|
|
342
|
+
# dc.draw_bitmap(
|
|
343
|
+
# grid.table[yi,xi] * 0.5,
|
|
344
|
+
# x + map.tilewidth * (0 + xii),
|
|
345
|
+
# y + map.tileheight * (0 + yii)
|
|
346
|
+
# )
|
|
347
|
+
# }
|
|
348
|
+
# }
|
|
349
|
+
#
|
|
350
|
+
# }
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
#
|
|
354
|
+
## if !tl.nil? && !br.nil?
|
|
355
|
+
## tl[0].upto(br[0]).with_index {|xi,xii|
|
|
356
|
+
## tl[1].upto(br[1]).with_index {|yi,yii|
|
|
357
|
+
## dc.draw_bitmap(grid.table[yi,xi] * 0.5,
|
|
358
|
+
## x + map.tilewidth * xii,y + map.tileheight * yii)
|
|
359
|
+
## }
|
|
360
|
+
## }
|
|
361
|
+
## end
|
|
362
|
+
end
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
pwnd.bind(:motion) {|e|
|
|
366
|
+
|
|
367
|
+
pwnd.refresh
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
# pwnd.bind(:left_down) {|e|
|
|
372
|
+
# layer = @frame[:side][:layerlist].selection.instance_variable_get(:@layer)
|
|
373
|
+
|
|
374
|
+
# x = 10
|
|
375
|
+
# y = 10
|
|
376
|
+
# point = pwnd.screen_to_client(WX.mouse_position)
|
|
377
|
+
# x = (point.x - x) / map.tilewidth
|
|
378
|
+
# y = (point.y - y)/ map.tileheight
|
|
379
|
+
# grid = @frame[:tilemap].current_page
|
|
380
|
+
|
|
381
|
+
# if x >= 0 && x < map.width && y >= 0 && y < map.height && grid.selection?
|
|
382
|
+
# tl = grid.selected_topleft
|
|
383
|
+
# p tl
|
|
384
|
+
# tl = tl[0]
|
|
385
|
+
# br = grid.selected_bottomright[0]
|
|
386
|
+
|
|
387
|
+
# br = tl if br.nil?
|
|
388
|
+
|
|
389
|
+
# if !tl.nil? && !br.nil?
|
|
390
|
+
## tl[0].upto(br[0]).with_index {|xi,xii|
|
|
391
|
+
## tl[1].upto(br[1]).with_index {|yi,yii|
|
|
392
|
+
## dc.draw_bitmap(grid.table[yi,xi] * 0.5,
|
|
393
|
+
## x + map.tilewidth * xii,y + map.tileheight * yii)
|
|
394
|
+
## }
|
|
395
|
+
## }
|
|
396
|
+
# table = grid.table
|
|
397
|
+
# id = map.tilesets.key(table.set)
|
|
398
|
+
# layer[y * map.width + x] = id + tl[0] + table.cols * tl[1]
|
|
399
|
+
# #p x,y,tl,br
|
|
400
|
+
# end
|
|
401
|
+
#
|
|
402
|
+
# end
|
|
403
|
+
# }
|
|
404
|
+
} if map
|
|
405
|
+
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
## tc.bind(:tree_item_menu) {|e|
|
|
410
|
+
## tc.bind(:menu_selected,:new_menu) {p e.item.instance_variable_get(:@map_data)}
|
|
411
|
+
## tc.popupmenu(popup)
|
|
412
|
+
## }
|
|
413
|
+
aui.add(tc)
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
WX::AuiNoteBookCtrl.new(@frame,:id => :paint) {|nbc|
|
|
418
|
+
|
|
419
|
+
# nbc.add_page(WX::Window,"map1",:id=>:ok) {|pwnd|
|
|
420
|
+
# pwnd.bind(:paint) {
|
|
421
|
+
# pwnd.draw {|dc|
|
|
422
|
+
# @map1.draw(0,0,0) { dc }
|
|
423
|
+
# }
|
|
424
|
+
# }
|
|
425
|
+
# }
|
|
426
|
+
nbc.bind(:auinotebook_page_changed) {|e|
|
|
427
|
+
dv = @frame[:side][:layerlist]
|
|
428
|
+
dv.delete_items
|
|
429
|
+
map = nbc.page(e.selection).instance_variable_get(:@map)
|
|
430
|
+
if map
|
|
431
|
+
map.tilesets.each_value{|s|
|
|
432
|
+
@frame[:tilemap].add_page(WX::Grid,s.name) {|grid|
|
|
433
|
+
grid.default_renderer = TilesetGridRenderer.new
|
|
434
|
+
grid.table = TilesetGridTable.new(s)
|
|
435
|
+
grid.row_label_size = 0
|
|
436
|
+
grid.col_label_size = 0
|
|
437
|
+
|
|
438
|
+
grid.editable = false
|
|
439
|
+
|
|
440
|
+
grid.autosize
|
|
441
|
+
|
|
442
|
+
grid.bind(:grid_select_cell) {|e| p :select }
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
map.layers.each {|z,l|
|
|
447
|
+
dv.prepend_item(l.visible,"new16x16.png",l.name).instance_variable_set(:@layer,l)
|
|
448
|
+
}
|
|
449
|
+
end
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
aui.add(nbc,:direction=>:center)
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
#
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
WX::Window.new(@frame,:id=>:side) {|wnd|
|
|
459
|
+
wnd.sizer = WX::BoxSizer.new {|siz|
|
|
460
|
+
siz.orientation = true
|
|
461
|
+
|
|
462
|
+
siz.add(WX::BoxSizer.new {|bar_siz|
|
|
463
|
+
bar_siz.add(WX::StaticText.new(wnd, :label => "Sichtbarkeit:"),:align=>:center)
|
|
464
|
+
|
|
465
|
+
bar_siz.add(WX::Slider.new(wnd,
|
|
466
|
+
:min => 0,:max => 256,:value => 128,:id=>:slider) {|slider|
|
|
467
|
+
slider.bind(:scroll_changed) {|e|
|
|
468
|
+
sel = wnd[:layerlist].selection.instance_variable_get(:@layer)
|
|
469
|
+
sel.opacity = e.position / 256.0 if sel
|
|
470
|
+
@frame[:paint].refresh if @frame[:paint]
|
|
471
|
+
}
|
|
472
|
+
slider.bind(:scroll_thumbtrack) {|e|
|
|
473
|
+
sel = wnd[:layerlist].selection.instance_variable_get(:@layer)
|
|
474
|
+
sel.opacity = e.position / 256.0 if sel
|
|
475
|
+
@frame[:paint].refresh if @frame[:paint]
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
},
|
|
479
|
+
:expand => true,:proportion=>1)
|
|
480
|
+
},:expand => true)
|
|
481
|
+
|
|
482
|
+
siz.add(WX::DataViewList.new(wnd,:id=>:layerlist) {|dv|
|
|
483
|
+
dv.append_toggle_column("toogle")
|
|
484
|
+
dv.append_icontext_column("icon")
|
|
485
|
+
dv.append_text_column("text")
|
|
486
|
+
|
|
487
|
+
# @map1.layers.each {|z,l|
|
|
488
|
+
# dv.prepend_item(l.visible,"new16x16.png",l.name).instance_variable_set(:@layer,l)
|
|
489
|
+
# }
|
|
490
|
+
dv.bind(:dataview_selection_changed) {|e|
|
|
491
|
+
unless e.item.nil? || wnd[:slider].nil?
|
|
492
|
+
wnd[:slider].value = e.item.instance_variable_get(:@layer).opacity * 256
|
|
493
|
+
end
|
|
494
|
+
}
|
|
495
|
+
dv.bind(:dataview_value_changed) {|e|
|
|
496
|
+
case e.column
|
|
497
|
+
when 0
|
|
498
|
+
e.item.instance_variable_get(:@layer).visible = e.value
|
|
499
|
+
end
|
|
500
|
+
@frame[:paint].refresh if @frame[:paint]
|
|
501
|
+
}
|
|
502
|
+
},:expand => true,:proportion=>1)
|
|
503
|
+
|
|
504
|
+
siz.add(WX::ToolBar.new(wnd) {|tb|
|
|
505
|
+
tb.addNormal(:new,nil)
|
|
506
|
+
})
|
|
507
|
+
}
|
|
508
|
+
wnd.layout
|
|
509
|
+
aui.add(wnd)
|
|
510
|
+
}
|
|
511
|
+
##
|
|
512
|
+
## #aui.add(tb)
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
#tb = WX::AuiToolBar.new(@frame)
|
|
517
|
+
#tb.addNormal(:new,nil)
|
|
518
|
+
# tb.addNormal(:new,nil)
|
|
519
|
+
#aui.add(tb)
|
|
520
|
+
## #aui['tree'] = @tc
|
|
521
|
+
## #aui['tb'] = tb
|
|
522
|
+
}
|
|
523
|
+
#=end
|
|
524
|
+
# pg = WX::PropertyGrid.new(@frame,:extra_style => WX::PropertyGrid::EX_HELP_AS_TOOLTIPS)
|
|
525
|
+
|
|
526
|
+
# pg = WX::PropertyGridManager.new(@frame,
|
|
527
|
+
# :style => WX::PropertyGridManager::TOOLBAR,
|
|
528
|
+
# :extra_style => WX::PropertyGridManager::EX_MODE_BUTTONS
|
|
529
|
+
# )
|
|
530
|
+
|
|
531
|
+
# fp = WX::CategoryProperty.new
|
|
532
|
+
# fp.name = "Font1"
|
|
533
|
+
# fp.label = "Font2"
|
|
534
|
+
|
|
535
|
+
# pg.append(Cat)
|
|
536
|
+
=begin
|
|
537
|
+
map = TiledTmx::Map.load_xml("../../../unbenannt.tmx")
|
|
538
|
+
grid = WX::Grid.new(@frame)
|
|
539
|
+
grid.table = TilesetGridTable.new(map.tilesets[1])
|
|
540
|
+
|
|
541
|
+
grid.row_label_size = 0
|
|
542
|
+
grid.col_label_size = 0
|
|
543
|
+
|
|
544
|
+
grid.default_renderer = TilesetGridRenderer.new
|
|
545
|
+
|
|
546
|
+
grid.autosize
|
|
547
|
+
=end
|
|
548
|
+
#stc = WX::STC.new(@frame)
|
|
549
|
+
#stc.use_tabs = true
|
|
550
|
+
#stc.text = File.read("test.rb")
|
|
551
|
+
#stc.test_style
|
|
552
|
+
|
|
553
|
+
#p WX::STC::Version
|
|
554
|
+
#nbc.add_page(WX::Button,"cancel",:id => :cancel)
|
|
555
|
+
# WX::TreeCtrl.new(@frame)
|
|
556
|
+
# tc.bind(:tree_item_gettooltip) {|e|
|
|
557
|
+
# p e.item
|
|
558
|
+
# }
|
|
559
|
+
# slider = WX::Slider.new(@frame)
|
|
560
|
+
# slider.max = 10
|
|
561
|
+
# slider.value = 5
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
# @frame.bind(:paint) {
|
|
565
|
+
# @frame.draw {|dc|
|
|
566
|
+
# @map1.draw(0,0,0) { dc }
|
|
567
|
+
# }
|
|
568
|
+
# }
|
|
569
|
+
|
|
570
|
+
@frame.show
|
|
571
|
+
# #p @frame.each.to_
|
|
572
|
+
end
|
|
573
|
+
|
|
574
|
+
def add_map_to_tree(item,map)
|
|
575
|
+
item.instance_variable_set(:@map,TiledTmx::Map.load_xml(map[:file])) if map[:file]
|
|
576
|
+
map.xpath("map").each {|m| add_map_to_tree(item.append(m[:name]),m) }
|
|
577
|
+
end
|
|
578
|
+
end
|
|
579
|
+
|
|
580
|
+
A.new.main_loop
|