summaryrefslogtreecommitdiff
path: root/src/core/stdmsg
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-12-10 15:50:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-12-10 15:50:53 +0300
commit5fea43e9b07b966fe023105bfd9a224bfbb00e7b (patch)
tree5868406c223c0ed4cca707f258dc55c331844298 /src/core/stdmsg
parent271558cf6114d70da75ed474d7c04fa707ae3369 (diff)
- ability to pass a button's text to a toolbar button;
- common code moved into the core
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r--src/core/stdmsg/src/chat_window.cpp13
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp13
2 files changed, 3 insertions, 23 deletions
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp
index a116e7f577..277f71b0d2 100644
--- a/src/core/stdmsg/src/chat_window.cpp
+++ b/src/core/stdmsg/src/chat_window.cpp
@@ -1129,18 +1129,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)si);
- CustomButtonData *cbd;
- for (int i = 0; cbd = Srmm_GetNthButton(i); i++) {
- if (!cbd->m_bChatButton)
- continue;
-
- HWND hwndButton = CreateWindowEx(0, L"MButtonClass", L"", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, cbd->m_iButtonWidth, 22, hwndDlg, (HMENU)cbd->m_dwButtonCID, g_hInst, NULL);
- SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0);
- if (cbd->m_pwszTooltip)
- SendMessage(hwndButton, BUTTONADDTOOLTIP, LPARAM(cbd->m_pwszTooltip), BATF_UNICODE);
- if (cbd->m_hIcon)
- SendMessage(hwndButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(cbd->m_hIcon));
- }
+ Srmm_CreateToolbarIcons(hwndDlg, BBBF_ISCHATBUTTON);
NotifyLocalWinEvent(si->hContact, hwndDlg, MSG_WINDOW_EVT_OPENING);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_SPLITTERX), SplitterSubclassProc);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 8f715d0cf5..840444681c 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -682,19 +682,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
dat->originalSplitterPos = pt.y;
if (dat->splitterPos == -1)
dat->splitterPos = dat->originalSplitterPos;// + 60;
+ }
- CustomButtonData *cbd;
- for (int i = 0; cbd = Srmm_GetNthButton(i); i++) {
- if (!cbd->m_bIMButton)
- continue;
+ Srmm_CreateToolbarIcons(hwndDlg, BBBF_ISIMBUTTON);
- HWND hwndButton = CreateWindowEx(0, L"MButtonClass", L"", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, cbd->m_iButtonWidth, 22, hwndDlg, (HMENU)cbd->m_dwButtonCID, g_hInst, NULL);
- if (cbd->m_pwszTooltip)
- SendMessage(hwndButton, BUTTONADDTOOLTIP, LPARAM(cbd->m_pwszTooltip), BATF_UNICODE);
- if (cbd->m_hIcon)
- SendMessage(hwndButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(cbd->m_hIcon));
- }
- }
WindowList_Add(pci->hWindowList, hwndDlg, dat->hContact);
GetWindowRect(GetDlgItem(hwndDlg, IDC_MESSAGE), &dat->minEditInit);
SendMessage(hwndDlg, DM_UPDATESIZEBAR, 0, 0);