FLImaging 7.8.25.3
GUIDialogProperty.h
1#pragma once
2
10
11#include "GUIDialog.h"
12#include "GUIPropertyItemBase.h"
13#include <set>
14
16namespace FLImaging
17{
19 namespace GUI
20 {
24 class CGUITreeCtrlBase;
25
33 class FL_EXPORT CGUIDialogProperty : public CGUIDialog
34 {
35 DECLARE_DYNAMIC(CGUIDialogProperty)
36 public:
46 CGUIDialogProperty(CWnd* pParent = nullptr);
47
58
67
77 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
78
90 static CGUIDialogProperty* CreateModelessDialog(CWnd* pParent = nullptr);
91
99 virtual void UpdateFont();
100
108 virtual void OnOK() override;
109
119 virtual BOOL OnInitDialog() override;
120
132 virtual void SetSize(int32_t i32W, int32_t i32H);
133
147 virtual const CResult AddItem(CGUIPropertyItemBase* pItem, bool bAdjustLayout = false);
148
168 template<typename TPropertyItem>
169 TPropertyItem* AddItem(const wchar_t* pWcsName, const wchar_t* pWcsPath = nullptr, const wchar_t* pWcsValue = nullptr, const wchar_t* pWcsDefaultValue = nullptr);
170
192 template<typename TPropertyItem>
193 TPropertyItem* AddItem(ESliderTemplateType eTemplateType, const wchar_t* pWcsName, const wchar_t* pWcsPath = nullptr, const wchar_t* pWcsValue = nullptr, const wchar_t* pWcsDefaultValue = nullptr);
194
214 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);
215
231 virtual const CResult InsertItem(CGUIPropertyItemBase* pItem, const CGUIPropertyItemBase* pItemBefore, bool bAdjustLayout = true);
232
246 virtual const CResult RemoveItem(CGUIPropertyItemBase* pItem, bool bAdjustLayout = true);
247
265 virtual const CResult MoveItem(CGUIPropertyItemBase* pItem, const CGUIPropertyItemBase* pItemNewParent, EAppendPosition eAppendPosition = EAppendPosition_Back, bool bAdjustLayout = true);
266
284 virtual const CResult MoveItem(CGUIPropertyItemBase* pItem, EInsertPosition eInsertPosition, const CGUIPropertyItemBase* pItemInsertPosition, bool bAdjustLayout = true);
285
303 virtual const CResult MoveItem(CGUIPropertyItemBase* pItem, const Base::CFLString<wchar_t>& strParentItemFullPath, EAppendPosition eAppendPosition = EAppendPosition_Back, bool bAdjustLayout = true);
304
322 virtual const CResult MoveItem(CGUIPropertyItemBase* pItem, EInsertPosition eInsertPosition, const Base::CFLString<wchar_t>& strInsertPositionItemFullPath, bool bAdjustLayout = true);
323
335 virtual CGUIPropertyItemBase* FindItemByHash(const uint32_t& u32Hash) const;
336
350 virtual CGUIPropertyItemBase* GetItem(int64_t i64Index) const;
351
371 virtual CGUIPropertyItemBase* FindItemByName(const Base::CFLString<wchar_t>& strName, bool bNocase = true, size_t stIndex = 0) const;
372
390 virtual CGUIPropertyItemBase* FindItemByFullPath(const Base::CFLString<wchar_t>& strFullPath, bool bNocase = true) const;
391
403 bool IsModified(const CGUIPropertyItemBase* pItem) const;
404
416 bool IsModifiedDouble(const CGUIPropertyItemBase* pItem) const;
417
427 virtual std::vector<CGUIPropertyItemBase*>& GetItems() const;
428
438 virtual std::unordered_map<uint32_t, CGUIPropertyItemBase*>& GetItemsHashMap() const;
439
449 void EnableTree(bool bEnable = false);
450
460 bool IsTreeEnabled() const;
461
471 void SetTreeWidth(int32_t i32Width = 200);
472
482 int32_t GetTreeWidth() const;
483
496
509
522
535
547 virtual CGUIPropertyItemCategory* GetTreeItem(int32_t i32CategoryIndex) const;
548
558 virtual const CResult ClearTreeItems();
559
569 virtual std::vector<FLImaging::GUI::CGUIPropertyItemCategory*>& GetTreeItems() const;
570
581
582 virtual const CGUIManagerPropertyItem* GetManagerPropertyItem() const;
583
584 DeclareGetClassType();
585
586 virtual bool AdjustLayoutButton(int32_t i32BtnW, int32_t i32BtnH, int32_t i32BtnMargin, int32_t i32BtnSpace, int32_t i32BtnTop);
587 virtual bool AdjustLayoutProperty(int32_t i32L, int32_t i32T, int32_t& i32PropertyW, int32_t& i32PropertyH);
588
589 protected:
590 virtual bool CreateTree();
591 virtual bool CreateProperty();
592
593 protected:
594 uint32_t m_u32IdWndPropList;
595 CGUIManagerPropertyItem* m_pMgrPI;
596 std::unordered_map<int32_t, Base::CFLString<wchar_t>>& m_mapChangedItems;
597 std::vector<CMFCPropertyGridProperty*>& m_vctProperties;
598 std::set<int32_t> m_setResetItemIdx;
599 CGUIPropertyGridCtrl& m_wndPropList;
600
601 Base::CFLString<wchar_t> m_strTreeRoot;
602 CGUITreeCtrlBase* m_pTree;
603 bool m_bCreateTree;
604 int32_t m_i32TreeWidth;
605 std::vector<CGUIPropertyItemCategory*>& m_vctCatInTree;
606
607 public:
608 DECLARE_MESSAGE_MAP()
609 afx_msg LRESULT OnPropertyChanged(WPARAM wparam, LPARAM lparam);
610 afx_msg void OnDestroy();
611 afx_msg void OnSize(UINT nType, int cx, int cy);
612 afx_msg void OnNMClick(NMHDR* pNMHDR, LRESULT* pResult);
613 virtual BOOL PreTranslateMessage(MSG* pMsg);
614 };
615 }
616}
Broadcast message class.
Definition BroadcastMessage.h:27
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition ResultsDef.h:1704
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 CGUIPropertyItemBase * GetItem(int64_t i64Index) const
Retrieves the item at the specified index.
virtual CGUIPropertyItemBase * FindItemByName(const Base::CFLString< wchar_t > &strName, bool bNocase=true, size_t stIndex=0) const
Finds an item by name.
virtual CGUIPropertyItemBase * FindItemByFullPath(const Base::CFLString< wchar_t > &strFullPath, bool bNocase=true) const
Finds an item by its full path.
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 property 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.
virtual CGUIPropertyItemCategory * GetTreeItem(int32_t i32CategoryIndex) const
Retrieves a property category item from the tree by index.
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:319
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:15460
ESliderTemplateType
Template type of slider.
Definition DefinitionsGUI.h:14586
EAppendPosition
Definition DefinitionsGUI.h:15480
@ EAppendPosition_Back
Definition DefinitionsGUI.h:15485