Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Toggling frame theme is buggy
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toggling frame theme is buggy

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

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Toggling frame theme is buggy
    Posted: 22 July 2009 at 6:21pm
XTP 13.1, RibbonSample.
 
When toggling the frame theme, the window is restored. This is very annoying, so I removed the ShowWindow-call below. However, if removed, the behavior is really weird (buggy). I have found that Vista GUI changes the logic somehow. Can you please test this function a little bit and comment?
 
void CMainFrame::OnFrameTheme()

{

ShowWindow(SW_NORMAL); // Why?! Removing it solves one thing, but screws another...

CXTPRibbonBar* pRibbonBar = (CXTPRibbonBar*)GetCommandBars()->GetAt(0);

CXTPWindowRect rc(this);

rc.top += (pRibbonBar->IsFrameThemeEnabled() ? -1 : +1) * GetSystemMetrics(SM_CYCAPTION);

MoveWindow(rc);

pRibbonBar->EnableFrameTheme(!pRibbonBar->IsFrameThemeEnabled());

}

PokerMemento - http://www.pokermemento.com/
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 24 July 2009 at 4:15am
Hi,
 
So "screws another" problem is restoring that you don't like ? Don't think your customers will switch it each day. Guess they can live with restoring frame once in life :)
 
anyway you can check WS_MAXIMIZE style and Maximize it back after you switch it.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 25 July 2009 at 2:43am

Well, if I started my application in a maximized state I do not want to restore it just like that. And if I remove that ShowWindow-call, the frame theme gets screwed in Vista Aero (until I restart my application, of course).

But sure, I can live with a "restoration" once every 313 days :P
PokerMemento - http://www.pokermemento.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.109 seconds.