Sha256: 5b2e7cf1942e983d182d1980af471853593efc0550041a8b466c447e21360217

Contents?: true

Size: 1.79 KB

Versions: 20

Compression:

Stored size: 1.79 KB

Contents

#!/usr/bin/env ruby

begin
  require 'wx'
rescue LoadError => no_wx_err
  begin
    require 'rubygems'
    require 'wx'
  rescue LoadError
    raise no_wx_err
  end
end

class TestPanel < Wx::Panel
    def initialize(parent)
        super(parent, -1)
        
        Wx::StaticText.new(self, -1, "This is an example of static text", Wx::Point.new(20, 10))
        
        Wx::StaticText.new(self, -1, "using the Wx::StaticText Control.", Wx::Point.new(20, 30))

        Wx::StaticText.new(self, -1, "Is this blue?", Wx::Point.new(20, 70), Wx::Size.new(90, -1)).set_background_colour(Wx::BLUE)

        Wx::StaticText.new(self, -1, "align center", Wx::Point.new(120, 70), Wx::Size.new(90, -1), Wx::ALIGN_CENTER).set_background_colour(Wx::BLUE)

        Wx::StaticText.new(self, -1, "align right", Wx::Point.new(220, 70), Wx::Size.new(90, -1), Wx::ALIGN_RIGHT).set_background_colour(Wx::BLUE)

        str = "This is a different font."
        text = Wx::StaticText.new(self, -1, str, Wx::Point.new(20, 100))
        font = Wx::Font.new(18, Wx::SWISS, Wx::NORMAL, Wx::NORMAL)
        text.set_font(font)
        #text.set_size(text.get_best_size())

        Wx::StaticText.new(self, -1, "Multi-line Wx::StaticText\nline 2\nline 3\n\nafter empty line", Wx::Point.new(20,150))
        Wx::StaticText.new(self, -1, "Align right multi-line\nline 2\nline 3\n\nafter empty line", Wx::Point.new(220,150), 
                            Wx::DEFAULT_SIZE,Wx::ALIGN_RIGHT)

    end
end

module Demo
    def Demo.run(frame,nb,log)
        panel = TestPanel.new(nb)
        return panel
    end
    
    def Demo.overview
        "A static text control displays one or more lines of read-only text."
    end
end


if __FILE__ == $0
  run_solo_lib = File.join( File.dirname(__FILE__), 'run.rb')
  load run_solo_lib
  run File.basename($0)
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
wxruby-1.9.3-i386-mswin32 samples/bigdemo/wxStaticText.rbw
wxruby-1.9.2-powerpc-darwin8.10.0 samples/bigdemo/wxStaticText.rbw
wxruby-1.9.2-i686-linux samples/bigdemo/wxStaticText.rbw
wxruby-1.9.2-i686-darwin8.8.2 samples/bigdemo/wxStaticText.rbw
wxruby-1.9.1-powerpc-darwin8.3.0 samples/bigdemo/wxStaticText.rbw
wxruby-1.9.1-i686-linux samples/bigdemo/wxStaticText.rbw
wxruby-1.9.1-i686-darwin8.4.1 samples/bigdemo/wxStaticText.rbw
wxruby-1.9.0-powerpc-darwin8.10.0 samples/bigdemo/wxStaticText.rbw
wxruby-1.9.0-i686-linux samples/bigdemo/wxStaticText.rbw
wxruby-1.9.0-i686-darwin8.4.1 samples/bigdemo/wxStaticText.rbw
wxruby-1.9.0-i386-mswin32 samples/bigdemo/wxStaticText.rbw
wxruby-1.9.1-x86_64-linux samples/bigdemo/wxStaticText.rbw
wxruby-1.9.2-x86_64-linux samples/bigdemo/wxStaticText.rbw
wxruby-1.9.3-universal-darwin samples/bigdemo/wxStaticText.rbw
wxruby-1.9.3-x86-linux samples/bigdemo/wxStaticText.rbw
wxruby-1.9.4-x86_64-linux samples/bigdemo/wxStaticText.rbw
wxruby-1.9.4-x86-linux samples/bigdemo/wxStaticText.rbw
wxruby-1.9.5-universal-darwin-9 samples/bigdemo/wxStaticText.rbw
wxruby-1.9.5-x86-linux samples/bigdemo/wxStaticText.rbw
wxruby-1.9.5-x86_64-linux samples/bigdemo/wxStaticText.rbw