MythTV  master
mythuispinbox.h
Go to the documentation of this file.
1 #ifndef MYTHUISPINBOX_H_
2 #define MYTHUISPINBOX_H_
3 
4 #include "mythuibuttonlist.h"
5 
17 {
18  Q_OBJECT
19  public:
20  MythUISpinBox(MythUIType *parent, const QString &name)
21  : MythUIButtonList(parent, name) {}
22  ~MythUISpinBox() = default;
23 
24  void SetRange(int low, int high, int step, uint pageMultiple = 5);
25 
26  void SetValue(int val) override // MythUIButtonList
27  { SetValueByData(val); }
28  void SetValue(const QString &val) override // MythUIButtonList
29  { SetValueByData(val.toInt()); }
30  void AddSelection (int value, const QString &label = "");
31  QString GetValue(void) const override // MythUIButtonList
32  { return GetDataValue().toString(); }
33  int GetIntValue(void) const override // MythUIButtonList
34  { return GetDataValue().toInt(); }
35  bool keyPressEvent(QKeyEvent *event) override; // MythUIButtonList
36 
37  protected:
38  bool ParseElement(const QString &filename, QDomElement &element,
39  bool showWarnings) override; // MythUIButtonList
40  void CopyFrom(MythUIType *base) override; // MythUIButtonList
41  void CreateCopy(MythUIType *parent) override; // MythUIButtonList
42 
43  bool MoveDown(MovementUnit unit = MoveItem, uint amount = 0) override; // MythUIButtonList
44  bool MoveUp(MovementUnit unit = MoveItem, uint amount = 0) override; // MythUIButtonList
45  void ShowEntryDialog(QString initialEntry);
46 
47  bool m_hasTemplate {false};
49  QString m_zeroTemplate;
51 
52  uint m_moveAmount {0};
53  int m_low {0};
54  int m_high {0};
55  int m_step {0};
56 };
57 
58 // Convenience Dialog to allow entry of a Spinbox value
59 
61 {
62  Q_OBJECT
63  public:
64  SpinBoxEntryDialog(MythScreenStack *parent, const char *name,
65  MythUIButtonList *parentList, QString searchText,
66  int low, int high, int step);
67  ~SpinBoxEntryDialog(void) = default;
68 
69  bool Create(void) override; // MythScreenType
70 
71  protected slots:
72  void entryChanged(void);
73  void okClicked(void);
74 
75  protected:
77  QString m_searchText;
84  int m_low;
85  int m_high;
86  int m_step;
87 
88 
89 };
90 
91 #endif
MythUIText * m_rulesText
Definition: mythuispinbox.h:81
MythUIButton * m_cancelButton
Definition: mythuispinbox.h:79
unsigned int slots[4]
Definition: element.c:38
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
MythUIButtonList * m_parentList
Definition: mythuispinbox.h:76
A widget for offering a range of numerical values where only the the bounding values and interval are...
Definition: mythuispinbox.h:16
QString m_positiveTemplate
Definition: mythuispinbox.h:50
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
QString GetValue(void) const override
Definition: mythuispinbox.h:31
virtual bool Create(void)
virtual bool MoveDown(MovementUnit unit=MoveItem, uint amount=0)
MythUIButton * m_okButton
Definition: mythuispinbox.h:80
unsigned int uint
Definition: compat.h:140
void SetValue(int val) override
Definition: mythuispinbox.h:26
QString m_zeroTemplate
Definition: mythuispinbox.h:49
The base class on which all widgets and screens are based.
Definition: mythuitype.h:63
int GetIntValue(void) const override
Definition: mythuispinbox.h:33
virtual bool MoveUp(MovementUnit unit=MoveItem, uint amount=0)
QString m_negativeTemplate
Definition: mythuispinbox.h:48
A text entry and edit widget.
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
MythUISpinBox(MythUIType *parent, const QString &name)
Definition: mythuispinbox.h:20
QVariant GetDataValue() const
const char * name
Definition: ParseText.cpp:328
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
A single button widget.
Definition: mythuibutton.h:21
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
#define MUI_PUBLIC
Definition: mythuiexp.h:9
MythUITextEdit * m_entryEdit
Definition: mythuispinbox.h:78
Screen in which all other widgets are contained and rendered.
void SetValue(const QString &val) override
Definition: mythuispinbox.h:28
void SetValueByData(const QVariant &data)