diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-20 23:51:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-20 23:51:53 +0000 |
commit | 57abc51aad272a656282a52a460a47abe24e07d6 (patch) | |
tree | c6f3538e63c9c736cfa7129423d1b498273278b6 /plugins/Alarms | |
parent | b9f120f97699286410fe902f93135235eed0b127 (diff) |
- MS_SKIN2_ADDICON replaced with Skin_AddIcon;
- SKINICONDESC_SIZE* constants removed and replaced with sizeof(sid);
- added SIDF_PATH_UNICODE for all plugins;
- dynamic translation fixed in the icolib options dialog
git-svn-id: http://svn.miranda-ng.org/main/trunk@507 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Alarms')
-rw-r--r-- | plugins/Alarms/alarms.cpp | 4 | ||||
-rw-r--r-- | plugins/Alarms/icons.cpp | 114 | ||||
-rw-r--r-- | plugins/Alarms/icons.h | 1 |
3 files changed, 49 insertions, 70 deletions
diff --git a/plugins/Alarms/alarms.cpp b/plugins/Alarms/alarms.cpp index c0dc60bb85..3c0a198716 100644 --- a/plugins/Alarms/alarms.cpp +++ b/plugins/Alarms/alarms.cpp @@ -294,10 +294,10 @@ static int MainInit(WPARAM wparam,LPARAM lparam) { return 0;
}
-static int MainDeInit(WPARAM wParam, LPARAM lParam) {
+static int MainDeInit(WPARAM wParam, LPARAM lParam)
+{
DeinitFrames();
DeinitList();
- DeinitIcons();
return 0;
}
diff --git a/plugins/Alarms/icons.cpp b/plugins/Alarms/icons.cpp index fe6abf834d..5a07541e27 100644 --- a/plugins/Alarms/icons.cpp +++ b/plugins/Alarms/icons.cpp @@ -5,7 +5,8 @@ HANDLE hIcoLibIconsChanged; HICON hIconMenuSet, hIconList1, hIconList2, hIconMenuShowHide, hIconSystray;
-int ReloadIcons(WPARAM wParam, LPARAM lParam) {
+int ReloadIcons(WPARAM wParam, LPARAM lParam)
+{
hIconMenuSet = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_set");
hIconList1 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list1");
hIconList2 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list2");
@@ -16,76 +17,55 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam) { return 0;
}
-void InitIcons() {
- if (ServiceExists(MS_SKIN2_ADDICON)) {
- SKINICONDESC sid = {0};
-
- sid.cbSize = sizeof(SKINICONDESC);
- sid.pszSection = Translate("Alarms");
-
- sid.pszDescription = Translate("Menu: Set Alarm");
- sid.pszName = "alarms_menu_set";
+void InitIcons()
+{
+ SKINICONDESC sid = {0};
+
+ sid.cbSize = sizeof(SKINICONDESC);
+ sid.pszSection = "Alarms";
+
+ sid.pszDescription = "Menu: Set Alarm";
+ sid.pszName = "alarms_menu_set";
+ sid.pszDefaultFile = "alarms.dll";
+ sid.iDefaultIndex = 0;
+ sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);
+ Skin_AddIcon(&sid);
+
+ sid.pszDescription = "Reminder: Soon";
+ sid.pszName = "alarms_list1";
+ sid.pszDefaultFile = "alarms.dll";
+ sid.iDefaultIndex = 1;
+ sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST1), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS ); Skin_AddIcon(&sid);
+
+ sid.pszDescription = "Reminder: Very Soon";
+ sid.pszName = "alarms_list2";
+ sid.pszDefaultFile = "alarms.dll";
+ sid.iDefaultIndex = 2;
+ sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST2), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ Skin_AddIcon(&sid);
+
+ sid.pszDescription = "Alarm: System Tray";
+ sid.pszName = "alarms_systray";
+ sid.pszDefaultFile = "alarms.dll";
+ sid.iDefaultIndex = 3;
+ sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ Skin_AddIcon(&sid);
+
+ if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
+ sid.pszDescription = "Menu: Show/Hide Reminders";
+ sid.pszName = "alarms_menu_showhide";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 0;
+ sid.iDefaultIndex = 4;
sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.pszDescription = Translate("Reminder: Soon");
- sid.pszName = "alarms_list1";
- sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 1;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST1), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.pszDescription = Translate("Reminder: Very Soon");
- sid.pszName = "alarms_list2";
- sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 2;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST2), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.pszDescription = Translate("Alarm: System Tray");
- sid.pszName = "alarms_systray";
- sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 3;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- sid.pszDescription = Translate("Menu: Show/Hide Reminders");
- sid.pszName = "alarms_menu_showhide";
- sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 4;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
- hIconMenuShowHide = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_showhide");
- }
-
- hIconMenuSet = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_set");
- hIconList1 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list1");
- hIconList2 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list2");
- hIconSystray = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_systray");
-
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
- } else {
- hIconMenuSet = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- hIconList1 = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST1), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- hIconList2 = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST2), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- hIconSystray = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
- hIconMenuShowHide = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ hIconMenuShowHide = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_showhide");
}
-}
+ hIconMenuSet = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_set");
+ hIconList1 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list1");
+ hIconList2 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list2");
+ hIconSystray = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_systray");
-void DeinitIcons() {
- if (!ServiceExists(MS_SKIN2_ADDICON)) {
- DestroyIcon(hIconMenuSet);
- DestroyIcon(hIconList1);
- DestroyIcon(hIconList2);
- DestroyIcon(hIconSystray);
- if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
- DestroyIcon(hIconMenuShowHide);
- }
+ hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
}
diff --git a/plugins/Alarms/icons.h b/plugins/Alarms/icons.h index 89226dd5d4..d47228f952 100644 --- a/plugins/Alarms/icons.h +++ b/plugins/Alarms/icons.h @@ -6,7 +6,6 @@ extern HICON hIconMenuSet, hIconList1, hIconList2, hIconMenuShowHide, hIconSystray;
void InitIcons();
-void DeinitIcons();
#endif
|