wxruby 1.9.9-universal-darwin-9 → 1.9.10-universal-darwin-9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/lib/wx/classes/bitmap.rb +29 -1
  2. data/lib/wx/classes/clipboard.rb +19 -3
  3. data/lib/wx/classes/colour.rb +6 -4
  4. data/lib/wx/classes/data_object.rb +14 -0
  5. data/lib/wx/classes/data_object_simple.rb +6 -0
  6. data/lib/wx/classes/dataformat.rb +23 -0
  7. data/lib/wx/classes/evthandler.rb +31 -4
  8. data/lib/wx/classes/genericdirctrl.rb +36 -0
  9. data/lib/wx/classes/grid.rb +8 -0
  10. data/lib/wx/classes/hboxsizer.rb +6 -0
  11. data/lib/wx/classes/icon.rb +12 -1
  12. data/lib/wx/classes/image.rb +13 -1
  13. data/lib/wx/classes/listctrl.rb +12 -0
  14. data/lib/wx/classes/point.rb +8 -0
  15. data/lib/wx/classes/rect.rb +10 -1
  16. data/lib/wx/classes/richtextctrl.rb +22 -0
  17. data/lib/wx/classes/size.rb +9 -0
  18. data/lib/wx/classes/sizer.rb +18 -3
  19. data/lib/wx/classes/toolbar.rb +4 -6
  20. data/lib/wx/classes/vboxsizer.rb +6 -0
  21. data/lib/wx/classes/window.rb +7 -0
  22. data/lib/wx/classes/xmlresource.rb +17 -0
  23. data/lib/wx/helpers.rb +16 -1
  24. data/lib/wx/keyword_ctors.rb +3 -2
  25. data/lib/wx/keyword_defs.rb +27 -5
  26. data/lib/wx/version.rb +1 -1
  27. data/lib/wxruby2.bundle +0 -0
  28. data/samples/bigdemo/About.rbw +1 -1
  29. data/samples/bigdemo/wxCheckListBox.rbw +40 -50
  30. data/samples/bigdemo/wxListCtrl_virtual.rbw +8 -3
  31. data/samples/bigdemo/wxSashWindow.rbw +2 -2
  32. data/samples/bigdemo/wxTreeCtrl.rbw +4 -3
  33. data/samples/calendar/calendar.rb +143 -158
  34. data/samples/dialogs/dialogs.rb +74 -0
  35. data/samples/etc/toolbar_sizer_additem.rb +55 -0
  36. data/samples/event/update_ui_event.rb +70 -0
  37. data/samples/grid/gridtablebase.rb +43 -29
  38. data/samples/mdi/mdi.rb +22 -14
  39. data/samples/minimal/minimal.rb +3 -3
  40. data/samples/text/format-text-bold.png +0 -0
  41. data/samples/text/format-text-italic.png +0 -0
  42. data/samples/text/format-text-underline.png +0 -0
  43. data/samples/text/rich_textctrl.rb +98 -0
  44. data/samples/text/textctrl.rb +0 -2
  45. data/samples/treectrl/treectrl.rb +10 -18
  46. data/samples/xrc/xrc_sample.rb +48 -68
  47. metadata +15 -3
@@ -8,8 +8,6 @@ end
8
8
  require 'wx'
9
9
 
10
10
  class InformativeTextCtrl < Wx::TextCtrl
11
- NEWLINE_CORRECTION_FACTOR = 0
12
-
13
11
  # These text controls are multiline, and may have rich (coloured,
14
12
  # styled) text in them
15
13
  STYLE = Wx::TE_MULTILINE|Wx::TE_RICH|Wx::TE_RICH2
@@ -679,6 +679,7 @@ end
679
679
  class MyFrame < Wx::Frame
680
680
  def initialize(title, x, y, w, h)
681
681
  super( nil, :title => title, :pos => [ x, y ], :size => [ w, h ] )
682
+ @splitter = nil
682
683
  @treectrl = nil
683
684
  @textctrl = nil
684
685
  @s_num = 0
@@ -772,9 +773,11 @@ class MyFrame < Wx::Frame
772
773
  menu_bar.append(item_menu, "&Item")
773
774
  self.menu_bar = menu_bar
774
775
 
776
+ @splitter = Wx::SplitterWindow.new(self, :style => Wx::SP_BORDER)
777
+ @splitter.minimum_pane_size = 100
775
778
 
776
779
  # create the controls
777
- @textctrl = Wx::TextCtrl.new( self,
780
+ @textctrl = Wx::TextCtrl.new( @splitter,
778
781
  :text => '',
779
782
  :style => Wx::TE_MULTILINE|Wx::SUNKEN_BORDER)
780
783
 
@@ -789,8 +792,9 @@ class MyFrame < Wx::Frame
789
792
  # set our text control as the log target
790
793
  logWindow = Wx::LogTextCtrl.new(@textctrl)
791
794
  Wx::Log::active_target = logWindow
795
+
796
+ @splitter.split_horizontally(@treectrl, @textctrl, 500)
792
797
 
793
- evt_size :on_size
794
798
  evt_close :on_close
795
799
 
796
800
  evt_menu Wx::ID_EXIT, :on_quit
@@ -859,18 +863,18 @@ class MyFrame < Wx::Frame
859
863
  end
860
864
 
861
865
  def create_tree(style)
862
- @treectrl = MyTreeCtrl.new(self, :style => style)
863
- resize
866
+ @treectrl = MyTreeCtrl.new(@splitter, :style => style)
864
867
  end
865
868
 
866
869
  def tog_style(id,flag)
867
-
868
870
  style = @treectrl.window_style_flag ^ flag
869
871
 
870
872
  # most treectrl styles can't be changed on the fly using the native
871
873
  # control and the tree must be recreated
872
- @treectrl.destroy
874
+ old_tree = @treectrl
873
875
  create_tree(style)
876
+ @splitter.replace_window old_tree, @treectrl
877
+ old_tree.destroy
874
878
  menu_bar.check(id, (style & flag) != 0)
875
879
  end
876
880
 
@@ -926,18 +930,6 @@ class MyFrame < Wx::Frame
926
930
  do_sort(true)
927
931
  end
928
932
 
929
- def on_size(event)
930
- if @treectrl && @textctrl
931
- resize
932
- end
933
- event.skip
934
- end
935
-
936
- def resize
937
- my_size = self.client_size
938
- @treectrl.size = [ my_size.x, 2 * my_size.y / 3 ]
939
- end
940
-
941
933
  def on_close(event)
942
934
  Wx::Log::active_target = nil
943
935
  destroy
@@ -9,88 +9,68 @@ require 'wx'
9
9
 
10
10
  # Basic Frame Class. This creates the dialog window
11
11
  class SimpleFrame < Wx::Frame
12
+ def initialize()
13
+ super nil, :title => "Sample", :position => [50, 50], :size => [300, 300]
12
14
 
13
- FILE_DIALOG = 1001
14
-
15
- def initialize()
16
- super(nil,-1,"Sample",Wx::Point.new(50,50),Wx::Size.new(300,300))
17
- txt = "Choose 'Open Dialog' from the menu to see a dialog made with XRC"
18
- Wx::StaticText.new( self, -1, txt, Wx::Point.new(10, 10) )
15
+ txt = "Choose 'Open Dialog' from the menu to see a dialog made with XRC"
16
+ Wx::StaticText.new self, :label => txt, :position => [20, 20]
19
17
 
20
- # Create a new menu
21
- bar = Wx::MenuBar.new()
22
- menu = Wx::Menu.new()
23
- menu.append(FILE_DIALOG,"Open Dialog")
24
- menu.append(Wx::ID_EXIT,"Quit")
25
- bar.append(menu,"File")
26
-
27
- set_menu_bar(bar)
28
-
29
- #
30
- # Assign the menu events
31
- #
32
- evt_menu(FILE_DIALOG) do
33
- SimpleDialog.new(self).show_modal()
34
- end
35
-
36
- evt_menu(Wx::ID_EXIT) do
37
- puts Wx::get_app.get_app_name
38
- Wx::get_app.exit_main_loop()
39
- end
40
-
41
- evt_close() do
42
- Wx::get_app.exit_main_loop()
43
- end
44
- end
45
-
18
+ # Create a new menu
19
+ self.menu_bar = Wx::MenuBar.new
20
+ menu = Wx::Menu.new
21
+ menu.append Wx::ID_OPEN, "Open Dialog"
22
+ menu.append Wx::ID_EXIT, "Quit"
23
+ menu_bar.append(menu,"File")
24
+
25
+ # Assign the menu events
26
+ evt_menu(Wx::ID_OPEN) { SimpleDialog.new(self).show_modal }
27
+ evt_menu(Wx::ID_EXIT) { close }
28
+ end
46
29
  end
47
30
 
48
31
  # Dialog subclass. The components within the dialog are loaded from XRC.
49
32
  class SimpleDialog < Wx::Dialog
50
- def initialize(parent)
51
- # To load a layout defined in XRC into a Ruby subclass of Dialog,
52
- # first call the empty constructor. All the details of size,
53
- # title, position and so on are loaded from the XRC by the call to
54
- # load_frame_subclass. Using a non-empty constructor will cause
55
- # errors on GTK.
56
- super()
57
-
58
- # Load the dialog from XRC. We define $xml in on_init.
59
- # We could use XmlResource.get() over and over again, but
60
- # honestly, thats just too much work.
61
- $xml.load_dialog_subclass(self,parent,'SAMPLE_DIALOG')
33
+ def initialize(parent)
34
+ # To load a layout defined in XRC into a Ruby subclass of Dialog,
35
+ # first call the empty constructor. All the details of size,
36
+ # title, position and so on are loaded from the XRC by the call to
37
+ # load_frame_subclass. Using a non-empty constructor will cause
38
+ # errors on GTK.
39
+ super()
40
+
41
+ # Load the dialog from XRC. We define $xml in on_init.
42
+ # We could use XmlResource.get() over and over again, but
43
+ # honestly, thats just too much work.
44
+ $xml.load_dialog_subclass(self,parent,'SAMPLE_DIALOG')
62
45
 
63
- # Get the buttons. The xrcid method turns a string identifier
64
- # used in an xml file into a numeric identifier as used in
65
- # wxruby.
66
- @ok = find_window_by_id( Wx::xrcid('wxID_OK') )
67
- @cancel = find_window_by_id( Wx::xrcid('wxID_CANCEL') )
68
- @message = find_window_by_id( Wx::xrcid('SAMPLE_MESSAGE') )
46
+ # Get the buttons. The xrcid method turns a string identifier
47
+ # used in an xml file into a numeric identifier as used in
48
+ # wxruby.
49
+ @ok = find_window_by_id( Wx::xrcid('wxID_OK') )
50
+ @cancel = find_window_by_id( Wx::xrcid('wxID_CANCEL') )
51
+ @message = find_window_by_id( Wx::xrcid('SAMPLE_MESSAGE') )
69
52
 
70
- # Bind the buttons to event handlers
71
- evt_button( @ok.get_id ) { end_modal(Wx::ID_OK) }
72
- evt_button( @cancel.get_id ) { end_modal(Wx::ID_CANCEL) }
73
- evt_button( @message.get_id ) do
74
- Wx::message_box("And now a message from our sponsors.")
75
- end
76
- end
53
+ # Bind the buttons to event handlers
54
+ evt_button(@ok) { end_modal(Wx::ID_OK) }
55
+ evt_button(@cancel) { end_modal(Wx::ID_CANCEL) }
56
+ evt_button(@message) do
57
+ Wx::message_box("And now a message from our sponsors.")
58
+ end
59
+ end
77
60
  end
78
61
 
79
- #
80
62
  # Application class.
81
- #
82
63
  class XrcApp < Wx::App
83
64
 
84
- def on_init
85
- # Get a new resources object
86
- xrc_file = File.join( File.dirname(__FILE__), 'samples.xrc' )
87
- $xml = Wx::XmlResource.new(xrc_file)
88
-
89
- # Show the main frame.
90
- main = SimpleFrame.new()
91
- main.show(true)
92
- end
65
+ def on_init
66
+ # Get a new resources object
67
+ xrc_file = File.join( File.dirname(__FILE__), 'samples.xrc' )
68
+ $xml = Wx::XmlResource.new(xrc_file)
93
69
 
70
+ # Show the main frame.
71
+ main = SimpleFrame.new()
72
+ main.show(true)
73
+ end
94
74
  end
95
75
 
96
76
  XrcApp.new.main_loop()
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wxruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.9
4
+ version: 1.9.10
5
5
  platform: universal-darwin-9
6
6
  authors:
7
7
  - wxRuby development team
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-31 00:00:00 +00:00
12
+ date: 2009-02-04 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -40,13 +40,18 @@ files:
40
40
  - lib/wx/classes/combobox.rb
41
41
  - lib/wx/classes/commandevent.rb
42
42
  - lib/wx/classes/controlwithitems.rb
43
+ - lib/wx/classes/data_object.rb
44
+ - lib/wx/classes/data_object_simple.rb
45
+ - lib/wx/classes/dataformat.rb
43
46
  - lib/wx/classes/dc.rb
44
47
  - lib/wx/classes/event.rb
45
48
  - lib/wx/classes/evthandler.rb
46
49
  - lib/wx/classes/font.rb
47
50
  - lib/wx/classes/functions.rb
48
51
  - lib/wx/classes/gauge.rb
52
+ - lib/wx/classes/genericdirctrl.rb
49
53
  - lib/wx/classes/grid.rb
54
+ - lib/wx/classes/hboxsizer.rb
50
55
  - lib/wx/classes/helpcontroller.rb
51
56
  - lib/wx/classes/helpcontrollerhelpprovider.rb
52
57
  - lib/wx/classes/helpprovider.rb
@@ -81,6 +86,7 @@ files:
81
86
  - lib/wx/classes/toolbar.rb
82
87
  - lib/wx/classes/toolbartool.rb
83
88
  - lib/wx/classes/treectrl.rb
89
+ - lib/wx/classes/vboxsizer.rb
84
90
  - lib/wx/classes/window.rb
85
91
  - lib/wx/classes/xmlresource.rb
86
92
  - lib/wx/helpers.rb
@@ -241,9 +247,11 @@ files:
241
247
  - samples/etc/scrollwin.rb
242
248
  - samples/etc/system_settings.rb
243
249
  - samples/etc/threaded.rb
250
+ - samples/etc/toolbar_sizer_additem.rb
244
251
  - samples/etc/wizard.rb
245
252
  - samples/event
246
253
  - samples/event/event.rb
254
+ - samples/event/update_ui_event.rb
247
255
  - samples/grid
248
256
  - samples/grid/grid.rb
249
257
  - samples/grid/gridtablebase.rb
@@ -277,8 +285,12 @@ files:
277
285
  - samples/sockets/wxServer.rb
278
286
  - samples/sockets/wxSocketGUI.rb
279
287
  - samples/text
288
+ - samples/text/format-text-bold.png
289
+ - samples/text/format-text-italic.png
290
+ - samples/text/format-text-underline.png
280
291
  - samples/text/mondrian.ico
281
292
  - samples/text/mondrian.xpm
293
+ - samples/text/rich_textctrl.rb
282
294
  - samples/text/scintilla.rb
283
295
  - samples/text/textctrl.rb
284
296
  - samples/text/unicode.rb
@@ -317,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
317
329
  requirements: []
318
330
 
319
331
  rubyforge_project: wxruby
320
- rubygems_version: 1.1.1
332
+ rubygems_version: 1.3.1
321
333
  signing_key:
322
334
  specification_version: 2
323
335
  summary: Ruby interface to the wxWidgets GUI library