www.pudn.com > routeplan_mainmenu.rar > mainmenu.cpp
/**************************************************************************** ** Form implementation generated from reading ui file 'mainmenubase.ui' ** ** Created: 鍏� 7鏈�21 12:49:35 2007 ** by: The User Interface Compiler ($Id: qt/main.cpp 3.1.1 edited Nov 21 17:40 $) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "mainmenu.h" #include "quanguo.h" #include "sheshi.h" #include "findbase.h" #include#include #include #include #include #include #include #include #include #include #include /* * Constructs a mainmenubase as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ static const char* const image0_data[] = { "16 16 42 1", "a c None", ". c #000000", "v c #000000", "# c #000000", "K c #0f0f0f", "C c #1b1b1b", "J c #1c1c1c", "z c #1e1e1e", "q c #252525", "N c #282828", "m c #292929", "M c #363636", "H c #3d3d3d", "f c #434f00", "g c #4c5900", "x c #4e4e4e", "u c #535353", "s c #575757", "L c #636363", "h c #666666", "k c #748800", "E c #777677", "F c #777776", "G c #777777", "l c #8ca500", "I c #9f9e9f", "D c #a4a3a4", "B c #a8a8a8", "o c #acca00", "A c #afaeae", "y c #b4b4b4", "w c #bababa", "d c #bdbdbd", "t c #c0c0c0", "r c #c6c6c6", "p c #cbcbcb", "n c #d1d1d1", "j c #d5d5d5", "e c #d9d9d9", "c c #dcdcdc", "b c #e4e4e4", "i c #ffffff", ".#########.aaaaa", "#bcccccccd#.#.aa", "#efgggggfh##i#.a", "#jklllllkm##ii#.", "#nloooool#iiiii#", "#ploo#oolq##ii#.", "#rloooools##i#.a", "#tloo#oolu#v#vaa", "#wlooooolx##i#aa", "#yloo#oolz#ii##.", "#Aloooool#iiiii#", "#BlooooolC#ii##.", "#DEFGGFGGH##i#aa", "#IiJiJiJiK#.#.aa", "#LMMMMMMMN#aaaaa", ".#########.aaaaa"}; mainmenubase::mainmenubase( QWidget* parent, const char* name, WFlags fl ) : QDialog( parent, name, TRUE ) ,image0( (const char **) image0_data ) { if ( !name ) setName( "mainmenubase" ); setMaximumSize( QSize( 200, 176 ) ); widgetStack = new QWidgetStack( this, "widgetStack" ); widgetStack->setGeometry( QRect( 90, 0, 100, 240 ) ); page = new QWidget( widgetStack, "page" ); yicunmudidibutton = new QPushButton( page, "yicunmudidibutton" ); yicunmudidibutton->setGeometry( QRect( 3, 12, 85, 22 ) ); //yicunmudidibutton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, yicunmudidibutton->sizePolicy().hasHeightForWidth() ) ); yicunmudidibutton->setMaximumSize( QSize( 85, 22 ) ); yicunmudidibutton->setFocusPolicy( QPushButton::TabFocus ); benxianbutton = new QPushButton( page, "benxianbutton" ); benxianbutton->setGeometry( QRect( 3, 40, 85, 22 ) ); //benxianbutton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, benxianbutton->sizePolicy().hasHeightForWidth() ) ); benxianbutton->setMaximumSize( QSize( 85, 22 ) ); benxianbutton->setFocusPolicy( QPushButton::NoFocus ); benshibutton = new QPushButton( page, "benshibutton" ); benshibutton->setGeometry( QRect( 3, 68, 85, 22 ) ); benshibutton->setMaximumSize( QSize( 85, 22 ) ); quanguobutton = new QPushButton( page, "quanguobutton" ); quanguobutton->setGeometry( QRect( 3, 96, 85, 22 ) ); quanguobutton->setMaximumSize( QSize( 85, 22 ) ); jingweidubutton = new QPushButton( page, "jingweidubutton" ); jingweidubutton->setGeometry( QRect( 3, 124, 85, 22 ) ); jingweidubutton->setMaximumSize( QSize( 85, 22 ) ); bianmabutton = new QPushButton( page, "bianmabutton" ); bianmabutton->setGeometry( QRect( 3, 152, 85, 22 ) ); bianmabutton->setMaximumSize( QSize( 85, 22 ) ); widgetStack->addWidget( page, 0 ); page_2 = new QWidget( widgetStack, "page_2" ); morebutton = new QPushButton( page_2, "morebutton" ); morebutton->setGeometry( QRect( 3, 39, 85, 22 ) ); morebutton->setMaximumSize( QSize( 85, 22 ) ); /* canyinbutton = new QPushButton( page_2, "canyinbutton" ); canyinbutton->setGeometry( QRect( 3, 95, 85, 22 ) ); canyinbutton->setMaximumSize( QSize( 85, 22 ) ); shanyebutton = new QPushButton( page_2, "shanyebutton" ); shanyebutton->setGeometry( QRect( 3, 67, 85, 22 ) ); shanyebutton->setMaximumSize( QSize( 85, 22 ) ); xiuxianbutton = new QPushButton( page_2, "xiuxianbutton" ); xiuxianbutton->setGeometry( QRect( 3, 123, 85, 22 ) ); xiuxianbutton->setMaximumSize( QSize( 85, 22 ) ); lvyoubutton = new QPushButton( page_2, "lvyoubutton" ); lvyoubutton->setGeometry( QRect( 3, 151, 85, 22 ) ); lvyoubutton->setMaximumSize( QSize( 85, 22 ) ); wenjiaobutton = new QPushButton( page_2, "wenjiaobutton" ); wenjiaobutton->setGeometry( QRect(3, 179, 85, 22 ) ); wenjiaobutton->setMaximumSize( QSize( 85, 22 ) ); qitabutton = new QPushButton( page_2, "qitabutton" ); qitabutton->setGeometry( QRect( 3, 207, 85, 22 ) ); qitabutton->setMaximumSize( QSize( 85, 22 ) ); jiaotongbutton = new QPushButton( page_2, "jiaotongbutton" ); jiaotongbutton->setGeometry( QRect( 3, 11, 85, 22 ) ); jiaotongbutton->setMaximumSize( QSize( 85, 22 ) );*/ widgetStack->addWidget( page_2, 1 ); page_3 = new QWidget( widgetStack, "page_3" ); GPSbutton = new QPushButton( page_3, "GPSbutton" ); GPSbutton->setGeometry( QRect( 3, 11, 85, 22 ) ); GPSbutton->setMaximumSize( QSize( 85, 22 ) ); mudidiguanlibutton = new QPushButton( page_3, "mudidiguanlibutton" ); mudidiguanlibutton->setGeometry( QRect( 3, 39, 85, 22 ) ); mudidiguanlibutton->setMaximumSize( QSize( 85, 22 ) ); xingqudianguanlibutton = new QPushButton( page_3, "xingqudianguanlibutton" ); xingqudianguanlibutton->setGeometry( QRect( 3, 67, 85, 22 ) ); xingqudianguanlibutton->setMaximumSize( QSize( 85, 22 ) ); zuiyoulujingbutton = new QPushButton( page_3, "zuiyoulujingbutton" ); zuiyoulujingbutton->setGeometry( QRect( 3, 95, 85, 22 ) ); zuiyoulujingbutton->setMaximumSize( QSize( 85, 22 ) ); widgetStack->addWidget( page_3, 2 ); page_4 = new QWidget( widgetStack, "page_4" ); xianshishezhibutton = new QPushButton( page_4, "xianshishezhibutton" ); xianshishezhibutton->setGeometry( QRect( 3, 11, 85, 22 ) ); xianshishezhibutton->setMaximumSize( QSize( 85, 22 ) ); shengyinshezhibutton = new QPushButton( page_4, "shengyinshezhibutton" ); shengyinshezhibutton->setGeometry( QRect(3, 39, 85, 22 ) ); shengyinshezhibutton->setMaximumSize( QSize( 85, 22 ) ); daohangshezhibutton = new QPushButton( page_4, "daohangshezhibutton" ); daohangshezhibutton->setGeometry( QRect( 3, 67, 85, 22 ) ); daohangshezhibutton->setMaximumSize( QSize( 85, 22 ) ); GPSshezhibutton = new QPushButton( page_4, "GPSshezhibutton" ); GPSshezhibutton->setGeometry( QRect( 3, 95, 85, 22 ) ); GPSshezhibutton->setMaximumSize( QSize( 85, 22 ) ); widgetStack->addWidget( page_4, 3 ); page_5 = new QWidget( widgetStack, "page_5" ); widgetStack->addWidget( page_5, 4 ); page_6 = new QWidget( widgetStack, "page_6" ); widgetStack->addWidget( page_6, 5 ); // fanhuibutton = new QPushButton( this, "fanhuibutton" ); // fanhuibutton->setGeometry( QRect( 3, 3, 85, 22 ) ); listBox1 = new QListBox( this, "listBox1" ); listBox1->setGeometry( QRect( 4, 6, 85, 160 ) ); languageChange(); resize( QSize(191, 176).expandedTo(minimumSizeHint()) ); QScrollView *w =new QScrollView(this); w->setGeometry( QRect( 90,0,105,176 ) ); widgetStack->setMinimumSize(90,240); w->addChild(widgetStack); w->setHScrollBarMode(QScrollView::AlwaysOff); // signals and slots connections connect( listBox1, SIGNAL( highlighted(int) ), widgetStack, SLOT( raiseWidget(int) ) ); connect( quanguobutton, SIGNAL( clicked() ), this, SLOT( close() ) ); connect( quanguobutton, SIGNAL (clicked()), this, SLOT(quanguodialog())); connect( morebutton, SIGNAL( clicked() ), this, SLOT( close() ) ); connect( morebutton, SIGNAL (clicked()), this, SLOT(sheshidialog())); connect( zuiyoulujingbutton, SIGNAL( clicked() ), this, SLOT( close() ) ); connect( zuiyoulujingbutton, SIGNAL (clicked()), this, SLOT(finddialog())); } /* * Destroys the object and frees any allocated resources */ mainmenubase::~mainmenubase() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void mainmenubase::languageChange() { setCaption( tr( "MainMenu" ) ); yicunmudidibutton->setText( tr( "yicunmudidi" ) ); benxianbutton->setText( tr( "benxian" ) ); benshibutton->setText( tr( "benshi" ) ); quanguobutton->setText( tr( "quanguo" ) ); jingweidubutton->setText( tr( "jinweidudingwei" ) ); bianmabutton->setText( tr( "bianma" ) ); morebutton->setText( tr( "more" ) ); //canyinbutton->setText( tr( "canyinzhusu" ) ); //shanyebutton->setText( tr( "shanyejigou" ) ); //xiuxianbutton->setText( tr( "xiuxianyule" ) ); //lvyoubutton->setText( tr( "lvyoujingdian" ) ); // wenjiaobutton->setText( tr( "wenjiaokeyan" ) ); //qitabutton->setText( tr( "qitadian" ) ); //jiaotongbutton->setText( tr( "jiaotongsheshi" ) ); GPSbutton->setText( tr( "zhuanyeGPS" ) ); mudidiguanlibutton->setText( tr( "mudidiguanli" ) ); xingqudianguanlibutton->setText( tr( "xingqudingguanli" ) ); zuiyoulujingbutton->setText( tr( "zuiyoulujing" ) ); xianshishezhibutton->setText( tr( "xianshishezhi" ) ); shengyinshezhibutton->setText( tr( "shengyinshezhi" ) ); daohangshezhibutton->setText( tr( "daohangshezhi" ) ); GPSshezhibutton->setText( tr( "GPSshezhi" ) ); listBox1->clear(); listBox1->insertItem(image0, tr( "mudidi" ) ); listBox1->insertItem( tr( "fujinsheshi" ) ); listBox1->insertItem( tr( "gaoji" ) ); listBox1->insertItem( tr( "xitongshezhi" ) ); listBox1->insertItem( tr( "guanyu" ) ); listBox1->insertItem( tr( "xitongtuichu" ) ); } void mainmenubase::quanguodialog() { quanguo *f =new quanguo(0,"quanguo"); f->exec(); delete f; } void mainmenubase::sheshidialog() { sheshi *f =new sheshi(0,"sheshi"); f->exec(); delete f; } void mainmenubase::finddialog() { findbase *f =new findbase(0,"findbase"); f->exec(); delete f; }