author | harlekin <harlekin> | 2002-08-01 00:47:09 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-01 00:47:09 (UTC) |
commit | ba034bf4cb91b83654056945fc27313a28528015 (patch) (unidiff) | |
tree | 4df33783ca21017424135aacc2e45b94437cfdff /noncore/apps/opie-sheet/cellformat.cpp | |
parent | 26ff0c72228b9c89b079dfa381d448b6152eb408 (diff) | |
download | opie-ba034bf4cb91b83654056945fc27313a28528015.zip opie-ba034bf4cb91b83654056945fc27313a28528015.tar.gz opie-ba034bf4cb91b83654056945fc27313a28528015.tar.bz2 |
gcc3.x fixes
Diffstat (limited to 'noncore/apps/opie-sheet/cellformat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-sheet/cellformat.cpp | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/noncore/apps/opie-sheet/cellformat.cpp b/noncore/apps/opie-sheet/cellformat.cpp index 597502c..342ebe9 100644 --- a/noncore/apps/opie-sheet/cellformat.cpp +++ b/noncore/apps/opie-sheet/cellformat.cpp | |||
@@ -22,20 +22,41 @@ | |||
22 | 22 | ||
23 | #define COLOR_COUNT 17 | 23 | #define COLOR_COUNT 17 |
24 | #define STYLE_COUNT 14 | 24 | #define STYLE_COUNT 14 |
25 | #define HALIGN_COUNT 3 | 25 | #define HALIGN_COUNT 3 |
26 | #define VALIGN_COUNT 3 | 26 | #define VALIGN_COUNT 3 |
27 | 27 | ||
28 | QColor qtColors[COLOR_COUNT]={Qt::black, Qt::white, Qt::darkGray, Qt::gray, Qt::lightGray, Qt::red, Qt::green, Qt::blue, Qt::cyan, Qt::magenta, Qt::yellow, Qt::darkRed, Qt::darkGreen, Qt::darkBlue, Qt::darkCyan, Qt::darkMagenta, Qt::darkYellow}; | 28 | QColor qtColors[COLOR_COUNT]={Qt::black,Qt::white, Qt::darkGray, |
29 | Qt::BrushStyle brushStyles[STYLE_COUNT]={Qt::SolidPattern, Qt::Dense1Pattern, Qt::Dense2Pattern, Qt::Dense3Pattern, Qt::Dense4Pattern, Qt::Dense5Pattern, Qt::Dense6Pattern, Qt::Dense7Pattern, Qt::HorPattern, Qt::VerPattern, Qt::CrossPattern, Qt::BDiagPattern, Qt::FDiagPattern, Qt::DiagCrossPattern}; | 29 | Qt::gray, Qt::lightGray, Qt::red, |
30 | Qt::green, Qt::blue, Qt::cyan, | ||
31 | Qt::magenta, Qt::yellow, | ||
32 | Qt::darkRed, Qt::darkGreen, | ||
33 | Qt::darkBlue, Qt::darkCyan, | ||
34 | Qt::darkMagenta, Qt::darkYellow}; | ||
35 | |||
36 | Qt::BrushStyle brushStyles[STYLE_COUNT]={Qt::SolidPattern, | ||
37 | Qt::Dense1Pattern, Qt::Dense2Pattern, | ||
38 | Qt::Dense3Pattern, Qt::Dense4Pattern, | ||
39 | Qt::Dense5Pattern, Qt::Dense6Pattern, | ||
40 | Qt::Dense7Pattern, Qt::HorPattern, | ||
41 | Qt::VerPattern, Qt::CrossPattern, | ||
42 | Qt::BDiagPattern, Qt::FDiagPattern, | ||
43 | Qt::DiagCrossPattern}; | ||
44 | |||
30 | QString namesHAlign[HALIGN_COUNT]={"Left", "Right", "Center"}; | 45 | QString namesHAlign[HALIGN_COUNT]={"Left", "Right", "Center"}; |
31 | QString namesVAlign[VALIGN_COUNT]={"Top", "Bottom", "Center"}; | 46 | QString namesVAlign[VALIGN_COUNT]={"Top", "Bottom", "Center"}; |
32 | Qt::AlignmentFlags flagsHAlign[HALIGN_COUNT]={Qt::AlignLeft, Qt::AlignRight, Qt::AlignHCenter}; | ||
33 | Qt::AlignmentFlags flagsVAlign[VALIGN_COUNT]={Qt::AlignTop, Qt::AlignBottom, Qt::AlignVCenter}; | ||
34 | 47 | ||
35 | CellFormat::CellFormat(QWidget *parent=0) | 48 | Qt::AlignmentFlags flagsHAlign[HALIGN_COUNT]={Qt::AlignLeft, |
49 | Qt::AlignRight, | ||
50 | Qt::AlignHCenter}; | ||
51 | |||
52 | Qt::AlignmentFlags flagsVAlign[VALIGN_COUNT]={Qt::AlignTop, | ||
53 | Qt::AlignBottom, | ||
54 | Qt::AlignVCenter}; | ||
55 | |||
56 | CellFormat::CellFormat(QWidget *parent) | ||
36 | :QDialog(parent, 0, TRUE) | 57 | :QDialog(parent, 0, TRUE) |
37 | { | 58 | { |
38 | // Main widget | 59 | // Main widget |
39 | tabs=new QTabWidget(this); | 60 | tabs=new QTabWidget(this); |
40 | widgetBorders=new QWidget(tabs); | 61 | widgetBorders=new QWidget(tabs); |
41 | widgetBackground=new QWidget(tabs); | 62 | widgetBackground=new QWidget(tabs); |
@@ -49,20 +70,24 @@ CellFormat::CellFormat(QWidget *parent=0) | |||
49 | fontDB.loadRenderers(); | 70 | fontDB.loadRenderers(); |
50 | changedFont=changedAlign=changedBrush=FALSE; | 71 | changedFont=changedAlign=changedBrush=FALSE; |
51 | 72 | ||
52 | // Borders tab | 73 | // Borders tab |
53 | borderEditor=new BorderEditor(widgetBorders); | 74 | borderEditor=new BorderEditor(widgetBorders); |
54 | borderEditor->setGeometry(10, 10, 215, 145); | 75 | borderEditor->setGeometry(10, 10, 215, 145); |
55 | connect(borderEditor, SIGNAL(clicked(BorderEditor::BorderArea)), this, SLOT(borderClicked(BorderEditor::BorderArea))); | 76 | connect(borderEditor, SIGNAL(clicked(BorderEditor::BorderArea)), |
77 | this, SLOT(borderClicked(BorderEditor::BorderArea))); | ||
56 | 78 | ||
57 | comboBordersWidth=createCombo(COMBO_WIDTH, widgetBorders, tr("&Width:"), 165); | 79 | comboBordersWidth=createCombo(COMBO_WIDTH, widgetBorders, tr("&Width:"), 165); |
58 | comboBordersColor=createCombo(COMBO_COLOR, widgetBorders, tr("&Color:"), 165+(COMBO_HEIGHTS+10)); | 80 | comboBordersColor=createCombo(COMBO_COLOR, widgetBorders, tr("&Color:"), 165+(COMBO_HEIGHTS+10)); |
59 | 81 | ||
60 | buttonBordersDefaults=new QPushButton(tr("&Default Borders"), widgetBorders); | 82 | buttonBordersDefaults=new QPushButton(tr("&Default Borders"), widgetBorders); |
61 | buttonBordersDefaults->setGeometry(115, 165+2*(COMBO_HEIGHTS+10), 110, COMBO_HEIGHTS); | 83 | buttonBordersDefaults->setGeometry(115, 165+2*(COMBO_HEIGHTS+10), |
62 | connect(buttonBordersDefaults, SIGNAL(clicked()), this, SLOT(slotBordersDefaults())); | 84 | 110, COMBO_HEIGHTS); |
85 | |||
86 | connect(buttonBordersDefaults, SIGNAL(clicked()), | ||
87 | this, SLOT(slotBordersDefaults())); | ||
63 | 88 | ||
64 | // Background tab | 89 | // Background tab |
65 | frameBackground=new QFrame(widgetBackground); | 90 | frameBackground=new QFrame(widgetBackground); |
66 | frameBackground->setGeometry(10, 10, 215, 145); | 91 | frameBackground->setGeometry(10, 10, 215, 145); |
67 | frameBackground->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); | 92 | frameBackground->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); |
68 | 93 | ||
@@ -289,13 +314,14 @@ int CellFormat::findComboItemIndex(QComboBox *combo, const QString &item) | |||
289 | for (int i=0; i<combo->count(); ++i) | 314 | for (int i=0; i<combo->count(); ++i) |
290 | if (combo->text(i)==item) | 315 | if (combo->text(i)==item) |
291 | return i; | 316 | return i; |
292 | return 0; | 317 | return 0; |
293 | } | 318 | } |
294 | 319 | ||
295 | QComboBox *CellFormat::createCombo(comboType type, QWidget *parent, const QString &caption, int y) | 320 | QComboBox *CellFormat::createCombo(comboType type, QWidget *parent, |
321 | const QString &caption, int y) | ||
296 | { | 322 | { |
297 | QComboBox *combo=new QComboBox(FALSE, parent); | 323 | QComboBox *combo=new QComboBox(FALSE, parent); |
298 | combo->setGeometry(70, y, COMBO_WIDTHS, COMBO_HEIGHTS); | 324 | combo->setGeometry(70, y, COMBO_WIDTHS, COMBO_HEIGHTS); |
299 | combo->setSizeLimit(5); | 325 | combo->setSizeLimit(5); |
300 | 326 | ||
301 | switch (type) | 327 | switch (type) |
@@ -304,12 +330,13 @@ QComboBox *CellFormat::createCombo(comboType type, QWidget *parent, const QStrin | |||
304 | case COMBO_STYLE: createStyleCombo(combo); break; | 330 | case COMBO_STYLE: createStyleCombo(combo); break; |
305 | case COMBO_FONT: createFontCombo(combo); break; | 331 | case COMBO_FONT: createFontCombo(combo); break; |
306 | case COMBO_SIZE: createSizeCombo(combo); break; | 332 | case COMBO_SIZE: createSizeCombo(combo); break; |
307 | case COMBO_COLOR: createColorCombo(combo); break; | 333 | case COMBO_COLOR: createColorCombo(combo); break; |
308 | case COMBO_HALIGN: createHAlignCombo(combo); break; | 334 | case COMBO_HALIGN: createHAlignCombo(combo); break; |
309 | case COMBO_VALIGN: createVAlignCombo(combo); break; | 335 | case COMBO_VALIGN: createVAlignCombo(combo); break; |
336 | default: break; | ||
310 | } | 337 | } |
311 | 338 | ||
312 | QLabel *label=new QLabel(combo, caption, parent); | 339 | QLabel *label=new QLabel(combo, caption, parent); |
313 | label->setGeometry(10, y, 50, COMBO_HEIGHTS); | 340 | label->setGeometry(10, y, 50, COMBO_HEIGHTS); |
314 | 341 | ||
315 | return combo; | 342 | return combo; |
@@ -492,13 +519,13 @@ int CellFormat::exec(Sheet *s) | |||
492 | } | 519 | } |
493 | 520 | ||
494 | // | 521 | // |
495 | // Border Editor | 522 | // Border Editor |
496 | // | 523 | // |
497 | 524 | ||
498 | BorderEditor::BorderEditor(QWidget *parent=0) | 525 | BorderEditor::BorderEditor(QWidget *parent) |
499 | :QFrame(parent) | 526 | :QFrame(parent) |
500 | { | 527 | { |
501 | setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); | 528 | setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); |
502 | } | 529 | } |
503 | 530 | ||
504 | BorderEditor::~BorderEditor() | 531 | BorderEditor::~BorderEditor() |