CSimpleFilePathParamGuiComp.h
Go to the documentation of this file.
1 #ifndef ifilegui_CSimpleFilePathParamGuiComp_included
2 #define ifilegui_CSimpleFilePathParamGuiComp_included
3 
4 
5 // ACF includes
6 #include <ifile/IFileTypeInfo.h>
7 #include <ifile/IFileNameParam.h>
9 #include <GeneratedFiles/ifilegui/ui_CSimpleFilePathParamGuiComp.h>
10 
11 
12 namespace ifilegui
13 {
14 
15 
17  Ui::CSimpleFilePathParamGuiComp,
18  ifile::IFileNameParam>
19 {
20  Q_OBJECT
21 
22 public:
24  Ui::CSimpleFilePathParamGuiComp,
26 
27  I_BEGIN_COMPONENT(CSimpleFilePathParamGuiComp);
28  I_ASSIGN(m_pathLabelAttrPtr, "PathLabel", "Label for the file editor", false, "Directory");
29  I_ASSIGN(m_startHintAttrPtr, "StartHint", "Start hint for the editor", false, "<Enter path>");
30  I_ASSIGN(m_fileTypeInfoPtr, "FileTypeInfo", "Allows to retrieve optional file type information for file selection dialog", false, "FileTypeInfo");
31  I_ASSIGN(m_readOnlyAttrPtr, "ReadOnly", "True if read only", true, false);
32  I_ASSIGN(m_filesComboAttrPtr, "FilesComboBox", "Show combobox with files", true, true);
33  I_ASSIGN(m_labelWidthAttrPtr, "LabelWidth", "Fixed label width (in pixels)", false, 100);
34  I_ASSIGN(m_defaultDirPtr, "DefaultPath", "Default path to search", false, "C:/");
35  I_ASSIGN(m_showBrowseButtonAttrPtr, "ShowBrowseButton", "If enabled, the browse button will be shown", true, true);
36  I_ASSIGN(m_filePathValidationExpressionAttrPtr, "ValidationExpression", "Regular expression used for path validation", false, "^[/,\\\\,\\w,\\s-]+");
37  I_ASSIGN(m_useSaveDialogAttrPtr, "UseSaveDialog", "Use save dialog instead of open one", true, false);
38  I_ASSIGN(m_updateOnEveryChangeAttrPtr, "UpdateOnEveryTextChange", "If set the model will be updated after every text change, else only if Enter pressed or focus lost", true, false);
39  I_END_COMPONENT;
40 
41 protected:
42  // reimplemented (iqtgui::TGuiObserverWrap)
43  virtual void OnGuiModelAttached();
44  virtual void UpdateModel() const;
45  virtual void UpdateGui(const istd::IChangeable::ChangeSet& changeSet);
46 
47  // reimplemented (iqtgui::CGuiComponentBase)
48  virtual void OnGuiCreated();
49  virtual void OnGuiRetranslate();
50 
51 protected Q_SLOTS:
53  void on_PathEdit_textChanged(const QString& text);
55 
56 private:
57  void SetPathToEditor(const QString& path) const;
58  void OnPathEdited(const QString& path);
59  QString GetPathFromEditor() const;
60  bool IsLabelNeeded() const;
61 
62 private:
63  I_TEXTATTR(m_pathLabelAttrPtr);
64  I_TEXTATTR(m_startHintAttrPtr);
65  I_ATTR(bool, m_readOnlyAttrPtr);
66  I_ATTR(bool, m_filesComboAttrPtr);
67  I_ATTR(int, m_labelWidthAttrPtr);
68  I_ATTR(bool, m_showBrowseButtonAttrPtr);
69  I_ATTR(bool, m_useSaveDialogAttrPtr);
70  I_ATTR(QString, m_filePathValidationExpressionAttrPtr);
71  I_ATTR(bool, m_updateOnEveryChangeAttrPtr);
72  I_REF(ifile::IFileTypeInfo, m_fileTypeInfoPtr);
73  I_REF(ifile::IFileNameParam, m_defaultDirPtr);
74 };
75 
76 
77 } // namespace ifilegui
78 
79 
80 #endif // !ifilegui_CSimpleFilePathParamGuiComp_included
81 
82 
virtual void OnGuiModelAttached()
Called when model is attached and GUI is created.
Provide loading and saving of objects.
Definition: IFileTypeInfo.h:22
iqtgui::TDesignerGuiObserverCompBase< Ui::CSimpleFilePathParamGuiComp, ifile::IFileNameParam > BaseClass
virtual void OnGuiRetranslate()
Called from widget event filter when GUI should be retranslated.
virtual void UpdateGui(const istd::IChangeable::ChangeSet &changeSet)
Do update of the GUI to reflect the state of model.
Common interface for any file system item name (e.g directory, file or URL path)
Base class for all Qt GUI components.
virtual void OnGuiCreated()
Called just after GUI is initialized.
void on_PathEdit_textChanged(const QString &text)
Set of change flags (its IDs).
Definition: IChangeable.h:30
virtual void UpdateModel() const
Do update of the model to reflect the current contents of GUI.

© 2007-2017 Witold Gantzke and Kirill Lepskiy