ICF 3.1.1.10
Technical documentation of ICF Libraries
CSimpleFilePathParamGuiComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef ifilegui_CSimpleFilePathParamGuiComp_included
7#define ifilegui_CSimpleFilePathParamGuiComp_included
8
9
10// ICF includes
11#include <ifile/IFileTypeInfo.h>
14#include <GeneratedFiles/ifilegui/ui_CSimpleFilePathParamGuiComp.h>
15
16
17namespace ifilegui
18{
19
20
22 Ui::CSimpleFilePathParamGuiComp,
23 ifile::IFileNameParam>
24{
25 Q_OBJECT
26
27public:
29 Ui::CSimpleFilePathParamGuiComp,
31
32 I_BEGIN_COMPONENT(CSimpleFilePathParamGuiComp);
33 I_ASSIGN(m_pathLabelAttrPtr, "PathLabel", "Label for the file editor", false, "Directory");
34 I_ASSIGN(m_startHintAttrPtr, "StartHint", "Start hint for the editor", false, "<Enter path>");
35 I_ASSIGN(m_fileTypeInfoPtr, "FileTypeInfo", "Allows to retrieve optional file type information for file selection dialog", false, "FileTypeInfo");
36 I_ASSIGN(m_filesComboAttrPtr, "FilesComboBox", "Show combobox with files", true, true);
37 I_ASSIGN(m_labelWidthAttrPtr, "LabelWidth", "Fixed label width (in pixels)", false, 100);
38 I_ASSIGN(m_defaultDirPtr, "DefaultPath", "Default path to search", false, "C:/");
39 I_ASSIGN(m_showBrowseButtonAttrPtr, "ShowBrowseButton", "If enabled, the browse button will be shown", true, true);
40 I_ASSIGN(m_filePathValidationExpressionAttrPtr, "ValidationExpression", "Regular expression used for path validation", false, "^[/,\\\\,\\w,\\s-]+");
41 I_ASSIGN(m_useSaveDialogAttrPtr, "UseSaveDialog", "Use save dialog instead of open one", true, false);
42 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);
43 I_END_COMPONENT;
44
45protected:
46 // reimplemented (istdgui::TGuiObserverWrap)
47 void OnGuiModelAttached() override;
48 void UpdateModel() const override;
49 void UpdateGui(const istd::IChangeable::ChangeSet& changeSet) override;
50
51 // reimplemented (istdgui::CGuiComponentBase)
52 void OnGuiCreated() override;
53 void OnGuiRetranslate() override;
54
55protected Q_SLOTS:
57 void on_PathEdit_textChanged(const QString& text);
59
60private:
61 void SetPathToEditor(const QString& path) const;
62 void OnPathEdited(const QString& path);
63 QString GetPathFromEditor() const;
64 bool IsLabelNeeded() const;
65
66private:
67 I_TEXTATTR(m_pathLabelAttrPtr);
68 I_TEXTATTR(m_startHintAttrPtr);
69 I_ATTR(bool, m_filesComboAttrPtr);
70 I_ATTR(int, m_labelWidthAttrPtr);
71 I_ATTR(bool, m_showBrowseButtonAttrPtr);
72 I_ATTR(bool, m_useSaveDialogAttrPtr);
73 I_ATTR(QString, m_filePathValidationExpressionAttrPtr);
74 I_ATTR(bool, m_updateOnEveryChangeAttrPtr);
75 I_REF(ifile::IFileTypeInfo, m_fileTypeInfoPtr);
76 I_REF(ifile::IFileNameParam, m_defaultDirPtr);
77};
78
79
80} // namespace ifilegui
81
82
83#endif // !ifilegui_CSimpleFilePathParamGuiComp_included
84
85
Common interface for any file system item name (e.g directory, file or URL path)
Provide loading and saving of objects.
void OnGuiCreated() override
Called just after GUI is initialized.
void UpdateGui(const istd::IChangeable::ChangeSet &changeSet) override
istdgui::TDesignerGuiObserverCompBase< Ui::CSimpleFilePathParamGuiComp, ifile::IFileNameParam > BaseClass
void on_PathEdit_textChanged(const QString &text)
void OnGuiRetranslate() override
Called from widget event filter when GUI should be retranslated.
Set of change flags (its IDs).
Definition IChangeable.h:38
Base class for all Qt GUI components.
GUI specific interfaces and components for file system access and representation.

© Witold Gantzke and Kirill Lepskiy