summaryrefslogtreecommitdiff
path: root/inputmethods/dasher/QtDasherScreen.cc
Unidiff
Diffstat (limited to 'inputmethods/dasher/QtDasherScreen.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/dasher/QtDasherScreen.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/inputmethods/dasher/QtDasherScreen.cc b/inputmethods/dasher/QtDasherScreen.cc
index 747b705..2179cfb 100644
--- a/inputmethods/dasher/QtDasherScreen.cc
+++ b/inputmethods/dasher/QtDasherScreen.cc
@@ -9,39 +9,44 @@
9#include <qpointarray.h> 9#include <qpointarray.h>
10#include <qpoint.h> 10#include <qpoint.h>
11 11
12#include "QtDasherScreen.h" 12#include "QtDasherScreen.h"
13#include "DasherScreen.h" 13#include "DasherScreen.h"
14#include "SettingsStore.h" 14#include "SettingsStore.h"
15 15
16#define MAXFONTSIZE 25 16#define MAXFONTSIZE 25
17#define MINFONTSIZE 8 17#define MINFONTSIZE 8
18 18
19QtDasherScreen::QtDasherScreen (int _width, int _height, 19QtDasherScreen::QtDasherScreen (int _width, int _height,
20 CDasherInterface *_interface, 20 CDasherInterface *_interface,
21 QWidget * _parent, Dasher::CDashEditbox *edit): 21 QWidget * _parent,
22 QWidget(_parent), interface( _interface ), 22 Dasher::CDashEditbox *_edit):
23 fontname( "fixed" ), fontsize(12), 23 QWidget(_parent),
24 Dasher::CDasherScreen(_width, _height) 24 Dasher::CDasherScreen(_width, _height),
25 fontsize(12),
26 interface( _interface ),
27 fontname( "fixed" )
25{ 28{
26 font = QFont (fontname.c_str(), fontsize); 29 font = QFont (fontname.c_str(), fontsize);
27 painter = new QPainter (); 30 painter = new QPainter ();
28 31
29 pixmap = new QPixmap (_width, _height); 32 pixmap = new QPixmap (_width, _height);
30 pixmap->setOptimization(QPixmap::BestOptim); 33 pixmap->setOptimization(QPixmap::BestOptim);
31 interface->SetSettingsStore(new CSettingsStore); 34 interface->SetSettingsStore(new CSettingsStore);
32 35
33 interface->ChangeLanguageModel(0); 36 interface->ChangeLanguageModel(0);
34 interface->ChangeView(0); 37 interface->ChangeView(0);
35 interface->ChangeEdit(edit); 38 interface->ChangeEdit(_edit);
39 edit = _edit;
40
36 41
37/* interface->GetFontSizes(&FontSizes); 42/* interface->GetFontSizes(&FontSizes);
38 43
39 for (int i=0; i<FontSizes.size(); i++) { 44 for (int i=0; i<FontSizes.size(); i++) {
40 if (FontSizes[i]>Fonts.size()) 45 if (FontSizes[i]>Fonts.size())
41 Fonts.resize((FontSizes[i])+1); 46 Fonts.resize((FontSizes[i])+1);
42 Fonts[FontSizes[i]]= QFont (fontname.c_str(), FontSizes[i]); 47 Fonts[FontSizes[i]]= QFont (fontname.c_str(), FontSizes[i]);
43// Fonts[FontSizes[i]].setPixelSize(FontSizes[i]); 48// Fonts[FontSizes[i]].setPixelSize(FontSizes[i]);
44 } 49 }
45*/ 50*/
46 interface->ChangeScreen(this); 51 interface->ChangeScreen(this);
47 52
@@ -134,25 +139,25 @@ void QtDasherScreen::Polyline(point* Points, int Number) const
134 painter->setPen (NoPen); 139 painter->setPen (NoPen);
135} 140}
136 141
137void QtDasherScreen::DrawPolygon(point* Points, int Number, int Color, 142void QtDasherScreen::DrawPolygon(point* Points, int Number, int Color,
138 Opts::ColorSchemes ColorScheme) const 143 Opts::ColorSchemes ColorScheme) const
139{ 144{
140 painter->setBrush (getColor (Color, ColorScheme)); 145 painter->setBrush (getColor (Color, ColorScheme));
141 QPointArray qpa(Number); 146 QPointArray qpa(Number);
142 Points_to_QPointArray (Points, Number, qpa); 147 Points_to_QPointArray (Points, Number, qpa);
143 painter->drawPolygon (qpa); 148 painter->drawPolygon (qpa);
144} 149}
145 150
146void QtDasherScreen::mousePressEvent (QMouseEvent *e) 151void QtDasherScreen::mousePressEvent (QMouseEvent *)
147{ 152{
148 paused=false; 153 paused=false;
149 interface->Unpause(get_time()); 154 interface->Unpause(get_time());
150} 155}
151 156
152void QtDasherScreen::mouseReleaseEvent(QMouseEvent *e) 157void QtDasherScreen::mouseReleaseEvent(QMouseEvent *e)
153{ 158{
154 QPoint p = e->pos(); 159 QPoint p = e->pos();
155 interface->PauseAt(p.x(), p.y()); 160 interface->PauseAt(p.x(), p.y());
156 paused=true; 161 paused=true;
157} 162}
158 163