-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompassPane.h
More file actions
71 lines (60 loc) · 1.78 KB
/
Copy pathCompassPane.h
File metadata and controls
71 lines (60 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//CompassPane.h
#pragma once
#include <QWidget.h>
#include <QPushbutton.h>
#include <QLabel.h>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QShowEvent>
#include <QGeoCoordinate.h>
#include <QString.h>
#include "RedrawReason.h"
class CCompassPane : public QWidget
{
Q_OBJECT
//Constructor
public:
explicit CCompassPane(QWidget* parent = nullptr);
//Methods
public:
void setEnabledAllButtons(bool bState);
void disableStepExtreme(int stepExtreme);
void SaveFocus();
void RestoreFocus();
private:
void SetupCompass();
void UpdateLocationLabel( QString locationText, QGeoCoordinate& GeoCoordinate );
void UpdateStepLabel( double stepSize );
int getKeyFromFocusedButton();
bool EmitDirections(int key);
//Slots
public:
void UpdateLabels(enumRedrawReason redrawReason, QString locationText, QGeoCoordinate& GeoCoordinate, double stepSize, int stepExtreme );
protected:
bool eventFilter(QObject* obj, QEvent* event) override;
void keyPressEvent(QKeyEvent* event) override;
bool focusNextPrevChild(bool next) override;
void mousePressEvent(QMouseEvent* event) override;
void showEvent(QShowEvent* event) override;
signals:
void northRequested();
void eastRequested();
void southRequested();
void westRequested();
void stepMoreRequested();
void stepLessRequested();
//Member variables
private:
QPushButton* m_pNorthButton;
QPushButton* m_pEastButton;
QPushButton* m_pSouthButton;
QPushButton* m_pWestButton;
//Location and step size labels and buttons
QLabel* m_pLocationLabel;
QLabel* m_pStepLabel;
QPushButton* m_pStepMoreButton;
QPushButton* m_pStepLessButton;
QWidget* m_pLastEnabledFocusedWidget;
QWidget* m_pLastF6FocusedWidget;
bool m_initialShow;
};