![]() |
Trouble getting theme w/ XTKPDialog |
Post Reply
|
| Author | |
geigy
Newbie
Joined: 31 August 2007 Location: United States Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Topic: Trouble getting theme w/ XTKPDialogPosted: 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
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
geigy
Newbie
Joined: 31 August 2007 Location: United States Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 September 2007 at 2:46am |
|
Thanks, Oleg. I'll give this a shot.
|
|
|
Mike Russell - www.curvemeister.com
|
|
![]() |
|
geigy
Newbie
Joined: 31 August 2007 Location: United States Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 September 2007 at 10:56am |
|
Hi,
attach project to check what you did.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
geigy
Newbie
Joined: 31 August 2007 Location: United States Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |