FLImaging 7.8.25.3
GUIPropertyItemBase.h
1
8#pragma once
9
10#include "DefinitionsGUI.h"
11#include <functional>
12
14namespace FLImaging
15{
17 namespace GUI
18 {
19 class CInternalPermissionManager;
25
191 typedef std::function<void(CGUIPropertyItemBase*,
192 Base::CFLString<wchar_t>&,
194
231 #define MakePropertyCallback [=](CGUIPropertyItemBase* pItem, Base::CFLString<wchar_t>& strValue, const Base::CFLString<wchar_t>& strOrig) -> void
232
288 typedef std::function<void(CGUIPropertyItemBase*,
291
308 #define MakePropertyAdditionalCheckBoxCallback [=](CGUIPropertyItemBase* pItem, ECheckState& eCheckValue, const ECheckState& eCheckValueOrig) -> void
309
310
318 class FL_EXPORT CGUIPropertyItemBase : public Base::CFLBase
319 {
320 public:
329
338
352 virtual bool SetPath(const Base::CFLString<wchar_t>& strPath);
353
366
380 virtual bool SetName(const Base::CFLString<wchar_t>& strName);
381
394
407
421 virtual bool Load(const Base::CFLString<wchar_t>& strFilePath = L"");
422
436 virtual bool Load(const Base::CFLArray<Base::CFLString<wchar_t>>& flaData);
437
451 virtual bool Save(const Base::CFLString<wchar_t>& strFilePath = L"") const;
452
468 virtual bool Save(Base::CFLArray<Base::CFLString<wchar_t>>& flaData) const;
469
479 virtual void SetReadOnly(bool bReadOnly);
480
490 virtual bool IsReadOnly() const;
491
499 virtual void Invalidate();
500
514 virtual bool SetValue(Base::CFLString<wchar_t> strValue, bool bInvokeCallback = true);
515
528
568
579
590
602 virtual bool SetOrigValue(const Base::CFLString<wchar_t>& strValue);
603
613 virtual void SetDefaultValue(const Base::CFLString<wchar_t>& strDefaultValue);
614
625
636 virtual void EnableAutoLoad(bool bAutoLoad = true);
637
647 virtual bool IsAutoLoadEnabled() const;
648
659 virtual void EnableAutoSave(bool bAutoSave = true);
660
670 virtual bool IsAutoSaveEnabled() const;
671
681 virtual void SetDescription(const Base::CFLString<wchar_t>& strDescription);
682
693
703 virtual CMFCPropertyGridProperty* GetGridProperty() const;
704
714 virtual CMFCPropertyGridProperty* CreateGridProperty() = 0;
715
725 virtual uint32_t GetHash() const;
726
736 virtual uint32_t GetParentHash() const;
737
753 virtual bool SetPropertyCallback(CPropertyCallback* pFunc, bool bAutoDestroy = true);
754
767
779 virtual void SetGUIMenuItemProperty(CGUIMenuItemProperty* pMIP);
780
790 virtual CGUIMenuItemProperty* GetGUIMenuItemProperty() const;
791
803 virtual void SetVisible(BOOL bShow, BOOL bAdjustLayout = FALSE);
804
814 virtual bool IsVisible() const;
815
825 virtual bool GetVisibleValue() const;
826
839
849 virtual bool IsInitialized() const;
850
860 virtual void SetInitialized(bool bInit);
861
871 virtual int32_t GetSubItemsCount() const;
872
884 virtual CGUIPropertyItemBase* GetSubItem(int32_t i32Index) const;
885
895 virtual void Enable(bool bEnable);
896
906 virtual bool IsEnabled() const;
907
917 virtual bool IsEffectivelyEnabled() const;
918
928 virtual void EnableInheritanceOfEnablement(bool bEnable = true);
929
940
950 virtual void EnableInheritanceOfVisibility(bool bEnable = true);
951
962
972 virtual void EnableGrayWhileDisabled(bool bGray = true);
973
983 virtual bool IsGrayWhileDisabled() const;
984
1000 virtual void SetMinimalAuthorityLevel(Base::EAuthorityLevel eAuthorityLevel, GUI::EPermission ePermission);
1017
1030
1038 virtual void SetModifiedFlag();
1039
1060
1080 virtual void EnableAdditionalCheckBox(ECheckBoxLocation eLocation, bool bAdditionalCheckBoxValue);
1081
1091 virtual bool IsAdditionalCheckBoxEnabled() const;
1092
1105
1118
1139
1150
1161
1171 virtual void SetAdditionalCheckBoxValue(bool bCheck);
1172
1183
1193 virtual bool GetAdditionalCheckBoxValue() const;
1194
1204 virtual bool Update();
1205
1215 virtual bool IsInsideCallback() const;
1216
1217 virtual const CResult UpdateStyle();
1218
1219 virtual void SetParentWndList(CMFCPropertyGridCtrl* pPGC);
1220 DeclareGetClassType();
1221
1222 virtual void InvokeCallback(Base::CFLString<wchar_t>& strValue);
1223
1224 const CGUIDialogProperty* GetParentDialogProperty() const;
1225
1226 protected:
1227 virtual bool InternalSetPath(const Base::CFLString<wchar_t>& strPath);
1228 virtual bool InternalSetName(const Base::CFLString<wchar_t>& strName);
1229 virtual void InternalSetValue(const COleVariant& varValue, bool bRedrawImmediately);
1230 virtual void InternalSetOrigValue(const COleVariant& varValue);
1231
1232 virtual bool IsSNAPPropertyItem() const;
1233 virtual Base::CFLString<wchar_t> GetSNAPFilePath() const;
1234
1235 virtual const CResult ConvertAbsolutePathToRelativePath(const Base::CFLString<wchar_t>& flsAbsolutePath, Base::CFLString<wchar_t>& flsResultRelativePath) const;
1236 virtual const CResult ConvertRelativePathToAbsolutePath(const Base::CFLString<wchar_t>& flsRelativePath, Base::CFLString<wchar_t>& flsResultAbsolutePath) const;
1237
1238 protected:
1239 Base::CFLString<wchar_t> m_strPath;
1240 Base::CFLString<wchar_t> m_strName;
1241
1242 Base::CFLString<wchar_t> m_strDefaultValue;
1243 Base::CFLString<wchar_t> m_strDescription;
1244
1245 Base::CFLString<wchar_t> m_strPreGridValue; // Value used only before the grid property(m_pGridProperty) is created.
1246
1247 Base::CFLString<wchar_t> m_strBufferValue;
1248 Base::CFLString<wchar_t> m_strPrevBufferValue;
1249
1250 CMFCPropertyGridProperty* m_pGridProperty;
1251 mutable CGUIPropertyGridCtrl* m_pParentPropertyGridCtrl;
1252
1253 CPropertyCallback* m_pPropertyCallback;
1254 CPropertyAdditionalCheckBoxCallback* m_pPropertyAdditionalCheckBoxCallback;
1255 bool m_bPropertyCallbackAutoDestroy;
1256 bool m_bPropertyAdditionalCheckBoxCallbackAutoDestroy;
1257
1258 CGUIMenuItemProperty* m_pGUIMenuItemProperty;
1259 CGUIDialogProperty* m_pParentDialogProperty;
1260
1261 CInternalPermissionManager* m_pInternalPM;
1262
1263 bool m_bInit;
1264 BOOL m_bShow;
1265 bool m_bEnable;
1266 bool m_bAutoLoad;
1267 bool m_bAutoSave;
1268 bool m_bReadOnly;
1269 bool m_bInCallback;
1270
1271 bool m_bInheritanceOfEnablement;
1272 bool m_bInheritanceOfVisibility;
1273 bool m_bEnableGrayWhileDisabled;
1274
1275 bool m_bEnableAdditionalCheckBox;
1276 ECheckState m_eAdditionalCheckBoxValue;
1277 ECheckBoxLocation m_eAdditionalCheckBoxLocation;
1278
1279 EPropertyItemType m_ePropertyItemType;
1280
1281 friend class CGUIPropertyGridCtrl;
1282 friend class CGUIPaneProperties;
1283 friend class CGUIMenuItemProperty;
1284 friend class CInternalPermissionManager;
1285 friend class CGUIPropertyGridPropertyInterface;
1286 friend class CGUIPropertyGridPropertyBase;
1287 friend class CGUIPropertyGridPropertyColor;
1288 friend class CGUIPropertyGridPropertyDraggableSpin;
1289 friend class CGUIDialogPropertyImageFigureDrawingAttribute;
1290 friend class CGUIDialogProperty;
1291 friend class CGUIDialogPropertyObjectFigure;
1292 friend class CGUIDialogPropertyObjectFigureTransform;
1293 friend class CGUIDialogPropertyView3DToolROI;
1294 friend class CGUIManagerPropertyItem;
1295 };
1296 }
1297}
Template type array class.
Definition FLArray.h:71
Top-level base class of FLImaging.
Definition FLBase.h:36
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition ResultsDef.h:1704
The dialog class that provides property grid and tree-based navigation.
Definition GUIDialogProperty.h:34
Manager class responsible for handling CGUIPropertyItemBase objects and synchronizing them with CGUIP...
Definition GUIManagerPropertyItem.h:46
The menu item class associated with the property pane.
Definition GUIMenuItemProperty.h:48
A class of property grid control.
Definition GUIPropertyGridCtrl.h:53
Property item base class.
Definition GUIPropertyItemBase.h:319
virtual FLImaging::GUI::CGUIPropertyGridCtrl * GetParentWndList() const
Returns a pointer to the grid control to which this item belongs.
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 property item.
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 ECheckBoxLocation GetAdditionalCheckBoxLocation() const
Gets the current location of the additional checkbox.
virtual bool IsEffectivelyEnabled() const
Checks whether the object is effectively enabled, taking into account the activation state of its par...
virtual void SetAdditionalCheckBoxValue(ECheckState eCheck)
Sets the checked state of the additional checkbox.
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 property item.
virtual bool IsAdditionalCheckBoxEnabled() const
Checks whether an additional checkbox has been added to this property item.
virtual void SetAdditionalCheckBoxValue(bool bCheck)
Sets the checked state of the additional checkbox.
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 CPropertyAdditionalCheckBoxCallback * GetPropertyAdditionalCheckBoxCallback() const
Gets the currently assigned callback for the additional checkbox.
virtual Base::CFLString< wchar_t > GetName() const
Returns the name of this.
virtual bool GetAdditionalCheckBoxValue() const
Gets the checked state of the additional checkbox.
virtual CMFCPropertyGridProperty * CreateGridProperty()=0
It creates and returns the MFC grid property for this item. If an instance has already been created,...
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 bool SetPropertyAdditionalCheckBoxCallback(CPropertyAdditionalCheckBoxCallback *pFunc, bool bAutoDestroy=true)
Sets a callback function for the additional checkbox interaction.
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 void EnableAdditionalCheckBox(ECheckBoxLocation eLocation, bool bAdditionalCheckBoxValue)
Adds an additional checkbox to the property item. This checkbox is an auxiliary control displayed alo...
virtual CGUIPropertyItemBase * GetSubItem(int32_t i32Index) const
Retrieves a specific sub-item by its index.
virtual bool Update()
Updates internal state or UI and returns the success status.
virtual Base::CFLString< wchar_t > GetFullPath() const
Returns the full path of this as a string, formatted like "Grandparent@Parent@MyName".
virtual ECheckState GetAdditionalCheckState() const
Gets the checked state of the additional checkbox.
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 IsInsideCallback() const
Returns whether the current context is inside a property callback procedure.
virtual bool IsEnabled() const
Checks if the object is enabled.
virtual void EnableAdditionalCheckBox(ECheckBoxLocation eLocation=ECheckBoxLocation_LeftOfName, ECheckState eAdditionalCheckBoxValue=ECheckState_Unchecked)
Adds an additional checkbox to the property item. This checkbox is an auxiliary control displayed alo...
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 void SetModifiedFlag()
Marks the property item as modified.
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 EPropertyItemType GetItemType() const
Returns the type of the property item.
virtual void SetAdditionalCheckBoxLocation(ECheckBoxLocation eLocation=ECheckBoxLocation_LeftOfName)
Sets the location of the additional checkbox.
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
Definition D2DObject.h:12
ECheckBoxLocation
CheckBox Location.
Definition DefinitionsGUI.h:14626
@ ECheckBoxLocation_LeftOfName
Left of name.
Definition DefinitionsGUI.h:14633
EPermission
Permission.
Definition DefinitionsGUI.h:14120
ECheckState
Defines the check states including 3-state logic.
Definition DefinitionsGUI.h:16228
@ ECheckState_Unchecked
Unchecked state.
Definition DefinitionsGUI.h:16235
EPropertyItemType
Definition DefinitionsGUI.h:15232
std::function< void(CGUIPropertyItemBase *, ECheckState &, const ECheckState &)> CPropertyAdditionalCheckBoxCallback
Callback invoked when an item's additional checkbox is toggled.
Definition GUIPropertyItemBase.h:290
std::function< void(CGUIPropertyItemBase *, Base::CFLString< wchar_t > &, const Base::CFLString< wchar_t > &)> CPropertyCallback
Value-change callback invoked from within SetValue().
Definition GUIPropertyItemBase.h:193