Print Page | Close Window

Trouble getting theme w/ XTKPDialog

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=8008
Printed Date: 13 November 2025 at 9:10pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Trouble getting theme w/ XTKPDialog
Posted By: geigy
Subject: Trouble getting theme w/ XTKPDialog
Date Posted: 14 September 2007 at 6:37pm
I'm porting a legacy app to XMTP.  I'm very happy with the progress I've made - had a ribbon SDI version of the app up in a matter of days. 

One lingering problem: my dialogs are not "styled".  My dialog inherits CXTPDialogBase<CXTResizeDialog>, and sets the Office 2007 style (se below). 

Any guesses as to what I'm missing?

TIA

Mike Russell
_____________________________

#define CDialogBase CXTPDialogBase<CXTResizeDialog>

class CCurvesDialog : public CDialogBase
{
...
}

BOOL CCurvesDialog::OnInitDialog()
{
    {
        HICON h = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
        SetIcon(h, true);
        SetIcon(h, false);
    }
    CXTPPaintManager::SetTheme(xtpThemeOffice2007);
...
}



-------------
Mike Russell - www.curvemeister.com



Replies:
Posted By: Oleg
Date Posted: 15 September 2007 at 1:40am
Hello,
Do you want Office2007 captiopn ?
 
if so,  change
 
class CCurvesDialog : public CDialogBase
to
class CCurvesDialog : public CDialogBase, CXTPOffice2007FrameHook
 
and add
 
EnableOffice2007Frame(this, XPTPaintManger());

 after you set theme.
 
don't forget add Office2007 bitmaps to your rc2 file.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: geigy
Date Posted: 15 September 2007 at 2:46am
Thanks, Oleg.  I'll give this a shot.



-------------
Mike Russell - www.curvemeister.com


Posted By: geigy
Date Posted: 15 September 2007 at 3:31am
I changed the inheritance and added the rc file, and changed OnInitDialog similar to your suggestion as shown below. 

I had to do a variation on your suggestion,  using the static method CreateTheme() to create the PaintManager object.

With this change, the dialog is blank, a caption and gray background, but no controls:
 
   CXTPPaintManager::SetTheme(xtpThemeOffice2007);
    CXTPPaintManager *pmgr = CXTPPaintManager::CreateTheme(xtpThemeOffice2007);
    EnableOffice2007Frame(this, pmgr);



-------------
Mike Russell - www.curvemeister.com


Posted By: Oleg
Date Posted: 15 September 2007 at 10:56am
Hi,
attach project to check what you did.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: geigy
Date Posted: 15 September 2007 at 3:10pm
Thanks, Oleg.  The project is a bit large to attach to a post, but this leads to a good idea: I should do a small  MDI ribbon project with a non-modal dialog, and see if the themes work in that scenario.  I'll try (beta schedule permitting) do that in the next several days.

In the meantime, I've been using the XTKP source and samples as my main source of documentation, stepping through functions to see how they work, as well as reading any materials I can glean from the site and help file.  Am I missing any large pieces of man-page-style documentation?  Is there a big fat Petzold or Prosise style book on XTKP?

Thanks again for your help.

Mike Russell


-------------
Mike Russell - www.curvemeister.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net