# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1349727670 0 # Node ID c110191e37752c2ddea23dc92fa011c8b4aa0bd0 # Parent 5efaea897310d6e5a4e3084d9c6577bc84dc5059 Added tab handling to the toolbar control on Windows... Fixing tab handling for bitmap buttons after the control change in 2.4. diff -r 5efaea897310 -r c110191e3775 win/dw.c --- a/win/dw.c Mon Oct 08 19:32:45 2012 +0000 +++ b/win/dw.c Mon Oct 08 20:21:10 2012 +0000 @@ -917,6 +917,9 @@ */ if(_tcsnicmp(tmpbuf, EDITCLASSNAME, _tcslen(EDITCLASSNAME)+1)==0 || /* Entryfield */ _tcsnicmp(tmpbuf, BUTTONCLASSNAME, _tcslen(BUTTONCLASSNAME)+1)==0 || /* Button */ +#ifdef TOOLBAR + _tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0 || /* Toolbar */ +#endif _tcsnicmp(tmpbuf, COMBOBOXCLASSNAME, _tcslen(COMBOBOXCLASSNAME)+1)==0 || /* Combobox */ _tcsnicmp(tmpbuf, LISTBOXCLASSNAME, _tcslen(LISTBOXCLASSNAME)+1)==0 || /* List box */ _tcsnicmp(tmpbuf, UPDOWN_CLASS, _tcslen(UPDOWN_CLASS)+1)==0 || /* Spinbutton */ @@ -2730,7 +2733,11 @@ /* These are the window classes which can * obtain input focus. */ - if (_tcsnicmp(tmpbuf, BUTTONCLASSNAME, _tcslen(BUTTONCLASSNAME)+1)==0) + if (_tcsnicmp(tmpbuf, BUTTONCLASSNAME, _tcslen(BUTTONCLASSNAME)+1)==0 +#ifdef TOOLBAR + || _tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0 +#endif + ) { /* Generate click on default item */ SignalHandler *tmp = Root; @@ -3146,7 +3153,7 @@ return CallWindowProc(continfo->cinfo.pOldProc, hWnd, msg, mp1, mp2); } -LRESULT CALLBACK _treewndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2) +LRESULT CALLBACK _simplewndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2) { ContainerInfo *cinfo; LRESULT ret = -1; @@ -5940,7 +5947,7 @@ return NULL; } - cinfo->cinfo.pOldProc = SubclassWindow(tmp, _treewndproc); + cinfo->cinfo.pOldProc = SubclassWindow(tmp, _simplewndproc); cinfo->cinfo.fore = cinfo->cinfo.back = -1; cinfo->odd = cinfo->even = DW_RGB_TRANSPARENT; @@ -6056,7 +6063,7 @@ return NULL; } - cinfo->cinfo.pOldProc = SubclassWindow(tmp, _treewndproc); + cinfo->cinfo.pOldProc = SubclassWindow(tmp, _simplewndproc); cinfo->cinfo.fore = cinfo->cinfo.back = -1; cinfo->odd = cinfo->even = DW_RGB_TRANSPARENT; @@ -6307,6 +6314,7 @@ if(tmp = _create_toolbar(text, id, icon, hbitmap)) { cinfo->fore = cinfo->back = -1; + cinfo->pOldProc = SubclassWindow(tmp, _simplewndproc); SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo); return tmp; } @@ -6377,6 +6385,7 @@ if(tmp = _create_toolbar(text, id, hicon, hbitmap)) { cinfo->fore = cinfo->back = -1; + cinfo->pOldProc = SubclassWindow(tmp, _simplewndproc); SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo); return tmp; } @@ -6467,6 +6476,7 @@ if(tmp = _create_toolbar(text, id, hicon, hbitmap)) { cinfo->fore = cinfo->back = -1; + cinfo->pOldProc = SubclassWindow(tmp, _simplewndproc); SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo); return tmp; }