#!/usr/local/bin/ruby
require "qt2"
include Qt2

class Form1 < QWidget
def initialize(parent=nil,name="",f=0)

   @image0_data = [   "22 22 2 1",
   ". c None",
   "# c #a4c610",
   "........######........",
   ".....###########......",
   "....##############....",
   "...################...",
   "..######......######..",
   "..#####........#####..",
   ".#####.......#..#####.",
   ".####.......###..####.",
   "####.......#####..####",
   "####......#####...####",
   "####....#######...####",
   "####....######....####",
   "####...########...####",
   ".####.##########..####",
   ".####..####.#########.",
   ".#####..##...########.",
   "..#####.......#######.",
   "..######......######..",
   "...###################",
   "....##################",
   "......###########.###.",
   "........######.....#.."]

   @image0 = QPixmap.new(@image0_data)
   setName("Form1")
   resize( 446,310)
   setCaption(tr("Form1"))

   rgridlayout_0 = QGridLayout.new(self)
   rgridlayout_0.setMargin(11)
   rgridlayout_0.setSpacing(6)

   @PushButton1 = QPushButton.new(self)
   @PushButton1.setName("PushButton1")
   @PushButton1.setText(tr("Close"))
   rgridlayout_0.addWidget(@PushButton1,4,4)

   @Frame9 = QFrame.new(self)
   @Frame9.setName("Frame9")
   @Frame9.setCursor(QCursor.new(6))
   @Frame9.setFrameShape(QFrame::Box)
   @Frame9.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame9,2,1)

   @Frame10 = QFrame.new(self)
   @Frame10.setName("Frame10")
   @Frame10.setCursor(QCursor.new(7))
   @Frame10.setFrameShape(QFrame::Box)
   @Frame10.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame10,2,2)

   @Frame11 = QFrame.new(self)
   @Frame11.setName("Frame11")
   @Frame11.setCursor(QCursor.new(8))
   @Frame11.setFrameShape(QFrame::Box)
   @Frame11.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame11,2,3)

   @Frame12 = QFrame.new(self)
   @Frame12.setName("Frame12")
   @Frame12.setCursor(QCursor.new(9))
   @Frame12.setFrameShape(QFrame::Box)
   @Frame12.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame12,2,4)

   @Frame13 = QFrame.new(self)
   @Frame13.setName("Frame13")
   @Frame13.setCursor(QCursor.new(10))
   @Frame13.setFrameShape(QFrame::Box)
   @Frame13.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame13,3,0)

   @Frame14 = QFrame.new(self)
   @Frame14.setName("Frame14")
   @Frame14.setCursor(QCursor.new(11))
   @Frame14.setFrameShape(QFrame::Box)
   @Frame14.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame14,3,1)

   @Frame15 = QFrame.new(self)
   @Frame15.setName("Frame15")
   @Frame15.setCursor(QCursor.new(12))
   @Frame15.setFrameShape(QFrame::Box)
   @Frame15.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame15,3,2)

   @Frame16 = QFrame.new(self)
   @Frame16.setName("Frame16")
   @Frame16.setCursor(QCursor.new(13))
   @Frame16.setFrameShape(QFrame::Box)
   @Frame16.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame16,3,3)

   @Frame17 = QFrame.new(self)
   @Frame17.setName("Frame17")
   @Frame17.setCursor(QCursor.new(14))
   @Frame17.setFrameShape(QFrame::Box)
   @Frame17.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame17,3,4)

   @Frame3 = QFrame.new(self)
   @Frame3.setName("Frame3")
   @Frame3.setCursor(QCursor.new(0))
   @Frame3.setFrameShape(QFrame::Box)
   @Frame3.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame3,1,0)

   @Frame8 = QFrame.new(self)
   @Frame8.setName("Frame8")
   @Frame8.setCursor(QCursor.new(4))
   @Frame8.setFrameShape(QFrame::Box)
   @Frame8.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame8,1,4)

   @TextLabel1 = QLabel.new(self)
   @TextLabel1.setName("TextLabel1")
   @TextLabel1.setMaximumSize(32767,28)
   @TextLabel1.setText(tr("Cursor Test Example"))
   @TextLabel1.setAlignment(Qt::AlignCenter)
   rgridlayout_0.addMultiCellWidget(@TextLabel1,0,0,0,4)

   @Frame5 = QFrame.new(self)
   @Frame5.setName("Frame5")
   @Frame5.setCursor(QCursor.new(1))
   @Frame5.setFrameShape(QFrame::Box)
   @Frame5.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame5,1,1)

   @Frame6 = QFrame.new(self)
   @Frame6.setName("Frame6")
   @Frame6.setCursor(QCursor.new(2))
   @Frame6.setFrameShape(QFrame::Box)
   @Frame6.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame6,1,2)

   @Frame7 = QFrame.new(self)
   @Frame7.setName("Frame7")
   @Frame7.setCursor(QCursor.new(3))
   @Frame7.setFrameShape(QFrame::Box)
   @Frame7.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame7,1,3)

   @Frame8_2 = QFrame.new(self)
   @Frame8_2.setName("Frame8_2")
   @Frame8_2.setCursor(QCursor.new(5))
   @Frame8_2.setFrameShape(QFrame::Box)
   @Frame8_2.setFrameShadow(QFrame::Raised)
   rgridlayout_0.addWidget(@Frame8_2,2,0)

#connections of main form
   
   Qt2::connect(@PushButton1, QSIGNAL("clicked()"), self, "close()")

#taborders
end

#
#def close()   
#   QMessageBox::information(nil,"Unimplemented slot","close() is not implemented.")
#end
end
#main roop for displaying form

a = QApplication.new([$0]+ARGV)
codec = QTextCodec.codecForName('UTF-8')
a.setDefaultCodec(codec)
#for close to quit program
Qt2::connect(QApplication::qApp,QSIGNAL("lastWindowClosed()"),
   QApplication::qApp,QSLOT("quit()"))
myform = Form1.new
a.setMainWidget(myform)
myform.show()
a.exec
