Print Page | Close Window

Preventing TearOff Popup from docking

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=6519
Printed Date: 19 June 2025 at 5:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Preventing TearOff Popup from docking
Posted By: markh
Subject: Preventing TearOff Popup from docking
Date Posted: 27 February 2007 at 9:16am
Hello
 
Just wondered if there was a way of preventing a TearOff popup from docking once it has been torn off? I have tried calling:
 
EnableDocking(XtremeCommandBars::xtpFlagFloating);
 
for the CommandBar of the popup on creation. However, this doesn't seem to work. It does seem to work if the toolbars are saved and reloaded next time the app starts but only if the TearOff was visible when the toolbars were saved.
 
There is also another interesting issue. When the TearOff is originally torn off, the floating window has the graduated fill of the specified VS 2005 theme. However, when it is reloaded it has a plain fill. This only occurs if the above EnableDocking is called after loading. See images:
 
After initial tearing off
 
After Save and Reload
 
Any help appreciated.
 
Mark
 



Replies:
Posted By: Oleg
Date Posted: 27 February 2007 at 9:50am
Hi,
 
check CustomThemes sample...


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: markh
Date Posted: 27 February 2007 at 10:39am
 
Hello Oleg
 
What is the CustomThemes sample? I don't see one.
 
In fact the only sample that seems to have a call to SetTearOffPopup is the Office 2003 sample. This however, does allow the torn off popup to dock to any position.
 
If I add the line:
 
ControlColorPopup.CommandBar.EnableDocking xtpFlagFloating
 
after
 
ControlColorPopup.CommandBar.SetTearOffPopup "Colors", IDR_COLORSBAR, 150
 
it still allows me to dock the TearOff to any location.


Posted By: markh
Date Posted: 06 March 2007 at 6:04pm
Any more info on this one??
 
I still don't seem to be able to prevent a TearOff popup from docking.
 
Thanks


Posted By: Oleg
Date Posted: 07 March 2007 at 5:04am
Sorry, was answer for MFC users, didn't check forum.
hmm in ActiveX version there is no event when new tearoff bar was created.
 
try to catch ToolBarVisibleChanged event, check toolbar's BuiltIn property and set its EnableDocking


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: markh
Date Posted: 07 March 2007 at 7:27am
Just tried this.
 
Unfortunately, the ToolBarVisibleChanged event does not seem to be called at all when the when I tearoff the popup. It only seems to be called when I subsequently close the floating tearoff bar using the X button.
 
Also, the BuiltIn property is always false for the tearoff bar, although this doesn't make any difference since the event isn't called anyway.
 
Any other ideas??


Posted By: Oleg
Date Posted: 07 March 2007 at 7:44am

Hi,

Afriad only one idea - monitor Count of CommandBars in Update event - if changed - check if it is tearoff bar (BuiltIn property have to be False for this bar) and change its docking. Quite weird but will work.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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