Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - theming (child) dialog in MDI application
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

theming (child) dialog in MDI application

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


Joined: 23 May 2018
Status: Offline
Points: 23
Post Options Post Options   Thanks (1) Thanks(1)   Quote jw_statica Quote  Post ReplyReply Direct Link To This Post Topic: theming (child) dialog in MDI application
    Posted: 06 June 2018 at 3:53am
I have problem connecting with skinning dialog in MDI application.
In order to explain it, I modified the CodeJock RibbonMDISample:
- added to project Dialog1 (style popup) and Dialog2 (style child).
- added members do class CMainFrame:  std::unique_ptr  dlg1; std::unique_ptr  dlg2;
- modified function void CMainFrame::OnViewFullscreen() 

void CMainFrame::OnViewFullscreen() 
{
  dlg1 = std::make_unique();
  if (dlg1->Create(IDD_DIALOG1, &m_wndClient))
  {
   dlg1->ShowWindow(SW_NORMAL);
  }

  dlg2 = std::make_unique();
  if (dlg2->Create(IDD_DIALOG2, &m_wndClient))
  {
   dlg2->ShowWindow(SW_NORMAL);
  }
}

After calling this function there will show 2 dialogs one (child) without skin and second (popup) skined.

We called function XTPSkinManager()->LoadSkin() and dialogs were skinned 
but after closing dialogs and opening them again they weren't skinned.uploads/9273/RibbonMDISample.zip
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 23 June 2018 at 11:12am
Originally posted by astoyan astoyan wrote:

Hello,

Yes, you can apply the same theme to your dialogs, it's not skinning though, it's just re-using CommandBars theme.
All you need is to derive your dialog class from CXTPDialog and enable frame theme as shown below:

BOOL CTestDialog::OnInitDialog() 
{
  CXTPDialog::OnInitDialog();
  if(InitCommandBars())
  {
    ASSERT(NULL != GetCommandBars());
    GetCommandBars()->EnableFrameTheme(TRUE);
  }

  ...
}

I hope it will be helpful.
Thank you.
Regards,
 Alexander Stoyan
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.141 seconds.