#19 new
lyle (at lylejohnson)

Proposed extensions from FoxTails

Reported by lyle (at lylejohnson) | November 11th, 2009 @ 07:22 PM

These are some standard extensions that I usually throw in when I am using FXRuby. (They are in FoxTails actually.)

What do you think about adopting them into FXRuby?

module Fox
  class FXTextField
    # Add #editable as alias for #editable?.
    # Two reasons for this:
    #
    # (1) consistency with #enabled and #enabled? being aliases.
    #
    # (2) having a traditional r/w pair (#foo and #foo=) is helpful
    #     with metaprogramming.
    alias :editable :editable? unless instance_methods(true).include?("editable")
  end

  class FXTable
    # For parallelism with selectRange.
    unless instance_methods(true).include?("deselectRange")
      def deselectRange(sr, er, sc, ec, notify = false)
        changes = false
        for row in sr..er
          for col in sc..ec
            changes |= deselectItem(row, col, notify)
          end
        end
        return changes
      end
    end
  end

  class FXWindow
    # Traverse all children, depth first (parent before child).
    def each_child_recursive
      each_child do |child|
        yield child
        child.each_child_recursive do |subchild|
          yield subchild
        end
      end
    end
  end
end

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

FXRuby is a library for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for your Ruby applications. It’s based on the FOX Toolkit, a popular open source C++ library developed by Jeroen van der Zijp. What that means for you as an application developer is that you’re able to write code in the Ruby programming language that you already know and love, while at the same time taking advantage of the performance and functionality of a featureful, highly optimized C++ toolkit.

Shared Ticket Bins

People watching this ticket

Tags

Pages