Originally Posted by
novacain
I understand, not the way I used to do it, I used a individual dialog for each TAB (when they were as complex as yours).
Since I'm still new to Win32, could you spell this out a little more for me? At the moment, each tab has a static control on its visual space. All of the controls on a given tab are a child of that static control. That parent static control is also used to swap out the main window's wndproc for a different wndproc specifically to handle all of the controls on that specific tab.
Did you mean something different than this?
And is there a better way to handle this setup than to have everything on a tab childed from a static control representing that tab?
Originally Posted by
novacain
My memory says static controls do not get / generate all WIN32 messages so may not work, but I am not 100% if this is an issue (not having tested it).
Maybe that's why my tabstops don't work.
My message loop looks like this:
Code:
while(GetMessage(&msg, NULL, 0, 0) > 0)
{
if((!hDlgCurrent) || (!IsDialogMessage(hDlgCurrent, &msg)))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
The main wndproc and each tab's wndproc look like this:
Code:
switch(msg)
{
//...
case WM_ACTIVATE:
if(wParam == 0)
hDlgCurrent = NULL;
else
hDlgCurrent = hwnd;
break; //or "return false" too;
//...
But the tabbing doesn't seem to work. Regardless of which control on a tab has focus, pressing the tab key makes the focus jump to the actual little tab item near the top of the interface.
In the message loop, if I swap out the first parameter of IsDialogMessage from hDlgCurrent to the name of the main static control for a particular tab (say, hTabGenerals), then tabbing works (although obviously only for that specific tab). Clearly, this won't fly because then only one tab's viewspace could ever have tabbing work.
From my understanding, I believe the point of the above code was to create exactly this functionality, but to work regardless of which tab is currently active. I think I'm obviously missing something somewhere or I misunderstood what I read.
Originally Posted by
novacain
Sound like you need to set a control as the default, but nothing wrong with manually setting focus (IMO).
Ok, it sounded ghetto to me at first, but that's purely from lack of knowledge and experience. So I'll just go with manual-focus on tab-selection-change part.