Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPControlComboBox on CommandBar stays disabled
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlComboBox on CommandBar stays disabled

 Post Reply Post Reply
Author
Message
Thanos View Drop Down
Newbie
Newbie
Avatar

Joined: 21 October 2010
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Thanos Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlComboBox on CommandBar stays disabled
    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.
Back to Top
Thanos View Drop Down
Newbie
Newbie
Avatar

Joined: 21 October 2010
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Thanos Quote  Post ReplyReply Direct Link To This Post 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.
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.234 seconds.