Print Page | Close Window

theming (child) dialog in MDI application

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=23650
Printed Date: 21 November 2024 at 1:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: theming (child) dialog in MDI application
Posted By: jw_statica
Subject: theming (child) dialog in MDI application
Date 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" rel="nofollow - uploads/9273/RibbonMDISample.zip



Replies:
Posted By: olebed
Date 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



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