Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTTabCtrl bugs
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTTabCtrl bugs

 Post Reply Post Reply
Author
Message
Karnize View Drop Down
Newbie
Newbie
Avatar

Joined: 20 October 2003
Location: Italy
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karnize Quote  Post ReplyReply Direct Link To This Post Topic: CXTTabCtrl bugs
    Posted: 21 October 2003 at 2:33am

Hello,

I use the CXTTabCtrl (from the last 8.51 release, but the same problems are in all XtremeToolkit versions) with multiline and XP styles and found some bugs.

Tabs located at the top of the window, I do not test this control with vertical or bottom tabs.

First of all, then you enable multiline and XP styles and tabs wraps to multiline, there is tabs drawing bug. Inactive tabs background drawing correctly only at first line and active tab elements also drawed at first line (but active tab always located at the most bottom line).

In OnDrawTop function I found what you calculate

int iBottom = rcClient.top + rcItem.Height();

and after that you use iBottom in all active tab drawing, but reClient.top == 0 in case of top docked tabs and rcItem.Height() returns height of ONE tab, but active tab located not at first row.

For the background you also use

m_pTabCtrl->GetItemRect(-1, &rcHeight);
 rcClient.bottom = rcHeight.bottom;
 pDC->FillSolidRect(rcClient, xtAfxData.clrXPTabInactiveBack);

but GetItemRect returns rect also of one item, so you fill the background only at first row.

 

The next bug is in calculating space which tabs take up while resizing window. Then you resize you window so all tabs are located at single line and after that resize the window back, so tabs are wrap several lines, you will see what active tab content still drawed in old size and cover all tabs in bottom lines.

I found this in your code:

void CXTTabCtrl::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
{
 OnWindowPosChangedImpl_Pre(lpwndpos);
 CTabCtrl::OnWindowPosChanged(lpwndpos);
 OnWindowPosChangedImpl_Post(lpwndpos);
}

In OnWindowPosChangedImpl_Pre you recalculate size of all views located at tabs, but at this step tab control still think what all tabs located at single line and only in CTabCtrl::OnWindowPosChanged it knows what tabs should be wraped to multiline. So the size of all views is calculated wrong. I solve this problem in my derived class in this way:

void CXTTabCtrl::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos)
{

 CTabCtrl::OnWindowPosChanged(lpwndpos);
 OnWindowPosChangedImpl_Pre(lpwndpos);
 OnWindowPosChangedImpl_Post(lpwndpos);
}

All  these bugs you can repeat if you run your TabCtrl example. But you should disable "Draw window content while resizing" in Windows to see the second bug.



Edited by Karnize
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.