Home | Ruby | Ruby Graphical User Interface |     Share This Page

Listing: sampledialog_ui.rb


Click here to download original file.

# Form implementation generated from reading ui file 'sampledialog.ui'
#
# Created: Sun Aug 20 09:58:51 2006
#      by: The QtRuby User Interface Compiler (rbuic)
#
# WARNING! All changes made in this file will be lost!
require 'Qt'
class SampleDialogUI < Qt::Dialog
   slots 'languageChange()',
   'testButton_clicked()',
   'closeButton_clicked()'
   attr_reader :textLabel1
   attr_reader :closeButton
   attr_reader :testButton
   def initialize(parent = nil, name = nil, modal = false, fl = 0)
      super
      if name.nil?
         setName("SampleDialogUI")
      end
      setModal(true)
      @SampleDialogUILayout = Qt::GridLayout.new(self, 1, 1, 11, 6, 'SampleDialogUILayout')
      @textLabel1 = Qt::Label.new(self, "textLabel1")
      @textLabel1.setAlignment( Qt::Label::AlignCenter )
      @SampleDialogUILayout.addMultiCellWidget(@textLabel1, 0, 0, 0, 3)
      @spacer2 = Qt::SpacerItem.new(90, 31, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
      @SampleDialogUILayout.addItem(@spacer2, 1, 3)
      @spacer1 = Qt::SpacerItem.new(80, 31, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum)
      @SampleDialogUILayout.addItem(@spacer1, 1, 0)
      @closeButton = Qt::PushButton.new(self, "closeButton")
      @SampleDialogUILayout.addWidget(@closeButton, 1, 2)
      @testButton = Qt::PushButton.new(self, "testButton")
      @SampleDialogUILayout.addWidget(@testButton, 1, 1)
      languageChange()
      resize( Qt::Size.new(425, 219).expandedTo(minimumSizeHint()) )
      clearWState( WState_Polished )
      Qt::Object.connect(@testButton, SIGNAL("clicked()"), self, SLOT("testButton_clicked()") )
      Qt::Object.connect(@closeButton, SIGNAL("clicked()"), self, SLOT("closeButton_clicked()") )
   end
   #
   #  Sets the strings of the subwidgets using the current
   #  language.
   #
   def languageChange()
      setCaption(trUtf8("Sample Dialog"))
      @textLabel1.setText( trUtf8("Hover here to see tooltip text.") )
      Qt::ToolTip.add( @textLabel1, trUtf8("This is an example of tooltip text.") )
      @closeButton.setText( trUtf8("Close") )
      Qt::ToolTip.add( @closeButton, trUtf8("Close this dialog") )
      @testButton.setText( trUtf8("Test") )
      Qt::ToolTip.add( @testButton, trUtf8("Test command execution") )
   end
   protected :languageChange
   def testButton_clicked(*k)
      print("SampleDialogUI.testButton_clicked(): Not implemented yet.\n")
   end
   def closeButton_clicked(*k)
      print("SampleDialogUI.closeButton_clicked(): Not implemented yet.\n")
   end
end
    

Home | Ruby | Ruby Graphical User Interface |     Share This Page