# Form implementation generated from reading ui file 'example2.ui'
#
# Created: Thu Aug 2 04:20:35 2001
#      by: The Ruby User Interface Compiler (rbuic)
#
# WARNING! All changes made in this file will be lost!


require 'qt2'
include Qt2


require 'qt2iconview'
include Qt2iconview
require 'qt2table'
include Qt2table


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



        image0_data = [
'32 32 10 1',
'. c None',
'# c #000000',
'b c #00c200',
'e c #313031',
'h c #410000',
'd c #5a595a',
'g c #a4a1a4',
'f c #c5c2c5',
'a c #c5ffc5',
'c c #ffffff',
'...###..........................',
'...#aa##........................',
'.###baaa##......................',
'.#cd##baaa##....................',
'.#cccd##baaa##..##e.............',
'.#cccccd##baaa##aaa##...........',
'.#cccccccd##baaaaaaaa##.........',
'.#cccccccccd##baaaaaaa#.........',
'.#cccccfcffgg#bbbbaaaaa#........',
'.#ccccccfcfffd#bbbbbbaa#........',
'.#cccfcfcfcffgd##bh#bbba#.......',
'.#ccccfcfffffffgd#dd##ba#.......',
'.#cfcfcfcfffffffffgfgd#bb#......',
'.#ccfcfffffffffgfgfgfgd#b#......',
'.#cfcfcfffffffffgfgfggd#b#......',
'.#fcfffffffffgfgfgggggd#b#......',
'.#cfcfffffffffgfgfggggd#b#......',
'.#fffffffffgfgfgggggggdhb#......',
'.#ffffffffffgfgfggggggd#b#......',
'.#ggfffffgfgfgggggggggd#b#......',
'.#ddggffffgfgfggggggggd#b#......',
'..##ddggfgfgggggggggggd#b#......',
'....##ddgggfggggggggggd#b#......',
'......##ddggggggggggggd#b#......',
'........##ddggggggggggd#b#......',
'..........##ddggggggggd#b#......',
'............##ddggggggd#b###....',
'..............##ddggggd#b#####..',
'................##ddggd#b######.',
'..................##ddd#b#####..',
'....................##d#b###....',
'......................####......'
]
        image0 = QPixmap.new(image0_data)

        if ( name == "unnamed" )
            setName('Form1')
        end
        resize(421,301)
        setCaption(tr("Form1"))

        @page1 = QWidget.new(self,'@page1')
        page1Layout = QVBoxLayout.new(@page1)
        page1Layout.setSpacing(6)
        page1Layout.setMargin(11)

        @TextLabel1 = QLabel.new(@page1,'@TextLabel1')
        @TextLabel1.setText(tr("This is an example for ui2rb script.\n\nHow to use ui2rb?\n\n1. Install ruby and qt2 library for ruby.\n   (http://sfns.u-shizuoka-ken.ac.jp/geneng/horie_hp/ruby/index.html)"))
        @TextLabel1.setAlignment(QLabel::AlignTop | QLabel::AlignLeft)
        QToolTip::add(@TextLabel1,tr("This is Label"))
        QWhatsThis::add(@TextLabel1,tr("This is message for you!"))
        page1Layout.addWidget(@TextLabel1)
        addPage(@page1,tr("Page1"))

        @page2 = QWidget.new(self,'@page2')
        page2Layout = QVBoxLayout.new(@page2)
        page2Layout.setSpacing(6)
        page2Layout.setMargin(11)

        @TextLabel2 = QLabel.new(@page2,'@TextLabel2')
        @TextLabel2.setText(tr("How to use ui2rb?\n\n2. Install qt2xml module in qt2/modules/qt2xml\n in qt2 package.\n\nex)\nruby extconf.rb --with-qt-dir=<dir. qt2 lib installed>\nmake\nmake install"))
        @TextLabel2.setAlignment(QLabel::AlignTop | QLabel::AlignLeft)
        page2Layout.addWidget(@TextLabel2)
        addPage(@page2,tr("Page2"))

        @page3 = QWidget.new(self,'@page3')
        page3Layout = QVBoxLayout.new(@page3)
        page3Layout.setSpacing(6)
        page3Layout.setMargin(11)

        @TextLabel3 = QLabel.new(@page3,'@TextLabel3')
        @TextLabel3.setText(tr("How to use ui2rb?\n\n3. If you want to icons in designer, install zlib extension for ruby.\n   (http://www.blue.sky.or.jp/atelier/)\n\n   And if you want to Qtable or QIconView, you need qt2table and \n   qt2iconview module in qt2 package."))
        @TextLabel3.setAlignment(QLabel::AlignTop | QLabel::AlignLeft)
        page3Layout.addWidget(@TextLabel3)
        addPage(@page3,tr("Page3"))

        @page4 = QWidget.new(self,'@page4')
        page4Layout = QVBoxLayout.new(@page4)
        page4Layout.setSpacing(6)
        page4Layout.setMargin(11)

        @TextLabel4 = QLabel.new(@page4,'@TextLabel4')
        @TextLabel4.setText(tr("How to use ui2rb?\n\n4.  Then, you can translate *.ui file to *.rb such like...\n     ui2rb -x (rubyfile.rb) (*.ui file)  \n\n     You can open form by..\n     ruby rubyfile.rb\n\n     Or directly open forms in *.ui file by..\n     ui2rb -e (*.ui)"))
        @TextLabel4.setAlignment(QLabel::AlignTop | QLabel::AlignLeft)
        page4Layout.addWidget(@TextLabel4)
        addPage(@page4,tr("Page4"))

        @page5 = QWidget.new(self,'@page5')
        page5Layout = QVBoxLayout.new(@page5)
        page5Layout.setSpacing(6)
        page5Layout.setMargin(11)

        @TextLabel5 = QLabel.new(@page5,'@TextLabel5')
        @TextLabel5.setText(tr("How to use ui2rb?\n\n5.  For install ui2rb in your system...\n    \n    a. copy ui2rb to the directory in PATH.\n    ex) /usr/local/bin\n    b. copy formmaker.rb to the directory in RUBYLIB.\n    ex) /usr/local/lib/ruby/site_ruby\n\n    If you use KDE and bind .ui extension to ui2rb script, \n    you can open *.ui file from filemanager of \n    KDE."))
        @TextLabel5.setAlignment(QLabel::AlignTop | QLabel::AlignLeft)
        page5Layout.addWidget(@TextLabel5)
        addPage(@page5,tr("Page5"))

        @page6 = QWidget.new(self,'@page6')
        page6Layout = QVBoxLayout.new(@page6)
        page6Layout.setSpacing(6)
        page6Layout.setMargin(11)

        @TextLabel6 = QLabel.new(@page6,'@TextLabel6')
        @TextLabel6.setText(tr("Complicated example"))
        page6Layout.addWidget(@TextLabel6)

        @TabWidget2 = QTabWidget.new(@page6,'@TabWidget2')

        @tab1 = QWidget.new(@TabWidget2,'@tab1')
        tab1Layout = QGridLayout.new(@tab1)
        tab1Layout.setSpacing(6)
        tab1Layout.setMargin(11)

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

        tab1Layout.addWidget(@LCDNumber1,1,0)

        @Slider1 = QSlider.new(@tab1,'@Slider1')
        @Slider1.setOrientation(QSlider::Horizontal)

        tab1Layout.addWidget(@Slider1,0,0)

        @Dial1 = QDial.new(@tab1,'@Dial1')

        tab1Layout.addMultiCellWidget(@Dial1,0,1,1,1)
        @TabWidget2.insertTab(@tab1,tr("Tab 1"))

        @tab2 = QWidget.new(@TabWidget2,'@tab2')
        tab2Layout = QHBoxLayout.new(@tab2)
        tab2Layout.setSpacing(6)
        tab2Layout.setMargin(11)

        @IconView1 = QIconView.new(@tab2,'@IconView1')
        QIconViewItem.new(@IconView1,tr("New Item"),image0)
        tab2Layout.addWidget(@IconView1)

        layout1 = QVBoxLayout.new()
        layout1.setSpacing(6)
        layout1.setMargin(0)

        @PushButton1 = QPushButton.new(@tab2,'@PushButton1')
        @PushButton1.setText(tr("Add"))
        layout1.addWidget(@PushButton1)

        @PushButton2 = QPushButton.new(@tab2,'@PushButton2')
        @PushButton2.setText(tr("Del"))
        layout1.addWidget(@PushButton2)
        spacer = QSpacerItem.new(20,20,QSizePolicy::Minimum,QSizePolicy::Expanding)
        layout1.addItem(spacer)
        tab2Layout.addLayout(layout1)
        @TabWidget2.insertTab(@tab2,tr("Tab 2"))

        @tab3 = QWidget.new(@TabWidget2,'@tab3')
        tab3Layout = QGridLayout.new(@tab3)
        tab3Layout.setSpacing(6)
        tab3Layout.setMargin(11)

        @Table1 = QTable.new(@tab3,'@Table1')
        @Table1.setNumRows(100)
        @Table1.setNumCols(100)

        tab3Layout.addWidget(@Table1,0,0)
        @TabWidget2.insertTab(@tab3,tr("Tab"))
        page6Layout.addWidget(@TabWidget2)
        addPage(@page6,tr("Page Extra"))

        Qt2::connect(@Slider1,QSIGNAL('valueChanged(int)'),@LCDNumber1,QSLOT('display(int)'))
        Qt2::connect(@Dial1,QSIGNAL('valueChanged(int)'),@Slider1,QSLOT('setValue(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()
