Print Page | Close Window

Toggling frame theme is buggy

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=14796
Printed Date: 02 October 2024 at 8:35pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Toggling frame theme is buggy
Posted By: znakeeye
Subject: Toggling frame theme is buggy
Date 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/



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


Posted By: znakeeye
Date 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/



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