diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-11 17:09:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-11 17:09:17 +0300 |
commit | b2c91edc9646daa331de71d589e4fec6bdef4945 (patch) | |
tree | 847a77d0686d26e25b126313fbaa8262c81f8d1a /plugins/TabSRMM | |
parent | ae081843e9663b3cb36b17309fbce1d2967315f1 (diff) |
GUI change:
- methods OnInitDialog, OnApply & OnClose of CDlgBase now return true if successful. return of false prevents a dialog from being loaded or left respectively;
- massive code cleaning considering the 'virtual' attribute of overridden methods;
- also fixes #1476 (Don't close "Create new account" window if user not set account name)
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/chat_options.cpp | 26 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_window.cpp | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgoptions.cpp | 54 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.h | 50 | ||||
-rw-r--r-- | plugins/TabSRMM/src/templates.cpp | 3 |
7 files changed, 83 insertions, 59 deletions
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 24a17cb92a..67390c9a5e 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -600,7 +600,7 @@ public: treeCheck(this, IDC_CHECKBOXES)
{}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
SetWindowLongPtr(treeCheck.GetHwnd(), GWL_STYLE, GetWindowLongPtr(treeCheck.GetHwnd(), GWL_STYLE) | (TVS_NOHSCROLL));
@@ -615,9 +615,10 @@ public: ptrW pszGroup(db_get_wsa(0, CHAT_MODULE, "AddToGroup"));
SetDlgItemText(m_hwnd, IDC_GROUP, (pszGroup != nullptr) ? pszGroup : TranslateT("Chat rooms"));
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
int iLen = GetWindowTextLength(GetDlgItem(m_hwnd, IDC_GROUP));
if (iLen > 0) {
@@ -630,6 +631,7 @@ public: SaveBranch(branch1, _countof(branch1));
SaveBranch(branch2, _countof(branch2));
+ return true;
}
void OnDestroy() override
@@ -643,7 +645,7 @@ public: TreeViewDestroy(treeCheck.GetHwnd());
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom == IDC_CHECKBOXES)
return TreeViewHandleClick(m_hwnd, ((LPNMHDR)lParam)->hwndFrom, wParam, lParam);
@@ -678,7 +680,7 @@ public: m_timer.OnEvent = Callback(this, &CChatLogOptionDlg::onTimer);
}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
SendDlgItemMessage(m_hwnd, IDC_CHAT_SPIN2, UDM_SETRANGE, 0, MAKELONG(5000, 0));
SendDlgItemMessage(m_hwnd, IDC_CHAT_SPIN2, UDM_SETPOS, 0, MAKELONG(db_get_w(0, CHAT_MODULE, "LogLimit", 100), 0));
@@ -731,9 +733,10 @@ public: hPathTip = CreateToolTip(GetDlgItem(m_hwnd, IDC_LOGDIRECTORY), tszTooltipText, TranslateT("Variables"));
if (hPathTip)
m_timer.Start(3000);
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
char *pszText = nullptr;
@@ -800,6 +803,7 @@ public: if (g_chatApi.hListBkgBrush)
DeleteObject(g_chatApi.hListBkgBrush);
g_chatApi.hListBkgBrush = CreateSolidBrush(M.GetDword(CHAT_MODULE, "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
+ return true;
}
void OnDestroy() override
@@ -922,7 +926,7 @@ public: CChatBaseOptionDlg(IDD_OPTIONS3)
{}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
DWORD dwFilterFlags = M.GetDword(CHAT_MODULE, "FilterFlags", GC_EVENT_ALL);
DWORD dwTrayFlags = M.GetDword(CHAT_MODULE, "TrayIconFlags", GC_EVENT_HIGHLIGHT);
@@ -945,9 +949,10 @@ public: SendDlgItemMessage(m_hwnd, IDC_LOGICONTYPE, CB_SETCURSEL, (g_Settings.bLogSymbols ? 2 : (g_Settings.dwIconFlags ? 1 : 0)), 0);
CheckDlgButton(m_hwnd, IDC_TRAYONLYFORINACTIVE, M.GetByte(CHAT_MODULE, "TrayIconInactiveOnly", 0) ? BST_CHECKED : BST_UNCHECKED);
+ return true;
}
- void OnApply() override
+ bool OnApply() override
{
DWORD dwFilterFlags = 0, dwTrayFlags = 0,
dwPopupFlags = 0, dwLogFlags = 0;
@@ -971,6 +976,7 @@ public: db_set_b(0, CHAT_MODULE, "LogSymbols", lr == 2 ? 1 : 0);
db_set_b(0, CHAT_MODULE, "TrayIconInactiveOnly", IsDlgButtonChecked(m_hwnd, IDC_TRAYONLYFORINACTIVE) ? 1 : 0);
+ return true;
}
};
@@ -994,7 +1000,7 @@ public: chkText.OnChange = Callback(this, &CHighlighOptionDlg::onChange_Text);
}
- void OnInitDialog() override
+ bool OnInitDialog() override
{
ptrW wszText(db_get_wsa(0, CHAT_MODULE, "HighlightWords"));
if (wszText)
@@ -1011,6 +1017,7 @@ public: ::CheckDlgButton(m_hwnd, IDC_HIGHLIGHTNICKUID, dwFlags & CMUCHighlight::MATCH_UIN ? BST_CHECKED : BST_UNCHECKED);
::CheckDlgButton(m_hwnd, IDC_HIGHLIGHTME, M.GetByte(CHAT_MODULE, "HighlightMe", 1) ? BST_CHECKED : BST_UNCHECKED);
+ return true;
}
void onChange_Text(CCtrlCheck*)
@@ -1027,7 +1034,7 @@ public: Utils::enableDlgControl(m_hwnd, IDC_HIGHLIGHTNICKUID, chkNick.GetState());
}
- void OnApply() override
+ bool OnApply() override
{
db_set_ws(0, CHAT_MODULE, "HighlightNames", ptrW(edtNick.GetText()));
db_set_ws(0, CHAT_MODULE, "HighlightWords", ptrW(edtText.GetText()));
@@ -1039,6 +1046,7 @@ public: db_set_b(0, CHAT_MODULE, "HighlightEnabled", dwFlags);
db_set_b(0, CHAT_MODULE, "HighlightMe", ::IsDlgButtonChecked(m_hwnd, IDC_HIGHLIGHTME) ? 1 : 0);
g_Settings.Highlight->init();
+ return true;
}
};
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index 1f2e3d9920..f28927637e 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -497,7 +497,7 @@ void CChatRoomDlg::tabClearLog() } } -void CChatRoomDlg::OnInitDialog() +bool CChatRoomDlg::OnInitDialog() { CTabBaseDlg::OnInitDialog(); @@ -566,6 +566,7 @@ void CChatRoomDlg::OnInitDialog() UpdateNickList(); m_pContainer->m_hwndActive = m_hwnd; NotifyEvent(MSG_WINDOW_EVT_OPEN); + return true; } void CChatRoomDlg::OnDestroy() diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 4c7ddf8301..b63fe36d79 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -603,7 +603,7 @@ CThumbBase* CSrmmWindow::tabCreateThumb(CProxyWindow *pProxy) const return new CThumbIM(pProxy);
}
-void CSrmmWindow::OnInitDialog()
+bool CSrmmWindow::OnInitDialog()
{
CTabBaseDlg::OnInitDialog();
@@ -850,6 +850,7 @@ void CSrmmWindow::OnInitDialog() m_pContainer->dwFlags &= ~CNT_CREATE_MINIMIZED;
m_pContainer->m_hwndActive = m_hwnd;
}
+ return true;
}
void CSrmmWindow::OnDestroy()
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index acdc82c788..1d9615ebd8 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -585,7 +585,7 @@ public: btnReset.OnClick = Callback(this, &COptMainDlg::onClick_Reset);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
TreeViewInit(GetDlgItem(m_hwnd, IDC_WINDOWOPTIONS), CTranslator::TREE_MSG, 0, FALSE);
@@ -593,9 +593,10 @@ public: spnAvaSize.SetRange(150);
spnAvaSize.SetPosition(M.GetDword("avatarheight", 100));
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
db_set_dw(0, SRMSGMOD_T, "avatarheight", spnAvaSize.GetPosition());
db_set_b(0, SRMSGMOD_T, "dontscaleavatars", chkAvaPreserve.GetState());
@@ -604,9 +605,10 @@ public: TreeViewToDB(GetDlgItem(m_hwnd, IDC_WINDOWOPTIONS), CTranslator::TREE_MSG, SRMSGMOD_T, nullptr);
PluginConfig.reloadSettings();
Srmm_Broadcast(DM_OPTIONSAPPLIED, 1, 0);
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
TreeViewDestroy(GetDlgItem(m_hwnd, IDC_WINDOWOPTIONS));
}
@@ -617,7 +619,7 @@ public: db_set_dw(0, SRMSGMOD_T, "cWarningsH", 0);
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom == IDC_WINDOWOPTIONS)
return TreeViewHandleClick(m_hwnd, ((LPNMHDR)lParam)->hwndFrom, wParam, lParam);
@@ -682,7 +684,7 @@ public: have_hpp = ServiceExists("History++/ExtGrid/NewWindow") != 0;
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
DWORD dwFlags = M.GetDword("mwflags", MWF_LOG_DEFAULT);
@@ -744,9 +746,10 @@ public: SetDlgItemText(m_hwnd, IDC_EXPLAINMSGLOGSETTINGS, TranslateT("You have chosen to use an external plugin for displaying the message history in the chat window. Most of the settings on this page are for the standard message log viewer only and will have no effect. To change the appearance of the message log, you must configure either IEView or History++."));
ShowHide();
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
LRESULT msglogmode = cmbLogDisplay.GetCurSel();
DWORD dwFlags = M.GetDword("mwflags", MWF_LOG_DEFAULT);
@@ -790,9 +793,10 @@ public: db_set_dw(0, SRMSGMOD_T, "maxhist", 0);
PluginConfig.reloadSettings();
Srmm_Broadcast(DM_OPTIONSAPPLIED, 1, 0);
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
TreeViewDestroy(GetDlgItem(m_hwnd, IDC_LOGOPTIONS));
}
@@ -833,7 +837,7 @@ public: ShowHide();
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom == IDC_LOGOPTIONS)
return TreeViewHandleClick(m_hwnd, ((LPNMHDR)lParam)->hwndFrom, wParam, lParam);
@@ -910,7 +914,7 @@ public: chkNotifyPopup.OnChange = Callback(this, &COptTypingDlg::onCheck_NotifyPopup);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
CLCINFOITEM cii = { sizeof(cii) };
cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
@@ -951,9 +955,10 @@ public: Utils::showDlgControl(m_hwnd, IDC_STATIC111, SW_HIDE);
Utils::showDlgControl(m_hwnd, IDC_MTN_POPUPMODE, SW_HIDE);
}
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
SaveList();
db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPING, (BYTE)IsDlgButtonChecked(m_hwnd, IDC_SHOWNOTIFY));
@@ -965,9 +970,10 @@ public: db_set_b(0, SRMSGMOD, "ShowTypingPopup", (BYTE)IsDlgButtonChecked(m_hwnd, IDC_NOTIFYPOPUP));
db_set_b(0, SRMSGMOD_T, "MTN_PopupMode", (BYTE)SendDlgItemMessage(m_hwnd, IDC_MTN_POPUPMODE, CB_GETCURSEL, 0, 0));
PluginConfig.reloadSettings();
+ return true;
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_NOTIFY && ((NMHDR*)lParam)->idFrom == IDC_CLIST) {
switch (((NMHDR*)lParam)->code) {
@@ -1035,7 +1041,7 @@ public: chkLimit.OnChange = Callback(this, &COptTabbedDlg::onChange_Cut);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
TreeViewInit(GetDlgItem(m_hwnd, IDC_TABMSGOPTIONS), CTranslator::TREE_TAB, 0, FALSE);
@@ -1048,9 +1054,10 @@ public: cmbEscMode.AddString(TranslateT("Minimize the window to the task bar"));
cmbEscMode.AddString(TranslateT("Close or hide window, depends on the close button setting above"));
cmbEscMode.SetCurSel(PluginConfig.m_EscapeCloses);
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
db_set_w(0, SRMSGMOD_T, "cut_at", spnLimit.GetPosition());
db_set_b(0, SRMSGMOD_T, "cuttitle", chkLimit.GetState());
@@ -1060,9 +1067,10 @@ public: PluginConfig.reloadSettings();
Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0);
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
TreeViewDestroy(GetDlgItem(m_hwnd, IDC_TABMSGOPTIONS));
}
@@ -1080,7 +1088,7 @@ public: spnLimit.Enable(bEnabled);
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_COMMAND && wParam == DM_STATUSMASKSET)
db_set_dw(0, SRMSGMOD_T, "autopopupmask", (DWORD)lParam);
@@ -1131,7 +1139,7 @@ public: chkLimits.OnChange = chkSingle.OnChange = chkGroup.OnChange = chkDefault.OnChange = Callback(this, &COptContainersDlg::onChangeLimits);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
chkGroup.SetState(M.GetByte("useclistgroups", 0));
chkLimits.SetState(M.GetByte("limittabs", 0));
@@ -1161,9 +1169,10 @@ public: chkUseAeroPeek.Enable(PluginConfig.m_bIsWin7);
if (PluginConfig.m_bIsVista)
Utils::enableDlgControl(m_hwnd, IDC_AEROEFFECT, chkUseAero.GetState() != 0);
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
bool fOldAeroState = M.getAeroState();
@@ -1182,6 +1191,7 @@ public: SendMessage(PluginConfig.g_hwndHotkeyHandler, WM_DWMCOLORIZATIONCOLORCHANGED, 0, 0); // simulate aero state change
}
BuildContainerMenu();
+ return true;
}
};
@@ -1205,7 +1215,7 @@ public: btnRevert.OnClick = Callback(this, &COptAdvancedDlg::onClick_Revert);
}
- virtual void OnInitDialog() override
+ bool OnInitDialog() override
{
TreeViewInit(GetDlgItem(m_hwnd, IDC_PLUS_CHECKTREE), CTranslator::TREE_MODPLUS, 0, FALSE);
@@ -1214,9 +1224,10 @@ public: spnHistSize.SetRange(255, 15);
spnHistSize.SetPosition(M.GetByte("historysize", 0));
+ return true;
}
- virtual void OnApply() override
+ bool OnApply() override
{
TreeViewToDB(GetDlgItem(m_hwnd, IDC_PLUS_CHECKTREE), CTranslator::TREE_MODPLUS, SRMSGMOD_T, nullptr);
@@ -1226,14 +1237,15 @@ public: db_set_b(0, SRMSGMOD_T, "historysize", spnHistSize.GetPosition());
PluginConfig.reloadAdv();
+ return true;
}
- virtual void OnDestroy() override
+ void OnDestroy() override
{
TreeViewDestroy(GetDlgItem(m_hwnd, IDC_PLUS_CHECKTREE));
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override
{
if (msg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom == IDC_PLUS_CHECKTREE)
return TreeViewHandleClick(m_hwnd, ((LPNMHDR)lParam)->hwndFrom, wParam, lParam);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 2e7bdbdd95..8eef8a5e26 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -91,7 +91,7 @@ void CTabBaseDlg::LoadSettings() LoadLogfont(FONTSECTION_IM, MSGFONTID_MESSAGEAREA, nullptr, &m_clrInputFG, FONTMODULE);
}
-void CTabBaseDlg::OnInitDialog()
+bool CTabBaseDlg::OnInitDialog()
{
CSrmmBaseDialog::OnInitDialog();
@@ -119,6 +119,7 @@ void CTabBaseDlg::OnInitDialog() m_cache->updateUIN();
m_bIsAutosizingInput = IsAutoSplitEnabled();
+ return true;
}
INT_PTR CTabBaseDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index b212ae4e81..14f630fee2 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -373,8 +373,8 @@ public: CTabBaseDlg(int iDialogId, SESSION_INFO* = nullptr);
virtual ~CTabBaseDlg();
- virtual void OnInitDialog() override;
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ bool OnInitDialog() override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
virtual CThumbBase* tabCreateThumb(CProxyWindow*) const = 0;
virtual void tabClearLog() = 0;
@@ -486,14 +486,14 @@ public: public:
CSrmmWindow();
- virtual void OnInitDialog() override;
- virtual void OnDestroy() override;
+ bool OnInitDialog() override;
+ void OnDestroy() override;
- virtual int Resizer(UTILRESIZECONTROL *urc) override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
- virtual void UpdateTitle() override;
+ void UpdateTitle() override;
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
void onClick_Ok(CCtrlButton*);
void onClick_Add(CCtrlButton*);
@@ -534,23 +534,23 @@ class CChatRoomDlg : public CTabBaseDlg public:
CChatRoomDlg(SESSION_INFO*);
- virtual void OnInitDialog() override;
- virtual void OnDestroy() override;
+ bool OnInitDialog() override;
+ void OnDestroy() override;
- virtual int Resizer(UTILRESIZECONTROL *urc) override;
+ int Resizer(UTILRESIZECONTROL *urc) override;
- virtual void AddLog() override;
- virtual void CloseTab() override;
- virtual void RedrawLog() override;
- virtual void ScrollToBottom() override;
- virtual void ShowFilterMenu() override;
- virtual void StreamInEvents(LOGINFO* lin, bool bRedraw) override;
- virtual void UpdateNickList() override;
- virtual void UpdateOptions() override;
- virtual void UpdateStatusBar() override;
- virtual void UpdateTitle() override;
-
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ void AddLog() override;
+ void CloseTab() override;
+ void RedrawLog() override;
+ void ScrollToBottom() override;
+ void ShowFilterMenu() override;
+ void StreamInEvents(LOGINFO* lin, bool bRedraw) override;
+ void UpdateNickList() override;
+ void UpdateOptions() override;
+ void UpdateStatusBar() override;
+ void UpdateTitle() override;
+
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
void onClick_OK(CCtrlButton*);
void onClick_Filter(CCtrlButton*);
@@ -585,10 +585,10 @@ class CTemplateEditDlg : public CTabBaseDlg public:
CTemplateEditDlg(BOOL rtl, HWND hwndParent);
- virtual void OnInitDialog() override;
- virtual void OnDestroy() override;
+ bool OnInitDialog() override;
+ void OnDestroy() override;
- virtual INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
+ INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
void onChange_Text(CCtrlEdit*);
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 0c2db1ff55..fefd3f78df 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -143,7 +143,7 @@ CTemplateEditDlg::CTemplateEditDlg(BOOL _rtl, HWND hwndParent) : btnResetAll.OnClick = Callback(this, &CTemplateEditDlg::onClick_Reset); } -void CTemplateEditDlg::OnInitDialog() +bool CTemplateEditDlg::OnInitDialog() { // set hContact to the first found contact so that we can use the Preview window properly // also, set other parameters needed by the streaming function to display events @@ -184,6 +184,7 @@ void CTemplateEditDlg::OnInitDialog() SendDlgItemMessage(m_hwnd, IDC_COLOR4, CPM_SETCOLOUR, 0, M.GetDword("cc4", SRMSGDEFSET_BKGCOLOUR)); SendDlgItemMessage(m_hwnd, IDC_COLOR5, CPM_SETCOLOUR, 0, M.GetDword("cc5", SRMSGDEFSET_BKGCOLOUR)); SendDlgItemMessage(m_hwnd, IDC_EDITTEMPLATE, EM_SETREADONLY, TRUE, 0); + return true; } void CTemplateEditDlg::OnDestroy() |