Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - shadow causes windows to disappear
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

shadow causes windows to disappear

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 867
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: shadow causes windows to disappear
    Posted: 01 April 2019 at 10:06am
We have a modal dialog that lets the user change themes. When we use an office 2013 theme such as white or dark grey, if the frame is not maximized, the frame window updates over the top of the modal dialog. This occurs when CXTPFrameShadowManager::EnableShadow is called. The call to pShadow->Create is what causes this to occur. The modal dialog isn't the only window in our application that is affected. Floating docking panes also disappear behind the application window.

We are on version 18.5.
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 867
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2019 at 11:01am
I modified the Samples\Ribbon\RibbonSample project. In CMainFrame::OnViewOfficeTheme I added this code:

    CThemeDlg dlg(this);
    dlg.ExcludeTheme(
        XTP_EXCLUDE_THEME_VISUALSTUDIO6    |
        XTP_EXCLUDE_THEME_VISUALSTUDIO2005 |
        XTP_EXCLUDE_THEME_VISUALSTUDIO2008 |
        XTP_EXCLUDE_THEME_VISUALSTUDIO2010 |
        XTP_EXCLUDE_THEME_VISUALSTUDIO2012 |
        XTP_EXCLUDE_THEME_OFFICE2000       |
        XTP_EXCLUDE_THEME_OFFICEXP         |
        XTP_EXCLUDE_THEME_OFFICE2003       |
        XTP_EXCLUDE_THEME_NATIVEWINDOWS    |
        XTP_EXCLUDE_THEME_CUSTOM);

    // set startup theme
    dlg.SetTheme(
        xtpThemeDlgOffice2016,
        xtpThemeColor2016Colorful,
#ifdef _XTP_INCLUDE_RIBBON
        xtpThemeAccentWord,
        xtpThemeRibbonBackCircuit);
#else
        xtpThemeAccentWord);
#endif

    dlg.DoModal();

In OnInitDialog I also added a call to EnableAutoPreview(TRUE);

The result is the same as I see with our application. If you make changes to the style, the application jumps on top of the dialog. Bitten by the shadow code once again. Float the "Styles" docking pane and I see it too disappears behind the application window.

As we have had issues before with shadows, I had looked at this ribbonsample code and fashioned our sequence of calls to manipulate the theme the same way the sample did. So we first call the ribbon bar EnableFrameTheme(FALSE) and then call it again later with TRUE (for our app it is always enabled). Now I find that I need to skip the first call to set FALSE. I can do that in our app and the sample and the windows remain as they should. I have a long comment in our code outlining all the issues making these calls "fixed". So I have to start testing what will break if I make this change to work around yet another shadow problem.
Back to Top
Fredrik View Drop Down
Senior Member
Senior Member


Joined: 22 June 2005
Status: Offline
Points: 226
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fredrik Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2019 at 3:24pm
Did you patch XTP with the fix from http://forum.codejock.com/forum_posts.asp?TID=23639 to set m_hOwner to NULL in CXTPFrameShadow::Create? We just had the problem that 8 out of 10 users on a course had the problem with shadow covering the application so I tried the fix with setting m_hOwner to NULL. But this caused similar effect as yours: after creating another frame window from the main application and closing it, the main application won't appear top most anymore even if you try to activate it. We don't have this problem with 18.6, but the problem with the shadow covering the application is still there.
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 867
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2019 at 4:42pm
Hi Fredrick,

No, I never modifed that code. m_hOwner is passed thru CreateEx.
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 867
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 05 April 2019 at 10:08am
It turned out my "fix" isn't comprehensive. We still have issues with disappearing windows that float (not just docking panes) if the user simply resizes the application. I have to completely disable the shadow code (again) to avoid the issues. Why is the shadow so hard to implement by CJ?
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 645
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2019 at 3:43am
I think I also reproduced this in the CommandBarSample. When using the Options to first disable Frame Theme and the again use it to enable Frame Theme the entire application turns faded black, and unresponsive.
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 867
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2019 at 8:15am
Covered by the shadow window? Sounds like it might be. I looked at Microsoft Visual Studio's shadow. It is actually 4 windows fashioned just around the edge of the app.
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.156 seconds.