FLImaging 7.4.14.3
GUIDialogProperty.h
1#pragma once
2
3#include "GUIDialog.h"
4#include "GUIPropertyItemBase.h"
5#include <set>
6
8namespace FLImaging
9{
11 namespace GUI
12 {
16 class CGUITreeCtrlBase;
17
25 class FL_EXPORT CGUIDialogProperty : public CGUIDialog
26 {
27 DECLARE_DYNAMIC(CGUIDialogProperty)
28 public:
38 CGUIDialogProperty(CWnd* pParent = nullptr);
39
50
59
69 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
70
82 static CGUIDialogProperty* CreateModelessDialog(CWnd* pParent = nullptr);
83
91 virtual void UpdateFont();
92
100 virtual void OnOK() override;
101
111 virtual BOOL OnInitDialog() override;
112
124 virtual void SetSize(int32_t i32W, int32_t i32H);
125
139 virtual const CResult AddItem(CGUIPropertyItemBase* pItem, bool bAdjustLayout = false);
140
160 template<typename TPropertyItem>
161 TPropertyItem* AddItem(const wchar_t* pWcsName, const wchar_t* pWcsPath = nullptr, const wchar_t* pWcsValue = nullptr, const wchar_t* pWcsDefaultValue = nullptr);
162
184 template<typename TPropertyItem>
185 TPropertyItem* AddItem(ESliderTemplateType eTemplateType, const wchar_t* pWcsName, const wchar_t* pWcsPath = nullptr, const wchar_t* pWcsValue = nullptr, const wchar_t* pWcsDefaultValue = nullptr);
186
206 virtual CGUIPropertyItemText* AddItem(const Base::CFLString<wchar_t>& flstrName, const Base::CFLString<wchar_t>& flstrPath, const Base::CFLString<wchar_t>& flstrValue, CGUIEditBase::EInputType eInputType, bool bReadOnly = false);
207
223 virtual const CResult InsertItem(CGUIPropertyItemBase* pItem, const CGUIPropertyItemBase* pItemBefore, bool bAdjustLayout = true);
224
238 virtual const CResult RemoveItem(CGUIPropertyItemBase* pItem, bool bAdjustLayout = true);
239
257 virtual const CResult MoveItem(CGUIPropertyItemBase* pItem, const CGUIPropertyItemBase* pItemNewParent, EAppendPosition eAppendPosition = EAppendPosition_Back, bool bAdjustLayout = true);
258
276 virtual const CResult MoveItem(CGUIPropertyItemBase* pItem, EInsertPosition eInsertPosition, const CGUIPropertyItemBase* pItemInsertPosition, bool bAdjustLayout = true);
277
295 virtual const CResult MoveItem(CGUIPropertyItemBase* pItem, const Base::CFLString<wchar_t>& strParentItemFullPath, EAppendPosition eAppendPosition = EAppendPosition_Back, bool bAdjustLayout = true);
296
314 virtual const CResult MoveItem(CGUIPropertyItemBase* pItem, EInsertPosition eInsertPosition, const Base::CFLString<wchar_t>& strInsertPositionItemFullPath, bool bAdjustLayout = true);
315
327 virtual CGUIPropertyItemBase* FindItemByHash(const uint32_t& u32Hash) const;
328
340 bool IsModified(const CGUIPropertyItemBase* pItem) const;
341
353 bool IsModifiedDouble(const CGUIPropertyItemBase* pItem) const;
354
364 virtual std::vector<CGUIPropertyItemBase*>& GetItems() const;
365
375 virtual std::unordered_map<uint32_t, CGUIPropertyItemBase*>& GetItemsHashMap() const;
376
386 void EnableTree(bool bEnable = false);
387
397 bool IsTreeEnabled() const;
398
408 void SetTreeWidth(int32_t i32Width = 200);
409
419 int32_t GetTreeWidth() const;
420
433
446
459
472
482 virtual const CResult ClearTreeItems();
483
493 virtual std::vector<FLImaging::GUI::CGUIPropertyItemCategory*>& GetTreeItems() const;
494
505
506 DeclareGetClassType();
507
508 virtual bool AdjustLayoutButton(int32_t i32BtnW, int32_t i32BtnH, int32_t i32BtnMargin, int32_t i32BtnSpace, int32_t i32BtnTop);
509 virtual bool AdjustLayoutProperty(int32_t i32L, int32_t i32T, int32_t& i32PropertyW, int32_t& i32PropertyH);
510
511 protected:
512 virtual bool CreateTree();
513 virtual bool CreateProperty();
514
515 protected:
516 uint32_t m_u32IdWndPropList;
517 CGUIManagerPropertyItem* m_pMgrPI;
518 std::unordered_map<int32_t, Base::CFLString<wchar_t>>& m_mapChangedItems;
519 std::vector<CMFCPropertyGridProperty*>& m_vctProperties;
520 std::set<int32_t> m_setResetItemIdx;
521 CGUIPropertyGridCtrl& m_wndPropList;
522
523 Base::CFLString<wchar_t> m_strTreeRoot;
524 CGUITreeCtrlBase* m_pTree;
525 bool m_bCreateTree;
526 int32_t m_i32TreeWidth;
527 std::vector<CGUIPropertyItemCategory*>& m_vctCatInTree;
528
529 public:
530 DECLARE_MESSAGE_MAP()
531 afx_msg LRESULT OnPropertyChanged(WPARAM wparam, LPARAM lparam);
532 afx_msg void OnDestroy();
533 afx_msg void OnSize(UINT nType, int cx, int cy);
534 afx_msg void OnNMClick(NMHDR* pNMHDR, LRESULT* pResult);
535 virtual BOOL PreTranslateMessage(MSG* pMsg);
536 };
537 }
538}
Broadcast message class.
Definition BroadcastMessage.h:27
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition ResultsDef.h:1676
CGUIDialog(CWnd *pParent=nullptr)
Default constructor.
virtual void OnOK() override
Event handler for the OK button.
virtual ~CGUIDialogProperty()
Destructor for CGUIDialogProperty.
virtual const CResult MoveItem(CGUIPropertyItemBase *pItem, const Base::CFLString< wchar_t > &strParentItemFullPath, EAppendPosition eAppendPosition=EAppendPosition_Back, bool bAdjustLayout=true)
Moves an existing property item using the parent's full path.
virtual CGUIPropertyItemBase * FindItemByHash(const uint32_t &u32Hash) const
Finds a property item using its hash value.
virtual const CResult MoveItem(CGUIPropertyItemBase *pItem, EInsertPosition eInsertPosition, const CGUIPropertyItemBase *pItemInsertPosition, bool bAdjustLayout=true)
Moves an existing property item relative to a reference item.
CGUIPropertyGridCtrl * GetPropertyGridCtrl()
Returns the property grid control.
virtual const CResult ClearTreeItems()
Clears all items from the tree navigation.
bool IsTreeEnabled() const
Checks if the tree navigation feature is enabled.
CGUIDialogProperty(CWnd *pParent=nullptr)
Default constructor for CGUIDialogProperty.
virtual BOOL OnInitDialog() override
Initializes the dialog and its controls.
virtual std::vector< CGUIPropertyItemBase * > & GetItems() const
Retrieves the list of all property items.
CGUIDialogProperty(const CGUIDialogProperty &rhs)
Copy constructor for CGUIDialogProperty.
virtual std::vector< FLImaging::GUI::CGUIPropertyItemCategory * > & GetTreeItems() const
Retrieves the list of category items added to the tree.
int32_t GetTreeWidth() const
Retrieves the width of the tree navigation pane.
bool IsModified(const CGUIPropertyItemBase *pItem) const
Checks if the value of the property item has been modified.
void SetTreeRootItemText(const Base::CFLString< wchar_t > &strRoot)
Sets the text for the root item of the tree. The default value is the dialog title.
virtual void SetSize(int32_t i32W, int32_t i32H)
Sets the size of the dialog.
virtual const CResult InsertItem(CGUIPropertyItemBase *pItem, const CGUIPropertyItemBase *pItemBefore, bool bAdjustLayout=true)
Inserts a property item before a specific item.
const CResult AddCategoryToTree(CGUIPropertyItemCategory *pCategory)
Adds a property category item to the tree navigation.
TPropertyItem * AddItem(const wchar_t *pWcsName, const wchar_t *pWcsPath=nullptr, const wchar_t *pWcsValue=nullptr, const wchar_t *pWcsDefaultValue=nullptr)
Function to add a property item of a specific type.
virtual void UpdateFont()
Updates the font of the dialog and its controls.
virtual const CResult AddItem(CGUIPropertyItemBase *pItem, bool bAdjustLayout=false)
Adds a property item.
virtual const CResult RemoveItem(CGUIPropertyItemBase *pItem, bool bAdjustLayout=true)
Removes a property item.
virtual void OnReceiveBroadcast(const Base::CBroadcastMessage *pMessage) override
Receives and handles broadcast messages.
virtual const CResult RemoveTreeItem(CGUIPropertyItemCategory *pCategory)
Removes a category item from the tree navigation.
virtual std::unordered_map< uint32_t, CGUIPropertyItemBase * > & GetItemsHashMap() const
Retrieves the hash map of property items.
virtual CGUIPropertyItemText * AddItem(const Base::CFLString< wchar_t > &flstrName, const Base::CFLString< wchar_t > &flstrPath, const Base::CFLString< wchar_t > &flstrValue, CGUIEditBase::EInputType eInputType, bool bReadOnly=false)
Function to add a text-type property item.
Base::CFLString< wchar_t > GetTreeRootItemText()
Returns the text of the tree's root item.
static CGUIDialogProperty * CreateModelessDialog(CWnd *pParent=nullptr)
Creates a modeless dialog instance.
void SetTreeWidth(int32_t i32Width=200)
Sets the width of the tree navigation pane.
virtual const CResult MoveItem(CGUIPropertyItemBase *pItem, EInsertPosition eInsertPosition, const Base::CFLString< wchar_t > &strInsertPositionItemFullPath, bool bAdjustLayout=true)
Moves an existing property item relative to a reference item specified by full path.
virtual const CResult MoveItem(CGUIPropertyItemBase *pItem, const CGUIPropertyItemBase *pItemNewParent, EAppendPosition eAppendPosition=EAppendPosition_Back, bool bAdjustLayout=true)
Moves an existing property item under a new parent item.
void EnableTree(bool bEnable=false)
Enables or disables the tree navigation feature.
TPropertyItem * AddItem(ESliderTemplateType eTemplateType, const wchar_t *pWcsName, const wchar_t *pWcsPath=nullptr, const wchar_t *pWcsValue=nullptr, const wchar_t *pWcsDefaultValue=nullptr)
Function to add a slider-type property item.
bool IsModifiedDouble(const CGUIPropertyItemBase *pItem) const
Checks if the value of the property item has been modified (specifically for double type comparison).
EInputType
Input type.
Definition GUIEditBase.h:40
Manager class responsible for handling CGUIPropertyItemBase objects and synchronizing them with CGUIP...
Definition GUIManagerPropertyItem.h:46
A class of property grid control.
Definition GUIPropertyGridCtrl.h:53
Property item base class.
Definition GUIPropertyItemBase.h:318
Category property item that can contain sub-items and optionally behave as a value list.
Definition GUIPropertyItemCategory.h:26
Property-grid item for single-line text input with validation, tooltip, and real-time callback suppor...
Definition GUIPropertyItemText.h:40
Definition D2DObject.h:12
EInsertPosition
Definition DefinitionsGUI.h:12150
ESliderTemplateType
Template type of slider.
Definition DefinitionsGUI.h:11276
EAppendPosition
Definition DefinitionsGUI.h:12170
@ EAppendPosition_Back
Definition DefinitionsGUI.h:12175