summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-06-02 15:58:09 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-06-02 15:58:09 +0300
commitb97afa71c6593939d96244cd19053846b9992a61 (patch)
tree410fbcca35b76bd68793e8f04271746ba079bda4 /src/mir_app
parentb348c6840a351158d0c6c544147ba96f23cf825c (diff)
Button_SetIcon_IcoLib - a helper to set MButton's icon using an icolib handle
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/auth.cpp8
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/proto_opts.cpp10
-rw-r--r--src/mir_app/src/skinicons.cpp10
5 files changed, 20 insertions, 10 deletions
diff --git a/src/mir_app/src/auth.cpp b/src/mir_app/src/auth.cpp
index d6c76c1bfb..cc7716708a 100644
--- a/src/mir_app/src/auth.cpp
+++ b/src/mir_app/src/auth.cpp
@@ -54,8 +54,8 @@ public:
bool OnInitDialog() override
{
- Button_SetIcon_IcoLib(m_hwnd, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details"));
- Button_SetIcon_IcoLib(m_hwnd, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list"));
+ Button_SetSkin_IcoLib(m_hwnd, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details"));
+ Button_SetSkin_IcoLib(m_hwnd, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list"));
int iBlobSize = db_event_getBlobSize(m_hDbEvent);
if (iBlobSize == -1)
@@ -201,8 +201,8 @@ public:
bool OnInitDialog() override
{
- Button_SetIcon_IcoLib(m_hwnd, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details"));
- Button_SetIcon_IcoLib(m_hwnd, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list"));
+ Button_SetSkin_IcoLib(m_hwnd, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details"));
+ Button_SetSkin_IcoLib(m_hwnd, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list"));
// blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
DBEVENTINFO dbei = {};
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index c04d269389..c2b15bb198 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -22,6 +22,7 @@ IcoLib_RemoveIcon @20
IcoLib_RemoveIconByHandle @21
IcoLib_Release @22
IcoLib_AddRef @23
+Button_SetSkin_IcoLib @24
??0CProtoIntDlgBase@@QAE@ABV0@@Z @25 NONAME
??0CProtoIntDlgBase@@QAE@PAUPROTO_INTERFACE@@H@Z @26 NONAME
??0PROTO_INTERFACE@@QAE@ABU0@@Z @27 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 06c417483d..864376d2ca 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -22,6 +22,7 @@ IcoLib_RemoveIcon @20
IcoLib_RemoveIconByHandle @21
IcoLib_Release @22
IcoLib_AddRef @23
+Button_SetSkin_IcoLib @24
??0CProtoIntDlgBase@@QEAA@AEBV0@@Z @25 NONAME
??0CProtoIntDlgBase@@QEAA@PEAUPROTO_INTERFACE@@H@Z @26 NONAME
??0PROTO_INTERFACE@@QEAA@AEBU0@@Z @27 NONAME
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp
index ba38cee3b9..f64dff3ea0 100644
--- a/src/mir_app/src/proto_opts.cpp
+++ b/src/mir_app/src/proto_opts.cpp
@@ -273,11 +273,11 @@ public:
{
Window_SetSkinIcon_IcoLib(m_hwnd, SKINICON_OTHER_ACCMGR);
- Button_SetIcon_IcoLib(m_hwnd, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("New account"));
- Button_SetIcon_IcoLib(m_hwnd, IDC_EDIT, SKINICON_OTHER_RENAME, LPGEN("Edit"));
- Button_SetIcon_IcoLib(m_hwnd, IDC_REMOVE, SKINICON_OTHER_DELETE, LPGEN("Remove account"));
- Button_SetIcon_IcoLib(m_hwnd, IDC_OPTIONS, SKINICON_OTHER_OPTIONS, LPGEN("Configure..."));
- Button_SetIcon_IcoLib(m_hwnd, IDC_UPGRADE, SKINICON_OTHER_ACCMGR, LPGEN("Upgrade account"));
+ Button_SetSkin_IcoLib(m_hwnd, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("New account"));
+ Button_SetSkin_IcoLib(m_hwnd, IDC_EDIT, SKINICON_OTHER_RENAME, LPGEN("Edit"));
+ Button_SetSkin_IcoLib(m_hwnd, IDC_REMOVE, SKINICON_OTHER_DELETE, LPGEN("Remove account"));
+ Button_SetSkin_IcoLib(m_hwnd, IDC_OPTIONS, SKINICON_OTHER_OPTIONS, LPGEN("Configure..."));
+ Button_SetSkin_IcoLib(m_hwnd, IDC_UPGRADE, SKINICON_OTHER_ACCMGR, LPGEN("Upgrade account"));
m_btnEdit.Disable();
m_btnRemove.Disable();
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp
index f583de9562..73e4e6fb7e 100644
--- a/src/mir_app/src/skinicons.cpp
+++ b/src/mir_app/src/skinicons.cpp
@@ -203,7 +203,7 @@ MIR_APP_DLL(void) Window_FreeIcon_IcoLib(HWND hWnd)
IcoLib_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_SMALL, 0), false);
}
-MIR_APP_DLL(void) Button_SetIcon_IcoLib(HWND hwndDlg, int itemId, int iconId, const char *tooltip)
+MIR_APP_DLL(void) Button_SetSkin_IcoLib(HWND hwndDlg, int itemId, int iconId, const char *tooltip)
{
HWND hWnd = GetDlgItem(hwndDlg, itemId);
SendMessage(hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(iconId, false));
@@ -211,6 +211,14 @@ MIR_APP_DLL(void) Button_SetIcon_IcoLib(HWND hwndDlg, int itemId, int iconId, co
SendMessage(hWnd, BUTTONADDTOOLTIP, (WPARAM)tooltip, 0);
}
+MIR_APP_DLL(void) Button_SetIcon_IcoLib(HWND hwndDlg, int itemId, HANDLE hIcolib, const char *tooltip)
+{
+ HWND hWnd = GetDlgItem(hwndDlg, itemId);
+ SendMessage(hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(hIcolib, false));
+ SendMessage(hWnd, BUTTONSETASFLATBTN, TRUE, 0);
+ SendMessage(hWnd, BUTTONADDTOOLTIP, (WPARAM)tooltip, 0);
+}
+
MIR_APP_DLL(void) Button_FreeIcon_IcoLib(HWND hwndDlg, int itemId)
{
HICON hIcon = (HICON)SendDlgItemMessage(hwndDlg, itemId, BM_SETIMAGE, IMAGE_ICON, 0);