-rw-r--r-- | noncore/apps/opie-sheet/mainwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp index 9d69b8a..efbcc20 100644 --- a/noncore/apps/opie-sheet/mainwindow.cpp +++ b/noncore/apps/opie-sheet/mainwindow.cpp @@ -412,257 +412,257 @@ void MainWindow::initMenu() rowAdjust->addTo(submenuRow); rowShow->addTo(submenuRow); rowHide->addTo(submenuRow); menuFormat->insertItem(tr("&Row"), submenuRow); submenuCol=new QPopupMenu; colWidth->addTo(submenuCol); colAdjust->addTo(submenuCol); colShow->addTo(submenuCol); colHide->addTo(submenuCol); menuFormat->insertItem(tr("Colum&n"), submenuCol); submenuSheet=new QPopupMenu; sheetRename->addTo(submenuSheet); sheetRemove->addTo(submenuSheet); menuFormat->insertItem(tr("&Sheet"), submenuSheet); submenuFunc=new QPopupMenu; menuInsert->insertItem(tr("&Function"), submenuFunc); submenuFuncStd=new QPopupMenu; funcPlus->addTo(submenuFuncStd); funcMinus->addTo(submenuFuncStd); funcCross->addTo(submenuFuncStd); funcDivide->addTo(submenuFuncStd); submenuFunc->insertItem(tr("&Standard"), submenuFuncStd); submenuFuncMath=new QPopupMenu; addFlyAction(tr("Summation"), tr("&Summation"), "SUM(", submenuFuncMath); addFlyAction(tr("Absolute Value"), tr("&Absolute"), "ABS(", submenuFuncMath); submenuFuncMath->insertSeparator(); addFlyAction(tr("Sine"), tr("Si&ne"), "SIN(", submenuFuncMath); addFlyAction(tr("Arc Sine"), tr("A&rc Sine"), "ASIN(", submenuFuncMath); addFlyAction(tr("Cosine"), tr("&Cosine"), "COS(", submenuFuncMath); addFlyAction(tr("ArcCosine"), tr("Arc Cos&ine"), "COS(", submenuFuncMath); addFlyAction(tr("Tangent"), tr("&Tangent"), "TAN(", submenuFuncMath); addFlyAction(tr("Arc Tangent"), tr("Arc Tan&gent"), "ATAN(", submenuFuncMath); addFlyAction(tr("Arc Tangent of Coordinates"), tr("C&oor. Arc Tangent"), "ATAN2(", submenuFuncMath); submenuFuncMath->insertSeparator(); addFlyAction(tr("Exponential"), tr("&Exponential"), "EXP(", submenuFuncMath); addFlyAction(tr("Logarithm"), tr("&Logarithm"), "LOG(", submenuFuncMath); addFlyAction(tr("Power"), tr("&Power"), "POW(", submenuFuncMath); submenuFunc->insertItem(tr("&Mathematical"), submenuFuncMath); submenuFuncStat=new QPopupMenu; addFlyAction(tr("Average"), tr("&Average"), "AVG(", submenuFuncStat); addFlyAction(tr("Maximum"), tr("Ma&ximum"), "MAX(", submenuFuncStat); addFlyAction(tr("Minimum"), tr("&Minimum"), "MIN(", submenuFuncStat); addFlyAction(tr("Count"), tr("&Count"), "COUNT(", submenuFuncStat); submenuFunc->insertItem(tr("&Statistical"), submenuFuncStat); menuInsert->insertSeparator(); insertCells->addTo(menuInsert); insertRows->addTo(menuInsert); insertCols->addTo(menuInsert); insertSheets->addTo(menuInsert); } void MainWindow::initStandardToolbar() { toolbarStandard=new QPEToolBar(this); toolbarStandard->setHorizontalStretchable(TRUE); moveToolBar(toolbarStandard, Top); fileNew->addTo(toolbarStandard); fileOpen->addTo(toolbarStandard); fileSave->addTo(toolbarStandard); comboSheets=new QComboBox(toolbarStandard); toolbarStandard->setStretchableWidget(comboSheets); connect(comboSheets, SIGNAL(activated(const QString &)), this, SLOT(slotSheetChanged(const QString &))); } void MainWindow::initFunctionsToolbar() { toolbarFunctions=new QPEToolBar(this); toolbarFunctions->setHorizontalStretchable(TRUE); moveToolBar(toolbarFunctions, Bottom); funcEqual->addTo(toolbarFunctions); funcPlus->addTo(toolbarFunctions); funcMinus->addTo(toolbarFunctions); funcCross->addTo(toolbarFunctions); funcDivide->addTo(toolbarFunctions); funcParanOpen->addTo(toolbarFunctions); funcParanClose->addTo(toolbarFunctions); funcComma->addTo(toolbarFunctions); toolFunction=new QToolButton(toolbarFunctions); toolFunction->setPixmap(func_func_xpm); toolFunction->setTextLabel(tr("Functions")); toolFunction->setPopup(submenuFunc); toolFunction->setPopupDelay(0); } void MainWindow::initEditToolbar() { toolbarEdit=new QPEToolBar(this); toolbarEdit->setHorizontalStretchable(TRUE); moveToolBar(toolbarEdit, Bottom); editAccept->addTo(toolbarEdit); editCancel->addTo(toolbarEdit); editData=new QLineEdit(toolbarEdit); toolbarEdit->setStretchableWidget(editData); connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept())); editCellSelect->addTo(toolbarEdit); } void MainWindow::slotHelpGeneral() { if (QFile::exists(helpFile)) { QCopEnvelope e("QPE/Application/helpbrowser", "showFile(QString)"); e << helpFile; } else QMessageBox::critical(this, tr("Error"), tr("Help file not found!")); } void MainWindow::slotHelpAbout() { QDialog dialogAbout(this, 0, TRUE); dialogAbout.resize(width()-40, height()-80); dialogAbout.setCaption(tr("About Opie Sheet")); - QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nVersion: 1.0.1 (Final)\nRelease Date: July 4, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout); + QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nRelease 1.0.1\nRelease Date: July 04, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout); label.setGeometry(dialogAbout.rect()); label.setAlignment(Qt::AlignCenter | Qt::WordBreak); dialogAbout.exec(); } void MainWindow::initSheet() { sheet=new Sheet(DEFAULT_NUM_ROWS, DEFAULT_NUM_COLS, this); setCentralWidget(sheet); connect(sheet, SIGNAL(currentDataChanged(const QString &)), editData, SLOT(setText(const QString &))); connect(sheet, SIGNAL(cellClicked(const QString &)), this, SLOT(slotCellClicked(const QString &))); connect(sheet, SIGNAL(sheetModified()), this, SLOT(slotDocModified())); connect(editCut, SIGNAL(activated()), sheet, SLOT(editCut())); connect(editCopy, SIGNAL(activated()), sheet, SLOT(editCopy())); connect(editClear, SIGNAL(activated()), sheet, SLOT(editClear())); } void MainWindow::slotEditAccept() { sheet->setData(editData->text()); } void MainWindow::slotEditCancel() { editData->setText(sheet->getData()); } void MainWindow::slotCellSelect(bool lock) { sheet->lockClicks(lock); } void MainWindow::addToData(const QString &data) { editData->setText(editData->text().insert(editData->cursorPosition(), data)); } void MainWindow::slotFuncOutput() { if (sender()->isA("QAction")) addToData(((QAction *)sender())->toolTip()); } void MainWindow::slotInsertRows() { NumberDialog dialogNumber(this); if (dialogNumber.exec(tr("Insert Rows"), tr("&Number of rows:"))==QDialog::Accepted) sheet->insertRows(dialogNumber.getValue()); } void MainWindow::slotInsertCols() { NumberDialog dialogNumber(this); if (dialogNumber.exec(tr("Insert Columns"), tr("&Number of columns:"))==QDialog::Accepted) sheet->insertColumns(dialogNumber.getValue()); } void MainWindow::slotInsertSheets() { NumberDialog dialogNumber(this); if (dialogNumber.exec(tr("Add Sheets"), tr("&Number of sheets:"))==QDialog::Accepted) for (int i=dialogNumber.getValue(); i>0; --i) createNewSheet(); } void MainWindow::slotCellClicked(const QString &cell) { editCellSelect->setOn(FALSE); addToData(cell); } typeSheet *MainWindow::createNewSheet() { typeSheet *newSheet=new typeSheet; int currentNo=1, tempNo; bool ok; for (typeSheet *tempSheet=listSheets.first(); tempSheet; tempSheet=listSheets.next()) if (tempSheet->name.startsWith(tr("Sheet")) && (tempNo=tempSheet->name.mid(tr("Sheet").length()).toInt(&ok))>=currentNo && ok) currentNo=tempNo+1; newSheet->name=tr("Sheet")+QString::number(currentNo); newSheet->data.setAutoDelete(TRUE); comboSheets->insertItem(newSheet->name); listSheets.append(newSheet); return newSheet; } typeSheet *MainWindow::findSheet(const QString &name) { for (typeSheet *tempSheet=listSheets.first(); tempSheet; tempSheet=listSheets.next()) if (tempSheet->name==name) return tempSheet; return NULL; } void MainWindow::slotSheetChanged(const QString &name) { sheet->copySheetData(&findSheet(sheet->getName())->data); sheet->setName(name); sheet->setSheetData(&findSheet(name)->data); } void MainWindow::addFlyAction(const QString &text, const QString &menuText, const QString &tip, QWidget *w) { QAction *action=new QAction(text, menuText, 0, this); action->setToolTip(tip); connect(action, SIGNAL(activated()), this, SLOT(slotFuncOutput())); action->addTo(w); } void MainWindow::slotFormatCells() { CellFormat dialogCellFormat(this); dialogCellFormat.showMaximized(); dialogCellFormat.exec(sheet); } void MainWindow::slotEditPaste() { sheet->editPaste(); } void MainWindow::slotEditPasteContents() { |