void Preferences::createFontPage() { // font parms page QWidget *w = new QWidget(this); Q3VBoxLayout *vbox = new Q3VBoxLayout(w); Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3); grid->setMargin(5); grid->setSpacing(5); grid->setColStretch(1, 1); grid->setColStretch(2, 2); vbox->insertStretch(-1, 1); // plot font QLabel *label = new QLabel(tr("Plot Font"), w); grid->addWidget(label, 0, 0); plotFontButton = new FontButton(w, plotFont); grid->addWidget(plotFontButton, 0, 1); connect(plotFontButton, SIGNAL(valueChanged()), this, SLOT(slotModified())); // app font label = new QLabel(tr("App Font"), w); grid->addWidget(label, 1, 0); appFontButton = new FontButton(w, appFont); grid->addWidget(appFontButton, 1, 1); connect(appFontButton, SIGNAL(valueChanged()), this, SLOT(slotModified())); addTab(w, tr("Fonts")); }
void Preferences::createETPage() { // extra tool bar page QWidget *w = new QWidget(this); Q3VBoxLayout *vbox = new Q3VBoxLayout(w); Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 2); grid->setMargin(5); grid->setSpacing(5); grid->setColStretch(1, 1); vbox->insertStretch(-1, 1); int i = 0; // count rows int j = 0; // "count" cols bool tb; // temporary RcFile rcfile; QLabel *label = new QLabel(tr("Recent charts"), w); grid->addWidget(label, i, j); recentComboBoxCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowRecentCharts, tb); recentComboBoxCheck->setChecked(tb); connect(recentComboBoxCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(recentComboBoxCheck, i++, j + 1); addTab(w, tr("ExtraToolbar")); }
TesterRulePage::TesterRulePage (QWidget *p) : QWidget (p) { Q3VBoxLayout *vbox = new Q3VBoxLayout(this); vbox->setMargin(5); vbox->setSpacing(5); Q3GridLayout *grid = new Q3GridLayout(vbox, 2, 2); Q3VGroupBox *gbox = new Q3VGroupBox(tr("Enter Long"), this); grid->addWidget(gbox, 0, 0); enterLongEdit = new FormulaEdit(gbox, FormulaEdit::Logic); gbox = new Q3VGroupBox(tr("Exit Long"), this); grid->addWidget(gbox, 0, 1); exitLongEdit = new FormulaEdit(gbox, FormulaEdit::Logic); gbox = new Q3VGroupBox(tr("Enter Short"), this); grid->addWidget(gbox, 1, 0); enterShortEdit = new FormulaEdit(gbox, FormulaEdit::Logic); gbox = new Q3VGroupBox(tr("Exit Short"), this); grid->addWidget(gbox, 1, 1); exitShortEdit = new FormulaEdit(gbox, FormulaEdit::Logic); }
TunerView::TunerView( int viewID_, QWidget *parent ) : ViewWidget( viewID_, parent) { //setCaption("Chromatic Tuner"); Q3GridLayout *layout = new Q3GridLayout(this, 9, 3, 2); layout->setResizeMode(QLayout::SetNoConstraint); // Tuner widget goes from (0, 0) to (0, 8); //tunerWidget = new TunerWidget(this); tunerWidget = new VibratoTunerWidget(this); layout->addMultiCellWidget(tunerWidget, 0, 0, 0, 8); // Slider goes from (2,0) to (2,9) //slider = new QwtSlider(this, "slider", Qt::Horizontal, QwtSlider::Bottom, QwtSlider::BgTrough); #if QWT_VERSION == 0x050000 slider = new QwtSlider(this, Qt::Horizontal, QwtSlider::Bottom, QwtSlider::BgTrough); #else slider = new QwtSlider(this, Qt::Horizontal, QwtSlider::BottomScale, QwtSlider::BgTrough); #endif slider->setRange(0, 2); slider->setReadOnly(false); layout->addMultiCellWidget(slider, 1, 1, 0, 8); QToolTip::add(slider, "Increase slider to smooth the pitch over a longer time period"); ledBuffer = new QPixmap(); leds.push_back(new LEDIndicator(ledBuffer, this, "A")); leds.push_back(new LEDIndicator(ledBuffer, this, "B")); leds.push_back(new LEDIndicator(ledBuffer, this, "C")); leds.push_back(new LEDIndicator(ledBuffer, this, "D")); leds.push_back(new LEDIndicator(ledBuffer, this, "E")); leds.push_back(new LEDIndicator(ledBuffer, this, "F")); leds.push_back(new LEDIndicator(ledBuffer, this, "G")); leds.push_back(new LEDIndicator(ledBuffer, this, "#")); // Add the leds for note names into the positions (1, 0) to (1, 6) for (int n = 0; n < 7; n++) { layout->addWidget(leds.at(n), 2, n); } // (1, 7) is blank // Add the flat led layout->addWidget(leds.at(7), 2, 8); layout->setRowStretch( 0, 4 ); layout->setRowStretch( 1, 1 ); layout->setRowStretch( 2, 0 ); //connect(gdata->view, SIGNAL(onFastUpdate(double)), this, SLOT(update())); //connect(gdata, SIGNAL(onChunkUpdate()), tunerWidget, SLOT(doUpdate())); connect(gdata, SIGNAL(onChunkUpdate()), this, SLOT(doUpdate())); connect(tunerWidget, SIGNAL(ledSet(int, bool)), this, SLOT(setLed(int, bool))); }
void QStringOption::initWidget() { Q3GridLayout* qgl = new Q3GridLayout(this,2,2); QLabel* label = new QLabel(optionTitle(),this); mpOptionLineEdit = new QLineEdit(this); connect(mpOptionLineEdit,SIGNAL(textChanged(const QString&)), this,SLOT(slotTextChanged(const QString&))); //create pixmap assignPixmap(); qgl->addMultiCellWidget(pixmapWidget(),0,1,0,0); qgl->addWidget(label,0,1); qgl->addWidget(mpOptionLineEdit,1,1); qgl->setSpacing(5); qgl->setColStretch(1,1); qgl->activate(); }
TicTacGameBoard::TicTacGameBoard( bool meFirst, int n, QWidget *parent, const char *name ) : QWidget( parent, name ) { st = Init; // initial state nBoard = n; n *= n; // make square comp_starts = FALSE; // human starts buttons = new TicTacButtons(n); // create real buttons btArray = new TicTacArray(n); // create button model Q3GridLayout * grid = new Q3GridLayout( this, nBoard, nBoard, 4 ); qDebug("added grid"); QPalette p( Qt::blue ); for ( int i=0; i<n; i++ ) { // create and connect buttons TicTacButton *ttb = new TicTacButton( this ); ttb->setPalette( p ); ttb->setEnabled( FALSE ); connect( ttb, SIGNAL(clicked()), SLOT(buttonClicked()) ); grid->addWidget( ttb, i%nBoard, i/nBoard ); buttons->insert( i, ttb ); btArray->at(i) = TicTacButton::Blank; // initial button type } QTime t = QTime::currentTime(); // set random seed srand( t.hour()*12+t.minute()*60+t.second()*60 ); computerStarts(!meFirst); }
void SaneIntOption::initWidget() { Q3GridLayout* qgl = new Q3GridLayout(this,3,3); mpTitleLabel = new QLabel(optionTitle(),this); mpValueSpinBox = new QSpinBox(INT_MIN,INT_MAX,1,this); mpValueSpinBox->setFocusPolicy(Qt::StrongFocus);//should get focus after clicking //create pixmap assignPixmap(); qgl->addMultiCellWidget(pixmapWidget(),0,2,0,0); qgl->addWidget(mpTitleLabel,1,1); qgl->addWidget(mpValueSpinBox,1,2); qgl->setSpacing(5); qgl->setColStretch(1,1); connect(mpValueSpinBox,SIGNAL(valueChanged(int)),this,SLOT(slotValueChanged(int))); qgl->activate(); }
BrowserSearchDialog::BrowserSearchDialog(const QPoint & p) : QDialog(0, "Browser search", TRUE) { setCaption("Browser search"); move(p); Q3VBoxLayout * vbox = new Q3VBoxLayout(this); vbox->setMargin(5); Q3GridLayout * gl = new Q3GridLayout(vbox, 4, 2, 5/*space*/); ed = new QLineEdit(this); ed->setText(saved_ed); gl->addWidget(new QLabel("Containing", this), 1, 0, Qt::AlignLeft); gl->addWidget(ed, 1, 1); Q3GroupBox * gb = new Q3GroupBox(2, Qt::Horizontal, this); case_sensitive = new QCheckBox("case sensitive", gb); case_sensitive->setChecked(saved_case_sensitive); gl->addWidget(gb, 2, 1); gl->addWidget(new QLabel("Result", this), 3, 0, Qt::AlignLeft); results = new Q3ComboBox(FALSE, this); gl->addWidget(results, 3, 1); Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox); hbox->setMargin(5); QPushButton * search_b = new QPushButton("Search", this); QPushButton * select_b = new QPushButton("Select", this); QPushButton * close_b = new QPushButton("Close", this); search_b->setDefault(TRUE); hbox->addWidget(search_b); hbox->addWidget(select_b); hbox->addWidget(close_b); connect(search_b, SIGNAL(clicked()), this, SLOT(search())); connect(select_b, SIGNAL(clicked()), this, SLOT(select())); connect(close_b, SIGNAL(clicked()), this, SLOT(reject())); setMaximumHeight(sizeHint().height()); }
void StocksDialog::createSplitPage () { QWidget *w = new QWidget(this); Q3VBoxLayout *vbox = new Q3VBoxLayout(w); vbox->setMargin(5); vbox->setSpacing(5); Q3GridLayout *grid = new Q3GridLayout(vbox); grid->setMargin(0); grid->setSpacing(5); QLabel *label = new QLabel(tr("Split Date"), w); grid->addWidget(label, 0, 0); Bar bar; db->getLastBar(bar); QDateTime dt; bar.getDate(dt); if (! bar.getEmptyFlag()) splitDate = new Q3DateEdit(dt.date(), w); else splitDate = new Q3DateEdit(QDate::currentDate(), w); splitDate->setOrder(Q3DateEdit::YMD); grid->addWidget(splitDate, 0, 1); label = new QLabel(tr("Split Ratio"), w); grid->addWidget(label, 1, 0); splitRatio = new QLineEdit("2:1", w); grid->addWidget(splitRatio, 1, 1); QPushButton *button = new QPushButton(tr("Perform Split"), w); connect(button, SIGNAL(clicked()), this, SLOT(split())); vbox->addWidget(button); vbox->addStretch(1); addTab(w, tr("Split")); }
void Preferences::createColorPage() { // colors parms page QWidget *w = new QWidget(this); Q3VBoxLayout *vbox = new Q3VBoxLayout(w); Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3); grid->setMargin(5); grid->setSpacing(5); grid->setColStretch(1, 1); grid->setColStretch(2, 2); vbox->insertStretch(-1, 1); // background color QLabel *label = new QLabel(tr("Chart Background"), w); grid->addWidget(label, 0, 0); backgroundColorButton = new ColorButton(w, backgroundColor); grid->addWidget(backgroundColorButton, 0, 1); backgroundColorButton->setColorButton(); connect(backgroundColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified())); // border color label = new QLabel(tr("Chart Border"), w); grid->addWidget(label, 1, 0); borderColorButton = new ColorButton(w, borderColor); grid->addWidget(borderColorButton, 1, 1); borderColorButton->setColorButton(); connect(borderColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified())); // grid color label = new QLabel(tr("Chart Grid"), w); grid->addWidget(label, 2, 0); gridColorButton = new ColorButton(w, gridColor); grid->addWidget(gridColorButton, 2, 1); gridColorButton->setColorButton(); connect(gridColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified())); //FIXME: add adjustment possibility for prefered CO-colors. // in this way to add a spinbox to set the amount of colors too addTab(w, tr("Colors")); }
DomainChecklist::DomainChecklist(QWidget* parent, const char* name, long DomainID) : TAAWidget(parent) { setCaption( "Domain Checklist" ); if (!DomainID) return; myDomainID = DomainID; // Setup the widgets. There are a bunch. QLabel *customerIDLabel = new QLabel("Customer ID:", this, "customerIDLabel"); customerIDLabel->setAlignment(AlignRight|AlignVCenter); customerID = new QLabel(this, "customerID"); customerID->setAlignment(AlignLeft|AlignVCenter); QLabel *loginIDLabel = new QLabel("Login ID:", this, "loginIDLabel"); loginIDLabel->setAlignment(AlignRight|AlignVCenter); loginID = new QLabel(this, "loginID"); loginID->setAlignment(AlignLeft|AlignVCenter); QLabel *customerNameLabel = new QLabel("Customer Name:", this, "customerNameLabel"); customerNameLabel->setAlignment(AlignRight|AlignVCenter); customerName = new QLabel(this, "customerName"); customerName->setAlignment(AlignLeft|AlignVCenter); QLabel *domainNameLabel = new QLabel("Domain Name:", this, "domainNameLabel"); domainNameLabel->setAlignment(AlignRight|AlignVCenter); domainName = new QLabel(this, "domainName"); domainName->setAlignment(AlignLeft|AlignVCenter); hostmasterSubmit = new QCheckBox("Request submitted to Hostmaster", this, "hostmasterSubmit"); hostmastDate = new QLabel(this, "hostmastDate"); hostmastDate->setAlignment(AlignRight|AlignVCenter); internicSubmit = new QCheckBox("Request submitted to InterNIC", this, "internicSubmit"); nicReqDate = new QLabel(this, "nicReqDate"); nicReqDate->setAlignment(AlignRight|AlignVCenter); dnsDone = new QCheckBox("DNS records created/updated", this, "dnsDone"); dnsDate = new QLabel(this, "dnsDate"); dnsDate->setAlignment(AlignRight|AlignVCenter); mailDone = new QCheckBox("Mail system updated", this, "mailDone"); mailDate = new QLabel(this, "mailDate"); mailDate->setAlignment(AlignRight|AlignVCenter); vserverDone = new QCheckBox("Virtual server setup completed", this, "vserverDone"); vserverDate = new QLabel(this, "vserverDate"); vserverDate->setAlignment(AlignRight|AlignVCenter); QLabel *serverListLabel = new QLabel("Server:", this, "serverListLabel"); serverListLabel->setAlignment(AlignRight|AlignVCenter); serverList = new QComboBox(true, this, "serverList"); QLabel *processListLabel = new QLabel("Process:", this, "processListLabel"); processListLabel->setAlignment(AlignRight|AlignVCenter); processList = new QComboBox(true, this, "processList"); QLabel *ipAddressLabel = new QLabel("IP Address:", this, "ipAddressLabel"); ipAddressLabel->setAlignment(AlignRight|AlignVCenter); ipAddress = new QLineEdit(this, "ipAddress"); ipAddress->setMaxLength(16); internicDone = new QCheckBox("InterNIC request completed", this, "internicDone"); nicDoneDate = new QLabel(this, "nicDoneDate"); nicDoneDate->setAlignment(AlignRight|AlignVCenter); QLabel *nicAdminIDLabel = new QLabel("NIC Admin ID:", this, "nicAdminIDLabel"); nicAdminIDLabel->setAlignment(AlignRight|AlignVCenter); nicAdminID = new QLineEdit(this, "nicAdminID"); nicAdminID->setMaxLength(16); QLabel *nicBillIDLabel = new QLabel("NIC Billing ID:", this, "nicBillIDLabel"); nicBillIDLabel->setAlignment(AlignRight|AlignVCenter); nicBillID = new QLineEdit(this, "nicBillID"); nicBillID->setMaxLength(16); domainDone = new QCheckBox("Domain released", this, "domainDone"); doneDate = new QLabel(this, "domainDate"); doneDate->setAlignment(AlignRight|AlignVCenter); // Finally, our buttons. QPushButton *updateButton = new QPushButton("&Update", this, "updateButton"); connect(updateButton, SIGNAL(clicked()), this, SLOT(updateClicked())); QPushButton *saveButton = new QPushButton("&Save", this, "saveButton"); connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked())); QPushButton *cancelButton = new QPushButton("&Cancel", this, "cancelButton"); connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked())); // And now for the layout. Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 5); // Our info grid. Q3GridLayout *igrid = new Q3GridLayout(3, 4, 3); int curRow = 0; igrid->addWidget(customerIDLabel, curRow, 0); igrid->addWidget(customerID, curRow, 1); igrid->addWidget(loginIDLabel, curRow, 2); igrid->addWidget(loginID, curRow, 3); igrid->setRowStretch(curRow, 0); curRow++; igrid->addWidget(customerNameLabel, curRow, 0); igrid->addMultiCellWidget(customerName, curRow, curRow, 1, 3); igrid->setRowStretch(curRow, 0); curRow++; igrid->addWidget(domainNameLabel, curRow, 0); igrid->addMultiCellWidget(domainName, curRow, curRow, 1, 3); igrid->setRowStretch(curRow, 0); igrid->setColStretch(0, 0); igrid->setColStretch(1, 1); igrid->setColStretch(2, 0); igrid->setColStretch(3, 0); ml->addLayout(igrid, 0); ml->addWidget(new HorizLine(this), 0); Q3GridLayout *gl = new Q3GridLayout(12, 3, 3); curRow = 0; gl->addMultiCellWidget(hostmasterSubmit, curRow, curRow, 0, 1); gl->addWidget(hostmastDate, curRow, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addMultiCellWidget(internicSubmit, curRow, curRow, 0, 1); gl->addWidget(nicReqDate, curRow, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addMultiCellWidget(dnsDone, curRow, curRow, 0, 1); gl->addWidget(dnsDate, curRow, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addMultiCellWidget(mailDone, curRow, curRow, 0, 1); gl->addWidget(mailDate, curRow, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addMultiCellWidget(vserverDone, curRow, curRow, 0, 1); gl->addWidget(vserverDate, curRow, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addWidget(serverListLabel, curRow, 0); gl->addMultiCellWidget(serverList, curRow, curRow, 1, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addWidget(processListLabel, curRow, 0); gl->addMultiCellWidget(processList, curRow, curRow, 1, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addWidget(ipAddressLabel, curRow, 0); gl->addMultiCellWidget(ipAddress, curRow, curRow, 1, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addMultiCellWidget(internicDone, curRow, curRow, 0, 1); gl->addWidget(nicDoneDate, curRow, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addWidget(nicAdminIDLabel, curRow, 0); gl->addMultiCellWidget(nicAdminID, curRow, curRow, 1, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addWidget(nicBillIDLabel, curRow, 0); gl->addMultiCellWidget(nicBillID, curRow, curRow, 1, 2); gl->setRowStretch(curRow, 0); curRow++; gl->addMultiCellWidget(domainDone, curRow, curRow, 0, 1); gl->addWidget(doneDate, curRow, 2); gl->setRowStretch(curRow, 0); gl->setColStretch(0, 0); gl->setColStretch(1, 1); gl->setColStretch(2, 0); ml->addLayout(gl, 0); ml->addStretch(1); ml->addWidget(new HorizLine(this), 0); Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3); bl->addStretch(1); bl->addWidget(updateButton, 0); bl->addWidget(saveButton, 0); bl->addWidget(cancelButton, 0); ml->addLayout(bl, 0); refreshCheckList(); }
ChangeBillingCycle::ChangeBillingCycle(QWidget* parent, const char* name, long CustID) : TAAWidget(parent) { setCaption( "Edit Customer Billing Cycle" ); if (!CustID) return; myCustID = CustID; // Create the widgets QLabel *customerLabel = new QLabel("Customer:", this, "customerLabel"); customerLabel->setAlignment(AlignRight|AlignVCenter); customer = new QLabel(this, "customer"); customer->setAlignment(AlignLeft|AlignVCenter); QLabel *cycleListLabel = new QLabel("New Billing Cycle:", this, "cycleListLabel"); cycleListLabel->setAlignment(AlignRight|AlignVCenter); cycleList = new QComboBox(false, this, "cycleList"); QLabel *effectiveDateLabel = new QLabel("Effective Date:", this, "effectiveDateLabel"); effectiveDateLabel->setAlignment(AlignRight|AlignVCenter); effectiveDate = new Q3DateEdit(QDate::currentDate(), this, "effectiveDate"); QPushButton *saveButton = new QPushButton("&Save", this, "saveButton"); connect(saveButton, SIGNAL(clicked()), this, SLOT(saveBillingCycleChange())); QPushButton *cancelButton = new QPushButton("&Save", this, "cancelButton"); connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelBillingCycleChange())); // Our layout. Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3); Q3GridLayout *gl = new Q3GridLayout(2, 3); int curRow = 0; gl->addWidget(customerLabel, curRow, 0); gl->addWidget(customer, curRow, 1); gl->setRowStretch(curRow, 0); curRow++; gl->addWidget(cycleListLabel, curRow, 0); gl->addWidget(cycleList, curRow, 1); gl->setRowStretch(curRow, 0); curRow++; gl->addWidget(effectiveDateLabel, curRow, 0); gl->addWidget(effectiveDate, curRow, 1); gl->setRowStretch(curRow, 0); gl->setColStretch(0, 0); gl->setColStretch(1, 1); ml->addLayout(gl, 0); ml->addStretch(1); Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3); bl->addStretch(1); bl->addWidget(saveButton, 0); bl->addWidget(cancelButton, 0); ml->addLayout(bl, 0); // Load the list of rate plans. ADB DB; CustomersDB CDB; char tmpStr[1024]; CDB.get(CustID); sprintf(tmpStr, "%s (%ld)", (const char *) CDB.getStr("FullName"), myCustID); customer->setText(tmpStr); DB.query("select CycleID,InternalID from BillingCycles order by CycleID"); while (DB.getrow()) { cycleList->insertItem(DB.curRow["CycleID"]); if (atol(DB.curRow["InternalID"]) == CDB.getLong("BillingCycle")) { cycleList->setCurrentItem(cycleList->count()-1); } } }
void Preferences::createMTPage() { // main tool bar page QWidget *w = new QWidget(this); Q3VBoxLayout *vbox = new Q3VBoxLayout(w); Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 6); // two more cols as needed grid->setMargin(5); grid->setSpacing(5); grid->setColStretch(2, 1); // middle spacing col grid->setColStretch(5, 2); // outer right col vbox->insertStretch(-1, 1); int i = 0; // count rows int j = 0; // "count" cols bool tb; // temporary RcFile rcfile; QLabel *label = new QLabel(tr("Quit"), w); grid->addWidget(label, i, j); quitBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowQuitBtn, tb); quitBtnCheck->setChecked(tb); connect(quitBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(quitBtnCheck, i++, j + 1); label = new QLabel(tr("Preferences"), w); grid->addWidget(label, i, j); prefBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowPrefBtn, tb); prefBtnCheck->setChecked(tb); connect(prefBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(prefBtnCheck, i++, j + 1); label = new QLabel(tr("Side Panel"), w); grid->addWidget(label, i, j); sidePanelBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowSidePanelBtn, tb); sidePanelBtnCheck->setChecked(tb); connect(sidePanelBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(sidePanelBtnCheck, i++, j + 1); label = new QLabel(tr("Grid"), w); grid->addWidget(label, i, j); gridBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowGridBtn, tb); gridBtnCheck->setChecked(tb); connect(gridBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(gridBtnCheck, i++, j + 1); label = new QLabel(tr("Scale to Screen"), w); grid->addWidget(label, i, j); scaleToScreenBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowScaleToScreenBtn, tb); scaleToScreenBtnCheck->setChecked(tb); connect(scaleToScreenBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(scaleToScreenBtnCheck, i++, j + 1); label = new QLabel(tr("CrossHair"), w); grid->addWidget(label, i, j); crosshairBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCrosshairBtn, tb); crosshairBtnCheck->setChecked(tb); connect(crosshairBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(crosshairBtnCheck, i++, j + 1); // now fill a second col i = 0; j = 3; label = new QLabel(tr("PaperTrade"), w); grid->addWidget(label, i, j); paperTradeBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowPaperTradeBtn, tb); paperTradeBtnCheck->setChecked(tb); connect(paperTradeBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(paperTradeBtnCheck, i++, j + 1); label = new QLabel(tr("DrawMode"), w); grid->addWidget(label, i, j); drawModeBtnCheck= new QCheckBox(w); rcfile.loadData(RcFile::ShowDrawModeBtn, tb); drawModeBtnCheck->setChecked(tb); connect(drawModeBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(drawModeBtnCheck, i++, j + 1); label = new QLabel(tr("NewIndicator"), w); grid->addWidget(label, i, j); newIndicatorBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowNewIndicatorBtn, tb); newIndicatorBtnCheck->setChecked(tb); connect(newIndicatorBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(newIndicatorBtnCheck, i++, j + 1); label = new QLabel(tr("DataWindow"), w); grid->addWidget(label, i, j); dataWindowBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowDataWindowBtn, tb); dataWindowBtnCheck->setChecked(tb); connect(dataWindowBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(dataWindowBtnCheck, i++, j + 1); label = new QLabel(tr("MainQuote"), w); grid->addWidget(label, i, j); mainQuoteBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowMainQuoteBtn, tb); mainQuoteBtnCheck->setChecked(tb); connect(mainQuoteBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(mainQuoteBtnCheck, i++, j + 1); label = new QLabel(tr("Help"), w); grid->addWidget(label, i, j); helpButtonCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowHelpButton, tb); helpButtonCheck->setChecked(tb); connect(helpButtonCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(helpButtonCheck, i++, j + 1); addTab(w, tr("MainToolbar")); }
LogCall::LogCall ( QWidget* parent, const char* name ) : TAAWidget(parent) { setCaption("Call Logger"); // Create all of our widgets. loginID = new QLineEdit(this, "loginID"); loginID->setMaxLength(16); connect(loginID, SIGNAL(textChanged(const QString &)), this, SLOT(loginIDChanged(const QString &))); loginIDLabel = new QLabel(loginID, "&Login ID", this); loginIDLabel->setAlignment(AlignRight|AlignVCenter); searchButton = new QPushButton(this, "searchButton"); searchButton->setText("&Search"); connect(searchButton, SIGNAL(clicked()), this, SLOT(findLogin())); // Searching doesn't really work very well, so lets hide the button for // now. searchButton->hide(); callType = new QComboBox(false, this, "callType"); callType->insertItem("Support"); callType->insertItem("Sales"); callType->insertItem("New User"); callType->insertItem("Accounting"); connect(callType, SIGNAL(highlighted(int)), this, SLOT(callTypeChanged(int))); typeLabel = new QLabel(callType, "&Type", this); typeLabel->setAlignment(AlignRight|AlignVCenter); reasonList = new Q3ListView(this, "reasonList"); reasonList->addColumn("Call Subject"); reasonList->setMaximumHeight(125); reasonLabel = new QLabel(reasonList, "&Reason", this); reasonLabel->setAlignment(AlignRight|AlignTop); solutionNotes = new Q3MultiLineEdit(this, "solutionNotes"); solutionNotes->setWordWrap(Q3MultiLineEdit::WidgetWidth); solutionLabel = new QLabel(solutionNotes, "S&olution", this); solutionLabel->setAlignment(AlignRight|AlignTop); // Now, our buttons. custWinButton = new QPushButton(this, "custWinButton"); custWinButton->setText("&Customer Window"); connect(custWinButton, SIGNAL(clicked()), this, SLOT(loadCustomer())); clockButton = new QPushButton(this, "clockButton"); clockButton->setText("Sto&p Timer"); connect(clockButton, SIGNAL(clicked()), this, SLOT(toggleTimer())); doneButton = new QPushButton(this, "doneButton"); doneButton->setText("&Done"); connect(doneButton, SIGNAL(clicked()), this, SLOT(hangupCall())); statusLabel = new QLabel(this, "statusLabel"); statusLabel->setFrameStyle(Q3Frame::Sunken|Q3Frame::WinPanel); clockArea = new QLCDNumber(this, "clockArea"); clockArea->setMode(QLCDNumber::DEC); clockArea->setSegmentStyle(QLCDNumber::Flat); clockArea->setNumDigits(7); // Main Layout, top to bottom, with a grid and stuff thrown in. Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3); Q3GridLayout *gl = new Q3GridLayout(3, 5); gl->setRowStretch(0, 0); gl->setRowStretch(1, 0); gl->setRowStretch(2, 1); gl->setColStretch(0, 0); gl->setColStretch(1, 1); gl->setColStretch(2, 0); gl->setColStretch(3, 0); gl->setColStretch(4, 0); gl->addWidget(loginIDLabel, 0, 0); gl->addWidget(loginID, 0, 1); gl->addWidget(searchButton, 0, 2); gl->addWidget(typeLabel, 0, 3); gl->addWidget(callType, 0, 4); gl->addWidget(reasonLabel, 1, 0); gl->addMultiCellWidget(reasonList, 1, 1, 1, 4); gl->addWidget(solutionLabel, 2, 0); gl->addMultiCellWidget(solutionNotes, 2, 2, 1, 4); ml->addLayout(gl, 1); Q3BoxLayout *abl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 0); abl->addWidget(custWinButton, 1); abl->addWidget(clockButton, 1); abl->addWidget(doneButton, 1); // These options don't really work very well, so lets disable them for // now. ml->addLayout(abl, 0); Q3BoxLayout *sbl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3); sbl->addWidget(statusLabel, 1); sbl->addWidget(clockArea, 0); ml->addLayout(sbl, 0); // Set the starting login ID to empty, and the starting customer ID to 0 strcpy(myLoginID, ""); myCustID = 0; // Start the clock ticking... callStart.setDate(QDate::currentDate()); callStart.setTime(QTime::currentTime()); // Set the status label to the default. statusLabel->setText("No customer selected."); callTypeChanged(0); // And setup the timer to update our clock once every second. updateClock(); callTimer = new QTimer(this); connect(callTimer, SIGNAL(timeout()), this, SLOT(updateClock())); callTimer->start(1000); // Once every second timerRunning = 1; clockArea->display("00:00:00"); // Make some hotkeys... loginIDLabel->setBuddy(loginID); typeLabel->setBuddy(callType); reasonLabel->setBuddy(reasonList); solutionLabel->setBuddy(solutionNotes); // Add wordwrap. myLinkedCall = 0; loginID->setFocus(); }
LogVoiceMail::LogVoiceMail ( QWidget* parent, const char* name ) : TAAWidget(parent) { setCaption( "Voice Mail Logging" ); // Create the widgets QLabel *dateLabel = new QLabel(this); dateLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter); dateLabel->setText("D&ate/Time:"); msgDateTime = new Q3DateTimeEdit(QDateTime::currentDateTime(), this, "MsgDateTime"); dateLabel->setBuddy(msgDateTime); QLabel *messageLabel = new QLabel(this); messageLabel->setAlignment(Qt::AlignRight|Qt::AlignTop); messageLabel->setText("M&essage:"); message = new Q3MultiLineEdit(this); message->setWordWrap(Q3MultiLineEdit::WidgetWidth); messageLabel->setBuddy(message); saveButton = new QPushButton(this); saveButton->setText("&Save"); connect(saveButton, SIGNAL(clicked()), this, SLOT(saveMessage())); closeButton = new QPushButton(this); closeButton->setText("&Close"); connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked())); statusLabel = new QLabel(this); statusLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); statusLabel->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken); statusLabel->setMinimumSize(0, 20); // Now, create our layouts // Date/time area. Q3GridLayout *dtl = new Q3GridLayout(2, 4, 3); dtl->setColStretch(0, 0); dtl->setColStretch(1, 1); dtl->setColStretch(2, 0); dtl->setColStretch(3, 1); dtl->setRowStretch(0, 0); dtl->setRowStretch(1, 1); dtl->addWidget(dateLabel, 0, 0); dtl->addMultiCellWidget(msgDateTime, 0, 0, 1, 3); dtl->addWidget(messageLabel, 1, 0); dtl->addMultiCellWidget(message, 1, 1, 1, 3); // The action button layout. Q3BoxLayout *abl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 5); abl->addStretch(1); abl->addWidget(saveButton, 0); abl->addWidget(closeButton, 0); abl->addSpacing(5); // The main layout. Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 0, 0); ml->addSpacing(3); ml->addLayout(dtl, 1); ml->addSpacing(3); ml->addLayout(abl, 0); ml->addSpacing(3); ml->addWidget(statusLabel, 0); // Done. msgDateTime->setFocus(); resize(350, 180); }
TesterTestPage::TesterTestPage (QWidget *p) : QWidget (p) { fieldList.append(tr("Open")); fieldList.append(tr("Close")); fieldList.append(tr("Mid Point")); Q3HBoxLayout *hbox = new Q3HBoxLayout(this); hbox->setMargin(5); hbox->setSpacing(10); // left side grid Q3GridLayout *grid = new Q3GridLayout(hbox); grid->setColStretch(1, 1); grid->setSpacing(5); // trades area tradeLong = new QCheckBox(tr("Long"), this); grid->addWidget(tradeLong, 0, 0); tradeShort = new QCheckBox(tr("Short"), this); grid->addWidget(tradeShort, 1, 0); QLabel *label = new QLabel(tr("Trade Delay"), this); grid->addWidget(label, 2, 0); tradeDelay = new QSpinBox(1, 999999, 1, this); tradeDelay->setValue(1); grid->addWidget(tradeDelay, 2, 1); grid->setRowSpacing(grid->numRows(), 25); // account area label = new QLabel(tr("Account Balance"), this); grid->addWidget(label, 4, 0); account = new QSpinBox(0, 999999, 1, this); account->setValue(10000); grid->addWidget(account, 4, 1); label = new QLabel(tr("Futures Margin"), this); grid->addWidget(label, 5, 0); margin = new QSpinBox(0, 999999, 1, this); grid->addWidget(margin, 5, 1); label = new QLabel(tr("Volume %"), this); grid->addWidget(label, 6, 0); volumePercent = new QSpinBox(0, 100, 1, this); grid->addWidget(volumePercent, 6, 1); grid->setRowSpacing(grid->numRows(), 25); // commission area commissionType = new QCheckBox(tr("Use Commission %"), this); grid->addWidget(commissionType, 8, 0); label = new QLabel(tr("Entry"), this); grid->addWidget(label, 9, 0); QDoubleValidator *dv = new QDoubleValidator(0, 99999999.0, 4, this, 0); entryCom = new QLineEdit(QString::number(10), this); entryCom->setValidator(dv); grid->addWidget(entryCom, 9, 1); label = new QLabel(tr("Exit"), this); grid->addWidget(label, 10, 0); QDoubleValidator *dv2 = new QDoubleValidator(0, 99999999.0, 4, this, 0); exitCom = new QLineEdit(QString::number(10), this); exitCom->setValidator(dv2); grid->addWidget(exitCom, 10, 1); grid->setRowStretch(grid->numRows() + 1, 1); // vline sperarator Q3Frame *line = new Q3Frame(this); line->setFrameStyle(Q3Frame::VLine | Q3Frame::Plain); hbox->addWidget(line); // right side grid grid = new Q3GridLayout(hbox); grid->setColStretch(1, 1); grid->setSpacing(5); // test area label = new QLabel(tr("Symbol"), this); grid->addWidget(label, 0, 0); Config config; QString s, s2; config.getData(Config::DataPath, s); symbolButton = new SymbolButton(this, s, s2); connect(symbolButton, SIGNAL(symbolChanged()), this, SLOT(symbolButtonPressed())); grid->addWidget(symbolButton, 0, 1); label = new QLabel(tr("Bar Length"), this); grid->addWidget(label, 1, 0); BarData bd(s); barLength = new QComboBox(this); bd.getBarLengthList(barLengthList); barLength->insertStringList(barLengthList, -1); barLength->setCurrentItem(6); grid->addWidget(barLength, 1, 1); label = new QLabel(tr("Bars"), this); grid->addWidget(label, 2, 0); bars = new QSpinBox(1, 99999999, 1, this); bars->setValue(275); grid->addWidget(bars, 2, 1); label = new QLabel(tr("Entry/Exit Price"), this); grid->addWidget(label, 3, 0); priceField = new QComboBox(this); priceField->insertStringList(fieldList,-1); grid->addWidget(priceField, 3, 1); grid->setRowStretch(grid->numRows() + 1, 1); }
QucsSettingsDialog::QucsSettingsDialog(QucsApp *parent, const char *name) : QDialog(parent, name, TRUE, Qt::WDestructiveClose) { App = parent; setCaption(tr("Edit Qucs Properties")); all = new Q3VBoxLayout(this); // to provide the neccessary size QTabWidget *t = new QTabWidget(this); all->addWidget(t); // ........................................................... QWidget *Tab1 = new QWidget(t); Q3GridLayout *gp = new Q3GridLayout(Tab1,5,2,5,5); QLabel *l1 = new QLabel(tr("Font (set after reload):"), Tab1); gp->addWidget(l1,0,0); FontButton = new QPushButton(Tab1); connect(FontButton, SIGNAL(clicked()), SLOT(slotFontDialog())); gp->addWidget(FontButton,0,1); QLabel *l2 = new QLabel(tr("Document Background Color:"), Tab1); gp->addWidget(l2,1,0); BGColorButton = new QPushButton(" ", Tab1); connect(BGColorButton, SIGNAL(clicked()), SLOT(slotBGColorDialog())); gp->addWidget(BGColorButton,1,1); val200 = new QIntValidator(0, 200, this); QLabel *l3 = new QLabel(tr("maximum undo operations:"), Tab1); gp->addWidget(l3,2,0); undoNumEdit = new QLineEdit(Tab1); undoNumEdit->setValidator(val200); gp->addWidget(undoNumEdit,2,1); QLabel *l4 = new QLabel(tr("text editor:"), Tab1); gp->addWidget(l4,3,0); editorEdit = new QLineEdit(Tab1); gp->addWidget(editorEdit,3,1); t->addTab(Tab1, tr("Settings")); // ........................................................... /* QWidget *Tab2 = new QWidget(t); QGridLayout *gp2 = new QGridLayout(Tab2,3,2,5,5); Check_GridOn = new QCheckBox(tr("show Grid"),Tab2); QLabel *l3 = new QLabel(tr("horizontal Grid:"), Tab2); gp2->addWidget(l3,1,0); Input_GridX = new QLineEdit(Tab2); gp2->addWidget(Input_GridX,1,1); QLabel *l4 = new QLabel(tr("vertical Grid:"), Tab2); gp2->addWidget(l4,2,0); Input_GridY = new QLineEdit(Tab2); gp2->addWidget(Input_GridY,2,1); t->addTab(Tab2, tr("Grid")); */ // ........................................................... // buttons on the bottom of the dialog (independent of the TabWidget) Q3HBox *Butts = new Q3HBox(this); Butts->setSpacing(5); Butts->setMargin(5); all->addWidget(Butts); QPushButton *OkButt = new QPushButton(tr("OK"), Butts); connect(OkButt, SIGNAL(clicked()), SLOT(slotOK())); QPushButton *ApplyButt = new QPushButton(tr("Apply"), Butts); connect(ApplyButt, SIGNAL(clicked()), SLOT(slotApply())); QPushButton *CancelButt = new QPushButton(tr("Cancel"), Butts); connect(CancelButt, SIGNAL(clicked()), SLOT(reject())); QPushButton *DefaultButt = new QPushButton(tr("Default Values"), Butts); connect(DefaultButt, SIGNAL(clicked()), SLOT(slotDefaultValues())); OkButt->setDefault(true); // ........................................................... // fill the fields with the Qucs-Properties Font = QucsSettings.font; FontButton->setText(Font.toString()); BGColorButton->setPaletteBackgroundColor( App->view->viewport()->paletteBackgroundColor()); undoNumEdit->setText(QString::number(QucsSettings.maxUndo)); editorEdit->setText(QucsSettings.Editor); }
MakeDeposits::MakeDeposits ( QWidget* parent, const char* name ) : TAAWidget(parent) { setCaption( "Make Deposits" ); // Create our widgets. paymentList = new Q3ListView(this, "paymentList"); int curCol = 1; paymentList->addColumn("Date"); curCol++; paymentList->addColumn("Cust ID"); curCol++; paymentList->addColumn("Customer Name"); curCol++; paymentList->addColumn("Check No"); curCol++; paymentList->addColumn("Amount"); curCol++; paymentList->addColumn("IntID"); paymentList->setColumnAlignment(curCol++, AlignRight); paymentList->setAllColumnsShowFocus(true); paymentList->setMultiSelection(true); connect(paymentList, SIGNAL(selectionChanged()), this, SLOT(itemSelected())); connect(paymentList, SIGNAL(doubleClicked(Q3ListViewItem *)), this, SLOT(itemDoubleClicked(Q3ListViewItem *))); QLabel *selectedItemCountLabel = new QLabel(this, "selectedItemCountLabel"); selectedItemCountLabel->setText("Items Selected:"); selectedItemCountLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter); selectedItemCount = new QLabel(this, "selectedItemCount"); selectedItemCount->setText("0"); selectedItemCount->setAlignment(Qt::AlignRight|Qt::AlignVCenter); QLabel *undepositedAmountLabel = new QLabel(this, "undepositedAmountLabel"); undepositedAmountLabel->setText("Undeposted amount:"); undepositedAmountLabel->setAlignment(AlignRight | AlignVCenter); undepositedAmount = new QLabel(this, "undepositedAmount"); undepositedAmount->setText("$0.00"); undepositedAmount->setAlignment(AlignRight | AlignVCenter); QLabel *amountSelectedLabel = new QLabel(this, "amountSelectedLabel"); amountSelectedLabel->setText("Amount selected:"); amountSelectedLabel->setAlignment(AlignRight | AlignVCenter); amountSelected = new QLabel(this, "amountSelected"); amountSelected->setText("$0.00"); amountSelected->setAlignment(AlignRight | AlignVCenter); QLabel *targetAccountLabel = new QLabel(this, "targetAccountLabel"); targetAccountLabel->setText("Target Account:"); targetAccountLabel->setAlignment(AlignRight | AlignVCenter); targetAccountList = new QComboBox(false, this, "targetAccountList"); QLabel *transDateLabel = new QLabel(this, "transDateLabel"); transDateLabel->setText("Desposit Date:"); transDateLabel->setAlignment(AlignRight | AlignVCenter); transDate = new Q3DateEdit(QDate::currentDate(), this, "transDate"); // Our buttons now. QPushButton *printButton = new QPushButton(this, "printButton"); printButton->setText("&Print"); connect(printButton, SIGNAL(clicked()), this, SLOT(printSelected())); QPushButton *selectAllButton = new QPushButton(this, "selectAllButton"); selectAllButton->setText("Select &All"); connect(selectAllButton, SIGNAL(clicked()), this, SLOT(selectAll())); QPushButton *selectNoneButton = new QPushButton(this, "selectNoneButton"); selectNoneButton->setText("Select &None"); connect(selectNoneButton, SIGNAL(clicked()), this, SLOT(selectNone())); QPushButton *continueButton = new QPushButton(this, "continueButton"); continueButton->setText("C&ontinue"); connect(continueButton, SIGNAL(clicked()), this, SLOT(processSelections())); QPushButton *cancelButton = new QPushButton(this, "cancelButton"); cancelButton->setText("&Cancel"); connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelSelected())); // Create our layout. Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3); ml->addWidget(paymentList, 1); // A grid for our labels and account selection. Q3GridLayout *asl = new Q3GridLayout(3, 2); asl->setColStretch(0, 0); asl->setColStretch(1, 1); int curRow = 0; asl->addWidget(selectedItemCountLabel, curRow, 0); asl->addWidget(selectedItemCount, curRow, 1); asl->setRowStretch(curRow++, 0); asl->addWidget(undepositedAmountLabel, curRow, 0); asl->addWidget(undepositedAmount, curRow, 1); asl->setRowStretch(curRow++, 0); asl->addWidget(amountSelectedLabel, curRow, 0); asl->addWidget(amountSelected, curRow, 1); asl->setRowStretch(curRow++, 0); asl->addWidget(targetAccountLabel, curRow, 0); asl->addWidget(targetAccountList, curRow, 1); asl->setRowStretch(curRow++, 0); asl->addWidget(transDateLabel, curRow, 0); asl->addWidget(transDate, curRow, 1); asl->setRowStretch(curRow++, 0); // Now our button layout Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3); bl->addStretch(1); bl->addWidget(printButton, 0); bl->addWidget(selectAllButton, 0); bl->addWidget(selectNoneButton, 0); bl->addWidget(continueButton, 0); bl->addWidget(cancelButton, 0); // Add the buttons to our other widget layout //owl->addLayout(bl, 0); // Add the other widget layout to our main layout. ml->addLayout(asl, 0); ml->addWidget(new HorizLine(this), 0); ml->addLayout(bl, 0); // Done with the layout. // Fill our account list. ADB DB; int tmpPos = 0; DB.query("select IntAccountNo, AccountNo, AcctName from Accounts order by AccountNo"); accountIDX = new long[DB.rowCount+2]; accountIDX[0] = 0; QString tmpStr; if (DB.rowCount) while (DB.getrow()) { accountIDX[tmpPos++] = atol(DB.curRow["IntAccountNo"]); tmpStr = DB.curRow["AccountNo"]; tmpStr += " "; tmpStr += DB.curRow["AcctName"]; targetAccountList->insertItem(tmpStr); } selTotal = 0.00; fillDepositList(); }
void Preferences::createGeneralPage() { // general parms page QWidget *w = new QWidget(this); Q3VBoxLayout *vbox = new Q3VBoxLayout(w); Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3); grid->setMargin(5); grid->setSpacing(5); grid->setColStretch(1, 1); // stretch 2nd col a little grid->setColStretch(2, 2); // stretch outer right col more vbox->insertStretch(-1, 1); // menubar checkbox QLabel *label = new QLabel(tr("Main Menubar"), w); grid->addWidget(label, 0, 0); menubarCheck = new QCheckBox(w); menubarCheck->setChecked(menubar); connect(menubarCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(menubarCheck, 0, 1); // extraToolbar checkbox label = new QLabel(tr("Extra Toolbar"), w); grid->addWidget(label, 1, 0); extraToolbarCheck = new QCheckBox(w); extraToolbarCheck->setChecked(extraToolbar); connect(extraToolbarCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(extraToolbarCheck, 1, 1); // bar spacing 1 label = new QLabel(tr("Bar Spacing 1"), w); grid->addWidget(label, 2, 0); bs1Spinner = new QSpinBox(2, 99, 1, w); bs1Spinner->setValue(ps1Button); connect(bs1Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified())); grid->addWidget(bs1Spinner, 2, 1); // bar spacing 2 label = new QLabel(tr("Bar Spacing 2"), w); grid->addWidget(label, 3, 0); bs2Spinner = new QSpinBox(2, 99, 1, w); bs2Spinner->setValue(ps2Button); connect(bs2Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified())); grid->addWidget(bs2Spinner, 3, 1); // bar spacing 3 label = new QLabel(tr("Bar Spacing 3"), w); grid->addWidget(label, 4, 0); bs3Spinner = new QSpinBox(2, 99, 1, w); bs3Spinner->setValue(ps3Button); connect(bs3Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified())); grid->addWidget(bs3Spinner, 4, 1); addTab(w, tr("General")); }
Tab_Logins::Tab_Logins ( QWidget* parent, const char* name, long CustID ) : TAAWidget(parent) { setCaption( "Logins" ); myCustID = CustID; // Create all of our widgets. list = new Q3ListView(this, "LoginList"); list->addColumn("Login ID"); list->addColumn("Login Type"); list->addColumn("Contact Name"); list->addColumn("Last Modified"); list->addColumn("Disk"); list->addColumn("Flags"); list->addColumn("Active"); list->setAllColumnsShowFocus(TRUE); list->setColumnAlignment(4, AlignRight); list->setColumnAlignment(5, AlignRight); list->setColumnAlignment(6, AlignCenter); list->setItemMargin( 2 ); newButton = new QPushButton(this, "NewButton"); newButton->setText("&New"); connect(newButton, SIGNAL(clicked()), this, SLOT(createNewLogin())); openCloseButton = new QPushButton(this, "OpenCloseButton"); openCloseButton->setText("(&De)Activate"); connect(openCloseButton, SIGNAL(clicked()), this, SLOT(unlockLogin())); passwdButton = new QPushButton(this, "PasswdButton"); passwdButton->setText("&Password"); connect(passwdButton, SIGNAL(clicked()), this, SLOT(changePassword())); QPushButton *loginFlagsButton = new QPushButton(this, "LoginFlagsButton"); loginFlagsButton->setText("Fla&gs"); connect(loginFlagsButton, SIGNAL(clicked()), this, SLOT(loginFlagsClicked())); editButton = new QPushButton(this, "EditButton"); editButton->setText("&Edit"); connect(editButton, SIGNAL(clicked()), this, SLOT(editLogin())); modemUsageButton = new QPushButton(this, "Modem Usage Button"); modemUsageButton->setText("&Modem Usage"); connect(modemUsageButton, SIGNAL(clicked()), this, SLOT(modemUsageReport())); bandwidthButton = new QPushButton(this, "BandwidthButton"); bandwidthButton->setText("&Bandwidth"); connect(bandwidthButton, SIGNAL(clicked()), this, SLOT(bandwidthUsageReport())); QPushButton *diskSpaceButton = new QPushButton(this, "DiskSpaceButton"); diskSpaceButton->setText("D&isk Space"); connect(diskSpaceButton, SIGNAL(clicked()), this, SLOT(diskSpaceClicked())); diskSpaceButton->setEnabled(false); adminMenuArea = new QLabel(this, "Admin Menu Area"); adminMenu = new Q3PopupMenu; adminMenu->insertItem("&Set Primary Login", this, SLOT(setPrimaryLogin())); adminMenu->insertItem("&Transfer Login", this, SLOT(transferLogin())); if (isAdmin()) adminMenu->insertItem("&Wipe Login", this, SLOT(wipeLogin())); QMenuBar *tmpMenu; tmpMenu = new QMenuBar(adminMenuArea, "Administrivia"); tmpMenu->insertItem("&Administrivia", adminMenu); hideWiped = new QCheckBox(this, "HideWiped"); hideWiped->setText("&Hide Wiped"); hideWiped->setChecked(true); connect(hideWiped, SIGNAL(toggled(bool)), this, SLOT(hideWipedChanged(bool))); // Create our layouts. A top to bottom box, with a grid in it. Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3); ml->addWidget(list, 1); Q3GridLayout *bl = new Q3GridLayout(2, 6); bl->addWidget(newButton, 0, 0); bl->addWidget(openCloseButton, 0, 1); bl->addWidget(passwdButton, 0, 2); bl->addWidget(loginFlagsButton, 0, 3); bl->addWidget(adminMenuArea, 0, 5); bl->addWidget(editButton, 1, 0); bl->addWidget(modemUsageButton, 1, 1); bl->addWidget(bandwidthButton, 1, 2); bl->addWidget(diskSpaceButton, 1, 3); bl->addWidget(hideWiped, 1, 5); for (int i = 0 ; i < 5; i++) bl->setColStretch(i, 1); bl->setRowStretch(0, 0); bl->setRowStretch(1, 0); ml->addLayout(bl, 0); // QObject::connect(listtitle, SIGNAL(widthChanged(int, int)), // list, SLOT(setColumnWidth(int, int))); refreshLoginList(0); if (!isManager()) { // wipeButton->hide(); adminMenuArea->hide(); } }
DomainAliases::DomainAliases(QWidget *parent, const char *name) : TAAWidget(parent) { setCaption("Email Alias List"); // Create the widgets we'll need aliasList = new Q3ListView(this, "Alias List"); aliasList->addColumn("Address"); aliasList->addColumn("Domain"); aliasList->addColumn("Mailbox"); aliasList->addColumn("Time Stamp"); aliasList->addColumn("Added By"); aliasList->setAllColumnsShowFocus(true); virtIDCol = 5; address = new QLineEdit(this, "Address Input"); address->setMaxLength(63); QLabel *atLabel = new QLabel(this, "At label"); atLabel->setText("@"); QLabel *mapsToLabel = new QLabel(this, "Maps To label"); mapsToLabel->setText("maps to"); domainList = new QComboBox(this, false); loginList = new QComboBox(this, false); addButton = new QPushButton(this, "Add Button"); addButton->setText("&Add"); connect(addButton, SIGNAL(clicked()), this, SLOT(addAlias())); refreshButton = new QPushButton(this, "Refresh Button"); refreshButton->setText("&Refresh"); connect(refreshButton, SIGNAL(clicked()), this, SLOT(refreshAlias())); autoButton = new QPushButton(this, "Auto Button"); autoButton->setText("A&uto"); connect(autoButton, SIGNAL(clicked()), this, SLOT(autoAlias())); delButton = new QPushButton(this, "Delete Button"); delButton->setText("&Delete"); connect(delButton, SIGNAL(clicked()), this, SLOT(delAlias())); closeButton = new QPushButton(this, "Close Button"); closeButton->setText("&Close"); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); HorizLine *hline1 = new HorizLine(this); // Our layout now. Very simple top down box. Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3); ml->addWidget(aliasList, 1); // Add in our "add" line. Q3BoxLayout *addl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3); addl->addWidget(address, 1); addl->addWidget(atLabel, 0); addl->addWidget(domainList, 0); addl->addWidget(mapsToLabel, 0); addl->addWidget(loginList, 0); addl->addWidget(addButton, 0); ml->addLayout(addl, 0); ml->addWidget(hline1, 0); Q3GridLayout *bl = new Q3GridLayout(1, 4); int curCol = 0; bl->addWidget(refreshButton, 0, curCol++); bl->addWidget(autoButton, 0, curCol++); bl->addWidget(delButton, 0, curCol++); bl->addWidget(closeButton, 0, curCol++); for (int i = 0; i < curCol; i++) bl->setColStretch(i, 1); bl->setRowStretch(0, 0); // Now, the "button bar layout" to keep things spaced nicely. Q3BoxLayout *bbl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 0); bbl->addStretch(1); bbl->addLayout(bl, 0); ml->addLayout(bbl); }
HTrackView::HTrackView( int viewID_, QWidget *parent ) : ViewWidget( viewID_, parent) { //setCaption("HTrack view"); Q3GridLayout *mainLayout = new Q3GridLayout(this, 2, 2); mainLayout->setResizeMode(QLayout::SetNoConstraint); //QBoxLayout *topLayout = new QVBoxLayout(mainLayout); //QBoxLayout *rightLayout = new QVBoxLayout(mainLayout); Q3BoxLayout *rightLayout = new Q3VBoxLayout(); Q3BoxLayout *bottomLayout = new Q3HBoxLayout(); Q3Grid *frame = new Q3Grid(1, this); frame->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken); //frame->setLineWidth(2); //frame->setMidLineWidth(2); QWidget *aWidget = new QWidget(frame); hTrackWidget = new HTrackWidget(aWidget); hTrackWidget->setWhatsThis("Shows a 3D keyboard with the current note coloured. " "Vertical columns (or tracks), each representing a harmonic (or component frequency), protrude from the back, and move further away over time. " "The height of each track is related to how much energy is at that frequency. " "Tracks alternate in colour for better visibility. It can be seen how the hamonics in a note fit into the musical scale."); //hTrackWidget->show(); peakThresholdSlider = new QSlider(0, 100, 10, 5, Qt::Vertical, this); QToolTip::add(peakThresholdSlider, "Thresholding of harmonics"); rotateXWheel = new QwtWheel(this); rotateXWheel->setWheelWidth(20); rotateXWheel->setRange(-180, 180, 0.1, 1); QToolTip::add(rotateXWheel, "Rotate piano horizonally"); rotateYWheel = new QwtWheel(this); rotateYWheel->setOrientation(Qt::Vertical); rotateYWheel->setWheelWidth(20); rotateYWheel->setRange(-90, 0, 0.1, 1); QToolTip::add(rotateYWheel, "Rotate piano vertically"); distanceWheel = new QwtWheel(this); distanceWheel->setOrientation(Qt::Vertical); //distanceWheel->setWheelWidth(20); distanceWheel->setRange(100, 5000, 10, 20); distanceWheel->setTotalAngle(20*360); QToolTip::add(distanceWheel, "Move towards/away from piano"); QPushButton *homeButton = new QPushButton("Reset", this, "homebutton"); QToolTip::add(homeButton, "Return to the original view"); QSizeGrip *sizeGrip = new QSizeGrip(this); //sizeGrip->setFixedSize(15, 15); mainLayout->addWidget(frame, 0, 0); mainLayout->addLayout(bottomLayout, 1, 0); mainLayout->addLayout(rightLayout, 0, 1); rightLayout->addStretch(2); rightLayout->addWidget(peakThresholdSlider); rightLayout->addStretch(4); rightLayout->addWidget(rotateYWheel); rightLayout->addSpacing(14); rightLayout->addWidget(distanceWheel); bottomLayout->addStretch(0); bottomLayout->addWidget(homeButton); bottomLayout->addSpacing(14); bottomLayout->addWidget(rotateXWheel); //bottomLayout->addSpacing(20); mainLayout->addWidget(sizeGrip, 1, 1); //make the widget get updated when the view changes connect(gdata->view, SIGNAL(onSlowUpdate(double)), hTrackWidget, SLOT(update())); connect(peakThresholdSlider, SIGNAL(valueChanged(int)), this, SLOT(setPeakThreshold(int))); connect(rotateYWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(setViewAngleVertical(double))); connect(rotateYWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(update())); connect(hTrackWidget, SIGNAL(viewAngleVerticalChanged(double)), rotateYWheel, SLOT(setValue(double))); connect(distanceWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(setDistanceAway(double))); connect(distanceWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(update())); connect(hTrackWidget, SIGNAL(distanceAwayChanged(double)), distanceWheel, SLOT(setValue(double))); connect(rotateXWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(setViewAngleHorizontal(double))); connect(rotateXWheel, SIGNAL(valueChanged(double)), hTrackWidget, SLOT(update())); connect(hTrackWidget, SIGNAL(viewAngleHorizontalChanged(double)), rotateXWheel, SLOT(setValue(double))); connect(homeButton, SIGNAL(clicked()), hTrackWidget, SLOT(home())); }
BrowserSearchDialog::BrowserSearchDialog() : QDialog(0, "Browser search", FALSE, Qt::WDestructiveClose) { the = this; setCaption(TR("Browser search")); Q3VBoxLayout * vbox = new Q3VBoxLayout(this); vbox->setMargin(5); Q3GridLayout * gl = new Q3GridLayout(vbox, 4, 2, 5/*space*/); gl->addWidget(new QLabel(TR("Kind"), this), 0, 0, Qt::AlignLeft); kind = new Q3ComboBox(FALSE, this); for (int index = 0; index != sizeof(Kinds) / sizeof(*Kinds); index += 1) kind->insertItem(TR(Kinds[index].lbl)); kind->setCurrentItem(saved_kind); gl->addWidget(kind, 0, 1); ed = new LineEdit(this); ed->setText(saved_ed); gl->addWidget(new QLabel(TR("Containing"), this), 1, 0, Qt::AlignLeft); gl->addWidget(ed, 1, 1); ed->setFocus(); Q3HBox * hb = new Q3HBox(this); gl->addWidget(hb, 2, 1); Q3GroupBox * gb = new Q3GroupBox(2, Qt::Horizontal, hb); case_sensitive = new QCheckBox(TR("case sensitive"), gb); case_sensitive->setChecked(saved_case_sensitive); even_deleted = new QCheckBox(TR("even deleted"), gb); even_deleted->setChecked(saved_even_deleted); Q3ButtonGroup * bg = new Q3ButtonGroup(4, Qt::Horizontal, hb); bg->setExclusive(TRUE); for_name = new QRadioButton(TR("name"), bg); for_name->setChecked(saved_name); for_stereotype = new QRadioButton(TR("stereotype"), bg); for_stereotype->setChecked(saved_stereotype); for_comment = new QRadioButton(TR("description"), bg); for_comment->setChecked(saved_comment); for_decldefbody = new QRadioButton(TR("declaration/definition/body"), bg); for_decldefbody->setChecked(saved_decldefbody); gl->addWidget(new QLabel(TR("Result"), this), 3, 0, Qt::AlignLeft); results = new Q3ComboBox(FALSE, this); gl->addWidget(results, 3, 1); Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox); QPushButton * search_b = new QPushButton(TR("Search"), this); QPushButton * close_b = new QPushButton(TR("Close"), this); hbox->setMargin(5); hbox->addWidget(search_b); hbox->addWidget(select_b = new QPushButton(TR("Select"), this)); hbox->addWidget(mark_unmark_b = new QPushButton(TR("Unmark"), this)); hbox->addWidget(mark_them_b = new QPushButton(TR("Mark them"), this)); hbox->addWidget(unmark_all_b = new QPushButton(TR("Unmark all"), this)); hbox->addWidget(close_b); search_b->setDefault(TRUE); connect(search_b, SIGNAL(clicked()), this, SLOT(search())); connect(select_b, SIGNAL(clicked()), this, SLOT(select())); connect(close_b, SIGNAL(clicked()), this, SLOT(reject())); connect(mark_unmark_b, SIGNAL(clicked()), this, SLOT(mark_unmark())); connect(mark_them_b, SIGNAL(clicked()), this, SLOT(mark_them())); connect(unmark_all_b, SIGNAL(clicked()), this, SLOT(unmark_all())); connect(results, SIGNAL(activated(int)), this, SLOT(selected(int))); if ((saved_kind != 0) || !saved_ed.isEmpty()) search(); else selected(-1); open_dialog(this); }
void Preferences::createCTPage() { // chart tool bar page QWidget *w = new QWidget(this); Q3VBoxLayout *vbox = new Q3VBoxLayout(w); Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 2); grid->setMargin(5); grid->setSpacing(5); grid->setColStretch(1, 1); vbox->insertStretch(-1, 1); int i = 0; // count rows int j = 0; // "count" cols bool tb; // temporary RcFile rcfile; QLabel *label = new QLabel(tr("Compression list"), w); grid->addWidget(label, i, j); cmpsComboBoxCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCmpsComboBox, tb); cmpsComboBoxCheck->setChecked(tb); connect(cmpsComboBoxCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(cmpsComboBoxCheck, i++, j + 1); label = new QLabel(tr("Compression 1 Minute"), w); grid->addWidget(label, i, j); cmps1MBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCmps1MBtn, tb); cmps1MBtnCheck->setChecked(tb); connect(cmps1MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(cmps1MBtnCheck, i++, j + 1); // label = new QLabel(tr("Compression 2 Minute"), w); // grid->addWidget(label, i, j); // cmps2MBtnCheck = new QCheckBox(w); // rcfile.loadData(RcFile::ShowCmps2MBtn, tb); // cmps2MBtnCheck->setChecked(tb); // connect(cmps2MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); // grid->addWidget(cmps2MBtnCheck, i++, j + 1); label = new QLabel(tr("Compression 5 Minute"), w); grid->addWidget(label, i, j); cmps5MBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCmps5MBtn, tb); cmps5MBtnCheck->setChecked(tb); connect(cmps5MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(cmps5MBtnCheck, i++, j + 1); label = new QLabel(tr("Compression 10 Minute"), w); grid->addWidget(label, i, j); cmps10MBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCmps10MBtn, tb); cmps10MBtnCheck->setChecked(tb); connect(cmps10MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(cmps10MBtnCheck, i++, j + 1); label = new QLabel(tr("Compression 15 Minute"), w); grid->addWidget(label, i, j); cmps15MBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCmps15MBtn, tb); cmps15MBtnCheck->setChecked(tb); connect(cmps15MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(cmps15MBtnCheck, i++, j + 1); // label = new QLabel(tr("Compression 20 Minute"), w); // grid->addWidget(label, i, j); // cmps20MBtnCheck = new QCheckBox(w); // rcfile.loadData(RcFile::ShowCmps20MBtn, tb); // cmps20MBtnCheck->setChecked(tb); // connect(cmps20MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); // grid->addWidget(cmps20MBtnCheck, i++, j + 1); label = new QLabel(tr("Compression 30 Minute"), w); grid->addWidget(label, i, j); cmps30MBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCmps30MBtn, tb); cmps30MBtnCheck->setChecked(tb); connect(cmps30MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(cmps30MBtnCheck, i++, j + 1); label = new QLabel(tr("Compression 1 Hour"), w); grid->addWidget(label, i, j); cmps1HBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCmps1HBtn, tb); cmps1HBtnCheck->setChecked(tb); connect(cmps1HBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(cmps1HBtnCheck, i++, j + 1); // label = new QLabel(tr("Compression 2 Hour"), w); // grid->addWidget(label, i, j); // cmps2HBtnCheck = new QCheckBox(w); // rcfile.loadData(RcFile::ShowCmps2HBtn, tb); // cmps2HBtnCheck->setChecked(tb); // connect(cmps2HBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); // grid->addWidget(cmps2HBtnCheck, i++, j + 1); // label = new QLabel(tr("Compression 4 Hour"), w); // grid->addWidget(label, i, j); // cmps4HBtnCheck = new QCheckBox(w); // rcfile.loadData(RcFile::ShowCmps4HBtn, tb); // cmps4HBtnCheck->setChecked(tb); // connect(cmps4HBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); // grid->addWidget(cmps4HBtnCheck, i++, j + 1); label = new QLabel(tr("Compression 1 Day"), w); grid->addWidget(label, i, j); cmps1DBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCmps1DBtn, tb); cmps1DBtnCheck->setChecked(tb); connect(cmps1DBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(cmps1DBtnCheck, i++, j + 1); label = new QLabel(tr("Compression 1 Week"), w); grid->addWidget(label, i, j); cmps1WBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCmps1WBtn, tb); cmps1WBtnCheck->setChecked(tb); connect(cmps1WBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(cmps1WBtnCheck, i++, j + 1); label = new QLabel(tr("Compression 1 Month"), w); grid->addWidget(label, i, j); cmpsMNBtnCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowCmpsMNBtn, tb); cmpsMNBtnCheck->setChecked(tb); connect(cmpsMNBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(cmpsMNBtnCheck, i++, j + 1); label = new QLabel(tr("BarSpacing spinner"), w); grid->addWidget(label, i, j); barSpSpinboxCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowBarSpSpinbox, tb); barSpSpinboxCheck->setChecked(tb); connect(barSpSpinboxCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(barSpSpinboxCheck, i++, j + 1); label = new QLabel(tr("BarsToLoad field"), w); grid->addWidget(label, i, j); barsToLoadFieldCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowBarsToLoadField, tb); barsToLoadFieldCheck->setChecked(tb); connect(barsToLoadFieldCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(barsToLoadFieldCheck, i++, j + 1); label = new QLabel(tr("Pan Chart slider"), w); grid->addWidget(label, i, j); sliderCheck = new QCheckBox(w); rcfile.loadData(RcFile::ShowSlider, tb); sliderCheck->setChecked(tb); connect(sliderCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified())); grid->addWidget(sliderCheck, i++, j + 1); addTab(w, tr("ChartToolbar")); }
void StocksDialog::createDetailsPage () { QWidget *w = new QWidget(this); Q3VBoxLayout *vbox = new Q3VBoxLayout(w); vbox->setMargin(5); vbox->setSpacing(5); Q3GridLayout *grid = new Q3GridLayout(vbox); grid->setMargin(0); grid->setSpacing(5); QLabel *label = new QLabel(tr("Symbol"), w); grid->addWidget(label, 0, 0); QString s; DBIndexItem item; index->getIndexItem(symbol, item); item.getSymbol(s); label = new QLabel(s, w); label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken); grid->addWidget(label, 0, 1); label = new QLabel(tr("Name"), w); grid->addWidget(label, 1, 0); item.getTitle(s); title = new QLineEdit(s, w); grid->addWidget(title, 1, 1); label = new QLabel(tr("Exchange"), w); grid->addWidget(label, 2, 0); item.getExchange(s); Exchange ex; ex.getExchange(s.toInt(), s); label = new QLabel(s, w); label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken); grid->addWidget(label, 2, 1); label = new QLabel(tr("Type"), w); grid->addWidget(label, 3, 0); item.getType(s); label = new QLabel(s, w); label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken); grid->addWidget(label, 3, 1); label = new QLabel(tr("First Date"), w); grid->addWidget(label, 4, 0); Bar bar; db->getFirstBar(bar); if (! bar.getEmptyFlag()) { bar.getDateTimeString(TRUE, s); label = new QLabel(s, w); label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken); grid->addWidget(label, 4, 1); } label = new QLabel(tr("Last Date"), w); grid->addWidget(label, 5, 0); Bar bar2; db->getLastBar(bar2); if (! bar2.getEmptyFlag()) { bar2.getDateTimeString(TRUE, s); label = new QLabel(s, w); label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken); grid->addWidget(label, 5, 1); } grid->expand(grid->numRows() + 1, grid->numCols()); grid->setColStretch(1, 1); vbox->addStretch(1); addTab(w, tr("Details")); }
SpiceDialog::SpiceDialog(QucsApp* App_, SpiceFile *c, Schematic *d) : QDialog(d, 0, TRUE, Qt::WDestructiveClose) { App = App_; // pointer to main application resize(400, 250); setCaption(tr("Edit SPICE Component Properties")); Comp = c; Doc = d; all = new Q3VBoxLayout(this); // to provide neccessary size QWidget *myParent = this; Expr.setPattern("[^\"=]+"); // valid expression for property 'edit' etc Validator = new QRegExpValidator(Expr, this); Expr.setPattern("[\\w_]+"); // valid expression for property 'NameEdit' etc ValRestrict = new QRegExpValidator(Expr, this); // ........................................................... Q3GridLayout *topGrid = new Q3GridLayout(0, 4,3,3,3); all->addLayout(topGrid); topGrid->addWidget(new QLabel(tr("Name:"), myParent), 0,0); CompNameEdit = new QLineEdit(myParent); CompNameEdit->setValidator(ValRestrict); topGrid->addWidget(CompNameEdit, 0,1); connect(CompNameEdit, SIGNAL(returnPressed()), SLOT(slotButtOK())); topGrid->addWidget(new QLabel(tr("File:"), myParent), 1,0); FileEdit = new QLineEdit(myParent); FileEdit->setValidator(ValRestrict); topGrid->addWidget(FileEdit, 1,1); connect(FileEdit, SIGNAL(returnPressed()), SLOT(slotButtOK())); ButtBrowse = new QPushButton(tr("Browse"), myParent); topGrid->addWidget(ButtBrowse, 1,2); connect(ButtBrowse, SIGNAL(clicked()), SLOT(slotButtBrowse())); ButtEdit = new QPushButton(tr("Edit"), myParent); topGrid->addWidget(ButtEdit, 2,2); connect(ButtEdit, SIGNAL(clicked()), SLOT(slotButtEdit())); FileCheck = new QCheckBox(tr("show file name in schematic"), myParent); topGrid->addWidget(FileCheck, 2,1); SimCheck = new QCheckBox(tr("include SPICE simulations"), myParent); topGrid->addWidget(SimCheck, 3,1); Q3HBox *h1 = new Q3HBox(myParent); h1->setSpacing(5); PrepCombo = new QComboBox(h1); PrepCombo->insertItem("none"); PrepCombo->insertItem("ps2sp"); PrepCombo->insertItem("spicepp"); PrepCombo->insertItem("spiceprm"); QLabel * PrepLabel = new QLabel(tr("preprocessor"), h1); PrepLabel->setMargin(5); topGrid->addWidget(h1, 4,1); connect(PrepCombo, SIGNAL(activated(int)), SLOT(slotPrepChanged(int))); // ........................................................... Q3GridLayout *midGrid = new Q3GridLayout(0, 2,3,5,5); all->addLayout(midGrid); midGrid->addWidget(new QLabel(tr("SPICE net nodes:"), myParent), 0,0); NodesList = new Q3ListBox(myParent); midGrid->addWidget(NodesList, 1,0); connect(NodesList, SIGNAL(doubleClicked(Q3ListBoxItem*)), SLOT(slotAddPort(Q3ListBoxItem*))); Q3VBox *v0 = new Q3VBox(myParent); v0->setSpacing(5); midGrid->addWidget(v0, 1,1); ButtAdd = new QPushButton(tr("Add >>"), v0); connect(ButtAdd, SIGNAL(clicked()), SLOT(slotButtAdd())); ButtRemove = new QPushButton(tr("<< Remove"), v0); connect(ButtRemove, SIGNAL(clicked()), SLOT(slotButtRemove())); v0->setStretchFactor(new QWidget(v0), 5); // stretchable placeholder midGrid->addWidget(new QLabel(tr("Component ports:"), myParent), 0,2); PortsList = new Q3ListBox(myParent); midGrid->addWidget(PortsList, 1,2); connect(PortsList, SIGNAL(doubleClicked(Q3ListBoxItem*)), SLOT(slotRemovePort(Q3ListBoxItem*))); // ........................................................... Q3HBox *h0 = new Q3HBox(this); h0->setSpacing(5); all->addWidget(h0); connect(new QPushButton(tr("OK"),h0), SIGNAL(clicked()), SLOT(slotButtOK())); connect(new QPushButton(tr("Apply"),h0), SIGNAL(clicked()), SLOT(slotButtApply())); connect(new QPushButton(tr("Cancel"),h0), SIGNAL(clicked()), SLOT(slotButtCancel())); // ------------------------------------------------------------ CompNameEdit->setText(Comp->Name); changed = false; // insert all properties into the ListBox Property *pp = Comp->Props.first(); FileEdit->setText(pp->Value); FileCheck->setChecked(pp->display); SimCheck->setChecked(Comp->Props.at(2)->Value == "yes"); for(int i=0; i<PrepCombo->count(); i++) { if(PrepCombo->text(i) == Comp->Props.at(3)->Value) { PrepCombo->setCurrentItem(i); currentPrep = i; break; } } loadSpiceNetList(pp->Value); // load netlist nodes }
/** * CustomLoginFlagEditor::CustomLoginFlagEditor() * * Constructor for the Custom Login Flag Editor. */ CustomLoginFlagEditor::CustomLoginFlagEditor ( QWidget* parent, const char* name, long CustID, const char *loginID ) : TAAWidget(parent) { setCaption( "Login Flags" ); myCustID = CustID; strcpy(myLoginID, loginID); // Create labels to let the user know who we're editing QLabel *custIDLabel = new QLabel(this, "custIDLabel"); char tmpStr[1024]; sprintf(tmpStr, "%ld", myCustID); custIDLabel->setAlignment(AlignRight); custIDLabel->setText("Customer ID:"); QLabel *custIDValue = new QLabel(this, "custIDValue"); custIDValue->setAlignment(AlignLeft); custIDValue->setText(tmpStr); QLabel *loginIDLabel = new QLabel(this, "loginIDLabel"); loginIDLabel->setAlignment(AlignRight); loginIDLabel->setText("Login ID:"); QLabel *loginIDValue = new QLabel(this, "loginIDValue"); loginIDValue->setAlignment(AlignLeft); loginIDValue->setText(myLoginID); QStringList colHeaders; colHeaders += "Flag"; colHeaders += "Value"; // Create all of our widgets. flagTable = new Q3Table(0, 2, this, "flagTable"); flagTable->setColumnLabels(colHeaders); QPushButton *saveButton = new QPushButton(this, "saveButton"); saveButton->setText("&Save"); QPushButton *cancelButton = new QPushButton(this, "cancelButton"); cancelButton->setText("&Cancel"); // Label layout Q3GridLayout *gl = new Q3GridLayout(2, 2); int curRow = 0; gl->addWidget(custIDLabel, curRow, 0); gl->addWidget(custIDValue, curRow, 1); curRow++; gl->addWidget(loginIDLabel, curRow, 0); gl->addWidget(loginIDValue, curRow, 1); curRow++; gl->setColStretch(0, 0); gl->setColStretch(1, 1); // Create the layout Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3); ml->addLayout(gl, 0); ml->addWidget(flagTable, 1); Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 1); bl->addStretch(1); bl->addWidget(saveButton, 0); bl->addWidget(cancelButton, 0); ml->addLayout(bl, 0); fillTable(); // Connect our buttons connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked())); connect(saveButton, SIGNAL(clicked()), this, SLOT(saveClicked())); }
CustRegister::CustRegister ( QWidget* parent, const char* name, long CustID ) : TAAWidget(parent) { setCaption( "Register" ); myCustID = CustID; // Create our labels QLabel *custNameLabel = new QLabel(this); custNameLabel->setText("Customer Name:"); custNameLabel->setAlignment(AlignRight); customerName = new QLabel(this); customerName->setAlignment(AlignLeft); QLabel *customerIDLabel = new QLabel(this); customerIDLabel->setText("Customer ID:"); customerIDLabel->setAlignment(AlignRight); custIDLabel = new QLabel(this); custIDLabel->setAlignment(AlignLeft); QLabel *customerBalanceLabel = new QLabel(this); customerBalanceLabel->setText("Current Balance:"); customerBalanceLabel->setAlignment(AlignRight); currentBalanceArea = new QLabel(this); currentBalanceArea->setAlignment(AlignLeft); QLabel *customerStatusLabel = new QLabel(this); customerStatusLabel->setText("Customer Status:"); customerStatusLabel->setAlignment(AlignRight); customerStatus = new QLabel(this); customerStatus->setAlignment(AlignLeft); list = new Q3ListView(this); list->addColumn( "Date" ); list->addColumn( "Login ID" ); list->addColumn( "Item ID" ); list->addColumn( "Qty" ); list->setColumnAlignment(3, Qt::AlignRight); list->addColumn( "Amount" ); list->setColumnAlignment(4, Qt::AlignRight); list->addColumn( "Total" ); list->setColumnAlignment(5, Qt::AlignRight); list->addColumn( "Description" ); //list->addColumn( "TrnsID" ); QPushButton *printButton = new QPushButton(this); printButton->setText("&Print"); connect(printButton, SIGNAL(clicked()), this, SLOT(printRegister())); voidChargeButton = new QPushButton(this); voidChargeButton->setText("&Void"); connect(voidChargeButton, SIGNAL(clicked()), this, SLOT(voidCustCharge())); voidChargeButton->setEnabled(false); delChargeButton = new QPushButton(this); delChargeButton->setText("&Delete"); connect(delChargeButton, SIGNAL(clicked()), this, SLOT(delCustCharge())); editChargeButton = new QPushButton(this); editChargeButton->setText("&Edit"); connect(editChargeButton, SIGNAL(clicked()), this, SLOT(editCustCharge())); editChargeButton->setEnabled(false); newChargeButton = new QPushButton(this); newChargeButton->setText("&New"); connect(newChargeButton, SIGNAL(clicked()), this, SLOT(newCustCharge())); QPushButton *closeButton = new QPushButton(this); closeButton->setText("&Close"); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); // Now, create our layouts Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3); // The text label layouts Q3GridLayout *tl = new Q3GridLayout(2, 4, 3); tl->setColStretch(0, 0); tl->setColStretch(1, 1); tl->setColStretch(2, 0); tl->setColStretch(3, 1); tl->setRowStretch(0, 0); tl->setRowStretch(1, 0); tl->addWidget(custNameLabel, 0, 0); tl->addWidget(customerName, 0, 1); tl->addWidget(customerBalanceLabel, 0, 2); tl->addWidget(currentBalanceArea, 0, 3); tl->addWidget(customerIDLabel, 1, 0); tl->addWidget(custIDLabel, 1, 1); tl->addWidget(customerStatusLabel, 1, 2); tl->addWidget(customerStatus, 1, 3); ml->addLayout(tl, 0); ml->addWidget(list, 1); // Now, our button area Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3); bl->addStretch(1); bl->addWidget(printButton, 0); bl->addWidget(voidChargeButton, 0); bl->addWidget(delChargeButton, 0); bl->addWidget(editChargeButton, 0); bl->addWidget(newChargeButton, 0); bl->addSpacing(10); bl->addWidget(closeButton, 0); ml->addLayout(bl, 0); CustomersDB CDB; char tmpStr[1024]; CDB.get(myCustID); customerName->setText(CDB.getStr("FullName")); custIDLabel->setText(CDB.getStr("CustomerID")); sprintf(tmpStr, "$%.2f", CDB.getFloat("CurrentBalance")); currentBalanceArea->setText(tmpStr); if (CDB.getInt("Active")) { strcpy(tmpStr, "Active"); } else { strcpy(tmpStr, "Inactive"); } customerStatus->setText(tmpStr); sprintf(tmpStr, "Register for %s (%ld)", (const char *) CDB.getStr("FullName"), myCustID); setCaption(tmpStr); if (!isManager()) { newChargeButton->hide(); editChargeButton->hide(); delChargeButton->hide(); voidChargeButton->hide(); } //list->setSorting(7, TRUE); // Sort by the internal transaction ID to // make sure that our total works. // The numeric columns should be aligned to the right. list->setAllColumnsShowFocus(TRUE); refreshRegister(1); }