Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Problem with ComboBox child window
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with ComboBox child window

 Post Reply Post Reply
Author
Message
upeters View Drop Down
Groupie
Groupie


Joined: 31 May 2007
Location: Brazil
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote upeters Quote  Post ReplyReply Direct Link To This Post Topic: Problem with ComboBox child window
    Posted: 10 July 2008 at 2:35pm
Hello,

I am developing a plugin for a third-party application, which is among other things adding the possibility to skin the application window.

I am able to use the ActiveX correctly (it skins the scrollbar of dropdown window of the ComboBox as expected), but the MFC version refuses to skin the scrollbar of the child window, keeping the current Windows skin. Normal child windows (like a MessageBox) are skinned correctly.

Here is an excerpt of the program, showing how I activate the SkinFramework.

union uMyUnion {
    long unsigned uValue;
    HWND hWnd;
};
(...)
if (XTPSkinManager()->LoadSkin(_T(szTheme), _T(szIniFile)) != TRUE) {
    // failure, abort here
    nLastError = 12001;
    lua_pushnumber(L, (double)1);
}
else {
    // apply skin
    u.uValue = (long unsigned)dParameter;
    XTPSkinManager()->SetApplyOptions(XTPSkinManager()->GetApplyOptions() | xtpSkinApplyFrame | xtpSkinApplyColors | xtpSkinApplyMetrics);
    XTPSkinManager()->ApplyWindow(u.hWnd);
    lua_pushnumber(L, (double)0);
}

Here is a picture showing the result, note that the scrollbar is not correctly skinned:



Could somebody show me what I am missing? Thank you in advance.

Ulrich
Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2008 at 3:05pm
I think the combo box drop-down is not actually a child of the window, so it won't be skinned unless you're skinning all new windows.

  XTPSkinManager()->SetAutoApplyNewWindows(TRUE);
  XTPSkinManager()->SetAutoApplyNewThreads(TRUE);


Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)

Platform: Windows 200x/XP/Vista/Win7 (32/64 bit)

Language: Visual C++ 9.0 (Studio 2008)

Back to Top
upeters View Drop Down
Groupie
Groupie


Joined: 31 May 2007
Location: Brazil
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote upeters Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2008 at 3:24pm
Hello, thank you for your post.

I tried that in the past (and once more right now just to make sure), but it didn't seem to make any difference. A pop-up message box is skinned correctly, so it seems that I am indeed skinning child windows - just not that one.
The strange thing is that when I use the OCX and perform the same steps
SkinFramework:LoadSkin(".\\AutoPlay\\Docs\\VistaVGBlue.cjstyles","");

SkinFramework:ApplyWindow(Application.GetWndHandle());
it works normally, and the dropdown is skinned. It is as if the OCX is doing something undocumented, that has to be done as well to make the MFC version work in the same way.


Ulrich
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 11 July 2008 at 3:15am
Hi,
 
Load Skin before you create this dialog.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
upeters View Drop Down
Groupie
Groupie


Joined: 31 May 2007
Location: Brazil
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote upeters Quote  Post ReplyReply Direct Link To This Post Posted: 11 July 2008 at 9:30am
Thank you!

Just calling LoadSkin once (without pointing to any skin) before the dialog is displayed is indeed sufficient - now the scrollbars of the combobox are skinned correctly.

Ulrich
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.172 seconds.