diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-09 17:53:15 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-09 17:53:15 +0000 |
commit | cee90240b1301ad373e98fe874a924fcdbb83447 (patch) | |
tree | 2a289365c84efbfd0c27eca4663294b04737d2f1 /plugins/TopToolBar | |
parent | 132e74c3f3f5a31558b6b50be7be70e7bc283804 (diff) |
- fix for button states errors in Clist Modern;
- fix for message handling duplicates;
- fix for naming toolbar icons;
- removed duplicate icon entry in dbeditor++
git-svn-id: http://svn.miranda-ng.org/main/trunk@884 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TopToolBar')
-rw-r--r-- | plugins/TopToolBar/toolbar.cpp | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp index 81772f9ae4..6f090dcc0d 100644 --- a/plugins/TopToolBar/toolbar.cpp +++ b/plugins/TopToolBar/toolbar.cpp @@ -263,23 +263,20 @@ TopButtonInt* CreateButton(TTBButton* but) b->name = NULL;
if (b->dwFlags & TTBBF_ICONBYHANDLE) {
- if (but->hIconHandleDn)
- b->hIconDn = Skin_GetIconByHandle(but->hIconHandleDn);
+ b->hIconUp = Skin_GetIconByHandle(b->hIconHandleUp = but->hIconHandleUp);
+ if (but->hIconHandleDn)
+ b->hIconDn = Skin_GetIconByHandle(b->hIconHandleDn = but->hIconHandleDn);
else
- b->hIconDn = 0;
- b->hIconUp = Skin_GetIconByHandle(but->hIconHandleUp);
+ b->hIconDn = 0, b->hIconHandleDn = 0;
}
else {
- b->hIconDn = but->hIconDn;
- b->hIconUp = but->hIconUp;
- }
-
- char buf[256];
- sprintf(buf, "%s_up", b->name);
- b->hIconUp = LoadIconFromLibrary(buf, b->hIconUp, b->hIconHandleUp);
- if (b->hIconDn) {
- sprintf(buf, "%s_dn", b->name);
- b->hIconDn = LoadIconFromLibrary(buf, b->hIconDn, b->hIconHandleDn);
+ char buf[256];
+ mir_snprintf(buf, SIZEOF(buf), (b->hIconDn) ? "%s_up" : "%s", b->name);
+ b->hIconUp = LoadIconFromLibrary(buf, but->hIconUp, b->hIconHandleUp);
+ if (b->hIconDn) {
+ mir_snprintf(buf, SIZEOF(buf), "%s_dn", b->name);
+ b->hIconDn = LoadIconFromLibrary(buf, but->hIconDn, b->hIconHandleDn);
+ }
}
if (but->cbSize > OLD_TBBUTTON_SIZE) {
@@ -696,8 +693,8 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara case WM_COMMAND:
switch (HIWORD(wParam)) {
- case STN_CLICKED:
- case STN_DBLCLK:
+ case BN_CLICKED:
+ case BN_DOUBLECLICKED:
{
int id = GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
if (id != 0) {
@@ -706,21 +703,15 @@ LRESULT CALLBACK TopToolBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara if (b == NULL || b->isSep())
return 0;
- // flag inversion inside condition coz we uses Up -> Down for non-push buttons
- // condition and inversion can be moved to main condition end
- if (b->bPushed) { //Dn -> Up
-
- if (b->dwFlags & TTBBF_ASPUSHBUTTON)
- b->bPushed = !b->bPushed;
+ if (b->dwFlags & TTBBF_ASPUSHBUTTON)
+ b->bPushed = !b->bPushed;
+ if (b->bPushed) { //Dn -> Up
if (!(b->dwFlags & TTBBF_ISLBUTTON)) // must be always true
if (b->pszService != NULL)
CallService(b->pszService, b->wParamUp, b->lParamUp);
}
else { //Up -> Dn
- if (b->dwFlags & TTBBF_ASPUSHBUTTON)
- b->bPushed = !b->bPushed;
-
if (b->pszService != NULL)
CallService(b->pszService, b->wParamDown, b->lParamDown);
}
|