Print Page | Close Window

CXTPControlComboBox on CommandBar stays disabled

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=17466
Printed Date: 28 November 2024 at 10:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlComboBox on CommandBar stays disabled
Posted By: Thanos
Subject: CXTPControlComboBox on CommandBar stays disabled
Date Posted: 21 October 2010 at 4:52am
Hi,
 
i seem to have the following problem. I've created a CXTPommandBar on a CXTPDialogBase derived class like in the DialogSample like this:
 
VERIFY(InitCommandBars());

CXTPCommandBars* pCommandBars = GetCommandBars();

CXTPToolBar* pToolBar = pCommandBars->Add(_T("Planning"), xtpBarTop);

pToolBar->LoadToolBar(IDR_PLANVIEW_TOOLBAR);

pToolBar->ShowExpandButton(FALSE);

pToolBar->GetControls()->CreateOriginalControls();

 

On the commandbar i've created a CXTPControlComboBox by using the following code in the OnCreateControl of the CXTPDialogBase derived class:

m_pFilterCombo = new CXTPControlComboBox(GetCommandBars());

lpCreateControl->pControl = m_pFilterCombo;

m_pFilterCombo->SetWidth(140);

m_pFilterCombo->SetHeight(200);

m_pFilterCombo->SetDropDownListStyle(FALSE);

m_pFilterCombo->SetEnabled(TRUE);

The combobox shows up perfectly and i can access it in code, it just never seems to be set to enabled.
I've tried adding

ON_UPDATE_COMMAND_UI and

ON_XTP_EXECUTE handlers to the CXTPDialogBase derived class and to the mainframe and main program view but nothing seems to work, even if i use pCmdUI->SetEnable(TRUE) on any of those levels.

One more thing to note would be that the CXTPDialogBase derived class is created and added to a pane that's added to the DockingPaneManager in the CMainFrame.
 
Any help on the subject would be appreciated.
Thanks in advance


-------------
If you can't beat them. Burn them.



Replies:
Posted By: Thanos
Date Posted: 21 October 2010 at 4:58am
Well for some reason it works now. I've readded the

ON_UPDATE_COMMAND_UI and

ON_XTP_EXECUTE handlers to the CXTPDialogBase derived class and now the combobox is enabled. The only difference i can think of are the

pToolBar->GetControls()->CreateOriginalControls();

and

m_pFilterCombo->SetEnabled(TRUE);

lines since the last time i tried this.


-------------
If you can't beat them. Burn them.



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