Toolbars in rebar control problems (win32 api)
Well I have been at it for some time, searched the newsgroups and all, but in the end found nothing.
I create my toolbars with this call:
g_hwndTB[j] = CreateWindowEx(0, TOOLBARCLASSNAME, (LPSTR) NULL,
TBSTYLE_TOOLTIPS | TBSTYLE_FLAT | CCS_NODIVIDER, 0, 0, 0, 0, hwndParent, 0, g_hInst, NULL);
j is the specific toolbar, this is a loop creating each toolbar in sucession. I add the bitmaps, the buttons, etc. Then I create the rebar:
HWND hwndRb = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, (LPSTR) NULL, RBS_VARHEIGHT |
RBS_AUTOSIZE | RBS_BANDBORDERS | RBS_DBLCLKTOGGLE | RBS_REGISTERDROP | RBS_VARHEIGHT | CCS_NODIVIDER | CCS_NOPARENTALIGN | RBS_VERTICALGRIPPER | WS_BORDER | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, 0, 0, 0, 0, hwndParent, 0, g_hInst, NULL);
After this I insert the bands as follows:
REBARBANDINFO rbbi;
rbbi.cbSize = sizeof(REBARBANDINFO);
rbbi.fMask = RBBIM_COLORS | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_STYLE | RBBIM_ID | RBBIM_SIZE;
rbbi.clrFore = GetSysColor(COLOR_BTNTEXT);
rbbi.clrBack = GetSysColor(COLOR_BTNFACE);
rbbi.fStyle = RBBS_NOVERT | RBBS_CHILDEDGE ;
for(int i=0; i, TB_GETBUTTONSIZE, 0, 0);
rbbi.wID = i;
rbbi.hwndChild = g_hwndTB;
rbbi.cx = LOWORD(dwBtnSize)*SendMessage(g_hwndTB, TB_BUTTONCOUNT, 0, 0);
rbbi.cxMinChild = LOWORD(dwBtnSize) * SendMessage(g_hwndTB, TB_BUTTONCOUNT, 0, 0);
rbbi.cyMinChild = HIWORD(dwBtnSize) + 2;
// Insert band into rebar
SendMessage(hwndRb, RB_INSERTBAND, i, (LPARAM) (LPREBARBANDINFO) &rbbi);
}
The toolbars are sending WM_COMMAND messages as they are supposed to, and everything ''seems'' to be working correctly. I can drag them, change the size, etc, but the problem is the focus.
In this picture:
http://venturello.com/files/5.gif
You can see how the toolbars are grayed out. They are active, if I click on them the specific toolbar gains focus and the parent window looses it, as you can see here:
http://venturello.com/files/6.gif
Hope someone can help me. Thanks!!
pd. I have tried setting the toolbars parent the rebar control. This does not help.
</i>
try using just 1 toobar in rebar and not all toolbars...is it the same?, try using toolbar that is not tbstyle_flat....what happnz?
Edited by - ^cyer on May 18, 2001 7:18:42 PM
Edited by - ^cyer on May 18, 2001 7:18:42 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement