diff options
Diffstat (limited to 'plugins/Quotes')
-rw-r--r-- | plugins/Quotes/src/IconLib.cpp | 66 |
1 files changed, 16 insertions, 50 deletions
diff --git a/plugins/Quotes/src/IconLib.cpp b/plugins/Quotes/src/IconLib.cpp index e7caa1fd36..ce7ad5cddc 100644 --- a/plugins/Quotes/src/IconLib.cpp +++ b/plugins/Quotes/src/IconLib.cpp @@ -3,7 +3,6 @@ #include <m_icolib.h>
#include "resource.h"
#include "EconomicRateInfo.h"
-// #include <newpluginapi.h>
#include <m_langpack.h>
#include <sstream>
#pragma warning (disable:4996)
@@ -11,52 +10,24 @@ #pragma warning (default:4996)
#include "ModuleInfo.h"
-// extern HMODULE g_hInstance;
-
-namespace
+static IconItem iconList[] =
{
- struct CIconList
- {
- char* szDescr;
- char* szName;
- int defIconID;
- HANDLE hIconLibItem;
- };
-
- CIconList iconList[] =
- {
- { LPGEN("Protocol icon"), ICON_STR_MAIN, IDI_ICON_MAIN },
- { LPGEN("Quote/Rate up"), ICON_STR_QUOTE_UP, IDI_ICON_UP },
- { LPGEN("Quote/Rate down"), ICON_STR_QUOTE_DOWN, IDI_ICON_DOWN },
- { LPGEN("Quote/Rate not changed"), ICON_STR_QUOTE_NOT_CHANGED, IDI_ICON_NOTCHANGED },
- { LPGEN("Quote Section"), ICON_STR_SECTION, IDI_ICON_SECTION },
- { LPGEN("Quote"), ICON_STR_QUOTE, IDI_ICON_QUOTE },
- { LPGEN("Currency Converter"), ICON_STR_CURRENCY_CONVERTER, IDI_ICON_CURRENCY_CONVERTER },
- { LPGEN("Refresh"), ICON_STR_REFRESH, IDI_ICON_REFRESH },
- { LPGEN("Export"), ICON_STR_EXPORT, IDI_ICON_EXPORT },
- { LPGEN("Swap button"), ICON_STR_SWAP, IDI_ICON_SWAP },
- { LPGEN("Import"), ICON_STR_IMPORT, IDI_ICON_IMPORT }
- };
-}
+ { LPGEN("Protocol icon"), ICON_STR_MAIN, IDI_ICON_MAIN },
+ { LPGEN("Quote/Rate up"), ICON_STR_QUOTE_UP, IDI_ICON_UP },
+ { LPGEN("Quote/Rate down"), ICON_STR_QUOTE_DOWN, IDI_ICON_DOWN },
+ { LPGEN("Quote/Rate not changed"), ICON_STR_QUOTE_NOT_CHANGED, IDI_ICON_NOTCHANGED },
+ { LPGEN("Quote Section"), ICON_STR_SECTION, IDI_ICON_SECTION },
+ { LPGEN("Quote"), ICON_STR_QUOTE, IDI_ICON_QUOTE },
+ { LPGEN("Currency Converter"), ICON_STR_CURRENCY_CONVERTER, IDI_ICON_CURRENCY_CONVERTER },
+ { LPGEN("Refresh"), ICON_STR_REFRESH, IDI_ICON_REFRESH },
+ { LPGEN("Export"), ICON_STR_EXPORT, IDI_ICON_EXPORT },
+ { LPGEN("Swap button"), ICON_STR_SWAP, IDI_ICON_SWAP },
+ { LPGEN("Import"), ICON_STR_IMPORT, IDI_ICON_IMPORT }
+};
void Quotes_IconsInit()
{
- TCHAR szFile[MAX_PATH];
- ::GetModuleFileName(g_hInstance, szFile, MAX_PATH);
-
- SKINICONDESC sid = { sizeof(sid) };
- sid.ptszDefaultFile = szFile;
- sid.cx = sid.cy = 16;
- sid.flags = SIDF_PATH_TCHAR;
- sid.pszSection = QUOTES_PROTOCOL_NAME;
-
- for (int i = 0; i < SIZEOF(iconList); i++) {
- std::string sName = Quotes_MakeIconName( iconList[i].szName);
- sid.pszName = const_cast<char*>(sName.c_str());
- sid.pszDescription = iconList[i].szDescr;
- sid.iDefaultIndex = -iconList[i].defIconID;
- iconList[i].hIconLibItem = Skin_AddIcon(&sid);
- }
+ ::Icon_Register(g_hInstance, QUOTES_PROTOCOL_NAME, iconList, SIZEOF(iconList), QUOTES_PROTOCOL_NAME);
}
std::string Quotes_MakeIconName(const char* name)
@@ -78,14 +49,9 @@ HICON Quotes_LoadIconEx(const char* name,bool bBig /*= false*/) HANDLE Quotes_GetIconHandle(int iconId)
{
- for(int i=0;i < SIZEOF(iconList);i++)
- {
+ for (int i=0; i < SIZEOF(iconList); i++)
if(iconList[i].defIconID == iconId)
- {
- return iconList[i].hIconLibItem;
- }
- }
+ return iconList[i].hIcolib;
return NULL;
}
-
|