From 03758f8f918f392386a1dd7a1c7a795927f8c221 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 10 Mar 2013 11:51:00 +0000 Subject: - ME_TTB_INITBUTTONS event considered useless; - clist_modern & clist_nicer are trained to reload TTB buttons when TopToolBar plugin is loaded dynamically; - TTB processing code slightly reordered git-svn-id: http://svn.miranda-ng.org/main/trunk@3953 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TopToolBar/src/InternalButtons.cpp | 3 +-- plugins/TopToolBar/src/common.h | 14 +++++++------- plugins/TopToolBar/src/toolbar.cpp | 5 +---- plugins/TopToolBar/src/toolbarwnd.cpp | 5 +++-- plugins/TopToolBar/src/version.h | 2 +- 5 files changed, 13 insertions(+), 16 deletions(-) (limited to 'plugins/TopToolBar/src') diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp index 0662c540bf..eaf07853b6 100644 --- a/plugins/TopToolBar/src/InternalButtons.cpp +++ b/plugins/TopToolBar/src/InternalButtons.cpp @@ -79,7 +79,7 @@ INT_PTR TTBInternalSoundsOnOff(WPARAM wParam, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////// -int InitInternalButtons(WPARAM, LPARAM) +void InitInternalButtons() { hwndContactTree = (HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0); @@ -119,5 +119,4 @@ int InitInternalButtons(WPARAM, LPARAM) db_get_b(NULL, "Skin", "UseSound", 1) ? TTBST_RELEASED : TTBST_PUSHED); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnSettingChanging); - return 0; } diff --git a/plugins/TopToolBar/src/common.h b/plugins/TopToolBar/src/common.h index 0840111f2f..64e15fcad4 100644 --- a/plugins/TopToolBar/src/common.h +++ b/plugins/TopToolBar/src/common.h @@ -116,7 +116,7 @@ extern HBITMAP hBmpBackground, hBmpSeparator; extern CRITICAL_SECTION csButtonsHook; extern pfnCustomProc g_CustomProc; extern LPARAM g_CustomProcParam; -extern HANDLE hTTBModuleLoaded, hTTBInitButtons; +extern HANDLE hTTBModuleLoaded; void AddToOptions(TopButtonInt* b); void RemoveFromOptions(int id); @@ -138,14 +138,14 @@ TopButtonInt* idtopos(int id, int* pPos=NULL); INT_PTR TTBAddButton(WPARAM, LPARAM); INT_PTR TTBRemoveButton(WPARAM, LPARAM); -int InitInternalButtons(WPARAM, LPARAM); +void InitInternalButtons(void); -int LoadToolbarModule( void ); -int UnloadToolbarModule( void ); +int LoadToolbarModule(void); +int UnloadToolbarModule(void); -void SetAllBitmaps( void ); -int SaveAllLButs( void ); -int SaveAllButtonsOptions( void ); +void SetAllBitmaps(void); +int SaveAllLButs(void); +int SaveAllButtonsOptions(void); void InsertSeparator( int i ); void DeleteSeparator(int i); diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index 655117fc50..a0e5509ed8 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -13,7 +13,7 @@ HWND hwndContactList = 0; int nextButtonId = 200; -HANDLE hTTBModuleLoaded, hTTBInitButtons; +HANDLE hTTBModuleLoaded; static WNDPROC buttonWndProc; CRITICAL_SECTION csButtonsHook; @@ -677,8 +677,6 @@ int LoadToolbarModule() HookEvent(ME_OPT_INITIALISE, TTBOptInit); hTTBModuleLoaded = CreateHookableEvent(ME_TTB_MODULELOADED); - hTTBInitButtons = CreateHookableEvent(ME_TTB_INITBUTTONS); - SetHookDefaultForHookableEvent(hTTBInitButtons, InitInternalButtons); CreateServiceFunction("TopToolBar/AddButton", TTBAddButton); CreateServiceFunction(MS_TTB_REMOVEBUTTON, TTBRemoveButton); @@ -712,7 +710,6 @@ int LoadToolbarModule() int UnloadToolbarModule() { DestroyHookableEvent(hTTBModuleLoaded); - DestroyHookableEvent(hTTBInitButtons); DeleteObject(hBmpSeparator); DeleteCriticalSection(&csButtonsHook); diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index 99793040d4..9801ac5faa 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -279,6 +279,8 @@ INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam) // if we're working in skinned clist, receive the standard buttons & customizations if (g_CustomProc && g_ctrl->hWnd) g_CustomProc(TTB_WINDOW_HANDLE, g_ctrl->hWnd, g_CustomProcParam); + else + InitInternalButtons(); // if there's no customized frames, create our own if (g_ctrl->hFrame == NULL) { @@ -292,8 +294,7 @@ INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam) g_ctrl->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0); } - // receive all buttons - NotifyEventHooks(hTTBInitButtons, 0, 0); + // receive buttons NotifyEventHooks(hTTBModuleLoaded, 0, 0); return 0; diff --git a/plugins/TopToolBar/src/version.h b/plugins/TopToolBar/src/version.h index e9242d347d..f32fd595eb 100644 --- a/plugins/TopToolBar/src/version.h +++ b/plugins/TopToolBar/src/version.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define __MAJOR_VERSION 0 #define __MINOR_VERSION 8 #define __RELEASE_NUM 0 -#define __BUILD_NUM 2 +#define __BUILD_NUM 3 // other stuff for Version resource #define __STRINGIFY_IMPL(x) #x -- cgit v1.2.3