Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Missing Filterlist in CExtCoomboBox Collapse All
Subject Author Date
Torsten Schucht Oct 29, 2009 - 9:39 AM

I am creating a CExtComboBox dynamically:


 


 



CExtComboBox* pCombo = new CExtComboBox();

pCombo->m_bEnableAutoComplete = false;

pCombo->m_bEnableAutoFilter = true;


CRect Rect (110, 50, 300, 200);

DWORD uStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWN | CBS_SORT; //CBS_AUTOHSCROLL;

   

pCombo->Create( uStyle, Rect, this, 12);

pCombo->ModifyStyleEx(0, WS_EX_NOPARENTNOTIFY);

pCombo->SetFont( CFont::FromHandle( (HFONT)::GetStockObject(DEFAULT_GUI_FONT) ) );



 


I am unable to make the filter popup list appear while typing. I compared my dynamically created control versus one created via resource. The resource one works just fine. I debugged the dynamic combo box and found out that in the method


 



CExtComboBoxBase::OnSubclassInnerEdit()


...


HWND hWnd = ::GetWindow( m_hWnd, GW_CHILD );



...


The hWnd is NULL which prevents m_wndInnerEditHook from being subclassed. Which than later in


CExtComboBoxBase::OnEditCtrlUpdate()


the inner edit control is NULL and the filterlist is not shown.


Is there anything I need to add to my dynamic creation to make this work?


 





 


 

Technical Support Oct 30, 2009 - 2:35 PM

Thank you very much for your test project. It helped us to fix this issue. Please update the source code for the following method:

CEdit * CExtComboBoxBase::OnQueryInnerEditCtrl() const
{
      ASSERT_VALID( this );
CEdit * pEdit = NULL;
DWORD dwWndStyle = GetStyle();
DWORD dwComboBoxType = dwWndStyle & 0x0003L;
      if( dwComboBoxType != CBS_DROPDOWNLIST )
      {
            ( const_cast < CExtComboBoxBase * > ( this ) ) -> OnSubclassInnerEdit();
            if( m_wndInnerEditHook.GetSafeHwnd() != NULL )
                  pEdit = (CEdit *)&m_wndInnerEditHook;
      }
      return pEdit;
}



Torsten Schucht Nov 2, 2009 - 9:59 AM

Thanks for the fix. It works just fine!!

Torsten Schucht Oct 30, 2009 - 3:44 AM

Thanks for the information. Unfortunetly that didn’t help. I have created a very simple sample application, which contains a dialog with one dynamic combobox and one created from a resource. The one created from the resource behaves in the way I would like to have the dynamic one.


I’ll send you the zipped solution via email.

Technical Support Oct 29, 2009 - 2:27 PM

Your combo box is not based on the CBS_HASSTRINGS style. The CExtComboBox class does not know which text lines should be displayed in the filter popup list box.