📄 diapage.cpp
字号:
/*************************************************************************** * Copyright (C) 2006 by Norbert Szabo * * nszabo@helta.hu * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/#include "diapage.h"#include "ncreportdesignerdocument.h"#include <qvariant.h>#include <qpushbutton.h>#include <qgroupbox.h>#include <qlineedit.h>#include <qlabel.h>#include <qcombobox.h>#include <qspinbox.h>#include <qbuttongroup.h>#include <qradiobutton.h>#include <qlayout.h>#include <qtooltip.h>#include <qwhatsthis.h>#include <qtabwidget.h>static const char * const _localenames[] = { "Latin1", "Big5", "Big5-HKSCS", "eucJP", "eucKR", "GB2312", "GBK", "GB18030", "JIS7", "Shift-JIS", "TSCII", "utf8", "utf16", "KOI8-R", "KOI8-U", "ISO8859-1", "ISO8859-2", "ISO8859-3", "ISO8859-4", "ISO8859-5", "ISO8859-6", "ISO8859-7", "ISO8859-8", "ISO8859-9", "ISO8859-10", "ISO8859-13", "ISO8859-14", "ISO8859-15", "IBM 850", "IBM 866", "CP874", "CP1250", "CP1251", "CP1252", "CP1253", "CP1254", "CP1255", "CP1256", "CP1257", "CP1258", "Apple Roman", "TIS-620",0 };static const char * const _pagesizes[] = { "A4", "B5", "Letter", "Legal", "Executive", "A0","A1","A2","A3","A5","A5M", "A6","A7","A8","A9","B0","B1","B10","B2","B3","B4","B6","B7", "B8"," B9","C5E","COMM10E","DLE","FOLIO","LEDGER","TABLOID",0 }; static const char * const _printermodes[] = { "screen", "printer", "high", "comp",0 }; static const char * const _datasources[] = { "Database", "Text file",0 };static const char * const _txtdelimiters[] = { "", "tab", "comma", "semicolon",0 };diaPage::diaPage( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ){ if ( !name ) setName( "diaPage" ); diaPageLayout = new QHBoxLayout( this, 6, 6, "diaPageLayout"); layLeft = new QVBoxLayout( 0, 0, 6, "layLeft"); tab = new QTabWidget( this, "tab" ); layLeft->addWidget( tab ); pagePage = new QWidget( tab, "pagePage" ); pageDataSource = new QWidget( tab, "pageDataSource" ); layPagePage = new QVBoxLayout( pagePage, 6, 6, "layPagePage"); layPageDataSource = new QVBoxLayout( pageDataSource, 6, 6, "layPageDataSource"); gbGen = new QGroupBox( pagePage, "gbGen" ); gbGen->setColumnLayout(0, Qt::Vertical ); gbGen->layout()->setSpacing( 6 ); gbGen->layout()->setMargin( 6 ); gbGenLayout = new QGridLayout( gbGen->layout(), 0,0,3 ); gbGenLayout->setAlignment( Qt::AlignTop ); leFont = new QLineEdit( gbGen, "leFont" ); gbGenLayout->addWidget( leFont, 4, 1 ); leMasterAlias = new QLineEdit( gbGen, "leMasterAlias" ); gbGenLayout->addWidget( leMasterAlias, 6, 1 ); lblEncode = new QLabel( gbGen, "lblEncode" ); gbGenLayout->addWidget( lblEncode, 1, 0 ); lblPrintMode = new QLabel( gbGen, "lblPrintMode" ); gbGenLayout->addWidget( lblPrintMode, 3, 0 ); comboPrinterMode = new QComboBox( FALSE, gbGen, "comboPrinterMode" ); comboPrinterMode->setMaximumSize( QSize( 170, 32767 ) ); gbGenLayout->addWidget( comboPrinterMode, 3, 1 ); textLabel10 = new QLabel( gbGen, "textLabel10" ); gbGenLayout->addWidget( textLabel10, 6, 0 ); lblFont = new QLabel( gbGen, "lblFont" ); gbGenLayout->addWidget( lblFont, 4, 0 ); lblPageSize = new QLabel( gbGen, "lblPageSize" ); gbGenLayout->addWidget( lblPageSize, 2, 0 ); lblFonstSize = new QLabel( gbGen, "lblFonstSize" ); gbGenLayout->addWidget( lblFonstSize, 5, 0 ); lblName = new QLabel( gbGen, "lblName" ); gbGenLayout->addWidget( lblName, 0, 0 ); spFontSize = new QSpinBox( gbGen, "spFontSize" ); spFontSize->setMaximumSize( QSize( 60, 32767 ) ); spFontSize->setMinValue( 5 ); gbGenLayout->addWidget( spFontSize, 5, 1 ); comboEncodings = new QComboBox( FALSE, gbGen, "comboEncodings" ); comboEncodings->setMaximumSize( QSize( 170, 32767 ) ); gbGenLayout->addWidget( comboEncodings, 1, 1 ); comboPageSize = new QComboBox( FALSE, gbGen, "comboPageSize" ); comboPageSize->setMaximumSize( QSize( 170, 32767 ) ); gbGenLayout->addWidget( comboPageSize, 2, 1 ); leName = new QLineEdit( gbGen, "leName" ); gbGenLayout->addWidget( leName, 0, 1 ); layPagePage->addWidget( gbGen ); layMargin = new QHBoxLayout( 0, 0, 6, "layMargin"); gbMargin = new QGroupBox( pagePage, "gbMargin" ); gbMargin->setColumnLayout(0, Qt::Vertical ); gbMargin->layout()->setSpacing( 0 ); gbMargin->layout()->setMargin( 6 ); gbMarginLayout = new QGridLayout( gbMargin->layout(),0,0,3 ); gbMarginLayout->setAlignment( Qt::AlignTop ); lblLeft = new QLabel( gbMargin, "lblLeft" ); gbMarginLayout->addWidget( lblLeft, 1, 0 ); spRight = new QSpinBox( gbMargin, "spRight" ); gbMarginLayout->addWidget( spRight, 1, 5 ); lblBottom = new QLabel( gbMargin, "lblBottom" ); gbMarginLayout->addWidget( lblBottom, 2, 2 ); spBottom = new QSpinBox( gbMargin, "spBottom" ); gbMarginLayout->addWidget( spBottom, 2, 3 ); lblTop = new QLabel( gbMargin, "lblTop" ); gbMarginLayout->addWidget( lblTop, 0, 2 ); spTop = new QSpinBox( gbMargin, "spTop" ); gbMarginLayout->addWidget( spTop, 0, 3 ); lblRight = new QLabel( gbMargin, "lblRight" ); gbMarginLayout->addWidget( lblRight, 1, 4 ); spLeft = new QSpinBox( gbMargin, "spLeft" ); gbMarginLayout->addWidget( spLeft, 1, 1 ); layMargin->addWidget( gbMargin ); gbOrient = new QButtonGroup( pagePage, "gbOrient" ); gbOrient->setColumnLayout(0, Qt::Vertical ); gbOrient->layout()->setSpacing( 6 ); gbOrient->layout()->setMargin( 6 ); gbOrientLayout = new QVBoxLayout( gbOrient->layout() ); gbOrientLayout->setAlignment( Qt::AlignTop ); radioP = new QRadioButton( gbOrient, "radioP" ); radioP->setChecked( TRUE ); gbOrientLayout->addWidget( radioP ); radioL = new QRadioButton( gbOrient, "radioL" ); gbOrientLayout->addWidget( radioL ); layMargin->addWidget( gbOrient ); layPagePage->addLayout( layMargin ); // Database connection layDSTop = new QHBoxLayout( layPageDataSource, 6, "layDSTop");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -