FLImaging 6.5.8.1
GUIPropertyItemBase.h
1
8#pragma once
9
10#include "GUIDefinitions.h"
11#include <functional>
12
14namespace FLImaging
15{
17 namespace GUI
18 {
19 class CInternalPermissionManager;
20 class CGUIMenuItemProperty;
21 class CGUIPropertyItemBase;
22
23 typedef std::function<void(CGUIPropertyItemBase*, Base::CFLString<wchar_t>&, const Base::CFLString<wchar_t>&)> CPropertyCallback;
24#define MakePropertyCallback [=](CGUIPropertyItemBase* pItem, Base::CFLString<wchar_t>& strValue, const Base::CFLString<wchar_t>& strOrig) -> void
25
26 typedef std::function<void(CGUIPropertyItemBase*, bool&, const bool&)> CPropertyAdditionalCheckBoxCallback;
27 #define MakePropertyAdditionalCheckBoxCallback [=](CGUIPropertyItemBase* pItem, bool& bCheckValue, const bool& bCheckValueOrig) -> void
28
36 class FL_EXPORT CGUIPropertyItemBase : public Base::CFLBase
37 {
38 public:
47
56
70 virtual bool SetPath(const Base::CFLString<wchar_t>& strPath);
71
84
98 virtual bool SetName(const Base::CFLString<wchar_t>& strName);
99
112
125
139 virtual bool Load(const Base::CFLString<wchar_t>& strFilePath = L"");
140
154 virtual bool Load(const Base::CFLArray<Base::CFLString<wchar_t>>& flaData);
155
169 virtual bool Save(const Base::CFLString<wchar_t>& strFilePath = L"") const;
170
186 virtual bool Save(Base::CFLArray<Base::CFLString<wchar_t>>& flaData) const;
187
197 virtual void SetReadOnly(bool bReadOnly);
198
208 virtual bool IsReadOnly() const;
209
217 virtual void Invalidate();
218
232 virtual bool SetValue(Base::CFLString<wchar_t> strValue, bool bInvokeCallback = true);
233
246
257
268
279
291 virtual bool SetOrigValue(const Base::CFLString<wchar_t>& strValue);
292
302 virtual void SetDefaultValue(const Base::CFLString<wchar_t>& strDefaultValue);
303
314
325 virtual void EnableAutoLoad(bool bAutoLoad = true);
326
336 virtual bool IsAutoLoadEnabled() const;
337
348 virtual void EnableAutoSave(bool bAutoSave = true);
349
359 virtual bool IsAutoSaveEnabled() const;
360
370 virtual void SetDescription(const Base::CFLString<wchar_t>& strDescription);
371
382
392 virtual CMFCPropertyGridProperty* GetGridProperty() const;
393
403 virtual CMFCPropertyGridProperty* CreateGridProperty() = 0;
404
414 virtual uint32_t GetHash() const;
415
425 virtual uint32_t GetParentHash() const;
426
442 virtual bool SetPropertyCallback(CPropertyCallback* pFunc, bool bAutoDestroy = true);
443
455 virtual CPropertyCallback* GetPropertyCallback() const;
456
469
480
492 virtual void SetVisible(BOOL bShow, BOOL bAdjustLayout = FALSE);
493
503 virtual bool IsVisible() const;
504
514 virtual bool GetVisibleValue() const;
515
525 virtual CMFCPropertyGridCtrl* GetParentWndList() const;
526
536 virtual bool IsInitialized() const;
537
547 virtual void SetInitialized(bool bInit);
548
558 virtual int32_t GetSubItemsCount() const;
559
571 virtual CGUIPropertyItemBase* GetSubItem(int32_t i32Index) const;
572
582 virtual void Enable(bool bEnable);
583
593 virtual bool IsEnabled() const;
594
604 virtual void EnableInheritanceOfEnablement(bool bEnable = true);
605
616
626 virtual void EnableInheritanceOfVisibility(bool bEnable = true);
627
638
648 virtual void EnableGrayWhileDisabled(bool bGray = true);
649
659 virtual bool IsGrayWhileDisabled() const;
660
676 virtual void SetMinimalAuthorityLevel(Base::EAuthorityLevel eAuthorityLevel, GUI::EPermission ePermission);
677
694
695 virtual bool Update();
696 virtual void SetModifiedFlag();
697
698 DeclareGetClassType();
699
700 virtual void AddCheckBox(ECheckBoxLocation eLocation = ECheckBoxLocation_LeftOfName, bool bAdditionalCheckBoxValue = false);
701 virtual bool IsCheckBoxAdded() const;
702 virtual void RemoveAdditionalCheckBoxAdded();
703
704 virtual void SetAdditionalCheckBoxLocation(ECheckBoxLocation eLocation = ECheckBoxLocation_LeftOfName);
705 virtual ECheckBoxLocation GetAdditionalCheckBoxLocation() const;
706
707 virtual void SetAdditionalCheckBoxValue(bool bCheck);
708 virtual bool GetAdditionalCheckBoxValue() const;
709
710 virtual bool SetPropertyAdditionalCheckBoxCallback(CPropertyAdditionalCheckBoxCallback* pFunc, bool bAutoDestroy = true);
711 virtual CPropertyAdditionalCheckBoxCallback* GetPropertyAdditionalCheckBoxCallback() const;
712
713 protected:
714 virtual void InvokeCallback(Base::CFLString<wchar_t>& strValue);
715 virtual void InternalSetValue(const COleVariant& varValue, bool bRedrawImmediate);
716 virtual void InternalSetOrigValue(const COleVariant& varValue);
717
718 protected:
719 Base::CFLString<wchar_t> m_strPath;
720 Base::CFLString<wchar_t> m_strName;
721
722 Base::CFLString<wchar_t> m_strDefaultValue;
723 Base::CFLString<wchar_t> m_strDescription;
724
725 Base::CFLString<wchar_t> m_strInitialValue;
726
727 Base::CFLString<wchar_t> m_strBufferValue;
728 Base::CFLString<wchar_t> m_strPrevBufferValue;
729
730 CMFCPropertyGridProperty* m_pGridProperty;
731
732 CPropertyCallback* m_pPropertyCallback;
733 CPropertyAdditionalCheckBoxCallback* m_pPropertyAdditionalCheckBoxCallback;
734 bool m_bPropertyCallbackAutoDestroy;
735 bool m_bPropertyAdditionalCheckBoxCallbackAutoDestroy;
736
737 CGUIMenuItemProperty* m_pGUIMenuItemProperty;
738
739 CInternalPermissionManager* m_pInternalPM;
740
741 bool m_bInit;
742 BOOL m_bShow;
743 bool m_bEnable;
744 bool m_bAutoLoad;
745 bool m_bAutoSave;
746 bool m_bReadOnly;
747
748 bool m_bInheritanceOfEnablement;
749 bool m_bInheritanceOfVisibility;
750 bool m_bEnableGrayWhileDisabled;
751
752 bool m_bCheckBoxAdded;
753 bool m_bAdditionalCheckBoxValue;
754 ECheckBoxLocation m_eAdditionalCheckBoxLocation;
755
756 friend class CGUIPaneProperties;
757 friend class CGUIMenuItemProperty;
758 friend class CInternalPermissionManager;
759 friend class CGUIPropertyGridPropertyInterface;
760 friend class CGUIPropertyGridPropertyBase;
761 friend class CGUIPropertyGridPropertyColor;
762 friend class CGUIPropertyGridPropertyDraggableSpin;
763 friend class CGUIDialogPropertyImageFigureDrawingAttribute;
764 friend class CGUIDialogProperty;
765 friend class CGUIDialogPropertyObjectFigure;
766 friend class CGUIDialogPropertyObjectFigureTransform;
767 friend class CGUIDialogPropertyView3DToolROI;
768 };
769 }
770}
Template type array class.
Definition RangeTree.h:19
Top-level base class of FLImaging.
Definition FLBase.h:36
Template type string class.
Definition INIUtilities.h:20
The menu item class associated with the property pane.
Definition GUIMenuItemProperty.h:48
Property item base class.
Definition GUIPropertyItemBase.h:37
virtual void Invalidate()
Invalidates the area corresponding to this on the screen, forcing a redraw.
virtual bool SetName(const Base::CFLString< wchar_t > &strName)
Sets the name of this.
virtual Base::EAuthorityLevel GetMinimalAuthorityLevel(GUI::EPermission ePermission) const
Returns the minimal permission level required to view, execute, or modify this.
virtual bool SetPath(const Base::CFLString< wchar_t > &strPath)
Sets the parent path of this. It should be set in the format like "Grandparent@Parent".
virtual uint32_t GetHash() const
Returns the hash value of this.
virtual void SetDescription(const Base::CFLString< wchar_t > &strDescription)
Sets the description of this.
virtual bool SetPropertyCallback(CPropertyCallback *pFunc, bool bAutoDestroy=true)
Sets a callback function for the property.
virtual void EnableInheritanceOfEnablement(bool bEnable=true)
Enables or disables inheritance of the enablement state for the object.
virtual Base::CFLString< wchar_t > GetValue() const
Returns the current value of this.
virtual bool Save(const Base::CFLString< wchar_t > &strFilePath=L"") const
Saves the value of this to an ini file.
virtual void EnableAutoSave(bool bAutoSave=true)
Enables or disables the auto-save feature for this. Auto-save is a feature that automatically saves t...
virtual Base::CFLString< wchar_t > GetName() const
Returns the name of this.
virtual CMFCPropertyGridProperty * CreateGridProperty()=0
Creates and returns a new grid property associated with this.
virtual CMFCPropertyGridCtrl * GetParentWndList() const
Returns a pointer to the grid control to which this item belongs.
virtual bool IsAutoLoadEnabled() const
Checks if auto-Load is enabled for this.
CGUIPropertyItemBase()
Default constructor.
virtual void SetMinimalAuthorityLevel(Base::EAuthorityLevel eAuthorityLevel, GUI::EPermission ePermission)
Sets the minimal permission level required to view, execute, or modify this.
virtual CPropertyCallback * GetPropertyCallback() const
Retrieves the callback function associated with the property.
virtual bool GetVisibleValue() const
Returns the value (m_bShow) set by SetVisible(). Even if SetVisible(true) is set, the item may be hid...
virtual bool Load(const Base::CFLString< wchar_t > &strFilePath=L"")
Loads the value of this from an ini file.
virtual void SetDefaultValue(const Base::CFLString< wchar_t > &strDefaultValue)
Sets the default value of this.
virtual Base::CFLString< wchar_t > GetBufferValue() const
Returns the current buffer value of this.
virtual bool IsGrayWhileDisabled() const
Returns whether a disabled property item is displayed in grayscale. If true, the disabled property it...
virtual bool SetValue(Base::CFLString< wchar_t > strValue, bool bInvokeCallback=true)
Sets the value for this.
virtual int32_t GetSubItemsCount() const
Gets the count of sub-items contained within the object.
virtual Base::CFLString< wchar_t > GetDefaultValue() const
Returns the default value of this.
virtual bool SetBufferValue(Base::CFLString< wchar_t > strValue)
Sets the buffer value of this.
virtual bool IsInheritanceOfEnablementEnabled() const
Checks if inheritance of the enablement state is enabled.
virtual CMFCPropertyGridProperty * GetGridProperty() const
Returns a pointer to the grid property associated with this.
virtual bool IsInheritanceOfVisibilityEnabled() const
Checks if inheritance of the visibility state is enabled.
virtual Base::CFLString< wchar_t > GetPrevBufferValue() const
Returns the previous buffer value of this.
virtual ~CGUIPropertyItemBase()
Destructor for CGUIPropertyItemBase class.
virtual void EnableInheritanceOfVisibility(bool bEnable=true)
Enables or disables inheritance of the visibility state for the object.
virtual void SetVisible(BOOL bShow, BOOL bAdjustLayout=FALSE)
Displays or hides this in the PropertyGridCtrl. If bAdjustLayout is FALSE, you must explicitly call G...
virtual void EnableAutoLoad(bool bAutoLoad=true)
Enables or disables the auto-load feature for this. Auto-load is a feature that loads and sets values...
virtual bool Load(const Base::CFLArray< Base::CFLString< wchar_t > > &flaData)
Loads the value of this from a string array.
virtual bool SetOrigValue(const Base::CFLString< wchar_t > &strValue)
Sets the original value of this.
virtual bool IsInitialized() const
Checks if the object is initialized.
virtual void SetGUIMenuItemProperty(CGUIMenuItemProperty *pMIP)
Sets the GUI menu item property associated with the object.
virtual CGUIPropertyItemBase * GetSubItem(int32_t i32Index) const
Retrieves a specific sub-item by its index.
virtual Base::CFLString< wchar_t > GetFullPath() const
Returns the full path of this as a string, formatted like "Grandparent@Parent@MyName".
virtual void SetInitialized(bool bInit)
Sets the initialization state of the object.
virtual bool IsReadOnly() const
Returns whether this is set as read-only. If true, this is read-only; if false, it is editable.
virtual bool IsVisible() const
Returns the visibility state of this. Even if SetVisible(true) is called, the item may be hidden base...
virtual bool IsEnabled() const
Checks if the object is enabled.
virtual uint32_t GetParentHash() const
Returns the hash value of the parent of this.
virtual void EnableGrayWhileDisabled(bool bGray=true)
Sets whether a disabled property item is displayed in grayscale. If true, the disabled property item ...
virtual bool Save(Base::CFLArray< Base::CFLString< wchar_t > > &flaData) const
Function to record the value of this in INI data array.
virtual void SetReadOnly(bool bReadOnly)
Sets whether this is read-only. If set to true, the item becomes non-editable; if false,...
virtual void Enable(bool bEnable)
Enables or disables the object.
virtual CGUIMenuItemProperty * GetGUIMenuItemProperty() const
Retrieves the GUI menu item property associated with the object.
virtual Base::CFLString< wchar_t > GetDescription() const
Returns the description of this.
virtual bool IsAutoSaveEnabled() const
Checks if auto-save is enabled for this.
virtual Base::CFLString< wchar_t > GetPath() const
Returns the parent path of this.
EAuthorityLevel
Authority level.
Definition AuthorityManager.h:29
ECheckBoxLocation
CheckBox Location.
Definition GUIDefinitions.h:9966
EPermission
Permission.
Definition GUIDefinitions.h:9460