wxruby3 0.9.2 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INSTALL.md +35 -29
- data/README.md +24 -15
- data/ext/wxruby3/include/wxruby-ClientData.h +48 -0
- data/ext/wxruby3/include/wxruby-Config.h +23 -5
- data/ext/wxruby3/include/wxruby-Persistence.h +79 -0
- data/ext/wxruby3/include/wxruby-Validator.h +39 -0
- data/ext/wxruby3/include/wxruby-ValidatorBinding.h +64 -0
- data/ext/wxruby3/swig/custom/director.swg +8 -0
- data/ext/wxruby3/swig/mark_free_impl.i +0 -33
- data/ext/wxruby3/swig/memory_management.i +6 -0
- data/lib/wx/core/bitmap_combobox.rb +17 -21
- data/lib/wx/core/book_ctrl_base.rb +16 -0
- data/lib/wx/core/combobox.rb +13 -3
- data/lib/wx/core/config.rb +454 -83
- data/lib/wx/core/controlwithitems.rb +40 -130
- data/lib/wx/core/enum.rb +17 -1
- data/lib/wx/core/event.rb +6 -1
- data/lib/wx/core/evthandler.rb +8 -2
- data/lib/wx/core/generic_validator.rb +312 -0
- data/lib/wx/core/listbox.rb +2 -2
- data/lib/wx/core/log.rb +1 -1
- data/lib/wx/core/notebook.rb +10 -8
- data/lib/wx/core/owner_drawn_combobox.rb +45 -0
- data/lib/wx/core/peristent_object.rb +15 -0
- data/lib/wx/core/persistence_manager.rb +39 -0
- data/lib/wx/core/persistent_window.rb +16 -0
- data/lib/wx/core/size.rb +4 -0
- data/lib/wx/core/sizer.rb +1 -2
- data/lib/wx/core/standard_paths.rb +22 -0
- data/lib/wx/core/text_entry.rb +4 -1
- data/lib/wx/core/top_level_window.rb +16 -0
- data/lib/wx/core/treebook.rb +18 -0
- data/lib/wx/core/validator.rb +70 -5
- data/lib/wx/core/window.rb +3 -7
- data/lib/wx/core.rb +4 -0
- data/lib/wx/doc/art_locator.rb +1 -0
- data/lib/wx/doc/book_ctrl_base.rb +19 -0
- data/lib/wx/doc/comboctrl.rb +18 -0
- data/lib/wx/doc/config.rb +101 -41
- data/lib/wx/doc/controlwithitems.rb +16 -0
- data/lib/wx/doc/date_picker_ctrl.rb +23 -0
- data/lib/wx/doc/editable_listbox.rb +44 -0
- data/lib/wx/doc/enum.rb +15 -0
- data/lib/wx/doc/event.rb +12 -0
- data/lib/wx/doc/extra/12_client_data.md +89 -0
- data/lib/wx/doc/extra/13_validators.md +139 -0
- data/lib/wx/doc/extra/14_config.md +101 -0
- data/lib/wx/doc/extra/15_persistence.md +148 -0
- data/lib/wx/doc/gdi_common.rb +4 -0
- data/lib/wx/doc/generic_validator.rb +95 -0
- data/lib/wx/doc/html/simple_html_listbox.rb +22 -0
- data/lib/wx/doc/num_validator.rb +387 -0
- data/lib/wx/doc/owner_drawn_combobox.rb +96 -0
- data/lib/wx/doc/persistence_manager.rb +36 -0
- data/lib/wx/doc/persistent_object.rb +27 -0
- data/lib/wx/doc/pg/numeric_property_validator.rb +33 -0
- data/lib/wx/doc/static_bitmap.rb +25 -0
- data/lib/wx/doc/text_validator.rb +10 -0
- data/lib/wx/doc/top_level_window.rb +19 -0
- data/lib/wx/doc/treebook.rb +6 -1
- data/lib/wx/doc/validator.rb +113 -0
- data/lib/wx/doc/window.rb +30 -0
- data/lib/wx/html/simple_html_listbox.rb +24 -91
- data/lib/wx/keyword_defs.rb +34 -2
- data/lib/wx/rbn/ribbon_gallery.rb +0 -21
- data/lib/wx/version.rb +1 -1
- data/rakelib/build.rb +1 -1
- data/rakelib/lib/config/mingw.rb +12 -0
- data/rakelib/lib/core/include/client_data.inc +65 -0
- data/rakelib/lib/core/include/funcall.inc +1 -1
- data/rakelib/lib/core/package.rb +39 -3
- data/rakelib/lib/core/parameter.rb +1 -1
- data/rakelib/lib/core/spec.rb +10 -0
- data/rakelib/lib/core/spec_helper.rb +8 -2
- data/rakelib/lib/director/app.rb +18 -0
- data/rakelib/lib/director/app_traits.rb +3 -1
- data/rakelib/lib/director/bitmap_combobox.rb +2 -2
- data/rakelib/lib/director/combobox.rb +22 -0
- data/rakelib/lib/director/comboctrl.rb +1 -55
- data/rakelib/lib/director/config_base.rb +490 -19
- data/rakelib/lib/director/ctrl_with_items.rb +88 -21
- data/rakelib/lib/director/date_picker_ctrl.rb +8 -6
- data/rakelib/lib/director/editable_listbox.rb +30 -0
- data/rakelib/lib/director/event.rb +102 -12
- data/rakelib/lib/director/event_filter.rb +1 -1
- data/rakelib/lib/director/event_handler.rb +3 -2
- data/rakelib/lib/director/event_loop.rb +1 -1
- data/rakelib/lib/director/file_dialog_customize_hook.rb +2 -2
- data/rakelib/lib/director/functions.rb +4 -2
- data/rakelib/lib/director/generic_dirctrl.rb +17 -0
- data/rakelib/lib/director/grid_cell_attr.rb +1 -3
- data/rakelib/lib/director/grid_cell_editor.rb +1 -3
- data/rakelib/lib/director/grid_cell_renderer.rb +1 -3
- data/rakelib/lib/director/header_ctrl.rb +9 -1
- data/rakelib/lib/director/html_listbox.rb +97 -22
- data/rakelib/lib/director/num_validator.rb +495 -0
- data/rakelib/lib/director/numeric_property_validator.rb +131 -6
- data/rakelib/lib/director/owner_drawn_combobox.rb +192 -0
- data/rakelib/lib/director/persistence_manager.rb +410 -0
- data/rakelib/lib/director/persistent_object.rb +70 -0
- data/rakelib/lib/director/persistent_window.rb +73 -0
- data/rakelib/lib/director/pgproperty.rb +3 -29
- data/rakelib/lib/director/ribbon_button_bar.rb +3 -3
- data/rakelib/lib/director/ribbon_gallery.rb +3 -5
- data/rakelib/lib/director/sizer.rb +15 -4
- data/rakelib/lib/director/sizer_item.rb +13 -0
- data/rakelib/lib/director/static_bitmap.rb +32 -0
- data/rakelib/lib/director/text_entry.rb +5 -1
- data/rakelib/lib/director/text_validator.rb +124 -13
- data/rakelib/lib/director/toggle_button.rb +1 -0
- data/rakelib/lib/director/top_level_window.rb +0 -2
- data/rakelib/lib/director/tree_ctrl.rb +35 -0
- data/rakelib/lib/director/utils.rb +16 -2
- data/rakelib/lib/director/validator.rb +196 -21
- data/rakelib/lib/director/window.rb +16 -2
- data/rakelib/lib/extractor/function.rb +2 -1
- data/rakelib/lib/generate/analyzer.rb +44 -44
- data/rakelib/lib/generate/doc.rb +11 -5
- data/rakelib/lib/specs/interfaces.rb +5 -0
- data/rakelib/lib/swig_runner.rb +55 -9
- data/rakelib/lib/typemap/client_data.rb +67 -0
- data/rakelib/lib/typemap/common.rb +3 -3
- data/rakelib/lib/typemap/config.rb +8 -0
- data/rakelib/lib/typemap/datetime.rb +1 -1
- data/rakelib/lib/typemap/tree_itemid.rb +2 -2
- data/samples/aui/aui.rb +1237 -1233
- data/samples/calendar/calendar.rb +293 -289
- data/samples/controls/get_item_sample.rb +83 -79
- data/samples/controls/htlbox.rb +331 -327
- data/samples/dialogs/dialogs.rb +682 -694
- data/samples/dialogs/wizard.rb +52 -55
- data/samples/dragdrop/dragdrop.rb +146 -142
- data/samples/drawing/bitmap.rb +29 -26
- data/samples/drawing/bitmap_image.rb +84 -80
- data/samples/drawing/graphics_drawing.rb +209 -205
- data/samples/drawing/image_prt.rb +344 -340
- data/samples/drawing/maths_images.rb +18 -1
- data/samples/drawing/rmagic_bitmap_image.rb +88 -84
- data/samples/etc/caret.rb +306 -0
- data/samples/etc/miniframe.rb +65 -60
- data/samples/etc/sash.rb +109 -105
- data/samples/etc/scrollwin.rb +86 -80
- data/samples/etc/system_settings.rb +216 -209
- data/samples/event/activation.rb +72 -67
- data/samples/event/event.rb +160 -153
- data/samples/event/threaded.rb +8 -1
- data/samples/event/update_ui_event.rb +67 -60
- data/samples/grid/grid.rb +188 -181
- data/samples/grid/gridtablebase.rb +136 -129
- data/samples/html/html.rb +208 -204
- data/samples/mdi/mdi.rb +59 -54
- data/samples/minimal/minimal.rb +54 -51
- data/samples/minimal/nothing.rb +1 -0
- data/samples/printing/printing.rb +367 -377
- data/samples/printing/printing2.rb +203 -198
- data/samples/propgrid/propgrid.rb +2312 -2308
- data/samples/propgrid/propgrid_minimal.rb +57 -50
- data/samples/ribbon/ribbon.rb +780 -774
- data/samples/sampler/ext.rb +0 -33
- data/samples/sampler/sample.rb +4 -9
- data/samples/sampler.rb +1 -1
- data/samples/splash/splash.rb +118 -116
- data/samples/text/rich_textctrl.rb +207 -201
- data/samples/text/richtext.rb +1409 -1405
- data/samples/text/scintilla.rb +137 -128
- data/samples/text/textctrl.rb +89 -83
- data/samples/text/unicode.rb +175 -168
- data/samples/treectrl/treectrl.rb +1430 -1426
- data/samples/widgets/activityindicator.rb +95 -0
- data/samples/widgets/art/widgets/activityindicator.xpm +278 -0
- data/samples/widgets/art/widgets/bmpbtn.xpm +37 -0
- data/samples/widgets/art/widgets/bmpcombobox.xpm +54 -0
- data/samples/widgets/art/widgets/button.xpm +54 -0
- data/samples/widgets/art/widgets/checkbox.xpm +54 -0
- data/samples/{bigdemo/icons → widgets/art/widgets}/choice.xpm +1 -1
- data/samples/widgets/art/widgets/choicebk.xpm +54 -0
- data/samples/widgets/art/widgets/clrpicker.xpm +193 -0
- data/samples/widgets/art/widgets/combobox.xpm +54 -0
- data/samples/widgets/art/widgets/datepick.xpm +200 -0
- data/samples/widgets/art/widgets/dirctrl.xpm +54 -0
- data/samples/widgets/art/widgets/dirpicker.xpm +213 -0
- data/samples/widgets/art/widgets/filepicker.xpm +214 -0
- data/samples/widgets/art/widgets/fontpicker.xpm +185 -0
- data/samples/widgets/art/widgets/gauge.xpm +54 -0
- data/samples/widgets/art/widgets/header.xpm +54 -0
- data/samples/widgets/art/widgets/hyperlnk.xpm +54 -0
- data/samples/widgets/art/widgets/listbook.xpm +54 -0
- data/samples/widgets/art/widgets/listbox.xpm +54 -0
- data/samples/widgets/art/widgets/native.xpm +81 -0
- data/samples/widgets/art/widgets/notebook.xpm +54 -0
- data/samples/widgets/art/widgets/odcombobox.xpm +54 -0
- data/samples/widgets/art/widgets/radiobox.xpm +54 -0
- data/samples/widgets/art/widgets/scrolbar.xpm +54 -0
- data/samples/widgets/art/widgets/slider.xpm +54 -0
- data/samples/widgets/art/widgets/spinbtn.xpm +40 -0
- data/samples/widgets/art/widgets/statbmp.xpm +40 -0
- data/samples/widgets/art/widgets/statbox.xpm +54 -0
- data/samples/widgets/art/widgets/stattext.xpm +54 -0
- data/samples/widgets/art/widgets/text.xpm +54 -0
- data/samples/widgets/art/widgets/timepick.xpm +207 -0
- data/samples/widgets/art/widgets/toggle.xpm +54 -0
- data/samples/widgets/art/widgets/toucan.png +0 -0
- data/samples/widgets/bmpcombobox.rb +651 -0
- data/samples/widgets/button.rb +462 -0
- data/samples/widgets/checkbox.rb +211 -0
- data/samples/widgets/choice.rb +287 -0
- data/samples/widgets/clrpicker.rb +156 -0
- data/samples/widgets/combobox.rb +516 -0
- data/samples/widgets/datepick.rb +215 -0
- data/samples/widgets/dirctrl.rb +265 -0
- data/samples/widgets/dirpicker.rb +158 -0
- data/samples/widgets/editlbox.rb +122 -0
- data/samples/widgets/filectrl.rb +216 -0
- data/samples/widgets/filepicker.rb +214 -0
- data/samples/widgets/fontpicker.rb +135 -0
- data/samples/widgets/gauge.rb +311 -0
- data/samples/widgets/headerctrl.rb +236 -0
- data/samples/widgets/hyperlink.rb +203 -0
- data/samples/widgets/itemcontainer.rb +185 -0
- data/samples/widgets/listbox.rb +473 -0
- data/samples/widgets/notebook.rb +488 -0
- data/samples/widgets/odcombobox.rb +608 -0
- data/samples/widgets/radiobox.rb +328 -0
- data/samples/widgets/searchctrl.rb +159 -0
- data/samples/widgets/slider.rb +594 -0
- data/samples/widgets/spinbtn.rb +443 -0
- data/samples/widgets/statbmp.rb +130 -0
- data/samples/widgets/static.rb +436 -0
- data/samples/widgets/textctrl.rb +700 -0
- data/samples/widgets/timepick.rb +148 -0
- data/samples/widgets/tn_widgets.png +0 -0
- data/samples/widgets/toggle.rb +385 -0
- data/samples/widgets/widgets.rb +1229 -0
- data/samples/xrc/custom_xrc_sample.rb +47 -41
- data/samples/xrc/xrc_sample.rb +53 -47
- data/tests/test_config.rb +207 -42
- data/tests/test_event_handling.rb +52 -34
- data/tests/test_events.rb +7 -0
- data/tests/test_item_data.rb +24 -0
- data/tests/test_persistence.rb +142 -0
- data/tests/test_sizer.rb +44 -1
- data/tests/test_validators.rb +805 -0
- metadata +109 -138
- data/lib/wx/core/choice.rb +0 -14
- data/lib/wx/core/combo_ctrl.rb +0 -110
- data/rakelib/lib/typemap/grid_client_data.rb +0 -58
- data/samples/bigdemo/About.rbw +0 -39
- data/samples/bigdemo/ColorPanel.rbw +0 -23
- data/samples/bigdemo/GridSimple.rbw +0 -78
- data/samples/bigdemo/MDIDemo.rbw +0 -57
- data/samples/bigdemo/PopupMenu.rbw +0 -146
- data/samples/bigdemo/ShapedWindow.rbw +0 -128
- data/samples/bigdemo/Sizers.rbw +0 -541
- data/samples/bigdemo/bigdemo.rb +0 -817
- data/samples/bigdemo/demoTemplate.rbw +0 -33
- data/samples/bigdemo/helpfile.htb +0 -0
- data/samples/bigdemo/icons/Test 015.jpg +0 -0
- data/samples/bigdemo/icons/Test 015.png +0 -0
- data/samples/bigdemo/icons/choice.bmp +0 -0
- data/samples/bigdemo/icons/combo.bmp +0 -0
- data/samples/bigdemo/icons/combo.xpm +0 -27
- data/samples/bigdemo/icons/copy.xpm +0 -25
- data/samples/bigdemo/icons/cut.xpm +0 -24
- data/samples/bigdemo/icons/gauge.bmp +0 -0
- data/samples/bigdemo/icons/gauge.xpm +0 -27
- data/samples/bigdemo/icons/help.xpm +0 -25
- data/samples/bigdemo/icons/list.bmp +0 -0
- data/samples/bigdemo/icons/list.xpm +0 -27
- data/samples/bigdemo/icons/mondrian.ico +0 -0
- data/samples/bigdemo/icons/mondrian.xpm +0 -44
- data/samples/bigdemo/icons/new.xpm +0 -24
- data/samples/bigdemo/icons/ogl.ico +0 -0
- data/samples/bigdemo/icons/ogl.xpm +0 -45
- data/samples/bigdemo/icons/open.xpm +0 -26
- data/samples/bigdemo/icons/paste.bmp +0 -0
- data/samples/bigdemo/icons/paste.xpm +0 -38
- data/samples/bigdemo/icons/pointy.png +0 -0
- data/samples/bigdemo/icons/preview.xpm +0 -26
- data/samples/bigdemo/icons/print.xpm +0 -26
- data/samples/bigdemo/icons/radio.bmp +0 -0
- data/samples/bigdemo/icons/radio.xpm +0 -27
- data/samples/bigdemo/icons/robert.xpm +0 -415
- data/samples/bigdemo/icons/sashtest.ico +0 -0
- data/samples/bigdemo/icons/save.xpm +0 -25
- data/samples/bigdemo/icons/smiles.bmp +0 -0
- data/samples/bigdemo/icons/smiles.xpm +0 -39
- data/samples/bigdemo/icons/smiley.ico +0 -0
- data/samples/bigdemo/icons/smiley.xpm +0 -42
- data/samples/bigdemo/icons/stattext.xpm +0 -24
- data/samples/bigdemo/icons/test2.bmp +0 -0
- data/samples/bigdemo/icons/test2.png +0 -0
- data/samples/bigdemo/icons/test2.xpm +0 -79
- data/samples/bigdemo/icons/text.bmp +0 -0
- data/samples/bigdemo/icons/text.xpm +0 -27
- data/samples/bigdemo/icons/tog1.bmp +0 -0
- data/samples/bigdemo/icons/tog1.xpm +0 -38
- data/samples/bigdemo/icons/tog2.bmp +0 -0
- data/samples/bigdemo/icons/tog2.xpm +0 -38
- data/samples/bigdemo/icons/wxruby-128x128.png +0 -0
- data/samples/bigdemo/icons/wxwin.ico +0 -0
- data/samples/bigdemo/icons/wxwin16x16.png +0 -0
- data/samples/bigdemo/icons/wxwin16x16.xpm +0 -25
- data/samples/bigdemo/icons/wxwin32x32.png +0 -0
- data/samples/bigdemo/icons/wxwin48x48.png +0 -0
- data/samples/bigdemo/run.rb +0 -98
- data/samples/bigdemo/tips.txt +0 -7
- data/samples/bigdemo/utils.rb +0 -20
- data/samples/bigdemo/wxArtProvider.rbw +0 -282
- data/samples/bigdemo/wxBitmapButton.rbw +0 -65
- data/samples/bigdemo/wxButton.rbw +0 -64
- data/samples/bigdemo/wxCalendarCtrl.rbw +0 -59
- data/samples/bigdemo/wxCheckBox.rbw +0 -50
- data/samples/bigdemo/wxCheckListBox.rbw +0 -65
- data/samples/bigdemo/wxChoice.rbw +0 -47
- data/samples/bigdemo/wxChoicebook.rbw +0 -78
- data/samples/bigdemo/wxColourDialog.rbw +0 -33
- data/samples/bigdemo/wxComboBox.rbw +0 -77
- data/samples/bigdemo/wxCursor.rbw +0 -136
- data/samples/bigdemo/wxDialog.rbw +0 -74
- data/samples/bigdemo/wxDirDialog.rbw +0 -29
- data/samples/bigdemo/wxDragImage.rbw +0 -70
- data/samples/bigdemo/wxFileDialog.rbw +0 -37
- data/samples/bigdemo/wxFileDialog_Save.rbw +0 -35
- data/samples/bigdemo/wxFindReplaceDialog.rbw +0 -82
- data/samples/bigdemo/wxFontDialog.rbw +0 -200
- data/samples/bigdemo/wxFrame.rbw +0 -53
- data/samples/bigdemo/wxGauge.rbw +0 -65
- data/samples/bigdemo/wxGenericDirCtrl.rbw +0 -74
- data/samples/bigdemo/wxGrid.rbw +0 -66
- data/samples/bigdemo/wxHtmlHelpController.rbw +0 -52
- data/samples/bigdemo/wxListBox.rbw +0 -140
- data/samples/bigdemo/wxListCtrl_virtual.rbw +0 -112
- data/samples/bigdemo/wxMDIWindows.rbw +0 -50
- data/samples/bigdemo/wxMenu.rbw +0 -247
- data/samples/bigdemo/wxMessageDialog.rbw +0 -27
- data/samples/bigdemo/wxMiniFrame.rbw +0 -70
- data/samples/bigdemo/wxMultipleChoiceDialog.rbw +0 -29
- data/samples/bigdemo/wxNotebook.rbw +0 -136
- data/samples/bigdemo/wxProgressDialog.rbw +0 -43
- data/samples/bigdemo/wxRadioBox.rbw +0 -72
- data/samples/bigdemo/wxRadioButton.rbw +0 -125
- data/samples/bigdemo/wxSashWindow.rbw +0 -141
- data/samples/bigdemo/wxScrolledMessageDialog.rbw +0 -57
- data/samples/bigdemo/wxScrolledWindow.rbw +0 -199
- data/samples/bigdemo/wxSingleChoiceDialog.rbw +0 -33
- data/samples/bigdemo/wxSlider.rbw +0 -42
- data/samples/bigdemo/wxSpinButton.rbw +0 -50
- data/samples/bigdemo/wxSpinCtrl.rbw +0 -51
- data/samples/bigdemo/wxSplitterWindow.rbw +0 -63
- data/samples/bigdemo/wxStaticBitmap.rbw +0 -47
- data/samples/bigdemo/wxStaticText.rbw +0 -55
- data/samples/bigdemo/wxStatusBar.rbw +0 -126
- data/samples/bigdemo/wxTextCtrl.rbw +0 -149
- data/samples/bigdemo/wxTextEntryDialog.rbw +0 -31
- data/samples/bigdemo/wxToggleButton.rbw +0 -49
- data/samples/bigdemo/wxToolBar.rbw +0 -131
- data/samples/bigdemo/wxTreeCtrl.rbw +0 -191
- data/samples/caret/caret.rb +0 -298
- data/samples/caret/mondrian.xpm +0 -44
- data/samples/controls/books.rb +0 -189
- data/samples/controls/choice.xpm +0 -27
- data/samples/controls/combo.xpm +0 -27
- data/samples/controls/controls.rb +0 -1099
- data/samples/controls/gauge.xpm +0 -27
- data/samples/controls/list.xpm +0 -27
- data/samples/controls/mondrian.ico +0 -0
- data/samples/controls/mondrian.xpm +0 -44
- data/samples/controls/radio.xpm +0 -27
- data/samples/controls/stattext.xpm +0 -24
- data/samples/controls/test2.bmp +0 -0
- data/samples/controls/text.xpm +0 -27
- data/samples/controls/tn_books.png +0 -0
- data/samples/controls/tn_controls.png +0 -0
- data/samples/etc/choice.rb +0 -87
- data/samples/etc/tn_choice.png +0 -0
- data/samples/text/mondrian.ico +0 -0
- data/samples/text/mondrian.xpm +0 -44
- /data/samples/{caret → etc}/tn_caret.png +0 -0
data/samples/aui/aui.rb
CHANGED
@@ -11,1361 +11,1365 @@
|
|
11
11
|
|
12
12
|
require 'wx'
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
paint do |dc|
|
26
|
-
size = get_client_size
|
27
|
-
|
28
|
-
dc.set_font Wx::NORMAL_FONT
|
29
|
-
dc.set_brush Wx::WHITE_BRUSH
|
30
|
-
dc.set_pen Wx::WHITE_PEN
|
31
|
-
dc.draw_rectangle(0, 0, size.width, size.height)
|
32
|
-
dc.set_pen Wx::LIGHT_GREY_PEN
|
33
|
-
dc.set_pen Wx::LIGHT_GREY_PEN
|
34
|
-
dc.draw_line(0, 0, size.width, size.height)
|
35
|
-
dc.draw_line(0, size.height, size.width, 0)
|
36
|
-
|
37
|
-
msg = "Size: %d x %d" % [size.width, size.height]
|
38
|
-
width, height = dc.get_text_extent(msg)
|
39
|
-
height += 3
|
40
|
-
dc.draw_text(msg,
|
41
|
-
(size.width - width) / 2,
|
42
|
-
(size.height - (height * 5)) / 2)
|
43
|
-
|
44
|
-
if @mgr
|
45
|
-
pi = @mgr.get_pane(self)
|
46
|
-
msg = "Layer: %d" % pi.layer
|
47
|
-
width, height = dc.get_text_extent(msg)
|
48
|
-
dc.draw_text(msg,
|
49
|
-
(size.width - width) / 2,
|
50
|
-
((size.height - (height * 5)) / 2) + height)
|
14
|
+
module AuiTest
|
15
|
+
|
16
|
+
# A resizable control that displays its current size, and, if an AUI
|
17
|
+
# arrangement, its position and layer
|
18
|
+
class SizeReportCtrl < Wx::Control
|
19
|
+
def initialize(parent, id, pos, size, mgr = nil)
|
20
|
+
super(parent, id, pos, size)
|
21
|
+
@mgr = mgr
|
22
|
+
evt_paint { on_paint }
|
23
|
+
evt_size { on_size }
|
24
|
+
end
|
51
25
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
(size.width - width) / 2,
|
56
|
-
((size.height - (height * 5)) / 2) + (height * 2))
|
26
|
+
def on_paint
|
27
|
+
paint do |dc|
|
28
|
+
size = get_client_size
|
57
29
|
|
58
|
-
|
59
|
-
|
60
|
-
dc.
|
61
|
-
|
62
|
-
|
30
|
+
dc.set_font Wx::NORMAL_FONT
|
31
|
+
dc.set_brush Wx::WHITE_BRUSH
|
32
|
+
dc.set_pen Wx::WHITE_PEN
|
33
|
+
dc.draw_rectangle(0, 0, size.width, size.height)
|
34
|
+
dc.set_pen Wx::LIGHT_GREY_PEN
|
35
|
+
dc.set_pen Wx::LIGHT_GREY_PEN
|
36
|
+
dc.draw_line(0, 0, size.width, size.height)
|
37
|
+
dc.draw_line(0, size.height, size.width, 0)
|
63
38
|
|
64
|
-
msg = "
|
39
|
+
msg = "Size: %d x %d" % [size.width, size.height]
|
65
40
|
width, height = dc.get_text_extent(msg)
|
41
|
+
height += 3
|
66
42
|
dc.draw_text(msg,
|
67
43
|
(size.width - width) / 2,
|
68
|
-
(
|
44
|
+
(size.height - (height * 5)) / 2)
|
45
|
+
|
46
|
+
if @mgr
|
47
|
+
pi = @mgr.get_pane(self)
|
48
|
+
msg = "Layer: %d" % pi.layer
|
49
|
+
width, height = dc.get_text_extent(msg)
|
50
|
+
dc.draw_text(msg,
|
51
|
+
(size.width - width) / 2,
|
52
|
+
((size.height - (height * 5)) / 2) + height)
|
53
|
+
|
54
|
+
msg = "Dock: %d Row: %d" % [pi.direction, pi.row]
|
55
|
+
width, height = dc.get_text_extent(msg)
|
56
|
+
dc.draw_text(msg,
|
57
|
+
(size.width - width) / 2,
|
58
|
+
((size.height - (height * 5)) / 2) + (height * 2))
|
59
|
+
|
60
|
+
msg = "Position: %d" % pi.position
|
61
|
+
width, height = dc.get_text_extent(msg)
|
62
|
+
dc.draw_text(msg,
|
63
|
+
(size.width - width) / 2,
|
64
|
+
((size.height - (height * 5)) / 2) + (height * 3))
|
65
|
+
|
66
|
+
msg = "Proportion: %d" % pi.proportion
|
67
|
+
width, height = dc.get_text_extent(msg)
|
68
|
+
dc.draw_text(msg,
|
69
|
+
(size.width - width) / 2,
|
70
|
+
((size.height - (height * 5)) / 2) + (height * 4))
|
69
71
|
|
72
|
+
end
|
70
73
|
end
|
71
74
|
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def on_size
|
75
|
-
refresh
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
class SettingsPanel < Wx::Panel
|
80
|
-
module ID
|
81
|
-
include Wx::IDHelper
|
82
|
-
|
83
|
-
PaneBorderSize = self.next_id
|
84
|
-
SashSize = self.next_id
|
85
|
-
CaptionSize = self.next_id
|
86
|
-
BackgroundColour = self.next_id
|
87
|
-
SashColour = self.next_id
|
88
|
-
InactiveCaptionColour = self.next_id
|
89
|
-
InactiveCaptionGradientColour = self.next_id
|
90
|
-
InactiveCaptionTextColour = self.next_id
|
91
|
-
ActiveCaptionColour = self.next_id
|
92
|
-
ActiveCaptionGradientColour = self.next_id
|
93
|
-
ActiveCaptionTextColour = self.next_id
|
94
|
-
BorderColour = self.next_id
|
95
|
-
GripperColour = self.next_id
|
96
|
-
end
|
97
75
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
@base_bmp = create_colour_bitmap(Wx::BLACK)
|
102
|
-
|
103
|
-
# set up some spin ctrls for integer variables
|
104
|
-
@border_size, s1 = make_metric_spin_ctrl(ID::PaneBorderSize,
|
105
|
-
"Pane Border Size:",
|
106
|
-
Wx::AUI_DOCKART_PANE_BORDER_SIZE)
|
107
|
-
|
108
|
-
@sash_size, s2 = make_metric_spin_ctrl(ID::SashSize,
|
109
|
-
"Sash Size:",
|
110
|
-
Wx::AUI_DOCKART_SASH_SIZE)
|
111
|
-
|
112
|
-
@cap_size, s3 = make_metric_spin_ctrl(ID::CaptionSize,
|
113
|
-
"Caption Size:",
|
114
|
-
Wx::AUI_DOCKART_CAPTION_SIZE)
|
115
|
-
|
116
|
-
# colour controls
|
117
|
-
@bckg_colour, s4 = make_colour_button(ID::BackgroundColour,
|
118
|
-
"Background Colour:")
|
119
|
-
@sash_colour, s5 = make_colour_button(ID::SashColour,
|
120
|
-
"Sash Colour:")
|
121
|
-
@capt_colour, s6 = make_colour_button(ID::InactiveCaptionColour,
|
122
|
-
"Normal Caption:")
|
123
|
-
@capt_gradnt, s7 = make_colour_button(ID::InactiveCaptionGradientColour,
|
124
|
-
"Normal Caption Gradient:")
|
125
|
-
@capt_text, s8 = make_colour_button(ID::InactiveCaptionTextColour,
|
126
|
-
"Normal Caption Text:")
|
127
|
-
@acap_colour, s9 = make_colour_button(ID::ActiveCaptionColour,
|
128
|
-
"Active Caption:")
|
129
|
-
@acap_gradnt, s10 = make_colour_button(ID::ActiveCaptionGradientColour,
|
130
|
-
"Active Caption Gradient:")
|
131
|
-
@acap_text, s11 = make_colour_button(ID::ActiveCaptionTextColour,
|
132
|
-
"Active Caption Text:")
|
133
|
-
@brdr_colour, s12 = make_colour_button(ID::BorderColour,
|
134
|
-
"Border Colour:")
|
135
|
-
@grip_colour, s13 = make_colour_button(ID::GripperColour,
|
136
|
-
"Gripper Colour:")
|
137
|
-
|
138
|
-
grid_sizer = Wx::GridSizer.new(2)
|
139
|
-
grid_sizer.set_h_gap(5)
|
140
|
-
|
141
|
-
grid_sizer.add(s1); grid_sizer.add(s4)
|
142
|
-
grid_sizer.add(s2); grid_sizer.add(s5)
|
143
|
-
grid_sizer.add(s3); grid_sizer.add(s13)
|
144
|
-
grid_sizer.add(1, 1); grid_sizer.add(s12)
|
145
|
-
grid_sizer.add(s6); grid_sizer.add(s9)
|
146
|
-
grid_sizer.add(s7); grid_sizer.add(s10)
|
147
|
-
grid_sizer.add(s8); grid_sizer.add(s11)
|
148
|
-
|
149
|
-
cont_sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
150
|
-
cont_sizer.add(grid_sizer, 1, Wx::EXPAND | Wx::ALL, 5)
|
151
|
-
self.set_sizer(cont_sizer)
|
152
|
-
get_sizer.set_size_hints(self)
|
153
|
-
update_colours
|
154
|
-
|
155
|
-
evt_spinctrl(ID::PaneBorderSize) { |e| on_pane_border_size(e) }
|
156
|
-
evt_spinctrl(ID::SashSize) { |e| on_sash_size(e) }
|
157
|
-
evt_spinctrl(ID::CaptionSize) { |e| on_caption_size(e) }
|
158
|
-
evt_button(ID::BackgroundColour) { |e| on_set_colour(e) }
|
159
|
-
evt_button(ID::SashColour) { |e| on_set_colour(e) }
|
160
|
-
evt_button(ID::InactiveCaptionColour) { |e| on_set_colour(e) }
|
161
|
-
evt_button(ID::InactiveCaptionGradientColour) { |e| on_set_colour(e) }
|
162
|
-
evt_button(ID::InactiveCaptionTextColour) { |e| on_set_colour(e) }
|
163
|
-
evt_button(ID::ActiveCaptionColour) { |e| on_set_colour(e) }
|
164
|
-
evt_button(ID::ActiveCaptionGradientColour) { |e| on_set_colour(e) }
|
165
|
-
evt_button(ID::ActiveCaptionTextColour) { |e| on_set_colour(e) }
|
166
|
-
evt_button(ID::BorderColour) { |e| on_set_colour(e) }
|
167
|
-
evt_button(ID::GripperColour) { |e| on_set_colour(e) }
|
76
|
+
def on_size
|
77
|
+
refresh
|
78
|
+
end
|
168
79
|
end
|
169
80
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
81
|
+
class SettingsPanel < Wx::Panel
|
82
|
+
module ID
|
83
|
+
include Wx::IDHelper
|
84
|
+
|
85
|
+
PaneBorderSize = self.next_id
|
86
|
+
SashSize = self.next_id
|
87
|
+
CaptionSize = self.next_id
|
88
|
+
BackgroundColour = self.next_id
|
89
|
+
SashColour = self.next_id
|
90
|
+
InactiveCaptionColour = self.next_id
|
91
|
+
InactiveCaptionGradientColour = self.next_id
|
92
|
+
InactiveCaptionTextColour = self.next_id
|
93
|
+
ActiveCaptionColour = self.next_id
|
94
|
+
ActiveCaptionGradientColour = self.next_id
|
95
|
+
ActiveCaptionTextColour = self.next_id
|
96
|
+
BorderColour = self.next_id
|
97
|
+
GripperColour = self.next_id
|
98
|
+
end
|
175
99
|
|
176
|
-
|
177
|
-
|
100
|
+
def initialize(parent, frame)
|
101
|
+
super(parent, Wx::ID_ANY)
|
102
|
+
@frame = frame
|
103
|
+
@base_bmp = create_colour_bitmap(Wx::BLACK)
|
104
|
+
|
105
|
+
# set up some spin ctrls for integer variables
|
106
|
+
@border_size, s1 = make_metric_spin_ctrl(ID::PaneBorderSize,
|
107
|
+
"Pane Border Size:",
|
108
|
+
Wx::AUI_DOCKART_PANE_BORDER_SIZE)
|
109
|
+
|
110
|
+
@sash_size, s2 = make_metric_spin_ctrl(ID::SashSize,
|
111
|
+
"Sash Size:",
|
112
|
+
Wx::AUI_DOCKART_SASH_SIZE)
|
113
|
+
|
114
|
+
@cap_size, s3 = make_metric_spin_ctrl(ID::CaptionSize,
|
115
|
+
"Caption Size:",
|
116
|
+
Wx::AUI_DOCKART_CAPTION_SIZE)
|
117
|
+
|
118
|
+
# colour controls
|
119
|
+
@bckg_colour, s4 = make_colour_button(ID::BackgroundColour,
|
120
|
+
"Background Colour:")
|
121
|
+
@sash_colour, s5 = make_colour_button(ID::SashColour,
|
122
|
+
"Sash Colour:")
|
123
|
+
@capt_colour, s6 = make_colour_button(ID::InactiveCaptionColour,
|
124
|
+
"Normal Caption:")
|
125
|
+
@capt_gradnt, s7 = make_colour_button(ID::InactiveCaptionGradientColour,
|
126
|
+
"Normal Caption Gradient:")
|
127
|
+
@capt_text, s8 = make_colour_button(ID::InactiveCaptionTextColour,
|
128
|
+
"Normal Caption Text:")
|
129
|
+
@acap_colour, s9 = make_colour_button(ID::ActiveCaptionColour,
|
130
|
+
"Active Caption:")
|
131
|
+
@acap_gradnt, s10 = make_colour_button(ID::ActiveCaptionGradientColour,
|
132
|
+
"Active Caption Gradient:")
|
133
|
+
@acap_text, s11 = make_colour_button(ID::ActiveCaptionTextColour,
|
134
|
+
"Active Caption Text:")
|
135
|
+
@brdr_colour, s12 = make_colour_button(ID::BorderColour,
|
136
|
+
"Border Colour:")
|
137
|
+
@grip_colour, s13 = make_colour_button(ID::GripperColour,
|
138
|
+
"Gripper Colour:")
|
139
|
+
|
140
|
+
grid_sizer = Wx::GridSizer.new(2)
|
141
|
+
grid_sizer.set_h_gap(5)
|
142
|
+
|
143
|
+
grid_sizer.add(s1); grid_sizer.add(s4)
|
144
|
+
grid_sizer.add(s2); grid_sizer.add(s5)
|
145
|
+
grid_sizer.add(s3); grid_sizer.add(s13)
|
146
|
+
grid_sizer.add(1, 1); grid_sizer.add(s12)
|
147
|
+
grid_sizer.add(s6); grid_sizer.add(s9)
|
148
|
+
grid_sizer.add(s7); grid_sizer.add(s10)
|
149
|
+
grid_sizer.add(s8); grid_sizer.add(s11)
|
150
|
+
|
151
|
+
cont_sizer = Wx::BoxSizer.new(Wx::VERTICAL)
|
152
|
+
cont_sizer.add(grid_sizer, 1, Wx::EXPAND | Wx::ALL, 5)
|
153
|
+
self.set_sizer(cont_sizer)
|
154
|
+
get_sizer.set_size_hints(self)
|
155
|
+
update_colours
|
178
156
|
|
179
|
-
|
180
|
-
|
157
|
+
evt_spinctrl(ID::PaneBorderSize) { |e| on_pane_border_size(e) }
|
158
|
+
evt_spinctrl(ID::SashSize) { |e| on_sash_size(e) }
|
159
|
+
evt_spinctrl(ID::CaptionSize) { |e| on_caption_size(e) }
|
160
|
+
evt_button(ID::BackgroundColour) { |e| on_set_colour(e) }
|
161
|
+
evt_button(ID::SashColour) { |e| on_set_colour(e) }
|
162
|
+
evt_button(ID::InactiveCaptionColour) { |e| on_set_colour(e) }
|
163
|
+
evt_button(ID::InactiveCaptionGradientColour) { |e| on_set_colour(e) }
|
164
|
+
evt_button(ID::InactiveCaptionTextColour) { |e| on_set_colour(e) }
|
165
|
+
evt_button(ID::ActiveCaptionColour) { |e| on_set_colour(e) }
|
166
|
+
evt_button(ID::ActiveCaptionGradientColour) { |e| on_set_colour(e) }
|
167
|
+
evt_button(ID::ActiveCaptionTextColour) { |e| on_set_colour(e) }
|
168
|
+
evt_button(ID::BorderColour) { |e| on_set_colour(e) }
|
169
|
+
evt_button(ID::GripperColour) { |e| on_set_colour(e) }
|
170
|
+
end
|
181
171
|
|
182
|
-
|
183
|
-
|
172
|
+
def update_colours()
|
173
|
+
art = @frame.dock_art
|
184
174
|
|
185
|
-
|
186
|
-
|
175
|
+
col = art.get_colour(Wx::AUI_DOCKART_BACKGROUND_COLOUR)
|
176
|
+
@bckg_colour.bitmap_label = (create_colour_bitmap(col))
|
187
177
|
|
188
|
-
|
189
|
-
|
178
|
+
col = art.get_colour(Wx::AUI_DOCKART_SASH_COLOUR)
|
179
|
+
@sash_colour.bitmap_label = (create_colour_bitmap(col))
|
190
180
|
|
191
|
-
|
192
|
-
|
181
|
+
col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_COLOUR)
|
182
|
+
@capt_colour.bitmap_label = (create_colour_bitmap(col))
|
193
183
|
|
194
|
-
|
195
|
-
|
184
|
+
col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR)
|
185
|
+
@capt_gradnt.bitmap_label = (create_colour_bitmap(col))
|
196
186
|
|
197
|
-
|
198
|
-
|
187
|
+
col = art.get_colour(Wx::AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR)
|
188
|
+
@capt_text.bitmap_label = (create_colour_bitmap(col))
|
199
189
|
|
200
|
-
|
201
|
-
|
202
|
-
end
|
190
|
+
col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_COLOUR)
|
191
|
+
@acap_colour.bitmap_label = (create_colour_bitmap(col))
|
203
192
|
|
204
|
-
|
205
|
-
|
206
|
-
event.get_position)
|
207
|
-
@frame.do_update
|
208
|
-
end
|
193
|
+
col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR)
|
194
|
+
@acap_gradnt.bitmap_label = (create_colour_bitmap(col))
|
209
195
|
|
210
|
-
|
211
|
-
|
212
|
-
event.get_position)
|
213
|
-
@frame.do_update
|
214
|
-
end
|
196
|
+
col = art.get_colour(Wx::AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR)
|
197
|
+
@acap_text.bitmap_label = (create_colour_bitmap(col))
|
215
198
|
|
216
|
-
|
217
|
-
|
218
|
-
event.get_position)
|
219
|
-
@frame.do_update
|
220
|
-
end
|
199
|
+
col = art.get_colour(Wx::AUI_DOCKART_SASH_COLOUR)
|
200
|
+
@brdr_colour.bitmap_label = (create_colour_bitmap(col))
|
221
201
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
return unless dlg.show_modal == Wx::ID_OK
|
227
|
-
|
228
|
-
var = nil
|
229
|
-
case event.get_id()
|
230
|
-
when ID::BackgroundColour
|
231
|
-
var = Wx::AUI_DOCKART_BACKGROUND_COLOUR
|
232
|
-
when ID::SashColour
|
233
|
-
var = Wx::AUI_DOCKART_SASH_COLOUR
|
234
|
-
when ID::InactiveCaptionColour
|
235
|
-
var = Wx::AUI_DOCKART_INACTIVE_CAPTION_COLOUR
|
236
|
-
when ID::InactiveCaptionGradientColour
|
237
|
-
var = Wx::AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR
|
238
|
-
when ID::InactiveCaptionTextColour
|
239
|
-
var = Wx::AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR
|
240
|
-
when ID::ActiveCaptionColour
|
241
|
-
var = Wx::AUI_DOCKART_ACTIVE_CAPTION_COLOUR
|
242
|
-
when ID::ActiveCaptionGradientColour
|
243
|
-
var = Wx::AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR
|
244
|
-
when ID::ActiveCaptionTextColour
|
245
|
-
var = Wx::AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR
|
246
|
-
when ID::BorderColour
|
247
|
-
var = Wx::AUI_DOCKART_BORDER_COLOUR
|
248
|
-
when ID::GripperColour
|
249
|
-
var = Wx::AUI_DOCKART_GRIPPER_COLOUR
|
250
|
-
else
|
251
|
-
return
|
252
|
-
end
|
202
|
+
col = art.get_colour(Wx::AUI_DOCKART_GRIPPER_COLOUR)
|
203
|
+
@grip_colour.bitmap_label = (create_colour_bitmap(col))
|
204
|
+
end
|
253
205
|
|
254
|
-
|
206
|
+
def on_pane_border_size(event)
|
207
|
+
@frame.get_dock_art.set_metric(Wx::AUI_DOCKART_PANE_BORDER_SIZE,
|
208
|
+
event.get_position)
|
255
209
|
@frame.do_update
|
256
|
-
update_colours
|
257
210
|
end
|
258
|
-
end
|
259
211
|
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
Wx::DEFAULT_POSITION,
|
266
|
-
Wx::Size.new(50, 20),
|
267
|
-
Wx::SP_ARROW_KEYS,
|
268
|
-
0, 100, metric_val)
|
269
|
-
|
270
|
-
sz = Wx::BoxSizer.new(Wx::HORIZONTAL)
|
271
|
-
sz.add(1, 1, 1, Wx::EXPAND)
|
272
|
-
sz.add(Wx::StaticText.new(self, Wx::ID_ANY, caption))
|
273
|
-
sz.add(sp)
|
274
|
-
sz.add(1, 1, 1, Wx::EXPAND)
|
275
|
-
sz.set_item_min_size(1, 180, 20)
|
276
|
-
return sp, sz
|
277
|
-
end
|
212
|
+
def on_sash_size(event)
|
213
|
+
@frame.get_dock_art.set_metric(Wx::AUI_DOCKART_SASH_SIZE,
|
214
|
+
event.get_position)
|
215
|
+
@frame.do_update
|
216
|
+
end
|
278
217
|
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
Wx::Size.new(50, 25))
|
285
|
-
|
286
|
-
sz = Wx::BoxSizer.new(Wx::HORIZONTAL)
|
287
|
-
sz.add(1, 1, 1, Wx::EXPAND)
|
288
|
-
sz.add(Wx::StaticText.new(self, Wx::ID_ANY, caption))
|
289
|
-
sz.add(bmp_butt)
|
290
|
-
sz.add(1, 1, 1, Wx::EXPAND)
|
291
|
-
sz.set_item_min_size(1, 180, 20)
|
292
|
-
return bmp_butt, sz
|
293
|
-
end
|
218
|
+
def on_caption_size(event)
|
219
|
+
@frame.get_dock_art.set_metric(Wx::AUI_DOCKART_CAPTION_SIZE,
|
220
|
+
event.get_position)
|
221
|
+
@frame.do_update
|
222
|
+
end
|
294
223
|
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
224
|
+
def on_set_colour(event)
|
225
|
+
Wx.ColourDialog(@frame) do |dlg|
|
226
|
+
dlg.set_title("Colour Picker")
|
227
|
+
|
228
|
+
return unless dlg.show_modal == Wx::ID_OK
|
229
|
+
|
230
|
+
var = nil
|
231
|
+
case event.get_id()
|
232
|
+
when ID::BackgroundColour
|
233
|
+
var = Wx::AUI_DOCKART_BACKGROUND_COLOUR
|
234
|
+
when ID::SashColour
|
235
|
+
var = Wx::AUI_DOCKART_SASH_COLOUR
|
236
|
+
when ID::InactiveCaptionColour
|
237
|
+
var = Wx::AUI_DOCKART_INACTIVE_CAPTION_COLOUR
|
238
|
+
when ID::InactiveCaptionGradientColour
|
239
|
+
var = Wx::AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR
|
240
|
+
when ID::InactiveCaptionTextColour
|
241
|
+
var = Wx::AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR
|
242
|
+
when ID::ActiveCaptionColour
|
243
|
+
var = Wx::AUI_DOCKART_ACTIVE_CAPTION_COLOUR
|
244
|
+
when ID::ActiveCaptionGradientColour
|
245
|
+
var = Wx::AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR
|
246
|
+
when ID::ActiveCaptionTextColour
|
247
|
+
var = Wx::AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR
|
248
|
+
when ID::BorderColour
|
249
|
+
var = Wx::AUI_DOCKART_BORDER_COLOUR
|
250
|
+
when ID::GripperColour
|
251
|
+
var = Wx::AUI_DOCKART_GRIPPER_COLOUR
|
303
252
|
else
|
304
|
-
|
253
|
+
return
|
305
254
|
end
|
306
|
-
|
255
|
+
|
256
|
+
@frame.get_dock_art.set_colour(var, dlg.get_colour_data.get_colour)
|
257
|
+
@frame.do_update
|
258
|
+
update_colours
|
307
259
|
end
|
308
260
|
end
|
309
|
-
return Wx::Bitmap.new(img)
|
310
|
-
end
|
311
|
-
end
|
312
|
-
|
313
|
-
class AuiFrame < Wx::Frame
|
314
|
-
module ID
|
315
|
-
include Wx::IDHelper
|
316
|
-
CreateTree = self.next_id
|
317
|
-
CreateGrid = self.next_id
|
318
|
-
CreateText = self.next_id
|
319
|
-
CreateHTML = self.next_id
|
320
|
-
CreateNotebook = self.next_id
|
321
|
-
CreateSizeReport = self.next_id
|
322
|
-
GridContent = self.next_id
|
323
|
-
TextContent = self.next_id
|
324
|
-
TreeContent = self.next_id
|
325
|
-
HTMLContent = self.next_id
|
326
|
-
NotebookContent = self.next_id
|
327
|
-
SizeReportContent = self.next_id
|
328
|
-
CreatePerspective = self.next_id
|
329
|
-
CopyPerspectiveCode = self.next_id
|
330
|
-
AllowFloating = self.next_id
|
331
|
-
AllowActivePane = self.next_id
|
332
|
-
TransparentHint = self.next_id
|
333
|
-
VenetianBlindsHint = self.next_id
|
334
|
-
RectangleHint = self.next_id
|
335
|
-
NoHint = self.next_id
|
336
|
-
HintFade = self.next_id
|
337
|
-
NoVenetianFade = self.next_id
|
338
|
-
TransparentDrag = self.next_id
|
339
|
-
NoGradient = self.next_id
|
340
|
-
VerticalGradient = self.next_id
|
341
|
-
HorizontalGradient = self.next_id
|
342
|
-
LiveUpdate = self.next_id
|
343
|
-
AllowToolbarResizing = self.next_id
|
344
|
-
Settings = self.next_id
|
345
|
-
CustomizeToolbar = self.next_id
|
346
|
-
DropDownToolbarItem = self.next_id
|
347
|
-
NotebookNoCloseButton = self.next_id
|
348
|
-
NotebookCloseButton = self.next_id
|
349
|
-
NotebookCloseButtonAll = self.next_id
|
350
|
-
NotebookCloseButtonActive = self.next_id
|
351
|
-
NotebookAllowTabMove = self.next_id
|
352
|
-
NotebookAllowTabExternalMove = self.next_id
|
353
|
-
NotebookAllowTabSplit = self.next_id
|
354
|
-
NotebookWindowList = self.next_id
|
355
|
-
NotebookScrollButtons = self.next_id
|
356
|
-
NotebookTabFixedWidth = self.next_id
|
357
|
-
NotebookArtGloss = self.next_id
|
358
|
-
NotebookArtSimple = self.next_id
|
359
|
-
NotebookAlignTop = self.next_id
|
360
|
-
NotebookAlignBottom = self.next_id
|
361
|
-
|
362
|
-
SampleItem = self.next_id
|
363
|
-
|
364
|
-
FirstPerspective = CreatePerspective+1000
|
365
|
-
end
|
366
261
|
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
@mgr.update
|
386
|
-
end
|
262
|
+
private
|
263
|
+
|
264
|
+
def make_metric_spin_ctrl(an_id, caption, metric)
|
265
|
+
metric_val = @frame.get_dock_art.get_metric(metric)
|
266
|
+
sp = Wx::SpinCtrl.new(self, an_id, metric_val.to_s,
|
267
|
+
Wx::DEFAULT_POSITION,
|
268
|
+
Wx::Size.new(50, 20),
|
269
|
+
Wx::SP_ARROW_KEYS,
|
270
|
+
0, 100, metric_val)
|
271
|
+
|
272
|
+
sz = Wx::BoxSizer.new(Wx::HORIZONTAL)
|
273
|
+
sz.add(1, 1, 1, Wx::EXPAND)
|
274
|
+
sz.add(Wx::StaticText.new(self, Wx::ID_ANY, caption))
|
275
|
+
sz.add(sp)
|
276
|
+
sz.add(1, 1, 1, Wx::EXPAND)
|
277
|
+
sz.set_item_min_size(1, 180, 20)
|
278
|
+
return sp, sz
|
279
|
+
end
|
387
280
|
|
388
|
-
|
389
|
-
|
390
|
-
|
281
|
+
# utility to make a little captioned button;
|
282
|
+
# returns the button and a sizer containing the button and caption
|
283
|
+
def make_colour_button(an_id, caption)
|
284
|
+
bmp_butt = Wx::BitmapButton.new(self, an_id, @base_bmp,
|
285
|
+
Wx::DEFAULT_POSITION,
|
286
|
+
Wx::Size.new(50, 25))
|
287
|
+
|
288
|
+
sz = Wx::BoxSizer.new(Wx::HORIZONTAL)
|
289
|
+
sz.add(1, 1, 1, Wx::EXPAND)
|
290
|
+
sz.add(Wx::StaticText.new(self, Wx::ID_ANY, caption))
|
291
|
+
sz.add(bmp_butt)
|
292
|
+
sz.add(1, 1, 1, Wx::EXPAND)
|
293
|
+
sz.set_item_min_size(1, 180, 20)
|
294
|
+
return bmp_butt, sz
|
295
|
+
end
|
391
296
|
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
view_menu.append(ID::GridContent,
|
409
|
-
"Use a Grid for the Content Pane")
|
410
|
-
view_menu.append(ID::TextContent,
|
411
|
-
"Use a Text Control for the Content Pane")
|
412
|
-
view_menu.append(ID::HTMLContent,
|
413
|
-
"Use an HTML Control for the Content Pane")
|
414
|
-
view_menu.append(ID::TreeContent,
|
415
|
-
"Use a Tree Control for the Content Pane")
|
416
|
-
view_menu.append(ID::NotebookContent,
|
417
|
-
"Use a wxAuiNotebook control for the Content Pane")
|
418
|
-
view_menu.append(ID::SizeReportContent,
|
419
|
-
"Use a Size Reporter for the Content Pane")
|
420
|
-
|
421
|
-
options_menu = Wx::Menu.new
|
422
|
-
# Hints
|
423
|
-
options_menu.append_radio_item(ID::TransparentHint,
|
424
|
-
"Transparent Hint")
|
425
|
-
options_menu.append_radio_item(ID::VenetianBlindsHint,
|
426
|
-
"Venetian Blinds Hint")
|
427
|
-
options_menu.append_radio_item(ID::RectangleHint,
|
428
|
-
"Rectangle Hint")
|
429
|
-
options_menu.append_radio_item(ID::NoHint,
|
430
|
-
"No Hint")
|
431
|
-
|
432
|
-
options_menu.append_separator
|
433
|
-
# Hints Options
|
434
|
-
options_menu.append_check_item(ID::HintFade,
|
435
|
-
"Hint Fade-in")
|
436
|
-
options_menu.append_check_item(ID::AllowFloating,
|
437
|
-
"Allow Floating")
|
438
|
-
options_menu.append_check_item(ID::NoVenetianFade,
|
439
|
-
"Disable Venetian Blinds Hint Fade-in")
|
440
|
-
options_menu.append_check_item(ID::TransparentDrag,
|
441
|
-
"Transparent Drag")
|
442
|
-
options_menu.append_check_item(ID::AllowActivePane,
|
443
|
-
"Allow Active Pane")
|
444
|
-
options_menu.append_separator
|
445
|
-
options_menu.append_radio_item(ID::NoGradient,
|
446
|
-
"No Caption Gradient")
|
447
|
-
options_menu.append_radio_item(ID::VerticalGradient,
|
448
|
-
"Vertical Caption Gradient")
|
449
|
-
options_menu.append_radio_item(ID::HorizontalGradient,
|
450
|
-
"Horizontal Caption Gradient")
|
451
|
-
options_menu.append_separator
|
452
|
-
options_menu.append(ID::Settings, "Settings Pane")
|
453
|
-
|
454
|
-
notebook_menu = Wx::Menu.new
|
455
|
-
notebook_menu.append_radio_item(ID::NotebookArtGloss,
|
456
|
-
"Glossy Theme (Default)")
|
457
|
-
notebook_menu.append_radio_item(ID::NotebookArtSimple,
|
458
|
-
"Simple Theme")
|
459
|
-
|
460
|
-
notebook_menu.append_separator
|
461
|
-
|
462
|
-
notebook_menu.append_radio_item(ID::NotebookNoCloseButton,
|
463
|
-
"No Close Button")
|
464
|
-
notebook_menu.append_radio_item(ID::NotebookCloseButton,
|
465
|
-
"Close Button at Right")
|
466
|
-
notebook_menu.append_radio_item(ID::NotebookCloseButtonAll,
|
467
|
-
"Close Button on All Tabs")
|
468
|
-
notebook_menu.append_radio_item(ID::NotebookCloseButtonActive,
|
469
|
-
"Close Button on Active Tab")
|
470
|
-
|
471
|
-
notebook_menu.append_separator
|
472
|
-
notebook_menu.append_check_item(ID::NotebookAllowTabMove,
|
473
|
-
"Allow Tab Move")
|
474
|
-
notebook_menu.append_check_item(ID::NotebookAllowTabExternalMove,
|
475
|
-
"Allow External Tab Move")
|
476
|
-
notebook_menu.append_check_item(ID::NotebookAllowTabSplit,
|
477
|
-
"Allow Notebook Split")
|
478
|
-
notebook_menu.append_check_item(ID::NotebookScrollButtons,
|
479
|
-
"Scroll Buttons Visible")
|
480
|
-
notebook_menu.append_check_item(ID::NotebookWindowList,
|
481
|
-
"Window List Button Visible")
|
482
|
-
notebook_menu.append_check_item(ID::NotebookTabFixedWidth,
|
483
|
-
"Fixed-width Tabs")
|
484
|
-
|
485
|
-
@perspectives_menu = Wx::Menu.new
|
486
|
-
@perspectives_menu.append(ID::CreatePerspective,
|
487
|
-
"Create Perspective")
|
488
|
-
@perspectives_menu.append(ID::CopyPerspectiveCode,
|
489
|
-
"Copy Perspective Data To Clipboard")
|
490
|
-
@perspectives_menu.append_separator
|
491
|
-
@perspectives_menu.append(ID::FirstPerspective + 0, "Default Startup")
|
492
|
-
@perspectives_menu.append(ID::FirstPerspective + 1, "All Panes")
|
493
|
-
|
494
|
-
help_menu = Wx::Menu.new
|
495
|
-
help_menu.append(Wx::ID_ABOUT, "About...")
|
496
|
-
|
497
|
-
mb.append(file_menu, "File")
|
498
|
-
mb.append(view_menu, "View")
|
499
|
-
mb.append(@perspectives_menu, "Perspectives")
|
500
|
-
mb.append(options_menu, "Options")
|
501
|
-
mb.append(notebook_menu, "Notebook")
|
502
|
-
mb.append(help_menu, "Help")
|
503
|
-
|
504
|
-
set_menu_bar(mb)
|
297
|
+
# returns a 25 x 14 image with solid colour +colour+, with a 1-pixel
|
298
|
+
# black border
|
299
|
+
def create_colour_bitmap(colour)
|
300
|
+
img = Wx::Image.new(25, 14)
|
301
|
+
0.upto(24) do |x|
|
302
|
+
0.upto(13) do |y|
|
303
|
+
if (x == 0 || x == 24 || y == 0 || y == 13)
|
304
|
+
pixcol = Wx::BLACK
|
305
|
+
else
|
306
|
+
pixcol = colour
|
307
|
+
end
|
308
|
+
img.set_rgb(x, y, pixcol.red, pixcol.green, pixcol.blue)
|
309
|
+
end
|
310
|
+
end
|
311
|
+
return Wx::Bitmap.new(img)
|
312
|
+
end
|
505
313
|
end
|
506
314
|
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
evt_update_ui(ID::NotebookAllowTabSplit, :on_update_ui)
|
561
|
-
evt_update_ui(ID::NotebookScrollButtons, :on_update_ui)
|
562
|
-
evt_update_ui(ID::NotebookWindowList, :on_update_ui)
|
563
|
-
evt_update_ui(ID::AllowFloating, :on_update_ui)
|
564
|
-
evt_update_ui(ID::TransparentHint, :on_update_ui)
|
565
|
-
evt_update_ui(ID::VenetianBlindsHint, :on_update_ui)
|
566
|
-
evt_update_ui(ID::RectangleHint, :on_update_ui)
|
567
|
-
evt_update_ui(ID::NoHint, :on_update_ui)
|
568
|
-
evt_update_ui(ID::HintFade, :on_update_ui)
|
569
|
-
evt_update_ui(ID::NoVenetianFade, :on_update_ui)
|
570
|
-
evt_update_ui(ID::TransparentDrag, :on_update_ui)
|
571
|
-
evt_update_ui(ID::NoGradient, :on_update_ui)
|
572
|
-
evt_update_ui(ID::VerticalGradient, :on_update_ui)
|
573
|
-
evt_update_ui(ID::HorizontalGradient, :on_update_ui)
|
574
|
-
evt_menu_range(ID::FirstPerspective,
|
575
|
-
ID::FirstPerspective +
|
576
|
-
@perspectives.length, :on_restore_perspective)
|
577
|
-
evt_aui_pane_close :on_pane_close
|
578
|
-
evt_auinotebook_page_close(Wx::ID_ANY, :on_notebook_page_close)
|
579
|
-
end
|
315
|
+
class AuiFrame < Wx::Frame
|
316
|
+
module ID
|
317
|
+
include Wx::IDHelper
|
318
|
+
CreateTree = self.next_id
|
319
|
+
CreateGrid = self.next_id
|
320
|
+
CreateText = self.next_id
|
321
|
+
CreateHTML = self.next_id
|
322
|
+
CreateNotebook = self.next_id
|
323
|
+
CreateSizeReport = self.next_id
|
324
|
+
GridContent = self.next_id
|
325
|
+
TextContent = self.next_id
|
326
|
+
TreeContent = self.next_id
|
327
|
+
HTMLContent = self.next_id
|
328
|
+
NotebookContent = self.next_id
|
329
|
+
SizeReportContent = self.next_id
|
330
|
+
CreatePerspective = self.next_id
|
331
|
+
CopyPerspectiveCode = self.next_id
|
332
|
+
AllowFloating = self.next_id
|
333
|
+
AllowActivePane = self.next_id
|
334
|
+
TransparentHint = self.next_id
|
335
|
+
VenetianBlindsHint = self.next_id
|
336
|
+
RectangleHint = self.next_id
|
337
|
+
NoHint = self.next_id
|
338
|
+
HintFade = self.next_id
|
339
|
+
NoVenetianFade = self.next_id
|
340
|
+
TransparentDrag = self.next_id
|
341
|
+
NoGradient = self.next_id
|
342
|
+
VerticalGradient = self.next_id
|
343
|
+
HorizontalGradient = self.next_id
|
344
|
+
LiveUpdate = self.next_id
|
345
|
+
AllowToolbarResizing = self.next_id
|
346
|
+
Settings = self.next_id
|
347
|
+
CustomizeToolbar = self.next_id
|
348
|
+
DropDownToolbarItem = self.next_id
|
349
|
+
NotebookNoCloseButton = self.next_id
|
350
|
+
NotebookCloseButton = self.next_id
|
351
|
+
NotebookCloseButtonAll = self.next_id
|
352
|
+
NotebookCloseButtonActive = self.next_id
|
353
|
+
NotebookAllowTabMove = self.next_id
|
354
|
+
NotebookAllowTabExternalMove = self.next_id
|
355
|
+
NotebookAllowTabSplit = self.next_id
|
356
|
+
NotebookWindowList = self.next_id
|
357
|
+
NotebookScrollButtons = self.next_id
|
358
|
+
NotebookTabFixedWidth = self.next_id
|
359
|
+
NotebookArtGloss = self.next_id
|
360
|
+
NotebookArtSimple = self.next_id
|
361
|
+
NotebookAlignTop = self.next_id
|
362
|
+
NotebookAlignBottom = self.next_id
|
363
|
+
|
364
|
+
SampleItem = self.next_id
|
365
|
+
|
366
|
+
FirstPerspective = CreatePerspective+1000
|
367
|
+
end
|
580
368
|
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
tb1.add_separator
|
602
|
-
tb1.add_tool(ID::SampleItem+2, "Test",
|
603
|
-
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION))
|
604
|
-
tb1.add_tool(ID::SampleItem+3, "Test",
|
605
|
-
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_INFORMATION))
|
606
|
-
tb1.add_tool(ID::SampleItem+4, "Test",
|
607
|
-
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_WARNING))
|
608
|
-
tb1.add_tool(ID::SampleItem+5, "Test",
|
609
|
-
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_MISSING_IMAGE))
|
610
|
-
tb1.set_custom_overflow_items(nil, append_items)
|
611
|
-
tb1.realize
|
612
|
-
|
613
|
-
tb2 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY, Wx::DEFAULT_POSITION,
|
614
|
-
Wx::DEFAULT_SIZE,
|
615
|
-
Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_HORIZONTAL)
|
616
|
-
# tb2.set_tool_bitmap_size(Wx::Size.new(16, 16))
|
617
|
-
|
618
|
-
tb2_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION,
|
619
|
-
Wx::ART_OTHER,
|
620
|
-
Wx::Size.new(24, 24))
|
621
|
-
tb2.add_tool(ID::SampleItem+6, "Test", tb2_bmp1)
|
622
|
-
tb2.add_tool(ID::SampleItem+7, "Test", tb2_bmp1)
|
623
|
-
tb2.add_tool(ID::SampleItem+8, "Test", tb2_bmp1)
|
624
|
-
tb2.add_tool(ID::SampleItem+9, "Test", tb2_bmp1)
|
625
|
-
tb2.add_separator
|
626
|
-
tb2.add_tool(ID::SampleItem+10, "Test", tb2_bmp1)
|
627
|
-
tb2.add_tool(ID::SampleItem+11, "Test", tb2_bmp1)
|
628
|
-
tb2.add_separator
|
629
|
-
tb2.add_tool(ID::SampleItem+12, "Test", tb2_bmp1)
|
630
|
-
tb2.add_tool(ID::SampleItem+13, "Test", tb2_bmp1)
|
631
|
-
tb2.add_tool(ID::SampleItem+14, "Test", tb2_bmp1)
|
632
|
-
tb2.add_tool(ID::SampleItem+15, "Test", tb2_bmp1)
|
633
|
-
tb2.set_custom_overflow_items(nil, append_items)
|
634
|
-
tb2.enable_tool(ID::SampleItem+6, false)
|
635
|
-
tb2.realize
|
636
|
-
|
637
|
-
tb3 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
|
638
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
639
|
-
Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW)
|
640
|
-
# tb3.set_tool_bitmap_size(Wx::Size.new(16, 16))
|
641
|
-
tb3_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_FOLDER,
|
642
|
-
Wx::ART_OTHER,
|
643
|
-
Wx::Size.new(16, 16))
|
644
|
-
tb3.add_tool(ID::SampleItem+16, "Check 1", tb3_bmp1, "Check 1", Wx::ItemKind::ITEM_CHECK)
|
645
|
-
tb3.add_tool(ID::SampleItem+17, "Check 2", tb3_bmp1, "Check 2", Wx::ItemKind::ITEM_CHECK)
|
646
|
-
tb3.add_tool(ID::SampleItem+18, "Check 3", tb3_bmp1, "Check 3", Wx::ItemKind::ITEM_CHECK)
|
647
|
-
tb3.add_tool(ID::SampleItem+19, "Check 4", tb3_bmp1, "Check 4", Wx::ItemKind::ITEM_CHECK)
|
648
|
-
tb3.add_separator
|
649
|
-
tb3.add_tool(ID::SampleItem+20, "Radio 1", tb3_bmp1, "Radio 1", Wx::ItemKind::ITEM_RADIO)
|
650
|
-
tb3.add_tool(ID::SampleItem+21, "Radio 2", tb3_bmp1, "Radio 2", Wx::ItemKind::ITEM_RADIO)
|
651
|
-
tb3.add_tool(ID::SampleItem+22, "Radio 3", tb3_bmp1, "Radio 3", Wx::ItemKind::ITEM_RADIO)
|
652
|
-
tb3.add_separator
|
653
|
-
tb3.add_tool(ID::SampleItem+23, "Radio 1 (Group 2)", tb3_bmp1, "Radio 1 (Group 2)", Wx::ItemKind::ITEM_RADIO)
|
654
|
-
tb3.add_tool(ID::SampleItem+24, "Radio 2 (Group 2)", tb3_bmp1, "Radio 2 (Group 2)", Wx::ItemKind::ITEM_RADIO)
|
655
|
-
tb3.add_tool(ID::SampleItem+25, "Radio 3 (Group 2)", tb3_bmp1, "Radio 3 (Group 2)", Wx::ItemKind::ITEM_RADIO)
|
656
|
-
tb3.set_custom_overflow_items(nil, append_items)
|
657
|
-
tb3.realize
|
658
|
-
|
659
|
-
tb4 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
|
660
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
661
|
-
Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_TEXT | Wx::AUI::AUI_TB_HORZ_TEXT)
|
662
|
-
# tb4.set_tool_bitmap_size(Wx::Size.new(16, 16))
|
663
|
-
tb4_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_NORMAL_FILE,
|
664
|
-
Wx::ART_OTHER,
|
665
|
-
Wx::Size.new(16, 16))
|
666
|
-
tb4.add_tool(ID::DropDownToolbarItem, "Item 1", tb4_bmp1)
|
667
|
-
tb4.add_tool(ID::SampleItem+23, "Item 2", tb4_bmp1)
|
668
|
-
tb4.set_tool_sticky(ID::SampleItem+23, true)
|
669
|
-
tb4.add_tool(ID::SampleItem+24, "Item 3", tb4_bmp1)
|
670
|
-
tb4.enable_tool(ID::SampleItem+24, false)
|
671
|
-
tb4.add_tool(ID::SampleItem+25, "Item 4", tb4_bmp1)
|
672
|
-
tb4.add_separator
|
673
|
-
tb4.add_tool(ID::SampleItem+26, "Item 5", tb4_bmp1)
|
674
|
-
tb4.add_tool(ID::SampleItem+27, "Item 6", tb4_bmp1)
|
675
|
-
tb4.add_tool(ID::SampleItem+28, "Item 7", tb4_bmp1)
|
676
|
-
tb4.add_tool(ID::SampleItem+29, "Item 8", tb4_bmp1)
|
677
|
-
tb4.set_tool_drop_down(ID::DropDownToolbarItem, true)
|
678
|
-
tb4.set_custom_overflow_items(nil, append_items)
|
679
|
-
choice = Wx::Choice.new(tb4, ID::SampleItem+35)
|
680
|
-
choice.append('One choice')
|
681
|
-
choice.append('Another choice')
|
682
|
-
tb4.add_control(choice)
|
683
|
-
tb4.realize
|
369
|
+
def initialize(*args)
|
370
|
+
super
|
371
|
+
@mgr = Wx::AuiManager.new
|
372
|
+
@mgr.set_managed_window(self)
|
373
|
+
@perspectives = []
|
374
|
+
|
375
|
+
# set up default notebook style
|
376
|
+
@notebook_style = Wx::AUI_NB_DEFAULT_STYLE |
|
377
|
+
Wx::AUI_NB_TAB_EXTERNAL_MOVE | Wx::NO_BORDER
|
378
|
+
@notebook_theme = 0
|
379
|
+
setup_menu
|
380
|
+
create_status_bar
|
381
|
+
get_status_bar.set_status_text("Ready")
|
382
|
+
set_min_size(Wx::Size.new(400, 300))
|
383
|
+
setup_toolbars
|
384
|
+
setup_panes
|
385
|
+
setup_perspectives
|
386
|
+
setup_events
|
387
|
+
@mgr.update
|
388
|
+
end
|
684
389
|
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_VERTICAL)
|
689
|
-
# tb5.set_tool_bitmap_size(Wx::Size.new(48, 48))
|
690
|
-
tb5.add_tool(ID::SampleItem+30, "Test",
|
691
|
-
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_ERROR))
|
692
|
-
tb5.add_separator
|
693
|
-
tb5.add_tool(ID::SampleItem+31, "Test",
|
694
|
-
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION))
|
695
|
-
tb5.add_tool(ID::SampleItem+32, "Test",
|
696
|
-
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_INFORMATION))
|
697
|
-
tb5.add_tool(ID::SampleItem+33, "Test",
|
698
|
-
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_WARNING))
|
699
|
-
tb5.add_tool(ID::SampleItem+34, "Test",
|
700
|
-
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_MISSING_IMAGE))
|
701
|
-
tb5.set_custom_overflow_items(nil, append_items)
|
702
|
-
tb5.realize
|
703
|
-
|
704
|
-
# add the toolbars to the manager
|
705
|
-
pi = Wx::AuiPaneInfo.new
|
706
|
-
pi.set_name('tb1').set_caption("Big Toolbar").toolbar_pane.top
|
707
|
-
# pi.top.set_left_dockable(false).set_right_dockable(false)
|
708
|
-
@mgr.add_pane(tb1, pi)
|
709
|
-
|
710
|
-
pi = Wx::AuiPaneInfo.new
|
711
|
-
pi.set_name('tb2').set_caption("Toolbar 2 (horizontal)").toolbar_pane.top.set_row(1)
|
712
|
-
# pi.set_left_dockable(false).set_right_dockable(false)
|
713
|
-
@mgr.add_pane(tb2, pi)
|
714
|
-
|
715
|
-
pi = Wx::AuiPaneInfo.new
|
716
|
-
pi.set_name('tb3').set_caption("Toolbar 3").toolbar_pane.top.set_row(1).set_position(1)
|
717
|
-
# pi.set_left_dockable(false).set_right_dockable(false)
|
718
|
-
@mgr.add_pane(tb3, pi)
|
719
|
-
|
720
|
-
pi = Wx::AuiPaneInfo.new
|
721
|
-
pi.set_name('tb4').set_caption("Sample Bookmark Toolbar").toolbar_pane.top.set_row(2)
|
722
|
-
# pi.set_left_dockable(false).set_right_dockable(false)
|
723
|
-
@mgr.add_pane(tb4, pi)
|
724
|
-
|
725
|
-
pi = Wx::AuiPaneInfo.new
|
726
|
-
pi.set_name('tb5').set_caption("Sample Vertical Toolbar").toolbar_pane.left.set_gripper_top
|
727
|
-
# pi.set_left_dockable(false).set_right_dockable(false)
|
728
|
-
@mgr.add_pane(tb5, pi)
|
729
|
-
|
730
|
-
@mgr.add_pane(Wx::Button.new(self, label: 'Test Button'),
|
731
|
-
Wx::AUI::AuiPaneInfo.new.set_name('tb6').toolbar_pane.top.set_row(2).set_position(1)
|
732
|
-
.set_left_dockable(false).set_right_dockable(false))
|
733
|
-
end
|
390
|
+
def dock_art
|
391
|
+
@mgr.art_provider
|
392
|
+
end
|
734
393
|
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
394
|
+
#
|
395
|
+
def setup_menu
|
396
|
+
mb = Wx::MenuBar.new
|
397
|
+
|
398
|
+
file_menu = Wx::Menu.new
|
399
|
+
file_menu.append(Wx::ID_EXIT, "Exit")
|
400
|
+
|
401
|
+
view_menu = Wx::Menu.new
|
402
|
+
view_menu.append(ID::CreateText, "Create Text Control")
|
403
|
+
view_menu.append(ID::CreateHTML, "Create HTML Control")
|
404
|
+
view_menu.append(ID::CreateTree, "Create Tree")
|
405
|
+
view_menu.append(ID::CreateGrid, "Create Grid")
|
406
|
+
view_menu.append(ID::CreateNotebook, "Create Notebook")
|
407
|
+
view_menu.append(ID::CreateSizeReport, "Create Size Reporter")
|
408
|
+
view_menu.append_separator
|
409
|
+
|
410
|
+
view_menu.append(ID::GridContent,
|
411
|
+
"Use a Grid for the Content Pane")
|
412
|
+
view_menu.append(ID::TextContent,
|
413
|
+
"Use a Text Control for the Content Pane")
|
414
|
+
view_menu.append(ID::HTMLContent,
|
415
|
+
"Use an HTML Control for the Content Pane")
|
416
|
+
view_menu.append(ID::TreeContent,
|
417
|
+
"Use a Tree Control for the Content Pane")
|
418
|
+
view_menu.append(ID::NotebookContent,
|
419
|
+
"Use a wxAuiNotebook control for the Content Pane")
|
420
|
+
view_menu.append(ID::SizeReportContent,
|
421
|
+
"Use a Size Reporter for the Content Pane")
|
422
|
+
|
423
|
+
options_menu = Wx::Menu.new
|
424
|
+
# Hints
|
425
|
+
options_menu.append_radio_item(ID::TransparentHint,
|
426
|
+
"Transparent Hint")
|
427
|
+
options_menu.append_radio_item(ID::VenetianBlindsHint,
|
428
|
+
"Venetian Blinds Hint")
|
429
|
+
options_menu.append_radio_item(ID::RectangleHint,
|
430
|
+
"Rectangle Hint")
|
431
|
+
options_menu.append_radio_item(ID::NoHint,
|
432
|
+
"No Hint")
|
433
|
+
|
434
|
+
options_menu.append_separator
|
435
|
+
# Hints Options
|
436
|
+
options_menu.append_check_item(ID::HintFade,
|
437
|
+
"Hint Fade-in")
|
438
|
+
options_menu.append_check_item(ID::AllowFloating,
|
439
|
+
"Allow Floating")
|
440
|
+
options_menu.append_check_item(ID::NoVenetianFade,
|
441
|
+
"Disable Venetian Blinds Hint Fade-in")
|
442
|
+
options_menu.append_check_item(ID::TransparentDrag,
|
443
|
+
"Transparent Drag")
|
444
|
+
options_menu.append_check_item(ID::AllowActivePane,
|
445
|
+
"Allow Active Pane")
|
446
|
+
options_menu.append_separator
|
447
|
+
options_menu.append_radio_item(ID::NoGradient,
|
448
|
+
"No Caption Gradient")
|
449
|
+
options_menu.append_radio_item(ID::VerticalGradient,
|
450
|
+
"Vertical Caption Gradient")
|
451
|
+
options_menu.append_radio_item(ID::HorizontalGradient,
|
452
|
+
"Horizontal Caption Gradient")
|
453
|
+
options_menu.append_separator
|
454
|
+
options_menu.append(ID::Settings, "Settings Pane")
|
455
|
+
|
456
|
+
notebook_menu = Wx::Menu.new
|
457
|
+
notebook_menu.append_radio_item(ID::NotebookArtGloss,
|
458
|
+
"Glossy Theme (Default)")
|
459
|
+
notebook_menu.append_radio_item(ID::NotebookArtSimple,
|
460
|
+
"Simple Theme")
|
461
|
+
|
462
|
+
notebook_menu.append_separator
|
463
|
+
|
464
|
+
notebook_menu.append_radio_item(ID::NotebookNoCloseButton,
|
465
|
+
"No Close Button")
|
466
|
+
notebook_menu.append_radio_item(ID::NotebookCloseButton,
|
467
|
+
"Close Button at Right")
|
468
|
+
notebook_menu.append_radio_item(ID::NotebookCloseButtonAll,
|
469
|
+
"Close Button on All Tabs")
|
470
|
+
notebook_menu.append_radio_item(ID::NotebookCloseButtonActive,
|
471
|
+
"Close Button on Active Tab")
|
472
|
+
|
473
|
+
notebook_menu.append_separator
|
474
|
+
notebook_menu.append_check_item(ID::NotebookAllowTabMove,
|
475
|
+
"Allow Tab Move")
|
476
|
+
notebook_menu.append_check_item(ID::NotebookAllowTabExternalMove,
|
477
|
+
"Allow External Tab Move")
|
478
|
+
notebook_menu.append_check_item(ID::NotebookAllowTabSplit,
|
479
|
+
"Allow Notebook Split")
|
480
|
+
notebook_menu.append_check_item(ID::NotebookScrollButtons,
|
481
|
+
"Scroll Buttons Visible")
|
482
|
+
notebook_menu.append_check_item(ID::NotebookWindowList,
|
483
|
+
"Window List Button Visible")
|
484
|
+
notebook_menu.append_check_item(ID::NotebookTabFixedWidth,
|
485
|
+
"Fixed-width Tabs")
|
486
|
+
|
487
|
+
@perspectives_menu = Wx::Menu.new
|
488
|
+
@perspectives_menu.append(ID::CreatePerspective,
|
489
|
+
"Create Perspective")
|
490
|
+
@perspectives_menu.append(ID::CopyPerspectiveCode,
|
491
|
+
"Copy Perspective Data To Clipboard")
|
492
|
+
@perspectives_menu.append_separator
|
493
|
+
@perspectives_menu.append(ID::FirstPerspective + 0, "Default Startup")
|
494
|
+
@perspectives_menu.append(ID::FirstPerspective + 1, "All Panes")
|
495
|
+
|
496
|
+
help_menu = Wx::Menu.new
|
497
|
+
help_menu.append(Wx::ID_ABOUT, "About...")
|
498
|
+
|
499
|
+
mb.append(file_menu, "File")
|
500
|
+
mb.append(view_menu, "View")
|
501
|
+
mb.append(@perspectives_menu, "Perspectives")
|
502
|
+
mb.append(options_menu, "Options")
|
503
|
+
mb.append(notebook_menu, "Notebook")
|
504
|
+
mb.append(help_menu, "Help")
|
505
|
+
|
506
|
+
set_menu_bar(mb)
|
507
|
+
end
|
825
508
|
|
826
|
-
|
827
|
-
|
828
|
-
|
509
|
+
def setup_events
|
510
|
+
evt_erase_background :on_erase_background
|
511
|
+
evt_size :on_size
|
512
|
+
|
513
|
+
evt_menu(ID::CreateTree) { |e| on_create_tree }
|
514
|
+
evt_menu(ID::CreateGrid) { |e| on_create_grid }
|
515
|
+
evt_menu(ID::CreateText) { |e| on_create_text }
|
516
|
+
evt_menu(ID::CreateHTML) { |e| on_create_html }
|
517
|
+
evt_menu(ID::CreateSizeReport) { |e| on_create_size_report }
|
518
|
+
evt_menu(ID::CreateNotebook) { |e| on_create_notebook }
|
519
|
+
evt_menu(ID::CreatePerspective) { |e| on_create_perspective }
|
520
|
+
evt_menu(ID::CopyPerspectiveCode) { |e| on_copy_perspective_code }
|
521
|
+
evt_menu(ID::AllowFloating, :on_manager_flag)
|
522
|
+
evt_menu(ID::TransparentHint, :on_manager_flag)
|
523
|
+
evt_menu(ID::VenetianBlindsHint, :on_manager_flag)
|
524
|
+
evt_menu(ID::RectangleHint, :on_manager_flag)
|
525
|
+
evt_menu(ID::NoHint, :on_manager_flag)
|
526
|
+
evt_menu(ID::HintFade, :on_manager_flag)
|
527
|
+
evt_menu(ID::NoVenetianFade, :on_manager_flag)
|
528
|
+
evt_menu(ID::TransparentDrag, :on_manager_flag)
|
529
|
+
evt_menu(ID::AllowActivePane, :on_manager_flag)
|
530
|
+
evt_menu(ID::NotebookTabFixedWidth, :on_notebook_flag)
|
531
|
+
evt_menu(ID::NotebookNoCloseButton, :on_notebook_flag)
|
532
|
+
evt_menu(ID::NotebookCloseButton, :on_notebook_flag)
|
533
|
+
evt_menu(ID::NotebookCloseButtonAll, :on_notebook_flag)
|
534
|
+
evt_menu(ID::NotebookCloseButtonActive, :on_notebook_flag)
|
535
|
+
evt_menu(ID::NotebookAllowTabMove, :on_notebook_flag)
|
536
|
+
evt_menu(ID::NotebookAllowTabExternalMove, :on_notebook_flag)
|
537
|
+
evt_menu(ID::NotebookAllowTabSplit, :on_notebook_flag)
|
538
|
+
evt_menu(ID::NotebookScrollButtons, :on_notebook_flag)
|
539
|
+
evt_menu(ID::NotebookWindowList, :on_notebook_flag)
|
540
|
+
evt_menu(ID::NotebookArtGloss, :on_notebook_flag)
|
541
|
+
evt_menu(ID::NotebookArtSimple, :on_notebook_flag)
|
542
|
+
evt_menu(ID::NoGradient, :on_gradient)
|
543
|
+
evt_menu(ID::VerticalGradient, :on_gradient)
|
544
|
+
evt_menu(ID::HorizontalGradient, :on_gradient)
|
545
|
+
evt_menu(ID::Settings) { on_settings }
|
546
|
+
evt_menu(ID::GridContent, :on_change_content_pane)
|
547
|
+
evt_menu(ID::TreeContent, :on_change_content_pane)
|
548
|
+
evt_menu(ID::TextContent, :on_change_content_pane)
|
549
|
+
evt_menu(ID::SizeReportContent, :on_change_content_pane)
|
550
|
+
evt_menu(ID::HTMLContent, :on_change_content_pane)
|
551
|
+
evt_menu(ID::NotebookContent, :on_change_content_pane)
|
552
|
+
evt_auitoolbar_tool_dropdown(ID::DropDownToolbarItem, :on_drop_down_toolbar_item)
|
553
|
+
evt_menu(Wx::ID_EXIT) { |e| on_exit }
|
554
|
+
evt_menu(Wx::ID_ABOUT) { |e| on_about }
|
555
|
+
evt_update_ui(ID::NotebookTabFixedWidth, :on_update_ui)
|
556
|
+
evt_update_ui(ID::NotebookNoCloseButton, :on_update_ui)
|
557
|
+
evt_update_ui(ID::NotebookCloseButton, :on_update_ui)
|
558
|
+
evt_update_ui(ID::NotebookCloseButtonAll, :on_update_ui)
|
559
|
+
evt_update_ui(ID::NotebookCloseButtonActive, :on_update_ui)
|
560
|
+
evt_update_ui(ID::NotebookAllowTabMove, :on_update_ui)
|
561
|
+
evt_update_ui(ID::NotebookAllowTabExternalMove, :on_update_ui)
|
562
|
+
evt_update_ui(ID::NotebookAllowTabSplit, :on_update_ui)
|
563
|
+
evt_update_ui(ID::NotebookScrollButtons, :on_update_ui)
|
564
|
+
evt_update_ui(ID::NotebookWindowList, :on_update_ui)
|
565
|
+
evt_update_ui(ID::AllowFloating, :on_update_ui)
|
566
|
+
evt_update_ui(ID::TransparentHint, :on_update_ui)
|
567
|
+
evt_update_ui(ID::VenetianBlindsHint, :on_update_ui)
|
568
|
+
evt_update_ui(ID::RectangleHint, :on_update_ui)
|
569
|
+
evt_update_ui(ID::NoHint, :on_update_ui)
|
570
|
+
evt_update_ui(ID::HintFade, :on_update_ui)
|
571
|
+
evt_update_ui(ID::NoVenetianFade, :on_update_ui)
|
572
|
+
evt_update_ui(ID::TransparentDrag, :on_update_ui)
|
573
|
+
evt_update_ui(ID::NoGradient, :on_update_ui)
|
574
|
+
evt_update_ui(ID::VerticalGradient, :on_update_ui)
|
575
|
+
evt_update_ui(ID::HorizontalGradient, :on_update_ui)
|
576
|
+
evt_menu_range(ID::FirstPerspective,
|
577
|
+
ID::FirstPerspective +
|
578
|
+
@perspectives.length, :on_restore_perspective)
|
579
|
+
evt_aui_pane_close :on_pane_close
|
580
|
+
evt_auinotebook_page_close(Wx::ID_ANY, :on_notebook_page_close)
|
581
|
+
end
|
829
582
|
|
830
|
-
|
831
|
-
|
583
|
+
# create some toolbars
|
584
|
+
def setup_toolbars
|
585
|
+
# prepare a few custom overflow elements for the toolbars' overflow buttons
|
586
|
+
append_items = []
|
587
|
+
item = Wx::AUI::AuiToolBarItem.new
|
588
|
+
item.set_kind(Wx::ItemKind::ITEM_SEPARATOR)
|
589
|
+
append_items << item
|
590
|
+
item = Wx::AUI::AuiToolBarItem.new
|
591
|
+
item.set_kind(Wx::ItemKind::ITEM_NORMAL)
|
592
|
+
item.set_id(ID::CustomizeToolbar)
|
593
|
+
item.set_label('Customize...')
|
594
|
+
append_items << item
|
595
|
+
|
596
|
+
tb1 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
|
597
|
+
Wx::DEFAULT_POSITION,
|
598
|
+
Wx::DEFAULT_SIZE,
|
599
|
+
Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW)
|
600
|
+
# tb1.set_tool_bitmap_size(Wx::Size.new(48, 48))
|
601
|
+
tb1.add_tool(ID::SampleItem+1, "Test",
|
602
|
+
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_ERROR))
|
603
|
+
tb1.add_separator
|
604
|
+
tb1.add_tool(ID::SampleItem+2, "Test",
|
605
|
+
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION))
|
606
|
+
tb1.add_tool(ID::SampleItem+3, "Test",
|
607
|
+
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_INFORMATION))
|
608
|
+
tb1.add_tool(ID::SampleItem+4, "Test",
|
609
|
+
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_WARNING))
|
610
|
+
tb1.add_tool(ID::SampleItem+5, "Test",
|
611
|
+
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_MISSING_IMAGE))
|
612
|
+
tb1.set_custom_overflow_items(nil, append_items)
|
613
|
+
tb1.realize
|
614
|
+
|
615
|
+
tb2 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY, Wx::DEFAULT_POSITION,
|
616
|
+
Wx::DEFAULT_SIZE,
|
617
|
+
Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_HORIZONTAL)
|
618
|
+
# tb2.set_tool_bitmap_size(Wx::Size.new(16, 16))
|
619
|
+
|
620
|
+
tb2_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION,
|
621
|
+
Wx::ART_OTHER,
|
622
|
+
Wx::Size.new(24, 24))
|
623
|
+
tb2.add_tool(ID::SampleItem+6, "Test", tb2_bmp1)
|
624
|
+
tb2.add_tool(ID::SampleItem+7, "Test", tb2_bmp1)
|
625
|
+
tb2.add_tool(ID::SampleItem+8, "Test", tb2_bmp1)
|
626
|
+
tb2.add_tool(ID::SampleItem+9, "Test", tb2_bmp1)
|
627
|
+
tb2.add_separator
|
628
|
+
tb2.add_tool(ID::SampleItem+10, "Test", tb2_bmp1)
|
629
|
+
tb2.add_tool(ID::SampleItem+11, "Test", tb2_bmp1)
|
630
|
+
tb2.add_separator
|
631
|
+
tb2.add_tool(ID::SampleItem+12, "Test", tb2_bmp1)
|
632
|
+
tb2.add_tool(ID::SampleItem+13, "Test", tb2_bmp1)
|
633
|
+
tb2.add_tool(ID::SampleItem+14, "Test", tb2_bmp1)
|
634
|
+
tb2.add_tool(ID::SampleItem+15, "Test", tb2_bmp1)
|
635
|
+
tb2.set_custom_overflow_items(nil, append_items)
|
636
|
+
tb2.enable_tool(ID::SampleItem+6, false)
|
637
|
+
tb2.realize
|
638
|
+
|
639
|
+
tb3 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
|
640
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
641
|
+
Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW)
|
642
|
+
# tb3.set_tool_bitmap_size(Wx::Size.new(16, 16))
|
643
|
+
tb3_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_FOLDER,
|
644
|
+
Wx::ART_OTHER,
|
645
|
+
Wx::Size.new(16, 16))
|
646
|
+
tb3.add_tool(ID::SampleItem+16, "Check 1", tb3_bmp1, "Check 1", Wx::ItemKind::ITEM_CHECK)
|
647
|
+
tb3.add_tool(ID::SampleItem+17, "Check 2", tb3_bmp1, "Check 2", Wx::ItemKind::ITEM_CHECK)
|
648
|
+
tb3.add_tool(ID::SampleItem+18, "Check 3", tb3_bmp1, "Check 3", Wx::ItemKind::ITEM_CHECK)
|
649
|
+
tb3.add_tool(ID::SampleItem+19, "Check 4", tb3_bmp1, "Check 4", Wx::ItemKind::ITEM_CHECK)
|
650
|
+
tb3.add_separator
|
651
|
+
tb3.add_tool(ID::SampleItem+20, "Radio 1", tb3_bmp1, "Radio 1", Wx::ItemKind::ITEM_RADIO)
|
652
|
+
tb3.add_tool(ID::SampleItem+21, "Radio 2", tb3_bmp1, "Radio 2", Wx::ItemKind::ITEM_RADIO)
|
653
|
+
tb3.add_tool(ID::SampleItem+22, "Radio 3", tb3_bmp1, "Radio 3", Wx::ItemKind::ITEM_RADIO)
|
654
|
+
tb3.add_separator
|
655
|
+
tb3.add_tool(ID::SampleItem+23, "Radio 1 (Group 2)", tb3_bmp1, "Radio 1 (Group 2)", Wx::ItemKind::ITEM_RADIO)
|
656
|
+
tb3.add_tool(ID::SampleItem+24, "Radio 2 (Group 2)", tb3_bmp1, "Radio 2 (Group 2)", Wx::ItemKind::ITEM_RADIO)
|
657
|
+
tb3.add_tool(ID::SampleItem+25, "Radio 3 (Group 2)", tb3_bmp1, "Radio 3 (Group 2)", Wx::ItemKind::ITEM_RADIO)
|
658
|
+
tb3.set_custom_overflow_items(nil, append_items)
|
659
|
+
tb3.realize
|
660
|
+
|
661
|
+
tb4 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
|
662
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
663
|
+
Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_TEXT | Wx::AUI::AUI_TB_HORZ_TEXT)
|
664
|
+
# tb4.set_tool_bitmap_size(Wx::Size.new(16, 16))
|
665
|
+
tb4_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_NORMAL_FILE,
|
666
|
+
Wx::ART_OTHER,
|
667
|
+
Wx::Size.new(16, 16))
|
668
|
+
tb4.add_tool(ID::DropDownToolbarItem, "Item 1", tb4_bmp1)
|
669
|
+
tb4.add_tool(ID::SampleItem+23, "Item 2", tb4_bmp1)
|
670
|
+
tb4.set_tool_sticky(ID::SampleItem+23, true)
|
671
|
+
tb4.add_tool(ID::SampleItem+24, "Item 3", tb4_bmp1)
|
672
|
+
tb4.enable_tool(ID::SampleItem+24, false)
|
673
|
+
tb4.add_tool(ID::SampleItem+25, "Item 4", tb4_bmp1)
|
674
|
+
tb4.add_separator
|
675
|
+
tb4.add_tool(ID::SampleItem+26, "Item 5", tb4_bmp1)
|
676
|
+
tb4.add_tool(ID::SampleItem+27, "Item 6", tb4_bmp1)
|
677
|
+
tb4.add_tool(ID::SampleItem+28, "Item 7", tb4_bmp1)
|
678
|
+
tb4.add_tool(ID::SampleItem+29, "Item 8", tb4_bmp1)
|
679
|
+
tb4.set_tool_drop_down(ID::DropDownToolbarItem, true)
|
680
|
+
tb4.set_custom_overflow_items(nil, append_items)
|
681
|
+
choice = Wx::Choice.new(tb4, ID::SampleItem+35)
|
682
|
+
choice.append('One choice')
|
683
|
+
choice.append('Another choice')
|
684
|
+
tb4.add_control(choice)
|
685
|
+
tb4.realize
|
686
|
+
|
687
|
+
# create some toolbars
|
688
|
+
tb5 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
|
689
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
690
|
+
Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_VERTICAL)
|
691
|
+
# tb5.set_tool_bitmap_size(Wx::Size.new(48, 48))
|
692
|
+
tb5.add_tool(ID::SampleItem+30, "Test",
|
693
|
+
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_ERROR))
|
694
|
+
tb5.add_separator
|
695
|
+
tb5.add_tool(ID::SampleItem+31, "Test",
|
696
|
+
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION))
|
697
|
+
tb5.add_tool(ID::SampleItem+32, "Test",
|
698
|
+
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_INFORMATION))
|
699
|
+
tb5.add_tool(ID::SampleItem+33, "Test",
|
700
|
+
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_WARNING))
|
701
|
+
tb5.add_tool(ID::SampleItem+34, "Test",
|
702
|
+
Wx::ArtProvider::get_bitmap_bundle(Wx::ART_MISSING_IMAGE))
|
703
|
+
tb5.set_custom_overflow_items(nil, append_items)
|
704
|
+
tb5.realize
|
705
|
+
|
706
|
+
# add the toolbars to the manager
|
707
|
+
pi = Wx::AuiPaneInfo.new
|
708
|
+
pi.set_name('tb1').set_caption("Big Toolbar").toolbar_pane.top
|
709
|
+
# pi.top.set_left_dockable(false).set_right_dockable(false)
|
710
|
+
@mgr.add_pane(tb1, pi)
|
711
|
+
|
712
|
+
pi = Wx::AuiPaneInfo.new
|
713
|
+
pi.set_name('tb2').set_caption("Toolbar 2 (horizontal)").toolbar_pane.top.set_row(1)
|
714
|
+
# pi.set_left_dockable(false).set_right_dockable(false)
|
715
|
+
@mgr.add_pane(tb2, pi)
|
716
|
+
|
717
|
+
pi = Wx::AuiPaneInfo.new
|
718
|
+
pi.set_name('tb3').set_caption("Toolbar 3").toolbar_pane.top.set_row(1).set_position(1)
|
719
|
+
# pi.set_left_dockable(false).set_right_dockable(false)
|
720
|
+
@mgr.add_pane(tb3, pi)
|
721
|
+
|
722
|
+
pi = Wx::AuiPaneInfo.new
|
723
|
+
pi.set_name('tb4').set_caption("Sample Bookmark Toolbar").toolbar_pane.top.set_row(2)
|
724
|
+
# pi.set_left_dockable(false).set_right_dockable(false)
|
725
|
+
@mgr.add_pane(tb4, pi)
|
726
|
+
|
727
|
+
pi = Wx::AuiPaneInfo.new
|
728
|
+
pi.set_name('tb5').set_caption("Sample Vertical Toolbar").toolbar_pane.left.set_gripper_top
|
729
|
+
# pi.set_left_dockable(false).set_right_dockable(false)
|
730
|
+
@mgr.add_pane(tb5, pi)
|
731
|
+
|
732
|
+
@mgr.add_pane(Wx::Button.new(self, label: 'Test Button'),
|
733
|
+
Wx::AUI::AuiPaneInfo.new.set_name('tb6').toolbar_pane.top.set_row(2).set_position(1)
|
734
|
+
.set_left_dockable(false).set_right_dockable(false))
|
832
735
|
end
|
833
736
|
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
737
|
+
def setup_panes
|
738
|
+
# add a bunch of panes
|
739
|
+
pi = Wx::AuiPaneInfo.new
|
740
|
+
pi.set_name('test1').set_caption('Pane Caption').top
|
741
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
742
|
+
|
743
|
+
pi = Wx::AuiPaneInfo.new
|
744
|
+
pi.set_name('test2').set_caption('Client Size Reporter').bottom
|
745
|
+
pi.set_position(1).set_close_button.set_maximize_button
|
746
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
747
|
+
|
748
|
+
pi = Wx::AuiPaneInfo.new
|
749
|
+
pi.set_name('test3').set_caption('Client Size Reporter').bottom
|
750
|
+
pi.set_close_button.set_maximize_button
|
751
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
752
|
+
|
753
|
+
pi = Wx::AuiPaneInfo.new
|
754
|
+
pi.set_name('test4').set_caption('Pane Caption').left
|
755
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
756
|
+
|
757
|
+
pi = Wx::AuiPaneInfo.new
|
758
|
+
pi.set_name('test5').set_caption('No Close Button').right
|
759
|
+
pi.set_close_button(false)
|
760
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
761
|
+
|
762
|
+
pi = Wx::AuiPaneInfo.new
|
763
|
+
pi.set_name('test6').set_caption('Client Size Report').right
|
764
|
+
pi.set_row(1).set_close_button.set_maximize_button
|
765
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
766
|
+
|
767
|
+
pi = Wx::AuiPaneInfo.new
|
768
|
+
pi.set_name('test7').set_caption('Client Size Report').left
|
769
|
+
pi.set_layer(1).set_close_button.set_maximize_button
|
770
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
771
|
+
|
772
|
+
pi = Wx::AuiPaneInfo.new
|
773
|
+
pi.set_name('test8').set_caption('Tree Pane').left
|
774
|
+
pi.set_layer(1).set_position(1).set_close_button.set_maximize_button
|
775
|
+
@mgr.add_pane(create_tree_ctrl, pi)
|
776
|
+
|
777
|
+
pi = Wx::AuiPaneInfo.new
|
778
|
+
pi_size = Wx::Size.new(200, 100)
|
779
|
+
pi.set_name('test9').set_caption('Min Size 200x100').bottom
|
780
|
+
pi.set_best_size(pi_size).set_min_size(pi_size)
|
781
|
+
pi.set_layer(1).set_close_button.set_maximize_button
|
782
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
783
|
+
|
784
|
+
wnd10 = create_text_ctrl("This pane will prompt the user before hiding.")
|
785
|
+
pi = Wx::AuiPaneInfo.new
|
786
|
+
pi.set_name('test10').set_caption('Text Pane with hide prompt')
|
787
|
+
pi.bottom.set_layer(1).set_position(1)
|
788
|
+
@mgr.add_pane(wnd10, pi)
|
789
|
+
|
790
|
+
pi = Wx::AuiPaneInfo.new
|
791
|
+
pi.set_name('test11').set_caption('Fixed Pane').bottom
|
792
|
+
pi.set_layer(1).set_position(2).fixed
|
793
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
794
|
+
|
795
|
+
pi = Wx::AuiPaneInfo.new
|
796
|
+
pi.set_name('settings').set_caption('Dock Manager Settings')
|
797
|
+
pi.set_dockable(false).float.hide
|
798
|
+
|
799
|
+
@mgr.add_pane(SettingsPanel.new(self, self), pi)
|
800
|
+
|
801
|
+
# create some center panes
|
802
|
+
|
803
|
+
pi = Wx::AuiPaneInfo.new
|
804
|
+
pi.set_name('grid_content').center_pane.hide
|
805
|
+
@mgr.add_pane(create_grid, pi)
|
806
|
+
|
807
|
+
pi = Wx::AuiPaneInfo.new
|
808
|
+
pi.set_name('tree_content').center_pane.hide
|
809
|
+
@mgr.add_pane(create_tree_ctrl, pi)
|
810
|
+
|
811
|
+
pi = Wx::AuiPaneInfo.new
|
812
|
+
pi.set_name('sizereport_content').center_pane.hide
|
813
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
814
|
+
|
815
|
+
pi = Wx::AuiPaneInfo.new
|
816
|
+
pi.set_name('text_content').center_pane.hide
|
817
|
+
@mgr.add_pane(create_text_ctrl, pi)
|
818
|
+
|
819
|
+
pi = Wx::AuiPaneInfo.new
|
820
|
+
pi.set_name('html_content').center_pane.hide
|
821
|
+
@mgr.add_pane(create_html_ctrl, pi)
|
822
|
+
|
823
|
+
pi = Wx::AuiPaneInfo.new
|
824
|
+
pi.set_name('notebook_content').center_pane.hide
|
825
|
+
@mgr.add_pane(create_notebook, pi)
|
826
|
+
end
|
840
827
|
|
841
|
-
|
842
|
-
|
843
|
-
|
828
|
+
# make some default perspectives
|
829
|
+
def setup_perspectives
|
830
|
+
perspective_all = @mgr.save_perspective
|
844
831
|
|
845
|
-
|
846
|
-
|
847
|
-
|
832
|
+
@mgr.each_pane do |pane|
|
833
|
+
pane.hide unless pane.is_toolbar
|
834
|
+
end
|
848
835
|
|
849
|
-
|
850
|
-
|
851
|
-
|
836
|
+
@mgr.get_pane("tb1").hide
|
837
|
+
@mgr.get_pane("tb6").hide
|
838
|
+
@mgr.get_pane("test8").show.left.set_layer(0).set_row(0).set_position(0)
|
839
|
+
@mgr.get_pane("test10").show.bottom.set_layer(0).set_row(0).set_position(0)
|
840
|
+
@mgr.get_pane("notebook_content").show
|
841
|
+
perspective_default = @mgr.save_perspective
|
852
842
|
|
853
|
-
|
854
|
-
|
855
|
-
|
843
|
+
@perspectives << perspective_default
|
844
|
+
@perspectives << perspective_all
|
845
|
+
end
|
856
846
|
|
857
|
-
|
858
|
-
|
859
|
-
|
847
|
+
def get_dock_art
|
848
|
+
@mgr.get_art_provider
|
849
|
+
end
|
860
850
|
|
861
|
-
|
862
|
-
|
863
|
-
if float_pane.floating_position == Wx::DEFAULT_POSITION
|
864
|
-
float_pane.floating_position = get_start_position
|
851
|
+
def do_update
|
852
|
+
@mgr.update
|
865
853
|
end
|
866
|
-
@mgr.update
|
867
|
-
end
|
868
854
|
|
869
|
-
|
870
|
-
|
871
|
-
case event.get_id
|
872
|
-
when ID::NoGradient
|
873
|
-
gradient = Wx::AUI_GRADIENT_NONE
|
874
|
-
when ID::VerticalGradient
|
875
|
-
gradient = Wx::AUI_GRADIENT_VERTICAL
|
876
|
-
when ID::HorizontalGradient
|
877
|
-
gradient = Wx::AUI_GRADIENT_HORIZONTAL
|
855
|
+
def on_erase_background(event)
|
856
|
+
event.skip
|
878
857
|
end
|
879
|
-
return if not gradient
|
880
|
-
@mgr.get_art_provider.set_metric(Wx::AUI_DOCKART_GRADIENT_TYPE,
|
881
|
-
gradient)
|
882
|
-
@mgr.update
|
883
|
-
end
|
884
858
|
|
885
|
-
|
886
|
-
|
887
|
-
if e_id == ID::TransparentHint or
|
888
|
-
e_id == ID::VenetianBlindsHint or
|
889
|
-
e_id == ID::RectangleHint or
|
890
|
-
e_id == ID::NoHint
|
891
|
-
flags = @mgr.get_flags
|
892
|
-
flags &= ~Wx::AUI_MGR_TRANSPARENT_HINT
|
893
|
-
flags &= ~Wx::AUI_MGR_VENETIAN_BLINDS_HINT
|
894
|
-
flags &= ~Wx::AUI_MGR_RECTANGLE_HINT
|
895
|
-
@mgr.set_flags(flags)
|
859
|
+
def on_size(event)
|
860
|
+
event.skip
|
896
861
|
end
|
897
862
|
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
when ID::HintFade
|
905
|
-
flag = Wx::AUI_MGR_HINT_FADE
|
906
|
-
when ID::NoVenetianFade
|
907
|
-
flag = Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE
|
908
|
-
when ID::AllowActivePane
|
909
|
-
flag = Wx::AUI_MGR_ALLOW_ACTIVE_PANE
|
910
|
-
when ID::TransparentHint
|
911
|
-
flag = Wx::AUI_MGR_TRANSPARENT_HINT
|
912
|
-
when ID::VenetianBlindsHint
|
913
|
-
flag = Wx::AUI_MGR_VENETIAN_BLINDS_HINT
|
914
|
-
when ID::RectangleHint
|
915
|
-
flag = Wx::AUI_MGR_RECTANGLE_HINT
|
863
|
+
def on_settings
|
864
|
+
float_pane = @mgr.get_pane("settings").float.show
|
865
|
+
if float_pane.floating_position == Wx::DEFAULT_POSITION
|
866
|
+
float_pane.floating_position = get_start_position
|
867
|
+
end
|
868
|
+
@mgr.update
|
916
869
|
end
|
917
870
|
|
918
|
-
|
919
|
-
|
871
|
+
def on_gradient(event)
|
872
|
+
gradient = nil
|
873
|
+
case event.get_id
|
874
|
+
when ID::NoGradient
|
875
|
+
gradient = Wx::AUI_GRADIENT_NONE
|
876
|
+
when ID::VerticalGradient
|
877
|
+
gradient = Wx::AUI_GRADIENT_VERTICAL
|
878
|
+
when ID::HorizontalGradient
|
879
|
+
gradient = Wx::AUI_GRADIENT_HORIZONTAL
|
880
|
+
end
|
881
|
+
return if not gradient
|
882
|
+
@mgr.get_art_provider.set_metric(Wx::AUI_DOCKART_GRADIENT_TYPE,
|
883
|
+
gradient)
|
884
|
+
@mgr.update
|
920
885
|
end
|
921
886
|
|
922
|
-
|
923
|
-
|
887
|
+
def on_manager_flag(event)
|
888
|
+
e_id = event.get_id
|
889
|
+
if e_id == ID::TransparentHint or
|
890
|
+
e_id == ID::VenetianBlindsHint or
|
891
|
+
e_id == ID::RectangleHint or
|
892
|
+
e_id == ID::NoHint
|
893
|
+
flags = @mgr.get_flags
|
894
|
+
flags &= ~Wx::AUI_MGR_TRANSPARENT_HINT
|
895
|
+
flags &= ~Wx::AUI_MGR_VENETIAN_BLINDS_HINT
|
896
|
+
flags &= ~Wx::AUI_MGR_RECTANGLE_HINT
|
897
|
+
@mgr.set_flags(flags)
|
898
|
+
end
|
924
899
|
|
925
|
-
|
926
|
-
|
900
|
+
flag = nil
|
901
|
+
case e_id
|
902
|
+
when ID::AllowFloating
|
903
|
+
flag = Wx::AUI_MGR_ALLOW_FLOATING
|
904
|
+
when ID::TransparentDrag
|
905
|
+
flag = Wx::AUI_MGR_TRANSPARENT_DRAG
|
906
|
+
when ID::HintFade
|
907
|
+
flag = Wx::AUI_MGR_HINT_FADE
|
908
|
+
when ID::NoVenetianFade
|
909
|
+
flag = Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE
|
910
|
+
when ID::AllowActivePane
|
911
|
+
flag = Wx::AUI_MGR_ALLOW_ACTIVE_PANE
|
912
|
+
when ID::TransparentHint
|
913
|
+
flag = Wx::AUI_MGR_TRANSPARENT_HINT
|
914
|
+
when ID::VenetianBlindsHint
|
915
|
+
flag = Wx::AUI_MGR_VENETIAN_BLINDS_HINT
|
916
|
+
when ID::RectangleHint
|
917
|
+
flag = Wx::AUI_MGR_RECTANGLE_HINT
|
918
|
+
end
|
927
919
|
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
e_id == ID::NotebookCloseButtonActive
|
932
|
-
@notebook_style &= ~(Wx::AUI_NB_CLOSE_BUTTON |
|
933
|
-
Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB |
|
934
|
-
Wx::AUI_NB_CLOSE_ON_ALL_TABS)
|
935
|
-
end
|
920
|
+
if flag
|
921
|
+
@mgr.set_flags(@mgr.get_flags ^ flag)
|
922
|
+
end
|
936
923
|
|
937
|
-
|
938
|
-
when ID::NotebookNoCloseButton
|
939
|
-
# nothing
|
940
|
-
when ID::NotebookCloseButton
|
941
|
-
@notebook_style |= Wx::AUI_NB_CLOSE_BUTTON
|
942
|
-
when ID::NotebookCloseButtonAll
|
943
|
-
@notebook_style |= Wx::AUI_NB_CLOSE_ON_ALL_TABS
|
944
|
-
when ID::NotebookCloseButtonActive
|
945
|
-
@notebook_style |= Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB
|
924
|
+
@mgr.update
|
946
925
|
end
|
947
926
|
|
948
|
-
|
949
|
-
|
950
|
-
end
|
927
|
+
def on_notebook_flag(event)
|
928
|
+
e_id = event.get_id
|
951
929
|
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
930
|
+
if e_id == ID::NotebookNoCloseButton or
|
931
|
+
e_id == ID::NotebookCloseButton or
|
932
|
+
e_id == ID::NotebookCloseButtonAll or
|
933
|
+
e_id == ID::NotebookCloseButtonActive
|
934
|
+
@notebook_style &= ~(Wx::AUI_NB_CLOSE_BUTTON |
|
935
|
+
Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB |
|
936
|
+
Wx::AUI_NB_CLOSE_ON_ALL_TABS)
|
937
|
+
end
|
938
|
+
|
939
|
+
case e_id
|
940
|
+
when ID::NotebookNoCloseButton
|
941
|
+
# nothing
|
942
|
+
when ID::NotebookCloseButton
|
943
|
+
@notebook_style |= Wx::AUI_NB_CLOSE_BUTTON
|
944
|
+
when ID::NotebookCloseButtonAll
|
945
|
+
@notebook_style |= Wx::AUI_NB_CLOSE_ON_ALL_TABS
|
946
|
+
when ID::NotebookCloseButtonActive
|
947
|
+
@notebook_style |= Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB
|
948
|
+
end
|
963
949
|
|
964
|
-
|
965
|
-
|
966
|
-
next unless maybe_nb.kind_of?(Wx::AuiNotebook)
|
967
|
-
if e_id == ID::NotebookArtGloss
|
968
|
-
maybe_nb.use_default_art
|
969
|
-
@notebook_theme = 0
|
970
|
-
elsif e_id == ID::NotebookArtSimple
|
971
|
-
maybe_nb.use_simple_art
|
972
|
-
@notebook_theme = 1
|
950
|
+
if e_id == ID::NotebookAllowTabMove
|
951
|
+
@notebook_style ^= Wx::AUI_NB_TAB_MOVE
|
973
952
|
end
|
974
953
|
|
975
|
-
|
976
|
-
|
954
|
+
if e_id == ID::NotebookAllowTabExternalMove
|
955
|
+
@notebook_style ^= Wx::AUI_NB_TAB_EXTERNAL_MOVE
|
956
|
+
elsif e_id == ID::NotebookAllowTabSplit
|
957
|
+
@notebook_style ^= Wx::AUI_NB_TAB_SPLIT
|
958
|
+
elsif e_id == ID::NotebookWindowList
|
959
|
+
@notebook_style ^= Wx::AUI_NB_WINDOWLIST_BUTTON
|
960
|
+
elsif e_id == ID::NotebookScrollButtons
|
961
|
+
@notebook_style ^= Wx::AUI_NB_SCROLL_BUTTONS
|
962
|
+
elsif e_id == ID::NotebookTabFixedWidth
|
963
|
+
@notebook_style ^= Wx::AUI_NB_TAB_FIXED_WIDTH
|
964
|
+
end
|
965
|
+
|
966
|
+
@mgr.each_pane do |pane|
|
967
|
+
maybe_nb = pane.window
|
968
|
+
next unless maybe_nb.kind_of?(Wx::AuiNotebook)
|
969
|
+
if e_id == ID::NotebookArtGloss
|
970
|
+
maybe_nb.use_default_art
|
971
|
+
@notebook_theme = 0
|
972
|
+
elsif e_id == ID::NotebookArtSimple
|
973
|
+
maybe_nb.use_simple_art
|
974
|
+
@notebook_theme = 1
|
975
|
+
end
|
976
|
+
|
977
|
+
maybe_nb.set_window_style_flag(@notebook_style)
|
978
|
+
maybe_nb.refresh()
|
979
|
+
end
|
977
980
|
end
|
978
|
-
end
|
979
981
|
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
982
|
+
def on_update_ui(event)
|
983
|
+
flags = @mgr.get_flags
|
984
|
+
|
985
|
+
case event.get_id
|
986
|
+
when ID::NoGradient
|
987
|
+
event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_NONE)
|
988
|
+
when ID::VerticalGradient
|
989
|
+
event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_VERTICAL)
|
990
|
+
when ID::HorizontalGradient
|
991
|
+
event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_HORIZONTAL)
|
992
|
+
when ID::AllowFloating
|
993
|
+
event.check((flags & Wx::AUI_MGR_ALLOW_FLOATING) != 0)
|
994
|
+
when ID::TransparentDrag
|
995
|
+
event.check((flags & Wx::AUI_MGR_TRANSPARENT_DRAG) != 0)
|
996
|
+
when ID::TransparentHint
|
997
|
+
event.check((flags & Wx::AUI_MGR_TRANSPARENT_HINT) != 0)
|
998
|
+
when ID::VenetianBlindsHint
|
999
|
+
event.check((flags & Wx::AUI_MGR_VENETIAN_BLINDS_HINT) != 0)
|
1000
|
+
when ID::RectangleHint
|
1001
|
+
event.check((flags & Wx::AUI_MGR_RECTANGLE_HINT) != 0)
|
1002
|
+
when ID::NoHint
|
1003
|
+
event.check((Wx::AUI_MGR_TRANSPARENT_HINT |
|
1004
|
+
Wx::AUI_MGR_VENETIAN_BLINDS_HINT |
|
1005
|
+
Wx::AUI_MGR_RECTANGLE_HINT) & flags == 0)
|
1006
|
+
when ID::HintFade
|
1007
|
+
event.check((flags & Wx::AUI_MGR_HINT_FADE) != 0)
|
1008
|
+
when ID::NoVenetianFade
|
1009
|
+
event.check((flags & Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE) != 0)
|
1010
|
+
when ID::NotebookNoCloseButton
|
1011
|
+
event.check((@notebook_style &
|
1012
|
+
(Wx::AUI_NB_CLOSE_BUTTON |
|
1013
|
+
Wx::AUI_NB_CLOSE_ON_ALL_TABS |
|
1014
|
+
Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB)) != 0)
|
1015
|
+
when ID::NotebookCloseButton
|
1016
|
+
event.check((@notebook_style & Wx::AUI_NB_CLOSE_BUTTON) != 0)
|
1017
|
+
when ID::NotebookCloseButtonAll
|
1018
|
+
event.check((@notebook_style & Wx::AUI_NB_CLOSE_ON_ALL_TABS) != 0)
|
1019
|
+
when ID::NotebookCloseButtonActive
|
1020
|
+
event.check((@notebook_style & Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB) != 0)
|
1021
|
+
when ID::NotebookAllowTabSplit
|
1022
|
+
event.check((@notebook_style & Wx::AUI_NB_TAB_SPLIT) != 0)
|
1023
|
+
when ID::NotebookAllowTabMove
|
1024
|
+
event.check((@notebook_style & Wx::AUI_NB_TAB_MOVE) != 0)
|
1025
|
+
when ID::NotebookAllowTabExternalMove
|
1026
|
+
event.check((@notebook_style & Wx::AUI_NB_TAB_EXTERNAL_MOVE) != 0)
|
1027
|
+
when ID::NotebookScrollButtons
|
1028
|
+
event.check((@notebook_style & Wx::AUI_NB_SCROLL_BUTTONS) != 0)
|
1029
|
+
when ID::NotebookWindowList
|
1030
|
+
event.check((@notebook_style & Wx::AUI_NB_WINDOWLIST_BUTTON) != 0)
|
1031
|
+
when ID::NotebookTabFixedWidth
|
1032
|
+
event.check((@notebook_style & Wx::AUI_NB_TAB_FIXED_WIDTH) != 0)
|
1033
|
+
when ID::NotebookArtGloss
|
1034
|
+
event.check(@notebook_style == 0)
|
1035
|
+
when ID::NotebookArtSimple
|
1036
|
+
event.check(@notebook_style == 1)
|
1037
|
+
end
|
1035
1038
|
end
|
1036
|
-
end
|
1037
1039
|
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1040
|
+
def on_pane_close(event)
|
1041
|
+
if event.get_pane.name == "test10"
|
1042
|
+
msg = "Are you sure you want to close/hide this pane?"
|
1043
|
+
Wx.MessageDialog(self, msg, "Wx::AUI", Wx::YES_NO) do |dlg|
|
1044
|
+
if dlg.show_modal != Wx::ID_YES
|
1045
|
+
return event.veto
|
1046
|
+
end
|
1044
1047
|
end
|
1045
1048
|
end
|
1046
1049
|
end
|
1047
|
-
end
|
1048
1050
|
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1051
|
+
def on_create_perspective
|
1052
|
+
msg = "Enter a name for the new perspective:"
|
1053
|
+
Wx.TextEntryDialog(self, msg, "Wx::AUI Test") do |dlg|
|
1054
|
+
dlg.set_value("Perspective %d" % [@perspectives.length + 1])
|
1055
|
+
return unless dlg.show_modal == Wx::ID_OK
|
1056
|
+
if @perspectives.length.zero?
|
1057
|
+
@perspectives_menu.append_separator
|
1058
|
+
end
|
1059
|
+
@perspectives_menu.append(ID::FirstPerspective + @perspectives.length,
|
1060
|
+
dlg.get_value)
|
1061
|
+
@perspectives << @mgr.save_perspective
|
1056
1062
|
end
|
1057
|
-
@perspectives_menu.append(ID::FirstPerspective + @perspectives.length,
|
1058
|
-
dlg.get_value)
|
1059
|
-
@perspectives << @mgr.save_perspective
|
1060
1063
|
end
|
1061
|
-
end
|
1062
1064
|
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1065
|
+
def on_copy_perspective_code
|
1066
|
+
Kernel.raise NotImplementedError
|
1067
|
+
end
|
1066
1068
|
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1069
|
+
def on_restore_perspective(event)
|
1070
|
+
perspective = @perspectives[event.get_id - ID::FirstPerspective]
|
1071
|
+
@mgr.load_perspective(perspective)
|
1072
|
+
end
|
1071
1073
|
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1074
|
+
def on_notebook_page_close(event)
|
1075
|
+
notebook = event.get_event_object
|
1076
|
+
if notebook.get_page(event.get_selection).kind_of?(Wx::HtmlWindow)
|
1077
|
+
msg = "Are you sure you want to close/hide this notebook page?"
|
1078
|
+
Wx.MessageDialog(self, msg, "Wx::AUI", Wx::YES_NO) do |dlg|
|
1079
|
+
if dlg.show_modal != Wx::ID_YES
|
1080
|
+
event.veto
|
1081
|
+
else
|
1082
|
+
event.allow
|
1083
|
+
end
|
1081
1084
|
end
|
1082
1085
|
end
|
1083
1086
|
end
|
1084
|
-
end
|
1085
1087
|
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1088
|
+
def get_start_position
|
1089
|
+
origin = client_to_screen(Wx::Point.new(0, 0))
|
1090
|
+
return Wx::Point.new(origin.x + 20, origin.y + 20)
|
1091
|
+
end
|
1090
1092
|
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1093
|
+
def on_create_tree
|
1094
|
+
pi = Wx::AuiPaneInfo.new
|
1095
|
+
pi.set_caption("Tree Control").float
|
1096
|
+
pi.set_floating_position(get_start_position)
|
1097
|
+
pi.set_floating_size(Wx::Size.new(150, 300))
|
1098
|
+
@mgr.add_pane(create_tree_ctrl, pi)
|
1099
|
+
@mgr.update
|
1100
|
+
end
|
1099
1101
|
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1102
|
+
def on_create_grid
|
1103
|
+
pi = Wx::AuiPaneInfo.new
|
1104
|
+
pi.set_caption("Grid").float
|
1105
|
+
pi.set_floating_position(get_start_position)
|
1106
|
+
pi.set_floating_size(Wx::Size.new(300, 200))
|
1107
|
+
@mgr.add_pane(create_grid, pi)
|
1108
|
+
@mgr.update
|
1109
|
+
end
|
1108
1110
|
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1111
|
+
def on_create_html
|
1112
|
+
pi = Wx::AuiPaneInfo.new
|
1113
|
+
pi.set_caption("HTML Control").float
|
1114
|
+
pi.set_floating_position(get_start_position)
|
1115
|
+
pi.set_floating_size(Wx::Size.new(300, 200))
|
1116
|
+
@mgr.add_pane(create_html_ctrl, pi)
|
1117
|
+
@mgr.update
|
1118
|
+
end
|
1117
1119
|
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1120
|
+
def on_create_notebook
|
1121
|
+
pi = Wx::AuiPaneInfo.new
|
1122
|
+
pi.set_caption("Notebook").float
|
1123
|
+
pi.set_floating_position(get_start_position)
|
1124
|
+
pi.set_close_button.set_maximize_button
|
1125
|
+
@mgr.add_pane(create_notebook, pi)
|
1126
|
+
@mgr.update
|
1127
|
+
end
|
1126
1128
|
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1129
|
+
def on_create_text
|
1130
|
+
pi = Wx::AuiPaneInfo.new
|
1131
|
+
pi.set_caption("Text Control").float
|
1132
|
+
pi.set_floating_position(get_start_position)
|
1133
|
+
@mgr.add_pane(create_text_ctrl, pi)
|
1134
|
+
@mgr.update
|
1135
|
+
end
|
1134
1136
|
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1137
|
+
def on_create_size_report
|
1138
|
+
pi = Wx::AuiPaneInfo.new
|
1139
|
+
pi.set_caption("Client Size Reporter").float
|
1140
|
+
pi.set_floating_position(get_start_position)
|
1141
|
+
pi.set_close_button.set_maximize_button
|
1142
|
+
@mgr.add_pane(create_size_report_ctrl, pi)
|
1143
|
+
@mgr.update
|
1144
|
+
end
|
1143
1145
|
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1146
|
+
def on_change_content_pane(event)
|
1147
|
+
e_id = event.get_id
|
1148
|
+
@mgr.get_pane("grID::content").show(e_id == ID::GridContent)
|
1149
|
+
@mgr.get_pane("text_content").show(e_id == ID::TextContent)
|
1150
|
+
@mgr.get_pane("tree_content").show(e_id == ID::TreeContent)
|
1151
|
+
@mgr.get_pane("sizereport_content").show(e_id == ID::SizeReportContent)
|
1152
|
+
@mgr.get_pane("html_content").show(e_id == ID::HTMLContent)
|
1153
|
+
@mgr.get_pane("notebook_content").show(e_id == ID::NotebookContent)
|
1154
|
+
@mgr.update
|
1155
|
+
end
|
1154
1156
|
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1157
|
+
def on_drop_down_toolbar_item(evt)
|
1158
|
+
if evt.is_drop_down_clicked
|
1159
|
+
tb = evt.get_event_object
|
1158
1160
|
|
1159
|
-
|
1161
|
+
tb.set_tool_sticky(evt.id, true)
|
1160
1162
|
|
1161
|
-
|
1162
|
-
|
1163
|
+
# create the popup menu
|
1164
|
+
menuPopup = Wx::Menu.new
|
1163
1165
|
|
1164
|
-
|
1166
|
+
bmp = Wx::ArtProvider.get_bitmap_bundle(Wx::ART_QUESTION, Wx::ART_OTHER, from_dip(Wx::Size.new(16,16)))
|
1165
1167
|
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1168
|
+
m1 = Wx::MenuItem.new(menuPopup, 10001, 'Drop Down Item 1')
|
1169
|
+
m1.set_bitmap(bmp)
|
1170
|
+
menuPopup.append(m1)
|
1169
1171
|
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1172
|
+
m2 = Wx::MenuItem.new(menuPopup, 10002, 'Drop Down Item 2')
|
1173
|
+
m2.set_bitmap(bmp)
|
1174
|
+
menuPopup.append(m2)
|
1173
1175
|
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1176
|
+
m3 = Wx::MenuItem.new(menuPopup, 10003, 'Drop Down Item 3')
|
1177
|
+
m3.set_bitmap(bmp)
|
1178
|
+
menuPopup.append(m3)
|
1177
1179
|
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1180
|
+
m4 = Wx::MenuItem.new(menuPopup, 10004, 'Drop Down Item 4')
|
1181
|
+
m4.set_bitmap(bmp)
|
1182
|
+
menuPopup.append(m4)
|
1181
1183
|
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1184
|
+
# line up our menu with the button
|
1185
|
+
rect = tb.get_tool_rect(evt.id)
|
1186
|
+
pt = tb.client_to_screen(rect.bottom_left)
|
1187
|
+
pt = screen_to_client(pt)
|
1186
1188
|
|
1187
|
-
|
1189
|
+
popup_menu(menuPopup, pt)
|
1188
1190
|
|
1189
|
-
|
1190
|
-
|
1191
|
+
# make sure the button is "un-stuck"
|
1192
|
+
tb.set_tool_sticky(evt.id, false)
|
1193
|
+
end
|
1191
1194
|
end
|
1192
|
-
end
|
1193
1195
|
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1196
|
+
def on_exit
|
1197
|
+
close(true)
|
1198
|
+
end
|
1199
|
+
|
1200
|
+
def on_about
|
1201
|
+
msg = "Wx::AUI Demo\nAn advanced window management library for wxRuby\nAdapted by Alex Fenton from the wxWidgets AUI Demo\n which is (c) Copyright 2005-2006, Kirix Corporation"
|
1202
|
+
Wx.MessageDialog(self, msg, "Wx::AUI", Wx::OK) do |dlg|
|
1203
|
+
dlg.show_modal
|
1204
|
+
end
|
1205
|
+
end
|
1197
1206
|
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1207
|
+
def create_text_ctrl(text = "")
|
1208
|
+
if text.empty?
|
1209
|
+
text = "This is a test text box"
|
1210
|
+
end
|
1211
|
+
Wx::TextCtrl.new(self, Wx::ID_ANY, text,
|
1212
|
+
Wx::Point.new(0, 0), Wx::Size.new(150, 90),
|
1213
|
+
Wx::NO_BORDER | Wx::TE_MULTILINE)
|
1202
1214
|
end
|
1203
|
-
end
|
1204
1215
|
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1216
|
+
def create_grid
|
1217
|
+
grid = Wx::Grid.new(self, Wx::ID_ANY,
|
1218
|
+
Wx::Point.new(0, 0),
|
1219
|
+
Wx::Size.new(150, 250),
|
1220
|
+
Wx::NO_BORDER | Wx::WANTS_CHARS)
|
1221
|
+
grid.create_grid(50, 20)
|
1222
|
+
grid
|
1208
1223
|
end
|
1209
|
-
Wx::TextCtrl.new(self, Wx::ID_ANY, text,
|
1210
|
-
Wx::Point.new(0, 0), Wx::Size.new(150, 90),
|
1211
|
-
Wx::NO_BORDER | Wx::TE_MULTILINE)
|
1212
|
-
end
|
1213
1224
|
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1225
|
+
def create_tree_ctrl
|
1226
|
+
tree = Wx::TreeCtrl.new(self, Wx::ID_ANY,
|
1227
|
+
Wx::Point.new(0, 0), Wx::Size.new(160, 250),
|
1228
|
+
Wx::TR_DEFAULT_STYLE | Wx::NO_BORDER)
|
1229
|
+
|
1230
|
+
img_list = Wx::ImageList.new(16, 16, true, 2)
|
1231
|
+
img_list.add(Wx::ArtProvider::get_bitmap(Wx::ART_FOLDER,
|
1232
|
+
Wx::ART_OTHER,
|
1233
|
+
Wx::Size.new(16, 16)))
|
1234
|
+
img_list.add(Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
|
1235
|
+
Wx::ART_OTHER,
|
1236
|
+
Wx::Size.new(16, 16)))
|
1237
|
+
tree.set_image_list(img_list)
|
1238
|
+
root = tree.add_root("Wx::AUI Project", 0)
|
1239
|
+
items = []
|
1240
|
+
1.upto(5) { |i| items << tree.append_item(root, "Item #{i}", 0) }
|
1241
|
+
|
1242
|
+
items.each do |id|
|
1243
|
+
1.upto(5) { |i| tree.append_item(id, "Subitem #{i}", 0) }
|
1244
|
+
end
|
1222
1245
|
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
Wx::TR_DEFAULT_STYLE | Wx::NO_BORDER)
|
1246
|
+
tree.expand(root)
|
1247
|
+
tree
|
1248
|
+
end
|
1227
1249
|
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
img_list.add(Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
|
1233
|
-
Wx::ART_OTHER,
|
1234
|
-
Wx::Size.new(16, 16)))
|
1235
|
-
tree.set_image_list(img_list)
|
1236
|
-
root = tree.add_root("Wx::AUI Project", 0)
|
1237
|
-
items = []
|
1238
|
-
1.upto(5) { |i| items << tree.append_item(root, "Item #{i}", 0) }
|
1239
|
-
|
1240
|
-
items.each do |id|
|
1241
|
-
1.upto(5) { |i| tree.append_item(id, "Subitem #{i}", 0) }
|
1250
|
+
def create_size_report_ctrl(width = 80, height = 80)
|
1251
|
+
SizeReportCtrl.new(self, Wx::ID_ANY,
|
1252
|
+
Wx::DEFAULT_POSITION,
|
1253
|
+
Wx::Size.new(width, height), @mgr)
|
1242
1254
|
end
|
1243
1255
|
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1256
|
+
def create_html_ctrl(parent = nil)
|
1257
|
+
if not parent
|
1258
|
+
parent = self
|
1259
|
+
end
|
1260
|
+
ctrl = Wx::HtmlWindow.new(parent, Wx::ID_ANY,
|
1261
|
+
Wx::DEFAULT_POSITION,
|
1262
|
+
Wx::Size.new(400, 300))
|
1263
|
+
ctrl.set_page <<~__HTML
|
1264
|
+
<html>
|
1265
|
+
<head><title>Test page</title></head>
|
1266
|
+
<body background="pic.png" bgcolor="#ffffff">
|
1267
|
+
|
1268
|
+
<B>wxString</B> <B>FindFirst</B>(was there a space between 'g' and 'F'?)<P>
|
1269
|
+
|
1270
|
+
<font size="+2">Unbre</font>akable word<P>
|
1271
|
+
|
1272
|
+
<pre width="50%">
|
1273
|
+
<pre> text, 50% wide
|
1274
|
+
</pre>
|
1275
|
+
|
1276
|
+
|
1277
|
+
<script>
|
1278
|
+
some meaningless script < is this > </is> FIXME: write real jscript here
|
1279
|
+
</script>
|
1280
|
+
text after script <b>in bold</b>
|
1281
|
+
|
1282
|
+
</body>
|
1283
|
+
</html>
|
1284
|
+
__HTML
|
1285
|
+
ctrl
|
1286
|
+
end
|
1247
1287
|
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1288
|
+
def create_notebook
|
1289
|
+
# create the notebook off-window to avoid flicker
|
1290
|
+
client_size = get_client_size
|
1291
|
+
|
1292
|
+
ctrl = Wx::AuiNotebook.new(self, Wx::ID_ANY,
|
1293
|
+
Wx::Point.new(client_size.width, client_size.height),
|
1294
|
+
Wx::Size.new(430, 200),
|
1295
|
+
@notebook_style)
|
1253
1296
|
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1297
|
+
page_bmp = Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
|
1298
|
+
Wx::ART_OTHER,
|
1299
|
+
Wx::Size.new(16, 16))
|
1300
|
+
|
1301
|
+
ctrl.add_page(create_html_ctrl(ctrl),
|
1302
|
+
"Welcome to Wx::AUI", false, page_bmp)
|
1303
|
+
|
1304
|
+
panel = Wx::Panel.new(ctrl, Wx::ID_ANY)
|
1305
|
+
flex = Wx::FlexGridSizer.new(2)
|
1306
|
+
flex.add_growable_row(0)
|
1307
|
+
flex.add_growable_row(3)
|
1308
|
+
flex.add_growable_row(1)
|
1309
|
+
|
1310
|
+
flex.add(5, 5)
|
1311
|
+
flex.add(5, 5)
|
1312
|
+
flex.add(Wx::StaticText.new(panel, -1, "Wx::TextCtrl:"),
|
1313
|
+
0, Wx::ALL | Wx::ALIGN_CENTRE, 5)
|
1314
|
+
flex.add(Wx::TextCtrl.new(panel, -1, "",
|
1315
|
+
Wx::DEFAULT_POSITION, Wx::Size.new(100, -1)),
|
1316
|
+
1, Wx::ALL | Wx::ALIGN_CENTRE, 5)
|
1317
|
+
|
1318
|
+
flex.add(Wx::StaticText.new(panel, -1, "Wx::SpinCtrl:"),
|
1319
|
+
0, Wx::ALL | Wx::ALIGN_CENTRE, 5)
|
1320
|
+
flex.add(Wx::SpinCtrl.new(panel, -1, "5",
|
1321
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1322
|
+
Wx::SP_ARROW_KEYS, 5, 50, 5),
|
1323
|
+
1, Wx::ALL | Wx::ALIGN_CENTRE, 5)
|
1324
|
+
|
1325
|
+
flex.add(5, 5)
|
1326
|
+
flex.add(5, 5)
|
1327
|
+
panel.set_sizer(flex)
|
1328
|
+
ctrl.add_page(panel, "wxPanel", false, page_bmp)
|
1329
|
+
|
1330
|
+
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some text",
|
1331
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1332
|
+
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1333
|
+
"wxTextCtrl 1", false, page_bmp)
|
1334
|
+
|
1335
|
+
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1336
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1337
|
+
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1338
|
+
"wxTextCtrl 2")
|
1339
|
+
|
1340
|
+
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1341
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1342
|
+
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1343
|
+
"wxTextCtrl 3")
|
1344
|
+
|
1345
|
+
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1346
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1347
|
+
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1348
|
+
"wxTextCtrl 4")
|
1349
|
+
|
1350
|
+
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1351
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1352
|
+
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1353
|
+
"wxTextCtrl 5")
|
1354
|
+
|
1355
|
+
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1356
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1357
|
+
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1358
|
+
"wxTextCtrl 6")
|
1359
|
+
|
1360
|
+
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1361
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1362
|
+
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1363
|
+
"wxTextCtrl 7 (longer title)")
|
1364
|
+
|
1365
|
+
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1366
|
+
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1367
|
+
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1368
|
+
"wxTextCtrl 8")
|
1369
|
+
return ctrl
|
1257
1370
|
end
|
1258
|
-
ctrl = Wx::HtmlWindow.new(parent, Wx::ID_ANY,
|
1259
|
-
Wx::DEFAULT_POSITION,
|
1260
|
-
Wx::Size.new(400, 300))
|
1261
|
-
ctrl.set_page <<~__HTML
|
1262
|
-
<html>
|
1263
|
-
<head><title>Test page</title></head>
|
1264
|
-
<body background="pic.png" bgcolor="#ffffff">
|
1265
|
-
|
1266
|
-
<B>wxString</B> <B>FindFirst</B>(was there a space between 'g' and 'F'?)<P>
|
1267
|
-
|
1268
|
-
<font size="+2">Unbre</font>akable word<P>
|
1269
|
-
|
1270
|
-
<pre width="50%">
|
1271
|
-
<pre> text, 50% wide
|
1272
|
-
</pre>
|
1273
|
-
|
1274
|
-
|
1275
|
-
<script>
|
1276
|
-
some meaningless script < is this > </is> FIXME: write real jscript here
|
1277
|
-
</script>
|
1278
|
-
text after script <b>in bold</b>
|
1279
|
-
|
1280
|
-
</body>
|
1281
|
-
</html>
|
1282
|
-
__HTML
|
1283
|
-
ctrl
|
1284
1371
|
end
|
1285
1372
|
|
1286
|
-
def create_notebook
|
1287
|
-
# create the notebook off-window to avoid flicker
|
1288
|
-
client_size = get_client_size
|
1289
|
-
|
1290
|
-
ctrl = Wx::AuiNotebook.new(self, Wx::ID_ANY,
|
1291
|
-
Wx::Point.new(client_size.width, client_size.height),
|
1292
|
-
Wx::Size.new(430, 200),
|
1293
|
-
@notebook_style)
|
1294
|
-
|
1295
|
-
page_bmp = Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
|
1296
|
-
Wx::ART_OTHER,
|
1297
|
-
Wx::Size.new(16, 16))
|
1298
|
-
|
1299
|
-
ctrl.add_page(create_html_ctrl(ctrl),
|
1300
|
-
"Welcome to Wx::AUI", false, page_bmp)
|
1301
|
-
|
1302
|
-
panel = Wx::Panel.new(ctrl, Wx::ID_ANY)
|
1303
|
-
flex = Wx::FlexGridSizer.new(2)
|
1304
|
-
flex.add_growable_row(0)
|
1305
|
-
flex.add_growable_row(3)
|
1306
|
-
flex.add_growable_row(1)
|
1307
|
-
|
1308
|
-
flex.add(5, 5)
|
1309
|
-
flex.add(5, 5)
|
1310
|
-
flex.add(Wx::StaticText.new(panel, -1, "Wx::TextCtrl:"),
|
1311
|
-
0, Wx::ALL | Wx::ALIGN_CENTRE, 5)
|
1312
|
-
flex.add(Wx::TextCtrl.new(panel, -1, "",
|
1313
|
-
Wx::DEFAULT_POSITION, Wx::Size.new(100, -1)),
|
1314
|
-
1, Wx::ALL | Wx::ALIGN_CENTRE, 5)
|
1315
|
-
|
1316
|
-
flex.add(Wx::StaticText.new(panel, -1, "Wx::SpinCtrl:"),
|
1317
|
-
0, Wx::ALL | Wx::ALIGN_CENTRE, 5)
|
1318
|
-
flex.add(Wx::SpinCtrl.new(panel, -1, "5",
|
1319
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1320
|
-
Wx::SP_ARROW_KEYS, 5, 50, 5),
|
1321
|
-
1, Wx::ALL | Wx::ALIGN_CENTRE, 5)
|
1322
|
-
|
1323
|
-
flex.add(5, 5)
|
1324
|
-
flex.add(5, 5)
|
1325
|
-
panel.set_sizer(flex)
|
1326
|
-
ctrl.add_page(panel, "wxPanel", false, page_bmp)
|
1327
|
-
|
1328
|
-
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some text",
|
1329
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1330
|
-
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1331
|
-
"wxTextCtrl 1", false, page_bmp)
|
1332
|
-
|
1333
|
-
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1334
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1335
|
-
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1336
|
-
"wxTextCtrl 2")
|
1337
|
-
|
1338
|
-
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1339
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1340
|
-
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1341
|
-
"wxTextCtrl 3")
|
1342
|
-
|
1343
|
-
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1344
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1345
|
-
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1346
|
-
"wxTextCtrl 4")
|
1347
|
-
|
1348
|
-
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1349
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1350
|
-
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1351
|
-
"wxTextCtrl 5")
|
1352
|
-
|
1353
|
-
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1354
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1355
|
-
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1356
|
-
"wxTextCtrl 6")
|
1357
|
-
|
1358
|
-
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1359
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1360
|
-
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1361
|
-
"wxTextCtrl 7 (longer title)")
|
1362
|
-
|
1363
|
-
ctrl.add_page(Wx::TextCtrl.new(ctrl, Wx::ID_ANY, "Some more text",
|
1364
|
-
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
|
1365
|
-
Wx::TE_MULTILINE | Wx::NO_BORDER),
|
1366
|
-
"wxTextCtrl 8")
|
1367
|
-
return ctrl
|
1368
|
-
end
|
1369
1373
|
end
|
1370
1374
|
|
1371
1375
|
module AUISample
|
@@ -1379,7 +1383,7 @@ module AUISample
|
|
1379
1383
|
end
|
1380
1384
|
|
1381
1385
|
def self.activate
|
1382
|
-
frame = AuiFrame.new(nil, Wx::ID_ANY, "Wx::AUI Sample Application",
|
1386
|
+
frame = AuiTest::AuiFrame.new(nil, Wx::ID_ANY, "Wx::AUI Sample Application",
|
1383
1387
|
Wx::DEFAULT_POSITION,
|
1384
1388
|
Wx::Size.new(800, 600))
|
1385
1389
|
frame.show
|