# File tst/tst_locana.rb, line 149 def tst_borders() Lwindow.new(:TestBorders, :pos=>[0, 0], :text => 'Test Borders') {#, :bg=>:aliceblue, :fg=>:blue) { label(:l1, :padx=>5, :pady=>5, :text => "This tests borders for most objects") label(:l2, :below=>:prev, :padx=>5, :pady=>5, :text => "border types are nil, #{Lborder.supported_borders.get_keys_as_strings.sort.inspect}") [Lgroup, Llabel, Lbutton, Lcheckbox, Lradiobox, Ltextbox, Lcombobox, Ldatebox].each do |obj| group("#{obj.class.name}_#{y}".intern, :startx=>10, :below=>:prev, :padx=>5, :pady=>5) { label(obj.class.name.intern, :pos=>[2, 2], :text=>"#{obj.name}:") x = 100 borders = Lborder.supported_borders.keys.sort {|k1, k2| k1.to_s <=> k2.to_s} borders[0,0] = nil borders.each do |border| attr = {:border => border} if (obj == Ltextbox) attr[:value] = 'Test' elsif (obj == Lcombobox) attr[:text] = ['Test'] attr[:value] = 'Test' # combobox needs both elsif (obj == Ldatebox) attr[:value] = Time.now elsif (obj == Lgroup) attr[:height] = 22 # otherwise the calculated height will be 0 and we won't be able to see it else attr[:text] = 'Test' end attr[:pos] = [x, 0, 70] add(obj.new("#{obj.class.name}_#{y}_#{border}".intern, attr)) x += 80 end } end button(:b_ok, :sticky=>:se, :padx=>10, :pady=>10, :text=>'Ok', :tab_order=>0) # make sure this starts with the keyboard focus b_ok.on_click = "close()" # this button will close the form } end