Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - ChldFrm and SkineFramework
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ChldFrm and SkineFramework

 Post Reply Post Reply
Author
Message
gwoin View Drop Down
Groupie
Groupie
Avatar

Joined: 09 September 2004
Location: France
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote gwoin Quote  Post ReplyReply Direct Link To This Post Topic: ChldFrm and SkineFramework
    Posted: 15 June 2006 at 11:52am
Hi,
 
I encounter a problem since  the version 10.2 ot the framework.
 
My application is using a custom theme (based on the SkinSDISample sample).
 
It is a MDI application, so with CChildFrame.
The problem is that the title bar of the child window does not appear with the version 10.2.
 
Plus, the child frame has its own skin (in order to put some images and customs informations in the title bar).
 
My code is simple:
 
//customize the theme of the child window
class CMatrisChildFrame : public CMDIChildWnd
{
    [...]
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnNcPaint();
    afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
    afx_msg void OnCaptureChanged(CWnd *pWnd);
    [...]
}
and then:

class CChildFrame : public CMatrisChildFrame

All ran well, and I would like to keep this skin for the child, but with the version 10.2 of the framework I dont see the title bar of the child window anymore.
 
Is there any informations to put in the .INI file of my skin, or in the MainFrm.cpp or any where else to see my titlebar again (and the complete skin of the child window too) ?
 
Thank you.
Back to Top
gwoin View Drop Down
Groupie
Groupie
Avatar

Joined: 09 September 2004
Location: France
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote gwoin Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2006 at 10:04am

I up a new post because the problem is still there.

with XTPro 10.1 and earlier, I got this:

 
And now, since XTPro 10.2, I get this:
 
The title bar of my child window is gone, whereas my source code has not been changed.
Any idea on how I could see the title bar again?
 
Thank you.
 
PS: Oleg, your avatar is the hedgehog from Youri Norstein?
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: 10 July 2006 at 12:29pm
Hello, difficult to say without information of code you use. May be you can attach some sample to show what you do?
 
 
ps.  Yeap, it is hedgehog  in mist :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
gwoin View Drop Down
Groupie
Groupie
Avatar

Joined: 09 September 2004
Location: France
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote gwoin Quote  Post ReplyReply Direct Link To This Post Posted: 11 July 2006 at 4:08am

My MDI application has an only one childframe.

I have customized the caption bar of this child in order to add some user informations and menus.
 
My code is very simple :
The CChildFrame class is inherited from CXTPFrameWndBase<CMDIChildWnd> and overload some functions:
 
class CChildFrame : public CXTPFrameWndBase<CMDIChildWnd>
{
    DECLARE_DYNCREATE(CChildFrame)
public:
    CChildFrame();
 
public:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildFrame)
    virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
 
    [...]
    //my variables and functions
    [...]
 
// Implementation
public:
    virtual ~CChildFrame();
 
    int GetSysButtonsh*tTest(CPoint point);
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnNcPaint();
    afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
    afx_msg LRESULT OnNcHitTest(CPoint point);
    afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
    afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnCaptureChanged(CWnd *pWnd);
};
 
Then, in the ChildFrm.cpp:
 
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    cs.style = WS_CHILDWINDOW;
    cs.cy = WINDOW_HEIGHT; //set a fixed window size
    cs.cx = WINDOW_WIDTH;
    cs.y = 0;
    cs.x = 0;
 
    return (CXTPFrameWndBase<CMDIChildWnd>::PreCreateWindow(cs) );
}
[...]
 
The child frame has the size that I set, so the function below is traversed by the application, but the others functions like OnNcPaint, OnNcCalcSize, OnNcHitTest, ... are never traversed anymore.
 
In the myApp.cpp file, i just declar the doc Template as this:

CMultiDocTemplate* pDocTemplate;

pDocTemplate = new CMultiDocTemplate(
    IDR_GUI_WHTYPE,
    RUNTIME_CLASS(CMatrisDoc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(CMatrisView));
 
 
Any idea why the On NCpaint, ...,  are not traversed anymore since XTP 10.2 ?
 
Thank you.
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 2006 at 10:02am
Hello,
 
Yes, SkinFramework draw Non Client area and don't allow base methods to be called. As Workaround remove WS_CAPTION style.
 
For next release we added ability to create custom CXTPSkinManager, catch events, create custom skin classes etc.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
gwoin View Drop Down
Groupie
Groupie
Avatar

Joined: 09 September 2004
Location: France
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote gwoin Quote  Post ReplyReply Direct Link To This Post Posted: 11 July 2006 at 10:20am
Originally posted by oleg oleg wrote:

Hello,
 
Yes, SkinFramework draw Non Client area and don't allow base methods to be called. As Workaround remove WS_CAPTION style.
 
For next release we added ability to create custom CXTPSkinManager, catch events, create custom skin classes etc.
 
Thank you Oleg.
 
Too bad for the Childframe...
Could you tell when the next version should be released?
I hope that the transfer between my actual code and the next release will be easy :)
 
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 2006 at 12:52pm
Hello,
I guess in beginning of August....
 
You can play now with source code. in
 
CXTPSkinObjectFrame::IsDefWindowProcAvail
 
comment "if (HasCaption()) return FALSE;"
and non client messages will be send.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
gwoin View Drop Down
Groupie
Groupie
Avatar

Joined: 09 September 2004
Location: France
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote gwoin Quote  Post ReplyReply Direct Link To This Post Posted: 11 July 2006 at 1:05pm

Hi Oleg,

Thank you.
 
I will try by commenting this line.
 
[Edit: ] It works, thank you Oleg Smile 
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.188 seconds.