From 696f4ea57845f48d6d979ecd9d66bb22bd9f738d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 8 Jul 2012 20:51:14 +0000 Subject: TopToolbar usage fixed everywhere git-svn-id: http://svn.miranda-ng.org/main/trunk@861 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AddContactPlus/src/addcontactplus.h | 2 +- plugins/AddContactPlus/src/main.cpp | 33 ++++++++++++++--------------- 2 files changed, 17 insertions(+), 18 deletions(-) (limited to 'plugins/AddContactPlus/src') 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 #include -#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; } -- cgit v1.2.3