wxruby3 0.9.0.pre.rc.1-x64-mingw-ucrt → 0.9.0.pre.rc.2-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +51 -22
  3. data/README.md +38 -6
  4. data/assets/hello_button-macos.png +0 -0
  5. data/assets/hello_button-msw.png +0 -0
  6. data/assets/hello_button_clicked-macos.png +0 -0
  7. data/assets/hello_button_clicked-msw.png +0 -0
  8. data/assets/hello_button_clicked_combi.png +0 -0
  9. data/assets/hello_world-macos.png +0 -0
  10. data/assets/hello_world-msw.png +0 -0
  11. data/assets/hello_world_combi.png +0 -0
  12. data/ext/wxbase32u_gcc_custom.dll +0 -0
  13. data/ext/wxbase32u_net_gcc_custom.dll +0 -0
  14. data/ext/wxbase32u_xml_gcc_custom.dll +0 -0
  15. data/ext/wxmsw32u_aui_gcc_custom.dll +0 -0
  16. data/ext/wxmsw32u_core_gcc_custom.dll +0 -0
  17. data/ext/wxmsw32u_gl_gcc_custom.dll +0 -0
  18. data/ext/wxmsw32u_html_gcc_custom.dll +0 -0
  19. data/ext/wxmsw32u_media_gcc_custom.dll +0 -0
  20. data/ext/wxmsw32u_propgrid_gcc_custom.dll +0 -0
  21. data/ext/wxmsw32u_qa_gcc_custom.dll +0 -0
  22. data/ext/wxmsw32u_ribbon_gcc_custom.dll +0 -0
  23. data/ext/wxmsw32u_richtext_gcc_custom.dll +0 -0
  24. data/ext/wxmsw32u_stc_gcc_custom.dll +0 -0
  25. data/ext/wxmsw32u_webview_gcc_custom.dll +0 -0
  26. data/ext/wxmsw32u_xrc_gcc_custom.dll +0 -0
  27. data/lib/wx/core/brush.rb +6 -0
  28. data/lib/wx/core/events/evt_list.rb +7 -0
  29. data/lib/wx/core/evthandler.rb +12 -2
  30. data/lib/wx/core/font.rb +22 -14
  31. data/lib/wx/core/helpprovider.rb +2 -2
  32. data/lib/wx/core/menu.rb +5 -0
  33. data/lib/wx/core/pen.rb +6 -0
  34. data/lib/wx/core/window.rb +28 -1
  35. data/lib/wx/doc/app.rb +40 -0
  36. data/lib/wx/doc/brush.rb +17 -0
  37. data/lib/wx/doc/font.rb +27 -0
  38. data/lib/wx/doc/gen/activity_indicator.rb +65 -0
  39. data/lib/wx/doc/gen/aui/aui_tool_bar.rb +2 -2
  40. data/lib/wx/doc/gen/context_help_button.rb +48 -0
  41. data/lib/wx/doc/gen/core.rb +2 -2
  42. data/lib/wx/doc/gen/event_blocker.rb +18 -16
  43. data/lib/wx/doc/gen/event_filter.rb +38 -45
  44. data/lib/wx/doc/gen/event_list.rb +7 -0
  45. data/lib/wx/doc/gen/file_dialog.rb +48 -49
  46. data/lib/wx/doc/gen/font.rb +9 -0
  47. data/lib/wx/doc/gen/hyperlink_ctrl.rb +147 -0
  48. data/lib/wx/doc/gen/hyperlink_event.rb +43 -0
  49. data/lib/wx/doc/gen/menu_bar.rb +0 -6
  50. data/lib/wx/doc/gen/radio_box.rb +0 -8
  51. data/lib/wx/doc/pen.rb +17 -0
  52. data/lib/wx/doc/radio_box.rb +20 -0
  53. data/lib/wx/doc/window.rb +27 -0
  54. data/lib/wx/keyword_defs.rb +77 -76
  55. data/lib/wx/prt/keyword_defs.rb +5 -1
  56. data/lib/wx/version.rb +1 -1
  57. data/lib/wxruby_aui.so +0 -0
  58. data/lib/wxruby_core.so +0 -0
  59. data/lib/wxruby_grid.so +0 -0
  60. data/lib/wxruby_html.so +0 -0
  61. data/lib/wxruby_pg.so +0 -0
  62. data/lib/wxruby_prt.so +0 -0
  63. data/lib/wxruby_rbn.so +0 -0
  64. data/lib/wxruby_rtc.so +0 -0
  65. data/lib/wxruby_stc.so +0 -0
  66. data/rakelib/install.rb +17 -6
  67. data/rakelib/lib/config/linux.rb +4 -2
  68. data/rakelib/lib/config/macosx.rb +120 -1
  69. data/rakelib/lib/config/mingw.rb +6 -1
  70. data/rakelib/lib/config/unixish.rb +26 -11
  71. data/rakelib/lib/config.rb +15 -6
  72. data/samples/aui/aui.rb +432 -363
  73. data/samples/propgrid/propgrid.rb +3 -0
  74. data/samples/sampler/editor.rb +33 -25
  75. data/samples/sampler/sample.rb +2 -2
  76. data/samples/sampler/stc_editor.rb +4 -2
  77. data/tests/lib/item_container_tests.rb +82 -0
  78. data/tests/lib/text_entry_tests.rb +80 -0
  79. data/tests/lib/wxapp_runner.rb +12 -0
  80. data/tests/lib/wxframe_runner.rb +89 -4
  81. data/tests/test_ext_controls.rb +28 -0
  82. data/tests/test_font.rb +239 -0
  83. data/tests/test_intl.rb +5 -1
  84. data/tests/test_std_controls.rb +263 -37
  85. data/tests/test_window.rb +340 -0
  86. metadata +25 -2
data/samples/aui/aui.rb CHANGED
@@ -72,23 +72,22 @@ class SizeReportCtrl < Wx::Control
72
72
  end
73
73
 
74
74
  class SettingsPanel < Wx::Panel
75
- consts = %w[
76
- ID_PaneBorderSize
77
- ID_SashSize
78
- ID_CaptionSize
79
- ID_BackgroundColour
80
- ID_SashColour
81
- ID_InactiveCaptionColour
82
- ID_InactiveCaptionGradientColour
83
- ID_InactiveCaptionTextColour
84
- ID_ActiveCaptionColour
85
- ID_ActiveCaptionGradientColour
86
- ID_ActiveCaptionTextColour
87
- ID_BorderColour
88
- ID_GripperColour ]
89
-
90
- consts.each_with_index do |c, i|
91
- const_set(c, 1001 + i)
75
+ module ID
76
+ include Wx::IDHelper
77
+
78
+ PaneBorderSize = self.next_id
79
+ SashSize = self.next_id
80
+ CaptionSize = self.next_id
81
+ BackgroundColour = self.next_id
82
+ SashColour = self.next_id
83
+ InactiveCaptionColour = self.next_id
84
+ InactiveCaptionGradientColour = self.next_id
85
+ InactiveCaptionTextColour = self.next_id
86
+ ActiveCaptionColour = self.next_id
87
+ ActiveCaptionGradientColour = self.next_id
88
+ ActiveCaptionTextColour = self.next_id
89
+ BorderColour = self.next_id
90
+ GripperColour = self.next_id
92
91
  end
93
92
 
94
93
  def initialize(parent, frame)
@@ -97,38 +96,38 @@ class SettingsPanel < Wx::Panel
97
96
  @base_bmp = create_colour_bitmap(Wx::BLACK)
98
97
 
99
98
  # set up some spin ctrls for integer variables
100
- @border_size, s1 = make_metric_spin_ctrl(ID_PaneBorderSize,
99
+ @border_size, s1 = make_metric_spin_ctrl(ID::PaneBorderSize,
101
100
  "Pane Border Size:",
102
101
  Wx::AUI_DOCKART_PANE_BORDER_SIZE)
103
102
 
104
- @sash_size, s2 = make_metric_spin_ctrl(ID_SashSize,
103
+ @sash_size, s2 = make_metric_spin_ctrl(ID::SashSize,
105
104
  "Sash Size:",
106
105
  Wx::AUI_DOCKART_SASH_SIZE)
107
106
 
108
- @cap_size, s3 = make_metric_spin_ctrl(ID_CaptionSize,
107
+ @cap_size, s3 = make_metric_spin_ctrl(ID::CaptionSize,
109
108
  "Caption Size:",
110
109
  Wx::AUI_DOCKART_CAPTION_SIZE)
111
110
 
112
111
  # colour controls
113
- @bckg_colour, s4 = make_colour_button(ID_BackgroundColour,
112
+ @bckg_colour, s4 = make_colour_button(ID::BackgroundColour,
114
113
  "Background Colour:")
115
- @sash_colour, s5 = make_colour_button(ID_SashColour,
114
+ @sash_colour, s5 = make_colour_button(ID::SashColour,
116
115
  "Sash Colour:")
117
- @capt_colour, s6 = make_colour_button(ID_InactiveCaptionColour,
116
+ @capt_colour, s6 = make_colour_button(ID::InactiveCaptionColour,
118
117
  "Normal Caption:")
119
- @capt_gradnt, s7 = make_colour_button(ID_InactiveCaptionGradientColour,
118
+ @capt_gradnt, s7 = make_colour_button(ID::InactiveCaptionGradientColour,
120
119
  "Normal Caption Gradient:")
121
- @capt_text, s8 = make_colour_button(ID_InactiveCaptionTextColour,
120
+ @capt_text, s8 = make_colour_button(ID::InactiveCaptionTextColour,
122
121
  "Normal Caption Text:")
123
- @acap_colour, s9 = make_colour_button(ID_ActiveCaptionColour,
122
+ @acap_colour, s9 = make_colour_button(ID::ActiveCaptionColour,
124
123
  "Active Caption:")
125
- @acap_gradnt, s10 = make_colour_button(ID_ActiveCaptionGradientColour,
124
+ @acap_gradnt, s10 = make_colour_button(ID::ActiveCaptionGradientColour,
126
125
  "Active Caption Gradient:")
127
- @acap_text, s11 = make_colour_button(ID_ActiveCaptionTextColour,
126
+ @acap_text, s11 = make_colour_button(ID::ActiveCaptionTextColour,
128
127
  "Active Caption Text:")
129
- @brdr_colour, s12 = make_colour_button(ID_BorderColour,
128
+ @brdr_colour, s12 = make_colour_button(ID::BorderColour,
130
129
  "Border Colour:")
131
- @grip_colour, s13 = make_colour_button(ID_GripperColour,
130
+ @grip_colour, s13 = make_colour_button(ID::GripperColour,
132
131
  "Gripper Colour:")
133
132
 
134
133
  grid_sizer = Wx::GridSizer.new(2)
@@ -148,19 +147,19 @@ class SettingsPanel < Wx::Panel
148
147
  get_sizer.set_size_hints(self)
149
148
  update_colours
150
149
 
151
- evt_spinctrl(ID_PaneBorderSize) { |e| on_pane_border_size(e) }
152
- evt_spinctrl(ID_SashSize) { |e| on_sash_size(e) }
153
- evt_spinctrl(ID_CaptionSize) { |e| on_caption_size(e) }
154
- evt_button(ID_BackgroundColour) { |e| on_set_colour(e) }
155
- evt_button(ID_SashColour) { |e| on_set_colour(e) }
156
- evt_button(ID_InactiveCaptionColour) { |e| on_set_colour(e) }
157
- evt_button(ID_InactiveCaptionGradientColour) { |e| on_set_colour(e) }
158
- evt_button(ID_InactiveCaptionTextColour) { |e| on_set_colour(e) }
159
- evt_button(ID_ActiveCaptionColour) { |e| on_set_colour(e) }
160
- evt_button(ID_ActiveCaptionGradientColour) { |e| on_set_colour(e) }
161
- evt_button(ID_ActiveCaptionTextColour) { |e| on_set_colour(e) }
162
- evt_button(ID_BorderColour) { |e| on_set_colour(e) }
163
- evt_button(ID_GripperColour) { |e| on_set_colour(e) }
150
+ evt_spinctrl(ID::PaneBorderSize) { |e| on_pane_border_size(e) }
151
+ evt_spinctrl(ID::SashSize) { |e| on_sash_size(e) }
152
+ evt_spinctrl(ID::CaptionSize) { |e| on_caption_size(e) }
153
+ evt_button(ID::BackgroundColour) { |e| on_set_colour(e) }
154
+ evt_button(ID::SashColour) { |e| on_set_colour(e) }
155
+ evt_button(ID::InactiveCaptionColour) { |e| on_set_colour(e) }
156
+ evt_button(ID::InactiveCaptionGradientColour) { |e| on_set_colour(e) }
157
+ evt_button(ID::InactiveCaptionTextColour) { |e| on_set_colour(e) }
158
+ evt_button(ID::ActiveCaptionColour) { |e| on_set_colour(e) }
159
+ evt_button(ID::ActiveCaptionGradientColour) { |e| on_set_colour(e) }
160
+ evt_button(ID::ActiveCaptionTextColour) { |e| on_set_colour(e) }
161
+ evt_button(ID::BorderColour) { |e| on_set_colour(e) }
162
+ evt_button(ID::GripperColour) { |e| on_set_colour(e) }
164
163
  end
165
164
 
166
165
  def update_colours()
@@ -223,25 +222,25 @@ class SettingsPanel < Wx::Panel
223
222
 
224
223
  var = nil
225
224
  case event.get_id()
226
- when ID_BackgroundColour
225
+ when ID::BackgroundColour
227
226
  var = Wx::AUI_DOCKART_BACKGROUND_COLOUR
228
- when ID_SashColour
227
+ when ID::SashColour
229
228
  var = Wx::AUI_DOCKART_SASH_COLOUR
230
- when ID_InactiveCaptionColour
229
+ when ID::InactiveCaptionColour
231
230
  var = Wx::AUI_DOCKART_INACTIVE_CAPTION_COLOUR
232
- when ID_InactiveCaptionGradientColour
231
+ when ID::InactiveCaptionGradientColour
233
232
  var = Wx::AUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR
234
- when ID_InactiveCaptionTextColour
233
+ when ID::InactiveCaptionTextColour
235
234
  var = Wx::AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR
236
- when ID_ActiveCaptionColour
235
+ when ID::ActiveCaptionColour
237
236
  var = Wx::AUI_DOCKART_ACTIVE_CAPTION_COLOUR
238
- when ID_ActiveCaptionGradientColour
237
+ when ID::ActiveCaptionGradientColour
239
238
  var = Wx::AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR
240
- when ID_ActiveCaptionTextColour
239
+ when ID::ActiveCaptionTextColour
241
240
  var = Wx::AUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR
242
- when ID_BorderColour
241
+ when ID::BorderColour
243
242
  var = Wx::AUI_DOCKART_BORDER_COLOUR
244
- when ID_GripperColour
243
+ when ID::GripperColour
245
244
  var = Wx::AUI_DOCKART_GRIPPER_COLOUR
246
245
  else
247
246
  return
@@ -307,51 +306,58 @@ class SettingsPanel < Wx::Panel
307
306
  end
308
307
 
309
308
  class AuiFrame < Wx::Frame
310
- consts = %w[
311
- ID_CreateTree
312
- ID_CreateGrid
313
- ID_CreateText
314
- ID_CreateHTML
315
- ID_CreateNotebook
316
- ID_CreateSizeReport
317
- ID_GridContent
318
- ID_TextContent
319
- ID_TreeContent
320
- ID_HTMLContent
321
- ID_NotebookContent
322
- ID_SizeReportContent
323
- ID_CreatePerspective
324
- ID_CopyPerspectiveCode
325
- ID_AllowFloating
326
- ID_AllowActivePane
327
- ID_TransparentHint
328
- ID_VenetianBlindsHint
329
- ID_RectangleHint
330
- ID_NoHint
331
- ID_HintFade
332
- ID_NoVenetianFade
333
- ID_TransparentDrag
334
- ID_NoGradient
335
- ID_VerticalGradient
336
- ID_HorizontalGradient
337
- ID_Settings
338
- ID_NotebookNoCloseButton
339
- ID_NotebookCloseButton
340
- ID_NotebookCloseButtonAll
341
- ID_NotebookCloseButtonActive
342
- ID_NotebookAllowTabMove
343
- ID_NotebookAllowTabExternalMove
344
- ID_NotebookAllowTabSplit
345
- ID_NotebookWindowList
346
- ID_NotebookScrollButtons
347
- ID_NotebookTabFixedWidth
348
- ID_NotebookArtGloss
349
- ID_NotebookArtSimple ]
350
-
351
- consts.each_with_index do |c, i|
352
- const_set(c, 2000 + i)
309
+ module ID
310
+ include Wx::IDHelper
311
+ CreateTree = self.next_id
312
+ CreateGrid = self.next_id
313
+ CreateText = self.next_id
314
+ CreateHTML = self.next_id
315
+ CreateNotebook = self.next_id
316
+ CreateSizeReport = self.next_id
317
+ GridContent = self.next_id
318
+ TextContent = self.next_id
319
+ TreeContent = self.next_id
320
+ HTMLContent = self.next_id
321
+ NotebookContent = self.next_id
322
+ SizeReportContent = self.next_id
323
+ CreatePerspective = self.next_id
324
+ CopyPerspectiveCode = self.next_id
325
+ AllowFloating = self.next_id
326
+ AllowActivePane = self.next_id
327
+ TransparentHint = self.next_id
328
+ VenetianBlindsHint = self.next_id
329
+ RectangleHint = self.next_id
330
+ NoHint = self.next_id
331
+ HintFade = self.next_id
332
+ NoVenetianFade = self.next_id
333
+ TransparentDrag = self.next_id
334
+ NoGradient = self.next_id
335
+ VerticalGradient = self.next_id
336
+ HorizontalGradient = self.next_id
337
+ LiveUpdate = self.next_id
338
+ AllowToolbarResizing = self.next_id
339
+ Settings = self.next_id
340
+ CustomizeToolbar = self.next_id
341
+ DropDownToolbarItem = self.next_id
342
+ NotebookNoCloseButton = self.next_id
343
+ NotebookCloseButton = self.next_id
344
+ NotebookCloseButtonAll = self.next_id
345
+ NotebookCloseButtonActive = self.next_id
346
+ NotebookAllowTabMove = self.next_id
347
+ NotebookAllowTabExternalMove = self.next_id
348
+ NotebookAllowTabSplit = self.next_id
349
+ NotebookWindowList = self.next_id
350
+ NotebookScrollButtons = self.next_id
351
+ NotebookTabFixedWidth = self.next_id
352
+ NotebookArtGloss = self.next_id
353
+ NotebookArtSimple = self.next_id
354
+ NotebookAlignTop = self.next_id
355
+ NotebookAlignBottom = self.next_id
356
+
357
+ SampleItem = self.next_id
358
+
359
+ FirstPerspective = CreatePerspective+1000
353
360
  end
354
- ID_FirstPerspective = ID_CreatePerspective + 1000
355
361
 
356
362
  def initialize(*args)
357
363
  super
@@ -386,99 +392,99 @@ class AuiFrame < Wx::Frame
386
392
  file_menu.append(Wx::ID_EXIT, "Exit")
387
393
 
388
394
  view_menu = Wx::Menu.new
389
- view_menu.append(ID_CreateText, "Create Text Control")
390
- view_menu.append(ID_CreateHTML, "Create HTML Control")
391
- view_menu.append(ID_CreateTree, "Create Tree")
392
- view_menu.append(ID_CreateGrid, "Create Grid")
393
- view_menu.append(ID_CreateNotebook, "Create Notebook")
394
- view_menu.append(ID_CreateSizeReport, "Create Size Reporter")
395
+ view_menu.append(ID::CreateText, "Create Text Control")
396
+ view_menu.append(ID::CreateHTML, "Create HTML Control")
397
+ view_menu.append(ID::CreateTree, "Create Tree")
398
+ view_menu.append(ID::CreateGrid, "Create Grid")
399
+ view_menu.append(ID::CreateNotebook, "Create Notebook")
400
+ view_menu.append(ID::CreateSizeReport, "Create Size Reporter")
395
401
  view_menu.append_separator
396
402
 
397
- view_menu.append(ID_GridContent,
403
+ view_menu.append(ID::GridContent,
398
404
  "Use a Grid for the Content Pane")
399
- view_menu.append(ID_TextContent,
405
+ view_menu.append(ID::TextContent,
400
406
  "Use a Text Control for the Content Pane")
401
- view_menu.append(ID_HTMLContent,
407
+ view_menu.append(ID::HTMLContent,
402
408
  "Use an HTML Control for the Content Pane")
403
- view_menu.append(ID_TreeContent,
409
+ view_menu.append(ID::TreeContent,
404
410
  "Use a Tree Control for the Content Pane")
405
- view_menu.append(ID_NotebookContent,
411
+ view_menu.append(ID::NotebookContent,
406
412
  "Use a wxAuiNotebook control for the Content Pane")
407
- view_menu.append(ID_SizeReportContent,
413
+ view_menu.append(ID::SizeReportContent,
408
414
  "Use a Size Reporter for the Content Pane")
409
415
 
410
416
  options_menu = Wx::Menu.new
411
417
  # Hints
412
- options_menu.append_radio_item(ID_TransparentHint,
418
+ options_menu.append_radio_item(ID::TransparentHint,
413
419
  "Transparent Hint")
414
- options_menu.append_radio_item(ID_VenetianBlindsHint,
420
+ options_menu.append_radio_item(ID::VenetianBlindsHint,
415
421
  "Venetian Blinds Hint")
416
- options_menu.append_radio_item(ID_RectangleHint,
422
+ options_menu.append_radio_item(ID::RectangleHint,
417
423
  "Rectangle Hint")
418
- options_menu.append_radio_item(ID_NoHint,
424
+ options_menu.append_radio_item(ID::NoHint,
419
425
  "No Hint")
420
426
 
421
427
  options_menu.append_separator
422
428
  # Hints Options
423
- options_menu.append_check_item(ID_HintFade,
429
+ options_menu.append_check_item(ID::HintFade,
424
430
  "Hint Fade-in")
425
- options_menu.append_check_item(ID_AllowFloating,
431
+ options_menu.append_check_item(ID::AllowFloating,
426
432
  "Allow Floating")
427
- options_menu.append_check_item(ID_NoVenetianFade,
433
+ options_menu.append_check_item(ID::NoVenetianFade,
428
434
  "Disable Venetian Blinds Hint Fade-in")
429
- options_menu.append_check_item(ID_TransparentDrag,
435
+ options_menu.append_check_item(ID::TransparentDrag,
430
436
  "Transparent Drag")
431
- options_menu.append_check_item(ID_AllowActivePane,
437
+ options_menu.append_check_item(ID::AllowActivePane,
432
438
  "Allow Active Pane")
433
439
  options_menu.append_separator
434
- options_menu.append_radio_item(ID_NoGradient,
440
+ options_menu.append_radio_item(ID::NoGradient,
435
441
  "No Caption Gradient")
436
- options_menu.append_radio_item(ID_VerticalGradient,
442
+ options_menu.append_radio_item(ID::VerticalGradient,
437
443
  "Vertical Caption Gradient")
438
- options_menu.append_radio_item(ID_HorizontalGradient,
444
+ options_menu.append_radio_item(ID::HorizontalGradient,
439
445
  "Horizontal Caption Gradient")
440
446
  options_menu.append_separator
441
- options_menu.append(ID_Settings, "Settings Pane")
447
+ options_menu.append(ID::Settings, "Settings Pane")
442
448
 
443
449
  notebook_menu = Wx::Menu.new
444
- notebook_menu.append_radio_item(ID_NotebookArtGloss,
450
+ notebook_menu.append_radio_item(ID::NotebookArtGloss,
445
451
  "Glossy Theme (Default)")
446
- notebook_menu.append_radio_item(ID_NotebookArtSimple,
452
+ notebook_menu.append_radio_item(ID::NotebookArtSimple,
447
453
  "Simple Theme")
448
454
 
449
455
  notebook_menu.append_separator
450
456
 
451
- notebook_menu.append_radio_item(ID_NotebookNoCloseButton,
457
+ notebook_menu.append_radio_item(ID::NotebookNoCloseButton,
452
458
  "No Close Button")
453
- notebook_menu.append_radio_item(ID_NotebookCloseButton,
459
+ notebook_menu.append_radio_item(ID::NotebookCloseButton,
454
460
  "Close Button at Right")
455
- notebook_menu.append_radio_item(ID_NotebookCloseButtonAll,
461
+ notebook_menu.append_radio_item(ID::NotebookCloseButtonAll,
456
462
  "Close Button on All Tabs")
457
- notebook_menu.append_radio_item(ID_NotebookCloseButtonActive,
463
+ notebook_menu.append_radio_item(ID::NotebookCloseButtonActive,
458
464
  "Close Button on Active Tab")
459
465
 
460
466
  notebook_menu.append_separator
461
- notebook_menu.append_check_item(ID_NotebookAllowTabMove,
467
+ notebook_menu.append_check_item(ID::NotebookAllowTabMove,
462
468
  "Allow Tab Move")
463
- notebook_menu.append_check_item(ID_NotebookAllowTabExternalMove,
469
+ notebook_menu.append_check_item(ID::NotebookAllowTabExternalMove,
464
470
  "Allow External Tab Move")
465
- notebook_menu.append_check_item(ID_NotebookAllowTabSplit,
471
+ notebook_menu.append_check_item(ID::NotebookAllowTabSplit,
466
472
  "Allow Notebook Split")
467
- notebook_menu.append_check_item(ID_NotebookScrollButtons,
473
+ notebook_menu.append_check_item(ID::NotebookScrollButtons,
468
474
  "Scroll Buttons Visible")
469
- notebook_menu.append_check_item(ID_NotebookWindowList,
475
+ notebook_menu.append_check_item(ID::NotebookWindowList,
470
476
  "Window List Button Visible")
471
- notebook_menu.append_check_item(ID_NotebookTabFixedWidth,
477
+ notebook_menu.append_check_item(ID::NotebookTabFixedWidth,
472
478
  "Fixed-width Tabs")
473
479
 
474
480
  @perspectives_menu = Wx::Menu.new
475
- @perspectives_menu.append(ID_CreatePerspective,
481
+ @perspectives_menu.append(ID::CreatePerspective,
476
482
  "Create Perspective")
477
- @perspectives_menu.append(ID_CopyPerspectiveCode,
483
+ @perspectives_menu.append(ID::CopyPerspectiveCode,
478
484
  "Copy Perspective Data To Clipboard")
479
485
  @perspectives_menu.append_separator
480
- @perspectives_menu.append(ID_FirstPerspective + 0, "Default Startup")
481
- @perspectives_menu.append(ID_FirstPerspective + 1, "All Panes")
486
+ @perspectives_menu.append(ID::FirstPerspective + 0, "Default Startup")
487
+ @perspectives_menu.append(ID::FirstPerspective + 1, "All Panes")
482
488
 
483
489
  help_menu = Wx::Menu.new
484
490
  help_menu.append(Wx::ID_ABOUT, "About...")
@@ -494,201 +500,231 @@ class AuiFrame < Wx::Frame
494
500
  end
495
501
 
496
502
  def setup_events
497
- evt_erase_background { |e| on_erase_background(e) }
498
- evt_size { |e| on_size(e) }
499
-
500
- evt_menu(ID_CreateTree) { |e| on_create_tree }
501
- evt_menu(ID_CreateGrid) { |e| on_create_grid }
502
- evt_menu(ID_CreateText) { |e| on_create_text }
503
- evt_menu(ID_CreateHTML) { |e| on_create_html }
504
- evt_menu(ID_CreateSizeReport) { |e| on_create_size_report }
505
- evt_menu(ID_CreateNotebook) { |e| on_create_notebook }
506
- evt_menu(ID_CreatePerspective) { |e| on_create_perspective }
507
- evt_menu(ID_CopyPerspectiveCode) { |e| on_copy_perspective_code }
508
- evt_menu(ID_AllowFloating) { |e| on_manager_flag(e) }
509
- evt_menu(ID_TransparentHint) { |e| on_manager_flag(e) }
510
- evt_menu(ID_VenetianBlindsHint) { |e| on_manager_flag(e) }
511
- evt_menu(ID_RectangleHint) { |e| on_manager_flag(e) }
512
- evt_menu(ID_NoHint) { |e| on_manager_flag(e) }
513
- evt_menu(ID_HintFade) { |e| on_manager_flag(e) }
514
- evt_menu(ID_NoVenetianFade) { |e| on_manager_flag(e) }
515
- evt_menu(ID_TransparentDrag) { |e| on_manager_flag(e) }
516
- evt_menu(ID_AllowActivePane) { |e| on_manager_flag(e) }
517
- evt_menu(ID_NotebookTabFixedWidth) { |e| on_notebook_flag(e) }
518
- evt_menu(ID_NotebookNoCloseButton) { |e| on_notebook_flag(e) }
519
- evt_menu(ID_NotebookCloseButton) { |e| on_notebook_flag(e) }
520
- evt_menu(ID_NotebookCloseButtonAll) { |e| on_notebook_flag(e) }
521
- evt_menu(ID_NotebookCloseButtonActive) { |e| on_notebook_flag(e) }
522
- evt_menu(ID_NotebookAllowTabMove) { |e| on_notebook_flag(e) }
523
- evt_menu(ID_NotebookAllowTabExternalMove) { |e| on_notebook_flag(e) }
524
- evt_menu(ID_NotebookAllowTabSplit) { |e| on_notebook_flag(e) }
525
- evt_menu(ID_NotebookScrollButtons) { |e| on_notebook_flag(e) }
526
- evt_menu(ID_NotebookWindowList) { |e| on_notebook_flag(e) }
527
- evt_menu(ID_NotebookArtGloss) { |e| on_notebook_flag(e) }
528
- evt_menu(ID_NotebookArtSimple) { |e| on_notebook_flag(e) }
529
- evt_menu(ID_NoGradient) { |e| on_gradient(e) }
530
- evt_menu(ID_VerticalGradient) { |e| on_gradient(e) }
531
- evt_menu(ID_HorizontalGradient) { |e| on_gradient(e) }
532
- evt_menu(ID_Settings) { on_settings }
533
- evt_menu(ID_GridContent) { |e| on_change_content_pane(e) }
534
- evt_menu(ID_TreeContent) { |e| on_change_content_pane(e) }
535
- evt_menu(ID_TextContent) { |e| on_change_content_pane(e) }
536
- evt_menu(ID_SizeReportContent) { |e| on_change_content_pane(e) }
537
- evt_menu(ID_HTMLContent) { |e| on_change_content_pane(e) }
538
- evt_menu(ID_NotebookContent) { |e| on_change_content_pane(e) }
503
+ evt_erase_background :on_erase_background
504
+ evt_size :on_size
505
+
506
+ evt_menu(ID::CreateTree) { |e| on_create_tree }
507
+ evt_menu(ID::CreateGrid) { |e| on_create_grid }
508
+ evt_menu(ID::CreateText) { |e| on_create_text }
509
+ evt_menu(ID::CreateHTML) { |e| on_create_html }
510
+ evt_menu(ID::CreateSizeReport) { |e| on_create_size_report }
511
+ evt_menu(ID::CreateNotebook) { |e| on_create_notebook }
512
+ evt_menu(ID::CreatePerspective) { |e| on_create_perspective }
513
+ evt_menu(ID::CopyPerspectiveCode) { |e| on_copy_perspective_code }
514
+ evt_menu(ID::AllowFloating, :on_manager_flag)
515
+ evt_menu(ID::TransparentHint, :on_manager_flag)
516
+ evt_menu(ID::VenetianBlindsHint, :on_manager_flag)
517
+ evt_menu(ID::RectangleHint, :on_manager_flag)
518
+ evt_menu(ID::NoHint, :on_manager_flag)
519
+ evt_menu(ID::HintFade, :on_manager_flag)
520
+ evt_menu(ID::NoVenetianFade, :on_manager_flag)
521
+ evt_menu(ID::TransparentDrag, :on_manager_flag)
522
+ evt_menu(ID::AllowActivePane, :on_manager_flag)
523
+ evt_menu(ID::NotebookTabFixedWidth, :on_notebook_flag)
524
+ evt_menu(ID::NotebookNoCloseButton, :on_notebook_flag)
525
+ evt_menu(ID::NotebookCloseButton, :on_notebook_flag)
526
+ evt_menu(ID::NotebookCloseButtonAll, :on_notebook_flag)
527
+ evt_menu(ID::NotebookCloseButtonActive, :on_notebook_flag)
528
+ evt_menu(ID::NotebookAllowTabMove, :on_notebook_flag)
529
+ evt_menu(ID::NotebookAllowTabExternalMove, :on_notebook_flag)
530
+ evt_menu(ID::NotebookAllowTabSplit, :on_notebook_flag)
531
+ evt_menu(ID::NotebookScrollButtons, :on_notebook_flag)
532
+ evt_menu(ID::NotebookWindowList, :on_notebook_flag)
533
+ evt_menu(ID::NotebookArtGloss, :on_notebook_flag)
534
+ evt_menu(ID::NotebookArtSimple, :on_notebook_flag)
535
+ evt_menu(ID::NoGradient, :on_gradient)
536
+ evt_menu(ID::VerticalGradient, :on_gradient)
537
+ evt_menu(ID::HorizontalGradient, :on_gradient)
538
+ evt_menu(ID::Settings) { on_settings }
539
+ evt_menu(ID::GridContent, :on_change_content_pane)
540
+ evt_menu(ID::TreeContent, :on_change_content_pane)
541
+ evt_menu(ID::TextContent, :on_change_content_pane)
542
+ evt_menu(ID::SizeReportContent, :on_change_content_pane)
543
+ evt_menu(ID::HTMLContent, :on_change_content_pane)
544
+ evt_menu(ID::NotebookContent, :on_change_content_pane)
545
+ evt_auitoolbar_tool_dropdown(ID::DropDownToolbarItem, :on_drop_down_toolbar_item)
539
546
  evt_menu(Wx::ID_EXIT) { |e| on_exit }
540
547
  evt_menu(Wx::ID_ABOUT) { |e| on_about }
541
- evt_update_ui(ID_NotebookTabFixedWidth) { |e| on_update_ui(e) }
542
- evt_update_ui(ID_NotebookNoCloseButton) { |e| on_update_ui(e) }
543
- evt_update_ui(ID_NotebookCloseButton) { |e| on_update_ui(e) }
544
- evt_update_ui(ID_NotebookCloseButtonAll) { |e| on_update_ui(e) }
545
- evt_update_ui(ID_NotebookCloseButtonActive) { |e| on_update_ui(e) }
546
- evt_update_ui(ID_NotebookAllowTabMove) { |e| on_update_ui(e) }
547
- evt_update_ui(ID_NotebookAllowTabExternalMove) { |e| on_update_ui(e) }
548
- evt_update_ui(ID_NotebookAllowTabSplit) { |e| on_update_ui(e) }
549
- evt_update_ui(ID_NotebookScrollButtons) { |e| on_update_ui(e) }
550
- evt_update_ui(ID_NotebookWindowList) { |e| on_update_ui(e) }
551
- evt_update_ui(ID_AllowFloating) { |e| on_update_ui(e) }
552
- evt_update_ui(ID_TransparentHint) { |e| on_update_ui(e) }
553
- evt_update_ui(ID_VenetianBlindsHint) { |e| on_update_ui(e) }
554
- evt_update_ui(ID_RectangleHint) { |e| on_update_ui(e) }
555
- evt_update_ui(ID_NoHint) { |e| on_update_ui(e) }
556
- evt_update_ui(ID_HintFade) { |e| on_update_ui(e) }
557
- evt_update_ui(ID_NoVenetianFade) { |e| on_update_ui(e) }
558
- evt_update_ui(ID_TransparentDrag) { |e| on_update_ui(e) }
559
- evt_update_ui(ID_NoGradient) { |e| on_update_ui(e) }
560
- evt_update_ui(ID_VerticalGradient) { |e| on_update_ui(e) }
561
- evt_update_ui(ID_HorizontalGradient) { |e| on_update_ui(e) }
562
- evt_menu_range(ID_FirstPerspective,
563
- ID_FirstPerspective +
564
- @perspectives.length) { |e| on_restore_perspective(e) }
565
- evt_aui_pane_close { |e| on_pane_close(e) }
566
- evt_auinotebook_page_close(Wx::ID_ANY) { |e| on_notebook_page_close(e) }
548
+ evt_update_ui(ID::NotebookTabFixedWidth, :on_update_ui)
549
+ evt_update_ui(ID::NotebookNoCloseButton, :on_update_ui)
550
+ evt_update_ui(ID::NotebookCloseButton, :on_update_ui)
551
+ evt_update_ui(ID::NotebookCloseButtonAll, :on_update_ui)
552
+ evt_update_ui(ID::NotebookCloseButtonActive, :on_update_ui)
553
+ evt_update_ui(ID::NotebookAllowTabMove, :on_update_ui)
554
+ evt_update_ui(ID::NotebookAllowTabExternalMove, :on_update_ui)
555
+ evt_update_ui(ID::NotebookAllowTabSplit, :on_update_ui)
556
+ evt_update_ui(ID::NotebookScrollButtons, :on_update_ui)
557
+ evt_update_ui(ID::NotebookWindowList, :on_update_ui)
558
+ evt_update_ui(ID::AllowFloating, :on_update_ui)
559
+ evt_update_ui(ID::TransparentHint, :on_update_ui)
560
+ evt_update_ui(ID::VenetianBlindsHint, :on_update_ui)
561
+ evt_update_ui(ID::RectangleHint, :on_update_ui)
562
+ evt_update_ui(ID::NoHint, :on_update_ui)
563
+ evt_update_ui(ID::HintFade, :on_update_ui)
564
+ evt_update_ui(ID::NoVenetianFade, :on_update_ui)
565
+ evt_update_ui(ID::TransparentDrag, :on_update_ui)
566
+ evt_update_ui(ID::NoGradient, :on_update_ui)
567
+ evt_update_ui(ID::VerticalGradient, :on_update_ui)
568
+ evt_update_ui(ID::HorizontalGradient, :on_update_ui)
569
+ evt_menu_range(ID::FirstPerspective,
570
+ ID::FirstPerspective +
571
+ @perspectives.length, :on_restore_perspective)
572
+ evt_aui_pane_close :on_pane_close
573
+ evt_auinotebook_page_close(Wx::ID_ANY, :on_notebook_page_close)
567
574
  end
568
575
 
569
576
  # create some toolbars
570
577
  def setup_toolbars
571
- tb1 = Wx::ToolBar.new(self, Wx::ID_ANY,
572
- Wx::DEFAULT_POSITION,
573
- Wx::DEFAULT_SIZE,
574
- Wx::TB_FLAT | Wx::TB_NODIVIDER)
575
- tb1.set_tool_bitmap_size(Wx::Size.new(48, 48))
576
- tb1.add_tool(101, "Test",
577
- Wx::ArtProvider::get_bitmap(Wx::ART_ERROR))
578
+ # prepare a few custom overflow elements for the toolbars' overflow buttons
579
+ append_items = []
580
+ item = Wx::AUI::AuiToolBarItem.new
581
+ item.set_kind(Wx::ItemKind::ITEM_SEPARATOR)
582
+ append_items << item
583
+ item = Wx::AUI::AuiToolBarItem.new
584
+ item.set_kind(Wx::ItemKind::ITEM_NORMAL)
585
+ item.set_id(ID::CustomizeToolbar)
586
+ item.set_label('Customize...')
587
+ append_items << item
588
+
589
+ tb1 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
590
+ Wx::DEFAULT_POSITION,
591
+ Wx::DEFAULT_SIZE,
592
+ Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW)
593
+ # tb1.set_tool_bitmap_size(Wx::Size.new(48, 48))
594
+ tb1.add_tool(ID::SampleItem+1, "Test",
595
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_ERROR))
578
596
  tb1.add_separator
579
- tb1.add_tool(102, "Test",
580
- Wx::ArtProvider::get_bitmap(Wx::ART_QUESTION))
581
- tb1.add_tool(103, "Test",
582
- Wx::ArtProvider::get_bitmap(Wx::ART_INFORMATION))
583
- tb1.add_tool(103, "Test",
584
- Wx::ArtProvider::get_bitmap(Wx::ART_WARNING));
585
- tb1.add_tool(103, "Test",
586
- Wx::ArtProvider::get_bitmap(Wx::ART_MISSING_IMAGE));
597
+ tb1.add_tool(ID::SampleItem+2, "Test",
598
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION))
599
+ tb1.add_tool(ID::SampleItem+3, "Test",
600
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_INFORMATION))
601
+ tb1.add_tool(ID::SampleItem+4, "Test",
602
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_WARNING))
603
+ tb1.add_tool(ID::SampleItem+5, "Test",
604
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_MISSING_IMAGE))
605
+ tb1.set_custom_overflow_items(nil, append_items)
587
606
  tb1.realize
588
607
 
589
- tb2 = Wx::ToolBar.new(self, Wx::ID_ANY, Wx::DEFAULT_POSITION,
590
- Wx::DEFAULT_SIZE,
591
- Wx::TB_FLAT | Wx::TB_NODIVIDER)
592
- tb2.set_tool_bitmap_size(Wx::Size.new(16, 16))
593
-
594
- tb2_bmp1 = Wx::ArtProvider::get_bitmap(Wx::ART_QUESTION,
595
- Wx::ART_OTHER,
596
- Wx::Size.new(16, 16))
597
- tb2.add_tool(101, "Test", tb2_bmp1);
598
- tb2.add_tool(101, "Test", tb2_bmp1);
599
- tb2.add_tool(101, "Test", tb2_bmp1);
600
- tb2.add_tool(101, "Test", tb2_bmp1);
608
+ tb2 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY, Wx::DEFAULT_POSITION,
609
+ Wx::DEFAULT_SIZE,
610
+ Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_HORIZONTAL)
611
+ # tb2.set_tool_bitmap_size(Wx::Size.new(16, 16))
612
+
613
+ tb2_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION,
614
+ Wx::ART_OTHER,
615
+ Wx::Size.new(24, 24))
616
+ tb2.add_tool(ID::SampleItem+6, "Test", tb2_bmp1)
617
+ tb2.add_tool(ID::SampleItem+7, "Test", tb2_bmp1)
618
+ tb2.add_tool(ID::SampleItem+8, "Test", tb2_bmp1)
619
+ tb2.add_tool(ID::SampleItem+9, "Test", tb2_bmp1)
601
620
  tb2.add_separator
602
- tb2.add_tool(101, "Test", tb2_bmp1);
603
- tb2.add_tool(101, "Test", tb2_bmp1);
621
+ tb2.add_tool(ID::SampleItem+10, "Test", tb2_bmp1)
622
+ tb2.add_tool(ID::SampleItem+11, "Test", tb2_bmp1)
604
623
  tb2.add_separator
605
- tb2.add_tool(101, "Test", tb2_bmp1);
606
- tb2.add_tool(101, "Test", tb2_bmp1);
607
- tb2.add_tool(101, "Test", tb2_bmp1);
608
- tb2.add_tool(101, "Test", tb2_bmp1);
624
+ tb2.add_tool(ID::SampleItem+12, "Test", tb2_bmp1)
625
+ tb2.add_tool(ID::SampleItem+13, "Test", tb2_bmp1)
626
+ tb2.add_tool(ID::SampleItem+14, "Test", tb2_bmp1)
627
+ tb2.add_tool(ID::SampleItem+15, "Test", tb2_bmp1)
628
+ tb2.set_custom_overflow_items(nil, append_items)
629
+ tb2.enable_tool(ID::SampleItem+6, false)
609
630
  tb2.realize
610
631
 
611
- tb3 = Wx::ToolBar.new(self, Wx::ID_ANY,
612
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
613
- Wx::TB_FLAT | Wx::TB_NODIVIDER)
614
- tb3.set_tool_bitmap_size(Wx::Size.new(16, 16))
615
- tb3_bmp1 = Wx::ArtProvider::get_bitmap(Wx::ART_FOLDER,
616
- Wx::ART_OTHER,
617
- Wx::Size.new(16, 16))
618
- tb3.add_tool(101, "Test", tb3_bmp1)
619
- tb3.add_tool(101, "Test", tb3_bmp1)
620
- tb3.add_tool(101, "Test", tb3_bmp1)
621
- tb3.add_tool(101, "Test", tb3_bmp1)
632
+ tb3 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
633
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
634
+ Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW)
635
+ # tb3.set_tool_bitmap_size(Wx::Size.new(16, 16))
636
+ tb3_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_FOLDER,
637
+ Wx::ART_OTHER,
638
+ Wx::Size.new(16, 16))
639
+ tb3.add_tool(ID::SampleItem+16, "Check 1", tb3_bmp1, "Check 1", Wx::ItemKind::ITEM_CHECK)
640
+ tb3.add_tool(ID::SampleItem+17, "Check 2", tb3_bmp1, "Check 2", Wx::ItemKind::ITEM_CHECK)
641
+ tb3.add_tool(ID::SampleItem+18, "Check 3", tb3_bmp1, "Check 3", Wx::ItemKind::ITEM_CHECK)
642
+ tb3.add_tool(ID::SampleItem+19, "Check 4", tb3_bmp1, "Check 4", Wx::ItemKind::ITEM_CHECK)
643
+ tb3.add_separator
644
+ tb3.add_tool(ID::SampleItem+20, "Radio 1", tb3_bmp1, "Radio 1", Wx::ItemKind::ITEM_RADIO)
645
+ tb3.add_tool(ID::SampleItem+21, "Radio 2", tb3_bmp1, "Radio 2", Wx::ItemKind::ITEM_RADIO)
646
+ tb3.add_tool(ID::SampleItem+22, "Radio 3", tb3_bmp1, "Radio 3", Wx::ItemKind::ITEM_RADIO)
622
647
  tb3.add_separator
623
- tb3.add_tool(101, "Test", tb3_bmp1)
624
- tb3.add_tool(101, "Test", tb3_bmp1)
648
+ tb3.add_tool(ID::SampleItem+23, "Radio 1 (Group 2)", tb3_bmp1, "Radio 1 (Group 2)", Wx::ItemKind::ITEM_RADIO)
649
+ tb3.add_tool(ID::SampleItem+24, "Radio 2 (Group 2)", tb3_bmp1, "Radio 2 (Group 2)", Wx::ItemKind::ITEM_RADIO)
650
+ tb3.add_tool(ID::SampleItem+25, "Radio 3 (Group 2)", tb3_bmp1, "Radio 3 (Group 2)", Wx::ItemKind::ITEM_RADIO)
651
+ tb3.set_custom_overflow_items(nil, append_items)
625
652
  tb3.realize
626
653
 
627
- tb4 = Wx::ToolBar.new(self, Wx::ID_ANY,
628
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
629
- Wx::TB_FLAT | Wx::TB_NODIVIDER | Wx::TB_HORZ_TEXT)
630
- tb4.set_tool_bitmap_size(Wx::Size.new(16, 16))
631
- tb4_bmp1 = Wx::ArtProvider::get_bitmap(Wx::ART_NORMAL_FILE,
632
- Wx::ART_OTHER,
633
- Wx::Size.new(16, 16))
634
- tb4.add_tool(101, "Item 1", tb4_bmp1)
635
- tb4.add_tool(101, "Item 2", tb4_bmp1)
636
- tb4.add_tool(101, "Item 3", tb4_bmp1)
637
- tb4.add_tool(101, "Item 4", tb4_bmp1)
654
+ tb4 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
655
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
656
+ Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_TEXT | Wx::AUI::AUI_TB_HORZ_TEXT)
657
+ # tb4.set_tool_bitmap_size(Wx::Size.new(16, 16))
658
+ tb4_bmp1 = Wx::ArtProvider::get_bitmap_bundle(Wx::ART_NORMAL_FILE,
659
+ Wx::ART_OTHER,
660
+ Wx::Size.new(16, 16))
661
+ tb4.add_tool(ID::DropDownToolbarItem, "Item 1", tb4_bmp1)
662
+ tb4.add_tool(ID::SampleItem+23, "Item 2", tb4_bmp1)
663
+ tb4.set_tool_sticky(ID::SampleItem+23, true)
664
+ tb4.add_tool(ID::SampleItem+24, "Item 3", tb4_bmp1)
665
+ tb4.enable_tool(ID::SampleItem+24, false)
666
+ tb4.add_tool(ID::SampleItem+25, "Item 4", tb4_bmp1)
638
667
  tb4.add_separator
639
- tb4.add_tool(101, "Item 5", tb4_bmp1)
640
- tb4.add_tool(101, "Item 6", tb4_bmp1)
641
- tb4.add_tool(101, "Item 7", tb4_bmp1)
642
- tb4.add_tool(101, "Item 8", tb4_bmp1)
668
+ tb4.add_tool(ID::SampleItem+26, "Item 5", tb4_bmp1)
669
+ tb4.add_tool(ID::SampleItem+27, "Item 6", tb4_bmp1)
670
+ tb4.add_tool(ID::SampleItem+28, "Item 7", tb4_bmp1)
671
+ tb4.add_tool(ID::SampleItem+29, "Item 8", tb4_bmp1)
672
+ tb4.set_tool_drop_down(ID::DropDownToolbarItem, true)
673
+ tb4.set_custom_overflow_items(nil, append_items)
674
+ choice = Wx::Choice.new(tb4, ID::SampleItem+35)
675
+ choice.append('One choice')
676
+ choice.append('Another choice')
677
+ tb4.add_control(choice)
643
678
  tb4.realize
644
679
 
645
680
  # create some toolbars
646
- tb5 = Wx::ToolBar.new(self, Wx::ID_ANY,
647
- Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
648
- Wx::TB_FLAT | Wx::TB_NODIVIDER | Wx::TB_VERTICAL)
649
- tb5.set_tool_bitmap_size(Wx::Size.new(48, 48))
650
- tb5.add_tool(101, "Test",
651
- Wx::ArtProvider::get_bitmap(Wx::ART_ERROR))
681
+ tb5 = Wx::AUI::AuiToolBar.new(self, Wx::ID_ANY,
682
+ Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
683
+ Wx::AUI::AUI_TB_DEFAULT_STYLE | Wx::AUI::AUI_TB_OVERFLOW | Wx::AUI::AUI_TB_VERTICAL)
684
+ # tb5.set_tool_bitmap_size(Wx::Size.new(48, 48))
685
+ tb5.add_tool(ID::SampleItem+30, "Test",
686
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_ERROR))
652
687
  tb5.add_separator
653
- tb5.add_tool(102, "Test",
654
- Wx::ArtProvider::get_bitmap(Wx::ART_QUESTION))
655
- tb5.add_tool(103, "Test",
656
- Wx::ArtProvider::get_bitmap(Wx::ART_INFORMATION))
657
- tb5.add_tool(103, "Test",
658
- Wx::ArtProvider::get_bitmap(Wx::ART_WARNING))
659
- tb5.add_tool(103, "Test",
660
- Wx::ArtProvider::get_bitmap(Wx::ART_MISSING_IMAGE))
688
+ tb5.add_tool(ID::SampleItem+31, "Test",
689
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_QUESTION))
690
+ tb5.add_tool(ID::SampleItem+32, "Test",
691
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_INFORMATION))
692
+ tb5.add_tool(ID::SampleItem+33, "Test",
693
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_WARNING))
694
+ tb5.add_tool(ID::SampleItem+34, "Test",
695
+ Wx::ArtProvider::get_bitmap_bundle(Wx::ART_MISSING_IMAGE))
696
+ tb5.set_custom_overflow_items(nil, append_items)
661
697
  tb5.realize
662
698
 
663
699
  # add the toolbars to the manager
664
700
  pi = Wx::AuiPaneInfo.new
665
- pi.set_name('tb1').set_caption("Big Toolbar").toolbar_pane
666
- pi.top.set_left_dockable(false).set_right_dockable(false)
701
+ pi.set_name('tb1').set_caption("Big Toolbar").toolbar_pane.top
702
+ # pi.top.set_left_dockable(false).set_right_dockable(false)
667
703
  @mgr.add_pane(tb1, pi)
668
704
 
669
705
  pi = Wx::AuiPaneInfo.new
670
- pi.set_name('tb2').set_caption("Toolbar 2").toolbar_pane
671
- pi.top.set_row(1)
672
- pi.set_left_dockable(false).set_right_dockable(false)
706
+ pi.set_name('tb2').set_caption("Toolbar 2 (horizontal)").toolbar_pane.top.set_row(1)
707
+ # pi.set_left_dockable(false).set_right_dockable(false)
673
708
  @mgr.add_pane(tb2, pi)
674
709
 
675
710
  pi = Wx::AuiPaneInfo.new
676
- pi.set_name('tb3').set_caption("Toolbar 3").toolbar_pane
677
- pi.top.set_row(1).set_position(1)
678
- pi.set_left_dockable(false).set_right_dockable(false)
711
+ pi.set_name('tb3').set_caption("Toolbar 3").toolbar_pane.top.set_row(1).set_position(1)
712
+ # pi.set_left_dockable(false).set_right_dockable(false)
679
713
  @mgr.add_pane(tb3, pi)
680
714
 
681
715
  pi = Wx::AuiPaneInfo.new
682
- pi.set_name('tb4').set_caption("Sample Bookmark Toolbar")
683
- pi.toolbar_pane.top.set_row(2)
684
- pi.set_left_dockable(false).set_right_dockable(false)
716
+ pi.set_name('tb4').set_caption("Sample Bookmark Toolbar").toolbar_pane.top.set_row(2)
717
+ # pi.set_left_dockable(false).set_right_dockable(false)
685
718
  @mgr.add_pane(tb4, pi)
686
719
 
687
720
  pi = Wx::AuiPaneInfo.new
688
- pi.set_name('tb5').set_caption("Sample Vertical Toolbar")
689
- pi.toolbar_pane.left.set_gripper_top
690
- pi.set_left_dockable(false).set_right_dockable(false)
721
+ pi.set_name('tb5').set_caption("Sample Vertical Toolbar").toolbar_pane.left.set_gripper_top
722
+ # pi.set_left_dockable(false).set_right_dockable(false)
691
723
  @mgr.add_pane(tb5, pi)
724
+
725
+ @mgr.add_pane(Wx::Button.new(self, label: 'Test Button'),
726
+ Wx::AUI::AuiPaneInfo.new.set_name('tb6').toolbar_pane.top.set_row(2).set_position(1)
727
+ .set_left_dockable(false).set_right_dockable(false))
692
728
  end
693
729
 
694
730
  def setup_panes
@@ -780,12 +816,6 @@ class AuiFrame < Wx::Frame
780
816
  pi = Wx::AuiPaneInfo.new
781
817
  pi.set_name('notebook_content').center_pane.hide
782
818
  @mgr.add_pane(create_notebook, pi)
783
-
784
- pi = Wx::AuiPaneInfo.new
785
- pi.set_name('tb6').toolbar_pane.top
786
- pi.set_row(2).set_position(1)
787
- pi.set_left_dockable(false).set_right_dockable(false)
788
- @mgr.add_pane(Wx::Button.new(self, Wx::ID_ANY, "Test Button"), pi)
789
819
  end
790
820
 
791
821
  # make some default perspectives
@@ -834,11 +864,11 @@ class AuiFrame < Wx::Frame
834
864
  def on_gradient(event)
835
865
  gradient = nil
836
866
  case event.get_id
837
- when ID_NoGradient
867
+ when ID::NoGradient
838
868
  gradient = Wx::AUI_GRADIENT_NONE
839
- when ID_VerticalGradient
869
+ when ID::VerticalGradient
840
870
  gradient = Wx::AUI_GRADIENT_VERTICAL
841
- when ID_HorizontalGradient
871
+ when ID::HorizontalGradient
842
872
  gradient = Wx::AUI_GRADIENT_HORIZONTAL
843
873
  end
844
874
  return if not gradient
@@ -849,10 +879,10 @@ class AuiFrame < Wx::Frame
849
879
 
850
880
  def on_manager_flag(event)
851
881
  e_id = event.get_id
852
- if e_id == ID_TransparentHint or
853
- e_id == ID_VenetianBlindsHint or
854
- e_id == ID_RectangleHint or
855
- e_id == ID_NoHint
882
+ if e_id == ID::TransparentHint or
883
+ e_id == ID::VenetianBlindsHint or
884
+ e_id == ID::RectangleHint or
885
+ e_id == ID::NoHint
856
886
  flags = @mgr.get_flags
857
887
  flags &= ~Wx::AUI_MGR_TRANSPARENT_HINT
858
888
  flags &= ~Wx::AUI_MGR_VENETIAN_BLINDS_HINT
@@ -862,21 +892,21 @@ class AuiFrame < Wx::Frame
862
892
 
863
893
  flag = nil
864
894
  case e_id
865
- when ID_AllowFloating
895
+ when ID::AllowFloating
866
896
  flag = Wx::AUI_MGR_ALLOW_FLOATING
867
- when ID_TransparentDrag
897
+ when ID::TransparentDrag
868
898
  flag = Wx::AUI_MGR_TRANSPARENT_DRAG
869
- when ID_HintFade
899
+ when ID::HintFade
870
900
  flag = Wx::AUI_MGR_HINT_FADE
871
- when ID_NoVenetianFade
901
+ when ID::NoVenetianFade
872
902
  flag = Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE
873
- when ID_AllowActivePane
903
+ when ID::AllowActivePane
874
904
  flag = Wx::AUI_MGR_ALLOW_ACTIVE_PANE
875
- when ID_TransparentHint
905
+ when ID::TransparentHint
876
906
  flag = Wx::AUI_MGR_TRANSPARENT_HINT
877
- when ID_VenetianBlindsHint
907
+ when ID::VenetianBlindsHint
878
908
  flag = Wx::AUI_MGR_VENETIAN_BLINDS_HINT
879
- when ID_RectangleHint
909
+ when ID::RectangleHint
880
910
  flag = Wx::AUI_MGR_RECTANGLE_HINT
881
911
  end
882
912
 
@@ -890,49 +920,49 @@ class AuiFrame < Wx::Frame
890
920
  def on_notebook_flag(event)
891
921
  e_id = event.get_id
892
922
 
893
- if e_id == ID_NotebookNoCloseButton or
894
- e_id == ID_NotebookCloseButton or
895
- e_id == ID_NotebookCloseButtonAll or
896
- e_id == ID_NotebookCloseButtonActive
923
+ if e_id == ID::NotebookNoCloseButton or
924
+ e_id == ID::NotebookCloseButton or
925
+ e_id == ID::NotebookCloseButtonAll or
926
+ e_id == ID::NotebookCloseButtonActive
897
927
  @notebook_style &= ~(Wx::AUI_NB_CLOSE_BUTTON |
898
928
  Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB |
899
929
  Wx::AUI_NB_CLOSE_ON_ALL_TABS)
900
930
  end
901
931
 
902
932
  case e_id
903
- when ID_NotebookNoCloseButton
933
+ when ID::NotebookNoCloseButton
904
934
  # nothing
905
- when ID_NotebookCloseButton
935
+ when ID::NotebookCloseButton
906
936
  @notebook_style |= Wx::AUI_NB_CLOSE_BUTTON
907
- when ID_NotebookCloseButtonAll
937
+ when ID::NotebookCloseButtonAll
908
938
  @notebook_style |= Wx::AUI_NB_CLOSE_ON_ALL_TABS
909
- when ID_NotebookCloseButtonActive
939
+ when ID::NotebookCloseButtonActive
910
940
  @notebook_style |= Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB
911
941
  end
912
942
 
913
- if e_id == ID_NotebookAllowTabMove
943
+ if e_id == ID::NotebookAllowTabMove
914
944
  @notebook_style ^= Wx::AUI_NB_TAB_MOVE
915
945
  end
916
946
 
917
- if e_id == ID_NotebookAllowTabExternalMove
947
+ if e_id == ID::NotebookAllowTabExternalMove
918
948
  @notebook_style ^= Wx::AUI_NB_TAB_EXTERNAL_MOVE
919
- elsif e_id == ID_NotebookAllowTabSplit
949
+ elsif e_id == ID::NotebookAllowTabSplit
920
950
  @notebook_style ^= Wx::AUI_NB_TAB_SPLIT
921
- elsif e_id == ID_NotebookWindowList
951
+ elsif e_id == ID::NotebookWindowList
922
952
  @notebook_style ^= Wx::AUI_NB_WINDOWLIST_BUTTON
923
- elsif e_id == ID_NotebookScrollButtons
953
+ elsif e_id == ID::NotebookScrollButtons
924
954
  @notebook_style ^= Wx::AUI_NB_SCROLL_BUTTONS
925
- elsif e_id == ID_NotebookTabFixedWidth
955
+ elsif e_id == ID::NotebookTabFixedWidth
926
956
  @notebook_style ^= Wx::AUI_NB_TAB_FIXED_WIDTH
927
957
  end
928
958
 
929
959
  @mgr.each_pane do |pane|
930
960
  maybe_nb = pane.window
931
961
  next unless maybe_nb.kind_of?(Wx::AuiNotebook)
932
- if e_id == ID_NotebookArtGloss
962
+ if e_id == ID::NotebookArtGloss
933
963
  maybe_nb.use_default_art
934
964
  @notebook_theme = 0
935
- elsif e_id == ID_NotebookArtSimple
965
+ elsif e_id == ID::NotebookArtSimple
936
966
  maybe_nb.use_simple_art
937
967
  @notebook_theme = 1
938
968
  end
@@ -946,56 +976,56 @@ class AuiFrame < Wx::Frame
946
976
  flags = @mgr.get_flags
947
977
 
948
978
  case event.get_id
949
- when ID_NoGradient
979
+ when ID::NoGradient
950
980
  event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_NONE)
951
- when ID_VerticalGradient
981
+ when ID::VerticalGradient
952
982
  event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_VERTICAL)
953
- when ID_HorizontalGradient
983
+ when ID::HorizontalGradient
954
984
  event.check(@mgr.get_art_provider.get_metric(Wx::AUI_DOCKART_GRADIENT_TYPE) == Wx::AUI_GRADIENT_HORIZONTAL)
955
- when ID_AllowFloating
985
+ when ID::AllowFloating
956
986
  event.check((flags & Wx::AUI_MGR_ALLOW_FLOATING) != 0)
957
- when ID_TransparentDrag
987
+ when ID::TransparentDrag
958
988
  event.check((flags & Wx::AUI_MGR_TRANSPARENT_DRAG) != 0)
959
- when ID_TransparentHint
989
+ when ID::TransparentHint
960
990
  event.check((flags & Wx::AUI_MGR_TRANSPARENT_HINT) != 0)
961
- when ID_VenetianBlindsHint
991
+ when ID::VenetianBlindsHint
962
992
  event.check((flags & Wx::AUI_MGR_VENETIAN_BLINDS_HINT) != 0)
963
- when ID_RectangleHint
993
+ when ID::RectangleHint
964
994
  event.check((flags & Wx::AUI_MGR_RECTANGLE_HINT) != 0)
965
- when ID_NoHint
995
+ when ID::NoHint
966
996
  event.check((Wx::AUI_MGR_TRANSPARENT_HINT |
967
997
  Wx::AUI_MGR_VENETIAN_BLINDS_HINT |
968
998
  Wx::AUI_MGR_RECTANGLE_HINT) & flags == 0)
969
- when ID_HintFade
999
+ when ID::HintFade
970
1000
  event.check((flags & Wx::AUI_MGR_HINT_FADE) != 0)
971
- when ID_NoVenetianFade
1001
+ when ID::NoVenetianFade
972
1002
  event.check((flags & Wx::AUI_MGR_NO_VENETIAN_BLINDS_FADE) != 0)
973
- when ID_NotebookNoCloseButton
1003
+ when ID::NotebookNoCloseButton
974
1004
  event.check((@notebook_style &
975
1005
  (Wx::AUI_NB_CLOSE_BUTTON |
976
1006
  Wx::AUI_NB_CLOSE_ON_ALL_TABS |
977
1007
  Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB)) != 0)
978
- when ID_NotebookCloseButton
1008
+ when ID::NotebookCloseButton
979
1009
  event.check((@notebook_style & Wx::AUI_NB_CLOSE_BUTTON) != 0)
980
- when ID_NotebookCloseButtonAll
1010
+ when ID::NotebookCloseButtonAll
981
1011
  event.check((@notebook_style & Wx::AUI_NB_CLOSE_ON_ALL_TABS) != 0)
982
- when ID_NotebookCloseButtonActive
1012
+ when ID::NotebookCloseButtonActive
983
1013
  event.check((@notebook_style & Wx::AUI_NB_CLOSE_ON_ACTIVE_TAB) != 0)
984
- when ID_NotebookAllowTabSplit
1014
+ when ID::NotebookAllowTabSplit
985
1015
  event.check((@notebook_style & Wx::AUI_NB_TAB_SPLIT) != 0)
986
- when ID_NotebookAllowTabMove
1016
+ when ID::NotebookAllowTabMove
987
1017
  event.check((@notebook_style & Wx::AUI_NB_TAB_MOVE) != 0)
988
- when ID_NotebookAllowTabExternalMove
1018
+ when ID::NotebookAllowTabExternalMove
989
1019
  event.check((@notebook_style & Wx::AUI_NB_TAB_EXTERNAL_MOVE) != 0)
990
- when ID_NotebookScrollButtons
1020
+ when ID::NotebookScrollButtons
991
1021
  event.check((@notebook_style & Wx::AUI_NB_SCROLL_BUTTONS) != 0)
992
- when ID_NotebookWindowList
1022
+ when ID::NotebookWindowList
993
1023
  event.check((@notebook_style & Wx::AUI_NB_WINDOWLIST_BUTTON) != 0)
994
- when ID_NotebookTabFixedWidth
1024
+ when ID::NotebookTabFixedWidth
995
1025
  event.check((@notebook_style & Wx::AUI_NB_TAB_FIXED_WIDTH) != 0)
996
- when ID_NotebookArtGloss
1026
+ when ID::NotebookArtGloss
997
1027
  event.check(@notebook_style == 0)
998
- when ID_NotebookArtSimple
1028
+ when ID::NotebookArtSimple
999
1029
  event.check(@notebook_style == 1)
1000
1030
  end
1001
1031
  end
@@ -1019,7 +1049,7 @@ class AuiFrame < Wx::Frame
1019
1049
  if @perspectives.length.zero?
1020
1050
  @perspectives_menu.append_separator
1021
1051
  end
1022
- @perspectives_menu.append(ID_FirstPerspective + @perspectives.length,
1052
+ @perspectives_menu.append(ID::FirstPerspective + @perspectives.length,
1023
1053
  dlg.get_value)
1024
1054
  @perspectives << @mgr.save_perspective
1025
1055
  end
@@ -1030,7 +1060,7 @@ class AuiFrame < Wx::Frame
1030
1060
  end
1031
1061
 
1032
1062
  def on_restore_perspective(event)
1033
- perspective = @perspectives[event.get_id - ID_FirstPerspective]
1063
+ perspective = @perspectives[event.get_id - ID::FirstPerspective]
1034
1064
  @mgr.load_perspective(perspective)
1035
1065
  end
1036
1066
 
@@ -1108,15 +1138,54 @@ class AuiFrame < Wx::Frame
1108
1138
 
1109
1139
  def on_change_content_pane(event)
1110
1140
  e_id = event.get_id
1111
- @mgr.get_pane("grid_content").show(e_id == ID_GridContent)
1112
- @mgr.get_pane("text_content").show(e_id == ID_TextContent)
1113
- @mgr.get_pane("tree_content").show(e_id == ID_TreeContent)
1114
- @mgr.get_pane("sizereport_content").show(e_id == ID_SizeReportContent)
1115
- @mgr.get_pane("html_content").show(e_id == ID_HTMLContent)
1116
- @mgr.get_pane("notebook_content").show(e_id == ID_NotebookContent)
1141
+ @mgr.get_pane("grID::content").show(e_id == ID::GridContent)
1142
+ @mgr.get_pane("text_content").show(e_id == ID::TextContent)
1143
+ @mgr.get_pane("tree_content").show(e_id == ID::TreeContent)
1144
+ @mgr.get_pane("sizereport_content").show(e_id == ID::SizeReportContent)
1145
+ @mgr.get_pane("html_content").show(e_id == ID::HTMLContent)
1146
+ @mgr.get_pane("notebook_content").show(e_id == ID::NotebookContent)
1117
1147
  @mgr.update
1118
1148
  end
1119
1149
 
1150
+ def on_drop_down_toolbar_item(evt)
1151
+ if evt.is_drop_down_clicked
1152
+ tb = evt.get_event_object
1153
+
1154
+ tb.set_tool_sticky(evt.id, true)
1155
+
1156
+ # create the popup menu
1157
+ menuPopup = Wx::Menu.new
1158
+
1159
+ bmp = Wx::ArtProvider.get_bitmap_bundle(Wx::ART_QUESTION, Wx::ART_OTHER, from_dip(Wx::Size.new(16,16)))
1160
+
1161
+ m1 = Wx::MenuItem.new(menuPopup, 10001, 'Drop Down Item 1')
1162
+ m1.set_bitmap(bmp)
1163
+ menuPopup.append(m1)
1164
+
1165
+ m2 = Wx::MenuItem.new(menuPopup, 10002, 'Drop Down Item 2')
1166
+ m2.set_bitmap(bmp)
1167
+ menuPopup.append(m2)
1168
+
1169
+ m3 = Wx::MenuItem.new(menuPopup, 10003, 'Drop Down Item 3')
1170
+ m3.set_bitmap(bmp)
1171
+ menuPopup.append(m3)
1172
+
1173
+ m4 = Wx::MenuItem.new(menuPopup, 10004, 'Drop Down Item 4')
1174
+ m4.set_bitmap(bmp)
1175
+ menuPopup.append(m4)
1176
+
1177
+ # line up our menu with the button
1178
+ rect = tb.get_tool_rect(evt.id)
1179
+ pt = tb.client_to_screen(rect.bottom_left)
1180
+ pt = screen_to_client(pt)
1181
+
1182
+ popup_menu(menuPopup, pt)
1183
+
1184
+ # make sure the button is "un-stuck"
1185
+ tb.set_tool_sticky(evt.id, false)
1186
+ end
1187
+ end
1188
+
1120
1189
  def on_exit
1121
1190
  close(true)
1122
1191
  end