Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Controlling popup automatic closing
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Controlling popup automatic closing

 Post Reply Post Reply
Author
Message
Joe19 View Drop Down
Newbie
Newbie


Joined: 11 May 2007
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote Joe19 Quote  Post ReplyReply Direct Link To This Post Topic: Controlling popup automatic closing
    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();

Back to Top
Joe19 View Drop Down
Newbie
Newbie


Joined: 11 May 2007
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote Joe19 Quote  Post ReplyReply Direct Link To This Post 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.
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.047 seconds.