summaryrefslogtreecommitdiff
path: root/plugins/Alarms/icons.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-05-19 14:38:34 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-05-19 14:38:34 +0000
commit4392b08fedcfc61eb3ec40a956516637d5abbf38 (patch)
tree16061c2ae482ea45b070fe4171b080edc1cf5c1b /plugins/Alarms/icons.cpp
parent162e60d66c78bd51aa44c691fe4f4e2f1deb990f (diff)
added Alarms
git-svn-id: http://svn.miranda-ng.org/main/trunk@77 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Alarms/icons.cpp')
-rw-r--r--plugins/Alarms/icons.cpp91
1 files changed, 91 insertions, 0 deletions
diff --git a/plugins/Alarms/icons.cpp b/plugins/Alarms/icons.cpp
new file mode 100644
index 0000000000..ecc7f5539c
--- /dev/null
+++ b/plugins/Alarms/icons.cpp
@@ -0,0 +1,91 @@
+#include "common.h"
+#include "icons.h"
+
+HANDLE hIcoLibIconsChanged;
+
+HICON hIconMenuSet, hIconList1, hIconList2, hIconMenuShowHide, hIconSystray;
+
+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");
+ if(!ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
+ hIconMenuShowHide = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_showhide");
+
+ RefreshReminderFrame();
+ 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";
+ sid.pszDefaultFile = "alarms.dll";
+ sid.iDefaultIndex = 0;
+ 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);
+
+ 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 );
+ }
+}
+
+
+void DeinitIcons() {
+ if(!ServiceExists(MS_SKIN2_ADDICON)) {
+ DestroyIcon(hIconMenuSet);
+ DestroyIcon(hIconList1);
+ DestroyIcon(hIconList2);
+ DestroyIcon(hIconSystray);
+ if(!ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
+ DestroyIcon(hIconMenuShowHide);
+ }
+}