diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/SecureIM/src/crypt_icons.cpp | 4 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/classMAnnivDate.cpp | 50 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/dlg_msgbox.cpp | 4 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/dlg_propsheet.cpp | 2 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/mir_icolib.cpp | 243 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/mir_icolib.h | 181 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/mir_menuitems.cpp | 74 |
7 files changed, 265 insertions, 293 deletions
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp index 9131583586..720120059e 100644 --- a/plugins/SecureIM/src/crypt_icons.cpp +++ b/plugins/SecureIM/src/crypt_icons.cpp @@ -2,6 +2,10 @@ struct ICON_CACHE
{
+ ICON_CACHE::~ICON_CACHE() {
+ ::DestroyIcon(icon);
+ }
+
HICON icon;
HANDLE hCLIcon;
SHORT mode;
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 2ba0fc335a..f703013550 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -207,36 +207,38 @@ int MAnnivDate::Age(MTime *pNow) * param: none
* return: structure, holding zodiac information
**/
+
+struct {
+ const WORD startDays;
+ const WORD endDays;
+ LPCTSTR szZodiac;
+ LPCSTR szZodiacIcon;
+}
+static zodiac[] = {
+ { 80, 110, LPGENT("Aries"), ICO_ZOD_ARIES }, // Widder
+ { 111, 140, LPGENT("Taurus"), ICO_ZOD_TAURUS }, // Stier
+ { 141, 172, LPGENT("Gemini"), ICO_ZOD_GEMINI }, // Zwillinge
+ { 173, 203, LPGENT("Cancer"), ICO_ZOD_CANCER }, // Krebs
+ { 204, 235, LPGENT("Leo"), ICO_ZOD_LEO }, // Löwe
+ { 236, 266, LPGENT("Virgo"), ICO_ZOD_VIRGO }, // Jungfrau
+ { 267, 296, LPGENT("Libra"), ICO_ZOD_LIBRA }, // Waage
+ { 297, 326, LPGENT("Scorpio"), ICO_ZOD_SCORPIO }, // Scorpion
+ { 327, 355, LPGENT("Sagittarius"), ICO_ZOD_SAGITTARIUS }, // Schütze
+ { 356, 364, LPGENT("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
+ { 1, 19, LPGENT("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
+ { 20, 49, LPGENT("Aquarius"), ICO_ZOD_AQUARIUS }, // Wassermann
+ { 50, 79, LPGENT("Pisces"), ICO_ZOD_PISCES }, // Fische
+ { 0, 0, NULL, "" } // end of array
+};
+
MZodiac MAnnivDate::Zodiac()
{
- static const struct TZodiac {
- const WORD startDays;
- const WORD endDays;
- LPCTSTR szZodiac;
- LPCSTR szZodiacIcon;
- } zodiac[] = {
- { 80, 110, LPGENT("Aries") , ICO_ZOD_ARIES }, // Widder
- { 111, 140, LPGENT("Taurus") , ICO_ZOD_TAURUS }, // Stier
- { 141, 172, LPGENT("Gemini") , ICO_ZOD_GEMINI }, // Zwillinge
- { 173, 203, LPGENT("Cancer") , ICO_ZOD_CANCER }, // Krebs
- { 204, 235, LPGENT("Leo") , ICO_ZOD_LEO }, // Löwe
- { 236, 266, LPGENT("Virgo") , ICO_ZOD_VIRGO }, // Jungfrau
- { 267, 296, LPGENT("Libra") , ICO_ZOD_LIBRA }, // Waage
- { 297, 326, LPGENT("Scorpio") , ICO_ZOD_SCORPIO }, // Scorpion
- { 327, 355, LPGENT("Sagittarius") , ICO_ZOD_SAGITTARIUS }, // Schütze
- { 356, 364, LPGENT("Capricorn") , ICO_ZOD_CAPRICORN }, // Steinbock
- { 1, 19, LPGENT("Capricorn") , ICO_ZOD_CAPRICORN }, // Steinbock
- { 20, 49, LPGENT("Aquarius") , ICO_ZOD_AQUARIUS }, // Wassermann
- { 50, 79, LPGENT("Pisces") , ICO_ZOD_PISCES }, // Fische
- //{ 0, 0, LPGENT("Unknown") , ICO_ZOD_UNKNOWN }, // not found
- { 0, 0, NULL , "" } // end of array
- };
const WORD wDays = DayOfYear();
- BYTE i;
- MZodiac mZodiac;
+ int i;
for (i = 0; i < 13 && (wDays < zodiac[i].startDays || wDays > zodiac[i].endDays); i++);
+ MZodiac mZodiac;
mZodiac.hIcon = IcoLib_GetIcon(zodiac[i].szZodiacIcon);
mZodiac.pszName = zodiac[i].szZodiac;
return mZodiac;
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index bb81ba8eff..46e05375d4 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -748,7 +748,7 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPTSTR pszTitle, LPTSTR pszInf MSGBOX mb = {0};
mb.cbSize = sizeof(MSGBOX);
mb.hParent = hParent;
- mb.hiLogo = LoadIcon(ghInst, MAKEINTRESOURCE(IDI_MAIN));
+ mb.hiLogo = IcoLib_GetIcon(ICO_COMMON_MAIN);
mb.hiMsg = NULL;
mb.ptszTitle = TranslateTS(pszTitle);
mb.ptszInfoText = TranslateTS(pszInfo);
@@ -775,7 +775,7 @@ INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...) MSGBOX mb = {0};
mb.cbSize = sizeof(MSGBOX);
mb.hParent = hParent;
- mb.hiLogo = LoadIcon(ghInst, MAKEINTRESOURCE(IDI_MAIN));
+ mb.hiLogo = IcoLib_GetIcon(ICO_COMMON_MAIN);
mb.hiMsg = NULL;
mb.ptszTitle = tszTitle;
mb.ptszMsg = tszMsg;
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 9a4ff2112d..2775719a87 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -766,7 +766,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar //
// set icons
//
- SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(ghInst, MAKEINTRESOURCE(IDI_MAIN)));
+ SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(ICO_COMMON_MAIN));
DlgProc(hDlg, HM_RELOADICONS, NULL, NULL);
//
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index 5ad36cfeba..e483aec7b2 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -35,93 +35,88 @@ HICON ghDefIcon = NULL; static ICODESC icoDesc[] =
{
// common
- { ICO_COMMON_IM, LPGEN("IM Naming"), SECT_COMMON, IDI_MIRANDA, 0 },
- { ICO_COMMON_PASSWORD, LPGEN("Password"), SECT_COMMON, IDI_PASSWORD, 0 },
- { ICO_COMMON_FEMALE, LPGEN("Female"), SECT_COMMON, IDI_FEMALE, 0 },
- { ICO_COMMON_MALE, LPGEN("Male"), SECT_COMMON, IDI_MALE, 0 },
- { ICO_COMMON_BIRTHDAY, LPGEN("Birthday"), SECT_COMMON, IDI_BIRTHDAY, 0 },
- { ICO_COMMON_CLOCK, LPGEN("Timezone"), SECT_COMMON, IDI_CLOCK, 1 },
- { ICO_COMMON_MARITAL, LPGEN("Marital status"), SECT_COMMON, IDI_MARITAL, 0 },
- { ICO_COMMON_ADDRESS, LPGEN("Address"), SECT_COMMON, IDI_TREE_ADDRESS, 0 },
- { ICO_COMMON_ANNIVERSARY,LPGEN("Anniversary"), SECT_COMMON, IDI_ANNIVERSARY, 0 },
-
- //zodiac
- { ICO_ZOD_AQUARIUS, LPGEN("Aquarius"), SECT_COMMON, IDI_ZOD_AQUARIUS, 128 },
- { ICO_ZOD_ARIES, LPGEN("Aries"), SECT_COMMON, IDI_ZOD_ARIES, 128 },
- { ICO_ZOD_CANCER, LPGEN("Cancer"), SECT_COMMON, IDI_ZOD_CANCER, 128 },
- { ICO_ZOD_CAPRICORN, LPGEN("Capricorn"), SECT_COMMON, IDI_ZOD_CAPRICORN, 128 },
- { ICO_ZOD_GEMINI, LPGEN("Gemini"), SECT_COMMON, IDI_ZOD_GEMINI, 128 },
- { ICO_ZOD_LEO, LPGEN("Leo"), SECT_COMMON, IDI_ZOD_LEO, 128 },
- { ICO_ZOD_LIBRA, LPGEN("Libra"), SECT_COMMON, IDI_ZOD_LIBRA, 128 },
- { ICO_ZOD_PISCES, LPGEN("Pisces"), SECT_COMMON, IDI_ZOD_PISCES, 128 },
- { ICO_ZOD_SAGITTARIUS, LPGEN("Sagittarius"), SECT_COMMON, IDI_ZOD_SAGITTARIUS, 128 },
- { ICO_ZOD_SCORPIO, LPGEN("Scorpio"), SECT_COMMON, IDI_ZOD_SCORPIO, 128 },
- { ICO_ZOD_TAURUS, LPGEN("Taurus"), SECT_COMMON, IDI_ZOD_TAURUS, 128 },
- { ICO_ZOD_VIRGO, LPGEN("Virgo"), SECT_COMMON, IDI_ZOD_VIRGO, 128 },
- // later with new icon pack version
- //{ ICO_ZOD_UNKNOWN, LPGEN("Unknown"), SECT_COMMON, IDI_ZOD_UNKNOWN, 128 },
-
- // lists
- { ICO_LST_MODULES, LPGEN("Export: Modules"), SECT_COMMON, IDI_LST_MODULES, 0 },
- { ICO_LST_FOLDER, LPGEN("Export: Folder"), SECT_COMMON, IDI_LST_FOLDER, 0 },
- { ICO_TREE_DEFAULT, LPGEN("Default"), SECT_TREE, IDI_LST_FOLDER, 0 },
-
- // dialogs
- { ICO_DLG_DETAILS, LPGEN("Details Infobar"), SECT_DLG, IDI_DLG_DETAILS, 48 },
- { ICO_DLG_PHONE, LPGEN("Phone Infobar"), SECT_DLG, IDI_DLG_PHONE, 1 },
- { ICO_DLG_EMAIL, LPGEN("E-Mail Infobar"), SECT_DLG, IDI_DLG_EMAIL, 1 },
- { ICO_DLG_EXPORT, LPGEN("Export VCard"), SECT_DLG, IDI_EXPORT, 1 },
- { ICO_DLG_IMPORT, LPGEN("Import VCard"), SECT_DLG, IDI_IMPORT, 1 },
- { ICO_DLG_ANNIVERSARY, LPGEN("Anniversary Infobar"), SECT_DLG, IDI_ANNIVERSARY, 1 },
-
- // button icons
- { ICO_BTN_UPDATE, LPGEN("Update"), SECT_BUTTONS, IDI_BTN_UPDATE, 0 },
- { ICO_BTN_IMPORT, LPGEN("Import"), SECT_BUTTONS, IDI_IMPORT, 0 },
- { ICO_BTN_EXPORT, LPGEN("Export"), SECT_BUTTONS, IDI_EXPORT, 0 },
- { ICO_BTN_OK, LPGEN("OK"), SECT_BUTTONS, IDI_BTN_OK, 0 },
- { ICO_BTN_CANCEL, LPGEN("Cancel"), SECT_BUTTONS, IDI_BTN_CLOSE, 0 },
- { ICO_BTN_APPLY, LPGEN("Apply"), SECT_BUTTONS, IDI_BTN_APPLY, 0 },
- { ICO_BTN_GOTO, LPGEN("Goto"), SECT_BUTTONS, IDI_BTN_GOTO, 0 },
- { ICO_BTN_PHONE, LPGEN("Phone"), SECT_BUTTONS, IDI_BTN_PHONE, 0 },
- { ICO_BTN_FAX, LPGEN("Fax"), SECT_BUTTONS, IDI_BTN_FAX, 0 },
- { ICO_BTN_CELLULAR, LPGEN("Cellular"), SECT_BUTTONS, IDI_BTN_CELLULAR, 0 },
- { ICO_BTN_CUSTOMPHONE, LPGEN("Custom Phone"), SECT_BUTTONS, IDI_BTN_CUSTOMPHONE, 0 },
- { ICO_BTN_EMAIL, LPGEN("e-mail"), SECT_BUTTONS, IDI_BTN_EMAIL, 0 },
- { ICO_BTN_DOWNARROW, LPGEN("Down arrow"), SECT_BUTTONS, IDI_BTN_DOWNARROW, 0 },
- { ICO_BTN_ADD, LPGEN("Add"), SECT_BUTTONS, IDI_BTN_ADD, 0 },
- { ICO_BTN_EDIT, LPGEN("Edit"), SECT_BUTTONS, IDI_BTN_EDIT, 0 },
- { ICO_BTN_DELETE, LPGEN("Delete"), SECT_BUTTONS, IDI_BTN_DELETE, 0 },
- { ICO_BTN_SEARCH, LPGEN("Search"), SECT_BUTTONS, IDI_SEARCH, 0 },
- { ICO_BTN_EXIMPORT, LPGEN("Ex-/Import"), SECT_BUTTONS, IDI_BTN_EXIMPORT, 0 },
- { ICO_BTN_BDAY_BACKUP, LPGEN("Backup Birthday"), SECT_BUTTONS, IDI_BTN_BIRTHDAY_BACKUP,0 },
- //{ ICO_BTN_YES, LPGEN("Yes"), SECT_BUTTONS, IDI_BTN_YES, 0 },
- //{ ICO_BTN_NO, LPGEN("No"), SECT_BUTTONS, IDI_BTN_NO, 0 },
- //{ ICO_BTN_IGNORE, LPGEN("Ignore"), SECT_BUTTONS, IDI_BTN_IGNORE, 0 },
-
- //birthday and anniversary
- { ICO_RMD_DTB0, LPGEN("Birthday today"), SECT_REMIND, IDI_RMD_DTB0, 0 },
- { ICO_RMD_DTB1, LPGEN("Birthday tomorrow"), SECT_REMIND, IDI_RMD_DTB1, 0 },
- { ICO_RMD_DTB2, LPGEN("Birthday in 2 days"), SECT_REMIND, IDI_RMD_DTB2, 0 },
- { ICO_RMD_DTB3, LPGEN("Birthday in 3 days"), SECT_REMIND, IDI_RMD_DTB3, 0 },
- { ICO_RMD_DTB4, LPGEN("Birthday in 4 days"), SECT_REMIND, IDI_RMD_DTB4, 0 },
- { ICO_RMD_DTB5, LPGEN("Birthday in 5 days"), SECT_REMIND, IDI_RMD_DTB5, 0 },
- { ICO_RMD_DTB6, LPGEN("Birthday in 6 days"), SECT_REMIND, IDI_RMD_DTB6, 0 },
- { ICO_RMD_DTB7, LPGEN("Birthday in 7 days"), SECT_REMIND, IDI_RMD_DTB7, 0 },
- { ICO_RMD_DTB8, LPGEN("Birthday in 8 days"), SECT_REMIND, IDI_RMD_DTB8, 0 },
- { ICO_RMD_DTB9, LPGEN("Birthday in 9 days"), SECT_REMIND, IDI_RMD_DTB9, 0 },
- { ICO_RMD_DTBX, LPGEN("Birthday later"), SECT_REMIND, IDI_RMD_DTBX, 0 },
-
- { ICO_RMD_DTA0, LPGEN("Anniversary today"), SECT_REMIND, IDI_RMD_DTA0, 0 },
- { ICO_RMD_DTA1, LPGEN("Anniversary tomorrow"), SECT_REMIND, IDI_RMD_DTA1, 0 },
- { ICO_RMD_DTA2, LPGEN("Anniversary in 2 days"), SECT_REMIND, IDI_RMD_DTA2, 0 },
- { ICO_RMD_DTA3, LPGEN("Anniversary in 3 days"), SECT_REMIND, IDI_RMD_DTA3, 0 },
- { ICO_RMD_DTA4, LPGEN("Anniversary in 4 days"), SECT_REMIND, IDI_RMD_DTA4, 0 },
- { ICO_RMD_DTA5, LPGEN("Anniversary in 5 days"), SECT_REMIND, IDI_RMD_DTA5, 0 },
- { ICO_RMD_DTA6, LPGEN("Anniversary in 6 days"), SECT_REMIND, IDI_RMD_DTA6, 0 },
- { ICO_RMD_DTA7, LPGEN("Anniversary in 7 days"), SECT_REMIND, IDI_RMD_DTA7, 0 },
- { ICO_RMD_DTA8, LPGEN("Anniversary in 8 days"), SECT_REMIND, IDI_RMD_DTA8, 0 },
- { ICO_RMD_DTA9, LPGEN("Anniversary in 9 days"), SECT_REMIND, IDI_RMD_DTA9, 0 },
- { ICO_RMD_DTAX, LPGEN("Anniversary later"), SECT_REMIND, IDI_RMD_DTAX, 0 },
+ { ICO_COMMON_IM, LPGEN("IM Naming"), SECT_COMMON, IDI_MIRANDA, 0 },
+ { ICO_COMMON_PASSWORD, LPGEN("Password"), SECT_COMMON, IDI_PASSWORD, 0 },
+ { ICO_COMMON_FEMALE, LPGEN("Female"), SECT_COMMON, IDI_FEMALE, 0 },
+ { ICO_COMMON_MALE, LPGEN("Male"), SECT_COMMON, IDI_MALE, 0 },
+ { ICO_COMMON_BIRTHDAY, LPGEN("Birthday"), SECT_COMMON, IDI_BIRTHDAY, 0 },
+ { ICO_COMMON_CLOCK, LPGEN("Timezone"), SECT_COMMON, IDI_CLOCK, 1 },
+ { ICO_COMMON_MARITAL, LPGEN("Marital status"), SECT_COMMON, IDI_MARITAL, 0 },
+ { ICO_COMMON_ADDRESS, LPGEN("Address"), SECT_COMMON, IDI_TREE_ADDRESS, 0 },
+ { ICO_COMMON_ANNIVERSARY,LPGEN("Anniversary"), SECT_COMMON, IDI_ANNIVERSARY, 0 },
+
+ //zodiac
+ { ICO_ZOD_AQUARIUS, LPGEN("Aquarius"), SECT_COMMON, IDI_ZOD_AQUARIUS, 128 },
+ { ICO_ZOD_ARIES, LPGEN("Aries"), SECT_COMMON, IDI_ZOD_ARIES, 128 },
+ { ICO_ZOD_CANCER, LPGEN("Cancer"), SECT_COMMON, IDI_ZOD_CANCER, 128 },
+ { ICO_ZOD_CAPRICORN, LPGEN("Capricorn"), SECT_COMMON, IDI_ZOD_CAPRICORN, 128 },
+ { ICO_ZOD_GEMINI, LPGEN("Gemini"), SECT_COMMON, IDI_ZOD_GEMINI, 128 },
+ { ICO_ZOD_LEO, LPGEN("Leo"), SECT_COMMON, IDI_ZOD_LEO, 128 },
+ { ICO_ZOD_LIBRA, LPGEN("Libra"), SECT_COMMON, IDI_ZOD_LIBRA, 128 },
+ { ICO_ZOD_PISCES, LPGEN("Pisces"), SECT_COMMON, IDI_ZOD_PISCES, 128 },
+ { ICO_ZOD_SAGITTARIUS, LPGEN("Sagittarius"), SECT_COMMON, IDI_ZOD_SAGITTARIUS, 128 },
+ { ICO_ZOD_SCORPIO, LPGEN("Scorpio"), SECT_COMMON, IDI_ZOD_SCORPIO, 128 },
+ { ICO_ZOD_TAURUS, LPGEN("Taurus"), SECT_COMMON, IDI_ZOD_TAURUS, 128 },
+ { ICO_ZOD_VIRGO, LPGEN("Virgo"), SECT_COMMON, IDI_ZOD_VIRGO, 128 },
+
+ // lists
+ { ICO_LST_MODULES, LPGEN("Export: Modules"), SECT_COMMON, IDI_LST_MODULES, 0 },
+ { ICO_LST_FOLDER, LPGEN("Export: Folder"), SECT_COMMON, IDI_LST_FOLDER, 0 },
+ { ICO_TREE_DEFAULT, LPGEN("Default"), SECT_TREE, IDI_LST_FOLDER, 0 },
+
+ // dialogs
+ { ICO_DLG_DETAILS, LPGEN("Details Infobar"), SECT_DLG, IDI_DLG_DETAILS, 48 },
+ { ICO_DLG_PHONE, LPGEN("Phone Infobar"), SECT_DLG, IDI_DLG_PHONE, 1 },
+ { ICO_DLG_EMAIL, LPGEN("E-Mail Infobar"), SECT_DLG, IDI_DLG_EMAIL, 1 },
+ { ICO_DLG_EXPORT, LPGEN("Export VCard"), SECT_DLG, IDI_EXPORT, 1 },
+ { ICO_DLG_IMPORT, LPGEN("Import VCard"), SECT_DLG, IDI_IMPORT, 1 },
+ { ICO_DLG_ANNIVERSARY, LPGEN("Anniversary Infobar"), SECT_DLG, IDI_ANNIVERSARY, 1 },
+
+ // button icons
+ { ICO_BTN_UPDATE, LPGEN("Update"), SECT_BUTTONS, IDI_BTN_UPDATE, 0 },
+ { ICO_BTN_IMPORT, LPGEN("Import"), SECT_BUTTONS, IDI_IMPORT, 0 },
+ { ICO_BTN_EXPORT, LPGEN("Export"), SECT_BUTTONS, IDI_EXPORT, 0 },
+ { ICO_BTN_OK, LPGEN("OK"), SECT_BUTTONS, IDI_BTN_OK, 0 },
+ { ICO_BTN_CANCEL, LPGEN("Cancel"), SECT_BUTTONS, IDI_BTN_CLOSE, 0 },
+ { ICO_BTN_APPLY, LPGEN("Apply"), SECT_BUTTONS, IDI_BTN_APPLY, 0 },
+ { ICO_BTN_GOTO, LPGEN("Goto"), SECT_BUTTONS, IDI_BTN_GOTO, 0 },
+ { ICO_BTN_PHONE, LPGEN("Phone"), SECT_BUTTONS, IDI_BTN_PHONE, 0 },
+ { ICO_BTN_FAX, LPGEN("Fax"), SECT_BUTTONS, IDI_BTN_FAX, 0 },
+ { ICO_BTN_CELLULAR, LPGEN("Cellular"), SECT_BUTTONS, IDI_BTN_CELLULAR, 0 },
+ { ICO_BTN_CUSTOMPHONE, LPGEN("Custom Phone"), SECT_BUTTONS, IDI_BTN_CUSTOMPHONE, 0 },
+ { ICO_BTN_EMAIL, LPGEN("e-mail"), SECT_BUTTONS, IDI_BTN_EMAIL, 0 },
+ { ICO_BTN_DOWNARROW, LPGEN("Down arrow"), SECT_BUTTONS, IDI_BTN_DOWNARROW, 0 },
+ { ICO_BTN_ADD, LPGEN("Add"), SECT_BUTTONS, IDI_BTN_ADD, 0 },
+ { ICO_BTN_EDIT, LPGEN("Edit"), SECT_BUTTONS, IDI_BTN_EDIT, 0 },
+ { ICO_BTN_DELETE, LPGEN("Delete"), SECT_BUTTONS, IDI_BTN_DELETE, 0 },
+ { ICO_BTN_SEARCH, LPGEN("Search"), SECT_BUTTONS, IDI_SEARCH, 0 },
+ { ICO_BTN_EXIMPORT, LPGEN("Ex-/Import"), SECT_BUTTONS, IDI_BTN_EXIMPORT, 0 },
+ { ICO_BTN_BDAY_BACKUP, LPGEN("Backup Birthday"), SECT_BUTTONS, IDI_BTN_BIRTHDAY_BACKUP, 0 },
+
+ //birthday and anniversary
+ { ICO_RMD_DTB0, LPGEN("Birthday today"), SECT_REMIND, IDI_RMD_DTB0, 0 },
+ { ICO_RMD_DTB1, LPGEN("Birthday tomorrow"), SECT_REMIND, IDI_RMD_DTB1, 0 },
+ { ICO_RMD_DTB2, LPGEN("Birthday in 2 days"), SECT_REMIND, IDI_RMD_DTB2, 0 },
+ { ICO_RMD_DTB3, LPGEN("Birthday in 3 days"), SECT_REMIND, IDI_RMD_DTB3, 0 },
+ { ICO_RMD_DTB4, LPGEN("Birthday in 4 days"), SECT_REMIND, IDI_RMD_DTB4, 0 },
+ { ICO_RMD_DTB5, LPGEN("Birthday in 5 days"), SECT_REMIND, IDI_RMD_DTB5, 0 },
+ { ICO_RMD_DTB6, LPGEN("Birthday in 6 days"), SECT_REMIND, IDI_RMD_DTB6, 0 },
+ { ICO_RMD_DTB7, LPGEN("Birthday in 7 days"), SECT_REMIND, IDI_RMD_DTB7, 0 },
+ { ICO_RMD_DTB8, LPGEN("Birthday in 8 days"), SECT_REMIND, IDI_RMD_DTB8, 0 },
+ { ICO_RMD_DTB9, LPGEN("Birthday in 9 days"), SECT_REMIND, IDI_RMD_DTB9, 0 },
+ { ICO_RMD_DTBX, LPGEN("Birthday later"), SECT_REMIND, IDI_RMD_DTBX, 0 },
+
+ { ICO_RMD_DTA0, LPGEN("Anniversary today"), SECT_REMIND, IDI_RMD_DTA0, 0 },
+ { ICO_RMD_DTA1, LPGEN("Anniversary tomorrow"), SECT_REMIND, IDI_RMD_DTA1, 0 },
+ { ICO_RMD_DTA2, LPGEN("Anniversary in 2 days"), SECT_REMIND, IDI_RMD_DTA2, 0 },
+ { ICO_RMD_DTA3, LPGEN("Anniversary in 3 days"), SECT_REMIND, IDI_RMD_DTA3, 0 },
+ { ICO_RMD_DTA4, LPGEN("Anniversary in 4 days"), SECT_REMIND, IDI_RMD_DTA4, 0 },
+ { ICO_RMD_DTA5, LPGEN("Anniversary in 5 days"), SECT_REMIND, IDI_RMD_DTA5, 0 },
+ { ICO_RMD_DTA6, LPGEN("Anniversary in 6 days"), SECT_REMIND, IDI_RMD_DTA6, 0 },
+ { ICO_RMD_DTA7, LPGEN("Anniversary in 7 days"), SECT_REMIND, IDI_RMD_DTA7, 0 },
+ { ICO_RMD_DTA8, LPGEN("Anniversary in 8 days"), SECT_REMIND, IDI_RMD_DTA8, 0 },
+ { ICO_RMD_DTA9, LPGEN("Anniversary in 9 days"), SECT_REMIND, IDI_RMD_DTA9, 0 },
+ { ICO_RMD_DTAX, LPGEN("Anniversary later"), SECT_REMIND, IDI_RMD_DTAX, 0 },
};
/**
@@ -160,16 +155,13 @@ LPTSTR IcoLib_GetDefaultIconFileName() **/
static void IcoLib_CheckIconPackVersion(LPTSTR szIconPack)
{
- if (db_get_b(NULL, MODNAME, SET_ICONS_CHECKFILEVERSION, TRUE))
- {
- if (szIconPack)
- {
+ if (db_get_b(NULL, MODNAME, SET_ICONS_CHECKFILEVERSION, TRUE)) {
+ if (szIconPack) {
TCHAR szAbsolutePath[MAX_PATH];
PathToAbsoluteT(szIconPack, szAbsolutePath);
HMODULE hIconDll = LoadLibrary(szAbsolutePath);
- if (hIconDll)
- {
+ if (hIconDll) {
CHAR szFileVersion[64];
if (!LoadStringA(hIconDll, IDS_ICOPACKVERSION, szFileVersion, sizeof(szFileVersion)) ||
@@ -180,10 +172,7 @@ static void IcoLib_CheckIconPackVersion(LPTSTR szIconPack) FreeLibrary(hIconDll);
}
}
- else
- {
- MsgErr(NULL, LPGENT("Warning: No IconPack found in one of the following directories: 'customize\\icons', 'icons' or 'plugins'!"));
- }
+ else MsgErr(NULL, LPGENT("Warning: No IconPack found in one of the following directories: 'customize\\icons', 'icons' or 'plugins'!"));
}
}
@@ -200,18 +189,6 @@ HICON IcoLib_GetIcon(LPCSTR pszIcon) }
/**
- * Returns a icon, identified by a name
- *
- * @param hIconItem - this is the pointer to an IconItem structure in icolib.
- *
- * @return: HICON if the icon is loaded, NULL otherwise
- **/
-HICON IcoLib_GetIconByHandle(HANDLE hIconItem)
-{
- return Skin_GetIconByHandle(hIconItem);
-}
-
-/**
* Set the icon of each control in the list
*
* @param hDlg - handle to the dialog control, that owns the controls
@@ -222,33 +199,20 @@ HICON IcoLib_GetIconByHandle(HANDLE hIconItem) **/
void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL* pCtrl, BYTE numCtrls)
{
- HICON hIcon;
- BYTE i;
- HWND hCtrl;
-
- for (i = 0; i < numCtrls; i++)
- {
- hIcon = IcoLib_GetIcon(pCtrl[i].pszIcon);
- if (pCtrl[i].idCtrl)
- {
- hCtrl = GetDlgItem(hDlg, pCtrl[i].idCtrl);
- switch (pCtrl[i].Message)
- {
- case STM_SETICON:
- case STM_SETIMAGE:
- {
- ShowWindow(hCtrl, hIcon ? SW_SHOW : SW_HIDE);
- }
- case BM_SETIMAGE:
- {
- SendMessage(hCtrl, pCtrl[i].Message, IMAGE_ICON, (LPARAM) hIcon);
- }
+ for (int i = 0; i < numCtrls; i++) {
+ HICON hIcon = IcoLib_GetIcon(pCtrl[i].pszIcon);
+ if (pCtrl[i].idCtrl) {
+ HWND hCtrl = GetDlgItem(hDlg, pCtrl[i].idCtrl);
+ switch (pCtrl[i].Message) {
+ case STM_SETICON:
+ case STM_SETIMAGE:
+ ShowWindow(hCtrl, hIcon ? SW_SHOW : SW_HIDE);
+
+ case BM_SETIMAGE:
+ SendMessage(hCtrl, pCtrl[i].Message, IMAGE_ICON, (LPARAM) hIcon);
}
}
- else
- {
- SendMessage(hDlg, pCtrl[i].Message, ICON_BIG, (LPARAM) hIcon);
- }
+ else SendMessage(hDlg, pCtrl[i].Message, ICON_BIG, (LPARAM) hIcon);
}
}
@@ -353,7 +317,7 @@ HANDLE IcoLib_RegisterIconHandle(LPSTR szIconID, LPSTR szDescription, LPSTR szSe **/
HICON IcoLib_RegisterIcon(LPSTR szIconID, LPSTR szDescription, LPSTR szSection, int idIcon, int Size)
{
- return IcoLib_GetIconByHandle(IcoLib_RegisterIconHandle(szIconID, szDescription, szSection, idIcon, Size));
+ return Skin_GetIconByHandle(IcoLib_RegisterIconHandle(szIconID, szDescription, szSection, idIcon, Size));
}
/**
@@ -363,8 +327,13 @@ HICON IcoLib_RegisterIcon(LPSTR szIconID, LPSTR szDescription, LPSTR szSection, *
* @return nothing
**/
+
+static IconItem main = { LPGEN("Main"), ICO_COMMON_MAIN, IDI_MAIN };
+
void IcoLib_LoadModule()
{
+ Icon_Register(ghInst, SECT_COMMON, &main, 1);
+
LPTSTR szDefaultFile = IcoLib_GetDefaultIconFileName();
IcoLib_CheckIconPackVersion(szDefaultFile);
@@ -372,10 +341,8 @@ void IcoLib_LoadModule() ghDefIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_DEFAULT), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
- for (int i = 0; i < SIZEOF(icoDesc); i++) {
+ for (int i = 0; i < SIZEOF(icoDesc); i++)
IcoLib_RegisterIconHandleEx(
icoDesc[i].pszName, icoDesc[i].pszDesc, icoDesc[i].pszSection,
szDefaultFile, icoDesc[i].idResource, icoDesc[i].size, ghDefIcon);
- }
}
-
diff --git a/plugins/UserInfoEx/src/mir_icolib.h b/plugins/UserInfoEx/src/mir_icolib.h index 046819a861..0c986ef9fd 100644 --- a/plugins/UserInfoEx/src/mir_icolib.h +++ b/plugins/UserInfoEx/src/mir_icolib.h @@ -23,98 +23,98 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define _UINFOEX_ICONS_H_INCLUDED_ 1
// sections
-#define SECT_COMMON LPGEN("UserInfoEx")
-#define SECT_ZODIAC "UserInfoEx/Zodiacs"
-#define SECT_DLG "UserInfoEx/Dialogs"
-#define SECT_BUTTONS "UserInfoEx/Buttons"
-#define SECT_TREE "UserInfoEx/TreeView"
-#define SECT_REMIND "UserInfoEx/Reminder"
+#define SECT_COMMON LPGEN("UserInfoEx")
+#define SECT_ZODIAC "UserInfoEx/Zodiacs"
+#define SECT_DLG "UserInfoEx/Dialogs"
+#define SECT_BUTTONS "UserInfoEx/Buttons"
+#define SECT_TREE "UserInfoEx/TreeView"
+#define SECT_REMIND "UserInfoEx/Reminder"
// icons
-#define ICO_COMMON_IM MODNAME"_common_im"
-#define ICO_COMMON_FEMALE MODNAME"_common_female"
-#define ICO_COMMON_MALE MODNAME"_common_male"
-#define ICO_COMMON_BIRTHDAY MODNAME"_common_birthday"
-#define ICO_COMMON_ANNIVERSARY MODNAME"_common_anniversary"
-#define ICO_COMMON_CLOCK MODNAME"_common_clock"
-#define ICO_COMMON_MARITAL MODNAME"_common_marital"
-#define ICO_COMMON_PASSWORD MODNAME"_common_password"
-#define ICO_COMMON_ADDRESS MODNAME"_common_address"
-#define ICO_DLG_DETAILS MODNAME"_dlg_details"
-#define ICO_DLG_PHONE MODNAME"_dlg_phone"
-#define ICO_DLG_EMAIL MODNAME"_dlg_email"
-#define ICO_DLG_EXPORT MODNAME"_dlg_export"
-#define ICO_DLG_IMPORT MODNAME"_dlg_import"
-#define ICO_DLG_ANNIVERSARY MODNAME"_dlg_anniversary"
-#define ICO_DLG_SEARCH MODNAME"_dlg_search"
-#define ICO_LST_MODULES MODNAME"_lst_modules"
-#define ICO_LST_FOLDER MODNAME"_lst_folder"
-#define ICO_BTN_UPDATE MODNAME"_btn_update"
-#define ICO_BTN_OK MODNAME"_btn_ok"
-#define ICO_BTN_CANCEL MODNAME"_btn_cancel"
-#define ICO_BTN_APPLY MODNAME"_btn_apply"
-#define ICO_BTN_GOTO MODNAME"_btn_goto"
-#define ICO_BTN_ADD MODNAME"_btn_add"
-#define ICO_BTN_EDIT MODNAME"_btn_edit"
-#define ICO_BTN_DELETE MODNAME"_btn_delete"
-#define ICO_BTN_IMPORT MODNAME"_btn_import"
-#define ICO_BTN_EXPORT MODNAME"_btn_export"
-#define ICO_BTN_NOTES MODNAME"_btn_notes"
-#define ICO_BTN_ABOUT MODNAME"_btn_about"
-#define ICO_BTN_PROFILE MODNAME"_btn_profile"
-#define ICO_BTN_DOWNARROW MODNAME"_btn_downarrow"
-#define ICO_BTN_PHONE MODNAME"_btn_phone"
-#define ICO_BTN_FAX MODNAME"_btn_fax"
-#define ICO_BTN_CELLULAR MODNAME"_btn_cellular"
-#define ICO_BTN_CUSTOMPHONE MODNAME"_btn_customphone"
-#define ICO_BTN_EMAIL MODNAME"_btn_email"
-#define ICO_BTN_SEARCH MODNAME"_btn_search"
-#define ICO_BTN_EXIMPORT MODNAME"_btn_eximport"
-#define ICO_BTN_BDAY_BACKUP MODNAME"_btn_bdaybackup"
-#define ICO_BTN_YES MODNAME"_btn_yes"
-#define ICO_BTN_NO MODNAME"_btn_no"
-#define ICO_BTN_IGNORE MODNAME"_btn_ignore"
-#define ICO_ZOD_AQUARIUS MODNAME"_zod_aquarius"
-#define ICO_ZOD_ARIES MODNAME"_zod_aries"
-#define ICO_ZOD_CANCER MODNAME"_zod_cancer"
-#define ICO_ZOD_CAPRICORN MODNAME"_zod_capricorn"
-#define ICO_ZOD_GEMINI MODNAME"_zod_gemini"
-#define ICO_ZOD_LEO MODNAME"_zod_leo"
-#define ICO_ZOD_LIBRA MODNAME"_zod_libra"
-#define ICO_ZOD_PISCES MODNAME"_zod_pisces"
-#define ICO_ZOD_SAGITTARIUS MODNAME"_zod_sagittarius"
-#define ICO_ZOD_SCORPIO MODNAME"_zod_scorpio"
-#define ICO_ZOD_TAURUS MODNAME"_zod_taurus"
-#define ICO_ZOD_VIRGO MODNAME"_zod_virgo"
-#define ICO_ZOD_UNKNOWN MODNAME"_zod_unknown"
-#define ICO_TREE_DEFAULT MODNAME"_tree_default"
-
-#define ICO_RMD_DTB0 MODNAME"_rmd_dtb0"
-#define ICO_RMD_DTB1 MODNAME"_rmd_dtb1"
-#define ICO_RMD_DTB2 MODNAME"_rmd_dtb2"
-#define ICO_RMD_DTB3 MODNAME"_rmd_dtb3"
-#define ICO_RMD_DTB4 MODNAME"_rmd_dtb4"
-#define ICO_RMD_DTB5 MODNAME"_rmd_dtb5"
-#define ICO_RMD_DTB6 MODNAME"_rmd_dtb6"
-#define ICO_RMD_DTB7 MODNAME"_rmd_dtb7"
-#define ICO_RMD_DTB8 MODNAME"_rmd_dtb8"
-#define ICO_RMD_DTB9 MODNAME"_rmd_dtb9"
-#define ICO_RMD_DTBX MODNAME"_rmd_dtbx"
-
-#define ICO_RMD_DTA0 MODNAME"_rmd_dta0"
-#define ICO_RMD_DTA1 MODNAME"_rmd_dta1"
-#define ICO_RMD_DTA2 MODNAME"_rmd_dta2"
-#define ICO_RMD_DTA3 MODNAME"_rmd_dta3"
-#define ICO_RMD_DTA4 MODNAME"_rmd_dta4"
-#define ICO_RMD_DTA5 MODNAME"_rmd_dta5"
-#define ICO_RMD_DTA6 MODNAME"_rmd_dta6"
-#define ICO_RMD_DTA7 MODNAME"_rmd_dta7"
-#define ICO_RMD_DTA8 MODNAME"_rmd_dta8"
-#define ICO_RMD_DTA9 MODNAME"_rmd_dta9"
-#define ICO_RMD_DTAX MODNAME"_rmd_dtax"
-
-#define SET_ICONS_CHECKFILEVERSION "CheckIconPackVersion"
-#define SET_ICONS_BUTTONS "ButtonIcons"
+#define ICO_COMMON_MAIN MODNAME"_common_main"
+#define ICO_COMMON_IM MODNAME"_common_im"
+#define ICO_COMMON_FEMALE MODNAME"_common_female"
+#define ICO_COMMON_MALE MODNAME"_common_male"
+#define ICO_COMMON_BIRTHDAY MODNAME"_common_birthday"
+#define ICO_COMMON_ANNIVERSARY MODNAME"_common_anniversary"
+#define ICO_COMMON_CLOCK MODNAME"_common_clock"
+#define ICO_COMMON_MARITAL MODNAME"_common_marital"
+#define ICO_COMMON_PASSWORD MODNAME"_common_password"
+#define ICO_COMMON_ADDRESS MODNAME"_common_address"
+#define ICO_DLG_DETAILS MODNAME"_dlg_details"
+#define ICO_DLG_PHONE MODNAME"_dlg_phone"
+#define ICO_DLG_EMAIL MODNAME"_dlg_email"
+#define ICO_DLG_EXPORT MODNAME"_dlg_export"
+#define ICO_DLG_IMPORT MODNAME"_dlg_import"
+#define ICO_DLG_ANNIVERSARY MODNAME"_dlg_anniversary"
+#define ICO_DLG_SEARCH MODNAME"_dlg_search"
+#define ICO_LST_MODULES MODNAME"_lst_modules"
+#define ICO_LST_FOLDER MODNAME"_lst_folder"
+#define ICO_BTN_UPDATE MODNAME"_btn_update"
+#define ICO_BTN_OK MODNAME"_btn_ok"
+#define ICO_BTN_CANCEL MODNAME"_btn_cancel"
+#define ICO_BTN_APPLY MODNAME"_btn_apply"
+#define ICO_BTN_GOTO MODNAME"_btn_goto"
+#define ICO_BTN_ADD MODNAME"_btn_add"
+#define ICO_BTN_EDIT MODNAME"_btn_edit"
+#define ICO_BTN_DELETE MODNAME"_btn_delete"
+#define ICO_BTN_IMPORT MODNAME"_btn_import"
+#define ICO_BTN_EXPORT MODNAME"_btn_export"
+#define ICO_BTN_NOTES MODNAME"_btn_notes"
+#define ICO_BTN_ABOUT MODNAME"_btn_about"
+#define ICO_BTN_PROFILE MODNAME"_btn_profile"
+#define ICO_BTN_DOWNARROW MODNAME"_btn_downarrow"
+#define ICO_BTN_PHONE MODNAME"_btn_phone"
+#define ICO_BTN_FAX MODNAME"_btn_fax"
+#define ICO_BTN_CELLULAR MODNAME"_btn_cellular"
+#define ICO_BTN_CUSTOMPHONE MODNAME"_btn_customphone"
+#define ICO_BTN_EMAIL MODNAME"_btn_email"
+#define ICO_BTN_SEARCH MODNAME"_btn_search"
+#define ICO_BTN_EXIMPORT MODNAME"_btn_eximport"
+#define ICO_BTN_BDAY_BACKUP MODNAME"_btn_bdaybackup"
+#define ICO_BTN_YES MODNAME"_btn_yes"
+#define ICO_BTN_NO MODNAME"_btn_no"
+#define ICO_BTN_IGNORE MODNAME"_btn_ignore"
+#define ICO_ZOD_AQUARIUS MODNAME"_zod_aquarius"
+#define ICO_ZOD_ARIES MODNAME"_zod_aries"
+#define ICO_ZOD_CANCER MODNAME"_zod_cancer"
+#define ICO_ZOD_CAPRICORN MODNAME"_zod_capricorn"
+#define ICO_ZOD_GEMINI MODNAME"_zod_gemini"
+#define ICO_ZOD_LEO MODNAME"_zod_leo"
+#define ICO_ZOD_LIBRA MODNAME"_zod_libra"
+#define ICO_ZOD_PISCES MODNAME"_zod_pisces"
+#define ICO_ZOD_SAGITTARIUS MODNAME"_zod_sagittarius"
+#define ICO_ZOD_SCORPIO MODNAME"_zod_scorpio"
+#define ICO_ZOD_TAURUS MODNAME"_zod_taurus"
+#define ICO_ZOD_VIRGO MODNAME"_zod_virgo"
+#define ICO_TREE_DEFAULT MODNAME"_tree_default"
+
+#define ICO_RMD_DTB0 MODNAME"_rmd_dtb0"
+#define ICO_RMD_DTB1 MODNAME"_rmd_dtb1"
+#define ICO_RMD_DTB2 MODNAME"_rmd_dtb2"
+#define ICO_RMD_DTB3 MODNAME"_rmd_dtb3"
+#define ICO_RMD_DTB4 MODNAME"_rmd_dtb4"
+#define ICO_RMD_DTB5 MODNAME"_rmd_dtb5"
+#define ICO_RMD_DTB6 MODNAME"_rmd_dtb6"
+#define ICO_RMD_DTB7 MODNAME"_rmd_dtb7"
+#define ICO_RMD_DTB8 MODNAME"_rmd_dtb8"
+#define ICO_RMD_DTB9 MODNAME"_rmd_dtb9"
+#define ICO_RMD_DTBX MODNAME"_rmd_dtbx"
+
+#define ICO_RMD_DTA0 MODNAME"_rmd_dta0"
+#define ICO_RMD_DTA1 MODNAME"_rmd_dta1"
+#define ICO_RMD_DTA2 MODNAME"_rmd_dta2"
+#define ICO_RMD_DTA3 MODNAME"_rmd_dta3"
+#define ICO_RMD_DTA4 MODNAME"_rmd_dta4"
+#define ICO_RMD_DTA5 MODNAME"_rmd_dta5"
+#define ICO_RMD_DTA6 MODNAME"_rmd_dta6"
+#define ICO_RMD_DTA7 MODNAME"_rmd_dta7"
+#define ICO_RMD_DTA8 MODNAME"_rmd_dta8"
+#define ICO_RMD_DTA9 MODNAME"_rmd_dta9"
+#define ICO_RMD_DTAX MODNAME"_rmd_dtax"
+
+#define SET_ICONS_CHECKFILEVERSION "CheckIconPackVersion"
+#define SET_ICONS_BUTTONS "ButtonIcons"
#define ICONINDEX(id) max((min((id), IDI_LASTICON)) - IDI_FIRST_ICON, 0)
@@ -131,7 +131,6 @@ void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL* pCtrl, BYTE numCtrls); HANDLE IcoLib_RegisterIconHandle(LPSTR szName, LPSTR szDescription, LPSTR szSection, int idIcon, int Size);
HICON IcoLib_RegisterIcon(LPSTR szName, LPSTR szDescription, LPSTR szSection, int idIcon, int Size);
HICON IcoLib_GetIcon(LPCSTR pszIcon);
-HICON IcoLib_GetIconByHandle(HANDLE hIconItem);
void IcoLib_LoadModule();
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 490eb8faab..8f269e957a 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -90,36 +90,35 @@ void RebuildContact() mi.flags = CMIF_ROOTHANDLE;
mi.hParentMenu = HGENMENU_ROOT;
- switch (flag)
- {
- case 3:
- //cascade off
- mhRoot = mhExIm = HGENMENU_ROOT;
- hMenuItem[item++] = NULL;
- break;
- case 5:
- //cascade all
- mi.position = 1000050000;
- mi.popupPosition = 1000050000;
- mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
- mi.pszName = LPGEN(MODULELONGNAME);
- mhRoot = Menu_AddContactMenuItem(&mi);
- hMenuItem[item++] = mhRoot;
- mhExIm = mhRoot;
- break;
- case 9:
- //cascade Ex/Import
- mi.position = 1000050100;
- mi.popupPosition = 1000050100;
- mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
- mi.pszName = LPGEN("Ex-/Import contact");
- mhExIm = Menu_AddContactMenuItem(&mi);
- hMenuItem[item++] = mhExIm;
- mhRoot = HGENMENU_ROOT;
- break;
- default:
- //disable Menue
- return;
+ switch (flag) {
+ case 3:
+ //cascade off
+ mhRoot = mhExIm = HGENMENU_ROOT;
+ hMenuItem[item++] = NULL;
+ break;
+ case 5:
+ //cascade all
+ mi.position = 1000050000;
+ mi.popupPosition = 1000050000;
+ mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
+ mi.pszName = LPGEN(MODULELONGNAME);
+ mhRoot = Menu_AddContactMenuItem(&mi);
+ hMenuItem[item++] = mhRoot;
+ mhExIm = mhRoot;
+ break;
+ case 9:
+ //cascade Ex/Import
+ mi.position = 1000050100;
+ mi.popupPosition = 1000050100;
+ mi.hIcon = IcoLib_GetIcon(ICO_BTN_EXIMPORT);
+ mi.pszName = LPGEN("Ex-/Import contact");
+ mhExIm = Menu_AddContactMenuItem(&mi);
+ hMenuItem[item++] = mhExIm;
+ mhRoot = HGENMENU_ROOT;
+ break;
+ default:
+ //disable Menu
+ return;
}
mi.popupPosition = NULL;
@@ -129,14 +128,15 @@ void RebuildContact() mi.pszService = MS_USERINFO_SHOWDIALOG;
mi.pszName = LPGEN("User &Details");
mi.position = 1000050000;
- mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
+ mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.hotKey = MAKELPARAM(VK_F3, MOD_ALT);
hMenuItem[item++] = Menu_AddContactMenuItem(&mi);
mi.hotKey = NULL;
}
// VCard's Ex/Import menuitems
- { mi.hParentMenu = mhExIm;
+ {
+ mi.hParentMenu = mhExIm;
// Export
mi.pszService = MS_USERINFO_VCARD_EXPORT;
@@ -198,7 +198,7 @@ void RebuildMain() //cascade all
mi.position = 500050000;
mi.popupPosition = 500050000;
- mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
+ mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.pszName = LPGEN(MODULELONGNAME);
mhRoot = Menu_AddMainMenuItem(&mi);
hMenuItem[item++] = mhRoot;
@@ -226,7 +226,7 @@ void RebuildMain() mi.pszService = MS_USERINFO_SHOWDIALOG;
mi.pszName = LPGEN("View/Change My &Details...");
mi.position = 500050000;
- mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
+ mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
hMenuItem[item++] = Menu_AddMainMenuItem(&mi);
}
@@ -343,7 +343,7 @@ void RebuildGroup() //cascade all
mi.position = 250000;
mi.popupPosition = 250000;
- mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
+ mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.pszName = LPGEN(MODULELONGNAME);
mhRoot = Menu_AddGroupMenuItem(0, &mi);
hMenuItem[item++] = mhRoot;
@@ -440,7 +440,7 @@ void RebuildSubGroup() //cascade all
mi.position = 1050000;
mi.popupPosition = 1050000;
- mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
+ mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.pszName = LPGEN("Extended UserInfo");
mhRoot = Menu_AddSubGroupMenuItem(0, &mi);
hMenuItem[item++] = mhRoot;
@@ -572,7 +572,7 @@ INT_PTR RebuildAccount(WPARAM wParam, LPARAM lParam) case 5:
//cascade all
mi.position = 50100;
- mi.hIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_MAIN), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON), 0);
+ mi.hIcon = IcoLib_GetIcon(ICO_COMMON_MAIN);
mi.ptszName = TranslateT(MODULELONGNAME);
hMenuItemAccount[mItems*i + item] = Menu_AddStatusMenuItem(&mi);
mhRoot = hMenuItemAccount[mItems*i + item++];
|