Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Trouble getting theme w/ XTKPDialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Trouble getting theme w/ XTKPDialog

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

Joined: 31 August 2007
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote geigy Quote  Post ReplyReply Direct Link To This Post Topic: Trouble getting theme w/ XTKPDialog
    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
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: 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
Back to Top
geigy View Drop Down
Newbie
Newbie
Avatar

Joined: 31 August 2007
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote geigy Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2007 at 2:46am
Thanks, Oleg.  I'll give this a shot.

Mike Russell - www.curvemeister.com
Back to Top
geigy View Drop Down
Newbie
Newbie
Avatar

Joined: 31 August 2007
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote geigy Quote  Post ReplyReply Direct Link To This Post 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
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: 15 September 2007 at 10:56am
Hi,
attach project to check what you did.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
geigy View Drop Down
Newbie
Newbie
Avatar

Joined: 31 August 2007
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote geigy Quote  Post ReplyReply Direct Link To This Post 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
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.063 seconds.