![]() |
tear-off custom control |
Post Reply ![]() |
Author | |
nostromo ![]() Newbie ![]() Joined: 01 September 2007 Location: United States Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() Posted: 01 September 2007 at 3:07pm |
Hi all,
I'm trying to add a custom control to a popup button, that can be ripped off, like the font color control in the CodeJock example "TearOffPopups ". However, it doesn't work correctly. behavior: click on button, see the custom control (a dialog), tear off the bar. Everything is still okay. Now close the bar, and click the button again.: the button is empty! where did the contents of the custom control go? Or, tear off the bar, click the button again, now the control shows in the popup (which is ok), the teared off bar shows a blank space. The teared off bar stays blank when the popup is closed. Any ideas how to get this working? Thanks! code: To test, I added a simple dialog to the TearOffPopus project, with style set to "Child","control=true", "no border", added a member to the mainframe, and did the following in OnCreateControl: (replaced the colorpopup with this) int CMainFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl) { if (lpCreateControl->bToolBar) { if (lpCreateControl->nID == ID_BUTTON_TEXT && pToolBar->GetBarID() == IDR_MAINFRAME) { CXTPControlPopup* pPopup = new CXTPControlPopup(); CXTPPopupBar* pBar = CXTPPopupToolBar::CreatePopupToolBar(GetCommandBars()); pPopup->SetCommandBar(pBar); m_dlgTest.Create(CDlgTest::IDD, this); CXTPControlCustom* pControlCustom = CXTPControlCustom::CreateControlCustom( &m_dlgTest ); pControlCustom->SetFlags(xtpFlagManualUpdate); pControlCustom->SetVerticalPositionOption(xtpVerticalShow); pBar->GetControls()->Add(pControlCustom); // pBar->GetControls()->Add(new CXTPControlColorSelector(), ID_CMD_COLORSET); pBar->SetTearOffPopup(_T("Measure Settings"), 1005, 0); pBar->EnableCustomization(FALSE); pBar->InternalRelease(); lpCreateControl->pControl = pPopup; return TRUE; } } return FALSE; } |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Yes, Custom controls can't be added to tearoff bars.
I think you understand that its not possible to show _same dialog_ (m_dlgTest ) in 2 windows in same time.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
nostromo ![]() Newbie ![]() Joined: 01 September 2007 Location: United States Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Oleg, it doesn't NEED to be shown in 2 windows at the same time, that's not what I'm asking. You can't click in 2 windows at the same time. The problem is that it isn't shown in ANY window, after closing the teared-off one.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |