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/StatusPlugins/StartupStatus | |
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/StatusPlugins/StartupStatus')
-rw-r--r-- | plugins/StatusPlugins/StartupStatus/toolbars.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp index ba90cfb1a3..6d9c62ea1d 100644 --- a/plugins/StatusPlugins/StartupStatus/toolbars.cpp +++ b/plugins/StatusPlugins/StartupStatus/toolbars.cpp @@ -25,10 +25,14 @@ #define MAX_MMITEMS 6
-static HANDLE hTtbDown = 0, hTtbUp = 0;
-
static LIST<void> ttbButtons(1);
+static IconItem iconList[] =
+{
+ { LPGEN("Pressed toolbar icon"), "StartupStatus/TtbDown", IDI_TTBDOWN },
+ { LPGEN("Released toolbar icon"), "StartupStatus/TtbUp", IDI_TTBUP },
+};
+
/////////////////////////////////////////////////////////////////////////////////////////
void RemoveTopToolbarButtons()
@@ -57,8 +61,8 @@ int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam) if (DBGetContactSetting(NULL, MODULENAME, setting, &dbv))
continue;
- ttb.hIconHandleDn = hTtbDown;
- ttb.hIconHandleUp = hTtbUp;
+ ttb.hIconHandleDn = iconList[0].hIcolib;
+ ttb.hIconHandleUp = iconList[1].hIcolib;
ttb.wParamDown = ttb.wParamUp = i;
ttb.name = ttb.pszTooltipUp = dbv.pszVal;
HANDLE ttbAddResult = TopToolbar_AddButton(&ttb);
@@ -73,20 +77,5 @@ int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam) void RegisterButtons()
{
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(hInst, szFile, SIZEOF(szFile));
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.ptszDefaultFile = szFile;
- sid.pszSection = "Toolbar/StartupStatus";
- sid.pszName = "StartupStatus/TtbDown";
- sid.pszDescription = "Pressed toolbar icon";
- sid.iDefaultIndex = -IDI_TTBDOWN;
- sid.flags = SIDF_PATH_TCHAR;
- hTtbDown = Skin_AddIcon(&sid);
-
- sid.pszName = "StartupStatus/TtbUp";
- sid.pszDescription = "Released toolbar icon";
- sid.iDefaultIndex = -IDI_TTBUP;
- hTtbUp = Skin_AddIcon(&sid);
+ Icon_Register(hInst, "Toolbar/StartupStatus", iconList, SIZEOF(iconList));
}
|