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/Nudge | |
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/Nudge')
-rw-r--r-- | plugins/Nudge/src/main.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 7921fce8a9..ab5c252a3c 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -5,7 +5,7 @@ int nProtocol = 0;
-static HANDLE g_hEventModulesLoaded = NULL, hEventOptionsInitialize = NULL, g_hIcon = NULL, g_hEventDbWindowEvent = NULL, g_hEventToolbarLoaded = NULL, g_hEventButtonPressed = NULL, g_hEventAccountsChanged = NULL;
+static HANDLE g_hEventModulesLoaded = NULL, hEventOptionsInitialize = NULL, g_hEventDbWindowEvent = NULL, g_hEventToolbarLoaded = NULL, g_hEventButtonPressed = NULL, g_hEventAccountsChanged = NULL;
HINSTANCE hInst;
NudgeElementList *NudgeList = NULL;
@@ -363,20 +363,15 @@ void RegisterToDbeditorpp(void) CallService("DBEditorpp/RegisterSingleModule", (WPARAM)"Nudge", 0);
}
+static IconItem iconList[] =
+{
+ { LPGEN("Nudge as Default"), "Nudge_Default", IDI_NUDGE }
+};
+
void LoadIcons(void)
{
//Load icons
- TCHAR szFilename[MAX_PATH];
- GetModuleFileName(hInst,szFilename,MAX_PATH);
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.flags = SIDF_PATH_TCHAR;
- sid.pszSection = LPGEN("Nudge");
- sid.ptszDefaultFile = szFilename;
- sid.pszName = "Nudge_Default";
- sid.pszDescription = LPGEN("Nudge as Default");
- sid.iDefaultIndex = -IDI_NUDGE;
- g_hIcon = Skin_AddIcon(&sid);
+ Icon_Register(hInst, LPGEN("Nudge"), iconList, SIZEOF(iconList));
}
// Nudge support
@@ -399,7 +394,7 @@ static int TabsrmmButtonInit(WPARAM wParam, LPARAM lParam) bbd.ptszTooltip = LPGENT("Send Nudge");
bbd.dwDefPos = 300;
bbd.bbbFlags = BBBF_ISIMBUTTON|BBBF_ISLSIDEBUTTON|BBBF_CANBEHIDDEN;
- bbd.hIcon = g_hIcon;
+ bbd.hIcon = iconList[0].hIcolib;
bbd.dwButtonID = 6000;
bbd.iButtonWidth = 0;
CallService (MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
@@ -550,7 +545,7 @@ void LoadPopupClass() ppc.flags = PCF_TCHAR;
ppc.pszName = "Nudge";
ppc.ptszDescription = LPGENT("Show Nudge");
- ppc.hIcon = Skin_GetIconByHandle(g_hIcon);
+ ppc.hIcon = Skin_GetIconByHandle(iconList[0].hIcolib);
ppc.colorBack = NULL;
ppc.colorText = NULL;
ppc.iSeconds = 0;
|