FLImaging 6.7.1.3
GUIMenuItemProperty.h
1#pragma once
2
10
11#include "GUIMenuItemBase.h"
12#include "GUIPropertyMessageBox.h"
13#include "GUIStaticText.h"
14#include "GUIDefinitions.h"
15#include <map>
16
18namespace FLImaging
19{
21 namespace GUI
22 {
23 class CGUIPaneProperties;
26 class CGUIPropertyButton;
27 class CGUIPropertyMessageBox;
28 class CGUIStaticText;
29 class CGUIDialogKernel;
30 class CGUIManager;
31 class CGUIPaneFrameWnd;
33
34 typedef std::function<const CResult(int32_t)> CGUIMenuItemRegistrationCallback;
35 #define MakeMenuItemRegistrationCallback [=](int32_t i32Index) -> const CResult
36
37 typedef std::function<const CResult(int32_t)> CGUIMenuItemUnregistrationCallback;
38 #define MakeMenuItemUnregistrationCallback [=](int32_t i32Index) -> const CResult
39
47 class FL_EXPORT CGUIMenuItemProperty : public CGUIMenuItemBase
48 {
49 public:
58
69
80
89
101 virtual const CResult PreDestroy() override;
102
110 virtual void Clear();
111
125 virtual const CResult Assign(const CGUIMenuItemProperty& rhs);
126
140 virtual const CResult Assign(const CGUIMenuItemProperty* pRhs);
141
176
211
221 virtual bool DoesFileExist() const;
222
232 virtual const CResult RemoveSettingFile() const;
233
243 virtual bool Load() override;
244
254 virtual bool IsLoaded() const;
255
269 virtual bool Load(CGUIDialogKernel* pKernel);
270
279 virtual bool Save() const override;
280
294 virtual bool Save(CGUIDialogKernel* pKernel) const;
295
305 virtual bool IsLoading() const;
306
316 virtual void EnableAutoLoad(bool bAutoLoad);
317
327 virtual bool IsAutoLoadEnabled() const;
328
338 virtual void EnableAutoSave(bool bAutoSave);
339
349 virtual bool IsAutoSaveEnabled() const;
350
360 virtual void SetCreateControl(bool bSet = true);
361
371 virtual bool IsCreateControl() const;
372
382 virtual void SetActivateViewOnShowPane(bool bActivate);
383
393 virtual bool DoesActivateViewOnShowPane() const;
394
404 virtual bool OnLButtonDoubleClick();
405
415 virtual bool OnRButtonClick();
416
426 virtual bool ShowPaneWindow();
427
437 virtual bool InitialDockPaneWindow();
438
454 virtual bool AddItem(CGUIPropertyItemBase* pItem, bool bAdjustLayout = true);
455
473 virtual bool InsertItem(CGUIPropertyItemBase* pItem, CGUIPropertyItemBase* pItemBefore, bool bAdjustLayout = true);
474
490 virtual bool RemoveItem(CGUIPropertyItemBase* pItem, bool bAdjustLayout = true);
491
503 virtual const CResult UpdateProperty();
504
516 virtual bool BuildItems(CMFCPropertyGridCtrl* pCtrl);
517
527 virtual int64_t GetItemCount() const;
528
542 virtual int64_t GetItemCountByName(const Base::CFLString<wchar_t>& strName) const;
543
557 virtual CGUIPropertyItemBase* GetItem(int64_t i64Index) const;
558
578 virtual CGUIPropertyItemBase* FindItemByName(const Base::CFLString<wchar_t>& strName, bool bNocase = true, size_t stIndex = 0) const;
579
597 virtual CGUIPropertyItemBase* FindItemByFullPath(const Base::CFLString<wchar_t>& strFullPath, bool bNocase = true) const;
598
610 virtual CGUIPropertyItemBase* FindItemByHash(uint32_t u32Hash) const;
611
630 virtual std::vector<CGUIPropertyItemBase*> FindItemsByPath(const Base::CFLString<wchar_t>& strPath, bool bNocase = true) const;
631
654 virtual const CResult FindItemsByPath(const Base::CFLString<wchar_t>& strPath, std::vector<CGUIPropertyItemBase*>& vctItems, bool bNocase = true) const;
655
667 virtual int64_t GetPropertyItemFigureCount() const;
668
683
697 virtual bool AddButton(CGUIPropertyButton* pButton);
698
716 virtual bool SetShortcut(EKeyType eKeyType, CGUIPropertyButton* pButton);
717
729 std::vector<CGUIPropertyButton*>* GetPropertyButtons() const;
730
746 CGUIPropertyButton* FindPropertyButtonByName(const Base::CFLString<wchar_t>& strBtnName);
747
760 CGUIPropertyButton* FindPropertyButtonByIndex(int64_t i64Index);
761
771 void EnableStatusMessageBox(bool bEnable);
772
783
800
813
825 void SetMessageDisplayMode(EMessageDisplayMode eMessageDisplayMode = EMessageDisplayMode_NoScroll);
826
838 EMessageDisplayMode GetMessageDisplayMode() const;
839
851 virtual bool InitializePropertyPane(bool bLoad = true);
852
868 virtual bool InitializePropertyPaneStandalone(bool bLoad, CWnd* pParentWnd, CGUIDockablePaneHostFrame* pHostFrame = nullptr);
869
881 CGUIPaneProperties* GetPaneProperties() const;
882
898 virtual bool SetMenuItemRegistrationCallback(CGUIMenuItemRegistrationCallback* pFunc, bool bAutoDestroy = true);
899
911 virtual CGUIMenuItemRegistrationCallback* GetRegistrationCallback() const;
912
928 virtual bool SetMenuItemUnregistrationCallback(CGUIMenuItemUnregistrationCallback* pFunc, bool bAutoDestroy = true);
929
941 virtual CGUIMenuItemUnregistrationCallback* GetDestroyInstanceCallback() const;
942
952 virtual bool IsInitialized() const;
953
967 virtual bool DoesSameFullPathExist(const Base::CFLString<wchar_t>& flstrFullPath) const;
968
978 virtual bool CreateProperty();
979
992
1006 virtual CGUIMenuItemProperty* GetChildInstanceAsMenuItemProperty(int32_t i32InstanceIdx) const;
1007
1020
1022
1035 virtual CGUIMenuItemBase* CreateChildInstance(int32_t i32InstanceIdx = -1) override;
1036
1050 virtual const CResult DeleteChildInstance(int32_t i32InstanceIndex) override;
1052
1068 virtual Base::CFLString<wchar_t> GetItemValue(CGUIPropertyItemBase* pItem) const;
1069
1085 virtual const CResult SelectPopupMenuItem(EMenuItemPaneMenuTree eSelectedContextMenu);
1086
1096 void EnableOpenWindow(bool bEnable);
1097
1108
1118 virtual void SetGlobalModel(bool bSet);
1119
1129 virtual bool IsGlobalModel() const;
1130
1140 virtual void Enable(bool bEnable) override;
1141
1157 virtual void SetMinimalAuthorityLevelOnContextMenu(Base::EAuthorityLevel eAuthorityLevel, GUI::EMenuItemPaneMenuTree eMenuItemPaneMenuTree) override;
1158
1170 virtual const CResult DeletePane();
1171
1183 virtual const CResult ClosePane();
1184
1194 virtual bool IsTerminateAppRequested() const;
1195
1205 virtual void RequestTerminateApp(bool bTerminate = true);
1206
1207 virtual Base::CFLString<wchar_t> GetPaneName();
1208
1209 virtual CGUIPaneBase* GetPane() const override;
1210
1211 virtual void SetDockDone(bool bSet);
1212 virtual bool IsDockDone() const;
1213
1214 /* Create Instance*/
1215 virtual CGUIMenuItemProperty* CreateInstance(int32_t i32InstanceIdx = -1);
1216 virtual CGUIMenuItemProperty* LoadToCreateInstance(int32_t i32InstanceIdx = -1);
1217
1218 virtual void UpdateChildProperty();
1219 virtual bool OnShortKeyDown(UINT uKeyType);
1220 virtual const CResult ActivateSelectedViewOfFirstViewList();
1221
1222 CGUIPropertyMessageBox* GetMessageBox() const;
1223
1224 virtual std::vector<CGUIPropertyItemBase*>& GetItems() const;
1225 virtual std::vector<CGUIPropertyButton*>& GetButtons() const;
1226
1227 virtual bool IsItemExist(const CGUIPropertyItemBase* pItem) const;
1228
1229 protected:
1230 virtual bool InternalLoad();
1231 virtual bool InternalSave() const;
1232
1233 protected:
1234 bool m_bDockDone;
1235 /* Property Items*/
1236 std::vector<CGUIPropertyItemBase*>& m_vctItems;
1237 std::vector<CGUIPropertyItemViewImageFigure*>& m_vctPIViewImageFigure;
1238 std::map<uint32_t, CGUIPropertyItemBase*>& m_mapItems;
1239 std::map<EKeyType, CGUIPropertyButton*>& m_mapBtnShortcuts;
1240
1241 /* Buttons*/
1242 std::vector<CGUIPropertyButton*>& m_vctButtons;
1243
1244 /* Message box*/
1245 CGUIPropertyMessageBox* m_pStaticMessage;
1246 Base::CFLString<wchar_t> m_strMessage;
1247
1248 /* Property Pane*/
1249 CGUIPaneProperties* m_pProperties;
1250 bool m_bInitialized;
1251
1252 /* Create Instance*/
1253 bool m_bCreateControl;
1254
1255 CGUIMenuItemRegistrationCallback* m_pRegistrationCallback;
1256 bool m_bCreateCallbackAutoDestroy;
1257
1258 /* Destroy Instance*/
1259 CGUIMenuItemUnregistrationCallback* m_pDestroyInstanceCallback;
1260 bool m_bDestroyCallbackAutoDestroy;
1261
1262 bool m_bLoaded;
1263 bool m_bLoadingNow;
1264 bool m_bAutoLoad;
1265 bool m_bAutoSave;
1266 bool m_bActivateViewOnShowPane;
1267
1268 bool m_bEnableOpenWindow;
1269 bool m_bGlobalModel;
1270
1271 friend class CGUIPaneProperties;
1272 friend class CGUITabbedPane;
1273 friend class CGUIPropertyItemBase;
1274 friend class CGUIManager;
1275 friend class CGUIPaneMenu;
1276 friend class CGUIManagerPane;
1277 friend class CGUIMainFrame;
1278 friend class CGUIPaneFrameWnd;
1279 friend class CGUIPanePropertiesShell;
1280 friend class CGUIPropertyMenuSNAPView;
1281 friend class CGUIManagerModel;
1282 };
1283 }
1284}
1285
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition ResultsDef.h:1596
Definition GUIDialogKernel.h:51
GUIDockablePaneHostFrame class.
Definition GUIDockablePaneHostFrame.h:27
virtual Base::CFLString< wchar_t > GetItemValue(CGUIPropertyItemBase *pItem) const
Retrieves the value of an item.
virtual CGUIPropertyItemBase * GetItem(int64_t i64Index) const
Retrieves the item at the specified index.
virtual int64_t GetPropertyItemFigureCount() const
Retrieves the count of CGUIPropertyItemViewImageFigure items.
virtual bool IsAutoLoadEnabled() const
Checks if auto-load is enabled for the property items.
bool IsEnabledOpenWindow() const
Checks if the open window functionality is enabled.
virtual void Clear()
Clears all the added property items.
virtual const CResult Assign(const CGUIMenuItemProperty *pRhs)
Assigns properties from another CGUIMenuItemProperty object using a pointer.
EMessageDisplayMode GetMessageDisplayMode() const
Retrieves the current message display mode.
virtual bool AddItem(CGUIPropertyItemBase *pItem, bool bAdjustLayout=true)
Function to add a property item to the end of the CGUIPropertyGridCtrl.
virtual bool IsTerminateAppRequested() const
Returns whether a program termination request has been received.
virtual CGUIPropertyItemBase * FindItemByHash(uint32_t u32Hash) const
Finds an item by its hash value.
virtual void EnableAutoLoad(bool bAutoLoad)
Enables or disables the auto-load feature for property items.
CGUIPropertyButton * FindPropertyButtonByName(const Base::CFLString< wchar_t > &strBtnName)
Retrieves a pointer to the CGUIPropertyButton object that matches the given button name.
virtual const CResult UpdateProperty()
Refreshes the property grid screen. It performs the same action as calling GetPaneProperties()->GetPr...
virtual bool OnRButtonClick()
Handles the right button click event.
virtual bool Load() override
Loads the value of property items from a file.
virtual const CResult SelectPopupMenuItem(EMenuItemPaneMenuTree eSelectedContextMenu)
Selects a popup menu item.
void EnableStatusMessageBox(bool bEnable)
Enables or disables the status message box.
virtual int64_t GetItemCount() const
Retrieves the number of property items.
virtual const CResult Assign(const CGUIMenuItemProperty &rhs)
Assigns properties from another CGUIMenuItemProperty object.
virtual const CResult DeletePane()
Deletes the property pane.
virtual bool InitializePropertyPane(bool bLoad=true)
Initializes the property pane.
virtual bool RemoveItem(CGUIPropertyItemBase *pItem, bool bAdjustLayout=true)
Function to remove a property item from CGUIPropertyGridCtrl.
virtual bool AddButton(CGUIPropertyButton *pButton)
Adds a CGUIPropertyButton object.
virtual bool IsCreateControl() const
Returns the flag indicating whether the property grid control should be created.
virtual bool Load(CGUIDialogKernel *pKernel)
Loads kernel values into the specified kernel dialog.
virtual CGUIPropertyItemViewImageFigure * GetPropertyItemFigure(int32_t i32Index) const
Retrieves the pointer to the CGUIPropertyItemViewImageFigure at the specified index.
void EnableOpenWindow(bool bEnable)
Enables or disables the open window functionality.
virtual bool IsAutoSaveEnabled() const
Checks if auto-save is enabled for the property items.
CGUIMenuItemProperty()
Default constructor for CGUIMenuItemProperty.
virtual void Enable(bool bEnable) override
Enables or disables the menu item.
bool IsStatusMessageBoxEnabled() const
Checks if the status message box is enabled.
virtual CGUIMenuItemProperty * GetParentMultiInstanceMenuItemProperty() const
Returns the pointer to the parent object if the current object is a child instance.
virtual bool Save(CGUIDialogKernel *pKernel) const
Saves the values of the kernel dialog.
virtual void SetGlobalModel(bool bSet)
Sets the global model flag.
virtual std::vector< CGUIPropertyItemBase * > FindItemsByPath(const Base::CFLString< wchar_t > &strPath, bool bNocase=true) const
Retrieves items that match the specified path.
virtual const CResult DeleteChildInstance(int32_t i32InstanceIndex) override
Deletes a child instance. This function works only if this is a multi-instance parent.
virtual void SetActivateViewOnShowPane(bool bActivate)
Sets the flag to activate the view when showing the pane.
virtual int64_t GetItemCountByName(const Base::CFLString< wchar_t > &strName) const
Retrieves the count of items by name.
virtual const CResult FindItemsByPath(const Base::CFLString< wchar_t > &strPath, std::vector< CGUIPropertyItemBase * > &vctItems, bool bNocase=true) const
Retrieves items that match the specified path.
virtual bool BuildItems(CMFCPropertyGridCtrl *pCtrl)
Function to initialize the property window and add items to the property pane.
const CResult SetStatusMessage(const Base::CFLString< wchar_t > &strMessage)
Sets the status message to be displayed.
virtual void SetCreateControl(bool bSet=true)
Sets the flag to create the property grid control.
virtual bool InsertItem(CGUIPropertyItemBase *pItem, CGUIPropertyItemBase *pItemBefore, bool bAdjustLayout=true)
Function to insert an item at a specified position, without inserting if pItem already exists.
virtual bool SetShortcut(EKeyType eKeyType, CGUIPropertyButton *pButton)
Assigns a shortcut key to perform the click action of a CGUIPropertyButton.
virtual Base::CFLString< wchar_t > GetFileName() const
Returns the INI file path associated with this object.
virtual CGUIMenuItemBase * CreateChildInstance(int32_t i32InstanceIdx=-1) override
Creates a child instance. This function works only if this is a multi-instance parent....
CGUIMenuItemProperty(const CGUIMenuItemProperty *pRhs)
Pointer-based copy constructor for CGUIMenuItemProperty.
virtual bool ShowPaneWindow()
Shows the pane window.
virtual Base::CFLString< wchar_t > GetChildInstanceIndexAsString() const
Retrieves the child instance numbers as a comma-separated string. For example, if the child instance ...
virtual ~CGUIMenuItemProperty()
Destructor for CGUIMenuItemProperty.
virtual bool DoesSameFullPathExist(const Base::CFLString< wchar_t > &flstrFullPath) const
Checks if an item with the same full path exists.
CGUIPropertyButton * FindPropertyButtonByIndex(int64_t i64Index)
Retrieves a pointer to the CGUIPropertyButton object at the specified index.
virtual bool IsInitialized() const
Checks if the menu item is initialized.
virtual CGUIPropertyItemBase * FindItemByName(const Base::CFLString< wchar_t > &strName, bool bNocase=true, size_t stIndex=0) const
Finds an item by name.
virtual Base::CFLString< wchar_t > GetDirPath() const
Retrieves the directory path associated with this object.
virtual bool OnLButtonDoubleClick()
Handles the left button double-click event.
virtual const CResult RemoveSettingFile() const
Removes the configuration file (e.g., .ini file) associated with this object.
void SetMessageDisplayMode(EMessageDisplayMode eMessageDisplayMode=EMessageDisplayMode_NoScroll)
Sets the message display mode.
virtual void RequestTerminateApp(bool bTerminate=true)
Requests or cancels a program termination.
virtual bool DoesFileExist() const
Checks if the file associated with this exists.
CGUIPaneProperties * GetPaneProperties() const
Retrieves the pane properties.
virtual bool IsGlobalModel() const
Returns whether it is a global model.
virtual const CResult ClosePane()
Closes the property pane.
std::vector< CGUIPropertyButton * > * GetPropertyButtons() const
Retrieves a pointer to the vector containing the added CGUIPropertyButton objects.
virtual void SetMinimalAuthorityLevelOnContextMenu(Base::EAuthorityLevel eAuthorityLevel, GUI::EMenuItemPaneMenuTree eMenuItemPaneMenuTree) override
Sets the minimal authority level for the context menu.
virtual bool DoesActivateViewOnShowPane() const
Checks if the view is activated when showing the pane.
virtual CGUIMenuItemProperty * GetChildInstanceAsMenuItemProperty(int32_t i32InstanceIdx) const
Retrieves a child instance by its index.
virtual bool SetMenuItemRegistrationCallback(CGUIMenuItemRegistrationCallback *pFunc, bool bAutoDestroy=true)
Sets the menu item registration callback.
virtual bool IsLoaded() const
Checks if the value of property items are loaded.
virtual bool IsLoading() const
Checks if the property is currently being loaded.
virtual CGUIPropertyItemBase * FindItemByFullPath(const Base::CFLString< wchar_t > &strFullPath, bool bNocase=true) const
Finds an item by its full path.
CGUIMenuItemProperty(const CGUIMenuItemProperty &rhs)
Copy constructor for CGUIMenuItemProperty.
virtual bool Save() const override
Saves the properties to a file.
virtual bool CreateProperty()
Creates a property.
virtual bool SetMenuItemUnregistrationCallback(CGUIMenuItemUnregistrationCallback *pFunc, bool bAutoDestroy=true)
Sets the menu item unregistration callback.
virtual bool InitializePropertyPaneStandalone(bool bLoad, CWnd *pParentWnd, CGUIDockablePaneHostFrame *pHostFrame=nullptr)
Initializes the standalone property pane (for execution in a standalone DLL environment).
virtual CGUIMenuItemUnregistrationCallback * GetDestroyInstanceCallback() const
Retrieves the destroy instance callback function.
Base::CFLString< wchar_t > GetStatusMessage() const
Retrieves the current status message.
virtual const CResult PreDestroy() override
Performs cleanup operations before the object is destroyed.
virtual bool InitialDockPaneWindow()
Initializes the dock pane window.
virtual void EnableAutoSave(bool bAutoSave)
Enables or disables the auto-save feature for property items. When enabled, changes to the values of ...
virtual CGUIMenuItemRegistrationCallback * GetRegistrationCallback() const
Retrieves the registration callback function.
Property item base class.
Definition GUIPropertyItemBase.h:37
A class of Figure property.
Definition GUIPropertyItemViewImageFigure.h:31
EAuthorityLevel
Authority level.
Definition AuthorityManager.h:29
Definition D2DObject.h:12
EMenuItemPaneMenuTree
Menu items in the menu tree.
Definition GUIDefinitions.h:8963
EKeyType
Keyboard input value.
Definition GUIDefinitions.h:7184