Diffstat (limited to 'noncore/tools/euroconv/calcdisplay.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/tools/euroconv/calcdisplay.cpp | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/noncore/tools/euroconv/calcdisplay.cpp b/noncore/tools/euroconv/calcdisplay.cpp index e5a49e6..8f3de22 100644 --- a/noncore/tools/euroconv/calcdisplay.cpp +++ b/noncore/tools/euroconv/calcdisplay.cpp | |||
@@ -1,70 +1,98 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * | 2 | * |
3 | * File: calcdisplay.cpp | 3 | * File: calcdisplay.cpp |
4 | * | 4 | * |
5 | * Description: | 5 | * Description: |
6 | * | 6 | * |
7 | * | 7 | * |
8 | * Authors: Eric Santonacci <Eric.Santonacci@talc.fr> | 8 | * Authors: Eric Santonacci <Eric.Santonacci@talc.fr> |
9 | * | 9 | * |
10 | * Requirements: Qt | 10 | * Requirements: Qt |
11 | * | 11 | * |
12 | * $Id$ | 12 | * $Id$ |
13 | * | 13 | * |
14 | ***************************************************************************/ | 14 | ***************************************************************************/ |
15 | 15 | ||
16 | #include <stdio.h> | 16 | #include <stdio.h> |
17 | #include <qvbox.h> | 17 | #include <qvbox.h> |
18 | #include <qpixmap.h> | 18 | #include <qpixmap.h> |
19 | 19 | ||
20 | #include "currency.h" | 20 | #include "currency.h" |
21 | #include "calcdisplay.h" | 21 | #include "calcdisplay.h" |
22 | 22 | ||
23 | /* XPM */ | ||
24 | static char *swap_xpm[] = { | ||
25 | /* width height num_colors chars_per_pixel */ | ||
26 | " 13 18 2 1", | ||
27 | /* colors */ | ||
28 | ". c None", | ||
29 | "# c #000000", | ||
30 | /* pixels */ | ||
31 | "..#######....", | ||
32 | "..#####......", | ||
33 | "..######.....", | ||
34 | "..#...###....", | ||
35 | "........##...", | ||
36 | ".........##..", | ||
37 | "..........##.", | ||
38 | "...........##", | ||
39 | "...........##", | ||
40 | "...........##", | ||
41 | "...........##", | ||
42 | "..........##.", | ||
43 | ".........##..", | ||
44 | "........##...", | ||
45 | "..#...###....", | ||
46 | "..######.....", | ||
47 | "..#####......", | ||
48 | "..#######....", | ||
49 | }; | ||
50 | |||
23 | 51 | ||
24 | LCDDisplay::LCDDisplay( QWidget *parent, const char *name ) | 52 | LCDDisplay::LCDDisplay( QWidget *parent, const char *name ) |
25 | : QHBox( parent, name ){ | 53 | : QHBox( parent, name ){ |
26 | 54 | ||
27 | 55 | ||
28 | 56 | ||
29 | this->setMargin(5); | 57 | this->setMargin(5); |
30 | this->setSpacing(5); | 58 | this->setSpacing(5); |
31 | 59 | ||
32 | // Create display | 60 | // Create display |
33 | QVBox *vbxlayout = new QVBox (this); | 61 | QVBox *vbxlayout = new QVBox (this); |
34 | 62 | ||
35 | /*************** Top LCD ***********************/ | 63 | /*************** Top LCD ***********************/ |
36 | grpbxTop = new QHGroupBox(vbxlayout, "grpbxTop"); | 64 | grpbxTop = new QHGroupBox(vbxlayout, "grpbxTop"); |
37 | grpbxStyle = grpbxTop->frameStyle(); | 65 | grpbxStyle = grpbxTop->frameStyle(); |
38 | grpbxTop->setMaximumHeight(48); | 66 | grpbxTop->setMaximumHeight(48); |
39 | 67 | ||
40 | cbbxTop = new QComboBox(grpbxTop, "cbbxTop"); | 68 | cbbxTop = new QComboBox(grpbxTop, "cbbxTop"); |
41 | cbbxTop->setMaximumWidth(50); | 69 | cbbxTop->setMaximumWidth(50); |
42 | cbbxTop->insertStrList(aCurrency); | 70 | cbbxTop->insertStrList(aCurrency); |
43 | 71 | ||
44 | lcdTop = new QLCDNumber(10, grpbxTop, "lcdTop"); | 72 | lcdTop = new QLCDNumber(10, grpbxTop, "lcdTop"); |
45 | lcdTop->setMode( QLCDNumber::DEC ); | 73 | lcdTop->setMode( QLCDNumber::DEC ); |
46 | lcdTop->setSmallDecimalPoint(false); | 74 | lcdTop->setSmallDecimalPoint(false); |
47 | lcdTop->setSegmentStyle(QLCDNumber::Flat); | 75 | lcdTop->setSegmentStyle(QLCDNumber::Flat); |
48 | 76 | ||
49 | /************** Bottom LCD ************************/ | 77 | /************** Bottom LCD ************************/ |
50 | grpbxBottom = new QHGroupBox(vbxlayout, "grpbxBottom"); | 78 | grpbxBottom = new QHGroupBox(vbxlayout, "grpbxBottom"); |
51 | grpbxBottom->setMaximumHeight(46); | 79 | grpbxBottom->setMaximumHeight(46); |
52 | grpbxBottom->setFrameStyle(0); | 80 | grpbxBottom->setFrameStyle(0); |
53 | grpbxBottom->setFrameShadow(QFrame::MShadow); | 81 | grpbxBottom->setFrameShadow(QFrame::MShadow); |
54 | 82 | ||
55 | cbbxBottom = new QComboBox(grpbxBottom, "cbbxBottom"); | 83 | cbbxBottom = new QComboBox(grpbxBottom, "cbbxBottom"); |
56 | cbbxBottom->setMaximumWidth(50); | 84 | cbbxBottom->setMaximumWidth(50); |
57 | cbbxBottom->insertStrList(aCurrency); | 85 | cbbxBottom->insertStrList(aCurrency); |
58 | 86 | ||
59 | lcdBottom = new QLCDNumber(10, grpbxBottom, "lcdBottom"); | 87 | lcdBottom = new QLCDNumber(10, grpbxBottom, "lcdBottom"); |
60 | lcdBottom->setMode( QLCDNumber::DEC ); | 88 | lcdBottom->setMode( QLCDNumber::DEC ); |
61 | lcdBottom->setSmallDecimalPoint(false); | 89 | lcdBottom->setSmallDecimalPoint(false); |
62 | lcdBottom->setSegmentStyle(QLCDNumber::Flat); | 90 | lcdBottom->setSegmentStyle(QLCDNumber::Flat); |
63 | 91 | ||
64 | // set combo box signals | 92 | // set combo box signals |
65 | connect(cbbxTop, SIGNAL(activated(int)), this, SLOT(cbbxChange())); | 93 | connect(cbbxTop, SIGNAL(activated(int)), this, SLOT(cbbxChange())); |
66 | connect(cbbxBottom, SIGNAL(activated(int)), this, SLOT(cbbxChange())); | 94 | connect(cbbxBottom, SIGNAL(activated(int)), this, SLOT(cbbxChange())); |
67 | 95 | ||
68 | btnSwap = new QPushButton(this, "swap"); | 96 | btnSwap = new QPushButton(this, "swap"); |
69 | QPixmap imgSwap((const char**) swap_xpm); | 97 | QPixmap imgSwap((const char**) swap_xpm); |
70 | btnSwap->setPixmap(imgSwap); | 98 | btnSwap->setPixmap(imgSwap); |