From f531ff887729783a7fe7a3e12ad12f658eefc7b0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Jun 2020 17:03:28 +0300 Subject: UI classes: - CDlgBase::m_bSucceeded variable introduced to check whether IDOK was pressed or not; - unused/useless buttons with id=IDOK or IDCANCEL removed; - brnOk.OnClick replaced with OnApply calls; - unused/useless calls of EndDialog/EndModal removed; - minor code cleaning --- include/m_gui.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/m_gui.h b/include/m_gui.h index 6b13667a83..5b92502f0b 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -399,7 +399,7 @@ public: __forceinline HINSTANCE GetInst() const { return m_pPlugin.getInst(); } __forceinline HWND GetHwnd() const { return m_hwnd; } __forceinline void Hide() { Show(SW_HIDE); } - __forceinline bool IsInitialized() const { return m_initialized; } + __forceinline bool IsInitialized() const { return m_bInitialized; } __forceinline void SetMinSize(int x, int y) { m_iMinWidth = x, m_iMinHeight = y; } __forceinline void SetParent(HWND hwnd) { m_hwndParent = hwnd; } @@ -411,16 +411,18 @@ protected: HWND m_hwnd = nullptr; // must be the first data item HWND m_hwndParent = nullptr; int m_idDialog; + bool m_isModal = false; - bool m_initialized = false; + bool m_bInitialized = false; bool m_forceResizable = false; + bool m_bSucceeded = false; // was IDOK pressed or not bool m_bExiting = false; // window received WM_CLOSE and gonna die soon - CMPluginBase &m_pPlugin; - enum { CLOSE_ON_OK = 0x1, CLOSE_ON_CANCEL = 0x2 }; BYTE m_autoClose; // automatically close dialog on IDOK/CANCEL commands. default: CLOSE_ON_OK|CLOSE_ON_CANCEL + CMPluginBase &m_pPlugin; + // override this handlers to provide custom functionality // general messages virtual bool OnInitDialog(); @@ -1464,11 +1466,11 @@ class MIR_APP_EXPORT CProtoIntDlgBase : public CDlgBase public: CProtoIntDlgBase(PROTO_INTERFACE *proto, int idDialog); - void CreateLink(CCtrlData& ctrl, const char *szSetting, BYTE type, DWORD iValue); - void CreateLink(CCtrlData& ctrl, const char *szSetting, wchar_t *szValue); + void CreateLink(CCtrlData &ctrl, const char *szSetting, BYTE type, DWORD iValue); + void CreateLink(CCtrlData &ctrl, const char *szSetting, wchar_t *szValue); template - __inline void CreateLink(CCtrlData& ctrl, CMOption &option) + __inline void CreateLink(CCtrlData &ctrl, CMOption &option) { ctrl.CreateDbLink(new CMOptionLink(option)); } -- cgit v1.2.3