Print Page | Close Window

Controlling popup automatic closing

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=8495
Printed Date: 14 November 2025 at 1:41am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Controlling popup automatic closing
Posted By: Joe19
Subject: Controlling popup automatic closing
Date Posted: 22 October 2007 at 1:55pm

I am trying to implement a CXTPPopupToolBar as part of a CXTPRibbonGroup in a ribbon bar.  What I want is that when the popup displays for it not to close when the user uses any of the controls.  I have this working except for a listbox font selector.

The SetCloseSubMenuOnClick method works for all the controls in my popup except for the listbox.  If I use that method with the listbox, when the listbox expands it will not close.  So I want the listbox to close when the user makes its selection, but not to have it close the underlying popup.
 
Here is the code I am playing with.  I have been experimenting with reacting to messages when the listbox is changed, but not getting good results there.  I have not found a way to manually close the listbox once it is open.
CXTPControlPopup* pButtonBasics = (CXTPControlPopup*)pGroupText->Add(xtpControlButtonPopup, ID_TEXT_BASICS);
CXTPPopupToolBar* pBasicsBar = CXTPPopupToolBar::CreatePopupToolBar(GetCommandBars());
pBasicsBar->EnableCustomization(FALSE);
pBasicsBar->SetBorders(CRect(2, 2, 2, 2));
pBasicsBar->DisableShadow();

CXTPControlComboBox* pComboFont = new CXTPControlComboBox();
pComboFont->SetDropDownListStyle(TRUE);
pComboFont->EnableAutoComplete();
pComboFont->SetCloseSubMenuOnClick(FALSE);
pBasicsBar->GetControls()->Add(pComboFont, ID_FONT_FACE);

CXTPPopupBar* pPopupBarGallery = CXTPControlComboBoxGalleryPopupBar::CreateComboBoxGalleryPopupBar(pCommandBars);
pComboFont->SetCommandBar(pPopupBarGallery);

CXTPControlGallery* pControlGallery = new CXTPControlGallery();
pControlGallery->SetControlSize(CSize(290, 300));
pControlGallery->ShowLabels(TRUE); // doesn't seem to do anything
CXTPControlGalleryItems* pItemsFontFace = CXTPControlGalleryItems::CreateItems(pCommandBars, ID_GALLERY_FONTFACE);
pItemsFontFace->SetItemSize(CSize(0, 26));
CGalleryItemFontFace::AddFontItems(pItemsFontFace);

pControlGallery->SetItems(pItemsFontFace);
pPopupBarGallery->GetControls()->Add(pControlGallery, ID_GALLERY_FONTFACE);
pPopupBarGallery->InternalRelease();




Replies:
Posted By: Joe19
Date Posted: 22 October 2007 at 3:36pm
An update.  The above code shows a complicated font combo box.  The problem is the same if its a simple combo box with regular text.



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