COptionsManagerEditorComp.h
Go to the documentation of this file.
1 #ifndef iqtprm_COptionsManagerEditorComp_included
2 #define iqtprm_COptionsManagerEditorComp_included
3 
4 
5 //Qt includes
6 #include <QtCore/QtGlobal>
7 #if QT_VERSION >= 0x050000
8 #include <QtWidgets/QMenu>
9 #else
10 #include <QtGui/QMenu>
11 #endif
12 
13 // ACF includes
14 #include <ifile/IFilePersistence.h>
15 #include <iprm/IOptionsManager.h>
17 
18 #include <GeneratedFiles/iqtprm/ui_COptionsManagerEditorComp.h>
19 
20 
21 namespace iqtprm
22 {
23 
24 
26  Ui::COptionsManagerEditorComp,
27  iprm::IOptionsManager>
28 {
29  Q_OBJECT
30 
31 public:
33  Ui::COptionsManagerEditorComp,
35 
36  I_BEGIN_COMPONENT(COptionsManagerEditorComp);
37  I_ASSIGN(m_allowAddRemoveAttrPtr, "AllowAddRemove", "If it is false, 'Add' and 'Remove' buttons will be always hidden", true, true);
38  I_ASSIGN(m_allowUpDownAttrPtr, "AllowUpDown", "If it is false, 'Up' and 'Down' buttons will be always hidden", true, true);
39  I_ASSIGN(m_iconSizeAttrPtr, "IconSize", "Size for page icons", false, 32);
40  I_ASSIGN(m_defaultOptionNameAttrPtr, "DefaultOptionName", "Default name of parameter set. Use %1 to insert automatic enumeration", true, "Option %1");
41  I_ASSIGN(m_paramsLoaderCompPtr, "ParamsLoader", "Loader for the parameter set", false, "ParamsLoader");
42  I_END_COMPONENT;
43 
45 
46 protected Q_SLOTS:
47  void on_AddButton_clicked();
49  void on_UpButton_clicked();
50  void on_DownButton_clicked();
52  void on_OptionsList_itemChanged(QListWidgetItem* item);
55 
56 protected:
57  void UpdateActions();
58  void UpdateList();
59  int GetSelectedIndex() const;
60  void EnsureSelectedIndexUpdated() const;
61  QByteArray GetSelectedParamsSetTypeId() const;
62 
63  QString CalculateNewDefaultName() const;
64 
65  // reimplemented (iqtgui::TGuiObserverWrap)
66  virtual void OnGuiModelAttached();
67  virtual void OnGuiModelDetached();
68  virtual void UpdateGui(const istd::IChangeable::ChangeSet& changeSet);
69 
70  // reimplemented (iqtgui::CComponentBase)
71  virtual void OnGuiCreated();
72 
73 private:
74  void UpdateButtonsVisibility();
75 
76 private:
77  I_ATTR(bool, m_allowAddRemoveAttrPtr);
78  I_ATTR(bool, m_allowUpDownAttrPtr);
79  I_ATTR(int, m_iconSizeAttrPtr);
80  I_TEXTATTR(m_defaultOptionNameAttrPtr);
81  I_REF(ifile::IFilePersistence, m_paramsLoaderCompPtr);
82 
83  mutable int m_lastSelectedIndex;
84 };
85 
86 
87 } // namespace iqtprm
88 
89 
90 #endif // !iqtprm_COptionsManagerEditorComp_included
91 
92 
virtual void OnGuiModelAttached()
Called when model is attached and GUI is created.
virtual void OnGuiCreated()
Called just after GUI is initialized.
iqtgui::TDesignerGuiObserverCompBase< Ui::COptionsManagerEditorComp, iprm::IOptionsManager > BaseClass
virtual void UpdateGui(const istd::IChangeable::ChangeSet &changeSet)
Do update of the GUI to reflect the state of model.
Common interface for the management of the dynamic selection constraints.
void on_OptionsList_itemChanged(QListWidgetItem *item)
QString CalculateNewDefaultName() const
Base class for all Qt GUI components.
Set of change flags (its IDs).
Definition: IChangeable.h:30
Interface providing loading and saving of data objects.
QByteArray GetSelectedParamsSetTypeId() const
virtual void OnGuiModelDetached()
Called when model is detached or GUI is destroyed.

© 2007-2017 Witold Gantzke and Kirill Lepskiy