diff options
author | George Hazan <george.hazan@gmail.com> | 2012-12-02 18:19:49 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-12-02 18:19:49 +0000 |
commit | c4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 (patch) | |
tree | 17a8627550b202d62df8e1df76d2585d3d0cdeaa /plugins/Alarms/src | |
parent | 5ea5feb7e052ca45af7bc9ed76e4a252bd71950d (diff) |
new easy standard way of registering icons: Icon_Register
git-svn-id: http://svn.miranda-ng.org/main/trunk@2601 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Alarms/src')
-rw-r--r-- | plugins/Alarms/src/icons.cpp | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/plugins/Alarms/src/icons.cpp b/plugins/Alarms/src/icons.cpp index d02534df31..8b9aca1780 100644 --- a/plugins/Alarms/src/icons.cpp +++ b/plugins/Alarms/src/icons.cpp @@ -3,6 +3,15 @@ HICON hIconMenuSet, hIconList1, hIconList2, hIconMenuShowHide, hIconSystray;
+static IconItem iconList[] =
+{
+ { LPGEN("Menu: Set Alarm"), "alarms_menu_set", IDI_MAINMENU },
+ { LPGEN("Reminder: Soon"), "alarms_list1", IDI_LIST1 },
+ { LPGEN("Reminder: Very Soon"), "alarms_list2", IDI_LIST2 },
+ { LPGEN("Alarm: System Tray"), "alarms_systray", IDI_MAINMENU },
+ { LPGEN("Menu: Show/Hide Reminders"), "alarms_menu_showhide", IDI_MAINMENU }
+};
+
int ReloadIcons(WPARAM wParam, LPARAM lParam)
{
hIconMenuSet = Skin_GetIcon("alarms_menu_set");
@@ -17,51 +26,11 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam) void InitIcons()
{
- TCHAR path[MAX_PATH]; - GetModuleFileName(hInst, path, MAX_PATH); -
- SKINICONDESC sid = { sizeof(sid) };
- sid.pszSection = "Alarms";
- sid.ptszDefaultFile = path;
- sid.flags = SIDF_PATH_TCHAR;
-
- sid.pszDescription = LPGEN("Menu: Set Alarm");
- sid.pszName = "alarms_menu_set";
- sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = -IDI_MAINMENU;
- Skin_AddIcon(&sid);
-
- sid.pszDescription = LPGEN("Reminder: Soon");
- sid.pszName = "alarms_list1";
- sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = -IDI_LIST1;
-
- sid.pszDescription = LPGEN("Reminder: Very Soon");
- sid.pszName = "alarms_list2";
- sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = -IDI_LIST2;
- Skin_AddIcon(&sid);
-
- sid.pszDescription = LPGEN("Alarm: System Tray");
- sid.pszName = "alarms_systray";
- sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = -IDI_MAINMENU;
- Skin_AddIcon(&sid);
-
- if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- sid.pszDescription = LPGEN("Menu: Show/Hide Reminders");
- sid.pszName = "alarms_menu_showhide";
- sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = -IDI_MAINMENU;
- Skin_AddIcon(&sid);
+ Icon_Register(hInst, "Alarms", iconList, SIZEOF(iconList));
+ if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
hIconMenuShowHide = Skin_GetIcon("alarms_menu_showhide");
- }
-
- hIconMenuSet = Skin_GetIcon("alarms_menu_set");
- hIconList1 = Skin_GetIcon("alarms_list1");
- hIconList2 = Skin_GetIcon("alarms_list2");
- hIconSystray = Skin_GetIcon("alarms_systray");
+ ReloadIcons(0, 0);
HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
}
|