diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-10 20:50:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-10 20:50:42 +0000 |
commit | a1c684f50ed38ef5200c9b8f7537da7fd33a2e22 (patch) | |
tree | 151a86d82f6dbcbee8476df07661b6a5670a19d9 | |
parent | 2850a08595f1bc86384d230a85de29ac794f97ef (diff) |
almost destroyed all toolbar-related perversions
git-svn-id: http://svn.miranda-ng.org/main/trunk@895 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Clist_modern/modern_toolbar.cpp | 12 | ||||
-rw-r--r-- | plugins/TopToolBar/toolbar.cpp | 40 |
2 files changed, 32 insertions, 20 deletions
diff --git a/plugins/Clist_modern/modern_toolbar.cpp b/plugins/Clist_modern/modern_toolbar.cpp index f62aa8dcb3..079946d9bf 100644 --- a/plugins/Clist_modern/modern_toolbar.cpp +++ b/plugins/Clist_modern/modern_toolbar.cpp @@ -291,9 +291,19 @@ void CustomizeToolbar(HWND hwnd) TTBCtrlCustomize custData = { sizeof(ModernToolbarCtrl), toolbarWndProc };
SendMessage(hwnd, TTB_SETCUSTOM, 0, (LPARAM)&custData);
+ ModernToolbarCtrl* pMTBInfo = (ModernToolbarCtrl*)GetWindowLongPtr(hwnd, 0);
+
+ CLISTFrame Frame = { 0 };
+ Frame.cbSize = sizeof(Frame);
+ Frame.tname = _T("Toolbar");
+ Frame.hWnd = hwnd;
+ Frame.align = alTop;
+ Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_TCHAR | F_NO_SUBCONTAINER;
+ Frame.height = 18;
+ pMTBInfo->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+
CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)hwnd,(LPARAM)ToolBar_LayeredPaintProc);
- ModernToolbarCtrl* pMTBInfo = (ModernToolbarCtrl*)GetWindowLongPtr(hwnd, 0);
pMTBInfo->nLineCount = 1;
pMTBInfo->mtbXPTheme = xpt_AddThemeHandle(hwnd, L"TOOLBAR");
}
diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp index 45add6f4f7..02338c69b7 100644 --- a/plugins/TopToolBar/toolbar.cpp +++ b/plugins/TopToolBar/toolbar.cpp @@ -649,24 +649,6 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara switch(msg) {
case WM_CREATE:
g_ctrl->hWnd = hwnd;
-
- // 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);
- {
- CLISTFrame Frame = { 0 };
- Frame.cbSize = sizeof(Frame);
- Frame.tname = _T("Toolbar");
- Frame.hWnd = hwnd;
- Frame.align = alTop;
- Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_TCHAR | F_NO_SUBCONTAINER;
- Frame.height = 18;
- g_ctrl->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
- }
-
- // receive all buttons
- NotifyEventHooks(hTTBInitButtons, 0, 0);
- NotifyEventHooks(hTTBModuleLoaded, 0, 0);
return FALSE;
case WM_MOVE:
@@ -762,11 +744,31 @@ static INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam) RegisterClass(&wndclass);
g_ctrl->pButtonList = (SortedList*)&Buttons;
- g_ctrl->hWnd = CreateWindow(pluginname, pluginname,
+ g_ctrl->hWnd = CreateWindow(pluginname, _T("Toolbar"),
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
0, 0, 0, 0, parent, NULL, hInst, NULL);
SetWindowLongPtr(g_ctrl->hWnd, 0, (LPARAM)g_ctrl);
+ // 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);
+
+ // if there's no customized frames, create our own
+ if (g_ctrl->hFrame == NULL) {
+ CLISTFrame Frame = { 0 };
+ Frame.cbSize = sizeof(Frame);
+ Frame.tname = _T("Toolbar");
+ Frame.hWnd = g_ctrl->hWnd;
+ Frame.align = alTop;
+ Frame.Flags = F_VISIBLE | F_NOBORDER | F_LOCKED | F_TCHAR;
+ Frame.height = 18;
+ g_ctrl->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
+ }
+
+ // receive all buttons
+ NotifyEventHooks(hTTBInitButtons, 0, 0);
+ NotifyEventHooks(hTTBModuleLoaded, 0, 0);
+
ttbOptionsChanged();
bEventFired = true;
|