summaryrefslogtreecommitdiff
path: root/noncore/tools/euroconv/calcdisplay.cpp
Unidiff
Diffstat (limited to 'noncore/tools/euroconv/calcdisplay.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/euroconv/calcdisplay.cpp34
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 */
24static 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
24LCDDisplay::LCDDisplay( QWidget *parent, const char *name ) 52LCDDisplay::LCDDisplay( QWidget *parent, const char *name )
25 : QHBox( parent, name ){ 53 : QHBox( parent, name ){
26 54
27 55
28 56
29this->setMargin(5); 57this->setMargin(5);
30this->setSpacing(5); 58this->setSpacing(5);
31 59
32// Create display 60// Create display
33QVBox *vbxlayout = new QVBox (this); 61QVBox *vbxlayout = new QVBox (this);
34 62
35/*************** Top LCD ***********************/ 63/*************** Top LCD ***********************/
36grpbxTop = new QHGroupBox(vbxlayout, "grpbxTop"); 64grpbxTop = new QHGroupBox(vbxlayout, "grpbxTop");
37grpbxStyle = grpbxTop->frameStyle(); 65grpbxStyle = grpbxTop->frameStyle();
38grpbxTop->setMaximumHeight(48); 66grpbxTop->setMaximumHeight(48);
39 67
40cbbxTop = new QComboBox(grpbxTop, "cbbxTop"); 68cbbxTop = new QComboBox(grpbxTop, "cbbxTop");
41cbbxTop->setMaximumWidth(50); 69cbbxTop->setMaximumWidth(50);
42cbbxTop->insertStrList(aCurrency); 70cbbxTop->insertStrList(aCurrency);
43 71
44lcdTop = new QLCDNumber(10, grpbxTop, "lcdTop"); 72lcdTop = new QLCDNumber(10, grpbxTop, "lcdTop");
45lcdTop->setMode( QLCDNumber::DEC ); 73lcdTop->setMode( QLCDNumber::DEC );
46lcdTop->setSmallDecimalPoint(false); 74lcdTop->setSmallDecimalPoint(false);
47lcdTop->setSegmentStyle(QLCDNumber::Flat); 75lcdTop->setSegmentStyle(QLCDNumber::Flat);
48 76
49/************** Bottom LCD ************************/ 77/************** Bottom LCD ************************/
50grpbxBottom = new QHGroupBox(vbxlayout, "grpbxBottom"); 78grpbxBottom = new QHGroupBox(vbxlayout, "grpbxBottom");
51grpbxBottom->setMaximumHeight(46); 79grpbxBottom->setMaximumHeight(46);
52grpbxBottom->setFrameStyle(0); 80grpbxBottom->setFrameStyle(0);
53grpbxBottom->setFrameShadow(QFrame::MShadow); 81grpbxBottom->setFrameShadow(QFrame::MShadow);
54 82
55cbbxBottom = new QComboBox(grpbxBottom, "cbbxBottom"); 83cbbxBottom = new QComboBox(grpbxBottom, "cbbxBottom");
56cbbxBottom->setMaximumWidth(50); 84cbbxBottom->setMaximumWidth(50);
57cbbxBottom->insertStrList(aCurrency); 85cbbxBottom->insertStrList(aCurrency);
58 86
59lcdBottom = new QLCDNumber(10, grpbxBottom, "lcdBottom"); 87lcdBottom = new QLCDNumber(10, grpbxBottom, "lcdBottom");
60lcdBottom->setMode( QLCDNumber::DEC ); 88lcdBottom->setMode( QLCDNumber::DEC );
61lcdBottom->setSmallDecimalPoint(false); 89lcdBottom->setSmallDecimalPoint(false);
62lcdBottom->setSegmentStyle(QLCDNumber::Flat); 90lcdBottom->setSegmentStyle(QLCDNumber::Flat);
63 91
64// set combo box signals 92// set combo box signals
65connect(cbbxTop, SIGNAL(activated(int)), this, SLOT(cbbxChange())); 93connect(cbbxTop, SIGNAL(activated(int)), this, SLOT(cbbxChange()));
66connect(cbbxBottom, SIGNAL(activated(int)), this, SLOT(cbbxChange())); 94connect(cbbxBottom, SIGNAL(activated(int)), this, SLOT(cbbxChange()));
67 95
68btnSwap = new QPushButton(this, "swap"); 96btnSwap = new QPushButton(this, "swap");
69QPixmap imgSwap((const char**) swap_xpm); 97QPixmap imgSwap((const char**) swap_xpm);
70btnSwap->setPixmap(imgSwap); 98btnSwap->setPixmap(imgSwap);