diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-02 14:12:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-02 14:12:59 +0300 |
commit | ae93aa98b214f98a0e28df1bdaa8df18b3f6da02 (patch) | |
tree | 6856f13b902b45e8ea9971df1c380fc18793dfec /src/core | |
parent | 2fccd1a7a6f642c30fc4cbd2281c6feba5f8d82d (diff) |
further SRMM window unification
- CSrmmBaseDialog received m_hContact as its common member;
- less usage of CTabBaseDlg::m_bType in tabSRMM
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 37 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 4 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.h | 1 |
3 files changed, 21 insertions, 21 deletions
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index af4ea35a85..36dc59a92a 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -875,6 +875,7 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) : { m_pLog = &m_log; m_pEntry = &m_message; + m_hContact = si->hContact; m_autoClose = 0; @@ -909,9 +910,9 @@ void CChatRoomDlg::OnInitDialog() m_btnColor.OnInit(); m_btnBkColor.OnInit(); m_btnFilter.OnInit(); m_btnHistory.OnInit(); m_btnChannelMgr.OnInit(); - WindowList_Add(pci->hWindowList, m_hwnd, m_si->hContact); + WindowList_Add(pci->hWindowList, m_hwnd, m_hContact); - NotifyLocalWinEvent(m_si->hContact, m_hwnd, MSG_WINDOW_EVT_OPENING); + NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPENING); mir_subclassWindow(GetDlgItem(m_hwnd, IDC_SPLITTERX), SplitterSubclassProc); mir_subclassWindow(GetDlgItem(m_hwnd, IDC_SPLITTERY), SplitterSubclassProc); mir_subclassWindow(m_log.GetHwnd(), LogSubclassProc); @@ -943,12 +944,12 @@ void CChatRoomDlg::OnInitDialog() SendMessage(m_hwnd, WM_SIZE, 0, 0); - NotifyLocalWinEvent(m_si->hContact, m_hwnd, MSG_WINDOW_EVT_OPEN); + NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPEN); } void CChatRoomDlg::OnDestroy() { - NotifyLocalWinEvent(m_si->hContact, m_hwnd, MSG_WINDOW_EVT_CLOSING); + NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSING); SaveWindowPosition(true); WindowList_Remove(pci->hWindowList, m_hwnd); @@ -958,7 +959,7 @@ void CChatRoomDlg::OnDestroy() m_si->wState &= ~STATE_TALK; DestroyWindow(m_si->hwndStatus); m_si->hwndStatus = NULL; - NotifyLocalWinEvent(m_si->hContact, m_hwnd, MSG_WINDOW_EVT_CLOSE); + NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSE); } void CChatRoomDlg::OnClick_Bold(CCtrlButton *pButton) @@ -1146,7 +1147,7 @@ void CChatRoomDlg::SetWindowPosition() } if (db_get_b(NULL, CHAT_MODULE, "SavePosition", 0)) { - if (RestoreWindowPosition(m_hwnd, m_si->hContact, true)) { + if (RestoreWindowPosition(m_hwnd, m_hContact, true)) { ShowWindow(m_hwnd, SW_HIDE); return; } @@ -1497,17 +1498,17 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (!g_Settings.bTabsEnable) { SaveWindowPosition(true); if (db_get_b(NULL, CHAT_MODULE, "SavePosition", 0)) { - db_set_dw(m_si->hContact, CHAT_MODULE, "roomx", m_si->iX); - db_set_dw(m_si->hContact, CHAT_MODULE, "roomy", m_si->iY); - db_set_dw(m_si->hContact, CHAT_MODULE, "roomwidth", m_si->iWidth); - db_set_dw(m_si->hContact, CHAT_MODULE, "roomheight", m_si->iHeight); + db_set_dw(m_hContact, CHAT_MODULE, "roomx", m_si->iX); + db_set_dw(m_hContact, CHAT_MODULE, "roomy", m_si->iY); + db_set_dw(m_hContact, CHAT_MODULE, "roomwidth", m_si->iWidth); + db_set_dw(m_hContact, CHAT_MODULE, "roomheight", m_si->iHeight); } } - if (pcli->pfnGetEvent(m_si->hContact, 0)) - pcli->pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT); + if (pcli->pfnGetEvent(m_hContact, 0)) + pcli->pfnRemoveEvent(m_hContact, GC_FAKE_EVENT); m_si->wState &= ~STATE_TALK; - db_set_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0); + db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0); SendMessage(m_hwnd, GC_CLOSEWINDOW, 0, 0); return TRUE; @@ -1673,10 +1674,10 @@ LABEL_SHOWWINDOW: if (KillTimer(m_hwnd, TIMERID_FLASHWND)) FlashWindow(m_hwnd, FALSE); - if (db_get_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0) != 0) - db_set_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0); - if (pcli->pfnGetEvent(m_si->hContact, 0)) - pcli->pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT); + if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode", 0) != 0) + db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0); + if (pcli->pfnGetEvent(m_hContact, 0)) + pcli->pfnRemoveEvent(m_hContact, GC_FAKE_EVENT); } break; @@ -1790,7 +1791,7 @@ LABEL_SHOWWINDOW: case WM_COMMAND: if (HIWORD(wParam) == BN_CLICKED) if (LOWORD(wParam) >= MIN_CBUTTONID && LOWORD(wParam) <= MAX_CBUTTONID) { - Srmm_ClickToolbarIcon(m_si->hContact, LOWORD(wParam), GetDlgItem(m_hwnd, LOWORD(wParam)), 0); + Srmm_ClickToolbarIcon(m_hContact, LOWORD(wParam), GetDlgItem(m_hwnd, LOWORD(wParam)), 0); break; } diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index d82a22d7bb..5eeacef419 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -419,11 +419,11 @@ CSrmmWindow::CSrmmWindow(MCONTACT hContact, bool noActivate, const char *szIniti m_log(this, IDC_LOG),
m_message(this, IDC_MESSAGE),
m_cmdList(20),
- m_bNoActivate(noActivate),
- m_hContact(hContact)
+ m_bNoActivate(noActivate)
{
m_pLog = &m_log;
m_pEntry = &m_message;
+ m_hContact = hContact;
m_wszInitialText = (bIsUnicode) ? mir_wstrdup((wchar_t*)szInitialText) : mir_a2u(szInitialText);
}
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index 18ff6ba2e1..33983fe2eb 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -79,7 +79,6 @@ class CSrmmWindow : public CSrmmBaseDialog, public MZeroedObject bool m_bIsMeta, m_bShowTyping, m_bNoActivate;
public:
- MCONTACT m_hContact;
MEVENT m_hDbEventFirst, m_hDbEventLast;
bool m_bIsAutoRTL;
|