diff options
author | George Hazan <ghazan@miranda.im> | 2019-04-13 20:22:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-04-13 20:22:59 +0300 |
commit | 680873487c4a7987012606119a744e5ca725ad30 (patch) | |
tree | 8e5fbc68a253c3ec44287754c9295670f1ee44c3 /plugins/UserInfoEx | |
parent | 6c4136504c660bf3359e6641362672c4b9502be5 (diff) |
merge with trunk
Diffstat (limited to 'plugins/UserInfoEx')
25 files changed, 1000 insertions, 1108 deletions
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 69d0aad715..fc32530755 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -215,23 +215,23 @@ struct WORD startDays;
WORD endDays;
LPCTSTR szZodiac;
- LPCSTR szZodiacIcon;
+ int szZodiacIcon;
}
static zodiac[] = {
- { 80, 110, LPGENW("Aries"), ICO_ZOD_ARIES }, // Widder
- { 111, 140, LPGENW("Taurus"), ICO_ZOD_TAURUS }, // Stier
- { 141, 172, LPGENW("Gemini"), ICO_ZOD_GEMINI }, // Zwillinge
- { 173, 203, LPGENW("Cancer"), ICO_ZOD_CANCER }, // Krebs
- { 204, 235, LPGENW("Leo"), ICO_ZOD_LEO }, // Löwe
- { 236, 266, LPGENW("Virgo"), ICO_ZOD_VIRGO }, // Jungfrau
- { 267, 296, LPGENW("Libra"), ICO_ZOD_LIBRA }, // Waage
- { 297, 326, LPGENW("Scorpio"), ICO_ZOD_SCORPIO }, // Scorpion
- { 327, 355, LPGENW("Sagittarius"), ICO_ZOD_SAGITTARIUS }, // Schütze
- { 356, 364, LPGENW("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
- { 1, 19, LPGENW("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
- { 20, 49, LPGENW("Aquarius"), ICO_ZOD_AQUARIUS }, // Wassermann
- { 50, 79, LPGENW("Pisces"), ICO_ZOD_PISCES }, // Fische
- { 0, 0, nullptr, "" } // end of array
+ { 80, 110, LPGENW("Aries"), IDI_ZOD_ARIES }, // Widder
+ { 111, 140, LPGENW("Taurus"), IDI_ZOD_TAURUS }, // Stier
+ { 141, 172, LPGENW("Gemini"), IDI_ZOD_GEMINI }, // Zwillinge
+ { 173, 203, LPGENW("Cancer"), IDI_ZOD_CANCER }, // Krebs
+ { 204, 235, LPGENW("Leo"), IDI_ZOD_LEO }, // Löwe
+ { 236, 266, LPGENW("Virgo"), IDI_ZOD_VIRGO }, // Jungfrau
+ { 267, 296, LPGENW("Libra"), IDI_ZOD_LIBRA }, // Waage
+ { 297, 326, LPGENW("Scorpio"), IDI_ZOD_SCORPIO }, // Scorpion
+ { 327, 355, LPGENW("Sagittarius"), IDI_ZOD_SAGITTARIUS }, // Schütze
+ { 356, 364, LPGENW("Capricorn"), IDI_ZOD_CAPRICORN }, // Steinbock
+ { 1, 19, LPGENW("Capricorn"), IDI_ZOD_CAPRICORN }, // Steinbock
+ { 20, 49, LPGENW("Aquarius"), IDI_ZOD_AQUARIUS }, // Wassermann
+ { 50, 79, LPGENW("Pisces"), IDI_ZOD_PISCES }, // Fische
+ { 0, 0, nullptr, 0 } // end of array
};
MZodiac MAnnivDate::Zodiac()
@@ -242,7 +242,7 @@ MZodiac MAnnivDate::Zodiac() for (i = 0; i < 13 && (wDays < zodiac[i].startDays || wDays > zodiac[i].endDays); i++);
MZodiac mZodiac;
- mZodiac.hIcon = IcoLib_GetIcon(zodiac[i].szZodiacIcon);
+ mZodiac.hIcon = g_plugin.getIcon(zodiac[i].szZodiacIcon);
mZodiac.pszName = zodiac[i].szZodiac;
return mZodiac;
}
@@ -692,7 +692,7 @@ static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *p MB.cbSize = sizeof(MSGBOX);
MB.hParent = nullptr;
- MB.hiLogo = IcoLib_GetIcon(ICO_DLG_ANNIVERSARY);
+ MB.hiLogo = g_plugin.getIcon(IDI_ANNIVERSARY);
MB.hiMsg = nullptr;
MB.uType = MB_YESALLNO|MB_ICON_QUESTION|MB_INFOBAR|MB_NOPOPUP;
MB.ptszTitle = LPGENW("Update custom birthday");
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp index 6f88bd700b..07ba971802 100644 --- a/plugins/UserInfoEx/src/ctrl_button.cpp +++ b/plugins/UserInfoEx/src/ctrl_button.cpp @@ -371,7 +371,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L bct->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
bct->dwStyle = cs->style;
if (cs->style & MBS_DOWNARROW)
- bct->arrow = IcoLib_GetIcon(ICO_BTN_DOWNARROW);
+ bct->arrow = g_plugin.getIcon(IDI_BTN_DOWNARROW);
LoadTheme(bct);
SetWindowLongPtr(hwndBtn, 0, (LONG_PTR)bct);
if (cs->lpszName) SetWindowText(hwndBtn, cs->lpszName);
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index d8084daaed..95abf7ae15 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -37,11 +37,11 @@ typedef struct TCbExItem DWORD dwID;
wchar_t szCat[MAX_CAT];
LPTSTR pszVal;
- LPCSTR pszIcon;
+ int iIcon;
HICON hIcon;
} CBEXITEMINTERN, *LPCBEXITEMINTERN;
-typedef struct TComboEx
+typedef struct TComboEx
{
LPCBEXITEMINTERN pItems;
int numItems;
@@ -72,12 +72,12 @@ static int CheckPhoneSyntax(LPTSTR pszSrc, LPTSTR szNumber, WORD cchNumber, int& {
int lenNum = 0;
BYTE hasLeftBreaket = FALSE,
- hasRightBreaket = FALSE;
+ hasRightBreaket = FALSE;
if (!szNumber || !pszSrc || !*pszSrc || !cchNumber) return 0;
*szNumber = 0;
errorPos = -1;
-
+
if (*pszSrc != '+') {
errorPos = 2; // set cursor after first digit
*(szNumber + lenNum++) = '+';
@@ -87,47 +87,47 @@ static int CheckPhoneSyntax(LPTSTR pszSrc, LPTSTR szNumber, WORD cchNumber, int& for (; lenNum < cchNumber - 1 && *pszSrc != 0; pszSrc++) {
switch (*pszSrc) {
- case '(':
- if (hasLeftBreaket) {
- if (errorPos == -1) errorPos = lenNum;
- break;
- }
- if (*(szNumber + lenNum - 1) != ' ') {
- *(szNumber + lenNum++) = ' ';
- if (errorPos == -1) errorPos = lenNum + 1;
- }
- *(szNumber + lenNum++) = *pszSrc;
- hasLeftBreaket = TRUE;
+ case '(':
+ if (hasLeftBreaket) {
+ if (errorPos == -1) errorPos = lenNum;
break;
+ }
+ if (*(szNumber + lenNum - 1) != ' ') {
+ *(szNumber + lenNum++) = ' ';
+ if (errorPos == -1) errorPos = lenNum + 1;
+ }
+ *(szNumber + lenNum++) = *pszSrc;
+ hasLeftBreaket = TRUE;
+ break;
- case ')':
- if (hasRightBreaket) {
- if (errorPos == -1) errorPos = lenNum;
- break;
- }
- *(szNumber + lenNum++) = *pszSrc;
- if (*(pszSrc + 1) != ' ') {
- *(szNumber + lenNum++) = ' ';
- if (errorPos == -1) errorPos = lenNum;
- }
- hasRightBreaket = TRUE;
+ case ')':
+ if (hasRightBreaket) {
+ if (errorPos == -1) errorPos = lenNum;
break;
+ }
+ *(szNumber + lenNum++) = *pszSrc;
+ if (*(pszSrc + 1) != ' ') {
+ *(szNumber + lenNum++) = ' ';
+ if (errorPos == -1) errorPos = lenNum;
+ }
+ hasRightBreaket = TRUE;
+ break;
- case ' ':
- if (*(szNumber + lenNum - 1) != ' ') {
- *(szNumber + lenNum++) = *pszSrc;
- }
- else
- if (errorPos == -1) errorPos = lenNum;
- break;
+ case ' ':
+ if (*(szNumber + lenNum - 1) != ' ') {
+ *(szNumber + lenNum++) = *pszSrc;
+ }
+ else
+ if (errorPos == -1) errorPos = lenNum;
+ break;
- default:
- if (*pszSrc >= '0' && *pszSrc <= '9' || *pszSrc == '-') {
- *(szNumber + lenNum++) = *pszSrc;
- }
- // remember first error position
- else if (errorPos == -1) errorPos = lenNum;
- break;
+ default:
+ if (*pszSrc >= '0' && *pszSrc <= '9' || *pszSrc == '-') {
+ *(szNumber + lenNum++) = *pszSrc;
+ }
+ // remember first error position
+ else if (errorPos == -1) errorPos = lenNum;
+ break;
}
}
*(szNumber + lenNum) = 0;
@@ -142,19 +142,19 @@ static int CheckPhoneSyntax(LPTSTR pszSrc, LPTSTR szNumber, WORD cchNumber, int& **/
static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- LPCBEXITEM cbi = (LPCBEXITEM)GetUserData(hDlg);
+ CBEXITEM *cbi = (CBEXITEM*)GetUserData(hDlg);
switch (msg) {
case WM_INITDIALOG:
- cbi = (LPCBEXITEM)lParam;
+ cbi = (CBEXITEM*)lParam;
if (!cbi)
return FALSE;
SetUserData(hDlg, lParam);
- SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_SETICON, 0, (LPARAM)IcoLib_GetIcon(ICO_DLG_EMAIL, TRUE));
+ SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_SETICON, 0, (LPARAM)g_plugin.getIcon(IDI_DLG_EMAIL, true));
if (g_plugin.getByte(SET_ICONS_BUTTONS, 1)) {
- SendDlgItemMessage(hDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_OK));
- SendDlgItemMessage(hDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_CANCEL));
+ SendDlgItemMessage(hDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_BTN_OK));
+ SendDlgItemMessage(hDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_BTN_CLOSE));
}
if (*cbi->pszVal)
@@ -186,7 +186,8 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM case WM_COMMAND:
switch (LOWORD(wParam)) {
- case IDOK: {
+ case IDOK:
+ {
if (HIWORD(wParam) == BN_CLICKED) {
if (cbi->pszVal && cbi->ccVal > 0)
GetDlgItemText(hDlg, EDIT_EMAIL, cbi->pszVal, cbi->ccVal);
@@ -195,26 +196,27 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM }
break;
}
- case IDCANCEL: {
- if (HIWORD(wParam) == BN_CLICKED)
+ case IDCANCEL:
+ {
+ if (HIWORD(wParam) == BN_CLICKED)
EndDialog(hDlg, LOWORD(wParam));
break;
}
- case EDIT_EMAIL:
- if (HIWORD(wParam) == EN_UPDATE) {
- wchar_t szText[MAXDATASIZE];
- LPTSTR pszAdd, pszDot;
- if (PtrIsValid(cbi)) {
- GetWindowText((HWND)lParam, szText, _countof(szText));
- EnableWindow(GetDlgItem(hDlg, IDOK),
- ((pszAdd = wcschr(szText, '@')) &&
+ case EDIT_EMAIL:
+ if (HIWORD(wParam) == EN_UPDATE) {
+ wchar_t szText[MAXDATASIZE];
+ LPTSTR pszAdd, pszDot;
+ if (PtrIsValid(cbi)) {
+ GetWindowText((HWND)lParam, szText, _countof(szText));
+ EnableWindow(GetDlgItem(hDlg, IDOK),
+ ((pszAdd = wcschr(szText, '@')) &&
*(pszAdd + 1) != '.' &&
(pszDot = wcschr(pszAdd, '.')) &&
*(pszDot + 1) &&
mir_wstrcmp(szText, cbi->pszVal)));
- }
}
- break;
+ }
+ break;
}
break;
}
@@ -229,7 +231,7 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM **/
INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- LPCBEXITEM cbi = (LPCBEXITEM)GetUserData(hDlg);
+ CBEXITEM *cbi = (CBEXITEM*)GetUserData(hDlg);
static int noRecursion = 0;
switch (msg) {
@@ -239,14 +241,14 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam LPIDSTRLIST pCountries;
HWND hCombo = GetDlgItem(hDlg, EDIT_COUNTRY);
- cbi = (LPCBEXITEM)lParam;
+ cbi = (CBEXITEM*)lParam;
if (!cbi) return FALSE;
SetUserData(hDlg, lParam);
- SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_SETICON, 0, (LPARAM)IcoLib_GetIcon(ICO_DLG_PHONE, TRUE));
+ SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_SETICON, 0, (LPARAM)g_plugin.getIcon(IDI_DLG_PHONE, TRUE));
if (g_plugin.getByte(SET_ICONS_BUTTONS, 1)) {
- SendDlgItemMessage(hDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_OK));
- SendDlgItemMessage(hDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_CANCEL));
+ SendDlgItemMessage(hDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_BTN_OK));
+ SendDlgItemMessage(hDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_BTN_CLOSE));
}
// translate Userinfo buttons
@@ -290,28 +292,28 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam case WM_COMMAND:
switch (LOWORD(wParam)) {
- case IDOK:
- if (HIWORD(wParam) == BN_CLICKED) {
- wchar_t szText[MAXDATASIZE];
- int errorPos;
-
- if (!GetDlgItemText(hDlg, EDIT_PHONE, szText, _countof(szText)) || !CheckPhoneSyntax(szText, cbi->pszVal, cbi->ccVal, errorPos) || errorPos > -1) {
- MsgErr(hDlg, TranslateT("The phone number should start with a + and consist of\nnumbers, spaces, brackets and hyphens only."));
- break;
- }
- // save category string
- GetDlgItemText(hDlg, EDIT_CATEGORY, cbi->pszCat, cbi->ccCat);
+ case IDOK:
+ if (HIWORD(wParam) == BN_CLICKED) {
+ wchar_t szText[MAXDATASIZE];
+ int errorPos;
- // save SMS flag
- if ((int)IsDlgButtonChecked(hDlg, CHECK_SMS) != ((cbi->wFlags & CBEXIF_SMS) == CBEXIF_SMS))
- cbi->wFlags ^= CBEXIF_SMS;
+ if (!GetDlgItemText(hDlg, EDIT_PHONE, szText, _countof(szText)) || !CheckPhoneSyntax(szText, cbi->pszVal, cbi->ccVal, errorPos) || errorPos > -1) {
+ MsgErr(hDlg, TranslateT("The phone number should start with a + and consist of\nnumbers, spaces, brackets and hyphens only."));
+ break;
}
- __fallthrough;
+ // save category string
+ GetDlgItemText(hDlg, EDIT_CATEGORY, cbi->pszCat, cbi->ccCat);
- case IDCANCEL:
- if (HIWORD(wParam) == BN_CLICKED)
- EndDialog(hDlg, wParam);
- break;
+ // save SMS flag
+ if ((int)IsDlgButtonChecked(hDlg, CHECK_SMS) != ((cbi->wFlags & CBEXIF_SMS) == CBEXIF_SMS))
+ cbi->wFlags ^= CBEXIF_SMS;
+ }
+ __fallthrough;
+
+ case IDCANCEL:
+ if (HIWORD(wParam) == BN_CLICKED)
+ EndDialog(hDlg, wParam);
+ break;
case EDIT_COUNTRY:
if (HIWORD(wParam) != CBN_SELCHANGE)
@@ -396,156 +398,156 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam * lParam - message specific
* return: message specific
**/
-static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPCBEX cbex = (LPCBEX)GetWindowLongPtr(hwnd, 0);
switch (msg) {
- /**
- * name: WM_NCCREATE
- * desc: is called to initiate the window creation
- * param: wParam - not used
- * lParam - pointer to a CREATESTRUCT
- *
- * return: FALSE on error, TRUE if initialisation was ok
- **/
- case WM_NCCREATE:
- {
- LPCREATESTRUCT cs = (LPCREATESTRUCT)lParam;
-
- if (!(cbex = (LPCBEX)mir_calloc(1*sizeof(CBEX))))
- return FALSE;
- SetWindowLongPtr(hwnd, 0, (LONG_PTR)cbex);
- cbex->bLocked = 1;
- cbex->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
- cbex->hInstance = cs->hInstance;
- cbex->iSelectedItem = -1;
- cbex->rect.left = cs->x;
- cbex->rect.top = cs->y;
- cbex->rect.right = cs->x + cs->cx;
- cbex->rect.bottom = cs->y + cs->cy;
- return TRUE;
- }
-
- /**
+ /**
* name: WM_NCCREATE
- * desc: is called to create all subitems
+ * desc: is called to initiate the window creation
* param: wParam - not used
- * lParam - not used
+ * lParam - pointer to a CREATESTRUCT
*
* return: FALSE on error, TRUE if initialisation was ok
**/
+ case WM_NCCREATE:
+ {
+ LPCREATESTRUCT cs = (LPCREATESTRUCT)lParam;
+
+ if (!(cbex = (LPCBEX)mir_calloc(1 * sizeof(CBEX))))
+ return FALSE;
+ SetWindowLongPtr(hwnd, 0, (LONG_PTR)cbex);
+ cbex->bLocked = 1;
+ cbex->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
+ cbex->hInstance = cs->hInstance;
+ cbex->iSelectedItem = -1;
+ cbex->rect.left = cs->x;
+ cbex->rect.top = cs->y;
+ cbex->rect.right = cs->x + cs->cx;
+ cbex->rect.bottom = cs->y + cs->cy;
+ return TRUE;
+ }
+
+ /**
+ * name: WM_NCCREATE
+ * desc: is called to create all subitems
+ * param: wParam - not used
+ * lParam - not used
+ *
+ * return: FALSE on error, TRUE if initialisation was ok
+ **/
case WM_CREATE:
- {
- WORD wHeight = (WORD)(cbex->rect.bottom - cbex->rect.top);
- WORD wWidth = 130;
- WORD x = 0;
+ {
+ WORD wHeight = (WORD)(cbex->rect.bottom - cbex->rect.top);
+ WORD wWidth = 130;
+ WORD x = 0;
- if (!(cbex->hBtnEdit = CreateWindowEx(WS_EX_NOPARENTNOTIFY,
- UINFOBUTTONCLASS,
+ if (!(cbex->hBtnEdit = CreateWindowEx(WS_EX_NOPARENTNOTIFY,
+ UINFOBUTTONCLASS,
L"none",
- WS_VISIBLE|WS_CHILD|WS_TABSTOP, 0, 0,
+ WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0,
wWidth, wHeight,
hwnd,
nullptr,
cbex->hInstance, nullptr))) {
- cbex->bLocked = 0;
- return FALSE;
- }
- x += wWidth + 2;
- wWidth = wHeight;
- if (!(cbex->hBtnMenu = CreateWindowEx(WS_EX_NOPARENTNOTIFY,
+ cbex->bLocked = 0;
+ return FALSE;
+ }
+ x += wWidth + 2;
+ wWidth = wHeight;
+ if (!(cbex->hBtnMenu = CreateWindowEx(WS_EX_NOPARENTNOTIFY,
UINFOBUTTONCLASS,
nullptr,
- WS_VISIBLE|WS_CHILD|WS_TABSTOP|MBS_PUSHBUTTON|MBS_DOWNARROW,
+ WS_VISIBLE | WS_CHILD | WS_TABSTOP | MBS_PUSHBUTTON | MBS_DOWNARROW,
x, 0,
wWidth, wHeight,
hwnd,
nullptr,
cbex->hInstance, nullptr))) {
- DestroyWindow(cbex->hBtnEdit);
- cbex->bLocked = 0;
- return FALSE;
- }
- x += wWidth + 2;
- wWidth = (WORD)(cbex->rect.right - cbex->rect.left - x - (2 * (wHeight + 2)));
- if (!(cbex->hEdit = CreateWindowEx(WS_EX_CLIENTEDGE,
- L"Edit",
+ DestroyWindow(cbex->hBtnEdit);
+ cbex->bLocked = 0;
+ return FALSE;
+ }
+ x += wWidth + 2;
+ wWidth = (WORD)(cbex->rect.right - cbex->rect.left - x - (2 * (wHeight + 2)));
+ if (!(cbex->hEdit = CreateWindowEx(WS_EX_CLIENTEDGE,
+ L"Edit",
nullptr,
- WS_VISIBLE|WS_CHILD|WS_TABSTOP|ES_AUTOHSCROLL,
+ WS_VISIBLE | WS_CHILD | WS_TABSTOP | ES_AUTOHSCROLL,
x, 1,
- wWidth, wHeight - 2,
+ wWidth, wHeight - 2,
hwnd,
nullptr,
cbex->hInstance, nullptr))) {
- DestroyWindow(cbex->hBtnEdit);
- DestroyWindow(cbex->hBtnMenu);
- cbex->bLocked = 0;
- return FALSE;
- }
- x += wWidth + 2;
- wWidth = wHeight;
- if (!(cbex->hBtnAdd = CreateWindowEx(WS_EX_NOPARENTNOTIFY,
+ DestroyWindow(cbex->hBtnEdit);
+ DestroyWindow(cbex->hBtnMenu);
+ cbex->bLocked = 0;
+ return FALSE;
+ }
+ x += wWidth + 2;
+ wWidth = wHeight;
+ if (!(cbex->hBtnAdd = CreateWindowEx(WS_EX_NOPARENTNOTIFY,
UINFOBUTTONCLASS,
nullptr,
- WS_VISIBLE|WS_CHILD|WS_TABSTOP|MBS_FLAT,
+ WS_VISIBLE | WS_CHILD | WS_TABSTOP | MBS_FLAT,
x, 0,
wWidth, wHeight,
hwnd,
nullptr,
cbex->hInstance, nullptr))) {
- DestroyWindow(cbex->hBtnEdit);
- DestroyWindow(cbex->hBtnMenu);
- DestroyWindow(cbex->hEdit);
- cbex->bLocked = 0;
- return FALSE;
- }
- x += wWidth + 2;
- if (!(cbex->hBtnDel = CreateWindowEx(WS_EX_NOPARENTNOTIFY,
+ DestroyWindow(cbex->hBtnEdit);
+ DestroyWindow(cbex->hBtnMenu);
+ DestroyWindow(cbex->hEdit);
+ cbex->bLocked = 0;
+ return FALSE;
+ }
+ x += wWidth + 2;
+ if (!(cbex->hBtnDel = CreateWindowEx(WS_EX_NOPARENTNOTIFY,
UINFOBUTTONCLASS,
nullptr,
- WS_VISIBLE|WS_CHILD|WS_TABSTOP|MBS_FLAT,
+ WS_VISIBLE | WS_CHILD | WS_TABSTOP | MBS_FLAT,
x, 0,
wWidth, wHeight,
hwnd,
nullptr,
cbex->hInstance, nullptr))) {
- DestroyWindow(cbex->hBtnEdit);
- DestroyWindow(cbex->hBtnMenu);
- DestroyWindow(cbex->hEdit);
- DestroyWindow(cbex->hBtnAdd);
+ DestroyWindow(cbex->hBtnEdit);
+ DestroyWindow(cbex->hBtnMenu);
+ DestroyWindow(cbex->hEdit);
+ DestroyWindow(cbex->hBtnAdd);
+ cbex->bLocked = 0;
+ return FALSE;
+ }
+
+ // set ids
+ SetWindowLongPtr(cbex->hBtnEdit, GWLP_ID, BTN_EDIT);
+ SetWindowLongPtr(cbex->hBtnMenu, GWLP_ID, BTN_MENU);
+ SetWindowLongPtr(cbex->hEdit, GWLP_ID, EDIT_VALUE);
+ SetWindowLongPtr(cbex->hBtnAdd, GWLP_ID, BTN_ADD);
+ SetWindowLongPtr(cbex->hBtnDel, GWLP_ID, BTN_DEL);
+ // set fonts & maximum edit control charachters
+ SendMessage(cbex->hEdit, WM_SETFONT, (WPARAM)cbex->hFont, NULL);
+ SendMessage(cbex->hEdit, EM_LIMITTEXT, (WPARAM)MAXDATASIZE, NULL);
+ // add tooltips
+ SendMessage(cbex->hBtnMenu, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Choose the item to display"), MBBF_TCHAR);
+ SendMessage(cbex->hBtnEdit, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Edit the currently displayed item"), MBBF_TCHAR);
+ SendMessage(cbex->hBtnAdd, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Add a new custom item"), MBBF_TCHAR);
+ SendMessage(cbex->hBtnDel, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete the selected item"), MBBF_TCHAR);
+ // reload icons
+ CtrlContactWndProc(hwnd, WM_SETICON, NULL, NULL);
cbex->bLocked = 0;
- return FALSE;
+ return TRUE;
}
- // set ids
- SetWindowLongPtr(cbex->hBtnEdit, GWLP_ID, BTN_EDIT);
- SetWindowLongPtr(cbex->hBtnMenu, GWLP_ID, BTN_MENU);
- SetWindowLongPtr(cbex->hEdit, GWLP_ID, EDIT_VALUE);
- SetWindowLongPtr(cbex->hBtnAdd, GWLP_ID, BTN_ADD);
- SetWindowLongPtr(cbex->hBtnDel, GWLP_ID, BTN_DEL);
- // set fonts & maximum edit control charachters
- SendMessage(cbex->hEdit, WM_SETFONT, (WPARAM)cbex->hFont, NULL);
- SendMessage(cbex->hEdit, EM_LIMITTEXT, (WPARAM)MAXDATASIZE, NULL);
- // add tooltips
- SendMessage(cbex->hBtnMenu, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Choose the item to display"), MBBF_TCHAR);
- SendMessage(cbex->hBtnEdit, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Edit the currently displayed item"), MBBF_TCHAR);
- SendMessage(cbex->hBtnAdd, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Add a new custom item"), MBBF_TCHAR);
- SendMessage(cbex->hBtnDel, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Delete the selected item"), MBBF_TCHAR);
- // reload icons
- CtrlContactWndProc(hwnd, WM_SETICON, NULL, NULL);
- cbex->bLocked = 0;
- return TRUE;
- }
-
- /**
- * name: WM_DESTROY
- * desc: default destroy message, so clear up memory
- * param: wParam - not used
- * lParam - not used
- * return: return value of DefWindowProc
- **/
+ /**
+ * name: WM_DESTROY
+ * desc: default destroy message, so clear up memory
+ * param: wParam - not used
+ * lParam - not used
+ * return: return value of DefWindowProc
+ **/
case WM_DESTROY:
CtrlContactWndProc(hwnd, CBEXM_DELALLITEMS, NULL, NULL);
DestroyWindow(cbex->hBtnEdit);
@@ -556,15 +558,15 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L MIR_FREE(cbex);
break;
- /**
- * name: WM_CTLCOLOREDIT
- * desc: is called on a paint message for a dialog item to determine its colour scheme
- * param: wParam - pointer to a HDC
- * lParam - pointer to a HWND
- * return: a brush
- **/
+ /**
+ * name: WM_CTLCOLOREDIT
+ * desc: is called on a paint message for a dialog item to determine its colour scheme
+ * param: wParam - pointer to a HDC
+ * lParam - pointer to a HWND
+ * return: a brush
+ **/
case WM_CTLCOLOREDIT:
- if (!g_plugin.getByte(SET_PROPSHEET_SHOWCOLOURS, 1) || (HWND)lParam != cbex->hEdit || !cbex->pItems || cbex->iSelectedItem < 0)
+ if (!g_plugin.getByte(SET_PROPSHEET_SHOWCOLOURS, 1) || (HWND)lParam != cbex->hEdit || !cbex->pItems || cbex->iSelectedItem < 0)
break;
return Ctrl_SetTextColour((HDC)wParam, cbex->pItems[cbex->iSelectedItem].wFlags);
@@ -572,39 +574,39 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if ((HWND)lParam == cbex->hEdit)
return (INT_PTR)GetSysColor(COLOR_WINDOW);
return FALSE;
- /**
- * name: WM_SETICON
- * desc: updates the icons of this control
- * param: wParam - not used
- * lParam - not used
- * return: always 0
- **/
+ /**
+ * name: WM_SETICON
+ * desc: updates the icons of this control
+ * param: wParam - not used
+ * lParam - not used
+ * return: always 0
+ **/
case WM_SETICON:
- {
- HICON hIcon = IcoLib_GetIcon(ICO_BTN_ADD);
- SendMessage(cbex->hBtnAdd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- SetWindowText(cbex->hBtnAdd, (hIcon ? L"" : L"+"));
+ {
+ HICON hIcon = g_plugin.getIcon(IDI_BTN_ADD);
+ SendMessage(cbex->hBtnAdd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
+ SetWindowText(cbex->hBtnAdd, (hIcon ? L"" : L"+"));
- hIcon = IcoLib_GetIcon(ICO_BTN_DELETE);
- SendMessage(cbex->hBtnDel, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- SetWindowText(cbex->hBtnDel, (hIcon ? L"" : L"-"));
+ hIcon = g_plugin.getIcon(IDI_BTN_DELETE);
+ SendMessage(cbex->hBtnDel, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
+ SetWindowText(cbex->hBtnDel, (hIcon ? L"" : L"-"));
- if (cbex->pItems && cbex->numItems > 0) {
- for (int i = 0; i < cbex->numItems; i++)
- cbex->pItems[i].hIcon = IcoLib_GetIcon(cbex->pItems[i].pszIcon);
+ if (cbex->pItems && cbex->numItems > 0) {
+ for (int i = 0; i < cbex->numItems; i++)
+ cbex->pItems[i].hIcon = g_plugin.getIcon(cbex->pItems[i].iIcon);
- if (cbex->iSelectedItem >= 0 && cbex->iSelectedItem < cbex->numItems)
- SendMessage(cbex->hBtnEdit, BM_SETIMAGE, IMAGE_ICON, (LPARAM)cbex->pItems[cbex->iSelectedItem].hIcon);
+ if (cbex->iSelectedItem >= 0 && cbex->iSelectedItem < cbex->numItems)
+ SendMessage(cbex->hBtnEdit, BM_SETIMAGE, IMAGE_ICON, (LPARAM)cbex->pItems[cbex->iSelectedItem].hIcon);
+ }
+ return 0;
}
- return 0;
- }
case WM_COMMAND:
switch (LOWORD(wParam)) {
- /**
- * name: BTN_MENU
- * desc: the button to dropdown the list to show all items is pressed
- **/
+ /**
+ * name: BTN_MENU
+ * desc: the button to dropdown the list to show all items is pressed
+ **/
case BTN_MENU:
if (HIWORD(wParam) == BN_CLICKED) {
POINT pt = { 0, 0 };
@@ -617,7 +619,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
- mii.fMask = MIIM_ID|MIIM_STRING|MIIM_FTYPE|MIIM_STATE;
+ mii.fMask = MIIM_ID | MIIM_STRING | MIIM_FTYPE | MIIM_STATE;
mii.fType = MFT_STRING;
// insert the items
@@ -642,7 +644,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
ClientToScreen((HWND)lParam, &pt);
GetClientRect((HWND)lParam, &rc);
- i = TrackPopupMenuEx(hMenu, TPM_RIGHTALIGN|TPM_RETURNCMD, pt.x + rc.right, pt.y + rc.bottom, hwnd, nullptr);
+ i = TrackPopupMenuEx(hMenu, TPM_RIGHTALIGN | TPM_RETURNCMD, pt.x + rc.right, pt.y + rc.bottom, hwnd, nullptr);
SendMessage(cbex->hBtnMenu, BM_SETCHECK, NULL, NULL);
if (i >= CBEXM_MENIITEMFIRST && i < CBEXM_MENIITEMFIRST + cbex->numItems) {
CtrlContactWndProc(hwnd, CBEXM_SETCURSEL, (WPARAM)i - CBEXM_MENIITEMFIRST, NULL);
@@ -652,10 +654,10 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
break;
- /**
- * name: BTN_ADD
- * desc: the button to add a new entry is pressed
- **/
+ /**
+ * name: BTN_ADD
+ * desc: the button to add a new entry is pressed
+ **/
case BTN_ADD:
if (HIWORD(wParam) == BN_CLICKED) {
DLGPROC dlgProc;
@@ -668,24 +670,24 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L SetFocus((HWND)lParam);
if (!(hDlgDetails = GetParent(GetParent(hwnd)))) return 1;
if (SendMessage(hDlgDetails, PSM_ISLOCKED, NULL, NULL)) return 0;
-
+
switch (GetWindowLongPtr(hwnd, GWLP_ID)) {
- case EDIT_PHONE:
- dlgID = IDD_ADDPHONE;
- dlgProc = DlgProc_Phone;
- cbi.pszIcon = ICO_BTN_CUSTOMPHONE;
- break;
- case EDIT_EMAIL:
- dlgID = IDD_ADDEMAIL;
- dlgProc = DlgProc_EMail;
- cbi.pszIcon = ICO_BTN_EMAIL;
- break;
- default:
- return 1;
+ case EDIT_PHONE:
+ dlgID = IDD_ADDPHONE;
+ dlgProc = DlgProc_Phone;
+ cbi.iIcon = IDI_BTN_CUSTOMPHONE;
+ break;
+ case EDIT_EMAIL:
+ dlgID = IDD_ADDEMAIL;
+ dlgProc = DlgProc_EMail;
+ cbi.iIcon = IDI_BTN_EMAIL;
+ break;
+ default:
+ return 1;
}
-
+
cbi.iItem = -1;
- cbi.wMask = CBEXIM_CAT|CBEXIM_VAL|CBEXIM_FLAGS|CBEXIM_ICONTEXT;
+ cbi.wMask = CBEXIM_CAT | CBEXIM_VAL | CBEXIM_FLAGS | CBEXIM_ICONTEXT;
cbi.pszCat = szCat;
cbi.pszVal = szVal;
cbi.ccCat = MAX_CAT;
@@ -695,7 +697,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(dlgID), GetParent(hwnd), dlgProc, (LPARAM)&cbi) == IDOK) {
MCONTACT hContact = NULL;
-
+
SendMessage(hDlgDetails, PSM_GETCONTACT, NULL, (LPARAM)&hContact);
if (hContact) cbi.wFlags |= CTRLF_HASCUSTOM;
cbi.wFlags |= CTRLF_CHANGED;
@@ -709,10 +711,10 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
break;
- /**
- * name: BTN_EDIT
- * desc: the button to edit an existing entry is pressed
- **/
+ /**
+ * name: BTN_EDIT
+ * desc: the button to edit an existing entry is pressed
+ **/
case BTN_EDIT:
if (HIWORD(wParam) == BN_CLICKED) {
DLGPROC dlgProc;
@@ -728,20 +730,20 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (!cbex->pItems || cbex->iSelectedItem == -1) return 0;
switch (GetWindowLongPtr(hwnd, GWLP_ID)) {
- case EDIT_PHONE:
- dlgID = IDD_ADDPHONE;
- dlgProc = DlgProc_Phone;
- break;
- case EDIT_EMAIL:
- dlgID = IDD_ADDEMAIL;
- dlgProc = DlgProc_EMail;
- break;
- default:
- return 1;
+ case EDIT_PHONE:
+ dlgID = IDD_ADDPHONE;
+ dlgProc = DlgProc_Phone;
+ break;
+ case EDIT_EMAIL:
+ dlgID = IDD_ADDEMAIL;
+ dlgProc = DlgProc_EMail;
+ break;
+ default:
+ return 1;
}
cbi.iItem = cbex->iSelectedItem;
cbi.dwID = 0;
- cbi.wMask = CBEXIM_CAT|CBEXIM_VAL|CBEXIM_FLAGS;
+ cbi.wMask = CBEXIM_CAT | CBEXIM_VAL | CBEXIM_FLAGS;
cbi.pszCat = szCat;
cbi.pszVal = szVal;
cbi.ccCat = MAX_CAT;
@@ -765,32 +767,31 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
break;
- /**
- * name: BTN_DEL
- * desc: the button to delete an existing entry is pressed
- **/
+ /**
+ * name: BTN_DEL
+ * desc: the button to delete an existing entry is pressed
+ **/
case BTN_DEL:
if (HIWORD(wParam) == BN_CLICKED) {
HWND hDlgDetails;
MSGBOX mBox;
wchar_t szMsg[MAXDATASIZE];
-
+
SetFocus((HWND)lParam);
if (!(hDlgDetails = GetParent(GetParent(hwnd))) ||
- SendMessage(hDlgDetails, PSM_ISLOCKED, NULL, NULL) ||
- !cbex->pItems ||
- cbex->iSelectedItem < 0 ||
- cbex->iSelectedItem >= cbex->numItems ||
- FAILED(mir_snwprintf(szMsg, TranslateT("Do you really want to delete the current selected item?\n\t%s\n\t%s"),
+ SendMessage(hDlgDetails, PSM_ISLOCKED, NULL, NULL) ||
+ !cbex->pItems ||
+ cbex->iSelectedItem < 0 ||
+ cbex->iSelectedItem >= cbex->numItems ||
+ FAILED(mir_snwprintf(szMsg, TranslateT("Do you really want to delete the current selected item?\n\t%s\n\t%s"),
cbex->pItems[cbex->iSelectedItem].szCat, cbex->pItems[cbex->iSelectedItem].pszVal))
- )
- {
- return 1;
+ ) {
+ return 1;
}
mBox.cbSize = sizeof(MSGBOX);
mBox.hParent = hDlgDetails;
- mBox.hiLogo = IcoLib_GetIcon(ICO_DLG_PHONE);
- mBox.uType = MB_YESNO|MB_ICON_QUESTION|MB_NOPOPUP;
+ mBox.hiLogo = g_plugin.getIcon(IDI_DLG_PHONE);
+ mBox.uType = MB_YESNO | MB_ICON_QUESTION | MB_NOPOPUP;
mBox.ptszTitle = TranslateT("Delete");
mBox.ptszMsg = szMsg;
if (IDYES == MsgBoxService(NULL, (LPARAM)&mBox)) {
@@ -802,16 +803,16 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L cbex->pItems[cbex->iSelectedItem].wFlags |= CTRLF_CHANGED;
}
// clear values for customized database entry
- else
- if (cbex->pItems[cbex->iSelectedItem].dwID != 0) {
- MIR_FREE(cbex->pItems[cbex->iSelectedItem].pszVal);
- *cbex->pItems[cbex->iSelectedItem].szCat = 0;
- cbex->pItems[cbex->iSelectedItem].wFlags |= CTRLF_CHANGED|CBEXIF_DELETED;
- CtrlContactWndProc(hwnd, CBEXM_SETCURSEL, cbex->iSelectedItem - 1, FALSE);
- }
- // delete default entry
else
- CtrlContactWndProc(hwnd, CBEXM_DELITEM, NULL, cbex->iSelectedItem);
+ if (cbex->pItems[cbex->iSelectedItem].dwID != 0) {
+ MIR_FREE(cbex->pItems[cbex->iSelectedItem].pszVal);
+ *cbex->pItems[cbex->iSelectedItem].szCat = 0;
+ cbex->pItems[cbex->iSelectedItem].wFlags |= CTRLF_CHANGED | CBEXIF_DELETED;
+ CtrlContactWndProc(hwnd, CBEXM_SETCURSEL, cbex->iSelectedItem - 1, FALSE);
+ }
+ // delete default entry
+ else
+ CtrlContactWndProc(hwnd, CBEXM_DELITEM, NULL, cbex->iSelectedItem);
SendMessage(hDlgDetails, PSM_CHANGED, NULL, NULL);
cbex->bIsChanged = TRUE;
@@ -820,30 +821,30 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
break;
- /**
- * name: EDIT_VALUE
- * desc: the edit control wants us to act
- **/
+ /**
+ * name: EDIT_VALUE
+ * desc: the edit control wants us to act
+ **/
case EDIT_VALUE:
switch (HIWORD(wParam)) {
- case EN_UPDATE:
+ case EN_UPDATE:
{
wchar_t szVal[MAXDATASIZE] = { 0 };
int ccVal;
MCONTACT hContact;
HWND hDlgDetails = GetParent(GetParent(hwnd));
-
+
EnableWindow(cbex->hBtnDel, GetWindowTextLength(cbex->hEdit) > 0);
if (SendMessage(hDlgDetails, PSM_ISLOCKED, NULL, NULL) ||
- cbex->bLocked ||
- !cbex->pItems ||
- cbex->iSelectedItem < 0 ||
+ cbex->bLocked ||
+ !cbex->pItems ||
+ cbex->iSelectedItem < 0 ||
cbex->iSelectedItem >= cbex->numItems) return 1;
// get the edit control's text value and check it for syntax
switch (GetWindowLongPtr(hwnd, GWLP_ID)) {
- case EDIT_PHONE:
+ case EDIT_PHONE:
{
int errorPos;
wchar_t szEdit[MAXDATASIZE];
@@ -856,17 +857,17 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
break;
}
- case EDIT_EMAIL:
- ccVal = GetWindowText(cbex->hEdit, szVal, _countof(szVal));
- break;
- default:
- ccVal = GetWindowText(cbex->hEdit, szVal, _countof(szVal));
- break;
+ case EDIT_EMAIL:
+ ccVal = GetWindowText(cbex->hEdit, szVal, _countof(szVal));
+ break;
+ default:
+ ccVal = GetWindowText(cbex->hEdit, szVal, _countof(szVal));
+ break;
}
-
+
SendMessage(hDlgDetails, PSM_GETCONTACT, NULL, (LPARAM)&hContact);
if ((cbex->pItems[cbex->iSelectedItem].wFlags & CTRLF_CHANGED) && !(hContact && (cbex->pItems[cbex->iSelectedItem].wFlags & CTRLF_HASCUSTOM))) return 0;
-
+
if (*szVal == 0 || !cbex->pItems[cbex->iSelectedItem].pszVal || mir_wstrcmp(szVal, cbex->pItems[cbex->iSelectedItem].pszVal)) {
cbex->pItems[cbex->iSelectedItem].wFlags |= CTRLF_CHANGED;
cbex->pItems[cbex->iSelectedItem].wFlags |= (hContact ? CTRLF_HASCUSTOM : CTRLF_HASPROTO);
@@ -876,10 +877,10 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
return 0;
}
- case EN_KILLFOCUS:
+ case EN_KILLFOCUS:
{
int ccText;
-
+
if (!cbex->pItems || cbex->iSelectedItem < 0 || cbex->iSelectedItem >= cbex->numItems) return 1;
if (!(cbex->pItems[cbex->iSelectedItem].wFlags & CTRLF_CHANGED)) return 0;
@@ -895,10 +896,10 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L cbex->bIsChanged = TRUE;
}
else
- if (cbex->pItems[cbex->iSelectedItem].pszVal = (LPTSTR)mir_realloc(cbex->pItems[cbex->iSelectedItem].pszVal, (ccText + 2) * sizeof(wchar_t))) {
- cbex->pItems[cbex->iSelectedItem].pszVal[ccText + 1] = 0;
- GetWindowText(cbex->hEdit, cbex->pItems[cbex->iSelectedItem].pszVal, ccText + 1);
- }
+ if (cbex->pItems[cbex->iSelectedItem].pszVal = (LPTSTR)mir_realloc(cbex->pItems[cbex->iSelectedItem].pszVal, (ccText + 2) * sizeof(wchar_t))) {
+ cbex->pItems[cbex->iSelectedItem].pszVal[ccText + 1] = 0;
+ GetWindowText(cbex->hEdit, cbex->pItems[cbex->iSelectedItem].pszVal, ccText + 1);
+ }
return 0;
}
}
@@ -906,237 +907,237 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
break;
- /**
- * name: CBEXM_ADDITEM
- * desc: add a item to the control
- * param: wParam - not used
- * lParam - (LPCBEXITEM)&item
- * return: CB_ERR on failure, new item index if successful
- **/
+ /**
+ * name: CBEXM_ADDITEM
+ * desc: add a item to the control
+ * param: wParam - not used
+ * lParam - (LPCBEXITEM)&item
+ * return: CB_ERR on failure, new item index if successful
+ **/
case CBEXM_ADDITEM:
- {
- LPCBEXITEM pItem = (LPCBEXITEM)lParam;
-
- if (!pItem) return FALSE;
-
- // if an item with the id of pItem exists, change it instead of adding a new one
- // but only if it has not been changed by the user yet.
- if ((pItem->wMask & CBEXIM_ID) && cbex->pItems && pItem->dwID != 0) {
- int iIndex;
-
- for (iIndex = 0; iIndex < cbex->numItems; iIndex++) {
- if (cbex->pItems[iIndex].dwID == pItem->dwID) {
- pItem->iItem = iIndex;
- if (cbex->pItems[iIndex].wFlags & CTRLF_CHANGED)
- pItem->wFlags |= CTRLF_CHANGED;
- else
- CtrlContactWndProc(hwnd, CBEXM_SETITEM, 0, lParam);
- return iIndex;
- }
- }
- }
+ {
+ CBEXITEM *pItem = (CBEXITEM*)lParam;
- // add a new item to the combobox
- if (!(cbex->pItems = (LPCBEXITEMINTERN)mir_realloc(cbex->pItems, (cbex->numItems + 1) * sizeof(CBEXITEMINTERN)))) {
- cbex->numItems = 0;
- return CB_ERR;
- }
-
- // set the ID
- cbex->pItems[cbex->numItems].dwID = (pItem->wMask & CBEXIM_ID) ? pItem->dwID : 0;
+ if (!pItem) return FALSE;
- // set category string
- if (!pItem->pszCat || !pItem->pszCat[0] || !mir_wstrncpy(cbex->pItems[cbex->numItems].szCat, pItem->pszCat, MAX_CAT)) {
- mir_snwprintf(cbex->pItems[cbex->numItems].szCat, L"%s %d", TranslateT("Other"), ++cbex->numOther);
- }
+ // if an item with the id of pItem exists, change it instead of adding a new one
+ // but only if it has not been changed by the user yet.
+ if ((pItem->wMask & CBEXIM_ID) && cbex->pItems && pItem->dwID != 0) {
+ int iIndex;
- // set value string
- if ((pItem->wMask & CBEXIM_VAL) && pItem->pszVal && pItem->pszVal[0])
- cbex->pItems[cbex->numItems].pszVal = mir_wstrdup(pItem->pszVal);
- else
- cbex->pItems[cbex->numItems].pszVal = nullptr;
- // set icon
- if ((pItem->wMask & CBEXIM_ICONTEXT) && pItem->pszIcon) {
- cbex->pItems[cbex->numItems].pszIcon = pItem->pszIcon;
- cbex->pItems[cbex->numItems].hIcon = IcoLib_GetIcon(pItem->pszIcon);
- }
- // set flags
- cbex->pItems[cbex->numItems].wFlags = (pItem->wMask & CBEXIM_CAT) ? pItem->wFlags : 0;
-
- cbex->numItems++;
- return cbex->numItems;
- }
+ for (iIndex = 0; iIndex < cbex->numItems; iIndex++) {
+ if (cbex->pItems[iIndex].dwID == pItem->dwID) {
+ pItem->iItem = iIndex;
+ if (cbex->pItems[iIndex].wFlags & CTRLF_CHANGED)
+ pItem->wFlags |= CTRLF_CHANGED;
+ else
+ CtrlContactWndProc(hwnd, CBEXM_SETITEM, 0, lParam);
+ return iIndex;
+ }
+ }
+ }
- /**
- * name: CBEXM_SETITEM
- * desc: Set an item's information of the control.
- * If iItem member of CBEXITEM is -1, the currently selected item is changed.
- * param: wParam - not used
- * lParam - (LPCBEXITEM)&item
- * return: CB_ERR on failure, new item index if successful
- **/
- case CBEXM_SETITEM:
- {
- LPCBEXITEM pItem = (LPCBEXITEM)lParam;
+ // add a new item to the combobox
+ if (!(cbex->pItems = (LPCBEXITEMINTERN)mir_realloc(cbex->pItems, (cbex->numItems + 1) * sizeof(CBEXITEMINTERN)))) {
+ cbex->numItems = 0;
+ return CB_ERR;
+ }
- if (!PtrIsValid(pItem) || !pItem->wMask || !PtrIsValid(cbex->pItems)) return FALSE;
- if (pItem->iItem == -1) pItem->iItem = cbex->iSelectedItem;
- if (pItem->iItem < 0 || pItem->iItem >= cbex->numItems) return FALSE;
+ // set the ID
+ cbex->pItems[cbex->numItems].dwID = (pItem->wMask & CBEXIM_ID) ? pItem->dwID : 0;
- // set new category string
- if (pItem->wMask & CBEXIM_CAT) {
// set category string
- if (!pItem->pszCat || !pItem->pszCat[0] || !mir_wstrncpy(cbex->pItems[pItem->iItem].szCat, pItem->pszCat, _countof(cbex->pItems[pItem->iItem].szCat)))
- mir_snwprintf(cbex->pItems[pItem->iItem].szCat, L"%s %d", TranslateT("Other"), ++cbex->numOther);
- if (pItem->iItem == cbex->iSelectedItem)
- SetWindowText(cbex->hBtnEdit, cbex->pItems[pItem->iItem].szCat);
- }
- // set new value
- if (pItem->wMask & CBEXIM_VAL) {
- MIR_FREE(cbex->pItems[pItem->iItem].pszVal);
- if (pItem->pszVal && pItem->pszVal[0])
- cbex->pItems[pItem->iItem].pszVal = mir_wstrdup(pItem->pszVal);
- if (pItem->iItem == cbex->iSelectedItem)
- SetWindowText(cbex->hEdit, cbex->pItems[pItem->iItem].pszVal ? cbex->pItems[pItem->iItem].pszVal : L"");
- }
+ if (!pItem->pszCat || !pItem->pszCat[0] || !mir_wstrncpy(cbex->pItems[cbex->numItems].szCat, pItem->pszCat, MAX_CAT)) {
+ mir_snwprintf(cbex->pItems[cbex->numItems].szCat, L"%s %d", TranslateT("Other"), ++cbex->numOther);
+ }
- // set icon
- if ((pItem->wMask & CBEXIM_ICONTEXT) && pItem->pszIcon) {
- cbex->pItems[pItem->iItem].pszIcon = pItem->pszIcon;
- cbex->pItems[pItem->iItem].hIcon = IcoLib_GetIcon(pItem->pszIcon);
- if (pItem->iItem == cbex->iSelectedItem)
- SendMessage(cbex->hBtnEdit, BM_SETIMAGE, IMAGE_ICON, (LPARAM)cbex->pItems[pItem->iItem].hIcon);
+ // set value string
+ if ((pItem->wMask & CBEXIM_VAL) && pItem->pszVal && pItem->pszVal[0])
+ cbex->pItems[cbex->numItems].pszVal = mir_wstrdup(pItem->pszVal);
+ else
+ cbex->pItems[cbex->numItems].pszVal = nullptr;
+ // set icon
+ if ((pItem->wMask & CBEXIM_ICONTEXT) && pItem->iIcon) {
+ cbex->pItems[cbex->numItems].iIcon = pItem->iIcon;
+ cbex->pItems[cbex->numItems].hIcon = g_plugin.getIcon(pItem->iIcon);
+ }
+ // set flags
+ cbex->pItems[cbex->numItems].wFlags = (pItem->wMask & CBEXIM_CAT) ? pItem->wFlags : 0;
+
+ cbex->numItems++;
+ return cbex->numItems;
}
- if (pItem->wMask & CBEXIM_FLAGS) {
- cbex->pItems[pItem->iItem].wFlags = pItem->wFlags;
- CtrlContactWndProc(hwnd, CBEXM_ENABLEITEM, NULL, NULL);
+
+ /**
+ * name: CBEXM_SETITEM
+ * desc: Set an item's information of the control.
+ * If iItem member of CBEXITEM is -1, the currently selected item is changed.
+ * param: wParam - not used
+ * lParam - (LPCBEXITEM)&item
+ * return: CB_ERR on failure, new item index if successful
+ **/
+ case CBEXM_SETITEM:
+ {
+ CBEXITEM *pItem = (CBEXITEM *)lParam;
+
+ if (!PtrIsValid(pItem) || !pItem->wMask || !PtrIsValid(cbex->pItems)) return FALSE;
+ if (pItem->iItem == -1) pItem->iItem = cbex->iSelectedItem;
+ if (pItem->iItem < 0 || pItem->iItem >= cbex->numItems) return FALSE;
+
+ // set new category string
+ if (pItem->wMask & CBEXIM_CAT) {
+ // set category string
+ if (!pItem->pszCat || !pItem->pszCat[0] || !mir_wstrncpy(cbex->pItems[pItem->iItem].szCat, pItem->pszCat, _countof(cbex->pItems[pItem->iItem].szCat)))
+ mir_snwprintf(cbex->pItems[pItem->iItem].szCat, L"%s %d", TranslateT("Other"), ++cbex->numOther);
+ if (pItem->iItem == cbex->iSelectedItem)
+ SetWindowText(cbex->hBtnEdit, cbex->pItems[pItem->iItem].szCat);
+ }
+ // set new value
+ if (pItem->wMask & CBEXIM_VAL) {
+ MIR_FREE(cbex->pItems[pItem->iItem].pszVal);
+ if (pItem->pszVal && pItem->pszVal[0])
+ cbex->pItems[pItem->iItem].pszVal = mir_wstrdup(pItem->pszVal);
+ if (pItem->iItem == cbex->iSelectedItem)
+ SetWindowText(cbex->hEdit, cbex->pItems[pItem->iItem].pszVal ? cbex->pItems[pItem->iItem].pszVal : L"");
+ }
+
+ // set icon
+ if ((pItem->wMask & CBEXIM_ICONTEXT) && pItem->iIcon) {
+ cbex->pItems[pItem->iItem].iIcon = pItem->iIcon;
+ cbex->pItems[pItem->iItem].hIcon = g_plugin.getIcon(pItem->iIcon);
+ if (pItem->iItem == cbex->iSelectedItem)
+ SendMessage(cbex->hBtnEdit, BM_SETIMAGE, IMAGE_ICON, (LPARAM)cbex->pItems[pItem->iItem].hIcon);
+ }
+ if (pItem->wMask & CBEXIM_FLAGS) {
+ cbex->pItems[pItem->iItem].wFlags = pItem->wFlags;
+ CtrlContactWndProc(hwnd, CBEXM_ENABLEITEM, NULL, NULL);
+ }
+ return TRUE;
}
- return TRUE;
- }
- /**
- * name: CBEXM_GETITEM
- * desc: Get an item from the control.
- * If iItem member of CBEXITEM is -1, the currently selected item is returned.
- * param: wParam - not used
- * lParam - (LPCBEXITEM)&item
- * return: CB_ERR on failure, new item index if successful
- **/
+ /**
+ * name: CBEXM_GETITEM
+ * desc: Get an item from the control.
+ * If iItem member of CBEXITEM is -1, the currently selected item is returned.
+ * param: wParam - not used
+ * lParam - (LPCBEXITEM)&item
+ * return: CB_ERR on failure, new item index if successful
+ **/
case CBEXM_GETITEM:
- {
- LPCBEXITEM pItem = (LPCBEXITEM)lParam;
+ {
+ CBEXITEM *pItem = (CBEXITEM *)lParam;
- if (!pItem || !cbex->pItems) return FALSE;
-
- // try to find item by id
- if ((pItem->wMask & CBEXIM_ID) && pItem->dwID != 0) {
- int i;
+ if (!pItem || !cbex->pItems) return FALSE;
- for (i = 0; i < cbex->numItems; i++) {
- if (cbex->pItems[i].dwID == pItem->dwID)
- break;
+ // try to find item by id
+ if ((pItem->wMask & CBEXIM_ID) && pItem->dwID != 0) {
+ int i;
+
+ for (i = 0; i < cbex->numItems; i++) {
+ if (cbex->pItems[i].dwID == pItem->dwID)
+ break;
+ }
+ pItem->iItem = i;
}
- pItem->iItem = i;
- }
- else
- if (pItem->iItem == -1) pItem->iItem = cbex->iSelectedItem;
- if (pItem->iItem < 0 || pItem->iItem >= cbex->numItems) return FALSE;
-
- // return only currently selected itemindex
- if (!pItem->wMask) return TRUE;
- // return the unique id
- if (pItem->wMask & CBEXIM_ID)
- pItem->dwID = cbex->pItems[pItem->iItem].dwID;
- // return category string
- if ((pItem->wMask & CBEXIM_CAT) && pItem->pszCat) {
- if (*cbex->pItems[pItem->iItem].szCat != 0)
- mir_wstrncpy(pItem->pszCat, cbex->pItems[pItem->iItem].szCat, pItem->ccCat - 1);
- else
- *pItem->pszCat = 0;
- }
- // return value string
- if ((pItem->wMask & CBEXIM_VAL) && pItem->pszVal) {
- if (cbex->pItems[pItem->iItem].pszVal)
- mir_wstrncpy(pItem->pszVal, cbex->pItems[pItem->iItem].pszVal, pItem->ccVal - 1);
else
- *pItem->pszVal = 0;
+ if (pItem->iItem == -1) pItem->iItem = cbex->iSelectedItem;
+ if (pItem->iItem < 0 || pItem->iItem >= cbex->numItems) return FALSE;
+
+ // return only currently selected itemindex
+ if (!pItem->wMask) return TRUE;
+ // return the unique id
+ if (pItem->wMask & CBEXIM_ID)
+ pItem->dwID = cbex->pItems[pItem->iItem].dwID;
+ // return category string
+ if ((pItem->wMask & CBEXIM_CAT) && pItem->pszCat) {
+ if (*cbex->pItems[pItem->iItem].szCat != 0)
+ mir_wstrncpy(pItem->pszCat, cbex->pItems[pItem->iItem].szCat, pItem->ccCat - 1);
+ else
+ *pItem->pszCat = 0;
+ }
+ // return value string
+ if ((pItem->wMask & CBEXIM_VAL) && pItem->pszVal) {
+ if (cbex->pItems[pItem->iItem].pszVal)
+ mir_wstrncpy(pItem->pszVal, cbex->pItems[pItem->iItem].pszVal, pItem->ccVal - 1);
+ else
+ *pItem->pszVal = 0;
+ }
+ // return the icon
+ if (pItem->wMask & CBEXIM_ICONTEXT)
+ pItem->iIcon = cbex->pItems[pItem->iItem].iIcon;
+ // return the flags
+ if (pItem->wMask & CBEXIM_FLAGS)
+ pItem->wFlags = cbex->pItems[pItem->iItem].wFlags;
+ return TRUE;
}
- // return the icon
- if (pItem->wMask & CBEXIM_ICONTEXT)
- pItem->pszIcon = cbex->pItems[pItem->iItem].pszIcon;
- // return the flags
- if (pItem->wMask & CBEXIM_FLAGS)
- pItem->wFlags = cbex->pItems[pItem->iItem].wFlags;
- return TRUE;
- }
- /**
- * name: CBEXM_DELITEM
- * desc: delete an item from the control
- * param: wParam - not used
- * lParam - item index
- * return: CB_ERR on failure, new item index if successful
- **/
+ /**
+ * name: CBEXM_DELITEM
+ * desc: delete an item from the control
+ * param: wParam - not used
+ * lParam - item index
+ * return: CB_ERR on failure, new item index if successful
+ **/
case CBEXM_DELITEM:
- {
- if (!cbex->pItems || (int)lParam < 0 || (int)lParam >= cbex->numItems || (cbex->pItems[lParam].wFlags & CBEXIF_CATREADONLY))
- return FALSE;
- MIR_FREE(cbex->pItems[(int)lParam].pszVal);
- memmove(cbex->pItems + (int)lParam,
- cbex->pItems + (int)lParam + 1,
- (cbex->numItems - (int)lParam - 1) * sizeof(CBEXITEMINTERN));
- cbex->numItems--;
- memset((cbex->pItems + cbex->numItems), 0, sizeof(CBEXITEMINTERN));
- CtrlContactWndProc(hwnd, CBEXM_SETCURSEL, lParam - 1, FALSE);
- return TRUE;
- }
+ {
+ if (!cbex->pItems || (int)lParam < 0 || (int)lParam >= cbex->numItems || (cbex->pItems[lParam].wFlags & CBEXIF_CATREADONLY))
+ return FALSE;
+ MIR_FREE(cbex->pItems[(int)lParam].pszVal);
+ memmove(cbex->pItems + (int)lParam,
+ cbex->pItems + (int)lParam + 1,
+ (cbex->numItems - (int)lParam - 1) * sizeof(CBEXITEMINTERN));
+ cbex->numItems--;
+ memset((cbex->pItems + cbex->numItems), 0, sizeof(CBEXITEMINTERN));
+ CtrlContactWndProc(hwnd, CBEXM_SETCURSEL, lParam - 1, FALSE);
+ return TRUE;
+ }
- /**
- * name: CBEXM_DELITEM
- * desc: delete an item from the control
- * param: wParam - not used
- * lParam - item index
- * return: CB_ERR on failure, new item index if successful
- **/
+ /**
+ * name: CBEXM_DELITEM
+ * desc: delete an item from the control
+ * param: wParam - not used
+ * lParam - item index
+ * return: CB_ERR on failure, new item index if successful
+ **/
case CBEXM_DELALLITEMS:
- {
- int i;
+ {
+ int i;
- if (PtrIsValid(cbex)) {
- if (PtrIsValid(cbex->pItems)) {
- for (i = 0; i < cbex->numItems; i++) {
- MIR_FREE(cbex->pItems[i].pszVal);
+ if (PtrIsValid(cbex)) {
+ if (PtrIsValid(cbex->pItems)) {
+ for (i = 0; i < cbex->numItems; i++) {
+ MIR_FREE(cbex->pItems[i].pszVal);
+ }
+ MIR_FREE(cbex->pItems);
+ cbex->pItems = nullptr;
}
- MIR_FREE(cbex->pItems);
- cbex->pItems = nullptr;
+ cbex->numItems = 0;
+ cbex->iSelectedItem = -1;
+ SetWindowText(cbex->hEdit, L"");
+ SetWindowText(cbex->hBtnEdit, L"");
+ SendMessage(cbex->hBtnEdit, WM_SETICON, NULL, NULL);
}
- cbex->numItems = 0;
- cbex->iSelectedItem = -1;
- SetWindowText(cbex->hEdit, L"");
- SetWindowText(cbex->hBtnEdit, L"");
- SendMessage(cbex->hBtnEdit, WM_SETICON, NULL, NULL);
+ return TRUE;
}
- return TRUE;
- }
- /**
- * name: CBEXM_ENABLEITEM
- * desc: enables or disables the current item
- * param: wParam - not used
- * lParam - not used
- * return: always 0
- **/
+ /**
+ * name: CBEXM_ENABLEITEM
+ * desc: enables or disables the current item
+ * param: wParam - not used
+ * lParam - not used
+ * return: always 0
+ **/
case CBEXM_ENABLEITEM:
if (cbex->iSelectedItem >= 0 && cbex->iSelectedItem < cbex->numItems) {
MCONTACT hContact;
BYTE bEnabled;
-
+
PSGetContact(GetParent(hwnd), hContact);
- bEnabled = !hContact ||
- (cbex->pItems[cbex->iSelectedItem].wFlags & CTRLF_HASCUSTOM) ||
- !(cbex->pItems[cbex->iSelectedItem].wFlags & (CTRLF_HASPROTO|CTRLF_HASMETA)) ||
- !g_plugin.getByte(SET_PROPSHEET_PCBIREADONLY, 0);
+ bEnabled = !hContact ||
+ (cbex->pItems[cbex->iSelectedItem].wFlags & CTRLF_HASCUSTOM) ||
+ !(cbex->pItems[cbex->iSelectedItem].wFlags & (CTRLF_HASPROTO | CTRLF_HASMETA)) ||
+ !g_plugin.getByte(SET_PROPSHEET_PCBIREADONLY, 0);
EnableWindow(cbex->hBtnEdit, bEnabled);
EnableWindow(cbex->hBtnDel, bEnabled && GetWindowTextLength(cbex->hEdit) > 0);
@@ -1144,72 +1145,72 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
break;
- /**
- * name: CBEXM_ISCHANGED
- * desc: returns whether the control contains changed values or not
- * param: wParam - not used
- * lParam - not used
- * return: TRUE if control was changed, FALSE if nothing was edited
- **/
+ /**
+ * name: CBEXM_ISCHANGED
+ * desc: returns whether the control contains changed values or not
+ * param: wParam - not used
+ * lParam - not used
+ * return: TRUE if control was changed, FALSE if nothing was edited
+ **/
case CBEXM_ISCHANGED:
return cbex->bIsChanged;
- /**
- * name: CBEXM_RESETCHANGED
- * desc: resets changed flag to FALSE
- * param: wParam - not used
- * lParam - not used
- * return: always FALSE
- **/
+ /**
+ * name: CBEXM_RESETCHANGED
+ * desc: resets changed flag to FALSE
+ * param: wParam - not used
+ * lParam - not used
+ * return: always FALSE
+ **/
case CBEXM_RESETCHANGED:
cbex->bIsChanged = 0;
return 0;
- /**
- * name: CBEXM_SETCURSEL
- * desc: selects a certain item
- * param: wParam - index of the item to select
- * lParam - (BYTE)bValid - if TRUE, the next item with a value is selected
- * return: always FALSE
- **/
+ /**
+ * name: CBEXM_SETCURSEL
+ * desc: selects a certain item
+ * param: wParam - index of the item to select
+ * lParam - (BYTE)bValid - if TRUE, the next item with a value is selected
+ * return: always FALSE
+ **/
case CBEXM_SETCURSEL:
- {
- int i;
-
- if (!cbex->pItems) return 1;
- if ((int)wParam < 0 || (int)wParam >= cbex->numItems) wParam = max(cbex->iSelectedItem, 0);
- cbex->bLocked = 1;
-
- if ((BYTE)lParam == TRUE) {
- i = (int)wParam;
-
- cbex->iSelectedItem = (int)wParam;
- while (i < cbex->numItems) {
- if (cbex->pItems[i].pszVal && *cbex->pItems[i].pszVal) {
- cbex->iSelectedItem = i;
- break;
+ {
+ int i;
+
+ if (!cbex->pItems) return 1;
+ if ((int)wParam < 0 || (int)wParam >= cbex->numItems) wParam = max(cbex->iSelectedItem, 0);
+ cbex->bLocked = 1;
+
+ if ((BYTE)lParam == TRUE) {
+ i = (int)wParam;
+
+ cbex->iSelectedItem = (int)wParam;
+ while (i < cbex->numItems) {
+ if (cbex->pItems[i].pszVal && *cbex->pItems[i].pszVal) {
+ cbex->iSelectedItem = i;
+ break;
+ }
+ i++;
}
- i++;
- }
- }
- else {
- // search for the next none deleted item
- for (i = (int)wParam; i < cbex->numItems && *cbex->pItems[i].szCat == 0; i++);
- if (i == cbex->numItems && (int)wParam > 0) {
- for (i = 0; i < (int)wParam && *cbex->pItems[i].szCat == 0; i++);
- cbex->iSelectedItem = i == (int)wParam ? 0 : i;
}
- else
- cbex->iSelectedItem = i;
+ else {
+ // search for the next none deleted item
+ for (i = (int)wParam; i < cbex->numItems && *cbex->pItems[i].szCat == 0; i++);
+ if (i == cbex->numItems && (int)wParam > 0) {
+ for (i = 0; i < (int)wParam && *cbex->pItems[i].szCat == 0; i++);
+ cbex->iSelectedItem = i == (int)wParam ? 0 : i;
+ }
+ else
+ cbex->iSelectedItem = i;
+ }
+ SetWindowText(cbex->hBtnEdit, cbex->pItems[cbex->iSelectedItem].szCat);
+ SetWindowText(cbex->hEdit, cbex->pItems[cbex->iSelectedItem].pszVal ? cbex->pItems[cbex->iSelectedItem].pszVal : L"");
+ SendMessage(cbex->hBtnEdit, BM_SETIMAGE, IMAGE_ICON, (LPARAM)cbex->pItems[cbex->iSelectedItem].hIcon);
+ CtrlContactWndProc(hwnd, CBEXM_ENABLEITEM, NULL, NULL);
+ cbex->bLocked = 0;
+ return 0;
}
- SetWindowText(cbex->hBtnEdit, cbex->pItems[cbex->iSelectedItem].szCat);
- SetWindowText(cbex->hEdit, cbex->pItems[cbex->iSelectedItem].pszVal ? cbex->pItems[cbex->iSelectedItem].pszVal : L"");
- SendMessage(cbex->hBtnEdit, BM_SETIMAGE, IMAGE_ICON, (LPARAM)cbex->pItems[cbex->iSelectedItem].hIcon);
- CtrlContactWndProc(hwnd, CBEXM_ENABLEITEM, NULL, NULL);
- cbex->bLocked = 0;
- return 0;
- }
case CBEXM_SORT:
if (cbex->numItems > 4) {
qsort(cbex->pItems + 3, cbex->numItems - 3, sizeof(CBEXITEMINTERN), compareProc);
@@ -1249,20 +1250,20 @@ int CtrlContactUnLoadModule() int CtrlContactLoadModule()
{
WNDCLASSEX wc;
-
+
memset(&wc, 0, sizeof(wc));
- wc.cbSize = sizeof(wc);
- wc.lpszClassName = UINFOCOMBOEXCLASS;
- wc.lpfnWndProc = CtrlContactWndProc;
- wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
- wc.cbWndExtra = sizeof(LPCBEX);
- wc.hbrBackground = (HBRUSH)GetStockObject(COLOR_WINDOW);
- wc.style = CS_GLOBALCLASS;
+ wc.cbSize = sizeof(wc);
+ wc.lpszClassName = UINFOCOMBOEXCLASS;
+ wc.lpfnWndProc = CtrlContactWndProc;
+ wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
+ wc.cbWndExtra = sizeof(LPCBEX);
+ wc.hbrBackground = (HBRUSH)GetStockObject(COLOR_WINDOW);
+ wc.style = CS_GLOBALCLASS;
RegisterClassEx(&wc);
return 0;
}
-
+
/**
* name: CtrlContactAddItemFromDB
* desc: add a item read from db to the combobox
@@ -1278,20 +1279,20 @@ int CtrlContactLoadModule() * FALSE - if item is added or updated successfully
**/
int CtrlContactAddItemFromDB(
- HWND hCtrl,
- LPCSTR szIcon,
- LPTSTR szItem,
- MCONTACT hContact,
- LPCSTR pszModule,
- LPCSTR pszProto,
- LPCSTR szSettingVal)
+ HWND hCtrl,
+ int iIcon,
+ LPTSTR szItem,
+ MCONTACT hContact,
+ LPCSTR pszModule,
+ LPCSTR pszProto,
+ LPCSTR szSettingVal)
{
DBVARIANT dbv;
CBEXITEM cbi;
cbi.pszVal = nullptr;
cbi.dwID = mir_hashstr(szSettingVal);
- cbi.wFlags = CBEXIF_CATREADONLY|DB::Setting::GetTStringCtrl(hContact, pszModule, pszModule, pszProto, szSettingVal, &dbv);
+ cbi.wFlags = CBEXIF_CATREADONLY | DB::Setting::GetTStringCtrl(hContact, pszModule, pszModule, pszProto, szSettingVal, &dbv);
if (dbv.type >= DBVT_WCHAR) {
// no value read from database
if (cbi.wFlags == CBEXIF_CATREADONLY)
@@ -1307,7 +1308,7 @@ int CtrlContactAddItemFromDB( cbi.pszCat = szItem;
cbi.iItem = -1;
cbi.wMask = CBEXIM_ALL;
- cbi.pszIcon = szIcon;
+ cbi.iIcon = iIcon;
SendMessage(hCtrl, CBEXM_ADDITEM, NULL, (LPARAM)&cbi);
db_free(&dbv);
return (cbi.wFlags & CTRLF_CHANGED) == CTRLF_CHANGED;
@@ -1328,14 +1329,14 @@ int CtrlContactAddItemFromDB( * FALSE - if all items were added or updated successfully
**/
int CtrlContactAddMyItemsFromDB(
- HWND hCtrl,
- LPCSTR szIcon,
- WORD wForcedFlags,
- MCONTACT hContact,
- LPCSTR pszModule,
- LPCSTR pszProto,
- LPCSTR szFormatCat,
- LPCSTR szFormatVal)
+ HWND hCtrl,
+ int iIcon,
+ WORD wForcedFlags,
+ MCONTACT hContact,
+ LPCSTR pszModule,
+ LPCSTR pszProto,
+ LPCSTR szFormatCat,
+ LPCSTR szFormatVal)
{
CBEXITEM cbi;
DBVARIANT dbv;
@@ -1347,13 +1348,12 @@ int CtrlContactAddMyItemsFromDB( memset(&cbi, 0, sizeof(cbi));
cbi.iItem = -1;
cbi.wMask = CBEXIM_ALL;
- cbi.pszIcon = szIcon;
+ cbi.iIcon = iIcon;
for (i = 0;
SUCCEEDED(mir_snprintf(pszSetting, szFormatVal, i)) &&
(cbi.wFlags = DB::Setting::GetTStringCtrl(hContact, pszModule, pszModule, pszProto, pszSetting, &dbv));
- i++)
- {
+ i++) {
// read value
cbi.dwID = mir_hashstr(pszSetting);
cbi.pszVal = dbv.pwszVal;
@@ -1367,10 +1367,10 @@ int CtrlContactAddMyItemsFromDB( dbv.type = DBVT_DELETED;
}
else
- if (cbi.wFlags & CTRLF_HASPROTO) {
- if (DB::Setting::GetTString(hContact, pszProto, pszSetting, &dbv))
- dbv.type = DBVT_DELETED;
- }
+ if (cbi.wFlags & CTRLF_HASPROTO) {
+ if (DB::Setting::GetTString(hContact, pszProto, pszSetting, &dbv))
+ dbv.type = DBVT_DELETED;
+ }
if (dbv.type > DBVT_DELETED && dbv.pwszVal && *dbv.pwszVal) {
cbi.pszCat = dbv.pwszVal;
@@ -1383,12 +1383,12 @@ int CtrlContactAddMyItemsFromDB( *sms = 0;
}
cbi.wFlags |= wForcedFlags;
- if (CB_ERR == SendMessage(hCtrl, CBEXM_ADDITEM, NULL, (LPARAM)&cbi))
+ if (CB_ERR == SendMessage(hCtrl, CBEXM_ADDITEM, NULL, (LPARAM)&cbi))
break;
bAnyItemIsChanged |= (cbi.wFlags & CTRLF_CHANGED) == CTRLF_CHANGED;
- if (cbi.pszCat) {
+ if (cbi.pszCat) {
mir_free(cbi.pszCat);
- cbi.pszCat = nullptr;
+ cbi.pszCat = nullptr;
}
if (cbi.pszVal) {
mir_free(cbi.pszVal);
@@ -1406,18 +1406,18 @@ int CtrlContactAddMyItemsFromDB( * return: always 0
**/
int CtrlContactWriteItemToDB(
- HWND hCtrl,
- MCONTACT hContact,
- LPCSTR pszModule,
- LPCSTR pszProto,
- LPCSTR pszSetting)
+ HWND hCtrl,
+ MCONTACT hContact,
+ LPCSTR pszModule,
+ LPCSTR pszProto,
+ LPCSTR pszSetting)
{
wchar_t szVal[MAXDATASIZE];
CBEXITEM cbi;
if (!CtrlContactWndProc(hCtrl, CBEXM_ISCHANGED, NULL, NULL)) return 1;
- cbi.wMask = CBEXIM_ID|CBEXIM_VAL|CBEXIM_FLAGS;
+ cbi.wMask = CBEXIM_ID | CBEXIM_VAL | CBEXIM_FLAGS;
cbi.pszVal = szVal;
cbi.ccVal = MAXDATASIZE - 4;
cbi.iItem = 0;
@@ -1447,13 +1447,13 @@ int CtrlContactWriteItemToDB( * return: always 0
**/
int CtrlContactWriteMyItemsToDB(
- HWND hCtrl,
- int iFirstItem,
- MCONTACT hContact,
- LPCSTR pszModule,
- LPCSTR pszProto,
- LPCSTR szFormatCat,
- LPCSTR szFormatVal)
+ HWND hCtrl,
+ int iFirstItem,
+ MCONTACT hContact,
+ LPCSTR pszModule,
+ LPCSTR pszProto,
+ LPCSTR szFormatCat,
+ LPCSTR szFormatVal)
{
CHAR pszSetting[MAXSETTING];
wchar_t szCat[MAX_CAT];
@@ -1465,17 +1465,17 @@ int CtrlContactWriteMyItemsToDB( if (!CtrlContactWndProc(hCtrl, CBEXM_ISCHANGED, NULL, NULL)) return 1;
if (!hContact && !(pszModule = pszProto)) return 1;
-
+
pszOther = TranslateT("Other");
ccOther = mir_wstrlen(pszOther);
- cbi.wMask = CBEXIM_CAT|CBEXIM_VAL|CBEXIM_FLAGS;
+ cbi.wMask = CBEXIM_CAT | CBEXIM_VAL | CBEXIM_FLAGS;
cbi.pszCat = szCat;
cbi.ccCat = MAX_CAT;
cbi.pszVal = szVal;
cbi.ccVal = MAXDATASIZE - 4;
cbi.iItem = iFirstItem;
cbi.dwID = 0;
-
+
while (CtrlContactWndProc(hCtrl, CBEXM_GETITEM, NULL, (LPARAM)&cbi) && cbi.iItem < 50) {
if (!(cbi.wFlags & CBEXIF_DELETED) && *szVal) {
if (cbi.wFlags & CBEXIF_SMS) {
@@ -1492,10 +1492,10 @@ int CtrlContactWriteMyItemsToDB( cbi.wFlags &= ~CTRLF_CHANGED;
cbi.wMask = CBEXIM_FLAGS;
CtrlContactWndProc(hCtrl, CBEXM_SETITEM, NULL, (LPARAM)&cbi);
- cbi.wMask = CBEXIM_CAT|CBEXIM_VAL|CBEXIM_FLAGS;
+ cbi.wMask = CBEXIM_CAT | CBEXIM_VAL | CBEXIM_FLAGS;
i++;
}
-
+
cbi.iItem++;
}
DB::Setting::DeleteArray(hContact, pszModule, szFormatCat, i);
diff --git a/plugins/UserInfoEx/src/ctrl_contact.h b/plugins/UserInfoEx/src/ctrl_contact.h index 6216035542..df3e9f8858 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.h +++ b/plugins/UserInfoEx/src/ctrl_contact.h @@ -54,23 +54,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CBEXIF_SMS (CTRLF_FIRST * 2)
#define CBEXIF_DELETED (CTRLF_FIRST * 4)
-typedef struct TComboExItem
+struct CBEXITEM
{
- WORD wMask; // determines which element of this structure is valid
- WORD wFlags; // standard control flags
- int iItem; // position of the item in the data array
- DWORD dwID; // unique number for each setting read from db to identify it, new entries have dwID = 0
- LPTSTR pszCat; // pointer to a descriptive category string to set or retrieve for the data entry
- WORD ccCat;
- LPTSTR pszVal;
- WORD ccVal;
- LPCSTR pszIcon;
-} CBEXITEM, *LPCBEXITEM;
+ WORD wMask; // determines which element of this structure is valid
+ WORD wFlags; // standard control flags
+ int iItem; // position of the item in the data array
+ DWORD dwID; // unique number for each setting read from db to identify it, new entries have dwID = 0
+ LPTSTR pszCat; // pointer to a descriptive category string to set or retrieve for the data entry
+ WORD ccCat;
+ LPTSTR pszVal;
+ WORD ccVal;
+ int iIcon;
+};
int CtrlContactLoadModule();
int CtrlContactUnLoadModule();
-int CtrlContactAddItemFromDB(HWND hCtrl, LPCSTR szIcon, LPTSTR szItem, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szSettingVal);
-int CtrlContactAddMyItemsFromDB(HWND hCtrl, LPCSTR szIcon, WORD wForcedFlags, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szFormatCat, LPCSTR szFormatVal);
+int CtrlContactAddItemFromDB(HWND hCtrl, int iIcon, LPTSTR szItem, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szSettingVal);
+int CtrlContactAddMyItemsFromDB(HWND hCtrl, int iIcon, WORD wForcedFlags, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szFormatCat, LPCSTR szFormatVal);
int CtrlContactWriteItemToDB(HWND hCtrl, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting);
int CtrlContactWriteMyItemsToDB(HWND hCtrl, int iFirstItem, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szFormatCat, LPCSTR szFormatVal);
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 3c3993eb9b..0533f11e57 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -283,7 +283,7 @@ class CAnnivList break;
// set icons
- hIcon = IcoLib_GetIcon(ICO_DLG_ANNIVERSARY);
+ hIcon = g_plugin.getIcon(IDI_ANNIVERSARY);
SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_SETICON, 0, (LPARAM)hIcon);
SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index 80d049ec74..f335833190 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -107,53 +107,53 @@ static void MakePopupAction(POPUPACTION &pa, int id) switch (id) {
case IDOK:
- pa.lchIcon = IcoLib_GetIcon(ICO_BTN_OK);
+ pa.lchIcon = g_plugin.getIcon(IDI_BTN_OK);
mir_strcpy(pa.lpzTitle, MODULENAME"/Ok");
break;
case IDCLOSE:
case IDCANCEL:
- pa.lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
+ pa.lchIcon = g_plugin.getIcon(IDI_BTN_CLOSE);
mir_strcpy(pa.lpzTitle, MODULENAME"/Cancel");
break;
case IDABORT:
- pa.lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
+ pa.lchIcon = g_plugin.getIcon(IDI_BTN_CLOSE);
mir_strcpy(pa.lpzTitle, MODULENAME"/Abort");
break;
case IDRETRY:
- pa.lchIcon = IcoLib_GetIcon(ICO_BTN_UPDATE);
+ pa.lchIcon = g_plugin.getIcon(IDI_BTN_UPDATE);
mir_strcpy(pa.lpzTitle, MODULENAME"/Retry");
break;
case IDIGNORE:
- pa.lchIcon = IcoLib_GetIcon(ICO_BTN_OK);
+ pa.lchIcon = g_plugin.getIcon(IDI_BTN_OK);
mir_strcpy(pa.lpzTitle, MODULENAME"/Ignore");
break;
case IDYES:
- pa.lchIcon = IcoLib_GetIcon(ICO_BTN_OK);
+ pa.lchIcon = g_plugin.getIcon(IDI_BTN_OK);
mir_strcpy(pa.lpzTitle, MODULENAME"/Yes");
break;
case IDNO:
- pa.lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
+ pa.lchIcon = g_plugin.getIcon(IDI_BTN_CLOSE);
mir_strcpy(pa.lpzTitle, MODULENAME"/No");
break;
case IDHELP:
- pa.lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
+ pa.lchIcon = g_plugin.getIcon(IDI_BTN_CLOSE);
mir_strcpy(pa.lpzTitle, MODULENAME"/Help");
break;
case IDALL:
- pa.lchIcon = IcoLib_GetIcon(ICO_BTN_OK);
+ pa.lchIcon = g_plugin.getIcon(IDI_BTN_OK);
mir_strcpy(pa.lpzTitle, MODULENAME"/All");
break;
case IDNONE:
- pa.lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
+ pa.lchIcon = g_plugin.getIcon(IDI_BTN_CLOSE);
mir_strcpy(pa.lpzTitle, MODULENAME"/None");
}
}
@@ -198,7 +198,7 @@ static INT_PTR CALLBACK MsgBoxProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM l // set infobar's logo icon
SendDlgItemMessage(hDlg, ICO_DLGLOGO, STM_SETIMAGE, IMAGE_ICON,
- (pMsgBox->hiLogo ? (LPARAM)pMsgBox->hiLogo : (LPARAM)IcoLib_GetIcon(ICO_DLG_DETAILS,TRUE)));
+ (pMsgBox->hiLogo ? (LPARAM)pMsgBox->hiLogo : (LPARAM)g_plugin.getIcon(IDI_DLG_DETAILS, true)));
// enable headerbar
ShowWindow(GetDlgItem(hDlg, TXT_NAME), SW_SHOW);
@@ -667,7 +667,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI MSGBOX mb = { 0 };
mb.cbSize = sizeof(MSGBOX);
mb.hParent = hParent;
- mb.hiLogo = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mb.hiLogo = g_plugin.getIcon(IDI_MAIN);
mb.hiMsg = nullptr;
mb.ptszTitle = TranslateW(pszTitle);
mb.ptszInfoText = TranslateW(pszInfo);
@@ -694,7 +694,7 @@ INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...) MSGBOX mb = {0};
mb.cbSize = sizeof(MSGBOX);
mb.hParent = hParent;
- mb.hiLogo = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mb.hiLogo = g_plugin.getIcon(IDI_MAIN);
mb.hiMsg = nullptr;
mb.ptszTitle = tszTitle;
mb.ptszMsg = tszMsg;
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 4356f92b7b..666dbf5235 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -240,9 +240,9 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM) return 1;
}
- HICON hDefIcon = IcoLib_GetIcon(ICO_TREE_DEFAULT);
+ HICON hDefIcon = g_plugin.getIcon(IDI_LST_FOLDER);
if (!hDefIcon)
- hDefIcon = (HICON)IcoLib_GetIcon(ICO_COMMON_DEFAULT, false);
+ hDefIcon = (HICON)g_plugin.getIcon(IDI_DEFAULT, false);
// add the default icon to imagelist
ImageList_AddIcon(psh._hImages, hDefIcon);
@@ -486,9 +486,9 @@ void DlgContactInfoInitTreeIcons() metrics.x = GetSystemMetrics(SM_CXSMICON);
metrics.y = GetSystemMetrics(SM_CYSMICON);
if (psh._hImages = ImageList_Create(metrics.x, metrics.y, ILC_COLOR32 | ILC_MASK, 0, 1)) {
- HICON hDefIcon = IcoLib_GetIcon(ICO_TREE_DEFAULT);
+ HICON hDefIcon = g_plugin.getIcon(IDI_LST_FOLDER);
if (!hDefIcon)
- hDefIcon = (HICON)IcoLib_GetIcon(ICO_COMMON_DEFAULT, false);
+ hDefIcon = (HICON)g_plugin.getIcon(IDI_DEFAULT, false);
// add the default icon to imagelist
ImageList_AddIcon(psh._hImages, hDefIcon);
@@ -590,7 +590,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar ShowWindow(GetDlgItem(hDlg, IDC_PAGETITLEBG2), !IsAeroMode());
// set icons
- Window_SetIcon_IcoLib(hDlg, IcoLib_GetIconHandle(ICO_COMMON_MAIN));
+ Window_SetIcon_IcoLib(hDlg, g_plugin.getIconHandle(IDI_MAIN));
DlgProc(hDlg, HM_RELOADICONS, NULL, NULL);
// load basic protocol for current contact (for faster load later on and better handling for owner protocol)
@@ -908,11 +908,11 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar HWND hCtrl;
HICON hIcon;
static const ICONCTRL idIcon[] = {
- { ICO_DLG_DETAILS, STM_SETIMAGE, ICO_DLGLOGO },
- { ICO_BTN_UPDATE, BM_SETIMAGE, BTN_UPDATE },
- { ICO_BTN_OK, BM_SETIMAGE, IDOK },
- { ICO_BTN_CANCEL, BM_SETIMAGE, IDCANCEL },
- { ICO_BTN_APPLY, BM_SETIMAGE, IDAPPLY }
+ { IDI_DLG_DETAILS, STM_SETIMAGE, ICO_DLGLOGO },
+ { IDI_BTN_UPDATE, BM_SETIMAGE, BTN_UPDATE },
+ { IDI_BTN_OK, BM_SETIMAGE, IDOK },
+ { IDI_BTN_CLOSE, BM_SETIMAGE, IDCANCEL },
+ { IDI_BTN_APPLY, BM_SETIMAGE, IDAPPLY }
};
const int numIconsToSet = g_plugin.getByte(SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 1;
@@ -920,12 +920,12 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar IcoLib_SetCtrlIcons(hDlg, idIcon, numIconsToSet);
if (hCtrl = GetDlgItem(hDlg, BTN_IMPORT)) {
- hIcon = IcoLib_GetIcon(ICO_BTN_IMPORT);
+ hIcon = g_plugin.getIcon(IDI_IMPORT);
SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SetWindowText(hCtrl, hIcon ? L"" : L"I");
}
if (hCtrl = GetDlgItem(hDlg, BTN_EXPORT)) {
- hIcon = IcoLib_GetIcon(ICO_BTN_EXPORT);
+ hIcon = g_plugin.getIcon(IDI_EXPORT);
SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SetWindowText(hCtrl, hIcon ? L"" : L"E");
}
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 689e72c564..9a8e0f11d9 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -25,7 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * typedefs
***********************************************************************************************************/
-typedef struct {
+typedef struct
+{
lpExImParam ExImContact;
DB::CEnumList* pModules;
} EXPORTDATA, *LPEXPORTDATA;
@@ -34,14 +35,14 @@ typedef struct { * modules stuff
***********************************************************************************************************/
-/**
- * name: ExportTree_AppendModuleList
- * desc: according to the checked list items create the module list for exporting
- * param: hTree - handle to the window of the treeview
- * hParent - parent tree item for the item to add
- * pModules - module list to fill
- * return: nothing
- **/
+ /**
+ * name: ExportTree_AppendModuleList
+ * desc: according to the checked list items create the module list for exporting
+ * param: hTree - handle to the window of the treeview
+ * hParent - parent tree item for the item to add
+ * pModules - module list to fill
+ * return: nothing
+ **/
void ExportTree_AppendModuleList(HWND hTree, HTREEITEM hParent, DB::CEnumList* pModules)
{
TVITEMA tvi;
@@ -51,7 +52,7 @@ void ExportTree_AppendModuleList(HWND hTree, HTREEITEM hParent, DB::CEnumList* p CHAR szModule[MAXSETTING];
// add optional items
- tvi.mask = TVIF_STATE|TVIF_TEXT;
+ tvi.mask = TVIF_STATE | TVIF_TEXT;
tvi.stateMask = TVIS_STATEIMAGEMASK;
tvi.pszText = szModule;
tvi.cchTextMax = _countof(szModule);
@@ -62,9 +63,8 @@ void ExportTree_AppendModuleList(HWND hTree, HTREEITEM hParent, DB::CEnumList* p (
tvi.state == INDEXTOSTATEIMAGEMASK(0) ||
tvi.state == INDEXTOSTATEIMAGEMASK(2)
- )
- )
- {
+ )
+ ) {
pModules->Insert(tvi.pszText);
}
}
@@ -93,8 +93,7 @@ HTREEITEM ExportTree_FindItem(HWND hTree, HTREEITEM hParent, LPSTR pszText) for (tvi.hItem = TreeView_GetChild(hTree, hParent);
tvi.hItem != nullptr;
- tvi.hItem = TreeView_GetNextSibling(hTree, tvi.hItem))
- {
+ tvi.hItem = TreeView_GetNextSibling(hTree, tvi.hItem)) {
if (SendMessageA(hTree, TVM_GETITEMA, NULL, (LPARAM)&tvi) && !mir_strcmpi(tvi.pszText, pszText))
return tvi.hItem;
}
@@ -109,7 +108,7 @@ HTREEITEM ExportTree_FindItem(HWND hTree, HTREEITEM hParent, LPSTR pszText) * pszDesc - item label
* bUseImages - icons are loaded
* bState - 0-hide checkbox/1-unchecked/2-checked
- * return: return handle to added treeitem
+ * return: return handle to added treeitem
**/
HTREEITEM ExportTree_AddItem(HWND hTree, HTREEITEM hParent, LPSTR pszDesc, BYTE bUseImages, BYTE bState)
{
@@ -120,7 +119,7 @@ HTREEITEM ExportTree_AddItem(HWND hTree, HTREEITEM hParent, LPSTR pszDesc, BYTE tvii.hInsertAfter = TVI_SORT;
tvii.itemex.mask = TVIF_TEXT;
if (bUseImages) {
- tvii.itemex.mask |= TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvii.itemex.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvii.itemex.iImage = tvii.itemex.iSelectedImage = 1;
}
tvii.itemex.pszText = pszDesc;
@@ -143,7 +142,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar LPEXPORTDATA pDat = (LPEXPORTDATA)GetUserData(hDlg);
switch (uMsg) {
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
BYTE bImagesLoaded = 0;
@@ -155,17 +154,17 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // init the datastructure
if (!(pDat = (LPEXPORTDATA)mir_alloc(sizeof(EXPORTDATA))))
return FALSE;
- pDat->ExImContact = ((LPEXPORTDATA)lParam)->ExImContact;
- pDat->pModules = ((LPEXPORTDATA)lParam)->pModules;
+ pDat->ExImContact = ((LPEXPORTDATA)lParam)->ExImContact;
+ pDat->pModules = ((LPEXPORTDATA)lParam)->pModules;
SetUserData(hDlg, pDat);
// set icons
{
const ICONCTRL idIcon[] = {
- { ICO_DLG_EXPORT, WM_SETICON, NULL },
- { ICO_DLG_EXPORT, STM_SETIMAGE, ICO_DLGLOGO },
- { ICO_BTN_EXPORT, BM_SETIMAGE, IDOK },
- { ICO_BTN_CANCEL, BM_SETIMAGE, IDCANCEL }
+ { IDI_EXPORT, WM_SETICON, NULL },
+ { IDI_EXPORT, STM_SETIMAGE, ICO_DLGLOGO },
+ { IDI_EXPORT, BM_SETIMAGE, IDOK },
+ { IDI_BTN_CLOSE, BM_SETIMAGE, IDCANCEL }
};
const int numIconsToSet = g_plugin.getByte(SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 2;
IcoLib_SetCtrlIcons(hDlg, idIcon, numIconsToSet);
@@ -174,15 +173,13 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (GetVersionEx(&osvi)) {
- HIMAGELIST hImages = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),
- ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5 && osvi.dwMinorVersion >= 1) ? ILC_COLOR32 : ILC_COLOR16)|ILC_MASK,0, 1);
- if (hImages != nullptr)
- {
+ HIMAGELIST hImages = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
+ ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5 && osvi.dwMinorVersion >= 1) ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 0, 1);
+ if (hImages != nullptr) {
SendMessage(hTree, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)hImages);
-
- HICON hIcon;
- bImagesLoaded = ((((hIcon = IcoLib_GetIcon(ICO_LST_MODULES)) != nullptr) && 0 == ImageList_AddIcon(hImages, hIcon))
- && (((hIcon = IcoLib_GetIcon(ICO_LST_FOLDER)) != nullptr) && 1 == ImageList_AddIcon(hImages, hIcon)));
+ g_plugin.addImgListIcon(hImages, IDI_LST_MODULES);
+ g_plugin.addImgListIcon(hImages, IDI_LST_FOLDER);
+ bImagesLoaded = true;
}
}
}
@@ -195,29 +192,29 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar }
// Set the Window Title and description
{
- LPCTSTR name = nullptr;
- wchar_t oldTitle[MAXDATASIZE],
- newTitle[MAXDATASIZE];
+ LPCTSTR name = nullptr;
+ wchar_t oldTitle[MAXDATASIZE],
+ newTitle[MAXDATASIZE];
switch (pDat->ExImContact->Typ) {
- case EXIM_ALL:
- case EXIM_GROUP:
- name = TranslateT("All Contacts");
- break;
- case EXIM_CONTACT:
- if (pDat->ExImContact->hContact == NULL) {
- name = TranslateT("Owner");
- }
- else {
- name = Clist_GetContactDisplayName(pDat->ExImContact->hContact);
- }
- break;
- case EXIM_SUBGROUP:
- name = (LPCTSTR) pDat->ExImContact->ptszName;
- break;
- case EXIM_ACCOUNT:
- PROTOACCOUNT* acc = Proto_GetAccount(pDat->ExImContact->pszName);
- name = (LPCTSTR) acc->tszAccountName;
- break;
+ case EXIM_ALL:
+ case EXIM_GROUP:
+ name = TranslateT("All Contacts");
+ break;
+ case EXIM_CONTACT:
+ if (pDat->ExImContact->hContact == NULL) {
+ name = TranslateT("Owner");
+ }
+ else {
+ name = Clist_GetContactDisplayName(pDat->ExImContact->hContact);
+ }
+ break;
+ case EXIM_SUBGROUP:
+ name = (LPCTSTR)pDat->ExImContact->ptszName;
+ break;
+ case EXIM_ACCOUNT:
+ PROTOACCOUNT* acc = Proto_GetAccount(pDat->ExImContact->pszName);
+ name = (LPCTSTR)acc->tszAccountName;
+ break;
}
TranslateDialogDefault(hDlg); //to translate oldTitle
GetWindowText(hDlg, oldTitle, _countof(oldTitle));
@@ -241,11 +238,11 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // add items that are always exported
tviiT.hParent = TVI_ROOT;
tviiT.hInsertAfter = TVI_FIRST;
- tviiT.itemex.mask = TVIF_TEXT|TVIF_STATE;
+ tviiT.itemex.mask = TVIF_TEXT | TVIF_STATE;
tviiT.itemex.pszText = TranslateT("Required modules");
tviiT.itemex.state = tviiT.itemex.stateMask = TVIS_EXPANDED;
if (bImagesLoaded) {
- tviiT.itemex.mask |= TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tviiT.itemex.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tviiT.itemex.iImage = tviiT.itemex.iSelectedImage = 0;
}
if (hItemEssential = TreeView_InsertItem(hTree, &tviiT)) {
@@ -275,8 +272,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar if (!Modules.EnumModules()) // init Modul list
{
- for (auto &p : Modules)
- {
+ for (auto &p : Modules) {
/*Filter/
if (!DB::Module::IsMeta(p))/end Filter*/
{
@@ -284,44 +280,38 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar if (pDat->ExImContact->Typ != EXIM_CONTACT) // TRUE = All Contacts
{
MCONTACT hContact;
-
- for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
- {
+
+ for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
// ignore empty modules
if (!DB::Module::IsEmpty(hContact, p)) {
pszProto = Proto_GetBaseAccountName(hContact);
// Filter by mode
- switch (pDat->ExImContact->Typ)
- {
- case EXIM_ALL:
- case EXIM_GROUP:
- break;
- case EXIM_SUBGROUP:
- if (mir_wstrncmp(pDat->ExImContact->ptszName, DB::Setting::GetTString(hContact, "CList", "Group"), mir_wstrlen(pDat->ExImContact->ptszName))) {
- continue;
- }
- break;
- case EXIM_ACCOUNT:
- if (mir_strcmp(pDat->ExImContact->pszName, pszProto)) {
- continue;
- }
- break;
+ switch (pDat->ExImContact->Typ) {
+ case EXIM_ALL:
+ case EXIM_GROUP:
+ break;
+ case EXIM_SUBGROUP:
+ if (mir_wstrncmp(pDat->ExImContact->ptszName, DB::Setting::GetTString(hContact, "CList", "Group"), mir_wstrlen(pDat->ExImContact->ptszName))) {
+ continue;
+ }
+ break;
+ case EXIM_ACCOUNT:
+ if (mir_strcmp(pDat->ExImContact->pszName, pszProto)) {
+ continue;
+ }
+ break;
}
// contact's base protocol is to be added to the treeview uniquely
- if (!mir_strcmpi(p, pszProto))
- {
+ if (!mir_strcmpi(p, pszProto)) {
if (!ExportTree_FindItem(hTree, hItemEssential, p))
- {
ExportTree_AddItem(hTree, hItemEssential, p, bImagesLoaded, 0);
- }
break;
}
// add optional module, which is valid for at least one contact
/*/Filter/*/
- if (mir_strcmpi(p, USERINFO) && mir_strcmpi(p, MOD_MBIRTHDAY) && mir_strcmpi(p, META_PROTO))
- {
+ if (mir_strcmpi(p, USERINFO) && mir_strcmpi(p, MOD_MBIRTHDAY) && mir_strcmpi(p, META_PROTO)) {
ExportTree_AddItem(hTree, hItemOptional, p, bImagesLoaded, 1);
break;
}
@@ -336,8 +326,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar (!pDat->ExImContact->hContact || mir_strcmpi(p, pszProto)) &&
//mir_strcmpi(p, "Protocol") &&
mir_strcmpi(p, USERINFO) &&
- mir_strcmpi(p, MOD_MBIRTHDAY))
- {
+ mir_strcmpi(p, MOD_MBIRTHDAY)) {
ExportTree_AddItem(hTree, hItemOptional, (LPSTR)p, bImagesLoaded, 1);
}
} // end
@@ -346,74 +335,72 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar }
}
TranslateDialogDefault(hDlg);
- return TRUE;
}
- case WM_CTLCOLORSTATIC:
- if (GetDlgItem(hDlg, STATIC_WHITERECT) == (HWND)lParam || GetDlgItem(hDlg, ICO_DLGLOGO) == (HWND)lParam) {
- SetBkColor((HDC)wParam, RGB(255, 255, 255));
- return (INT_PTR)GetStockObject(WHITE_BRUSH);
- }
- SetBkMode((HDC)wParam, TRANSPARENT);
- return (INT_PTR)GetStockObject(NULL_BRUSH);
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDOK:
- {
- HWND hTree = GetDlgItem(hDlg, IDC_TREE);
- HTREEITEM hParent;
-
- // search the tree item of optional items
- for (hParent = TreeView_GetRoot(hTree);
- hParent != nullptr;
- hParent = TreeView_GetNextSibling(hTree, hParent))
- {
- ExportTree_AppendModuleList(hTree, hParent, pDat->pModules);
- }
- return EndDialog(hDlg, IDOK);
+ return TRUE;
+
+ case WM_CTLCOLORSTATIC:
+ if (GetDlgItem(hDlg, STATIC_WHITERECT) == (HWND)lParam || GetDlgItem(hDlg, ICO_DLGLOGO) == (HWND)lParam) {
+ SetBkColor((HDC)wParam, RGB(255, 255, 255));
+ return (INT_PTR)GetStockObject(WHITE_BRUSH);
+ }
+ SetBkMode((HDC)wParam, TRANSPARENT);
+ return (INT_PTR)GetStockObject(NULL_BRUSH);
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDOK:
+ {
+ HWND hTree = GetDlgItem(hDlg, IDC_TREE);
+ HTREEITEM hParent;
+
+ // search the tree item of optional items
+ for (hParent = TreeView_GetRoot(hTree);
+ hParent != nullptr;
+ hParent = TreeView_GetNextSibling(hTree, hParent)) {
+ ExportTree_AppendModuleList(hTree, hParent, pDat->pModules);
}
- case IDCANCEL:
- return EndDialog(hDlg, IDCANCEL);
-
- case BTN_CHECK:
- case BTN_UNCHECK:
- {
- HWND hTree = GetDlgItem(hDlg, IDC_TREE);
- LPCSTR pszRoot = Translate("Optional modules");
- TVITEMA tvi;
- CHAR szText[128];
-
- tvi.mask = TVIF_TEXT;
- tvi.pszText = szText;
- tvi.cchTextMax = _countof(szText);
-
- // search the tree item of optional items
- for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_ROOT, NULL);
- tvi.hItem != nullptr && SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&tvi);
- tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem))
- {
- if (!mir_strcmpi(tvi.pszText, pszRoot)) {
- tvi.mask = TVIF_STATE;
- tvi.state = INDEXTOSTATEIMAGEMASK(LOWORD(wParam) == BTN_UNCHECK ? 1 : 2);
- tvi.stateMask = TVIS_STATEIMAGEMASK;
-
- for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)tvi.hItem);
- tvi.hItem != nullptr;
- tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem))
- {
- SendMessageA(hTree, TVM_SETITEMA, NULL, (LPARAM)&tvi);
- }
- break;
+ return EndDialog(hDlg, IDOK);
+ }
+ case IDCANCEL:
+ return EndDialog(hDlg, IDCANCEL);
+
+ case BTN_CHECK:
+ case BTN_UNCHECK:
+ {
+ HWND hTree = GetDlgItem(hDlg, IDC_TREE);
+ LPCSTR pszRoot = Translate("Optional modules");
+ TVITEMA tvi;
+ CHAR szText[128];
+
+ tvi.mask = TVIF_TEXT;
+ tvi.pszText = szText;
+ tvi.cchTextMax = _countof(szText);
+
+ // search the tree item of optional items
+ for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_ROOT, NULL);
+ tvi.hItem != nullptr && SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&tvi);
+ tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem)) {
+ if (!mir_strcmpi(tvi.pszText, pszRoot)) {
+ tvi.mask = TVIF_STATE;
+ tvi.state = INDEXTOSTATEIMAGEMASK(LOWORD(wParam) == BTN_UNCHECK ? 1 : 2);
+ tvi.stateMask = TVIS_STATEIMAGEMASK;
+
+ for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)tvi.hItem);
+ tvi.hItem != nullptr;
+ tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem)) {
+ SendMessageA(hTree, TVM_SETITEMA, NULL, (LPARAM)&tvi);
}
+ break;
}
- break;
}
+ break;
}
- break;
+ }
+ break;
- case WM_DESTROY:
- mir_free(pDat);
- break;
+ case WM_DESTROY:
+ mir_free(pDat);
+ break;
}
return 0;
}
@@ -434,4 +421,3 @@ int DlgExImModules_SelectModulesToExport(lpExImParam ExImContact, DB::CEnumList* dat.pModules = pModules;
return (IDOK != DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_EXPORT), hParent, SelectModulesToExport_DlgProc, (LPARAM)&dat));
}
-
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp index 8e4ca959ae..3535f8d261 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp @@ -38,9 +38,9 @@ INT_PTR CALLBACK DlgProcProgress(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar case WM_INITDIALOG:
{
const ICONCTRL idIcon[] = {
- { ICO_DLG_IMPORT, WM_SETICON, NULL },
- { ICO_DLG_IMPORT, STM_SETIMAGE, ICO_DLGLOGO },
- { ICO_BTN_CANCEL, BM_SETIMAGE, IDCANCEL }
+ { IDI_IMPORT, WM_SETICON, NULL },
+ { IDI_IMPORT, STM_SETIMAGE, ICO_DLGLOGO },
+ { IDI_BTN_CLOSE, BM_SETIMAGE, IDCANCEL }
};
const int numIconsToSet = g_plugin.getByte(SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 2;
IcoLib_SetCtrlIcons(hDlg, idIcon, numIconsToSet);
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index 67344160c0..8dd883c6c8 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -30,10 +30,10 @@ INT_PTR CALLBACK DlgProc_DataHistory(HWND hDlg, UINT msg, WPARAM wParam, LPARAM TranslateDialogDefault(hDlg);
{
const ICONCTRL idIcon[] = {
- { ICO_DLG_EXPORT, WM_SETICON, NULL },
- { ICO_DLG_EXPORT, STM_SETIMAGE, ICO_DLGLOGO },
- { ICO_BTN_EXPORT, BM_SETIMAGE, IDOK },
- { ICO_BTN_CANCEL, BM_SETIMAGE, IDCANCEL }
+ { IDI_EXPORT, WM_SETICON, NULL },
+ { IDI_EXPORT, STM_SETIMAGE, ICO_DLGLOGO },
+ { IDI_EXPORT, BM_SETIMAGE, IDOK },
+ { IDI_BTN_CLOSE, BM_SETIMAGE, IDCANCEL }
};
const int numIconsToSet = g_plugin.getByte(SET_ICONS_BUTTONS, 1) ? _countof(idIcon) : 2;
IcoLib_SetCtrlIcons(hDlg, idIcon, numIconsToSet);
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp index 6d017b966f..cc5389422a 100644 --- a/plugins/UserInfoEx/src/init.cpp +++ b/plugins/UserInfoEx/src/init.cpp @@ -67,18 +67,18 @@ static int OnTopToolBarLoaded(WPARAM, LPARAM) TTBButton ttb = {};
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_USERINFO_SHOWDIALOG;
- ttb.hIconHandleUp = IcoLib_GetIconHandle(ICO_COMMON_MAIN);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_MAIN);
ttb.name = ttb.pszTooltipUp = LPGEN("User &details");
g_plugin.addTTB(&ttb);
ttb.dwFlags = TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_USERINFO_REMINDER_LIST;
- ttb.hIconHandleUp = IcoLib_GetIconHandle(ICO_COMMON_ANNIVERSARY);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_ANNIVERSARY);
ttb.name = ttb.pszTooltipUp = LPGEN("Anniversary list");
g_plugin.addTTB(&ttb);
ttb.pszService = MS_USERINFO_REMINDER_CHECK;
- ttb.hIconHandleUp = IcoLib_GetIconHandle(ICO_COMMON_BIRTHDAY);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_BIRTHDAY);
ttb.name = ttb.pszTooltipUp = LPGEN("Check anniversaries");
g_plugin.addTTB(&ttb);
return 0;
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index a703d3d457..8d13206a7c 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -23,109 +23,109 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static IconItem common[] =
{
- { LPGEN("Main"), ICO_COMMON_MAIN, IDI_MAIN },
- { LPGEN("Default"), ICO_COMMON_DEFAULT, IDI_DEFAULT }
+ { LPGEN("Main"), "common_main", IDI_MAIN },
+ { LPGEN("Default"), "common_default", IDI_DEFAULT }
};
static IconItem icons1[] =
{
// common
- { ICO_COMMON_IM, LPGEN("IM naming"), IDI_MIRANDA },
- { ICO_COMMON_PASSWORD, LPGEN("Password"), IDI_PASSWORD },
- { ICO_COMMON_FEMALE, LPGEN("Female"), IDI_FEMALE },
- { ICO_COMMON_MALE, LPGEN("Male"), IDI_MALE },
- { ICO_COMMON_BIRTHDAY, LPGEN("Birthday"), IDI_BIRTHDAY },
- { ICO_COMMON_CLOCK, LPGEN("Timezone"), IDI_CLOCK, 32 },
- { ICO_COMMON_MARITAL, LPGEN("Marital status"), IDI_MARITAL },
- { ICO_COMMON_ADDRESS, LPGEN("Address"), IDI_TREE_ADDRESS },
- { ICO_COMMON_ANNIVERSARY,LPGEN("Anniversary"), IDI_ANNIVERSARY },
+ { "common_im", LPGEN("IM naming"), IDI_MIRANDA },
+ { "common_password", LPGEN("Password"), IDI_PASSWORD },
+ { "common_female", LPGEN("Female"), IDI_FEMALE },
+ { "common_male", LPGEN("Male"), IDI_MALE },
+ { "common_birthday", LPGEN("Birthday"), IDI_BIRTHDAY },
+ { "common_clock", LPGEN("Timezone"), IDI_CLOCK, 32 },
+ { "common_marital", LPGEN("Marital status"), IDI_MARITAL },
+ { "common_address", LPGEN("Address"), IDI_TREE_ADDRESS },
+ { "common_anniversary", LPGEN("Anniversary"), IDI_ANNIVERSARY },
// zodiac
- { ICO_ZOD_AQUARIUS, LPGEN("Aquarius"), IDI_ZOD_AQUARIUS, 128 },
- { ICO_ZOD_ARIES, LPGEN("Aries"), IDI_ZOD_ARIES, 128 },
- { ICO_ZOD_CANCER, LPGEN("Cancer"), IDI_ZOD_CANCER, 128 },
- { ICO_ZOD_CAPRICORN, LPGEN("Capricorn"), IDI_ZOD_CAPRICORN, 128 },
- { ICO_ZOD_GEMINI, LPGEN("Gemini"), IDI_ZOD_GEMINI, 128 },
- { ICO_ZOD_LEO, LPGEN("Leo"), IDI_ZOD_LEO, 128 },
- { ICO_ZOD_LIBRA, LPGEN("Libra"), IDI_ZOD_LIBRA, 128 },
- { ICO_ZOD_PISCES, LPGEN("Pisces"), IDI_ZOD_PISCES, 128 },
- { ICO_ZOD_SAGITTARIUS, LPGEN("Sagittarius"), IDI_ZOD_SAGITTARIUS, 128 },
- { ICO_ZOD_SCORPIO, LPGEN("Scorpio"), IDI_ZOD_SCORPIO, 128 },
- { ICO_ZOD_TAURUS, LPGEN("Taurus"), IDI_ZOD_TAURUS, 128 },
- { ICO_ZOD_VIRGO, LPGEN("Virgo"), IDI_ZOD_VIRGO, 128 },
+ { "zod_aquarius", LPGEN("Aquarius"), IDI_ZOD_AQUARIUS, 128 },
+ { "zod_aries", LPGEN("Aries"), IDI_ZOD_ARIES, 128 },
+ { "zod_cancer", LPGEN("Cancer"), IDI_ZOD_CANCER, 128 },
+ { "zod_capricorn", LPGEN("Capricorn"), IDI_ZOD_CAPRICORN, 128 },
+ { "zod_gemini", LPGEN("Gemini"), IDI_ZOD_GEMINI, 128 },
+ { "zod_leo", LPGEN("Leo"), IDI_ZOD_LEO, 128 },
+ { "zod_libra", LPGEN("Libra"), IDI_ZOD_LIBRA, 128 },
+ { "zod_pisces", LPGEN("Pisces"), IDI_ZOD_PISCES, 128 },
+ { "zod_sagittarius", LPGEN("Sagittarius"), IDI_ZOD_SAGITTARIUS, 128 },
+ { "zod_scorpio", LPGEN("Scorpio"), IDI_ZOD_SCORPIO, 128 },
+ { "zod_taurus", LPGEN("Taurus"), IDI_ZOD_TAURUS, 128 },
+ { "zod_virgo", LPGEN("Virgo"), IDI_ZOD_VIRGO, 128 },
// lists
- { ICO_LST_MODULES, LPGEN("Export: modules"), IDI_LST_MODULES },
- { ICO_LST_FOLDER, LPGEN("Export: folder"), IDI_LST_FOLDER },
+ { "lst_modules", LPGEN("Export: modules"), IDI_LST_MODULES },
+ { "lst_folder", LPGEN("Export: folder"), IDI_LST_FOLDER },
};
static IconItem icons2[] =
{
// tree
- { ICO_TREE_DEFAULT, LPGEN("Default"), IDI_LST_FOLDER },
+ { "tree_default", LPGEN("Default"), IDI_LST_FOLDER },
};
static IconItem icons3[] =
{
// dialogs
- { ICO_DLG_DETAILS, LPGEN("Details info bar"), IDI_DLG_DETAILS, 48 },
- { ICO_DLG_PHONE, LPGEN("Phone info bar"), IDI_DLG_PHONE, 32 },
- { ICO_DLG_EMAIL, LPGEN("E-mail info bar"), IDI_DLG_EMAIL, 32 },
- { ICO_DLG_EXPORT, LPGEN("Export VCard"), IDI_EXPORT, 32 },
- { ICO_DLG_IMPORT, LPGEN("Import VCard"), IDI_IMPORT, 32 },
- { ICO_DLG_ANNIVERSARY, LPGEN("Anniversary info bar"), IDI_ANNIVERSARY, 32 },
+ { "dlg_details", LPGEN("Details info bar"), IDI_DLG_DETAILS, 48 },
+ { "dlg_phone", LPGEN("Phone info bar"), IDI_DLG_PHONE, 32 },
+ { "dlg_email", LPGEN("E-mail info bar"), IDI_DLG_EMAIL, 32 },
+ { "dlg_export", LPGEN("Export VCard"), IDI_EXPORT, 32 },
+ { "dlg_import", LPGEN("Import VCard"), IDI_IMPORT, 32 },
+ { "dlg_anniversary", LPGEN("Anniversary info bar"), IDI_ANNIVERSARY, 32 },
};
static IconItem icons4[] =
{
// button icons
- { ICO_BTN_UPDATE, LPGEN("Update"), IDI_BTN_UPDATE },
- { ICO_BTN_IMPORT, LPGEN("Import"), IDI_IMPORT },
- { ICO_BTN_EXPORT, LPGEN("Export"), IDI_EXPORT },
- { ICO_BTN_OK, LPGEN("OK"), IDI_BTN_OK },
- { ICO_BTN_CANCEL, LPGEN("Cancel"), IDI_BTN_CLOSE },
- { ICO_BTN_APPLY, LPGEN("Apply"), IDI_BTN_APPLY },
- { ICO_BTN_GOTO, LPGEN("Goto"), IDI_BTN_GOTO },
- { ICO_BTN_PHONE, LPGEN("Phone"), IDI_BTN_PHONE },
- { ICO_BTN_FAX, LPGEN("Fax"), IDI_BTN_FAX },
- { ICO_BTN_CELLULAR, LPGEN("Cellular"), IDI_BTN_CELLULAR },
- { ICO_BTN_CUSTOMPHONE, LPGEN("Custom phone"), IDI_BTN_CUSTOMPHONE },
- { ICO_BTN_EMAIL, LPGEN("E-mail"), IDI_BTN_EMAIL },
- { ICO_BTN_DOWNARROW, LPGEN("Down arrow"), IDI_BTN_DOWNARROW },
- { ICO_BTN_ADD, LPGEN("Add"), IDI_BTN_ADD },
- { ICO_BTN_EDIT, LPGEN("Edit"), IDI_BTN_EDIT },
- { ICO_BTN_DELETE, LPGEN("Delete"), IDI_BTN_DELETE },
- { ICO_BTN_SEARCH, LPGEN("Search"), IDI_SEARCH },
- { ICO_BTN_EXIMPORT, LPGEN("Export/import"), IDI_BTN_EXIMPORT },
- { ICO_BTN_BDAY_BACKUP, LPGEN("Backup birthday"), IDI_BTN_BIRTHDAY_BACKUP },
+ { "btn_update", LPGEN("Update"), IDI_BTN_UPDATE },
+ { "btn_import", LPGEN("Import"), IDI_IMPORT },
+ { "btn_export", LPGEN("Export"), IDI_EXPORT },
+ { "btn_ok", LPGEN("OK"), IDI_BTN_OK },
+ { "btn_cancel", LPGEN("Cancel"), IDI_BTN_CLOSE },
+ { "btn_apply", LPGEN("Apply"), IDI_BTN_APPLY },
+ { "btn_goto", LPGEN("Goto"), IDI_BTN_GOTO },
+ { "btn_phone", LPGEN("Phone"), IDI_BTN_PHONE },
+ { "btn_fax", LPGEN("Fax"), IDI_BTN_FAX },
+ { "btn_cellular", LPGEN("Cellular"), IDI_BTN_CELLULAR },
+ { "btn_customphone", LPGEN("Custom phone"), IDI_BTN_CUSTOMPHONE },
+ { "btn_email", LPGEN("E-mail"), IDI_BTN_EMAIL },
+ { "btn_downarrow", LPGEN("Down arrow"), IDI_BTN_DOWNARROW },
+ { "btn_add", LPGEN("Add"), IDI_BTN_ADD },
+ { "btn_edit", LPGEN("Edit"), IDI_BTN_EDIT },
+ { "btn_delete", LPGEN("Delete"), IDI_BTN_DELETE },
+ { "btn_search", LPGEN("Search"), IDI_SEARCH },
+ { "btn_eximport", LPGEN("Export/import"), IDI_BTN_EXIMPORT },
+ { "btn_bdaybackup", LPGEN("Backup birthday"), IDI_BTN_BIRTHDAY_BACKUP },
};
static IconItem icons5[] =
{
// birthday and anniversary
- { ICO_RMD_DTB0, LPGEN("Birthday today"), IDI_RMD_DTB0 },
- { ICO_RMD_DTB1, LPGEN("Birthday tomorrow"), IDI_RMD_DTB1 },
- { ICO_RMD_DTB2, LPGEN("Birthday in 2 days"), IDI_RMD_DTB2 },
- { ICO_RMD_DTB3, LPGEN("Birthday in 3 days"), IDI_RMD_DTB3 },
- { ICO_RMD_DTB4, LPGEN("Birthday in 4 days"), IDI_RMD_DTB4 },
- { ICO_RMD_DTB5, LPGEN("Birthday in 5 days"), IDI_RMD_DTB5 },
- { ICO_RMD_DTB6, LPGEN("Birthday in 6 days"), IDI_RMD_DTB6 },
- { ICO_RMD_DTB7, LPGEN("Birthday in 7 days"), IDI_RMD_DTB7 },
- { ICO_RMD_DTB8, LPGEN("Birthday in 8 days"), IDI_RMD_DTB8 },
- { ICO_RMD_DTB9, LPGEN("Birthday in 9 days"), IDI_RMD_DTB9 },
- { ICO_RMD_DTBX, LPGEN("Birthday later"), IDI_RMD_DTBX },
-
- { ICO_RMD_DTA0, LPGEN("Anniversary today"), IDI_RMD_DTA0 },
- { ICO_RMD_DTA1, LPGEN("Anniversary tomorrow"), IDI_RMD_DTA1 },
- { ICO_RMD_DTA2, LPGEN("Anniversary in 2 days"), IDI_RMD_DTA2 },
- { ICO_RMD_DTA3, LPGEN("Anniversary in 3 days"), IDI_RMD_DTA3 },
- { ICO_RMD_DTA4, LPGEN("Anniversary in 4 days"), IDI_RMD_DTA4 },
- { ICO_RMD_DTA5, LPGEN("Anniversary in 5 days"), IDI_RMD_DTA5 },
- { ICO_RMD_DTA6, LPGEN("Anniversary in 6 days"), IDI_RMD_DTA6 },
- { ICO_RMD_DTA7, LPGEN("Anniversary in 7 days"), IDI_RMD_DTA7 },
- { ICO_RMD_DTA8, LPGEN("Anniversary in 8 days"), IDI_RMD_DTA8 },
- { ICO_RMD_DTA9, LPGEN("Anniversary in 9 days"), IDI_RMD_DTA9 },
- { ICO_RMD_DTAX, LPGEN("Anniversary later"), IDI_RMD_DTAX },
+ { "rmd_dtb0", LPGEN("Birthday today"), IDI_RMD_DTB0 },
+ { "rmd_dtb1", LPGEN("Birthday tomorrow"), IDI_RMD_DTB1 },
+ { "rmd_dtb2", LPGEN("Birthday in 2 days"), IDI_RMD_DTB2 },
+ { "rmd_dtb3", LPGEN("Birthday in 3 days"), IDI_RMD_DTB3 },
+ { "rmd_dtb4", LPGEN("Birthday in 4 days"), IDI_RMD_DTB4 },
+ { "rmd_dtb5", LPGEN("Birthday in 5 days"), IDI_RMD_DTB5 },
+ { "rmd_dtb6", LPGEN("Birthday in 6 days"), IDI_RMD_DTB6 },
+ { "rmd_dtb7", LPGEN("Birthday in 7 days"), IDI_RMD_DTB7 },
+ { "rmd_dtb8", LPGEN("Birthday in 8 days"), IDI_RMD_DTB8 },
+ { "rmd_dtb9", LPGEN("Birthday in 9 days"), IDI_RMD_DTB9 },
+ { "rmd_dtbx", LPGEN("Birthday later"), IDI_RMD_DTBX },
+
+ { "rmd_dta0", LPGEN("Anniversary today"), IDI_RMD_DTA0 },
+ { "rmd_dta1", LPGEN("Anniversary tomorrow"), IDI_RMD_DTA1 },
+ { "rmd_dta2", LPGEN("Anniversary in 2 days"), IDI_RMD_DTA2 },
+ { "rmd_dta3", LPGEN("Anniversary in 3 days"), IDI_RMD_DTA3 },
+ { "rmd_dta4", LPGEN("Anniversary in 4 days"), IDI_RMD_DTA4 },
+ { "rmd_dta5", LPGEN("Anniversary in 5 days"), IDI_RMD_DTA5 },
+ { "rmd_dta6", LPGEN("Anniversary in 6 days"), IDI_RMD_DTA6 },
+ { "rmd_dta7", LPGEN("Anniversary in 7 days"), IDI_RMD_DTA7 },
+ { "rmd_dta8", LPGEN("Anniversary in 8 days"), IDI_RMD_DTA8 },
+ { "rmd_dta9", LPGEN("Anniversary in 9 days"), IDI_RMD_DTA9 },
+ { "rmd_dtax", LPGEN("Anniversary later"), IDI_RMD_DTAX },
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -182,7 +182,7 @@ static HINSTANCE IcoLib_CheckIconPackVersion(wchar_t *szIconPack) void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL *pCtrl, BYTE numCtrls)
{
for (int i = 0; i < numCtrls; i++) {
- HICON hIcon = IcoLib_GetIcon(pCtrl[i].pszIcon);
+ HICON hIcon = g_plugin.getIcon(pCtrl[i].iIcon);
if (!pCtrl[i].idCtrl) {
SendMessage(hDlg, pCtrl[i].Message, ICON_BIG, (LPARAM)hIcon);
continue;
@@ -206,16 +206,16 @@ void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL *pCtrl, BYTE numCtrls) void IcoLib_LoadModule()
{
- g_plugin.registerIcon(SECT_COMMON, common);
+ g_plugin.registerIcon(SECT_COMMON, common, MODULENAME);
wchar_t *szDefaultFile = IcoLib_GetDefaultIconFileName();
HINSTANCE hIconPack = IcoLib_CheckIconPackVersion(szDefaultFile);
if (hIconPack) {
- Icon_Register(hIconPack, SECT_COMMON, icons1, _countof(icons1), 0, &g_plugin);
- Icon_Register(hIconPack, SECT_TREE, icons2, _countof(icons2), 0, &g_plugin);
- Icon_Register(hIconPack, SECT_DLG, icons3, _countof(icons3), 0, &g_plugin);
- Icon_Register(hIconPack, SECT_BUTTONS, icons4, _countof(icons4), 0, &g_plugin);
- Icon_Register(hIconPack, SECT_REMIND, icons5, _countof(icons5), 0, &g_plugin);
+ Icon_Register(hIconPack, SECT_COMMON, icons1, _countof(icons1), MODULENAME, &g_plugin);
+ Icon_Register(hIconPack, SECT_TREE, icons2, _countof(icons2), MODULENAME, &g_plugin);
+ Icon_Register(hIconPack, SECT_DLG, icons3, _countof(icons3), MODULENAME, &g_plugin);
+ Icon_Register(hIconPack, SECT_BUTTONS, icons4, _countof(icons4), MODULENAME, &g_plugin);
+ Icon_Register(hIconPack, SECT_REMIND, icons5, _countof(icons5), MODULENAME, &g_plugin);
FreeLibrary(hIconPack);
}
}
diff --git a/plugins/UserInfoEx/src/mir_icolib.h b/plugins/UserInfoEx/src/mir_icolib.h index de9424ac25..e632d47394 100644 --- a/plugins/UserInfoEx/src/mir_icolib.h +++ b/plugins/UserInfoEx/src/mir_icolib.h @@ -29,101 +29,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SECT_TREE LPGEN("Extended user info") "/" LPGEN("Treeview")
#define SECT_REMIND LPGEN("Extended user info") "/" LPGEN("Reminder")
-// icons
-#define ICO_COMMON_MAIN MODULENAME"_common_main"
-#define ICO_COMMON_DEFAULT MODULENAME"_common_default"
-#define ICO_COMMON_IM MODULENAME"_common_im"
-#define ICO_COMMON_FEMALE MODULENAME"_common_female"
-#define ICO_COMMON_MALE MODULENAME"_common_male"
-#define ICO_COMMON_BIRTHDAY MODULENAME"_common_birthday"
-#define ICO_COMMON_ANNIVERSARY MODULENAME"_common_anniversary"
-#define ICO_COMMON_CLOCK MODULENAME"_common_clock"
-#define ICO_COMMON_MARITAL MODULENAME"_common_marital"
-#define ICO_COMMON_PASSWORD MODULENAME"_common_password"
-#define ICO_COMMON_ADDRESS MODULENAME"_common_address"
-#define ICO_DLG_DETAILS MODULENAME"_dlg_details"
-#define ICO_DLG_PHONE MODULENAME"_dlg_phone"
-#define ICO_DLG_EMAIL MODULENAME"_dlg_email"
-#define ICO_DLG_EXPORT MODULENAME"_dlg_export"
-#define ICO_DLG_IMPORT MODULENAME"_dlg_import"
-#define ICO_DLG_ANNIVERSARY MODULENAME"_dlg_anniversary"
-#define ICO_DLG_SEARCH MODULENAME"_dlg_search"
-#define ICO_LST_MODULES MODULENAME"_lst_modules"
-#define ICO_LST_FOLDER MODULENAME"_lst_folder"
-#define ICO_BTN_UPDATE MODULENAME"_btn_update"
-#define ICO_BTN_OK MODULENAME"_btn_ok"
-#define ICO_BTN_CANCEL MODULENAME"_btn_cancel"
-#define ICO_BTN_APPLY MODULENAME"_btn_apply"
-#define ICO_BTN_GOTO MODULENAME"_btn_goto"
-#define ICO_BTN_ADD MODULENAME"_btn_add"
-#define ICO_BTN_EDIT MODULENAME"_btn_edit"
-#define ICO_BTN_DELETE MODULENAME"_btn_delete"
-#define ICO_BTN_IMPORT MODULENAME"_btn_import"
-#define ICO_BTN_EXPORT MODULENAME"_btn_export"
-#define ICO_BTN_NOTES MODULENAME"_btn_notes"
-#define ICO_BTN_ABOUT MODULENAME"_btn_about"
-#define ICO_BTN_PROFILE MODULENAME"_btn_profile"
-#define ICO_BTN_DOWNARROW MODULENAME"_btn_downarrow"
-#define ICO_BTN_PHONE MODULENAME"_btn_phone"
-#define ICO_BTN_FAX MODULENAME"_btn_fax"
-#define ICO_BTN_CELLULAR MODULENAME"_btn_cellular"
-#define ICO_BTN_CUSTOMPHONE MODULENAME"_btn_customphone"
-#define ICO_BTN_EMAIL MODULENAME"_btn_email"
-#define ICO_BTN_SEARCH MODULENAME"_btn_search"
-#define ICO_BTN_EXIMPORT MODULENAME"_btn_eximport"
-#define ICO_BTN_BDAY_BACKUP MODULENAME"_btn_bdaybackup"
-#define ICO_BTN_YES MODULENAME"_btn_yes"
-#define ICO_BTN_NO MODULENAME"_btn_no"
-#define ICO_BTN_IGNORE MODULENAME"_btn_ignore"
-#define ICO_ZOD_AQUARIUS MODULENAME"_zod_aquarius"
-#define ICO_ZOD_ARIES MODULENAME"_zod_aries"
-#define ICO_ZOD_CANCER MODULENAME"_zod_cancer"
-#define ICO_ZOD_CAPRICORN MODULENAME"_zod_capricorn"
-#define ICO_ZOD_GEMINI MODULENAME"_zod_gemini"
-#define ICO_ZOD_LEO MODULENAME"_zod_leo"
-#define ICO_ZOD_LIBRA MODULENAME"_zod_libra"
-#define ICO_ZOD_PISCES MODULENAME"_zod_pisces"
-#define ICO_ZOD_SAGITTARIUS MODULENAME"_zod_sagittarius"
-#define ICO_ZOD_SCORPIO MODULENAME"_zod_scorpio"
-#define ICO_ZOD_TAURUS MODULENAME"_zod_taurus"
-#define ICO_ZOD_VIRGO MODULENAME"_zod_virgo"
-#define ICO_TREE_DEFAULT MODULENAME"_tree_default"
-
-#define ICO_RMD_DTB0 MODULENAME"_rmd_dtb0"
-#define ICO_RMD_DTB1 MODULENAME"_rmd_dtb1"
-#define ICO_RMD_DTB2 MODULENAME"_rmd_dtb2"
-#define ICO_RMD_DTB3 MODULENAME"_rmd_dtb3"
-#define ICO_RMD_DTB4 MODULENAME"_rmd_dtb4"
-#define ICO_RMD_DTB5 MODULENAME"_rmd_dtb5"
-#define ICO_RMD_DTB6 MODULENAME"_rmd_dtb6"
-#define ICO_RMD_DTB7 MODULENAME"_rmd_dtb7"
-#define ICO_RMD_DTB8 MODULENAME"_rmd_dtb8"
-#define ICO_RMD_DTB9 MODULENAME"_rmd_dtb9"
-#define ICO_RMD_DTBX MODULENAME"_rmd_dtbx"
-
-#define ICO_RMD_DTA0 MODULENAME"_rmd_dta0"
-#define ICO_RMD_DTA1 MODULENAME"_rmd_dta1"
-#define ICO_RMD_DTA2 MODULENAME"_rmd_dta2"
-#define ICO_RMD_DTA3 MODULENAME"_rmd_dta3"
-#define ICO_RMD_DTA4 MODULENAME"_rmd_dta4"
-#define ICO_RMD_DTA5 MODULENAME"_rmd_dta5"
-#define ICO_RMD_DTA6 MODULENAME"_rmd_dta6"
-#define ICO_RMD_DTA7 MODULENAME"_rmd_dta7"
-#define ICO_RMD_DTA8 MODULENAME"_rmd_dta8"
-#define ICO_RMD_DTA9 MODULENAME"_rmd_dta9"
-#define ICO_RMD_DTAX MODULENAME"_rmd_dtax"
-
#define SET_ICONS_CHECKFILEVERSION "CheckIconPackVersion"
#define SET_ICONS_BUTTONS "ButtonIcons"
#define ICONINDEX(id) max((min((id), IDI_LASTICON)) - IDI_FIRST_ICON, 0)
-typedef struct TIconCtrl
+struct ICONCTRL
{
- LPCSTR pszIcon;
- UINT Message;
- WORD idCtrl;
-} ICONCTRL, *LPICONCTRL;
+ int iIcon;
+ UINT Message;
+ WORD idCtrl;
+};
LPTSTR IcoLib_GetDefaultIconFileName();
void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL* pCtrl, BYTE numCtrls);
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 8b33978a46..f3c1c6200c 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -96,7 +96,7 @@ void RebuildContact() //cascade all
SET_UID(mi, 0xeb3736b6, 0x3b6, 0x40fa, 0xa7, 0xe5, 0xbb, 0x40, 0xeb, 0x55, 0xf7, 0x84);
mi.position = 1000050000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MAIN);
mi.name.a = MODULELONGNAME;
mhRoot = Menu_AddContactMenuItem(&mi);
hMenuItem[0] = mhRoot;
@@ -106,7 +106,7 @@ void RebuildContact() //cascade Ex/Import
SET_UID(mi, 0x100de420, 0x4835, 0x4f8d, 0xbd, 0x58, 0x4f, 0x31, 0xcc, 0xe6, 0xc1, 0xa8);
mi.position = 1000050100;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BTN_EXIMPORT);
mi.name.a = LPGEN("Export/import contact");
mhExIm = Menu_AddContactMenuItem(&mi);
hMenuItem[0] = mhExIm;
@@ -123,7 +123,7 @@ void RebuildContact() mi.pszService = MS_USERINFO_SHOWDIALOG;
mi.name.a = LPGEN("User &details");
mi.position = 1000050000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MAIN);
hMenuItem[1] = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hMenuItem[1], MCI_OPT_HOTKEY, MAKELPARAM(VK_F3, MOD_ALT));
@@ -136,7 +136,7 @@ void RebuildContact() mi.pszService = MS_USERINFO_VCARD_EXPORT;
mi.name.a = mhExIm != NULL ? LPGEN("&Export") : LPGEN("&Export user details");
mi.position = 1000050200;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_EXPORT);
hMenuItem[2] = Menu_AddContactMenuItem(&mi);
// Import
@@ -144,7 +144,7 @@ void RebuildContact() mi.pszService = MS_USERINFO_VCARD_IMPORT;
mi.name.a = mhExIm != NULL ? LPGEN("&Import") : LPGEN("&Import user details");
mi.position = 1000050300;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_IMPORT);
hMenuItem[3] = Menu_AddContactMenuItem(&mi);
}
@@ -188,7 +188,7 @@ void RebuildMain() //cascade all
SET_UID(mi, 0x17d277d5, 0x2772, 0x40c6, 0xbd, 0xbb, 0x2c, 0x3a, 0xcc, 0xda, 0xc, 0x72);
mi.position = 500050000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MAIN);
mi.name.a = MODULELONGNAME;
mhRoot = Menu_AddMainMenuItem(&mi);
hMenuItem[item++] = mhRoot;
@@ -198,7 +198,7 @@ void RebuildMain() //cascade Ex/Import
SET_UID(mi, 0x80666af7, 0x1c92, 0x4ea6, 0xa8, 0xdc, 0x25, 0x88, 0x88, 0x27, 0x92, 0x68);
mi.position = 500050000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BTN_EXIMPORT);
mi.name.a = LPGEN("Export/import contact");
mhExIm = Menu_AddMainMenuItem(&mi);
hMenuItem[item++] = mhExIm;
@@ -215,7 +215,7 @@ void RebuildMain() mi.pszService = MS_USERINFO_SHOWDIALOG;
mi.name.a = LPGEN("View/change my &details...");
mi.position = 500050000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MAIN);
hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
// VCard's Ex/Import menuitems
@@ -226,7 +226,7 @@ void RebuildMain() mi.pszService = MS_USERINFO_VCARD_EXPORTALL;
mi.name.a = LPGEN("Export all contacts");
mi.position = 500150000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_EXPORT);
hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
// Import
@@ -234,7 +234,7 @@ void RebuildMain() mi.pszService = MS_USERINFO_VCARD_IMPORTALL;
mi.name.a = LPGEN("Import all contacts");
mi.position = 500151000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_IMPORT);
hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
// reminder
@@ -248,7 +248,7 @@ void RebuildMain() mi.pszService = MS_USERINFO_REMINDER_AGGRASIVEBACKUP;
mi.name.a = LPGEN("Backup birthdays");
mi.position = 500253000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_BDAY_BACKUP);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BTN_BIRTHDAY_BACKUP);
hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
// Check anniversaries
@@ -256,7 +256,7 @@ void RebuildMain() mi.pszService = MS_USERINFO_REMINDER_CHECK;
mi.name.a = LPGEN("Check anniversaries");
mi.position = 500251000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_SEARCH);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SEARCH);
hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
}
else {
@@ -269,7 +269,7 @@ void RebuildMain() mi.pszService = MS_USERINFO_REFRESH;
mi.name.a = LPGEN("Refresh contact details");
mi.position = 500254000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_UPDATE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BTN_UPDATE);
hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
// anniversary list
@@ -277,7 +277,7 @@ void RebuildMain() mi.pszService = MS_USERINFO_REMINDER_LIST;
mi.name.a = LPGEN("Anniversary list");
mi.position = 500252000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_COMMON_ANNIVERSARY);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ANNIVERSARY);
hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
}
@@ -326,7 +326,7 @@ void RebuildGroup() //cascade all
SET_UID(mi, 0xfefe20db, 0x431f, 0x4fef, 0x9d, 0xa6, 0x70, 0xcd, 0x25, 0xf1, 0x2f, 0x1d);
mi.position = 250000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MAIN);
mi.name.a = MODULELONGNAME;
mhRoot = Menu_AddGroupMenuItem(&mi);
hMenuItem[item++] = mhRoot;
@@ -336,7 +336,7 @@ void RebuildGroup() //cascade Ex/Import
SET_UID(mi, 0x3ec4da1, 0x8a1a, 0x4734, 0xba, 0x99, 0x7, 0x9c, 0x2, 0x46, 0xff, 0xec);
mi.position = 250100;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BTN_EXIMPORT);
mi.name.a = LPGEN("Export/import contact");
mhExIm = Menu_AddGroupMenuItem(&mi);
hMenuItem[item++] = mhExIm;
@@ -355,7 +355,7 @@ void RebuildGroup() mi.pszService = MS_USERINFO_VCARD_EXPORTALL;
mi.name.a = LPGEN("Export all contacts");
mi.position = 250200;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_EXPORT);
hMenuItem[item++] = Menu_AddGroupMenuItem(&mi);
// Import
@@ -363,7 +363,7 @@ void RebuildGroup() mi.pszService = MS_USERINFO_VCARD_IMPORTALL;
mi.name.a = LPGEN("Import all contacts");
mi.position = 250300;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_IMPORT);
hMenuItem[item++] = Menu_AddGroupMenuItem(&mi);
}
@@ -418,7 +418,7 @@ void RebuildSubGroup() //cascade all
SET_UID(mi, 0x77b46004, 0xe845, 0x41f4, 0x9a, 0x56, 0x72, 0xd9, 0xa5, 0x61, 0x4d, 0x5);
mi.position = 1050000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MAIN);
mi.name.a = MODULELONGNAME;
mhRoot = Menu_AddSubGroupMenuItem(&mi);
hMenuItem[item++] = mhRoot;
@@ -428,7 +428,7 @@ void RebuildSubGroup() //cascade Ex/Import
SET_UID(mi, 0xac5e810b, 0x4b41, 0x477c, 0x98, 0xfe, 0x8, 0x88, 0xec, 0x6f, 0xc3, 0xcf);
mi.position = 1050100;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BTN_EXIMPORT);
mi.name.a = LPGEN("Export/import group");
mhExIm = Menu_AddSubGroupMenuItem(&mi);
hMenuItem[item++] = mhExIm;
@@ -448,7 +448,7 @@ void RebuildSubGroup() if (!ServiceExists(mi.pszService)) CreateServiceFunction(mi.pszService, svcExIm_Group_Service);
mi.name.a = mhExIm != NULL ? LPGEN("&Export") : LPGEN("&Export group");
mi.position = 1050200;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_EXPORT);
gmp.wParam = TRUE;
hMenuItem[item++] = Menu_AddSubGroupMenuItem(&mi, &gmp);
@@ -458,7 +458,7 @@ void RebuildSubGroup() if (!ServiceExists(mi.pszService)) CreateServiceFunction(mi.pszService, svcExIm_Group_Service);
mi.name.a = mhExIm != NULL ? LPGEN("&Import") : LPGEN("&Import group");
mi.position = 1050300;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_IMPORT);
gmp.wParam = FALSE;
hMenuItem[item++] = Menu_AddSubGroupMenuItem(&mi, &gmp);
}
@@ -539,7 +539,7 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) case 5:
// cascade all
mi.position = 50100;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MAIN);
mi.name.a = MODULELONGNAME;
hMenuItemAccount[mItems*i + item] = Menu_AddStatusMenuItem(&mi, pa->szModuleName);
mhRoot = hMenuItemAccount[mItems*i + item++];
@@ -548,7 +548,7 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) case 9:
// cascade Ex/Import
mi.position = 50100;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BTN_EXIMPORT);
mi.name.a = LPGEN("Export/import");
hMenuItemAccount[mItems*i + item] = Menu_AddStatusMenuItem(&mi, pa->szModuleName);
mhRoot = hMenuItemAccount[mItems*i + item++];
@@ -567,7 +567,7 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) CreateServiceFunction(mi.pszService, svcExIm_Account_Service);
mi.name.a = LPGEN("&Export xml");
mi.position = 50200;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EXPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_EXPORT);
hMenuItemAccount[mItems*i + item++] = Menu_AddStatusMenuItem(&mi, pa->szModuleName);
// Import
@@ -575,7 +575,7 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) CreateServiceFunction(mi.pszService, svcExIm_Account_Service);
mi.name.a = LPGEN("&Import xml");
mi.position = 50300;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_IMPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_IMPORT);
hMenuItemAccount[mItems*i + item++] = Menu_AddStatusMenuItem(&mi, pa->szModuleName);
}
return 0;
diff --git a/plugins/UserInfoEx/src/psp_anniversary.cpp b/plugins/UserInfoEx/src/psp_anniversary.cpp index a75ad3d52f..a185512b59 100644 --- a/plugins/UserInfoEx/src/psp_anniversary.cpp +++ b/plugins/UserInfoEx/src/psp_anniversary.cpp @@ -45,10 +45,10 @@ static INT_PTR CALLBACK DlgProc_AnniversaryEditor(HWND hDlg, UINT uMsg, WPARAM w // set icons
if (g_plugin.getByte(SET_ICONS_BUTTONS, 1)) {
- SendDlgItemMessage(hDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_OK));
- SendDlgItemMessage(hDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_BTN_CANCEL));
+ SendDlgItemMessage(hDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_BTN_OK));
+ SendDlgItemMessage(hDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_BTN_CLOSE));
}
- SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_SETICON, 0, (LPARAM)IcoLib_GetIcon(ICO_DLG_ANNIVERSARY, TRUE));
+ SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_SETICON, 0, (LPARAM)g_plugin.getIcon(IDI_ANNIVERSARY, true));
// translate controls
SendDlgItemMessage(hDlg, IDOK, BUTTONTRANSLATE, NULL, NULL);
@@ -146,9 +146,9 @@ INT_PTR CALLBACK PSPProcAnniversary(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM case PSN_ICONCHANGED:
{
const ICONCTRL idIcon[] = {
- { ICO_COMMON_BIRTHDAY, STM_SETIMAGE, ICO_BIRTHDAY },
- { ICO_BTN_ADD, BM_SETIMAGE, BTN_ADD },
- { ICO_BTN_DELETE, BM_SETIMAGE, BTN_DELETE }
+ { IDI_BIRTHDAY, STM_SETIMAGE, ICO_BIRTHDAY },
+ { IDI_BTN_ADD, BM_SETIMAGE, BTN_ADD },
+ { IDI_BTN_DELETE, BM_SETIMAGE, BTN_DELETE }
};
IcoLib_SetCtrlIcons(hDlg, idIcon, _countof(idIcon));
}
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp index 75eb8909ec..0a2f3c857e 100644 --- a/plugins/UserInfoEx/src/psp_contact.cpp +++ b/plugins/UserInfoEx/src/psp_contact.cpp @@ -84,18 +84,18 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM // phone numbers
hCtrl = GetDlgItem(hDlg, EDIT_PHONE);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_PHONE, TranslateT(SET_CONTACT_PHONE), hContact, USERINFO, pszProto, SET_CONTACT_PHONE);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_FAX, TranslateT(SET_CONTACT_FAX), hContact, USERINFO, pszProto, SET_CONTACT_FAX);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_CELLULAR, TranslateT(SET_CONTACT_CELLULAR), hContact, USERINFO, pszProto, SET_CONTACT_CELLULAR);
- bChanged |= CtrlContactAddMyItemsFromDB(hCtrl, ICO_BTN_CUSTOMPHONE, 0, hContact, USERINFO, pszProto, SET_CONTACT_MYPHONE_CAT, SET_CONTACT_MYPHONE_VAL);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_PHONE, TranslateT(SET_CONTACT_PHONE), hContact, USERINFO, pszProto, SET_CONTACT_PHONE);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_FAX, TranslateT(SET_CONTACT_FAX), hContact, USERINFO, pszProto, SET_CONTACT_FAX);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_CELLULAR, TranslateT(SET_CONTACT_CELLULAR), hContact, USERINFO, pszProto, SET_CONTACT_CELLULAR);
+ bChanged |= CtrlContactAddMyItemsFromDB(hCtrl, IDI_BTN_CUSTOMPHONE, 0, hContact, USERINFO, pszProto, SET_CONTACT_MYPHONE_CAT, SET_CONTACT_MYPHONE_VAL);
SendMessage(hCtrl, CBEXM_SETCURSEL, (WPARAM)-1, TRUE);
// emails
hCtrl = GetDlgItem(hDlg, EDIT_EMAIL);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_EMAIL, TranslateT("Primary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_EMAIL);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_EMAIL, TranslateT("Secondary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_EMAIL0);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_EMAIL, TranslateT("Tertiary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_EMAIL1);
- bChanged |= CtrlContactAddMyItemsFromDB(hCtrl, ICO_BTN_EMAIL, 0, hContact, USERINFO, pszProto, SET_CONTACT_MYEMAIL_CAT, SET_CONTACT_MYEMAIL_VAL);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_EMAIL, TranslateT("Primary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_EMAIL);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_EMAIL, TranslateT("Secondary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_EMAIL0);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_EMAIL, TranslateT("Tertiary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_EMAIL1);
+ bChanged |= CtrlContactAddMyItemsFromDB(hCtrl, IDI_BTN_EMAIL, 0, hContact, USERINFO, pszProto, SET_CONTACT_MYEMAIL_CAT, SET_CONTACT_MYEMAIL_VAL);
SendMessage(hCtrl, CBEXM_SETCURSEL, (WPARAM)-1, TRUE);
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, bChanged ? PSP_CHANGED : 0);
}
@@ -124,11 +124,11 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM case PSN_ICONCHANGED:
{
- HICON hIcon = IcoLib_GetIcon(ICO_BTN_GOTO);
+ HICON hIcon = g_plugin.getIcon(IDI_BTN_GOTO);
SendDlgItemMessage(hDlg, BTN_GOTO, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SetDlgItemText(hDlg, BTN_GOTO, hIcon ? L"" : L"->");
- hIcon = IcoLib_GetIcon(ICO_COMMON_ADDRESS);
+ hIcon = g_plugin.getIcon(IDI_TREE_ADDRESS);
SendDlgItemMessage(hDlg, ICO_ADDRESS, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
ShowWindow(GetDlgItem(hDlg, ICO_ADDRESS), hIcon ? SW_SHOW : SW_HIDE);
@@ -228,18 +228,18 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM // phone numbers
hCtrl = GetDlgItem(hDlg, EDIT_PHONE);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_PHONE, TranslateT(SET_CONTACT_PHONE), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_PHONE);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_FAX, TranslateT(SET_CONTACT_FAX), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_FAX);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_CELLULAR, TranslateT(SET_CONTACT_CELLULAR), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_CELLULAR);
- bChanged |= CtrlContactAddMyItemsFromDB(hCtrl, ICO_BTN_CUSTOMPHONE, 0, hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_MYPHONE_CAT, SET_CONTACT_COMPANY_MYPHONE_VAL);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_PHONE, TranslateT(SET_CONTACT_PHONE), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_PHONE);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_FAX, TranslateT(SET_CONTACT_FAX), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_FAX);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_CELLULAR, TranslateT(SET_CONTACT_CELLULAR), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_CELLULAR);
+ bChanged |= CtrlContactAddMyItemsFromDB(hCtrl, IDI_BTN_CUSTOMPHONE, 0, hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_MYPHONE_CAT, SET_CONTACT_COMPANY_MYPHONE_VAL);
SendMessage(hCtrl, CBEXM_SETCURSEL, (WPARAM)-1, TRUE);
// emails
hCtrl = GetDlgItem(hDlg, EDIT_EMAIL);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_EMAIL, TranslateT("Primary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_EMAIL);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_EMAIL, TranslateT("Secondary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_EMAIL0);
- bChanged |= CtrlContactAddItemFromDB(hCtrl, ICO_BTN_EMAIL, TranslateT("Tertiary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_EMAIL1);
- bChanged |= CtrlContactAddMyItemsFromDB(hCtrl, ICO_BTN_EMAIL, 0, hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_MYEMAIL_CAT, SET_CONTACT_COMPANY_MYEMAIL_VAL);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_EMAIL, TranslateT("Primary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_EMAIL);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_EMAIL, TranslateT("Secondary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_EMAIL0);
+ bChanged |= CtrlContactAddItemFromDB(hCtrl, IDI_BTN_EMAIL, TranslateT("Tertiary e-mail"), hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_EMAIL1);
+ bChanged |= CtrlContactAddMyItemsFromDB(hCtrl, IDI_BTN_EMAIL, 0, hContact, USERINFO, pszProto, SET_CONTACT_COMPANY_MYEMAIL_CAT, SET_CONTACT_COMPANY_MYEMAIL_VAL);
SendMessage(hCtrl, CBEXM_SETCURSEL, (WPARAM)-1, TRUE);
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, bChanged ? PSP_CHANGED : 0);
}
@@ -268,11 +268,11 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM case PSN_ICONCHANGED:
{
- HICON hIcon = IcoLib_GetIcon(ICO_BTN_GOTO);
+ HICON hIcon = g_plugin.getIcon(IDI_BTN_GOTO);
SendDlgItemMessage(hDlg, BTN_GOTO, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
SetDlgItemText(hDlg, BTN_GOTO, hIcon ? L"" : L"->");
- hIcon = IcoLib_GetIcon(ICO_COMMON_ADDRESS);
+ hIcon = g_plugin.getIcon(IDI_TREE_ADDRESS);
SendDlgItemMessage(hDlg, ICO_ADDRESS, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
ShowWindow(GetDlgItem(hDlg, ICO_ADDRESS), hIcon ? SW_SHOW : SW_HIDE);
diff --git a/plugins/UserInfoEx/src/psp_general.cpp b/plugins/UserInfoEx/src/psp_general.cpp index 3dc0e6de02..fbfc25c044 100644 --- a/plugins/UserInfoEx/src/psp_general.cpp +++ b/plugins/UserInfoEx/src/psp_general.cpp @@ -127,9 +127,9 @@ INT_PTR CALLBACK PSPProcGeneral(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case PSN_ICONCHANGED:
{
const ICONCTRL idIcon[] = {
- { ICO_COMMON_FEMALE, STM_SETIMAGE, ICO_FEMALE },
- { ICO_COMMON_MALE, STM_SETIMAGE, ICO_MALE },
- { ICO_COMMON_MARITAL, STM_SETIMAGE, ICO_MARITAL },
+ { IDI_FEMALE, STM_SETIMAGE, ICO_FEMALE },
+ { IDI_MALE, STM_SETIMAGE, ICO_MALE },
+ { IDI_MARITAL, STM_SETIMAGE, ICO_MARITAL },
};
IcoLib_SetCtrlIcons(hDlg, idIcon, _countof(idIcon));
}
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 9d8d704089..06bf4e6e1b 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -590,7 +590,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam TranslateDialogDefault(hDlg);
ShowWindow(GetDlgItem(hDlg, CHECK_REMIND_SECURED), SW_SHOW);
- SendDlgItemMessage(hDlg, ICO_BIRTHDAY, STM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_DLG_ANNIVERSARY, TRUE));
+ SendDlgItemMessage(hDlg, ICO_BIRTHDAY, STM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_ANNIVERSARY, true));
// set colours
SendDlgItemMessage(hDlg, EDIT_REMIND, EM_LIMITTEXT, 2, 0);
@@ -888,7 +888,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR // Birthday
mir_wstrncpy(ppd.lpwzContactName, TranslateT("Birthday"), _countof(ppd.lpwzContactName));
- ppd.lchIcon = IcoLib_GetIcon(ICO_RMD_DTB0);
+ ppd.lchIcon = g_plugin.getIcon(IDI_RMD_DTB0);
if (IsDlgButtonChecked(hDlg, CHECK_OPT_POPUP_WINCLR)) {
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
@@ -901,7 +901,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR // Anniversary
mir_wstrncpy(ppd.lpwzContactName, TranslateT("Anniversary"), _countof(ppd.lpwzContactName));
- ppd.lchIcon = IcoLib_GetIcon(ICO_RMD_DTAX);
+ ppd.lchIcon = g_plugin.getIcon(IDI_RMD_DTAX);
if (IsDlgButtonChecked(hDlg, CHECK_OPT_POPUP_WINCLR)) {
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
diff --git a/plugins/UserInfoEx/src/psp_origin.cpp b/plugins/UserInfoEx/src/psp_origin.cpp index 5c804278d4..2d8d48faa5 100644 --- a/plugins/UserInfoEx/src/psp_origin.cpp +++ b/plugins/UserInfoEx/src/psp_origin.cpp @@ -106,8 +106,8 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara case PSN_ICONCHANGED:
{
const ICONCTRL idIcon[] = {
- { ICO_COMMON_ADDRESS, STM_SETIMAGE, ICO_ADDRESS },
- { ICO_COMMON_CLOCK, STM_SETIMAGE, ICO_CLOCK },
+ { IDI_TREE_ADDRESS, STM_SETIMAGE, ICO_ADDRESS },
+ { IDI_CLOCK, STM_SETIMAGE, ICO_CLOCK },
};
IcoLib_SetCtrlIcons(hDlg, idIcon, _countof(idIcon));
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index 7652aba64f..2195bf7064 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -127,7 +127,7 @@ static INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam) static int OnCListApplyIcons(WPARAM wParam, LPARAM)
{
LPSTR val = Get(wParam);
- ExtraIcon_SetIconByName(ghExtraIconSvc, wParam, (val) ? ICO_BTN_EMAIL : nullptr);
+ ExtraIcon_SetIcon(ghExtraIconSvc, wParam, (val) ? g_plugin.getIconHandle(IDI_DLG_EMAIL) : nullptr);
mir_free(val);
return 0;
}
@@ -186,7 +186,7 @@ void SvcEMailRebuildMenu() CMenuItem mi(&g_plugin);
SET_UID(mi, 0x61d8e25a, 0x92e, 0x4470, 0x84, 0x57, 0x5e, 0x52, 0x17, 0x7f, 0xfa, 0x3);
mi.position = -2000010000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EMAIL);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_DLG_EMAIL);
mi.name.a = "&E-mail";
mi.pszService = MS_EMAIL_SENDEMAIL;
ghMenuItem = Menu_AddContactMenuItem(&mi);
@@ -229,7 +229,7 @@ bool SvcEMailEnableExtraIcons(bool bEnable, bool bUpdateDB) hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
if (ghExtraIconSvc == INVALID_HANDLE_VALUE)
- ghExtraIconSvc = ExtraIcon_RegisterIcolib("email", LPGEN("E-mail (UInfoEx)"), ICO_BTN_EMAIL);
+ ghExtraIconSvc = ExtraIcon_RegisterIcolib("email", LPGEN("E-mail (UInfoEx)"), g_plugin.getIconHandle(IDI_BTN_EMAIL));
}
else { // E-mail uncheckt
if (hChangedHook) {
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp index bd57c715c5..39a6c19af1 100644 --- a/plugins/UserInfoEx/src/svc_gender.cpp +++ b/plugins/UserInfoEx/src/svc_gender.cpp @@ -72,13 +72,13 @@ BYTE GenderOf(MCONTACT hContact) static int OnCListApplyIcons(MCONTACT hContact, LPARAM)
{
if (ghExtraIconSvc != INVALID_HANDLE_VALUE) {
- char *icoName;
+ HANDLE hIcon;
switch (GenderOf(hContact)) {
- case 'M': icoName = ICO_COMMON_MALE; break;
- case 'F': icoName = ICO_COMMON_FEMALE; break;
- default: icoName = nullptr;
+ case 'M': hIcon = g_plugin.getIconHandle(IDI_MALE); break;
+ case 'F': hIcon = g_plugin.getIconHandle(IDI_FEMALE); break;
+ default: hIcon = nullptr;
}
- ExtraIcon_SetIconByName(ghExtraIconSvc, hContact, icoName);
+ ExtraIcon_SetIcon(ghExtraIconSvc, hContact, hIcon);
}
return 0;
}
@@ -117,7 +117,7 @@ bool SvcGenderEnableExtraIcons(bool bEnable, bool bUpdateDB) if (g_eiGender) { // Gender checked or dropdown select
if (ghExtraIconSvc == INVALID_HANDLE_VALUE)
- ghExtraIconSvc = ExtraIcon_RegisterIcolib("gender", LPGEN("Gender (UInfoEx)"), ICO_COMMON_MALE);
+ ghExtraIconSvc = ExtraIcon_RegisterIcolib("gender", LPGEN("Gender (UInfoEx)"), g_plugin.getIconHandle(IDI_MALE));
// hook events
if (hChangedHook == nullptr)
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp index 8361873cb6..21822d1dd2 100644 --- a/plugins/UserInfoEx/src/svc_homepage.cpp +++ b/plugins/UserInfoEx/src/svc_homepage.cpp @@ -93,7 +93,7 @@ static int OnCListApplyIcons(MCONTACT hContact, LPARAM) {
LPSTR val = Get(hContact);
if (ghExtraIconSvc != INVALID_HANDLE_VALUE)
- ExtraIcon_SetIconByName(ghExtraIconSvc, hContact, (val) ? ICO_BTN_GOTO : nullptr);
+ ExtraIcon_SetIcon(ghExtraIconSvc, hContact, (val) ? g_plugin.getIconHandle(IDI_BTN_GOTO) : nullptr);
MIR_FREE(val);
return 0;
}
@@ -156,7 +156,7 @@ void SvcHomepageRebuildMenu() CMenuItem mi(&g_plugin);
SET_UID(mi, 0xdb78c16e, 0x50db, 0x4a40, 0x80, 0x0, 0xd1, 0xa4, 0x1c, 0x1b, 0xa3, 0x2d);
mi.position = -2000010000;
- mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_GOTO);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BTN_GOTO);
mi.name.a = LPGEN("&Homepage");
mi.pszService = MS_USERINFO_HOMEPAGE_OPENURL;
ghMenuItem = Menu_AddContactMenuItem(&mi);
@@ -189,7 +189,7 @@ bool SvcHomepageEnableExtraIcons(bool bEnable, bool bUpdateDB) hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
if (ghExtraIconSvc == INVALID_HANDLE_VALUE)
- ghExtraIconSvc = ExtraIcon_RegisterIcolib("homepage", LPGEN("Homepage (UInfoEx)"), ICO_BTN_GOTO);
+ ghExtraIconSvc = ExtraIcon_RegisterIcolib("homepage", LPGEN("Homepage (UInfoEx)"), g_plugin.getIconHandle(IDI_BTN_GOTO));
}
else {
if (hChangedHook) {
diff --git a/plugins/UserInfoEx/src/svc_phone.cpp b/plugins/UserInfoEx/src/svc_phone.cpp index 49215d1471..97d436a458 100644 --- a/plugins/UserInfoEx/src/svc_phone.cpp +++ b/plugins/UserInfoEx/src/svc_phone.cpp @@ -88,13 +88,13 @@ static INT_PTR Get(MCONTACT hContact) static int OnCListApplyIcons(MCONTACT hContact, LPARAM)
{
- char *icoName;
+ HANDLE hIcon;
switch (Get(hContact)) {
- case PHONE_NORMAL: icoName = ICO_BTN_PHONE; break;
- case PHONE_SMS: icoName = ICO_BTN_CELLULAR; break;
- default: icoName = nullptr;
+ case PHONE_NORMAL: hIcon = g_plugin.getIconHandle(IDI_BTN_PHONE); break;
+ case PHONE_SMS: hIcon = g_plugin.getIconHandle(IDI_BTN_CELLULAR); break;
+ default: hIcon = nullptr;
}
- ExtraIcon_SetIconByName(ghExtraIconSvc, hContact, icoName);
+ ExtraIcon_SetIcon(ghExtraIconSvc, hContact, hIcon);
return 0;
}
@@ -146,7 +146,7 @@ bool SvcPhoneEnableExtraIcons(bool bEnable, bool bUpdateDB) hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
if (ghExtraIconSvc == INVALID_HANDLE_VALUE)
- ghExtraIconSvc = ExtraIcon_RegisterIcolib("sms", LPGEN("Phone (UInfoEx)"), ICO_BTN_CELLULAR);
+ ghExtraIconSvc = ExtraIcon_RegisterIcolib("sms", LPGEN("Phone (UInfoEx)"), g_plugin.getIconHandle(IDI_BTN_CELLULAR));
}
else {
if (hChangedHook) {
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index 0d7bc2b4de..9b28bfe730 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -221,9 +221,9 @@ class CDlgUpdProgress : public CUpdProgress case WM_INITDIALOG:
{
const ICONCTRL idIcon[] = {
- { ICO_BTN_UPDATE, WM_SETICON, NULL },
- { ICO_BTN_DOWNARROW, BM_SETIMAGE, IDSKIP },
- { ICO_BTN_CANCEL, BM_SETIMAGE, IDCANCEL }
+ { IDI_BTN_UPDATE, WM_SETICON, NULL },
+ { IDI_BTN_DOWNARROW, BM_SETIMAGE, IDSKIP },
+ { IDI_BTN_CLOSE, BM_SETIMAGE, IDCANCEL }
};
IcoLib_SetCtrlIcons(hWnd, idIcon, g_plugin.getByte(SET_ICONS_BUTTONS, 1) ? 2 : 1);
@@ -373,7 +373,7 @@ public: _popupButtons[0].cbSize = sizeof(POPUPACTION);
_popupButtons[0].flags = PAF_ENABLED;
- _popupButtons[0].lchIcon = IcoLib_GetIcon(ICO_BTN_DOWNARROW);
+ _popupButtons[0].lchIcon = g_plugin.getIcon(IDI_BTN_DOWNARROW);
_popupButtons[0].wParam = MAKEWORD(IDSKIP, BN_CLICKED);
_popupButtons[0].lParam = NULL;
mir_strcpy(_popupButtons[0].lpzTitle, MODULENAME"/Hide");
@@ -381,7 +381,7 @@ public: // cancel button
_popupButtons[1].cbSize = sizeof(POPUPACTION);
_popupButtons[1].flags = PAF_ENABLED;
- _popupButtons[1].lchIcon = IcoLib_GetIcon(ICO_BTN_CANCEL);
+ _popupButtons[1].lchIcon = g_plugin.getIcon(IDI_BTN_CLOSE);
_popupButtons[1].wParam = MAKEWORD(IDCANCEL, BN_CLICKED);
_popupButtons[1].lParam = NULL;
mir_strcpy(_popupButtons[1].lpzTitle, MODULENAME"/Cancel");
@@ -394,7 +394,7 @@ public: virtual HWND Create(LPCTSTR szTitle, PUpdCallback pFnCallBack)
{
POPUPDATAW ppd;
- ppd.lchIcon = IcoLib_GetIcon(ICO_BTN_UPDATE);
+ ppd.lchIcon = g_plugin.getIcon(IDI_BTN_UPDATE);
ppd.iSeconds = -1;
ppd.PluginData = this;
ppd.PluginWindowProc = CPopupUpdProgress::WndProc;
@@ -565,7 +565,7 @@ class CContactUpdater : public CContactQueue // reset menu
if (hMenuItemRefresh)
- Menu_ModifyItem(hMenuItemRefresh, LPGENW("Refresh contact details"), IcoLib_GetIconHandle(ICO_BTN_UPDATE));
+ Menu_ModifyItem(hMenuItemRefresh, LPGENW("Refresh contact details"), g_plugin.getIconHandle(IDI_BTN_UPDATE));
}
/**
@@ -645,7 +645,7 @@ public: // if there are contacts in the queue, change the main menu item to indicate it is meant for canceling.
if (hMenuItemRefresh && Size() > 0)
- Menu_ModifyItem(hMenuItemRefresh, LPGENW("Abort Refreshing Contact Details"), IcoLib_GetIconHandle(ICO_BTN_CANCEL));
+ Menu_ModifyItem(hMenuItemRefresh, LPGENW("Abort Refreshing Contact Details"), g_plugin.getIconHandle(IDI_BTN_CLOSE));
}
void Cancel()
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 6f6b207e52..93ec9fbad0 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -141,25 +141,19 @@ static HICON GetAnnivIcon(const CEvent &evt) {
HICON hIcon = nullptr;
- CHAR szIcon[MAXSETTING];
-
switch (evt._eType) {
case CEvent::BIRTHDAY:
if (evt._wDaysLeft > 9)
- hIcon = IcoLib_GetIcon(ICO_RMD_DTBX);
- else {
- mir_snprintf(szIcon, MODULENAME"_rmd_dtb%u", evt._wDaysLeft);
- hIcon = IcoLib_GetIcon(szIcon);
- }
+ hIcon = g_plugin.getIcon(IDI_RMD_DTBX);
+ else
+ hIcon = g_plugin.getIcon(IDI_RMD_DTB0 + evt._wDaysLeft);
break;
case CEvent::ANNIVERSARY:
if (evt._wDaysLeft > 9)
- hIcon = IcoLib_GetIcon(ICO_RMD_DTAX);
- else {
- mir_snprintf(szIcon, MODULENAME"_rmd_dta%u", evt._wDaysLeft);
- hIcon = IcoLib_GetIcon(szIcon);
- }
+ hIcon = g_plugin.getIcon(IDI_RMD_DTAX);
+ else
+ hIcon = g_plugin.getIcon(IDI_RMD_DTA0 + evt._wDaysLeft);
}
return hIcon;
}
@@ -176,31 +170,27 @@ static HICON GetAnnivIcon(const CEvent &evt) static void NotifyWithExtraIcon(MCONTACT hContact, const CEvent &evt)
{
if (gRemindOpts.bCListExtraIcon) {
- char szIcon[MAXSETTING], *icoName;
-
+ int iIcon;
+
switch (evt._eType) {
case CEvent::BIRTHDAY:
if (evt._wDaysLeft > 9)
- icoName = ICO_RMD_DTAX;
- else {
- mir_snprintf(szIcon, MODULENAME"_rmd_dtb%u", evt._wDaysLeft);
- icoName = szIcon;
- }
+ iIcon = IDI_RMD_DTBX;
+ else
+ iIcon = IDI_RMD_DTB0 + evt._wDaysLeft;
break;
case CEvent::ANNIVERSARY:
if (evt._wDaysLeft > 9)
- icoName = ICO_RMD_DTAX;
- else {
- mir_snprintf(szIcon, MODULENAME"_rmd_dta%u", evt._wDaysLeft);
- icoName = szIcon;
- }
+ iIcon = IDI_RMD_DTAX;
+ else
+ iIcon = IDI_RMD_DTA0 + evt._wDaysLeft;
break;
default:
return;
}
- ExtraIcon_SetIconByName(ExtraIcon, hContact, icoName);
+ ExtraIcon_SetIcon(ExtraIcon, hContact, g_plugin.getIconHandle(iIcon));
}
}
@@ -318,12 +308,12 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) switch (evt._eType) {
case CEvent::BIRTHDAY:
mir_snwprintf(szMsg, TranslateT("%s has %s today."), Clist_GetContactDisplayName(hContact), TranslateT("Birthday"));
- cle.hIcon = IcoLib_GetIcon(ICO_COMMON_BIRTHDAY);
+ cle.hIcon = g_plugin.getIcon(IDI_BIRTHDAY);
break;
case CEvent::ANNIVERSARY:
mir_snwprintf(szMsg, TranslateT("%s has %s today."), Clist_GetContactDisplayName(hContact), TranslateT("an anniversary"));
- cle.hIcon = IcoLib_GetIcon(ICO_COMMON_ANNIVERSARY);
+ cle.hIcon = g_plugin.getIcon(IDI_ANNIVERSARY);
break;
default:
@@ -714,7 +704,7 @@ static INT_PTR BackupBirthdayService(WPARAM hContact, LPARAM lParam) MSGBOX mBox;
mBox.cbSize = sizeof(MSGBOX);
mBox.hParent = nullptr;
- mBox.hiLogo = IcoLib_GetIcon(ICO_COMMON_BIRTHDAY);
+ mBox.hiLogo = g_plugin.getIcon(IDI_BIRTHDAY);
mBox.uType = MB_ICON_INFO;
mBox.ptszTitle = TranslateT("Update custom birthday");
mBox.ptszMsg = TranslateT("Backing up and syncing all birthdays complete!");
@@ -884,7 +874,7 @@ void SvcReminderLoadModule(void) g_plugin.addHotkey(&hk);
if (g_plugin.getByte(SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF && ExtraIcon == INVALID_HANDLE_VALUE)
- ExtraIcon = ExtraIcon_RegisterIcolib("Reminder", LPGEN("Reminder (UInfoEx)"), ICO_COMMON_ANNIVERSARY);
+ ExtraIcon = ExtraIcon_RegisterIcolib("Reminder", LPGEN("Reminder (UInfoEx)"), g_plugin.getIconHandle(IDI_ANNIVERSARY));
}
/**
|