diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-09 09:02:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-09 09:02:16 +0000 |
commit | 6d10b27399e46e952ded3d5a8bc4645ccffb2c34 (patch) | |
tree | fc245f64fc5b4da747fa85d588cc10ce525504c2 /plugins/TopToolBar/topbutton.cpp | |
parent | 4ce494e510feaaabc64ac4630645874ddd95203d (diff) |
- customizeable TopToolbar
- restored Clist Modern toolbar painter
git-svn-id: http://svn.miranda-ng.org/main/trunk@876 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TopToolBar/topbutton.cpp')
-rw-r--r-- | plugins/TopToolBar/topbutton.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/plugins/TopToolBar/topbutton.cpp b/plugins/TopToolBar/topbutton.cpp index 651686feea..9a1cbe0200 100644 --- a/plugins/TopToolBar/topbutton.cpp +++ b/plugins/TopToolBar/topbutton.cpp @@ -23,25 +23,25 @@ TopButtonInt::~TopButtonInt() DWORD TopButtonInt::CheckFlags(DWORD Flags)
{
int res = 0;
- if (BitChanged(TTBBF_DISABLED)) {
- dwFlags^=TTBBF_DISABLED;
+ if ( BitChanged(TTBBF_DISABLED)) {
+ dwFlags ^= TTBBF_DISABLED;
EnableWindow(hwnd,(dwFlags & TTBBF_DISABLED)?FALSE:TRUE);
}
- if (BitChanged(TTBBF_ASPUSHBUTTON)) {
+ if ( BitChanged(TTBBF_ASPUSHBUTTON)) {
dwFlags ^= TTBBF_ASPUSHBUTTON;
SendMessage(hwnd, BUTTONSETASPUSHBTN, (dwFlags & TTBBF_ASPUSHBUTTON)?1:0, 0);
}
- if (BitChanged(TTBBF_SHOWTOOLTIP)) {
+ if ( BitChanged(TTBBF_SHOWTOOLTIP)) {
dwFlags ^= TTBBF_SHOWTOOLTIP;
SendMessage(hwnd,BUTTONADDTOOLTIP,
(WPARAM)((dwFlags & TTBBF_SHOWTOOLTIP)?tooltip:L""),BATF_UNICODE);
}
// next settings changing visual side, requires additional actions
- if (BitChanged(TTBBF_VISIBLE)) {
+ if ( BitChanged(TTBBF_VISIBLE)) {
dwFlags ^= TTBBF_VISIBLE;
res |= TTBBF_VISIBLE;
}
- if (BitChanged(TTBBF_PUSHED)) {
+ if ( BitChanged(TTBBF_PUSHED)) {
dwFlags ^= TTBBF_PUSHED;
res |= TTBBF_PUSHED;
bPushed = (dwFlags & TTBBF_PUSHED) ? TRUE : FALSE;
@@ -52,7 +52,10 @@ DWORD TopButtonInt::CheckFlags(DWORD Flags) void TopButtonInt::CreateWnd()
{
if ( !(dwFlags & TTBBF_ISSEPARATOR)) {
- hwnd = CreateWindow(MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON|WS_CHILD|WS_TABSTOP|SS_NOTIFY, 0, 0, BUTTWIDTH, BUTTHEIGHT, hwndTopToolBar, NULL, hInst, 0);
+ hwnd = CreateWindow(MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON|WS_CHILD|WS_TABSTOP|SS_NOTIFY, 0, 0, g_ctrl->nButtonWidth, g_ctrl->nButtonHeight, g_ctrl->hWnd, NULL, hInst, 0);
+
+ if (g_CustomProc)
+ g_CustomProc((HANDLE)id, hwnd, g_CustomProcParam);
if (dwFlags & TTBBF_ASPUSHBUTTON)
SendMessage(hwnd, BUTTONSETASPUSHBTN, 1, 0);
@@ -60,11 +63,11 @@ void TopButtonInt::CreateWnd() if (DBGetContactSettingByte(0, TTB_OPTDIR, "UseFlatButton", 1))
SendMessage(hwnd, BUTTONSETASFLATBTN, TRUE, 0);
- EnableWindow(hwnd,(dwFlags & TTBBF_DISABLED)?FALSE:TRUE);
+ EnableWindow(hwnd,(dwFlags & TTBBF_DISABLED)?FALSE:TRUE);
}
- // maybe SEPWIDTH, not BUTTWIDTH?
+ // maybe SEPWIDTH, not g_ctrl->nButtonWidth?
else
- hwnd = CreateWindow( _T("STATIC"), _T(""), WS_CHILD|SS_NOTIFY, 0, 0, BUTTWIDTH, BUTTHEIGHT, hwndTopToolBar, NULL, hInst, 0);
+ hwnd = CreateWindow( _T("STATIC"), _T(""), WS_CHILD|SS_NOTIFY, 0, 0, g_ctrl->nButtonWidth, g_ctrl->nButtonHeight, g_ctrl->hWnd, NULL, hInst, 0);
SetWindowLongPtr(hwnd, GWLP_USERDATA, id);
SetBitmap();
|