Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Possible bug in CXTPTabClientWnd
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Possible bug in CXTPTabClientWnd

 Post Reply Post Reply
Author
Message
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Topic: Possible bug in CXTPTabClientWnd
    Posted: 07 January 2007 at 5:08pm
I have little icons in my tabs, when i need to change them I call the .UpdateContents() method, but this only changes the text and not the icon.
 
If I click the tab then the tab is refreshed, but otherwise it isnt.
 
I added the following line (in bold) and it now works:

void CXTPTabClientWnd::UpdateContents()
...
    // update text if necessary
    pFoundItem->SetCaption(GetItemText(pChildWnd));
    pFoundItem->SetImageIndex( pFoundItem->GetImageIndex() );
 
Is this a bug, or is there something else I should do.
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2007 at 3:02am
Hello,
 
How you set icon?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2007 at 7:03am

By overriding GetItemIcon in my derived TabClientWnd .. basically to put in a ReadOnly icon into the tab instead of the file icon.

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2007 at 7:44am
Hi, Remove this change and just call Invalidate (or RecalcLayout)
 
from StyleView sample:
 
void CStylerView::SetLoading(BOOL bLoading)
{
 int nState = bLoading ? -1 : 3;
 if (m_nLoadingState != nState)
 {
  m_nLoadingState = nState;
  GetMainFrame()->m_MTIClientWnd.Invalidate(FALSE);
 }
}
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Posted: 08 January 2007 at 7:46am
But wont that cause all the tabs to flicker and redraw unnecessarily?
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.047 seconds.