wxruby3 1.8.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/INSTALL.md +20 -10
- data/README.md +3 -3
- data/ext/wxruby3/include/wxRubyApp.h +49 -3
- data/ext/wxruby3/include/wxruby-ComboPopup.h +17 -32
- data/ext/wxruby3/include/wxruby-Config.h +34 -11
- data/ext/wxruby3/include/wxruby-GCTracking.h +23 -5
- data/ext/wxruby3/include/wxruby-SharedEventHandler.h +7 -7
- data/ext/wxruby3/include/wxruby-runtime.h +65 -0
- data/ext/wxruby3/swig/common.i +6 -0
- data/ext/wxruby3/swig/custom/typed_data/rubyhead.swg +220 -0
- data/ext/wxruby3/swig/custom/typed_data/rubyprimtypes.swg +265 -0
- data/ext/wxruby3/swig/custom/typed_data/rubyrun.swg +243 -0
- data/ext/wxruby3/swig/custom/typed_data/swigrun.swg +689 -0
- data/ext/wxruby3/swig/custom/{rubyprimtypes.swg → untyped_data/rubyprimtypes.swg} +8 -0
- data/ext/wxruby3/swig/mark_free_impl.i +2 -2
- data/ext/wxruby3/swig/memory_management.i +1 -0
- data/ext/wxruby3/swig/wx.i +19 -6
- data/lib/wx/core/file_dialog.rb +3 -10
- data/lib/wx/doc/rbn/events.rb +32 -0
- data/lib/wx/doc/rbn/ribbon_backstage_mrulist.rb +25 -0
- data/lib/wx/keyword_ctors.rb +3 -13
- data/lib/wx/rbn/events.rb +18 -0
- data/lib/wx/rbn/require.rb +1 -0
- data/lib/wx/rbn/ribbon_backstage_mrulist.rb +39 -0
- data/lib/wx/version.rb +1 -1
- data/rakelib/lib/config.rb +3 -3
- data/rakelib/lib/core/include/typed_data/swigrubyrun.inc +629 -0
- data/rakelib/lib/core/include/typed_data/swigrun.inc +870 -0
- data/rakelib/lib/core/package.rb +2 -2
- data/rakelib/lib/director/app.rb +16 -0
- data/rakelib/lib/director/art_provider.rb +3 -3
- data/rakelib/lib/director/aui_mdi_child_frame.rb +24 -0
- data/rakelib/lib/director/aui_mdi_parent_frame.rb +0 -2
- data/rakelib/lib/director/aui_tab_ctrl.rb +3 -3
- data/rakelib/lib/director/comboctrl.rb +35 -2
- data/rakelib/lib/director/config_base.rb +79 -33
- data/rakelib/lib/director/data_object.rb +1 -1
- data/rakelib/lib/director/date_event.rb +10 -3
- data/rakelib/lib/director/event.rb +16 -7
- data/rakelib/lib/director/event_handler.rb +48 -10
- data/rakelib/lib/director/events.rb +4 -2
- data/rakelib/lib/director/file_history.rb +46 -0
- data/rakelib/lib/director/frame.rb +29 -0
- data/rakelib/lib/director/fs_file.rb +2 -4
- data/rakelib/lib/director/functions.rb +2 -2
- data/rakelib/lib/director/graphics_context.rb +6 -6
- data/rakelib/lib/director/grid_cell_editor.rb +1 -1
- data/rakelib/lib/director/grid_cell_renderer.rb +1 -1
- data/rakelib/lib/director/grid_ctrl.rb +39 -12
- data/rakelib/lib/director/help_controller.rb +17 -0
- data/rakelib/lib/director/html_help_data.rb +20 -2
- data/rakelib/lib/director/icon.rb +3 -0
- data/rakelib/lib/director/log.rb +25 -1
- data/rakelib/lib/director/menu.rb +38 -106
- data/rakelib/lib/director/menu_bar.rb +36 -70
- data/rakelib/lib/director/num_validator.rb +3 -3
- data/rakelib/lib/director/numeric_property_validator.rb +1 -1
- data/rakelib/lib/director/page_setup_dialog.rb +18 -1
- data/rakelib/lib/director/pgeditor.rb +1 -1
- data/rakelib/lib/director/pgvalidation_info.rb +1 -0
- data/rakelib/lib/director/popup_window.rb +7 -0
- data/rakelib/lib/director/preview_frame.rb +8 -1
- data/rakelib/lib/director/print_dialog.rb +17 -0
- data/rakelib/lib/director/printer.rb +1 -1
- data/rakelib/lib/director/property_grid_page.rb +2 -0
- data/rakelib/lib/director/region_iterator.rb +1 -1
- data/rakelib/lib/director/ribbon_backstage.rb +28 -0
- data/rakelib/lib/director/ribbon_backstage_button.rb +25 -0
- data/rakelib/lib/director/ribbon_backstage_callout.rb +26 -0
- data/rakelib/lib/director/ribbon_backstage_heading.rb +26 -0
- data/rakelib/lib/director/ribbon_backstage_itemlist.rb +27 -0
- data/rakelib/lib/director/ribbon_backstage_mrulist.rb +112 -0
- data/rakelib/lib/director/ribbon_bar.rb +14 -0
- data/rakelib/lib/director/ribbon_gallery.rb +6 -2
- data/rakelib/lib/director/ribbon_tool_bar.rb +6 -4
- data/rakelib/lib/director/richtext_composite_object.rb +4 -4
- data/rakelib/lib/director/richtext_paragraph_layout_box.rb +1 -1
- data/rakelib/lib/director/scrolled_t.rb +1 -1
- data/rakelib/lib/director/sizer.rb +7 -0
- data/rakelib/lib/director/sizer_item.rb +4 -1
- data/rakelib/lib/director/splitter_event.rb +2 -2
- data/rakelib/lib/director/task_bar_icon.rb +4 -1
- data/rakelib/lib/director/text_validator.rb +1 -1
- data/rakelib/lib/director/tree_event.rb +3 -3
- data/rakelib/lib/director/validator.rb +1 -1
- data/rakelib/lib/director/variant.rb +2 -2
- data/rakelib/lib/director/window.rb +27 -5
- data/rakelib/lib/director/window_disabler.rb +1 -1
- data/rakelib/lib/director/xml_resource.rb +33 -8
- data/rakelib/lib/extractor/class.rb +2 -1
- data/rakelib/lib/extractor.rb +3 -2
- data/rakelib/lib/generate/interface.rb +2 -3
- data/rakelib/lib/specs/interfaces.rb +7 -0
- data/rakelib/lib/swig_runner.rb +14 -3
- data/rakelib/lib/typemap/common.rb +2 -36
- data/rakelib/lib/typemap/config.rb +22 -0
- data/samples/ribbon/ribbon.rb +277 -20
- data/tests/test_shared_event_handler.rb +3 -3
- metadata +32 -16
- /data/ext/wxruby3/swig/custom/{director.swg → common/director.swg} +0 -0
- /data/ext/wxruby3/swig/custom/{rubyapi.swg → common/rubyapi.swg} +0 -0
- /data/ext/wxruby3/swig/custom/{rubyerrors.swg → common/rubyerrors.swg} +0 -0
- /data/ext/wxruby3/swig/custom/{rubytracking.swg → common/rubytracking.swg} +0 -0
- /data/ext/wxruby3/swig/custom/{swiglabels.swg → common/swiglabels.swg} +0 -0
- /data/ext/wxruby3/swig/custom/{typemaps → common/typemaps}/swigtypemaps.swg +0 -0
- /data/ext/wxruby3/swig/custom/{wx_ruby_shared_ptr.i → common/wx_ruby_shared_ptr.i} +0 -0
- /data/ext/wxruby3/swig/custom/{wx_shared_ptr.i → common/wx_shared_ptr.i} +0 -0
- /data/ext/wxruby3/swig/custom/{rubyhead.swg → untyped_data/rubyhead.swg} +0 -0
- /data/ext/wxruby3/swig/custom/{rubyrun.swg → untyped_data/rubyrun.swg} +0 -0
- /data/ext/wxruby3/swig/custom/{swigrun.swg → untyped_data/swigrun.swg} +0 -0
- /data/rakelib/lib/core/include/{swigrubyrun.inc → untyped_data/swigrubyrun.inc} +0 -0
- /data/rakelib/lib/core/include/{swigrun.inc → untyped_data/swigrun.inc} +0 -0
data/samples/ribbon/ribbon.rb
CHANGED
|
@@ -57,22 +57,101 @@ module Ribbon
|
|
|
57
57
|
SMALL_BUTTON_4
|
|
58
58
|
SMALL_BUTTON_5
|
|
59
59
|
SMALL_BUTTON_6
|
|
60
|
+
BACKSTAGE_INFO
|
|
61
|
+
BACKSTAGE_NEW
|
|
62
|
+
BACKSTAGE_OPEN
|
|
63
|
+
BACKSTAGE_SAVE
|
|
64
|
+
BACKSTAGE_SAVE_AS
|
|
65
|
+
BACKSTAGE_EXIT
|
|
66
|
+
BACKSTAGE_DISCARD
|
|
67
|
+
BACKSTAGE_PROTECT
|
|
68
|
+
BACKSTAGE_TEMPLATE_BLANK
|
|
69
|
+
BACKSTAGE_TEMPLATE_RIBBON
|
|
70
|
+
BACKSTAGE_TEMPLATE_COLOURS
|
|
71
|
+
BACKSTAGE_RECENT_LIST
|
|
72
|
+
BACKSTAGE_FOLDER_LIST
|
|
60
73
|
].each_with_index { |sym, ix| self.const_set(sym, Wx::ID_HIGHEST+1+ix) }
|
|
61
74
|
end
|
|
62
75
|
|
|
76
|
+
# embedded SVG icons
|
|
77
|
+
RibbonSvg = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'>" \
|
|
78
|
+
"<rect x='2' y='4' width='28' height='8' rx='2' fill='#4488CC'/>" \
|
|
79
|
+
"<rect x='2' y='12' width='28' height='16' rx='1' fill='#E0E8F0' stroke='#4488CC'" \
|
|
80
|
+
" stroke-width='0.5'/>" \
|
|
81
|
+
"<rect x='4' y='14' width='8' height='4' rx='1' fill='#4488CC' opacity='0.6'/>" \
|
|
82
|
+
"<rect x='14' y='14' width='8' height='4' rx='1' fill='#4488CC' opacity='0.6'/>" \
|
|
83
|
+
"<rect x='4' y='20' width='6' height='4' rx='1' fill='#4488CC' opacity='0.4'/>" \
|
|
84
|
+
"<rect x='12' y='20' width='6' height='4' rx='1' fill='#4488CC' opacity='0.4'/>" \
|
|
85
|
+
"<rect x='20' y='20' width='6' height='4' rx='1' fill='#4488CC' opacity='0.4'/>" \
|
|
86
|
+
"</svg>"
|
|
87
|
+
|
|
88
|
+
EyeSvg = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'>" \
|
|
89
|
+
"<path d='M16 8C8 8 2 16 2 16s6 8 14 8 14-8 14-8-6-8-14-8z' fill='none' stroke='#555'" \
|
|
90
|
+
" stroke-width='2'/>" \
|
|
91
|
+
"<circle cx='16' cy='16' r='5' fill='#4488CC'/>" \
|
|
92
|
+
"<circle cx='16' cy='16' r='2' fill='#222'/>" \
|
|
93
|
+
"</svg>"
|
|
94
|
+
|
|
95
|
+
EmptySvg = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'>" \
|
|
96
|
+
"<rect x='6' y='2' width='20' height='28' rx='2' fill='#F8F8F8' stroke='#999'" \
|
|
97
|
+
" stroke-width='1'/>" \
|
|
98
|
+
"<path d='M10 8h12M10 13h12M10 18h8' stroke='#DDD' stroke-width='1'/>" \
|
|
99
|
+
"</svg>"
|
|
100
|
+
|
|
101
|
+
ColoursSvg = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'>" \
|
|
102
|
+
"<circle cx='12' cy='10' r='6' fill='#FF4444' opacity='0.8'/>" \
|
|
103
|
+
"<circle cx='20' cy='10' r='6' fill='#44CC44' opacity='0.8'/>" \
|
|
104
|
+
"<circle cx='16' cy='18' r='6' fill='#4444FF' opacity='0.8'/>" \
|
|
105
|
+
"</svg>"
|
|
106
|
+
|
|
107
|
+
PdfSvg = %q{<svg xmlns="http://www.w3.org/2000/svg" width="75.320129mm" height="92.604164mm" viewBox="0 0 75.320129 92.604164">
|
|
108
|
+
<g transform="translate(53.548057 -183.975276) scale(1.4843)">
|
|
109
|
+
<path fill="#ff2116" d="M-29.632812 123.94727c-3.551967 0-6.44336 2.89347-6.44336 6.44531v49.49804c0 3.55185 2.891393 6.44532 6.44336 6.44532H8.2167969c3.5519661 0 6.4433591-2.89335 6.4433591-6.44532v-40.70117s.101353-1.19181-.416015-2.35156c-.484969-1.08711-1.275391-1.84375-1.275391-1.84375a1.0584391 1.0584391 0 0 0-.0059-.008l-9.3906254-9.21094a1.0584391 1.0584391 0 0 0-.015625-.0156s-.8017392-.76344-1.9902344-1.27344c-1.39939552-.6005-2.8417968-.53711-2.8417968-.53711l.021484-.002z" color="#000" font-family="sans-serif" overflow="visible" paint-order="markers fill stroke" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;isolation:auto;mix-blend-mode:normal;solid-color:#000000;solid-opacity:1"/>
|
|
110
|
+
<path fill="#f5f5f5" d="M-29.632812 126.06445h28.3789058a1.0584391 1.0584391 0 0 0 .021484 0s1.13480448.011 1.96484378.36719c.79889772.34282 1.36536982.86176 1.36914062.86524.0000125.00001.00391.004.00391.004l9.3671868 9.18945s.564354.59582.837891 1.20899c.220779.49491.234375 1.40039.234375 1.40039a1.0584391 1.0584391 0 0 0-.002.0449v40.74609c0 2.41592-1.910258 4.32813-4.3261717 4.32813H-29.632812c-2.415914 0-4.326172-1.91209-4.326172-4.32813v-49.49804c0-2.41603 1.910258-4.32813 4.326172-4.32813z" color="#000" font-family="sans-serif" overflow="visible" paint-order="markers fill stroke" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;isolation:auto;mix-blend-mode:normal;solid-color:#000000;solid-opacity:1"/>
|
|
111
|
+
<path fill="#ff2116" d="M-23.40766 161.09299c-1.45669-1.45669.11934-3.45839 4.39648-5.58397l2.69124-1.33743 1.04845-2.29399c.57665-1.26169 1.43729-3.32036 1.91254-4.5748l.8641-2.28082-.59546-1.68793c-.73217-2.07547-.99326-5.19438-.52872-6.31588.62923-1.51909 2.69029-1.36323 3.50626.26515.63727 1.27176.57212 3.57488-.18329 6.47946l-.6193 2.38125.5455.92604c.30003.50932 1.1764 1.71867 1.9475 2.68743l1.44924 1.80272 1.8033728-.23533c5.72900399-.74758 7.6912472.523 7.6912472 2.34476 0 2.29921-4.4984914 2.48899-8.2760865-.16423-.8499666-.59698-1.4336605-1.19001-1.4336605-1.19001s-2.3665326.48178-3.531704.79583c-1.202707.32417-1.80274.52719-3.564509 1.12186 0 0-.61814.89767-1.02094 1.55026-1.49858 2.4279-3.24833 4.43998-4.49793 5.1723-1.3991.81993-2.86584.87582-3.60433.13733zm2.28605-.81668c.81883-.50607 2.47616-2.46625 3.62341-4.28553l.46449-.73658-2.11497 1.06339c-3.26655 1.64239-4.76093 3.19033-3.98386 4.12664.43653.52598.95874.48237 2.01093-.16792zm21.21809-5.95578c.80089-.56097.68463-1.69142-.22082-2.1472-.70466-.35471-1.2726074-.42759-3.1031574-.40057-1.1249.0767-2.9337647.3034-3.2403347.37237 0 0 .993716.68678 1.434896.93922.58731.33544 2.0145161.95811 3.0565161 1.27706 1.02785.31461 1.6224.28144 2.0729-.0409zm-8.53152-3.54594c-.4847-.50952-1.30889-1.57296-1.83152-2.3632-.68353-.89643-1.02629-1.52887-1.02629-1.52887s-.4996 1.60694-.90948 2.57394l-1.27876 3.16076-.37075.71695s1.971043-.64627 2.97389-.90822c1.0621668-.27744 3.21787-.70134 3.21787-.70134zm-2.74938-11.02573c.12363-1.0375.1761-2.07346-.15724-2.59587-.9246-1.01077-2.04057-.16787-1.85154 2.23517.0636.8084.26443 2.19033.53292 3.04209l.48817 1.54863.34358-1.16638c.18897-.64151.47882-2.02015.64411-3.06364z"/>
|
|
112
|
+
<path fill="#2c2c2c" d="M-20.930423 167.83862h2.364986q1.133514 0 1.840213.2169.706698.20991 1.189489.9446.482795.72769.482795 1.75625 0 .94459-.391832 1.6233-.391833.67871-1.056548.97958-.65772.30087-2.02913.30087h-.818651v3.72941h-1.581322zm1.581322 1.22447v3.33058h.783664q1.049552 0 1.44838-.39184.405826-.39183.405826-1.27345 0-.65772-.265887-1.06355-.265884-.41282-.587747-.50378-.314866-.098-1.000572-.098zm5.50664-1.22447h2.148082q1.560333 0 2.4909318.55276.9375993.55276 1.4133973 1.6443.482791 1.09153.482791 2.42096 0 1.3994-.4338151 2.49793-.4268149 1.09153-1.3154348 1.76324-.8816233.67172-2.5189212.67172h-2.267031zm1.581326 1.26645v7.018h.657715q1.378411 0 2.001144-.9516.6227329-.95858.6227329-2.5539 0-3.5125-2.6238769-3.5125zm6.4722254-1.26645h5.30372941v1.26645H-4.2075842v2.85478h2.9807225v1.26646h-2.9807225v4.16322h-1.5813254z" font-family="Franklin Gothic Medium Cond" letter-spacing="0" style="line-height:125%;-inkscape-font-specification:'Franklin Gothic Medium Cond'" word-spacing="4.26000023"/>
|
|
113
|
+
</g>
|
|
114
|
+
</svg>}
|
|
115
|
+
|
|
116
|
+
OdsSvg = %q{<svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 550.801 550.801" xml:space="preserve"><g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
|
117
|
+
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g>
|
|
118
|
+
<path d="M488.426,197.021H475.2v-63.825c0-0.398-0.063-0.799-0.116-1.203c-0.021-2.533-0.827-5.022-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.074c-0.633-0.709-1.371-1.297-2.151-1.803c-0.231-0.158-0.464-0.288-0.706-0.422 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.695-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.832,505.47,197.021,488.426,197.021z M97.2,21.601 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.601z M358.773,297.496c0,27.791-10.125,46.955-24.131,58.81 c-15.304,12.72-38.555,18.736-67.002,18.736c-17.004,0-29.072-1.07-37.26-2.146V230.283c12.058-1.938,27.789-3.029,44.376-3.029 c27.58,0,45.457,4.946,59.453,15.504C349.292,253.975,358.773,271.838,358.773,297.496z M69.225,302.01 c0-43.516,27.789-76.04,70.659-76.04c44.587,0,68.929,33.394,68.929,73.451c0,47.614-28.861,76.486-71.307,76.486 C94.427,375.907,69.225,343.364,69.225,302.01z M453.601,523.347H97.2V419.302h356.4V523.347z M415.885,375.706 c-16.58,0-32.964-4.329-41.144-8.854l6.666-27.143c8.849,4.535,22.412,9.049,36.407,9.049c15.088,0,23.066-6.238,23.066-15.72 c0-9.055-6.897-14.223-24.353-20.461c-24.121-8.4-39.856-21.758-39.856-42.873c0-24.777,20.682-43.73,54.938-43.73 c16.368,0,28.435,3.438,37.051,7.317l-7.319,26.491c-5.822-2.795-16.158-6.885-30.386-6.885c-14.217,0-21.114,6.465-21.114,14.02 c0,9.252,8.2,13.345,26.947,20.453c25.629,9.471,37.688,22.834,37.688,43.306C474.478,355.003,455.741,375.706,415.885,375.706z"></path>
|
|
119
|
+
<path d="M278.198,252.474c-7.322,0-12.063,0.63-14.866,1.284v94.996c2.803,0.654,7.333,0.654,11.42,0.654 c29.736,0.221,49.122-16.158,49.122-50.847C324.096,268.408,306.424,252.474,278.198,252.474z"></path>
|
|
120
|
+
<path d="M174.135,300.513c0-26.067-12.49-48.481-35.121-48.481c-22.188,0-35.111,21.112-35.111,49.336 c0,28.439,13.36,48.468,35.327,48.468C161.418,349.835,174.135,328.726,174.135,300.513z"></path> </g>
|
|
121
|
+
</g>
|
|
122
|
+
</svg>}
|
|
123
|
+
|
|
124
|
+
TxtSvg = %q{<svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 548.291 548.291" xml:space="preserve"><g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
|
125
|
+
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g>
|
|
126
|
+
<path d="M486.201,196.124h-13.166V132.59c0-0.396-0.062-0.795-0.115-1.196c-0.021-2.523-0.825-5-2.552-6.963L364.657,3.677 c-0.033-0.031-0.064-0.042-0.085-0.075c-0.63-0.704-1.364-1.29-2.143-1.796c-0.229-0.154-0.461-0.283-0.702-0.418 c-0.672-0.366-1.387-0.671-2.121-0.892c-0.2-0.055-0.379-0.134-0.577-0.188C358.23,0.118,357.401,0,356.562,0H96.757 C84.894,0,75.256,9.649,75.256,21.502v174.616H62.09c-16.968,0-30.729,13.753-30.729,30.73v159.812 c0,16.961,13.761,30.731,30.729,30.731h13.166V526.79c0,11.854,9.638,21.501,21.501,21.501h354.776 c11.853,0,21.501-9.647,21.501-21.501V417.392h13.166c16.966,0,30.729-13.764,30.729-30.731V226.854 C516.93,209.872,503.167,196.124,486.201,196.124z M96.757,21.502h249.054v110.006c0,5.943,4.817,10.751,10.751,10.751h94.972 v53.864H96.757V21.502z M202.814,225.042h41.68l14.063,29.3c4.756,9.756,8.336,17.622,12.147,26.676h0.48 c3.798-10.242,6.9-17.392,10.95-26.676l13.587-29.3h41.449l-45.261,78.363l47.638,82.185h-41.927l-14.525-29.06 c-5.956-11.197-9.771-19.528-14.299-28.825h-0.478c-3.334,9.297-7.381,17.628-12.381,28.825l-13.336,29.06h-41.455l46.455-81.224 L202.814,225.042z M66.08,255.532v-30.489h123.382v30.489h-43.828v130.049h-36.434V255.532H66.08z M451.534,520.962H96.757v-103.57 h354.776V520.962z M471.764,255.532h-43.831v130.049h-36.442V255.532h-43.119v-30.489h123.393V255.532z"></path>
|
|
127
|
+
</g> </g>
|
|
128
|
+
</svg>}
|
|
129
|
+
|
|
63
130
|
def initialize
|
|
64
131
|
super(nil, Wx::ID_ANY, "wxRibbon Sample Application", size: [800, 600], style: Wx::DEFAULT_FRAME_STYLE)
|
|
65
132
|
|
|
66
133
|
self.icon = Wx.Icon(:sample, Wx::BITMAP_TYPE_XPM, art_path: File.join(__dir__, '..'))
|
|
67
134
|
|
|
135
|
+
@panel = Wx::Panel.new(self)
|
|
136
|
+
|
|
68
137
|
@colour_data = Wx::ColourData.new
|
|
69
|
-
@ribbon = Wx::RBN::RibbonBar.new(
|
|
138
|
+
@ribbon = Wx::RBN::RibbonBar.new(@panel, Wx::ID_ANY,
|
|
70
139
|
style: Wx::RBN::RIBBON_BAR_FLOW_HORIZONTAL |
|
|
71
140
|
Wx::RBN::RIBBON_BAR_SHOW_PAGE_LABELS |
|
|
72
141
|
Wx::RBN::RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS |
|
|
73
142
|
Wx::RBN::RIBBON_BAR_SHOW_TOGGLE_BUTTON |
|
|
74
143
|
Wx::RBN::RIBBON_BAR_SHOW_HELP_BUTTON)
|
|
75
144
|
|
|
145
|
+
# Reusable bitmap bundles for the generic ribbon and empty-page icons.
|
|
146
|
+
@ribbon_small = make_svg_bundle(RibbonSvg, [16, 16])
|
|
147
|
+
@ribbon_large = make_svg_bundle(RibbonSvg, [32, 32])
|
|
148
|
+
@empty_small = make_svg_bundle(EmptySvg, [16, 16])
|
|
149
|
+
|
|
150
|
+
# The File tab shows the backstage.
|
|
151
|
+
file = Wx::RBN::RibbonPage.new(@ribbon, Wx::ID_ANY, 'File')
|
|
152
|
+
@ribbon.set_backstage_page(file)
|
|
153
|
+
@ribbon.set_page_key_tip(file, 'F')
|
|
154
|
+
|
|
76
155
|
home = Wx::RBN::RibbonPage.new(@ribbon, Wx::ID_ANY, "Examples", bitmap_(:ribbon_xpm))
|
|
77
156
|
toolbar_panel = Wx::RBN::RibbonPanel.new(home, Wx::ID_ANY, "Toolbar",
|
|
78
157
|
style: Wx::RBN::RIBBON_PANEL_NO_AUTO_MINIMISE |
|
|
@@ -184,8 +263,8 @@ module Ribbon
|
|
|
184
263
|
@default_secondary, ID::SECONDARY_COLOUR)
|
|
185
264
|
|
|
186
265
|
page = Wx::RBN::RibbonPage.new(@ribbon, Wx::ID_ANY, "UI Updated", bitmap_(:ribbon_xpm))
|
|
187
|
-
|
|
188
|
-
bar = Wx::RBN::RibbonButtonBar.new(
|
|
266
|
+
button_panel = Wx::RBN::RibbonPanel.new(page, Wx::ID_ANY, "Enable/Disable", bitmap_(:ribbon_xpm))
|
|
267
|
+
bar = Wx::RBN::RibbonButtonBar.new(button_panel, Wx::ID_ANY)
|
|
189
268
|
bar.add_button(ID::DISABLED, "Disabled", bitmap_(:ribbon_xpm))
|
|
190
269
|
bar.add_button(ID::ENABLE, "Enable", bitmap_(:ribbon_xpm))
|
|
191
270
|
bar.add_button(ID::DISABLE, "Disable", bitmap_(:ribbon_xpm))
|
|
@@ -193,14 +272,14 @@ module Ribbon
|
|
|
193
272
|
bar.enable_button(ID::DISABLED, false)
|
|
194
273
|
@bEnabled = true
|
|
195
274
|
|
|
196
|
-
|
|
197
|
-
bar = Wx::RBN::RibbonButtonBar.new(
|
|
275
|
+
button_panel = Wx::RBN::RibbonPanel.new(page, Wx::ID_ANY, "Toggle", bitmap_(:ribbon_xpm))
|
|
276
|
+
bar = Wx::RBN::RibbonButtonBar.new(button_panel, Wx::ID_ANY)
|
|
198
277
|
bar.add_button(ID::CHECK, "Toggle", bitmap_(:ribbon_xpm))
|
|
199
278
|
bar.add_toggle_button(ID::UI_CHECK_UPDATED, "Toggled UI updated", bitmap_(:ribbon_xpm))
|
|
200
279
|
@bChecked = true
|
|
201
280
|
|
|
202
|
-
|
|
203
|
-
bar = Wx::RBN::RibbonButtonBar.new(
|
|
281
|
+
button_panel = Wx::RBN::RibbonPanel.new(page, Wx::ID_ANY, "Change text", bitmap_(:ribbon_xpm))
|
|
282
|
+
bar = Wx::RBN::RibbonButtonBar.new(button_panel, Wx::ID_ANY)
|
|
204
283
|
bar.add_button(ID::CHANGE_TEXT1, "One", bitmap_(:ribbon_xpm))
|
|
205
284
|
bar.add_button(ID::CHANGE_TEXT2, "Two", bitmap_(:ribbon_xpm))
|
|
206
285
|
bar.add_button(ID::UI_CHANGE_TEXT_UPDATED, "Zero", bitmap_(:ribbon_xpm))
|
|
@@ -213,14 +292,14 @@ module Ribbon
|
|
|
213
292
|
Wx::RBN::RibbonPage.new(@ribbon, Wx::ID_ANY, "Empty Page", bitmap_(:empty_xpm))
|
|
214
293
|
|
|
215
294
|
page = Wx::RBN::RibbonPage.new(@ribbon, Wx::ID_ANY, "Another Page", bitmap_(:empty_xpm))
|
|
216
|
-
|
|
217
|
-
bar = Wx::RBN::RibbonButtonBar.new(
|
|
295
|
+
button_panel = Wx::RBN::RibbonPanel.new(page, Wx::ID_ANY, "Page manipulation", bitmap_(:ribbon_xpm))
|
|
296
|
+
bar = Wx::RBN::RibbonButtonBar.new(button_panel, Wx::ID_ANY)
|
|
218
297
|
bar.add_button(ID::REMOVE_PAGE, "Remove", Wx::ArtProvider.get_bitmap(Wx::ART_DELETE, Wx::ART_OTHER, Wx::Size.new(24, 24)))
|
|
219
298
|
bar.add_button(ID::HIDE_PAGES, "Hide Pages", bitmap_(:ribbon_xpm))
|
|
220
299
|
bar.add_button(ID::SHOW_PAGES, "Show Pages", bitmap_(:ribbon_xpm))
|
|
221
300
|
|
|
222
|
-
|
|
223
|
-
button_bar = Wx::RBN::RibbonButtonBar.new(
|
|
301
|
+
button_panel = Wx::RBN::RibbonPanel.new(page, Wx::ID_ANY, "Button bar manipulation", bitmap_(:ribbon_xpm))
|
|
302
|
+
button_bar = Wx::RBN::RibbonButtonBar.new(button_panel, Wx::ID_ANY)
|
|
224
303
|
button_bar.add_button(ID::PLUS_MINUS, "+/-",
|
|
225
304
|
Wx::ArtProvider.get_bitmap(Wx::ART_PLUS, Wx::ART_OTHER, Wx::Size.new(24, 24)))
|
|
226
305
|
@plus_minus_state = false
|
|
@@ -228,8 +307,8 @@ module Ribbon
|
|
|
228
307
|
button_bar.set_button_text_min_width(ID::CHANGE_LABEL, "some long text")
|
|
229
308
|
@change_label_state = false
|
|
230
309
|
|
|
231
|
-
|
|
232
|
-
bar = Wx::RBN::RibbonButtonBar.new(
|
|
310
|
+
button_panel = Wx::RBN::RibbonPanel.new(page, Wx::ID_ANY, "Always medium buttons", bitmap_(:ribbon_xpm))
|
|
311
|
+
bar = Wx::RBN::RibbonButtonBar.new(button_panel, Wx::ID_ANY)
|
|
233
312
|
bar.add_button(ID::SMALL_BUTTON_1, "Button 1", bitmap_(:ribbon_xpm))
|
|
234
313
|
bar.set_button_max_size_class(ID::SMALL_BUTTON_1, Wx::RBN::RIBBON_BUTTONBAR_BUTTON_MEDIUM)
|
|
235
314
|
bar.add_button(ID::SMALL_BUTTON_2, "Button 2", bitmap_(:ribbon_xpm))
|
|
@@ -246,8 +325,8 @@ module Ribbon
|
|
|
246
325
|
|
|
247
326
|
|
|
248
327
|
page = Wx::RBN::RibbonPage.new(@ribbon, Wx::ID_ANY, "Advanced", bitmap_(:empty_xpm))
|
|
249
|
-
|
|
250
|
-
button_bar = Wx::RBN::RibbonButtonBar.new(
|
|
328
|
+
button_panel = Wx::RBN::RibbonPanel.new(page, Wx::ID_ANY, "Button bar manipulation", bitmap_(:ribbon_xpm))
|
|
329
|
+
button_bar = Wx::RBN::RibbonButtonBar.new(button_panel, Wx::ID_ANY)
|
|
251
330
|
button_bar.add_button(ID::PLUS_MINUS, "+/-",
|
|
252
331
|
Wx::ArtProvider.get_bitmap(Wx::ART_PLUS, Wx::ART_OTHER, Wx::Size.new(24, 24)))
|
|
253
332
|
@plus_minus_state = false
|
|
@@ -255,8 +334,8 @@ module Ribbon
|
|
|
255
334
|
button_bar.set_button_text_min_width(ID::CHANGE_LABEL, "some long text")
|
|
256
335
|
@change_label_state = false
|
|
257
336
|
|
|
258
|
-
|
|
259
|
-
bar = Wx::RBN::RibbonButtonBar.new(
|
|
337
|
+
button_panel = Wx::RBN::RibbonPanel.new(page, Wx::ID_ANY, "Always medium buttons", bitmap_(:ribbon_xpm))
|
|
338
|
+
bar = Wx::RBN::RibbonButtonBar.new(button_panel, Wx::ID_ANY)
|
|
260
339
|
bar.add_button(ID::SMALL_BUTTON_1, "Button 1", bitmap_(:ribbon_xpm))
|
|
261
340
|
bar.set_button_max_size_class(ID::SMALL_BUTTON_1, Wx::RBN::RIBBON_BUTTONBAR_BUTTON_MEDIUM)
|
|
262
341
|
bar.add_button(ID::SMALL_BUTTON_2, "Button 2", bitmap_(:ribbon_xpm))
|
|
@@ -270,19 +349,31 @@ module Ribbon
|
|
|
270
349
|
|
|
271
350
|
@ribbon.realize
|
|
272
351
|
|
|
273
|
-
@logwindow = Wx::TextCtrl.new(
|
|
352
|
+
@logwindow = Wx::TextCtrl.new(@panel, Wx::ID_ANY, style: Wx::TE_MULTILINE | Wx::TE_READONLY |
|
|
274
353
|
Wx::TE_LEFT | Wx::TE_BESTWRAP | Wx::BORDER_NONE)
|
|
275
354
|
|
|
276
|
-
@togglePanels = Wx::ToggleButton.new(
|
|
355
|
+
@togglePanels = Wx::ToggleButton.new(@panel, ID::TOGGLE_PANELS, "&Toggle panels")
|
|
277
356
|
@togglePanels.set_value(true)
|
|
278
357
|
|
|
279
358
|
s = Wx::BoxSizer.new(Wx::VERTICAL)
|
|
280
359
|
|
|
281
360
|
s.add(@ribbon, 0, Wx::EXPAND)
|
|
282
361
|
s.add(@logwindow, 1, Wx::EXPAND)
|
|
362
|
+
|
|
363
|
+
# The backstage takes the place of the log window while the File tab is selected.
|
|
364
|
+
create_backstage
|
|
365
|
+
@backstage.hide
|
|
366
|
+
s.add(@backstage, Wx::SizerFlags.new(1).expand)
|
|
367
|
+
|
|
283
368
|
s.add(@togglePanels, Wx::SizerFlags.new.border)
|
|
284
369
|
|
|
285
|
-
set_sizer(s)
|
|
370
|
+
@panel.set_sizer(s)
|
|
371
|
+
|
|
372
|
+
frameSizer = Wx::VBoxSizer.new
|
|
373
|
+
frameSizer.add(@panel, Wx::SizerFlags.new(1).expand)
|
|
374
|
+
set_sizer(frameSizer)
|
|
375
|
+
|
|
376
|
+
@ribbon.set_backstage(@backstage, @logwindow)
|
|
286
377
|
|
|
287
378
|
evt_ribbonbuttonbar_clicked(ID::ENABLE, :on_enable)
|
|
288
379
|
evt_ribbonbuttonbar_clicked(ID::DISABLE, :on_disable)
|
|
@@ -351,6 +442,172 @@ module Ribbon
|
|
|
351
442
|
Wx::Bitmap.new(File.join(File.dirname(__FILE__), bitmap_name.to_s.sub(/_([A-Za-z]+)\Z/, '.\1')))
|
|
352
443
|
end
|
|
353
444
|
|
|
445
|
+
# Helper to create a bitmap bundle from embedded SVG data. When wxHAS_SVG is
|
|
446
|
+
# available, the SVG is rasterized at any requested size for DPI-aware display.
|
|
447
|
+
# Falls back to wxArtProvider to guarantee the returned bundle is never empty,
|
|
448
|
+
# which prevents wxASSERT failures in AddTool/AddButton.
|
|
449
|
+
def make_svg_bundle(svg_data, size, fallback = Wx::ART_QUESTION)
|
|
450
|
+
if Wx.has_feature?(:USE_SVG)
|
|
451
|
+
bundle = Wx::BitmapBundle::from_svg(svg_data, size)
|
|
452
|
+
return bundle if bundle.ok?
|
|
453
|
+
else
|
|
454
|
+
# noop
|
|
455
|
+
end # USE_SVG
|
|
456
|
+
Wx::ArtProvider::get_bitmap_bundle(fallback, Wx::ART_OTHER, size)
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
def create_backstage
|
|
460
|
+
@backstage = Wx::RBN::Backstage.new(@panel)
|
|
461
|
+
|
|
462
|
+
@backstage.add_button(ID::BACKSTAGE_INFO, "Info")
|
|
463
|
+
@backstage.add_button(ID::BACKSTAGE_NEW, "New")
|
|
464
|
+
@backstage.add_button(ID::BACKSTAGE_OPEN, "Open")
|
|
465
|
+
@backstage.add_button(ID::BACKSTAGE_SAVE, "Save")
|
|
466
|
+
@backstage.add_button(ID::BACKSTAGE_SAVE_AS, "Save As")
|
|
467
|
+
@backstage.add_separator
|
|
468
|
+
@backstage.add_flexible_space
|
|
469
|
+
@backstage.add_button(ID::BACKSTAGE_EXIT, "Exit")
|
|
470
|
+
|
|
471
|
+
# Save and Exit have no page, so they are just actions.
|
|
472
|
+
margin = from_dip(30)
|
|
473
|
+
|
|
474
|
+
page = @backstage.add_page(ID::BACKSTAGE_INFO)
|
|
475
|
+
sizer = Wx::VBoxSizer.new
|
|
476
|
+
sizer.add(Wx::RBN::BackstageHeading.new(page, Wx::ID_ANY, 'Information'),
|
|
477
|
+
Wx::SizerFlags.new.border(Wx::LEFT | Wx::TOP, margin))
|
|
478
|
+
|
|
479
|
+
callout = Wx::BackstageCallout.new(page, Wx::ID_ANY,
|
|
480
|
+
'Checked Out Document',
|
|
481
|
+
"No one else can edit this document or view your changes\n" +
|
|
482
|
+
'until it is checked in.')
|
|
483
|
+
callout.set_action(Wx::RBN::BackstageButton.new(callout, ID::BACKSTAGE_DISCARD,
|
|
484
|
+
'Discard Check Out', Wx::BitmapBundle.new,
|
|
485
|
+
Wx::RBN::BackstageButtonStyle::Wide))
|
|
486
|
+
sizer.add(callout, Wx::SizerFlags.new.expand.border(Wx::LEFT | Wx::RIGHT | Wx::TOP, margin))
|
|
487
|
+
|
|
488
|
+
protect = Wx::RBN::BackstageButton.new(page, ID::BACKSTAGE_PROTECT,
|
|
489
|
+
'Protect Document', Wx::BitmapBundle.new,
|
|
490
|
+
Wx::RBN::BackstageButtonStyle::Wide,
|
|
491
|
+
'Control what types of changes people can make')
|
|
492
|
+
protect.show_drop_down_arrow
|
|
493
|
+
sizer.add(protect, Wx::SizerFlags.new.border(Wx::LEFT | Wx::TOP, margin))
|
|
494
|
+
page.set_sizer(sizer)
|
|
495
|
+
|
|
496
|
+
page = @backstage.add_page(ID::BACKSTAGE_NEW)
|
|
497
|
+
sizer = Wx::VBoxSizer.new
|
|
498
|
+
sizer.add(Wx::RBN::BackstageHeading.new(page, Wx::ID_ANY, 'New'),
|
|
499
|
+
Wx::SizerFlags.new.border(Wx::LEFT | Wx::TOP, margin))
|
|
500
|
+
sizer.add(Wx::RBN::BackstageHeading.new(page, Wx::ID_ANY, 'Featured',
|
|
501
|
+
Wx::RBN::BackstageHeadingStyle::Section),
|
|
502
|
+
Wx::SizerFlags.new.border(Wx::LEFT | Wx::TOP, margin))
|
|
503
|
+
|
|
504
|
+
# Wx::REMOVE_LEADING_SPACES keeps the last card on a row from being stretched
|
|
505
|
+
cards = Wx::WrapSizer.new(Wx::HORIZONTAL, Wx::REMOVE_LEADING_SPACES)
|
|
506
|
+
cardFlags = Wx::SizerFlags.new.border(Wx::RIGHT | Wx::TOP, from_dip(16))
|
|
507
|
+
[
|
|
508
|
+
{ id: ID::BACKSTAGE_TEMPLATE_BLANK, label: "Blank Document", svg: EmptySvg },
|
|
509
|
+
{ id: ID::BACKSTAGE_TEMPLATE_RIBBON, label: "Ribbon Layout", svg: RibbonSvg },
|
|
510
|
+
{ id: ID::BACKSTAGE_TEMPLATE_COLOURS, label: "Colour Study", svg: ColoursSvg }
|
|
511
|
+
].each do |tmpl|
|
|
512
|
+
cards.add(Wx::RBN::BackstageButton.new(page, tmpl[:id], tmpl[:label],
|
|
513
|
+
make_svg_bundle(tmpl[:svg], [64, 64]),
|
|
514
|
+
Wx::RBN::BackstageButtonStyle::Card),
|
|
515
|
+
cardFlags)
|
|
516
|
+
end
|
|
517
|
+
sizer.add(cards, Wx::SizerFlags.new(1).expand.border(Wx::LEFT | Wx::RIGHT, margin))
|
|
518
|
+
page.set_sizer(sizer)
|
|
519
|
+
|
|
520
|
+
page = @backstage.add_page(ID::BACKSTAGE_OPEN)
|
|
521
|
+
sizer = Wx::VBoxSizer.new
|
|
522
|
+
sizer.add(Wx::RBN::BackstageHeading.new(page, Wx::ID_ANY, 'Open'),
|
|
523
|
+
Wx::SizerFlags.new.border(Wx::LEFT | Wx::TOP, margin))
|
|
524
|
+
|
|
525
|
+
# The list sorts by modified date and groups the files into sections
|
|
526
|
+
# ("Today", "Yesterday", ...). The files here don't need to exist.
|
|
527
|
+
recent = Wx::RBN::BackstageMRUList.new(page, ID::BACKSTAGE_RECENT_LIST)
|
|
528
|
+
recent.set_empty_text("You haven't opened any files recently.")
|
|
529
|
+
now = Time::now
|
|
530
|
+
recent.add_file("/Documents/Marketing Proposal.pdf", now - (12 * 60))
|
|
531
|
+
recent.add_file("/Documents/Invoices/March.txt", now - (5 * 60 * 60))
|
|
532
|
+
recent.add_file("/Documents/Notes.txt", now - (24 * 60 * 60))
|
|
533
|
+
recent.add_file("/Documents/Reports/Q1.ods", now - (4 * 24 * 60 * 60))
|
|
534
|
+
recent.add_file("/Documents/Old/Archive.txt", now - (40 * 24 * 60 * 60))
|
|
535
|
+
recent.set_min_size(from_dip([560, 340].to_size))
|
|
536
|
+
recent.set_icon_provider do |path|
|
|
537
|
+
case File.extname(path)
|
|
538
|
+
when '.pdf'
|
|
539
|
+
make_svg_bundle(PdfSvg, [16, 16])
|
|
540
|
+
when '.ods'
|
|
541
|
+
make_svg_bundle(OdsSvg, [16, 16])
|
|
542
|
+
else
|
|
543
|
+
make_svg_bundle(TxtSvg, [16, 16])
|
|
544
|
+
end
|
|
545
|
+
end
|
|
546
|
+
sizer.add(recent, Wx::SizerFlags.new(1).expand.border(Wx::ALL, margin))
|
|
547
|
+
page.set_sizer(sizer)
|
|
548
|
+
|
|
549
|
+
page = @backstage.add_page(ID::BACKSTAGE_SAVE_AS)
|
|
550
|
+
sizer = Wx::VBoxSizer.new
|
|
551
|
+
sizer.add(Wx::RBN::BackstageHeading.new(page, Wx::ID_ANY, 'Save As'),
|
|
552
|
+
Wx::SizerFlags.new.border(Wx::LEFT | Wx::TOP, margin))
|
|
553
|
+
|
|
554
|
+
folders = Wx::RBN::BackstageItemList.new(page, ID::BACKSTAGE_FOLDER_LIST)
|
|
555
|
+
folders.add_header('Current Folder')
|
|
556
|
+
folderSeparator = " » "
|
|
557
|
+
folders.add_item('Marketing', 'Documents' + folderSeparator + 'Marketing', '',
|
|
558
|
+
Wx::BitmapBundle.new, '/Documents/Marketing')
|
|
559
|
+
folders.add_header('Recent')
|
|
560
|
+
folders.add_item('Reports', 'Documents' + folderSeparator + 'Reports', '',
|
|
561
|
+
Wx::BitmapBundle.new, '/Documents/Reports')
|
|
562
|
+
folders.add_item('Downloads', '', '',
|
|
563
|
+
Wx::BitmapBundle.new, '/Downloads')
|
|
564
|
+
folders.set_min_size(from_dip([380, 340].to_size))
|
|
565
|
+
sizer.add(folders, Wx::SizerFlags.new(1).expand.border(Wx::ALL, margin))
|
|
566
|
+
page.set_sizer(sizer)
|
|
567
|
+
|
|
568
|
+
evt_backstage_clicked Wx::ID_ANY, :on_backstage_clicked
|
|
569
|
+
evt_backstage_item_clicked Wx::ID_ANY, :on_backstage_item_clicked
|
|
570
|
+
connect(ID::BACKSTAGE_DISCARD, ID::BACKSTAGE_TEMPLATE_COLOURS, Wx::EVT_BUTTON, self.method(:on_backstage_button))
|
|
571
|
+
|
|
572
|
+
end
|
|
573
|
+
|
|
574
|
+
def on_backstage_clicked(evt)
|
|
575
|
+
# A button with a page shows it after this returns, unless evt.Veto() is called.
|
|
576
|
+
case evt.id
|
|
577
|
+
when ID::BACKSTAGE_SAVE
|
|
578
|
+
Wx::message_box("The \"#{evt.string}\" button was clicked.",
|
|
579
|
+
'Backstage Button', Wx::OK | Wx::ICON_INFORMATION, self)
|
|
580
|
+
|
|
581
|
+
when ID::BACKSTAGE_EXIT
|
|
582
|
+
close(true)
|
|
583
|
+
end
|
|
584
|
+
end
|
|
585
|
+
|
|
586
|
+
def on_backstage_item_clicked(evt)
|
|
587
|
+
# GetId() is the ID of the list, GetInt() is the index of the item, and
|
|
588
|
+
# GetString() is its user string (here it's the path).
|
|
589
|
+
Wx::message_box("Item #%d of list %d was clicked:\n%s" % [evt.int, evt.id, evt.string],
|
|
590
|
+
evt.id == ID::BACKSTAGE_RECENT_LIST ? 'Open Recent File'
|
|
591
|
+
: 'Save To Folder',
|
|
592
|
+
Wx::OK | Wx::ICON_INFORMATION, self)
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
def on_backstage_button(evt)
|
|
596
|
+
if evt.id == ID::BACKSTAGE_PROTECT
|
|
597
|
+
menu = Wx::Menu.new
|
|
598
|
+
choices = ["Mark as Final", "Encrypt with Password", "Restrict Access"]
|
|
599
|
+
choices.each do |choice|
|
|
600
|
+
item = menu.append(Wx::ID_ANY, choice)
|
|
601
|
+
menu.evt_menu(item) { Wx::message_box("\"#{choice}\" was chosen.", 'Protect Document', Wx::OK | Wx::ICON_INFORMATION) }
|
|
602
|
+
end
|
|
603
|
+
evt.event_object.popup_menu(menu, 0, evt.event_object.size.height) if evt.event_object.is_a?(Wx::Window)
|
|
604
|
+
return
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
Wx::message_box("The button \"%s\" (ID %d) was clicked." % [evt.string, evt.id],
|
|
608
|
+
'Backstage Page Button', Wx::OK | Wx::ICON_INFORMATION, self)
|
|
609
|
+
end
|
|
610
|
+
|
|
354
611
|
def on_enable_update_ui(evt)
|
|
355
612
|
evt.enable(@bEnabled)
|
|
356
613
|
end
|
|
@@ -43,7 +43,7 @@ class WindowTests < WxRuby::Test::GUITests
|
|
|
43
43
|
r.monitor(pmon)
|
|
44
44
|
assert_equal(Wx::RT::SharedEvtHandler, pin.receive)
|
|
45
45
|
assert_true(pin.receive)
|
|
46
|
-
assert_equal(:exited, pmon.receive)
|
|
46
|
+
assert_equal(:exited, [pmon.receive].flatten.last)
|
|
47
47
|
else
|
|
48
48
|
seh = frame_win.make_shared
|
|
49
49
|
r = Ractor.new(seh) do |seh_|
|
|
@@ -77,7 +77,7 @@ class WindowTests < WxRuby::Test::GUITests
|
|
|
77
77
|
yield_and_wait_for_test(3000) { data_sent }
|
|
78
78
|
assert_not_nil(data_sent)
|
|
79
79
|
assert_equal(data_sent, pin.receive)
|
|
80
|
-
|
|
80
|
+
assert_equal(:exited, [pmon.receive].flatten.last)
|
|
81
81
|
else
|
|
82
82
|
seh = frame_win.make_shared
|
|
83
83
|
data_sent = nil
|
|
@@ -117,7 +117,7 @@ class WindowTests < WxRuby::Test::GUITests
|
|
|
117
117
|
yield_and_wait_for_test(3000) { data_sent }
|
|
118
118
|
assert_not_nil(data_sent)
|
|
119
119
|
assert_equal(data_sent, pin.receive)
|
|
120
|
-
assert_equal(:exited, pmon.receive)
|
|
120
|
+
assert_equal(:exited, [pmon.receive].flatten.last)
|
|
121
121
|
else
|
|
122
122
|
seh = frame_win.make_shared
|
|
123
123
|
data_sent = nil
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wxruby3
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Corino
|
|
@@ -139,18 +139,22 @@ files:
|
|
|
139
139
|
- ext/wxruby3/include/wxruby-runtime.h
|
|
140
140
|
- ext/wxruby3/swig/RubyStockObjects.i
|
|
141
141
|
- ext/wxruby3/swig/common.i
|
|
142
|
-
- ext/wxruby3/swig/custom/director.swg
|
|
143
|
-
- ext/wxruby3/swig/custom/rubyapi.swg
|
|
144
|
-
- ext/wxruby3/swig/custom/rubyerrors.swg
|
|
145
|
-
- ext/wxruby3/swig/custom/
|
|
146
|
-
- ext/wxruby3/swig/custom/
|
|
147
|
-
- ext/wxruby3/swig/custom/
|
|
148
|
-
- ext/wxruby3/swig/custom/
|
|
149
|
-
- ext/wxruby3/swig/custom/
|
|
150
|
-
- ext/wxruby3/swig/custom/
|
|
151
|
-
- ext/wxruby3/swig/custom/
|
|
152
|
-
- ext/wxruby3/swig/custom/
|
|
153
|
-
- ext/wxruby3/swig/custom/
|
|
142
|
+
- ext/wxruby3/swig/custom/common/director.swg
|
|
143
|
+
- ext/wxruby3/swig/custom/common/rubyapi.swg
|
|
144
|
+
- ext/wxruby3/swig/custom/common/rubyerrors.swg
|
|
145
|
+
- ext/wxruby3/swig/custom/common/rubytracking.swg
|
|
146
|
+
- ext/wxruby3/swig/custom/common/swiglabels.swg
|
|
147
|
+
- ext/wxruby3/swig/custom/common/typemaps/swigtypemaps.swg
|
|
148
|
+
- ext/wxruby3/swig/custom/common/wx_ruby_shared_ptr.i
|
|
149
|
+
- ext/wxruby3/swig/custom/common/wx_shared_ptr.i
|
|
150
|
+
- ext/wxruby3/swig/custom/typed_data/rubyhead.swg
|
|
151
|
+
- ext/wxruby3/swig/custom/typed_data/rubyprimtypes.swg
|
|
152
|
+
- ext/wxruby3/swig/custom/typed_data/rubyrun.swg
|
|
153
|
+
- ext/wxruby3/swig/custom/typed_data/swigrun.swg
|
|
154
|
+
- ext/wxruby3/swig/custom/untyped_data/rubyhead.swg
|
|
155
|
+
- ext/wxruby3/swig/custom/untyped_data/rubyprimtypes.swg
|
|
156
|
+
- ext/wxruby3/swig/custom/untyped_data/rubyrun.swg
|
|
157
|
+
- ext/wxruby3/swig/custom/untyped_data/swigrun.swg
|
|
154
158
|
- ext/wxruby3/swig/mark_free_impl.i
|
|
155
159
|
- ext/wxruby3/swig/memory_management.i
|
|
156
160
|
- ext/wxruby3/swig/typedefs.i
|
|
@@ -347,6 +351,8 @@ files:
|
|
|
347
351
|
- lib/wx/doc/prt/printer.rb
|
|
348
352
|
- lib/wx/doc/prt/printer_dc.rb
|
|
349
353
|
- lib/wx/doc/radio_box.rb
|
|
354
|
+
- lib/wx/doc/rbn/events.rb
|
|
355
|
+
- lib/wx/doc/rbn/ribbon_backstage_mrulist.rb
|
|
350
356
|
- lib/wx/doc/rbn/ribbon_bar.rb
|
|
351
357
|
- lib/wx/doc/rbn/ribbon_button_bar.rb
|
|
352
358
|
- lib/wx/doc/rbn/ribbon_gallery.rb
|
|
@@ -419,6 +425,7 @@ files:
|
|
|
419
425
|
- lib/wx/rbn/keyword_defs.rb
|
|
420
426
|
- lib/wx/rbn/require.rb
|
|
421
427
|
- lib/wx/rbn/ribbon_art_provider.rb
|
|
428
|
+
- lib/wx/rbn/ribbon_backstage_mrulist.rb
|
|
422
429
|
- lib/wx/rbn/ribbon_bar.rb
|
|
423
430
|
- lib/wx/rbn/ribbon_button_bar.rb
|
|
424
431
|
- lib/wx/rbn/ribbon_control.rb
|
|
@@ -481,8 +488,10 @@ files:
|
|
|
481
488
|
- rakelib/lib/core/include/init.inc
|
|
482
489
|
- rakelib/lib/core/include/swigdirector.inc
|
|
483
490
|
- rakelib/lib/core/include/swigrubyerrors.inc
|
|
484
|
-
- rakelib/lib/core/include/swigrubyrun.inc
|
|
485
|
-
- rakelib/lib/core/include/swigrun.inc
|
|
491
|
+
- rakelib/lib/core/include/typed_data/swigrubyrun.inc
|
|
492
|
+
- rakelib/lib/core/include/typed_data/swigrun.inc
|
|
493
|
+
- rakelib/lib/core/include/untyped_data/swigrubyrun.inc
|
|
494
|
+
- rakelib/lib/core/include/untyped_data/swigrun.inc
|
|
486
495
|
- rakelib/lib/core/mapping.rb
|
|
487
496
|
- rakelib/lib/core/package.rb
|
|
488
497
|
- rakelib/lib/core/parameter.rb
|
|
@@ -566,6 +575,7 @@ files:
|
|
|
566
575
|
- rakelib/lib/director/file_ctrl_event.rb
|
|
567
576
|
- rakelib/lib/director/file_dialog_custom_control.rb
|
|
568
577
|
- rakelib/lib/director/file_dialog_customize_hook.rb
|
|
578
|
+
- rakelib/lib/director/file_history.rb
|
|
569
579
|
- rakelib/lib/director/file_picker_ctrl.rb
|
|
570
580
|
- rakelib/lib/director/file_system.rb
|
|
571
581
|
- rakelib/lib/director/find_dialog_event.rb
|
|
@@ -655,6 +665,12 @@ files:
|
|
|
655
665
|
- rakelib/lib/director/region.rb
|
|
656
666
|
- rakelib/lib/director/region_iterator.rb
|
|
657
667
|
- rakelib/lib/director/ribbon_art_provider.rb
|
|
668
|
+
- rakelib/lib/director/ribbon_backstage.rb
|
|
669
|
+
- rakelib/lib/director/ribbon_backstage_button.rb
|
|
670
|
+
- rakelib/lib/director/ribbon_backstage_callout.rb
|
|
671
|
+
- rakelib/lib/director/ribbon_backstage_heading.rb
|
|
672
|
+
- rakelib/lib/director/ribbon_backstage_itemlist.rb
|
|
673
|
+
- rakelib/lib/director/ribbon_backstage_mrulist.rb
|
|
658
674
|
- rakelib/lib/director/ribbon_bar.rb
|
|
659
675
|
- rakelib/lib/director/ribbon_bar_event.rb
|
|
660
676
|
- rakelib/lib/director/ribbon_button_bar.rb
|
|
@@ -1304,7 +1320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1304
1320
|
- !ruby/object:Gem::Version
|
|
1305
1321
|
version: '0'
|
|
1306
1322
|
requirements: []
|
|
1307
|
-
rubygems_version: 4.0.
|
|
1323
|
+
rubygems_version: 4.0.20
|
|
1308
1324
|
specification_version: 4
|
|
1309
1325
|
summary: wxWidgets extension for Ruby
|
|
1310
1326
|
test_files: []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|