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/Rate/src/main.cpp | |
| 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/Rate/src/main.cpp')
| -rw-r--r-- | plugins/Rate/src/main.cpp | 45 | 
1 files changed, 10 insertions, 35 deletions
diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index c1c7af1d93..0d00e56a9b 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -69,40 +69,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda  ///////////////////////////////////////////////////////////////////////////////
 -struct
 -{
 -	char*  szDescr;
 -	char*  szName;
 -	int    defIconID;
 -	HANDLE hIconLibItem;
 -}
 -static iconList[] =
 -{
 -	{ LPGEN("Rate high"), "rate_high", IDI_RATEHI },
 -	{ LPGEN("Rate medium"), "rate_medium", IDI_RATEME },
 -	{ LPGEN("Rate low"), "rate_low", IDI_RATELO },
 -};
 -
 -static void init_icolib (void)
 -{
 -	TCHAR szFile[MAX_PATH];
 -	GetModuleFileName(g_hInst, szFile, MAX_PATH);
 -
 -	SKINICONDESC sid = { sizeof(sid) };
 -	sid.pszSection = LPGEN("Contact Rate");
 -	sid.ptszDefaultFile = szFile;
 -	sid.flags = SIDF_ALL_TCHAR;
 -
 -	for (int i = 0; i < SIZEOF(iconList); i++ ) {
 -		sid.pszName = iconList[i].szName;
 -		sid.pszDescription =  iconList[i].szDescr;
 -		sid.iDefaultIndex = -iconList[i].defIconID;
 -		iconList[i].hIconLibItem = Skin_AddIcon(&sid);
 -	}
 -}
 -
 -///////////////////////////////////////////////////////////////////////////////
 -
  static void setExtraIcon(HANDLE hContact, int bRate = -1, BOOL clear = TRUE)
  {
  	if (hContact == NULL)
 @@ -122,10 +88,19 @@ static void setExtraIcon(HANDLE hContact, int bRate = -1, BOOL clear = TRUE)  		ExtraIcon_SetIcon(hExtraIcon, hContact, icon);
  }
 +///////////////////////////////////////////////////////////////////////////////
 +
 +static IconItem iconList[] =
 +{
 +	{ LPGEN("Rate high"),   "rate_high",   IDI_RATEHI },
 +	{ LPGEN("Rate medium"), "rate_medium", IDI_RATEME },
 +	{ LPGEN("Rate low"),    "rate_low",    IDI_RATELO },
 +};
 +
  int onModulesLoaded(WPARAM wParam,LPARAM lParam)
  {
     // IcoLib support
 -   init_icolib();
 +	Icon_Register(g_hInst, LPGEN("Contact Rate"), iconList, SIZEOF(iconList));
  	// Extra icon support
  	hExtraIcon = ExtraIcon_Register("contact_rate", "Contact rate", "rate_high");
  | 
