From 7a20312b1ea4998111a05f207be8023a499050fb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 13 May 2019 14:54:10 +0300 Subject: CDlgBase::SetMinSize - a way to get rid of WM_GETMINMAXINFO in DlgProc --- plugins/CrashDumper/src/ui.cpp | 14 +---- plugins/DbEditorPP/src/findwindow.cpp | 54 ++++++++--------- plugins/DbEditorPP/src/main_window.cpp | 104 ++++++++++++++++----------------- plugins/DbEditorPP/src/watchedvars.cpp | 66 ++++++++++----------- plugins/Import/src/wizard.cpp | 9 +-- plugins/Scriver/src/chat_window.cpp | 13 +---- plugins/Scriver/src/msgdialog.cpp | 19 ++---- plugins/Scriver/src/msgs.h | 1 - 8 files changed, 117 insertions(+), 163 deletions(-) (limited to 'plugins') diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp index 50c7dd944c..cde5a7bf2f 100644 --- a/plugins/CrashDumper/src/ui.cpp +++ b/plugins/CrashDumper/src/ui.cpp @@ -33,6 +33,8 @@ public: m_btnCopyFile(this, IDC_FILEVER), m_redtViewVersionInfo(this, IDC_VIEWVERSIONINFO) { + SetMinSize(400, 300); + m_flags = flags; m_forceResizable = true; @@ -76,18 +78,6 @@ public: return true; } - INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override - { - if (msg == WM_GETMINMAXINFO) { - LPMINMAXINFO mmi = (LPMINMAXINFO)lParam; - mmi->ptMinTrackSize.x = 400; // The minimum width in points - mmi->ptMinTrackSize.y = 300; // The minimum height in points - return 0; - } - - return CDlgBase::DlgProc(msg, wParam, lParam); - } - int Resizer(UTILRESIZECONTROL * urc) override { switch (urc->wId) { diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp index 8f80063be5..2d21dac0c9 100644 --- a/plugins/DbEditorPP/src/findwindow.cpp +++ b/plugins/DbEditorPP/src/findwindow.cpp @@ -35,7 +35,8 @@ static int lastColumn = -1; #define F_DELETED 0x400 -typedef struct { +typedef struct +{ HWND hwnd; // hwnd to item list wchar_t* search; // text to find wchar_t* replace; // text to replace @@ -43,19 +44,18 @@ typedef struct { } FindInfo; -ColumnsSettings csResultList[] = { +ColumnsSettings csResultList[] = +{ { LPGENW("Result"), 0, "Search0width", 100 }, { LPGENW("Contact"), 1, "Search1width", 100 }, { LPGENW("Module"), 2, "Search2width", 100 }, { LPGENW("Setting"), 3, "Search3width", 100 }, { LPGENW("Value"), 4, "Search4width", 150 }, - {nullptr} + { nullptr } }; - void __cdecl FindSettings(LPVOID di); - int FindDialogResize(HWND, LPARAM, UTILRESIZECONTROL *urc) { switch (urc->wId) { @@ -68,9 +68,10 @@ int FindDialogResize(HWND, LPARAM, UTILRESIZECONTROL *urc) } } - INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { + HWND hwndResults = GetDlgItem(hwnd, IDC_LIST); + switch (msg) { case WM_INITDIALOG: SendDlgItemMessage(hwnd, IDC_SBAR, SB_SETTEXT, 0, (LPARAM)TranslateT("Enter a string to search the database for")); @@ -83,8 +84,8 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP SetWindowLongPtr(GetDlgItem(hwnd, IDC_SEARCH), GWLP_USERDATA, 0); SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_APPWINDOW); // taskbar icon TranslateDialogDefault(hwnd); - ListView_SetExtendedListViewStyle(GetDlgItem(hwnd, IDC_LIST), 32 | LVS_EX_LABELTIP); // LVS_EX_GRIDLINES - loadListSettings(GetDlgItem(hwnd, IDC_LIST), csResultList); + ListView_SetExtendedListViewStyle(hwndResults, 32 | LVS_EX_LABELTIP); // LVS_EX_GRIDLINES + loadListSettings(hwndResults, csResultList); Utils_RestoreWindowPositionNoMove(hwnd, NULL, MODULENAME, "Search_"); return TRUE; @@ -115,7 +116,7 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (!fi) break; - fi->hwnd = GetDlgItem(hwnd, IDC_LIST); + fi->hwnd = hwndResults; fi->options = (IsDlgButtonChecked(hwnd, IDC_CASESENSITIVE) ? F_CASE : 0) | (IsDlgButtonChecked(hwnd, IDC_EXACT) ? F_EXACT : 0) | (IsDlgButtonChecked(hwnd, IDC_MODNAME) ? F_MODNAME : 0) | @@ -153,13 +154,14 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP break; } break; + case WM_GETMINMAXINFO: - { - MINMAXINFO *mmi = (MINMAXINFO*)lParam; - mmi->ptMinTrackSize.x = 610; - mmi->ptMinTrackSize.y = 300; - } - return 0; + { + MINMAXINFO *mmi = (MINMAXINFO*)lParam; + mmi->ptMinTrackSize.x = 610; + mmi->ptMinTrackSize.y = 300; + } + return 0; case WM_SIZE: Utils_ResizeDialog(hwnd, g_plugin.getInst(), MAKEINTRESOURCEA(IDD_FIND), FindDialogResize); @@ -169,19 +171,15 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (LOWORD(wParam) != IDC_LIST) break; switch (((NMHDR*)lParam)->code) { case NM_DBLCLK: - { LVHITTESTINFO hti; LVITEM lvi; - HWND hwndResults = GetDlgItem(hwnd, IDC_LIST); hti.pt = ((NMLISTVIEW*)lParam)->ptAction; if (ListView_SubItemHitTest(hwndResults, &hti) > -1) { - if (hti.flags&LVHT_ONITEM) - { + if (hti.flags & LVHT_ONITEM) { lvi.mask = LVIF_PARAM; lvi.iItem = hti.iItem; lvi.iSubItem = 0; - if (ListView_GetItem(hwndResults, &lvi)) - { + if (ListView_GetItem(hwndResults, &lvi)) { ItemInfo ii = { 0 }; ii.hContact = (MCONTACT)lvi.lParam; ListView_GetItemTextA(hwndResults, hti.iItem, 2, ii.module, _countof(ii.module)); @@ -196,24 +194,22 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP } } break; - } case LVN_COLUMNCLICK: - { LPNMLISTVIEW lv = (LPNMLISTVIEW)lParam; ColumnsSortParams params; - params.hList = GetDlgItem(hwnd, IDC_LIST); + params.hList = hwndResults; params.column = lv->iSubItem; params.last = lastColumn; ListView_SortItemsEx(params.hList, ColumnsCompare, (LPARAM)¶ms); lastColumn = (params.column == lastColumn) ? -1 : params.column; break; - } } // switch break; + case WM_DESTROY: - ListView_DeleteAllItems(GetDlgItem(hwnd, IDC_LIST)); - saveListSettings(GetDlgItem(hwnd, IDC_LIST), csResultList); + ListView_DeleteAllItems(hwndResults); + saveListSettings(hwndResults, csResultList); Utils_SaveWindowPosition(hwnd, NULL, MODULENAME, "Search_"); break; } @@ -221,7 +217,8 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP } -void newFindWindow() { +void newFindWindow() +{ CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FIND), hwnd2mainWindow, FindWindowDlgProc); } @@ -564,7 +561,6 @@ void __cdecl FindSettings(LPVOID param) ItemFound(fi->hwnd, hContact, newModule, nullptr, nullptr, flag); } - } // for(module) } diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index fbef13920e..2318e21397 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -60,12 +60,12 @@ static LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return HTCLIENT; case WM_SETCURSOR: - { - RECT rc; - GetClientRect(hwnd, &rc); - SetCursor(rc.right > rc.bottom ? LoadCursor(nullptr, IDC_SIZENS) : LoadCursor(nullptr, IDC_SIZEWE)); - } - return TRUE; + { + RECT rc; + GetClientRect(hwnd, &rc); + SetCursor(rc.right > rc.bottom ? LoadCursor(nullptr, IDC_SIZENS) : LoadCursor(nullptr, IDC_SIZEWE)); + } + return TRUE; case WM_LBUTTONDOWN: SetCapture(hwnd); @@ -91,18 +91,18 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR { switch (msg) { case WM_RBUTTONDOWN: - { - TVHITTESTINFO hti; - hti.pt.x = (short)LOWORD(GetMessagePos()); - hti.pt.y = (short)HIWORD(GetMessagePos()); - ScreenToClient(hwnd, &hti.pt); - - if (TreeView_HitTest(hwnd, &hti)) { - if (hti.flags&TVHT_ONITEM) - TreeView_SelectItem(hwnd, hti.hItem); + { + TVHITTESTINFO hti; + hti.pt.x = (short)LOWORD(GetMessagePos()); + hti.pt.y = (short)HIWORD(GetMessagePos()); + ScreenToClient(hwnd, &hti.pt); + + if (TreeView_HitTest(hwnd, &hti)) { + if (hti.flags&TVHT_ONITEM) + TreeView_SelectItem(hwnd, hti.hItem); + } } - } - break; + break; case WM_CHAR: if (GetKeyState(VK_CONTROL) & 0x8000 && wParam == 6) @@ -265,38 +265,38 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return TRUE; case GC_SPLITTERMOVED: - { - int splitterPos = GetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA); - - RECT rc2; - GetWindowRect(hwnd, &rc2); - - if ((HWND)lParam == GetDlgItem(hwnd, IDC_SPLITTER)) { - RECT rc; - GetClientRect(hwnd, &rc); - POINT pt = { (LONG)wParam, 0 }; - ScreenToClient(hwnd, &pt); - - splitterPos = rc.left + pt.x + 1; - if (splitterPos < 150) - splitterPos = 150; - if (splitterPos > rc2.right - rc2.left - 150) - splitterPos = rc2.right - rc2.left - 150; - SetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA, splitterPos); - g_plugin.setWord("Splitter", (WORD)splitterPos); + { + int splitterPos = GetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA); + + RECT rc2; + GetWindowRect(hwnd, &rc2); + + if ((HWND)lParam == GetDlgItem(hwnd, IDC_SPLITTER)) { + RECT rc; + GetClientRect(hwnd, &rc); + POINT pt = { (LONG)wParam, 0 }; + ScreenToClient(hwnd, &pt); + + splitterPos = rc.left + pt.x + 1; + if (splitterPos < 150) + splitterPos = 150; + if (splitterPos > rc2.right - rc2.left - 150) + splitterPos = rc2.right - rc2.left - 150; + SetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA, splitterPos); + g_plugin.setWord("Splitter", (WORD)splitterPos); + } + PostMessage(hwnd, WM_SIZE, 0, 0); } - PostMessage(hwnd, WM_SIZE, 0, 0); - } - break; + break; case WM_GETMINMAXINFO: - { - MINMAXINFO *mmi = (MINMAXINFO *)lParam; - int splitterPos = GetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA); - mmi->ptMinTrackSize.x = splitterPos + 150; - mmi->ptMinTrackSize.y = 300; - } - return 0; + { + MINMAXINFO *mmi = (MINMAXINFO *)lParam; + int splitterPos = GetWindowLongPtr(GetDlgItem(hwnd, IDC_SPLITTER), GWLP_USERDATA); + mmi->ptMinTrackSize.x = splitterPos + 150; + mmi->ptMinTrackSize.y = 300; + } + return 0; case WM_MOVE: case WM_SIZE: @@ -490,12 +490,12 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) CheckMenuItem(GetSubMenu(GetMenu(hwnd), 5), MENU_DWORD_HEX, MF_BYCOMMAND | ((g_Hex & HEX_DWORD) ? MF_CHECKED : MF_UNCHECKED)); break; case MENU_SAVE_POSITION: - { - BOOL save = !g_plugin.getByte("RestoreOnOpen", 1); - CheckMenuItem(GetSubMenu(GetMenu(hwnd), 5), MENU_SAVE_POSITION, MF_BYCOMMAND | (save ? MF_CHECKED : MF_UNCHECKED)); - g_plugin.setByte("RestoreOnOpen", (byte)save); - } - break; + { + BOOL save = !g_plugin.getByte("RestoreOnOpen", 1); + CheckMenuItem(GetSubMenu(GetMenu(hwnd), 5), MENU_SAVE_POSITION, MF_BYCOMMAND | (save ? MF_CHECKED : MF_UNCHECKED)); + g_plugin.setByte("RestoreOnOpen", (byte)save); + } + break; case MENU_INLINE_EDIT: g_Inline = !g_Inline; CheckMenuItem(GetSubMenu(GetMenu(hwnd), 5), MENU_INLINE_EDIT, MF_BYCOMMAND | (g_Inline ? MF_CHECKED : MF_UNCHECKED)); diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index f24dad1745..7cd8ef85b5 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -17,7 +17,8 @@ ColumnsSettings csWatchList[] = { -int WatchedArrayIndex(MCONTACT hContact, const char *module, const char *setting, int strict) { +int WatchedArrayIndex(MCONTACT hContact, const char *module, const char *setting, int strict) +{ for (int i = 0; i < WatchListArray.count; i++) { if (hContact == WatchListArray.item[i].hContact) if (!mir_strcmp(module, WatchListArray.item[i].module)) @@ -31,8 +32,7 @@ int WatchedArrayIndex(MCONTACT hContact, const char *module, const char *setting int addSettingToWatchList(MCONTACT hContact, const char *module, const char *setting) { - if (WatchListArray.count == WatchListArray.size) - { + if (WatchListArray.count == WatchListArray.size) { WatchListArray.size += 32; WatchListArray.item = (struct DBsetting*)mir_realloc(WatchListArray.item, sizeof(struct DBsetting)*WatchListArray.size); } @@ -94,8 +94,7 @@ void addwatchtolist(HWND hwnd, struct DBsetting *lParam) dummy.hContact = lParam->hContact; dummy.module = lParam->module; - for (ModSetLinkLinkItem *setting = settinglist.first; setting; setting = setting->next) - { + for (ModSetLinkLinkItem *setting = settinglist.first; setting; setting = setting->next) { dummy.setting = setting->name; addwatchtolist(hwnd, &dummy); @@ -125,11 +124,11 @@ void addwatchtolist(HWND hwnd, struct DBsetting *lParam) switch (dbv->type) { case DBVT_BLOB: - { - ptrA str(StringFromBlob(dbv->pbVal, dbv->cpbVal)); - ListView_SetItemTextA(hwnd, index, 3, str); - break; - } + { + ptrA str(StringFromBlob(dbv->pbVal, dbv->cpbVal)); + ListView_SetItemTextA(hwnd, index, 3, str); + break; + } case DBVT_BYTE: mir_snwprintf(data, L"0x%02X (%s)", dbv->bVal, _ultow(dbv->bVal, tmp, 10)); ListView_SetItemText(hwnd, index, 3, data); @@ -149,18 +148,18 @@ void addwatchtolist(HWND hwnd, struct DBsetting *lParam) break; case DBVT_WCHAR: - { - ptrW str(mir_wstrdup(dbv->pwszVal)); - ListView_SetItemText(hwnd, index, 3, str); - break; - } + { + ptrW str(mir_wstrdup(dbv->pwszVal)); + ListView_SetItemText(hwnd, index, 3, str); + break; + } case DBVT_UTF8: - { - ptrW str(mir_utf8decodeW(dbv->pszVal)); - ListView_SetItemText(hwnd, index, 3, str); - break; - } + { + ptrW str(mir_utf8decodeW(dbv->pszVal)); + ListView_SetItemText(hwnd, index, 3, str); + break; + } case DBVT_DELETED: if (IsResidentSetting(lParam->module, lParam->setting)) ListView_SetItemText(hwnd, index, 3, TranslateT("*** resident ***")); @@ -192,8 +191,7 @@ void PopulateWatchedWindow() void freeAllWatches() { ListView_DeleteAllItems(GetDlgItem(hwnd2watchedVarsWindow, IDC_VARS)); - for (int i = 0; i < WatchListArray.count; i++) - { + for (int i = 0; i < WatchListArray.count; i++) { freeWatchListItem(i); } mir_free(WatchListArray.item); @@ -204,8 +202,7 @@ void freeAllWatches() int WatchDialogResize(HWND, LPARAM, UTILRESIZECONTROL *urc) { - switch (urc->wId) - { + switch (urc->wId) { case IDC_VARS: urc->rcItem.top = 0; urc->rcItem.bottom = urc->dlgNewSize.cy; @@ -256,12 +253,12 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) // for the resize case WM_GETMINMAXINFO: - { - MINMAXINFO *mmi = (MINMAXINFO*)lParam; - mmi->ptMinTrackSize.x = 500; - mmi->ptMinTrackSize.y = 300; - } - return 0; + { + MINMAXINFO *mmi = (MINMAXINFO*)lParam; + mmi->ptMinTrackSize.x = 500; + mmi->ptMinTrackSize.y = 300; + } + return 0; case WM_SIZE: Utils_ResizeDialog(hwnd, g_plugin.getInst(), MAKEINTRESOURCEA(IDD_WATCH_DIAG), WatchDialogResize); @@ -292,15 +289,12 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { HWND hwndVars = GetDlgItem(hwnd, IDC_VARS); hti.pt = ((NMLISTVIEW*)lParam)->ptAction; - if (ListView_SubItemHitTest(hwndVars, &hti) > -1) - { - if (hti.flags&LVHT_ONITEM) - { + if (ListView_SubItemHitTest(hwndVars, &hti) > -1) { + if (hti.flags&LVHT_ONITEM) { lvi.mask = LVIF_PARAM; lvi.iItem = hti.iItem; lvi.iSubItem = 0; - if (ListView_GetItem(hwndVars, &lvi)) - { + if (ListView_GetItem(hwndVars, &lvi)) { ItemInfo ii; ii.hContact = (MCONTACT)lvi.lParam; ListView_GetItemTextA(hwndVars, hti.iItem, 1, ii.module, _countof(ii.module)); diff --git a/plugins/Import/src/wizard.cpp b/plugins/Import/src/wizard.cpp index 6efdeeb125..5ca204bd72 100644 --- a/plugins/Import/src/wizard.cpp +++ b/plugins/Import/src/wizard.cpp @@ -115,6 +115,7 @@ public: CDlgBase(g_plugin, IDD_WIZARD), m_pFirstPage(pPage) { + SetMinSize(330, 286); m_autoClose = CLOSE_ON_CANCEL; } @@ -221,14 +222,6 @@ public: SetDlgItemText(m_hwnd, IDCANCEL, (wchar_t*)lParam); break; - case WM_GETMINMAXINFO: - { - LPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam; - lpMMI->ptMinTrackSize.x = 330; - lpMMI->ptMinTrackSize.y = 286; - } - return 1; - case WM_COMMAND: SendMessage(hwndPage, WM_COMMAND, wParam, lParam); break; diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index 9b31e2e3bc..9ceec71ae4 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -227,6 +227,8 @@ bool CChatRoomDlg::OnInitDialog() m_pParent->iSplitterX = rc.right - rc.left; } + SetMinSize(350, m_minLogBoxHeight + TOOLBAR_HEIGHT + m_minEditBoxHeight + 5); + m_message.SendMsg(EM_SUBCLASSED, 0, 0); m_message.SendMsg(EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE | ENM_REQUESTRESIZE); @@ -1032,17 +1034,6 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SetFocus(m_message.GetHwnd()); break; - case WM_GETMINMAXINFO: - { - MINMAXINFO *mmi = (MINMAXINFO*)lParam; - mmi->ptMinTrackSize.x = m_pParent->iSplitterX + 43; - if (mmi->ptMinTrackSize.x < 350) - mmi->ptMinTrackSize.x = 350; - - mmi->ptMinTrackSize.y = m_minLogBoxHeight + TOOLBAR_HEIGHT + m_minEditBoxHeight + 5; - } - break; - case WM_LBUTTONDBLCLK: if (LOWORD(lParam) < 30) ScrollToBottom(); diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index ab2d569f71..ddc1f27bda 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -229,9 +229,6 @@ bool CSrmmWindow::OnInitDialog() DWORD dwExStyle = GetWindowLongPtr(m_log.GetHwnd(), GWL_EXSTYLE); SetWindowLongPtr(m_log.GetHwnd(), GWL_EXSTYLE, (m_bUseRtl) ? dwExStyle | WS_EX_LEFTSCROLLBAR :dwExStyle & ~WS_EX_LEFTSCROLLBAR); - m_toolbarSize.cy = TOOLBAR_HEIGHT; - m_toolbarSize.cx = 0; - RECT rc; GetWindowRect(m_message.GetHwnd(), &rc); m_minLogBoxHeight = m_minEditBoxHeight = rc.bottom - rc.top; @@ -240,6 +237,8 @@ bool CSrmmWindow::OnInitDialog() if (m_pParent->iSplitterY == -1) m_pParent->iSplitterY = m_minEditBoxHeight; + SetMinSize(BOTTOM_RIGHT_AVATAR_HEIGHT, m_minLogBoxHeight + TOOLBAR_HEIGHT + m_minEditBoxHeight + max(INFO_BAR_HEIGHT, BOTTOM_RIGHT_AVATAR_HEIGHT - TOOLBAR_HEIGHT) + 5); + if (m_wszInitialText) { m_message.SetText(m_wszInitialText); mir_free(m_wszInitialText); @@ -839,7 +838,7 @@ void CSrmmWindow::MessageDialogResize(int w, int h) { ParentWindowData *pdat = m_pParent; bool bToolbar = (pdat->flags2 & SMF2_SHOWTOOLBAR) != 0; - int hSplitterPos = pdat->iSplitterY, toolbarHeight = (bToolbar) ? m_toolbarSize.cy : 0; + int hSplitterPos = pdat->iSplitterY, toolbarHeight = (bToolbar) ? TOOLBAR_HEIGHT : 0; int hSplitterMinTop = toolbarHeight + m_minLogBoxHeight, hSplitterMinBottom = m_minEditBoxHeight; int infobarInnerHeight = INFO_BAR_INNER_HEIGHT; int infobarHeight = INFO_BAR_HEIGHT; @@ -881,8 +880,8 @@ void CSrmmWindow::MessageDialogResize(int w, int h) if (avatarWidth > BOTTOM_RIGHT_AVATAR_HEIGHT && avatarWidth > w / 4) avatarWidth = w / 4; - if ((toolbarWidth - avatarWidth - 2) < m_toolbarSize.cx) - avatarWidth = toolbarWidth - m_toolbarSize.cx - 2; + if ((toolbarWidth - avatarWidth - 2) < 0) + avatarWidth = toolbarWidth - 2; toolbarWidth -= avatarWidth + 2; messageEditWidth -= avatarWidth + 1; @@ -1353,14 +1352,6 @@ INT_PTR CSrmmWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) m_pParent = (ParentWindowData *)GetWindowLongPtr(m_hwndParent, GWLP_USERDATA); return TRUE; - case WM_GETMINMAXINFO: - { - MINMAXINFO *mmi = (MINMAXINFO *)lParam; - mmi->ptMinTrackSize.x = m_toolbarSize.cx + BOTTOM_RIGHT_AVATAR_HEIGHT; - mmi->ptMinTrackSize.y = m_minLogBoxHeight + m_toolbarSize.cy + m_minEditBoxHeight + max(INFO_BAR_HEIGHT, BOTTOM_RIGHT_AVATAR_HEIGHT - m_toolbarSize.cy) + 5; - } - return 0; - case WM_SIZE: if (wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED) { RECT rc; diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index 41bf0a6e3e..88189fb316 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -117,7 +117,6 @@ class CSrmmWindow : public CScriverWindow bool m_bIncoming, m_bShowTyping; MEVENT m_hDbEventFirst, m_hDbEventLast, m_hDbUnreadEventFirst; - SIZE m_toolbarSize; int m_iWindowWasCascaded; int m_nTypeSecs, m_nTypeMode, m_nLastTyping; int m_iShowUnread; -- cgit v1.2.3