summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-02-20 15:20:48 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-02-20 15:20:48 +0300
commitc6a701bdc536a6ab0826462868dc8851ceb35323 (patch)
treeff84cacfbcf5622cd971765b6453506521a43e77 /src/core
parentde56963af6144f98828806a02f09c5844cd82947 (diff)
stduserinfo: another fix for missing AVS plugin
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stduserinfo/res/resource.rc43
-rw-r--r--src/core/stduserinfo/src/stdafx.h1
-rw-r--r--src/core/stduserinfo/src/stdinfo.cpp19
3 files changed, 36 insertions, 27 deletions
diff --git a/src/core/stduserinfo/res/resource.rc b/src/core/stduserinfo/res/resource.rc
index cc83b665fe..f2e7bd0f7e 100644
--- a/src/core/stduserinfo/res/resource.rc
+++ b/src/core/stduserinfo/res/resource.rc
@@ -103,27 +103,28 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- EDITTEXT IDC_NICK,3,0,146,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "First name:",IDC_STATIC,0,44,46,8
- EDITTEXT IDC_FIRSTNAME,48,44,74,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Gender:",IDC_STATIC,126,44,44,8
- EDITTEXT IDC_GENDER,168,44,53,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Last name:",IDC_STATIC,0,56,46,8
- EDITTEXT IDC_LASTNAME,48,56,74,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Age:",IDC_STATIC,126,56,44,8
- EDITTEXT IDC_AGE,168,56,53,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "E-mail:",IDC_STATIC,0,68,46,8
- CONTROL "",IDC_EMAIL,"Hyperlink",WS_TABSTOP,49,68,160,8
- LTEXT "Date of birth:",IDC_STATIC,0,80,59,8
- EDITTEXT IDC_DOBDAY,78,80,8,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_DOBMONTH,96,80,16,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_DOBYEAR,114,80,20,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- LTEXT "Marital status:",IDC_STATIC,0,92,76,8
- EDITTEXT IDC_MARITAL,76,92,87,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- EDITTEXT IDC_ADDR,1,12,124,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- PUSHBUTTON "Copy",IDC_CPADDR,138,10,83,12,BS_ICON
- EDITTEXT IDC_FN,1,24,146,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
- CONTROL "",IDC_HORLINE,"Static",SS_ETCHEDHORZ,0,38,221,1
+ EDITTEXT IDC_NICK,72,0,146,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "First name:",IDC_STATIC,0,72,46,8
+ EDITTEXT IDC_FIRSTNAME,48,72,74,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Gender:",IDC_STATIC,126,72,44,8
+ EDITTEXT IDC_GENDER,168,72,53,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Last name:",IDC_STATIC,0,84,46,8
+ EDITTEXT IDC_LASTNAME,48,84,74,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Age:",IDC_STATIC,126,84,44,8
+ EDITTEXT IDC_AGE,168,84,53,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "E-mail:",IDC_STATIC,0,96,46,8
+ CONTROL "",IDC_EMAIL,"Hyperlink",WS_TABSTOP,49,96,160,8
+ LTEXT "Date of birth:",IDC_STATIC,0,108,59,8
+ EDITTEXT IDC_DOBDAY,78,108,8,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ EDITTEXT IDC_DOBMONTH,96,108,16,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ EDITTEXT IDC_DOBYEAR,114,108,20,8,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "Marital status:",IDC_STATIC,0,120,76,8
+ EDITTEXT IDC_MARITAL,76,120,87,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ LTEXT "",IDC_AVA,0,0,66,60,NOT WS_GROUP | WS_TABSTOP
+ EDITTEXT IDC_ADDR,72,26,146,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ PUSHBUTTON "Copy",IDC_CPADDR,83,39,71,12,BS_ICON
+ EDITTEXT IDC_FN,72,13,146,8,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
+ CONTROL "",IDC_HORLINE,"Static",SS_ETCHEDHORZ,0,66,221,1
END
IDD_INFO_CONTACT DIALOGEX 0, 0, 222, 132
diff --git a/src/core/stduserinfo/src/stdafx.h b/src/core/stduserinfo/src/stdafx.h
index e11eb44fef..75bb3426d0 100644
--- a/src/core/stduserinfo/src/stdafx.h
+++ b/src/core/stduserinfo/src/stdafx.h
@@ -45,6 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <string>
#include <newpluginapi.h>
+#include <m_avatars.h>
#include <m_button.h>
#include <m_clist.h>
#include <m_contacts.h>
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp
index 9cd1fad10c..b2fed06847 100644
--- a/src/core/stduserinfo/src/stdinfo.cpp
+++ b/src/core/stduserinfo/src/stdinfo.cpp
@@ -70,10 +70,19 @@ public:
m_nickfont = CreateFontIndirect(&lf);
SendDlgItemMessage(m_hwnd, IDC_NICK, WM_SETFONT, (WPARAM)m_nickfont, 0);
- SendDlgItemMessage(m_hwnd, IDC_AVA, AVATAR_SETCONTACT, 0, m_hContact);
- SendDlgItemMessage(m_hwnd, IDC_AVA, AVATAR_SETNOAVATARTEXT, 0, (WPARAM)TranslateT("No avatar"));
- SendDlgItemMessage(m_hwnd, IDC_AVA, AVATAR_SETAVATARBORDERCOLOR, 0, 0);
-
+ if (ServiceExists(MS_AV_GETAVATARBITMAP)) {
+ RECT rc;
+ MWindow hwndAva = GetDlgItem(m_hwnd, IDC_AVA);
+ GetClientRect(hwndAva, &rc);
+ DestroyWindow(hwndAva);
+
+ hwndAva = CreateWindowW(AVATAR_CONTROL_CLASS, L"", WS_VISIBLE | WS_CHILD,
+ rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, m_hwnd, 0, g_plugin.getInst(), 0);
+
+ SendMessage(hwndAva, AVATAR_SETCONTACT, 0, m_hContact);
+ SendMessage(hwndAva, AVATAR_SETNOAVATARTEXT, 0, (WPARAM)TranslateT("No avatar"));
+ SendMessage(hwndAva, AVATAR_SETAVATARBORDERCOLOR, 0, 0);
+ }
return true;
}
@@ -127,8 +136,6 @@ public:
int Resizer(UTILRESIZECONTROL *urc) override
{
switch (urc->wId) {
- case IDC_CPADDR:
- return RD_ANCHORX_RIGHT | RD_ANCHORY_TOP;
case IDC_FN:
case IDC_ADDR:
case IDC_NICK: