diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-07 19:24:29 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-07 19:24:29 +0000 |
commit | 4c8d197c7259166c26e037f352f9cc801942308e (patch) | |
tree | 9563615d1fc46c5f62e892416d77aef0b4172680 /plugins/TopToolBar | |
parent | 3dfbb6741fe9e70bff6b70608cd7663742287a4a (diff) |
- removed unneeded hooks & services control;
- arrangedpos uniqueness
git-svn-id: http://svn.miranda-ng.org/main/trunk@824 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TopToolBar')
-rw-r--r-- | plugins/TopToolBar/InternalButtons.cpp | 8 | ||||
-rw-r--r-- | plugins/TopToolBar/common.h | 1 | ||||
-rw-r--r-- | plugins/TopToolBar/main.cpp | 8 | ||||
-rw-r--r-- | plugins/TopToolBar/toolbar.cpp | 26 | ||||
-rw-r--r-- | plugins/TopToolBar/topbutton.cpp | 5 | ||||
-rw-r--r-- | plugins/TopToolBar/ttbopt.cpp | 5 |
6 files changed, 24 insertions, 29 deletions
diff --git a/plugins/TopToolBar/InternalButtons.cpp b/plugins/TopToolBar/InternalButtons.cpp index 08c8f09802..2a79cd566f 100644 --- a/plugins/TopToolBar/InternalButtons.cpp +++ b/plugins/TopToolBar/InternalButtons.cpp @@ -91,10 +91,10 @@ int UnLoadInternalButtons() int LoadInternalButtons(HWND hwnd)
{
hwndContactTree = hwnd;
- arServices.insert( CreateServiceFunction(TTBI_GROUPSHOWHIDE, TTBInternalGroupShowHide));
- arServices.insert( CreateServiceFunction(TTBI_SOUNDSONOFF, TTBInternalSoundsOnOff));
+ CreateServiceFunction(TTBI_GROUPSHOWHIDE, TTBInternalGroupShowHide);
+ CreateServiceFunction(TTBI_SOUNDSONOFF, TTBInternalSoundsOnOff);
- arServices.insert( CreateServiceFunction(TTBI_MAINMENUBUTT, TTBInternalMainMenuButt));
+ CreateServiceFunction(TTBI_MAINMENUBUTT, TTBInternalMainMenuButt);
int ShowOnline = DBGetContactSettingByte(NULL, "CList", "HideOffline", 0);
int ShowGroups = DBGetContactSettingByte(NULL, "CList", "UseGroups", 2);
@@ -169,7 +169,7 @@ int LoadInternalButtons(HWND hwnd) CallService(MS_TTB_SETBUTTONOPTIONS, MAKEWPARAM(TTBO_TIPNAME, hMainMenuBut),
(LPARAM)"Show Main Menu");
- arHooks.insert(HookEvent(ME_DB_CONTACT_SETTINGCHANGED,OnSettingChanging));
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED,OnSettingChanging);
return 0;
}
diff --git a/plugins/TopToolBar/common.h b/plugins/TopToolBar/common.h index ea577b4c74..432879c57f 100644 --- a/plugins/TopToolBar/common.h +++ b/plugins/TopToolBar/common.h @@ -104,7 +104,6 @@ extern bool StopArrange; extern HWND hwndTopToolBar;
extern HANDLE hHookTTBModuleLoaded;
extern HINSTANCE hInst;
-extern LIST<void> arHooks, arServices;
extern HBITMAP hBmpBackground, hBmpSeparator;
extern int BUTTWIDTH, BUTTHEIGHT, BUTTGAP;
extern CRITICAL_SECTION csButtonsHook;
diff --git a/plugins/TopToolBar/main.cpp b/plugins/TopToolBar/main.cpp index 2bd283bcfc..7eb6c653f2 100644 --- a/plugins/TopToolBar/main.cpp +++ b/plugins/TopToolBar/main.cpp @@ -7,8 +7,6 @@ HINSTANCE hInst; HANDLE hHookTTBModuleLoaded;
int hLangpack;
-LIST<void> arHooks(10), arServices(10);
-
#define MIID_TTB {0xf593c752, 0x51d8, 0x4d46, {0xba, 0x27, 0x37, 0x57, 0x79, 0x53, 0xf5, 0x5c}}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
@@ -58,12 +56,6 @@ extern "C" int __declspec(dllexport) Unload(void) UnLoadInternalButtons();
UnloadToolbarModule();
- for (int i=0; i < arHooks.getCount(); i++ )
- UnhookEvent( arHooks[i] );
-
- for (int j=0; j < arServices.getCount(); j++ )
- DestroyServiceFunction( arServices[j] );
-
DestroyHookableEvent(hHookTTBModuleLoaded);
return 0;
}
diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp index 238558439b..f2e9932738 100644 --- a/plugins/TopToolBar/toolbar.cpp +++ b/plugins/TopToolBar/toolbar.cpp @@ -658,7 +658,7 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara hwndTopToolBar = hwnd;
return FALSE;
- case WM_MOVE:
+ case WM_MOVE:
return 0;
case WM_WINDOWPOSCHANGING:
@@ -799,7 +799,7 @@ int OnModulesLoad(WPARAM wParam, LPARAM lParam) char buf[256];
sprintf(buf, "TopToolBar Background/%s", TTB_OPTDIR);
CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)buf, 0);
- arHooks.insert( HookEvent(ME_BACKGROUNDCONFIG_CHANGED, OnBGChange));
+ HookEvent(ME_BACKGROUNDCONFIG_CHANGED, OnBGChange);
}
ttbOptionsChanged();
@@ -814,22 +814,22 @@ int LoadToolbarModule() StopArrange = TRUE;
hBmpSeparator = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_SEP));
- arHooks.insert( HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoad));
- arHooks.insert( HookEvent(ME_SKIN2_ICONSCHANGED, OnIconChange));
- arHooks.insert( HookEvent(ME_OPT_INITIALISE, TTBOptInit));
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoad);
+ HookEvent(ME_SKIN2_ICONSCHANGED, OnIconChange);
+ HookEvent(ME_OPT_INITIALISE, TTBOptInit);
- arServices.insert( CreateServiceFunction(MS_TTB_ADDBUTTON, TTBAddButton));
- arServices.insert( CreateServiceFunction(MS_TTB_REMOVEBUTTON, TTBRemoveButton));
+ CreateServiceFunction(MS_TTB_ADDBUTTON, TTBAddButton);
+ CreateServiceFunction(MS_TTB_REMOVEBUTTON, TTBRemoveButton);
- arServices.insert( CreateServiceFunction(MS_TTB_SETBUTTONSTATE, TTBSetState));
- arServices.insert( CreateServiceFunction(MS_TTB_GETBUTTONSTATE, TTBGetState));
+ CreateServiceFunction(MS_TTB_SETBUTTONSTATE, TTBSetState);
+ CreateServiceFunction(MS_TTB_GETBUTTONSTATE, TTBGetState);
- arServices.insert( CreateServiceFunction(MS_TTB_GETBUTTONOPTIONS, TTBGetOptions));
- arServices.insert( CreateServiceFunction(MS_TTB_SETBUTTONOPTIONS, TTBSetOptions));
+ CreateServiceFunction(MS_TTB_GETBUTTONOPTIONS, TTBGetOptions);
+ CreateServiceFunction(MS_TTB_SETBUTTONOPTIONS, TTBSetOptions);
- arServices.insert( CreateServiceFunction(TTB_LAUNCHSERVICE, LaunchService));
+ CreateServiceFunction(TTB_LAUNCHSERVICE, LaunchService);
- arServices.insert( CreateServiceFunction("TTB_ONSTARTUPFIRE", OnEventFire));
+ CreateServiceFunction("TTB_ONSTARTUPFIRE", OnEventFire);
BUTTHEIGHT = DBGetContactSettingByte(0, TTB_OPTDIR, "BUTTHEIGHT", DEFBUTTHEIGHT);
BUTTWIDTH = DBGetContactSettingByte(0, TTB_OPTDIR, "BUTTWIDTH", DEFBUTTWIDTH);
diff --git a/plugins/TopToolBar/topbutton.cpp b/plugins/TopToolBar/topbutton.cpp index 88d4128c0e..952140da95 100644 --- a/plugins/TopToolBar/topbutton.cpp +++ b/plugins/TopToolBar/topbutton.cpp @@ -3,6 +3,8 @@ #define BitChanged(c) (dwFlags ^ Flags) & c
+static int maxid = 10000;
+
TopButtonInt::~TopButtonInt()
{
if (dwFlags & TTBBF_ISLBUTTON) {
@@ -105,6 +107,9 @@ void TopButtonInt::LoadSettings() if ( DBGetContactSettingByte(0, TTB_OPTDIR, AS(buf, name, "_Visible"), oldv) > 0 )
dwFlags |= TTBBF_VISIBLE;
}
+
+ if (Buttons.getIndex(this) != -1)
+ arrangedpos = maxid++;
}
void TopButtonInt::SaveSettings(int *SepCnt, int *LaunchCnt)
diff --git a/plugins/TopToolBar/ttbopt.cpp b/plugins/TopToolBar/ttbopt.cpp index 84f719662e..c377868477 100644 --- a/plugins/TopToolBar/ttbopt.cpp +++ b/plugins/TopToolBar/ttbopt.cpp @@ -643,7 +643,7 @@ int TTBOptInit(WPARAM wParam, LPARAM lParam) if ( !ServiceExists(MS_BACKGROUNDCONFIG_REGISTER)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TTBBKG);
- odp.pszTitle = LPGEN("TTBBackground");
+ odp.pszTitle = LPGEN("Background");
odp.pfnDlgProc = DlgProcTTBBkgOpts;
odp.flags = ODPF_BOLDGROUPS;
Options_AddPage(wParam, &odp);
@@ -651,10 +651,9 @@ int TTBOptInit(WPARAM wParam, LPARAM lParam) odp.position = -1000000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_BUTORDER);
- odp.pszGroup = LPGEN("TopToolBar");
odp.pszTitle = LPGEN("Buttons");
odp.pfnDlgProc = ButOrderOpts;
- odp.flags = ODPF_BOLDGROUPS|ODPF_EXPERTONLY;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_EXPERTONLY;
Options_AddPage(wParam, &odp);
return 0;
}
|