MythTV  master
screenwizard.h
Go to the documentation of this file.
1 #ifndef SCREENWIZARD_H
2 #define SCREENWIZARD_H
3 
4 #include <QStringList>
5 #include <QString>
6 
7 #include "mythscreentype.h"
8 #include "mythuitext.h"
9 #include "mythuibutton.h"
10 #include "mythuiimage.h"
11 #include "mythdialogbox.h"
12 #include "mythuishape.h"
13 #include "mythuitype.h"
14 
15 class XMLParse;
17 {
18  Q_OBJECT
19 
20  public:
21 
22  ScreenWizard(MythScreenStack *parent, const char *name);
23  ~ScreenWizard() override = default;
24 
25  void SetInitialSettings(int _x, int _y, int _w, int _h);
26  bool Create(void) override; // MythScreenType
27  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
28  void customEvent(QEvent *event) override; // MythUIType
29 
30  protected:
31  void doMenu();
32  void doExit();
33  private:
34  bool m_whichCorner { true };
35  bool m_coarseFine { false }; // fine adjustments by default
36  bool m_changed { false };
37  int m_fine { 1 }; // fine moves corners by one pixel
38  int m_coarse { 10 }; // coarse moves corners by ten pixels
39  int m_change { m_fine };
40  int m_topLeftX { 0 };
41  int m_topLeftY { 0 };
42  int m_bottomRightX { 0 };
43  int m_bottomRightY { 0 };
44  int m_screenWidth { 0 };
45  int m_screenHeight { 0 };
46  int m_xSize { 0 };
47  int m_ySize { 0 };
48  int m_xOffset { 0 };
49  int m_yOffset { 0 };
50 
51  QRect m_menuRect;
52  QRect m_arrowsRect;
53 
54  MythUIShape *m_blackout { nullptr };
55  MythUIImage *m_preview { nullptr };
56  MythUIText *m_size { nullptr };
57  MythUIText *m_offsets { nullptr };
58  MythUIText *m_changeAmount { nullptr };
59  MythDialogBox *m_menuPopup { nullptr };
60 
61  bool moveTLUp(void);
62  bool moveTLDown(void);
63  bool moveTLLeft(void);
64  bool moveTLRight(void);
65 
66  bool moveBRUp(void);
67  bool moveBRDown(void);
68  bool moveBRLeft(void);
69  bool moveBRRight(void);
70 
71  void wireUpTheme();
72  void updateScreen();
73  bool anythingChanged() const;
74 
75  void slotSaveSettings() const;
76  void slotChangeCoarseFine();
77  static void slotResetSettings();
78 };
79 
80 #endif
ScreenWizard::moveTLLeft
bool moveTLLeft(void)
Definition: screenwizard.cpp:159
ScreenWizard::m_coarseFine
bool m_coarseFine
Definition: screenwizard.h:35
ScreenWizard::doExit
void doExit()
Definition: screenwizard.cpp:261
ScreenWizard::m_menuPopup
MythDialogBox * m_menuPopup
Definition: screenwizard.h:59
ScreenWizard::m_preview
MythUIImage * m_preview
Definition: screenwizard.h:55
mythuitext.h
ScreenWizard::moveBRLeft
bool moveBRLeft(void)
Definition: screenwizard.cpp:197
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
ScreenWizard::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: screenwizard.cpp:71
ScreenWizard::m_xSize
int m_xSize
Definition: screenwizard.h:46
ScreenWizard::anythingChanged
bool anythingChanged() const
Definition: screenwizard.cpp:323
ScreenWizard::m_offsets
MythUIText * m_offsets
Definition: screenwizard.h:57
ScreenWizard::m_yOffset
int m_yOffset
Definition: screenwizard.h:49
ScreenWizard::m_ySize
int m_ySize
Definition: screenwizard.h:47
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:15
ScreenWizard::moveTLUp
bool moveTLUp(void)
Definition: screenwizard.cpp:140
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
ScreenWizard::wireUpTheme
void wireUpTheme()
ScreenWizard::m_coarse
int m_coarse
Definition: screenwizard.h:38
ScreenWizard::m_size
MythUIText * m_size
Definition: screenwizard.h:56
mythuiimage.h
ScreenWizard::m_bottomRightX
int m_bottomRightX
Definition: screenwizard.h:42
ScreenWizard::ScreenWizard
ScreenWizard(MythScreenStack *parent, const char *name)
Definition: screenwizard.cpp:22
ScreenWizard::m_bottomRightY
int m_bottomRightY
Definition: screenwizard.h:43
ScreenWizard::m_screenWidth
int m_screenWidth
Definition: screenwizard.h:44
ScreenWizard::updateScreen
void updateScreen()
Definition: screenwizard.cpp:216
ScreenWizard::slotResetSettings
static void slotResetSettings()
Definition: screenwizard.cpp:314
ScreenWizard::m_change
int m_change
Definition: screenwizard.h:39
ScreenWizard::m_whichCorner
bool m_whichCorner
Definition: screenwizard.h:34
ScreenWizard::m_screenHeight
int m_screenHeight
Definition: screenwizard.h:45
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
ScreenWizard::doMenu
void doMenu()
Definition: screenwizard.cpp:228
ScreenWizard::m_blackout
MythUIShape * m_blackout
Definition: screenwizard.h:54
ScreenWizard::m_topLeftX
int m_topLeftX
Definition: screenwizard.h:40
ScreenWizard::Create
bool Create(void) override
Definition: screenwizard.cpp:38
ScreenWizard::moveTLDown
bool moveTLDown(void)
Definition: screenwizard.cpp:149
ScreenWizard::m_topLeftY
int m_topLeftY
Definition: screenwizard.h:41
ScreenWizard::SetInitialSettings
void SetInitialSettings(int _x, int _y, int _w, int _h)
Definition: screenwizard.cpp:29
MythUIShape
A widget for rendering primitive shapes and lines.
Definition: mythuishape.h:21
ScreenWizard::m_menuRect
QRect m_menuRect
Definition: screenwizard.h:51
ScreenWizard::slotChangeCoarseFine
void slotChangeCoarseFine()
Definition: screenwizard.cpp:288
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:30
ScreenWizard
Definition: screenwizard.h:16
ScreenWizard::moveBRDown
bool moveBRDown(void)
Definition: screenwizard.cpp:188
ScreenWizard::m_xOffset
int m_xOffset
Definition: screenwizard.h:48
ScreenWizard::m_arrowsRect
QRect m_arrowsRect
Definition: screenwizard.h:52
ScreenWizard::moveBRUp
bool moveBRUp(void)
Definition: screenwizard.cpp:178
ScreenWizard::moveTLRight
bool moveTLRight(void)
Definition: screenwizard.cpp:168
ScreenWizard::m_fine
int m_fine
Definition: screenwizard.h:37
mythuibutton.h
ScreenWizard::customEvent
void customEvent(QEvent *event) override
Definition: screenwizard.cpp:336
ScreenWizard::slotSaveSettings
void slotSaveSettings() const
Definition: screenwizard.cpp:304
ScreenWizard::~ScreenWizard
~ScreenWizard() override=default
ScreenWizard::m_changed
bool m_changed
Definition: screenwizard.h:36
mythuishape.h
ScreenWizard::m_changeAmount
MythUIText * m_changeAmount
Definition: screenwizard.h:58
mythscreentype.h
mythuitype.h
ScreenWizard::moveBRRight
bool moveBRRight(void)
Definition: screenwizard.cpp:207