wxruby 1.9.8-x86-mswin32-60 → 1.9.9-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
data/lib/wx.rb CHANGED
@@ -45,8 +45,8 @@ require 'wx/keyword_defs'
45
45
  # Wx clean-up routines called by Wx::App#on_exit. This can under some
46
46
  # circumstances cause crashes as the application ends.
47
47
  Kernel::at_exit do
48
- # This is set in wxRubyApp.OnExit (see swig/classes/App.i)
49
- if not $__wx_app_ended__
48
+ # These are set at App startup and wxRuby shut down respectively - see App.i
49
+ if Wx::const_defined?(:THE_APP) and not $__wx_app_ended__
50
50
  Wx::THE_APP.on_exit
51
51
  end
52
52
  end
@@ -42,8 +42,14 @@ module WxRubyStyleAccessors
42
42
  end
43
43
  end
44
44
 
45
- all_classes = Wx::constants.collect { | c | Wx::const_get(c) }.grep(Class)
45
+ # Allow Wx-global functions to be accessed with nice syntax
46
+ module Wx
47
+ extend WxRubyStyleAccessors
48
+ end
46
49
 
50
+ # Apply the syntax extensions to every class, both class methods and
51
+ # instance methods
52
+ all_classes = Wx::constants.collect { | c | Wx::const_get(c) }.grep(Class)
47
53
  all_classes.each do | klass |
48
54
  klass.class_eval do
49
55
  include WxRubyStyleAccessors
@@ -37,9 +37,15 @@ class Wx::App
37
37
  # second. This should help ferret out bugs in memory management more
38
38
  # quickly.
39
39
  def gc_stress(interval = 1)
40
- t = Wx::Timer.new(self, 9999)
41
- evt_timer(9999) { Thread.pass }
42
- Thread.new { loop { sleep interval; GC.start } }
43
- t.start(100)
40
+ # Ruby 1.9 provides this built-in version, but doesn't like the 1.8
41
+ # version at all - results in frequent segfaults.
42
+ if RUBY_VERSION >= "1.9.0"
43
+ GC.stress
44
+ else # Ruby 1.8
45
+ t = Wx::Timer.new(self, 9999)
46
+ evt_timer(9999) { Thread.pass }
47
+ Thread.new { loop { sleep interval; GC.start } }
48
+ t.start(100)
49
+ end
44
50
  end
45
51
  end
@@ -625,6 +625,9 @@ class Wx::EvtHandler
625
625
  EventType['evt_moving', 0,
626
626
  Wx::EVT_MOVING,
627
627
  Wx::MoveEvent],
628
+ EventType['evt_navigation_key', 0,
629
+ Wx::EVT_NAVIGATION_KEY,
630
+ Wx::NavigationKeyEvent],
628
631
  EventType['evt_nc_paint', 0,
629
632
  Wx::EVT_NC_PAINT,
630
633
  Wx::Event],
@@ -649,6 +652,51 @@ class Wx::EvtHandler
649
652
  EventType['evt_radiobutton', 1,
650
653
  Wx::EVT_COMMAND_RADIOBUTTON_SELECTED,
651
654
  Wx::CommandEvent],
655
+ EventType['evt_richtext_character', 1,
656
+ Wx::EVT_COMMAND_RICHTEXT_CHARACTER,
657
+ Wx::RichTextEvent],
658
+ EventType['evt_richtext_content_inserted', 1,
659
+ Wx::EVT_COMMAND_RICHTEXT_CONTENT_INSERTED,
660
+ Wx::RichTextEvent],
661
+ EventType['evt_richtext_content_deleted', 1,
662
+ Wx::EVT_COMMAND_RICHTEXT_CONTENT_DELETED,
663
+ Wx::RichTextEvent],
664
+ EventType['evt_richtext_delete', 1,
665
+ Wx::EVT_COMMAND_RICHTEXT_DELETE,
666
+ Wx::RichTextEvent],
667
+ EventType['evt_richtext_left_click', 1,
668
+ Wx::EVT_COMMAND_RICHTEXT_LEFT_CLICK,
669
+ Wx::RichTextEvent],
670
+ EventType['evt_richtext_left_dclick', 1,
671
+ Wx::EVT_COMMAND_RICHTEXT_LEFT_DCLICK,
672
+ Wx::RichTextEvent],
673
+ EventType['evt_richtext_middle_click', 1,
674
+ Wx::EVT_COMMAND_RICHTEXT_MIDDLE_CLICK,
675
+ Wx::RichTextEvent],
676
+ EventType['evt_richtext_return', 1,
677
+ Wx::EVT_COMMAND_RICHTEXT_RETURN,
678
+ Wx::RichTextEvent],
679
+ EventType['evt_richtext_right_click', 1,
680
+ Wx::EVT_COMMAND_RICHTEXT_RIGHT_CLICK,
681
+ Wx::RichTextEvent],
682
+ EventType['evt_richtext_selection_changed', 1,
683
+ Wx::EVT_COMMAND_RICHTEXT_SELECTION_CHANGED,
684
+ Wx::RichTextEvent],
685
+ EventType['evt_richtext_style_changed', 1,
686
+ Wx::EVT_COMMAND_RICHTEXT_STYLE_CHANGED,
687
+ Wx::RichTextEvent],
688
+ EventType['evt_richtext_stylesheet_changed', 1,
689
+ Wx::EVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED,
690
+ Wx::RichTextEvent],
691
+ EventType['evt_richtext_stylesheet_changing', 1,
692
+ Wx::EVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING,
693
+ Wx::RichTextEvent],
694
+ EventType['evt_richtext_stylesheet_replaced', 1,
695
+ Wx::EVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED,
696
+ Wx::RichTextEvent],
697
+ EventType['evt_richtext_stylesheet_replacing', 1,
698
+ Wx::EVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING,
699
+ Wx::RichTextEvent],
652
700
  EventType['evt_right_dclick', 0,
653
701
  Wx::EVT_RIGHT_DCLICK,
654
702
  Wx::MouseEvent],
@@ -0,0 +1,41 @@
1
+ # Text editor supporting various formatting, intended for editing
2
+ # natural language texts
3
+ class Wx::RichTextCtrl
4
+ # These three methods return the styles applicable at certain points
5
+ # in the document. However, the standard wx signature is to accept the
6
+ # value of some kind of TextAttr class that will hold the return as an
7
+ # argument. The return value is a boolean for success/failure. In
8
+ # Ruby, we only support returning the value as a RichTextAttr, and do
9
+ # so as a proper return value, having accepted a single argument
10
+ # specifying where to get the style from. If retrieval is not
11
+ # successful, raise an exception.
12
+ wx_get_style = self.instance_method(:get_style)
13
+ define_method(:get_style) do | pos |
14
+ style = Wx::RichTextAttr.new
15
+ if wx_get_style.bind(self).call(pos, style)
16
+ return style
17
+ else
18
+ Kernel.raise RuntimeError, "Could not retrieve style at position #{pos}"
19
+ end
20
+ end
21
+
22
+ wx_get_style_for_range = self.instance_method(:get_style_for_range)
23
+ define_method(:get_style_for_range) do | rng |
24
+ style = Wx::RichTextAttr.new
25
+ if wx_get_style_for_range.bind(self).call(rng, style)
26
+ return style
27
+ else
28
+ Kernel.raise RuntimeError, "Could not retrieve style for range #{rng}"
29
+ end
30
+ end
31
+
32
+ wx_get_uncombined_style = self.instance_method(:get_uncombined_style)
33
+ define_method(:get_uncombined_style) do | pos |
34
+ style = Wx::RichTextAttr.new
35
+ if wx_get_uncombined_style.bind(self).call(pos, style)
36
+ return style
37
+ else
38
+ Kernel.raise RuntimeError, "Could not retrieve style at position #{pos}"
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,9 @@
1
+ # Access OS-standard locations for user files, config files etc
2
+ class Wx::StandardPaths
3
+ class << self
4
+ # Expose instance methods as class methods in Ruby
5
+ Wx::StandardPaths.instance_methods(false).each do | meth |
6
+ define_method(meth) { get.send(meth) }
7
+ end
8
+ end
9
+ end
@@ -1,6 +1,18 @@
1
+ # Event fired when a user clicks or hovers over a hyperlink in a TextCtrl
1
2
  class Wx::TextUrlEvent
2
- # Returns the string URL that is being interacted with in this event
3
+ # Returns the string URL that is being interacted with in this event
3
4
  def get_url
4
- get_event_object.get_value[get_url_start .. get_url_end]
5
+ text_ctrl = event_object
6
+ # In the standard TextCtrl, the relevant URL is always the same as
7
+ # the text clicked on, because all it does is highlight text that
8
+ # look like a URL. In RichTextCtrl, however, the URL value can be
9
+ # applied to any text (more like HTML), and so the URL has be
10
+ # retrieved by getting the applied RichTextAttr style and inspecting
11
+ # its property.
12
+ if text_ctrl.kind_of?(Wx::RichTextCtrl)
13
+ return text_ctrl.get_style(url_start).url
14
+ else
15
+ return text_ctrl.value[url_start .. url_end]
16
+ end
5
17
  end
6
18
  end
@@ -505,3 +505,32 @@ Wx::define_keyword_ctors('AnimationCtrl') do
505
505
  wx_ctor_params :name => 'animationCtrl'
506
506
  end
507
507
 
508
+ Wx::define_keyword_ctors('VScrolledWindow') do
509
+ wx_ctor_params :id, :pos, :size, :style, :name => 'VScrolledWindowNameStr'
510
+ end
511
+
512
+ Wx::define_keyword_ctors('VListBox') do
513
+ wx_ctor_params :id, :pos, :size, :style, :name => 'VListBoxNameStr'
514
+ end
515
+
516
+ Wx::define_keyword_ctors('HtmlListBox') do
517
+ wx_ctor_params :id, :pos, :size, :style, :name => 'HtmlListBoxNameStr'
518
+ end
519
+
520
+ Wx::define_keyword_ctors('RichTextCtrl') do
521
+ wx_ctor_params :id, :value => ''
522
+ wx_ctor_params :pos, :size, :style => Wx::TE_MULTILINE
523
+ wx_ctor_params :validator, :name => 'textCtrl'
524
+ end
525
+
526
+ Wx::define_keyword_ctors('RichTextStyleListBox') do
527
+ wx_ctor_params :id, :pos, :size, :style
528
+ end
529
+
530
+ Wx::define_keyword_ctors('RichTextStyleListCtrl') do
531
+ wx_ctor_params :id, :pos, :size, :style
532
+ end
533
+
534
+ # FIXME - SymbolPickerDialog is hard to because the parent argument is
535
+ # in a strange place.
536
+
@@ -1,3 +1,3 @@
1
1
  module Wx
2
- WXRUBY_VERSION = '1.9.8'
2
+ WXRUBY_VERSION = '1.9.9'
3
3
  end
Binary file
Binary file
Binary file
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.8
4
+ version: 1.9.9
5
5
  platform: x86-mswin32-60
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-09-04 00:00:00 +01:00
12
+ date: 2008-10-31 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -68,10 +68,12 @@ files:
68
68
  - lib/wx/classes/point.rb
69
69
  - lib/wx/classes/previewframe.rb
70
70
  - lib/wx/classes/rect.rb
71
+ - lib/wx/classes/richtextctrl.rb
71
72
  - lib/wx/classes/simplehelpprovider.rb
72
73
  - lib/wx/classes/size.rb
73
74
  - lib/wx/classes/sizer.rb
74
75
  - lib/wx/classes/sound.rb
76
+ - lib/wx/classes/standardpaths.rb
75
77
  - lib/wx/classes/styledtextctrl.rb
76
78
  - lib/wx/classes/textctrl.rb
77
79
  - lib/wx/classes/texturlevent.rb
@@ -86,6 +88,8 @@ files:
86
88
  - lib/wx/keyword_defs.rb
87
89
  - lib/wx/version.rb
88
90
  - lib/wx.rb
91
+ - lib/wxruby2.exp
92
+ - lib/wxruby2.lib
89
93
  - lib/wxruby2.so
90
94
  - samples/aui
91
95
  - samples/aui/aui.rb