Rose
ConfigDialog.h
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include <regex>
11 #include <utility>
12 
13 #include "PopupWindow.h"
14 #include "TextField.h"
15 
16 namespace rose {
17 
22  class ConfigDialog : public Dialog {
23  protected:
24  static constexpr std::string_view mTitle = "Configure";
25  static constexpr std::string_view CallPattern = "[A-Z]+[0-9][A-Z]+";
26  static constexpr std::string_view FloatPattern = "[+-]?([0-9]*[.])?[0-9]+";
27 
28  static constexpr std::array<DialogActionButton,1> mActionButtons = {
30  };
31 
32  void qthConfigure(shared_ptr <Row> &parent);
33 
34  std::array<std::shared_ptr<TextField>,3> mTextFields{};
35 
36  std::shared_ptr<std::regex> mCallRegex{};
37  std::shared_ptr<std::regex> mFloatRegex{};
38 
39  std::shared_ptr<Slot<Button::SignalType>> mActionButtonSlot{};
40 
41  public:
42  ConfigDialog() = delete;
43  ~ConfigDialog() override = default;
44  ConfigDialog(ConfigDialog &&) = delete;
45  ConfigDialog(const ConfigDialog &) = delete;
46  ConfigDialog& operator=(ConfigDialog &&) = delete;
47  ConfigDialog& operator=(const ConfigDialog &) = delete;
48 
53  explicit ConfigDialog(shared_ptr <Rose> parent) : Dialog(std::move(parent)) {
54  mWindowTitle = mTitle;
55  mSupportsDrag = true;
56  }
57 
64  ConfigDialog(shared_ptr <Rose> parent, const Position &position) : Dialog(std::move(parent), position) {
65  mWindowTitle = mTitle;
66  mSupportsDrag = true;
67  }
68 
75  ConfigDialog(shared_ptr <Rose> parent, const Position &pos, const Size &size)
76  : Dialog(std::move(parent), pos, size) {
77  mWindowTitle = mTitle;
78  mSupportsDrag = true;
79  }
80 
84  void initializeComposite() override;
85 
86  };
87 }
88 
std::string mWindowTitle
The title of the window.
Definition: PopupWindow.h:130
ConfigDialog(shared_ptr< Rose > parent, const Position &position)
Construct a Window of specified position.
Definition: ConfigDialog.h:64
Present a dialog to allow the user to configure the program.
Definition: ConfigDialog.h:22
ConfigDialog(shared_ptr< Rose > parent)
Construct a Dialog which covers the entire screen.
Definition: ConfigDialog.h:53
A Dialog is a way for the application to have a brief conversation with the user. ...
Definition: Popup.h:62
Close the dialog.
Definition: Constants.h:57
void initializeComposite() override
See Widget::initializeComposite()
Definition: ConfigDialog.cpp:16
A position in integer (x, y) co-ordinates.
Definition: Types.h:95
The data required to creat a DialogActionButton.
Definition: PopupWindow.h:21
ConfigDialog(shared_ptr< Rose > parent, const Position &pos, const Size &size)
Construct a Window of specified position and size.
Definition: ConfigDialog.h:75
A size in integer dimensions.
Definition: Types.h:230
Close the dialog.
Definition: Constants.h:72
ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Wid...
Definition: CelestialOverlay.cpp:13