# Form implementation generated from reading ui file 'example1.ui'
#
# Created: Mon Jul 30 17:52:28 2001
#      by: The Ruby User Interface Compiler (rbuic)
#
# WARNING! All changes made in this file will be lost!


require 'qt2'
include Qt2




class Form1 < QDialog
    def initialize(parent=nil,name="",modal=false,f=0)
        super

        if ( name == "unnamed" )
            setName('Form1')
        end
        resize(360,161)
        setCaption(tr("Form1"))
        form1Layout = QGridLayout.new(self)
        form1Layout.setSpacing(6)
        form1Layout.setMargin(11)

        @PushButton1 = QPushButton.new(self,'@PushButton1')
        @PushButton1.setText(tr("OK"))
        @PushButton1.setDefault(true)

        form1Layout.addMultiCellWidget(@PushButton1,3,4,1,1)
        spacer = QSpacerItem.new(20,20,QSizePolicy::Expanding,QSizePolicy::Minimum)
        form1Layout.addItem(spacer,4,0)
        spacer_2 = QSpacerItem.new(20,20,QSizePolicy::Expanding,QSizePolicy::Minimum)
        form1Layout.addMultiCell(spacer_2,4,4,4,6)

        @PushButton2 = QPushButton.new(self,'@PushButton2')
        @PushButton2.setText(tr("Cancel"))

        form1Layout.addMultiCellWidget(@PushButton2,3,4,3,3)
        spacer_3 = QSpacerItem.new(20,20,QSizePolicy::Expanding,QSizePolicy::Minimum)
        form1Layout.addItem(spacer_3,4,2)

        @Slider1 = QSlider.new(self,'@Slider1')
        @Slider1.setOrientation(QSlider::Vertical)

        form1Layout.addMultiCellWidget(@Slider1,0,2,6,6)

        @Dial1 = QDial.new(self,'@Dial1')
        @Dial1.setMaximumSize(QSize.new(48,32767))

        form1Layout.addWidget(@Dial1,1,5)

        @LCDNumber1 = QLCDNumber.new(self,'@LCDNumber1')

        form1Layout.addMultiCellWidget(@LCDNumber1,0,2,0,4)
        spacer_4 = QSpacerItem.new(20,20,QSizePolicy::Minimum,QSizePolicy::Expanding)
        form1Layout.addMultiCell(spacer_4,2,3,5,5)
        spacer_5 = QSpacerItem.new(20,20,QSizePolicy::Minimum,QSizePolicy::Expanding)
        form1Layout.addItem(spacer_5,0,5)

        Qt2::connect(@PushButton1,QSIGNAL('clicked()'),self,QSLOT('accept()'))
        Qt2::connect(@PushButton2,QSIGNAL('clicked()'),self,QSLOT('reject()'))
        Qt2::connect(@Dial1,QSIGNAL('valueChanged(int)'),@Slider1,QSLOT('setValue(int)'))
        Qt2::connect(@Slider1,QSIGNAL('valueChanged(int)'),@LCDNumber1,QSLOT('display(int)'))
        Qt2::connect(@Slider1,QSIGNAL('valueChanged(int)'),@Dial1,QSLOT('setValue(int)'))
    end
end


# main routine
    a = QApplication.new([$0]+ARGV)
    Qt2::connect(a,QSIGNAL('lastWindowClosed()'),a,QSLOT('quit()'))
    w = Form1.new()
    a.setMainWidget(w)
    w.show()
    a.exec()
