diff options
author | George Hazan <ghazan@miranda.im> | 2018-06-06 20:53:00 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-06-06 20:53:00 +0300 |
commit | f7d7c40c372287642424883fc64b95edeb4461c9 (patch) | |
tree | d71b7b7e5e1e0f2bbe10892dcccc59a7691faa33 /src/mir_core | |
parent | 0ebf6eee52c36fe139edb77730a835479cf0de21 (diff) |
CCtrlPages::CheckRowCount() - new function to force tab resize when the number of rows is changed
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/CCtrlPages.cpp | 16 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/src/mir_core/src/CCtrlPages.cpp b/src/mir_core/src/CCtrlPages.cpp index f14d43f786..b0d07450cc 100644 --- a/src/mir_core/src/CCtrlPages.cpp +++ b/src/mir_core/src/CCtrlPages.cpp @@ -135,7 +135,7 @@ void CCtrlPages::AddPage(const wchar_t *ptszName, HICON hIcon, CDlgBase *pDlg) ShowPage(m_pActivePage); } } - else m_pages.insert(info); + m_pages.insert(info); } void CCtrlPages::ActivatePage(int iPage) @@ -160,6 +160,16 @@ void CCtrlPages::ActivatePage(int iPage) ::SendMessage(m_pActivePage->GetHwnd(), WM_MOUSEACTIVATE, 0, 0); } +void CCtrlPages::CheckRowCount() +{ + int iRowCount = TabCtrl_GetRowCount(m_hwnd); + if (m_numRows != iRowCount) { + m_numRows = iRowCount; + for (auto &p : m_pages) + p->m_bScheduledResize = true; + } +} + int CCtrlPages::GetCount() { return TabCtrl_GetItemCount(m_hwnd); @@ -226,6 +236,8 @@ void CCtrlPages::InsertPage(TPageInfo *pPage) } TabCtrl_InsertItem(m_hwnd, TabCtrl_GetItemCount(m_hwnd), &tci); + + CheckRowCount(); } void CCtrlPages::RemovePage(int iPage) @@ -236,6 +248,8 @@ void CCtrlPages::RemovePage(int iPage) TabCtrl_DeleteItem(m_hwnd, iPage); delete p; + + CheckRowCount(); } void CCtrlPages::ShowPage(CDlgBase *pDlg) diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 4bb5b14e91..678e5453e5 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1067,3 +1067,4 @@ CallObjectEventHook @1259 ?db_get_wsm@@YG?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@IPBD0@Z @1261 NONAME
?CreateLink@CDlgBase@@IAEXAAVCCtrlData@@PBDEK@Z @1262 NONAME
?CreateLink@CDlgBase@@IAEXAAVCCtrlData@@PBDPA_W@Z @1263 NONAME
+?CheckRowCount@CCtrlPages@@AAEXXZ @1264 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 638caf74fb..f84202ff91 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1067,3 +1067,4 @@ CallObjectEventHook @1259 ?db_get_wsm@@YA?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@IPEBD0@Z @1261 NONAME
?CreateLink@CDlgBase@@IEAAXAEAVCCtrlData@@PEBDEK@Z @1262 NONAME
?CreateLink@CDlgBase@@IEAAXAEAVCCtrlData@@PEBDPEA_W@Z @1263 NONAME
+?CheckRowCount@CCtrlPages@@AEAAXXZ @1264 NONAME
|