diff options
| author | George Hazan <george.hazan@gmail.com> | 2012-07-08 20:51:14 +0000 | 
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2012-07-08 20:51:14 +0000 | 
| commit | 696f4ea57845f48d6d979ecd9d66bb22bd9f738d (patch) | |
| tree | c32ac05d363bff47320c1b204561b966aa1c81fd /plugins/AddContactPlus/src | |
| parent | 3b396a2da6b0b8e0f4d2c051aca133772d317820 (diff) | |
TopToolbar usage fixed everywhere
git-svn-id: http://svn.miranda-ng.org/main/trunk@861 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AddContactPlus/src')
| -rw-r--r-- | plugins/AddContactPlus/src/addcontactplus.h | 2 | ||||
| -rw-r--r-- | plugins/AddContactPlus/src/main.cpp | 33 | 
2 files changed, 17 insertions, 18 deletions
diff --git a/plugins/AddContactPlus/src/addcontactplus.h b/plugins/AddContactPlus/src/addcontactplus.h index 6e9d90e9fd..a42f0d14bb 100644 --- a/plugins/AddContactPlus/src/addcontactplus.h +++ b/plugins/AddContactPlus/src/addcontactplus.h @@ -43,7 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,  #include <m_utils.h>
  #include <m_addcontact.h>
 -#include "m_toolbar.h"
 +#include "m_toptoolbar.h"
  #include "m_updater.h"
  #include "m_addcontactplus.h"
 diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index 56d8b0ad1b..de529836c9 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -108,21 +108,6 @@ static int OnAccListChanged(WPARAM, LPARAM)  		mi.ptszName = LPGENT("&Add Contact...");
  		mi.pszService = MS_ADDCONTACTPLUS_SHOW;
  		hMainMenuItem = Menu_AddMainMenuItem(&mi);
 -
 -		if (ServiceExists(MS_TB_ADDBUTTON))
 -		{
 -			TBButton tbb = {0};
 -
 -			tbb.cbSize = sizeof(TBButton);
 -			tbb.tbbFlags = TBBF_VISIBLE | TBBF_SHOWTOOLTIP;
 -			tbb.pszButtonID = "acplus_btn";
 -			tbb.pszButtonName = Translate("Add Contact");
 -			tbb.pszServiceName = MS_ADDCONTACTPLUS_SHOW;
 -			tbb.pszTooltipUp = Translate("Add Contact");
 -			tbb.hPrimaryIconHandle = hIconLibItem;
 -			tbb.defPos = 10100;
 -			hToolBarItem = (HANDLE)CallService(MS_TB_ADDBUTTON, 0, (LPARAM)&tbb);
 -		}
  	}
  	else
  	{
 @@ -130,7 +115,7 @@ static int OnAccListChanged(WPARAM, LPARAM)  			return 0;
  		CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)hMainMenuItem, 0);
 -		CallService(MS_TB_REMOVEBUTTON, (WPARAM)hToolBarItem, 0);
 +		CallService(MS_TTB_REMOVEBUTTON, (WPARAM)hToolBarItem, 0);
  		hMainMenuItem = 0;
  	}
 @@ -138,6 +123,19 @@ static int OnAccListChanged(WPARAM, LPARAM)  	return 0;
  }
 +static int CreateButton(WPARAM, LPARAM)
 +{
 +	TTBButton tbb = {0};
 +	tbb.cbSize = sizeof(tbb);
 +	tbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
 +	tbb.name = "Add Contact";
 +	tbb.pszService = MS_ADDCONTACTPLUS_SHOW;
 +	tbb.pszTooltipUp = "Add Contact";
 +	tbb.hIconHandleUp = hIconLibItem;
 +	hToolBarItem = TopToolbar_AddButton(&tbb);
 +	return 0;
 +}
 +
  static int OnModulesLoaded(WPARAM, LPARAM)
  {
  	if (ServiceExists(MS_UPDATE_REGISTERFL))
 @@ -171,7 +169,8 @@ static int OnModulesLoaded(WPARAM, LPARAM)  	Hotkey_Register(&hkd);
  	OnAccListChanged(0, 0);
 -
 +	
 +	HookEvent(ME_TTB_MODULELOADED, CreateButton);
  	return 0;
  }
  | 
