wxruby 1.9.5-universal-darwin-9 → 1.9.6-universal-darwin-9
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.
- data/lib/wx/classes/acceleratortable.rb +28 -0
- data/lib/wx/classes/animation.rb +18 -0
- data/lib/wx/classes/bitmap.rb +5 -0
- data/lib/wx/classes/busycursor.rb +12 -0
- data/lib/wx/classes/evthandler.rb +36 -21
- data/lib/wx/classes/functions.rb +44 -0
- data/lib/wx/classes/grid.rb +16 -7
- data/lib/wx/classes/htmlwindow.rb +8 -0
- data/lib/wx/classes/icon.rb +7 -0
- data/lib/wx/classes/iconbundle.rb +3 -0
- data/lib/wx/classes/image.rb +17 -0
- data/lib/wx/classes/imagelist.rb +3 -0
- data/lib/wx/classes/toolbartool.rb +4 -0
- data/lib/wx/classes/xmlresource.rb +21 -0
- data/lib/wx/keyword_ctors.rb +9 -6
- data/lib/wx/keyword_defs.rb +7 -0
- data/lib/wx/version.rb +1 -1
- data/lib/wxruby2.bundle +0 -0
- data/samples/aui/aui.rb +6 -10
- data/samples/bigdemo/About.rbw +0 -0
- data/samples/bigdemo/ColorPanel.rbw +7 -9
- data/samples/bigdemo/GridSimple.rbw +7 -9
- data/samples/bigdemo/MDIDemo.rbw +7 -9
- data/samples/bigdemo/PopupMenu.rbw +7 -9
- data/samples/bigdemo/ShapedWindow.rbw +6 -10
- data/samples/bigdemo/Sizers.rbw +7 -9
- data/samples/bigdemo/bigdemo.rb +24 -25
- data/samples/bigdemo/demoTemplate.rbw +6 -10
- data/samples/bigdemo/run.rb +6 -10
- data/samples/bigdemo/utils.rb +0 -0
- data/samples/bigdemo/wxArtProvider.rbw +6 -10
- data/samples/bigdemo/wxBitmapButton.rbw +42 -41
- data/samples/bigdemo/wxButton.rbw +7 -9
- data/samples/bigdemo/wxCalendarCtrl.rbw +41 -53
- data/samples/bigdemo/wxCheckBox.rbw +7 -9
- data/samples/bigdemo/wxCheckListBox.rbw +7 -9
- data/samples/bigdemo/wxChoice.rbw +7 -9
- data/samples/bigdemo/wxChoicebook.rbw +7 -9
- data/samples/bigdemo/wxColourDialog.rbw +7 -10
- data/samples/bigdemo/wxComboBox.rbw +7 -9
- data/samples/bigdemo/wxCursor.rbw +6 -10
- data/samples/bigdemo/wxDialog.rbw +7 -9
- data/samples/bigdemo/wxDirDialog.rbw +7 -10
- data/samples/bigdemo/wxDragImage.rbw +6 -10
- data/samples/bigdemo/wxFileDialog.rbw +7 -9
- data/samples/bigdemo/wxFileDialog_Save.rbw +7 -10
- data/samples/bigdemo/wxFindReplaceDialog.rbw +7 -10
- data/samples/bigdemo/wxFontDialog.rbw +7 -10
- data/samples/bigdemo/wxFrame.rbw +7 -9
- data/samples/bigdemo/wxGauge.rbw +7 -9
- data/samples/bigdemo/wxGenericDirCtrl.rbw +6 -10
- data/samples/bigdemo/wxGrid.rbw +7 -9
- data/samples/bigdemo/wxHtmlHelpController.rbw +6 -11
- data/samples/bigdemo/wxListBox.rbw +7 -9
- data/samples/bigdemo/wxListCtrl_virtual.rbw +7 -9
- data/samples/bigdemo/wxMDIWindows.rbw +7 -9
- data/samples/bigdemo/wxMenu.rbw +7 -9
- data/samples/bigdemo/wxMessageDialog.rbw +7 -10
- data/samples/bigdemo/wxMiniFrame.rbw +6 -10
- data/samples/bigdemo/wxMultipleChoiceDialog.rbw +7 -9
- data/samples/bigdemo/wxNotebook.rbw +7 -9
- data/samples/bigdemo/wxProgressDialog.rbw +7 -9
- data/samples/bigdemo/wxRadioBox.rbw +7 -9
- data/samples/bigdemo/wxRadioButton.rbw +7 -9
- data/samples/bigdemo/wxSashWindow.rbw +6 -10
- data/samples/bigdemo/wxScrolledMessageDialog.rbw +7 -9
- data/samples/bigdemo/wxScrolledWindow.rbw +7 -9
- data/samples/bigdemo/wxSingleChoiceDialog.rbw +7 -9
- data/samples/bigdemo/wxSlider.rbw +7 -9
- data/samples/bigdemo/wxSpinButton.rbw +7 -9
- data/samples/bigdemo/wxSpinCtrl.rbw +7 -9
- data/samples/bigdemo/wxSplitterWindow.rbw +7 -9
- data/samples/bigdemo/wxStaticBitmap.rbw +7 -9
- data/samples/bigdemo/wxStaticText.rbw +7 -9
- data/samples/bigdemo/wxStatusBar.rbw +7 -9
- data/samples/bigdemo/wxTextCtrl.rbw +7 -9
- data/samples/bigdemo/wxTextEntryDialog.rbw +7 -10
- data/samples/bigdemo/wxToggleButton.rbw +7 -9
- data/samples/bigdemo/wxToolBar.rbw +7 -9
- data/samples/bigdemo/wxTreeCtrl.rbw +7 -9
- data/samples/calendar/calendar.rb +6 -10
- data/samples/caret/caret.rb +6 -10
- data/samples/controls/controls.rb +6 -10
- data/samples/controls/get_item_sample.rb +0 -0
- data/samples/dialogs/dialogs.rb +10 -11
- data/samples/drawing/graphics_drawing.rb +6 -7
- data/samples/drawing/images.rb +5 -10
- data/samples/drawing/paperclip.png +0 -0
- data/samples/etc/activation.rb +4 -10
- data/samples/etc/choice.rb +5 -10
- data/samples/etc/miniframe.rb +5 -10
- data/samples/etc/sash.rb +5 -10
- data/samples/etc/scrollwin.rb +4 -10
- data/samples/etc/system_settings.rb +4 -10
- data/samples/etc/threaded.rb +4 -10
- data/samples/etc/wizard.rb +5 -10
- data/samples/event/event.rb +3 -5
- data/samples/grid/grid.rb +5 -9
- data/samples/grid/gridtablebase.rb +134 -0
- data/samples/html/html.rb +4 -10
- data/samples/listbook/listbook.rb +4 -11
- data/samples/mdi/mdi.rb +5 -10
- data/samples/media/mediactrl.rb +4 -10
- data/samples/minimal/minimal.rb +18 -26
- data/samples/minimal/nothing.rb +5 -10
- data/samples/opengl/cube.rb +8 -14
- data/samples/printing/mondrian.ico +0 -0
- data/samples/printing/mondrian.xpm +0 -0
- data/samples/printing/printing.rb +5 -179
- data/samples/text/mondrian.ico +0 -0
- data/samples/text/mondrian.xpm +0 -0
- data/samples/text/scintilla.rb +5 -10
- data/samples/text/textctrl.rb +27 -38
- data/samples/text/unicode.rb +6 -2
- data/samples/treectrl/treectrl.rb +4 -10
- data/samples/xrc/xrc_sample.rb +6 -17
- metadata +11 -3
| @@ -0,0 +1,28 @@ | |
| 1 | 
            +
            class Wx::AcceleratorTable
         | 
| 2 | 
            +
              # Allow new to be called as []
         | 
| 3 | 
            +
              class << self
         | 
| 4 | 
            +
                alias :[] :new
         | 
| 5 | 
            +
              end
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              # Allow initialize to be called with a splat-like list of arguments,
         | 
| 8 | 
            +
              # and allow entries to be specified in terser form [mod, key, id]
         | 
| 9 | 
            +
              # rather than full AcceleratorEntry.new call.
         | 
| 10 | 
            +
              wx_init = self.instance_method(:initialize)
         | 
| 11 | 
            +
              define_method(:initialize) do | *args |
         | 
| 12 | 
            +
                # Test for old-style arg passing in a single array
         | 
| 13 | 
            +
                if args.length == 1 and args.first.kind_of?(Array) and
         | 
| 14 | 
            +
                   args.first.all? { | e | e.kind_of?(Wx::AcceleratorEntry) }
         | 
| 15 | 
            +
                  args = args[0]
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
                # Convert to array of AccEntries, to pass in as single array
         | 
| 18 | 
            +
                args = args.map do | entry |
         | 
| 19 | 
            +
                  case entry 
         | 
| 20 | 
            +
                  when Wx::AcceleratorEntry then entry
         | 
| 21 | 
            +
                  when Array then Wx::AcceleratorEntry.new(*entry)
         | 
| 22 | 
            +
                  else Kernel.raise ArgumentError,
         | 
| 23 | 
            +
                                    "#{entry.inspect} is not a valid AcceleratorTable entry"
         | 
| 24 | 
            +
                  end
         | 
| 25 | 
            +
                end
         | 
| 26 | 
            +
                wx_init.bind(self).call(args)
         | 
| 27 | 
            +
              end
         | 
| 28 | 
            +
            end
         | 
| @@ -0,0 +1,18 @@ | |
| 1 | 
            +
            class Wx::Animation < Wx::GDIObject
         | 
| 2 | 
            +
              # Redefine the initialize method so it raises an exception if a
         | 
| 3 | 
            +
              # non-existent file is given to the constructor; otherwise, wx Widgets
         | 
| 4 | 
            +
              # just carries on with an empty bitmap, which may cause faults later
         | 
| 5 | 
            +
              wx_init = self.instance_method(:initialize)
         | 
| 6 | 
            +
              define_method(:initialize) do | *args |
         | 
| 7 | 
            +
                if args[0].kind_of? String
         | 
| 8 | 
            +
                  if not File.exist?( File.expand_path(args[0]) )
         | 
| 9 | 
            +
                    Kernel.raise( ArgumentError, 
         | 
| 10 | 
            +
                                  "Animation file does not exist: #{args[0]}" )
         | 
| 11 | 
            +
                  end
         | 
| 12 | 
            +
                  res = wx_init.bind(self).call()
         | 
| 13 | 
            +
                  res.load_file(args[0], args[1] || Wx::ANIMATION_TYPE_ANY)
         | 
| 14 | 
            +
                else
         | 
| 15 | 
            +
                  wx_init.bind(self).call(*args)
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
              end
         | 
| 18 | 
            +
            end
         | 
    
        data/lib/wx/classes/bitmap.rb
    CHANGED
    
    | @@ -1,4 +1,9 @@ | |
| 1 1 | 
             
            class Wx::Bitmap
         | 
| 2 | 
            +
              # Constructor copying data from an image
         | 
| 3 | 
            +
              def self.from_image(img, depth = -1)
         | 
| 4 | 
            +
                new(img, depth)
         | 
| 5 | 
            +
              end
         | 
| 6 | 
            +
             | 
| 2 7 | 
             
              # Redefine the initialize method so it raises an exception if a
         | 
| 3 8 | 
             
              # non-existent file is given to the constructor; otherwise, wx Widgets
         | 
| 4 9 | 
             
              # just carries on with an empty bitmap, which may cause faults later
         | 
| @@ -0,0 +1,12 @@ | |
| 1 | 
            +
            # Emulates the wxWidgets BusyCursor class, by providing a scope within
         | 
| 2 | 
            +
            # which a busy cursor will be shown
         | 
| 3 | 
            +
            class Wx::BusyCursor
         | 
| 4 | 
            +
              # Only one class method, optionally accepting a cursor that should be
         | 
| 5 | 
            +
              # shown, defaulting to an hour glass cursor.
         | 
| 6 | 
            +
              def self.busy(cursor = Wx::HOURGLASS_CURSOR)
         | 
| 7 | 
            +
                Wx::begin_busy_cursor(cursor)
         | 
| 8 | 
            +
                yield
         | 
| 9 | 
            +
              ensure
         | 
| 10 | 
            +
                Wx::end_busy_cursor
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
            end
         | 
| @@ -29,7 +29,9 @@ class Wx::EvtHandler | |
| 29 29 | 
             
                if evt_klass = EVENT_TYPE_CLASS_MAP[id]
         | 
| 30 30 | 
             
                  return evt_klass
         | 
| 31 31 | 
             
                else
         | 
| 32 | 
            -
                   | 
| 32 | 
            +
                  if Wx::DEBUG
         | 
| 33 | 
            +
                    warn "No event class defined for event type #{id}"
         | 
| 34 | 
            +
                  end
         | 
| 33 35 | 
             
                  return Wx::Event
         | 
| 34 36 | 
             
                end
         | 
| 35 37 | 
             
              end
         | 
| @@ -42,11 +44,18 @@ class Wx::EvtHandler | |
| 42 44 |  | 
| 43 45 | 
             
              # Given the Integer constant Wx::EVT_XXX, returns the convenience
         | 
| 44 46 | 
             
              # handler method name associated with that type of event.
         | 
| 45 | 
            -
             | 
| 46 47 | 
             
              def self.event_name_for_type(name)
         | 
| 47 48 | 
             
                EVENT_NAME_TYPE_MAP.index(name)
         | 
| 48 49 | 
             
              end
         | 
| 49 50 |  | 
| 51 | 
            +
              # Given an integer value +int_val+, returns the name of the EVT_xxx
         | 
| 52 | 
            +
              # constant which points to it. Mainly useful for debugging.
         | 
| 53 | 
            +
              def self.const_to_name(int_val)
         | 
| 54 | 
            +
                Wx::constants.grep(/^EVT/).find do | c_name |
         | 
| 55 | 
            +
                  Wx::const_get(c_name) == int_val
         | 
| 56 | 
            +
                end
         | 
| 57 | 
            +
              end
         | 
| 58 | 
            +
             | 
| 50 59 | 
             
              # Public method to register the mapping of a custom event type
         | 
| 51 60 | 
             
              # +konstant+ (which should be a unique integer; one will be created if
         | 
| 52 61 | 
             
              # not supplied) to a custom event class +klass+. If +meth+ and +arity+
         | 
| @@ -133,12 +142,15 @@ class Wx::EvtHandler | |
| 133 142 | 
             
              # parameter or by calling the wx_id method of a passed Window.
         | 
| 134 143 | 
             
              def acquire_id(window_or_id)
         | 
| 135 144 | 
             
                case window_or_id
         | 
| 136 | 
            -
                when Fixnum  | 
| 137 | 
            -
             | 
| 138 | 
            -
                 | 
| 139 | 
            -
             | 
| 140 | 
            -
             | 
| 141 | 
            -
             | 
| 145 | 
            +
                when Fixnum 
         | 
| 146 | 
            +
                  window_or_id
         | 
| 147 | 
            +
                when Wx::Window, Wx::MenuItem, Wx::ToolBarTool 
         | 
| 148 | 
            +
                  window_or_id.wx_id
         | 
| 149 | 
            +
                else 
         | 
| 150 | 
            +
                  Kernel.raise ArgumentError, 
         | 
| 151 | 
            +
                               "Must specify Wx::Window event source or its Wx id, " +
         | 
| 152 | 
            +
                               "not '#{window_or_id.inspect}'",
         | 
| 153 | 
            +
                               caller
         | 
| 142 154 | 
             
                end
         | 
| 143 155 | 
             
              end
         | 
| 144 156 | 
             
              private :acquire_id, :acquire_handler
         | 
| @@ -258,30 +270,24 @@ class Wx::EvtHandler | |
| 258 270 | 
             
                EventType['evt_combobox', 1,
         | 
| 259 271 | 
             
                          Wx::EVT_COMMAND_COMBOBOX_SELECTED, 
         | 
| 260 272 | 
             
                          Wx::CommandEvent],
         | 
| 261 | 
            -
                EventType['evt_command', 0,
         | 
| 262 | 
            -
                          Wx::EVT_NULL, 
         | 
| 263 | 
            -
                          Wx::Event],
         | 
| 264 273 | 
             
                EventType['evt_command_enter', 1,
         | 
| 265 274 | 
             
                          Wx::EVT_COMMAND_ENTER, 
         | 
| 266 | 
            -
                          Wx:: | 
| 275 | 
            +
                          Wx::CommandEvent],
         | 
| 267 276 | 
             
                EventType['evt_command_kill_focus', 1,
         | 
| 268 277 | 
             
                          Wx::EVT_COMMAND_KILL_FOCUS, 
         | 
| 269 | 
            -
                          Wx:: | 
| 278 | 
            +
                          Wx::CommandEvent],
         | 
| 270 279 | 
             
                EventType['evt_command_left_click', 1,
         | 
| 271 280 | 
             
                          Wx::EVT_COMMAND_LEFT_CLICK, 
         | 
| 272 | 
            -
                          Wx:: | 
| 281 | 
            +
                          Wx::CommandEvent],
         | 
| 273 282 | 
             
                EventType['evt_command_left_dclick', 1,
         | 
| 274 283 | 
             
                          Wx::EVT_COMMAND_LEFT_DCLICK, 
         | 
| 275 | 
            -
                          Wx:: | 
| 276 | 
            -
                EventType['evt_command_range', 2,
         | 
| 277 | 
            -
                          Wx::EVT_NULL, 
         | 
| 278 | 
            -
                          Wx::Event],
         | 
| 284 | 
            +
                          Wx::CommandEvent],
         | 
| 279 285 | 
             
                EventType['evt_command_right_click', 1,
         | 
| 280 286 | 
             
                          Wx::EVT_COMMAND_RIGHT_CLICK, 
         | 
| 281 | 
            -
                          Wx:: | 
| 287 | 
            +
                          Wx::CommandEvent],
         | 
| 282 288 | 
             
                EventType['evt_command_set_focus', 1,
         | 
| 283 289 | 
             
                          Wx::EVT_COMMAND_SET_FOCUS, 
         | 
| 284 | 
            -
                          Wx:: | 
| 290 | 
            +
                          Wx::CommandEvent],
         | 
| 285 291 | 
             
                EventType['evt_context_menu', 0,
         | 
| 286 292 | 
             
                          Wx::EVT_CONTEXT_MENU, 
         | 
| 287 293 | 
             
                          Wx::ContextMenuEvent],
         | 
| @@ -585,6 +591,9 @@ class Wx::EvtHandler | |
| 585 591 | 
             
                EventType['evt_move', 0,
         | 
| 586 592 | 
             
                          Wx::EVT_MOVE, 
         | 
| 587 593 | 
             
                          Wx::MoveEvent],
         | 
| 594 | 
            +
                EventType['evt_moving', 0,
         | 
| 595 | 
            +
                          Wx::EVT_MOVING, 
         | 
| 596 | 
            +
                          Wx::MoveEvent],
         | 
| 588 597 | 
             
                EventType['evt_nc_paint', 0,
         | 
| 589 598 | 
             
                          Wx::EVT_NC_PAINT, 
         | 
| 590 599 | 
             
                          Wx::Event],
         | 
| @@ -598,7 +607,7 @@ class Wx::EvtHandler | |
| 598 607 | 
             
                          Wx::EVT_PAINT, 
         | 
| 599 608 | 
             
                          Wx::PaintEvent],
         | 
| 600 609 | 
             
                EventType['evt_query_end_session', 0,
         | 
| 601 | 
            -
                          Wx::EVT_QUERY_END_SESSION, | 
| 610 | 
            +
                          Wx::EVT_QUERY_END_SESSION,
         | 
| 602 611 | 
             
                          Wx::Event],
         | 
| 603 612 | 
             
                EventType['evt_query_layout_info', 0,
         | 
| 604 613 | 
             
                          Wx::EVT_QUERY_LAYOUT_INFO, 
         | 
| @@ -687,6 +696,9 @@ class Wx::EvtHandler | |
| 687 696 | 
             
                EventType['evt_set_focus', 0,
         | 
| 688 697 | 
             
                          Wx::EVT_SET_FOCUS, 
         | 
| 689 698 | 
             
                          Wx::FocusEvent],
         | 
| 699 | 
            +
                EventType['evt_show', 1,
         | 
| 700 | 
            +
                          Wx::EVT_SHOW, 
         | 
| 701 | 
            +
                          Wx::ShowEvent],
         | 
| 690 702 | 
             
                EventType['evt_size', 0,
         | 
| 691 703 | 
             
                          Wx::EVT_SIZE, 
         | 
| 692 704 | 
             
                          Wx::SizeEvent],
         | 
| @@ -816,6 +828,9 @@ class Wx::EvtHandler | |
| 816 828 | 
             
                EventType['evt_tree_item_expanding', 1,
         | 
| 817 829 | 
             
                          Wx::EVT_COMMAND_TREE_ITEM_EXPANDING, 
         | 
| 818 830 | 
             
                          Wx::TreeEvent],
         | 
| 831 | 
            +
                EventType['evt_tree_item_gettooltip', 1,
         | 
| 832 | 
            +
                          Wx::EVT_COMMAND_TREE_ITEM_GETTOOLTIP, 
         | 
| 833 | 
            +
                          Wx::TreeEvent],
         | 
| 819 834 | 
             
                EventType['evt_tree_item_menu', 1,
         | 
| 820 835 | 
             
                          Wx::EVT_COMMAND_TREE_ITEM_MENU, 
         | 
| 821 836 | 
             
                          Wx::TreeEvent],
         | 
| @@ -0,0 +1,44 @@ | |
| 1 | 
            +
            # Tweaks to the global module functions
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Wx
         | 
| 4 | 
            +
              class << self
         | 
| 5 | 
            +
                # Allow this to be called with keyword parameters, and avoid
         | 
| 6 | 
            +
                # segfaults on OS X with bad params
         | 
| 7 | 
            +
                wx_about_box = self.instance_method(:about_box)
         | 
| 8 | 
            +
                define_method(:about_box) do | info |
         | 
| 9 | 
            +
                  # If AboutDialogInfo has no version, it segfaults on OS X 10.5
         | 
| 10 | 
            +
                  no_version = ArgumentError.new("Must supply a version for AboutDialog")
         | 
| 11 | 
            +
                  case info
         | 
| 12 | 
            +
                  when Wx::AboutDialogInfo
         | 
| 13 | 
            +
                    unless info.has_version
         | 
| 14 | 
            +
                      Kernel.raise no_version 
         | 
| 15 | 
            +
                    end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                    ab_info = info
         | 
| 18 | 
            +
                  when Hash
         | 
| 19 | 
            +
                    ab_info = Wx::AboutDialogInfo.new
         | 
| 20 | 
            +
                    ab_info.name    = info[:name] || 'wxRuby application'
         | 
| 21 | 
            +
                    ab_info.version = info[:version] || Kernel.raise(no_version)
         | 
| 22 | 
            +
                    
         | 
| 23 | 
            +
                    ab_info.description = info[:description] || ''
         | 
| 24 | 
            +
                    ab_info.copyright   = info[:copyright] || ''
         | 
| 25 | 
            +
                    ab_info.licence     = info[:licence] || ''
         | 
| 26 | 
            +
                    ab_info.developers  = info[:developers] || []
         | 
| 27 | 
            +
                    ab_info.doc_writers = info[:doc_writers] || []
         | 
| 28 | 
            +
                    ab_info.artists     = info[:artists] || []
         | 
| 29 | 
            +
                    ab_info.translators = info[:translators] || []
         | 
| 30 | 
            +
                    if info.key?(:website)
         | 
| 31 | 
            +
                      ab_info.set_website(*info[:website])
         | 
| 32 | 
            +
                    end
         | 
| 33 | 
            +
                    if info.key?(:icon)
         | 
| 34 | 
            +
                      ab_info.icon = info[:icon]
         | 
| 35 | 
            +
                    end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                  else
         | 
| 38 | 
            +
                    Kernel.raise ArgumentError,
         | 
| 39 | 
            +
                                 "Can't use #{info.inspect} for AboutDialogInfo"
         | 
| 40 | 
            +
                  end
         | 
| 41 | 
            +
                  wx_about_box.bind(self).call(ab_info)
         | 
| 42 | 
            +
                end
         | 
| 43 | 
            +
              end
         | 
| 44 | 
            +
            end
         | 
    
        data/lib/wx/classes/grid.rb
    CHANGED
    
    | @@ -4,15 +4,17 @@ class Wx::Grid | |
| 4 4 | 
             
              # garbage collection of Grid-related classes; they do not extend the
         | 
| 5 5 | 
             
              # public functionality of the class in any way. 
         | 
| 6 6 | 
             
              # 
         | 
| 7 | 
            -
              #  | 
| 8 | 
            -
              # GC, in that Wx makes them owned by the grid once | 
| 9 | 
            -
              # for a cell or group of cells. However, because | 
| 10 | 
            -
              # directors we cannot allow the ruby object they are | 
| 11 | 
            -
              # associated with to be swept by GC | 
| 7 | 
            +
              # GridTableBase, and the GridCellRenderers and GridCellEditors pose a
         | 
| 8 | 
            +
              # problem for ruby's GC, in that Wx makes them owned by the grid once
         | 
| 9 | 
            +
              # they have been set for a cell or group of cells. However, because
         | 
| 10 | 
            +
              # they are SWIG directors we cannot allow the ruby object they are
         | 
| 11 | 
            +
              # originally associated with to be swept by GC, as C++ method calls
         | 
| 12 | 
            +
              # are routed to ruby method calls.
         | 
| 12 13 | 
             
              #
         | 
| 13 14 | 
             
              # The code below stores Ruby redefines all methods that may
         | 
| 14 | 
            -
              # potentially set  | 
| 15 | 
            -
              #  | 
| 15 | 
            +
              # potentially set a GridTableBase, Editor or Renderer, and stores a
         | 
| 16 | 
            +
              # reference to them in an instance variable, so they are not disposed
         | 
| 17 | 
            +
              # of up when GC sweeps.
         | 
| 16 18 |  | 
| 17 19 | 
             
              # These all need to be set up as private methods which default to an
         | 
| 18 20 | 
             
              # array. This can't be done in initialize b/c that may not be called
         | 
| @@ -26,6 +28,13 @@ class Wx::Grid | |
| 26 28 | 
             
                private meth
         | 
| 27 29 | 
             
              end
         | 
| 28 30 |  | 
| 31 | 
            +
              # Set a grid table base to provide data
         | 
| 32 | 
            +
              alias :__set_table :set_table
         | 
| 33 | 
            +
              def set_table(table, sel_mode = Wx::Grid::GridSelectCells)
         | 
| 34 | 
            +
                __set_table(table, sel_mode)
         | 
| 35 | 
            +
                @__grid_table = table
         | 
| 36 | 
            +
              end
         | 
| 37 | 
            +
             | 
| 29 38 | 
             
              # store default editor
         | 
| 30 39 | 
             
              wx_set_default_editor = self.instance_method(:set_default_editor)
         | 
| 31 40 | 
             
              define_method(:set_default_editor) do | editr |
         | 
| @@ -3,4 +3,12 @@ class Wx::HtmlWindow | |
| 3 3 | 
             
              def load_file(file)
         | 
| 4 4 | 
             
                set_page( File.read(file) )
         | 
| 5 5 | 
             
              end
         | 
| 6 | 
            +
              
         | 
| 7 | 
            +
              # This is called from within wxWidgets whenever a URL is being
         | 
| 8 | 
            +
              # opened. The method may return true, to signal that the opening
         | 
| 9 | 
            +
              # should be permitted, false or nil to signal that it should be
         | 
| 10 | 
            +
              # blocked, or a string URL to which it should be redirected
         | 
| 11 | 
            +
              def on_opening_url(url)
         | 
| 12 | 
            +
                true
         | 
| 13 | 
            +
              end
         | 
| 6 14 | 
             
            end
         | 
    
        data/lib/wx/classes/icon.rb
    CHANGED
    
    | @@ -1,4 +1,11 @@ | |
| 1 1 | 
             
            class Wx::Icon
         | 
| 2 | 
            +
              # Analogous to Image.from_bitmap
         | 
| 3 | 
            +
              def self.from_bitmap(bmp)
         | 
| 4 | 
            +
                ico = new
         | 
| 5 | 
            +
                ico.copy_from_bitmap(bmp)
         | 
| 6 | 
            +
                ico
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
             | 
| 2 9 | 
             
              # Redefine the initialize method so it raises an exception if a
         | 
| 3 10 | 
             
              # non-existent file is given to the constructor; otherwise, wx Widgets
         | 
| 4 11 | 
             
              # just carries on with an empty icon, which may cause faults later
         | 
    
        data/lib/wx/classes/image.rb
    CHANGED
    
    | @@ -1,4 +1,16 @@ | |
| 1 1 | 
             
            class Wx::Image
         | 
| 2 | 
            +
              # Load a new image from an IO-like object that supports "read"
         | 
| 3 | 
            +
              def self.read(an_io, type_or_mime, index = -1)
         | 
| 4 | 
            +
                img = new
         | 
| 5 | 
            +
                img.load_stream(an_io, type_or_mime, index)
         | 
| 6 | 
            +
                img
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              # Create a new image from Wx::Bitmap, preserving mask information
         | 
| 10 | 
            +
              def self.from_bitmap(bmp)
         | 
| 11 | 
            +
                bmp.convert_to_image
         | 
| 12 | 
            +
              end
         | 
| 13 | 
            +
             | 
| 2 14 | 
             
              # Redefine the initialize method so it raises an exception if a
         | 
| 3 15 | 
             
              # non-existent file is given to the constructor; otherwise, wx Widgets
         | 
| 4 16 | 
             
              # just carries on with an invalid image, which may cause faults later
         | 
| @@ -11,4 +23,9 @@ class Wx::Image | |
| 11 23 | 
             
                end
         | 
| 12 24 | 
             
                wx_init.bind(self).call(*args)
         | 
| 13 25 | 
             
              end
         | 
| 26 | 
            +
              
         | 
| 27 | 
            +
              # Convert to bitmap
         | 
| 28 | 
            +
              def convert_to_bitmap
         | 
| 29 | 
            +
                Wx::Bitmap.from_image(self)
         | 
| 30 | 
            +
              end
         | 
| 14 31 | 
             
            end
         | 
| @@ -1,4 +1,25 @@ | |
| 1 1 | 
             
            class Wx::XmlResource
         | 
| 2 | 
            +
              # XRC_NO_SUBCLASSING should always be in place in wxRuby - we can't
         | 
| 3 | 
            +
              # currently link directly to wxRuby subclasses.
         | 
| 4 | 
            +
              class << self
         | 
| 5 | 
            +
                wx_get = self.instance_method(:get)
         | 
| 6 | 
            +
                define_method(:get) do 
         | 
| 7 | 
            +
                  res = wx_get.bind(self).call
         | 
| 8 | 
            +
                  res.flags |= Wx::XRC_NO_SUBCLASSING
         | 
| 9 | 
            +
                  res
         | 
| 10 | 
            +
                end
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              # WxRuby already has all XRC handlers built in so there's no way to
         | 
| 14 | 
            +
              # control init_all_handlers to reduce binary size. So save users
         | 
| 15 | 
            +
              # having to call it.
         | 
| 16 | 
            +
              wx_init = self.instance_method(:initialize)
         | 
| 17 | 
            +
              define_method(:initialize) do | *args |
         | 
| 18 | 
            +
                result = wx_init.bind(self).call(*args)
         | 
| 19 | 
            +
                result.flags |= Wx::XRC_NO_SUBCLASSING
         | 
| 20 | 
            +
                result.init_all_handlers
         | 
| 21 | 
            +
              end
         | 
| 22 | 
            +
             | 
| 2 23 | 
             
              # The standard .load method returns a boolean indicating success or
         | 
| 3 24 | 
             
              # failure. Failure might result from bad XML, or a non-existent
         | 
| 4 25 | 
             
              # file. In ruby, in these circumstances, it's more natural to raise an
         | 
    
        data/lib/wx/keyword_ctors.rb
    CHANGED
    
    | @@ -160,7 +160,7 @@ module Wx | |
| 160 160 |  | 
| 161 161 | 
             
                  def describe_constructor()
         | 
| 162 162 | 
             
                    param_spec.inject("") do | desc, param |
         | 
| 163 | 
            -
                      desc << " | 
| 163 | 
            +
                      desc << ":#{param.name} => (#{param.default.class.name})\n"
         | 
| 164 164 | 
             
                    end
         | 
| 165 165 | 
             
                  end
         | 
| 166 166 | 
             
                end
         | 
| @@ -184,12 +184,15 @@ module Wx | |
| 184 184 | 
             
                      real_args = [ parent ] + self.class.args_as_list(*mixed_args)
         | 
| 185 185 | 
             
                      begin
         | 
| 186 186 | 
             
                        pre_wx_kwctor_init(*real_args)
         | 
| 187 | 
            -
                      rescue
         | 
| 188 | 
            -
                        msg = "Error initializing #{self.inspect} | 
| 189 | 
            -
                              " | 
| 190 | 
            -
             | 
| 187 | 
            +
                      rescue => err
         | 
| 188 | 
            +
                        msg = "Error initializing #{self.inspect}\n"+
         | 
| 189 | 
            +
                              " : #{err.message} \n" +
         | 
| 190 | 
            +
                              "Correct parameters for #{self.class.name}.new are:\n" + 
         | 
| 191 191 | 
             
                               self.class.describe_constructor()
         | 
| 192 | 
            -
             | 
| 192 | 
            +
             | 
| 193 | 
            +
                        new_err = err.class.new(msg)
         | 
| 194 | 
            +
                        new_err.set_backtrace(caller)
         | 
| 195 | 
            +
                        Kernel.raise new_err
         | 
| 193 196 | 
             
                      end
         | 
| 194 197 |  | 
| 195 198 | 
             
                      # If a block was given, pass the newly created Window instance
         | 
    
        data/lib/wx/keyword_defs.rb
    CHANGED
    
    | @@ -483,3 +483,10 @@ Wx::define_keyword_ctors('SearchCtrl') do | |
| 483 483 | 
             
              wx_ctor_params :validator, :name => 'searchCtrl'
         | 
| 484 484 | 
             
            end
         | 
| 485 485 |  | 
| 486 | 
            +
             | 
| 487 | 
            +
            Wx::define_keyword_ctors('AnimationCtrl') do
         | 
| 488 | 
            +
              wx_ctor_params :id, :anim
         | 
| 489 | 
            +
              wx_ctor_params :pos, :size, :style => Wx::AC_DEFAULT_STYLE
         | 
| 490 | 
            +
              wx_ctor_params :name => 'animationCtrl'
         | 
| 491 | 
            +
            end
         | 
| 492 | 
            +
             | 
    
        data/lib/wx/version.rb
    CHANGED
    
    
    
        data/lib/wxruby2.bundle
    CHANGED
    
    | Binary file | 
    
        data/samples/aui/aui.rb
    CHANGED
    
    | @@ -1,17 +1,13 @@ | |
| 1 1 | 
             
            #!/usr/bin/env ruby
         | 
| 2 | 
            -
            # wxRuby2 Sample Code. Copyright (c) 2004- | 
| 2 | 
            +
            # wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team
         | 
| 3 3 | 
             
            # Freely reusable code: see SAMPLES-LICENSE.TXT for details
         | 
| 4 | 
            -
             | 
| 5 4 | 
             
            begin
         | 
| 6 | 
            -
              require ' | 
| 7 | 
            -
            rescue LoadError | 
| 8 | 
            -
              begin
         | 
| 9 | 
            -
                require 'rubygems' 
         | 
| 10 | 
            -
                load 'wx'
         | 
| 11 | 
            -
              rescue
         | 
| 12 | 
            -
                raise no_wx_err
         | 
| 13 | 
            -
              end
         | 
| 5 | 
            +
              require 'rubygems' 
         | 
| 6 | 
            +
            rescue LoadError
         | 
| 14 7 | 
             
            end
         | 
| 8 | 
            +
            require 'wx'
         | 
| 9 | 
            +
             | 
| 10 | 
            +
             | 
| 15 11 |  | 
| 16 12 | 
             
            # A resizable control that displays its current size, and, if an AUI
         | 
| 17 13 | 
             
            # arrangement, its position and layer
         |