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

CXTPTabControl questions

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

Joined: 23 August 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote SergeyS Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTabControl questions
    Posted: 23 August 2006 at 2:11pm

When I use CXTPTabControl inside of another CXTPTabControl in a themed application headers background does not look good. It's not themed. (See attachment). Is there any standard way to avoid this?

To fix this I use CXTPWinThemeWrapper::DrawThemeParentBackground and it works well, but only if I don't use skins. After loading a skin CXTPSkinManagerApiHook::OnHookGetProcAddress cannot find DrawThemeParentBackground. I tested several other methods from UXTHEME.DLL and CXTPSkinManagerApiHook::OnHookGetProcAddress could not find any of them. (Those methods are not hooked in CXTPSkinManagerApiHook::InitializeHookManagement).

Any thoughts on this?

 

Another question:

CXTPTabControl::InsertItem has this code:

            if (nItem == 0)

            {

                        SetCurSel(0);

            }

It does not work well if I want to just insert a new tab at 0 position into existing control with another tab selected. Wouldn't it be better to check whether the control is empty or not? I had to override it because of that.

 
I don’t have 10.3 yet so I don't if any of that was changed.


Thank you,

Sergey



uploads/20060823_140813_CXTPTabControl.rar
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: 23 August 2006 at 3:00pm
1. Unfortnatelly SkinFramework don't support DrawThemeParentBackground, please try instead use standard WM_CTLCOLORSTATIC message:
 
 HBRUSH hBrush = (HBRUSH)GetParent()->SendMessage(WM_CTLCOLORSTATIC, (WPARAM)memDC.GetSafeHdc(), (LPARAM)m_hWnd);
 if (hBrush)
 {
  ::FillRect(memDC.GetSafeHdc(), rc, hBrush);
 }
 else
 {
  memDC.FillSolidRect(rc, GetXtremeColor(COLOR_3DFACE));
 }
 
2. Thanks good idea. We changed it to:
 
if (nItem == 0 && m_pSelected == NULL)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.032 seconds.