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 » Checkbox in CExtComboBox Collapse All
Subject Author Date
Emmanuel Verguet Mar 4, 2009 - 9:47 AM

Hi,


I want to display a CExtComboBox in a toolbar (already done), but instead of displayed a string list, I want to display a checkbox with string list. Is it possible ?


Thanks.

Emmanuel V. Mar 9, 2009 - 10:54 AM

Thanks for your update but two things :



  1. When clicking on the arrow to "drop-down" the combo box content, the height of the visible items seems to be null (the width is correct). If I replace my CExtCheckComboBox by a CExtComboBox, it is ok. Here is the Create() line:

    if (m_wndComboZones.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | CBS_HASSTRINGS, CRect(0, 0, 150, 100), this, ID_TOOLBAR_COMBO_ZONES) == FALSE)



    So I cannot view my items, neither check/uncheck them.

  2. The CExtCheckComboBox::ResetContent() does not works (or maybe CExtCheckComboBox::m_strText is not updated).


Thanks.

Technical Support Mar 10, 2009 - 1:18 PM

The CExtCheckComboBox class currently requires the CBS_DROPDOWNLIST|CBS_OWNERDRAWVARIABLE|CBS_HASSTRINGS styles. Please specify the CBS_OWNERDRAWVARIABLE style.

Thank you for reporting the content resetting issue in the new check combo box control. To fix it, please update the source code for the following method:

LRESULT CExtCheckComboBox::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
            if( message == CB_RESETCONTENT )
                        m_bHaveItemHeight = m_bHaveText = false;
            else
            if(                     WM_KEYFIRST <= message && message <= WM_KEYLAST
                        &&        ( wParam == VK_UP || wParam == VK_DOWN || wParam == VK_LEFT || wParam == VK_RIGHT || wParam == VK_PRIOR || wParam == VK_NEXT || wParam == VK_HOME || wParam == VK_END )
                        )
            {
                        if( ! GetDroppedState() )
                        {
                                    ShowDropDown();
                                    return 0L;
                        }
                        SetRedraw( FALSE );
                        LRESULT lResult = CExtComboBox::WindowProc( message, wParam, lParam );
                        SetRedraw( TRUE );
                        Invalidate( TRUE );
                        UpdateWindow();
                        return lResult;
            }
            return CExtComboBox::WindowProc( message, wParam, lParam );
}

Emmanuel V. Mar 11, 2009 - 2:44 AM

I added the CBS_OWNERDRAWVARIABLE flag, but it didn’t solve my problem. I sent to you by email a quick and short sample (Visual C++ 6.0) which demonstrate my problem. May be something is wrong on my side.


Thanks for your support.

Technical Support Mar 11, 2009 - 8:52 AM

You reported a very interesting issue. The check combo box does not have such issue when created inside dialog window. We found only temporarily but working solution for this issue. Please download the fixed version of your test project and find all the comments in it marked with the PROF-UIS TECH SUPPORT text:

http://www.prof-uis.com/download/forums/tmp/TestCExtCheckCombo-fixed-for-EmmanuelVERGUET.zip

Emmanuel V. Mar 12, 2009 - 3:53 AM

Another things, I discover that you are using ItemData to store checked state. I planned to use this ItemData to store something else. Is it possible to not use the ItemData to store checked state ? If not possible, I will create a map.


Thanks.

Technical Support Mar 12, 2009 - 2:30 PM

We can implement check marks in the synchronized CArray object. But if you are going to use the CMapStringTo*** object for storing your data linked to the combo box items, then please note all the combo box strings should be unique.

Emmanuel V. Mar 12, 2009 - 3:05 AM

Thanks for your update.


So, in next release v2.85, I will need to rooback this patch ?

Technical Support Mar 12, 2009 - 2:30 PM

If we find a solution to avoid additional moving of the check combo box window, you can remove this trick from your project. But it does not conflict with the combo box control and even if you leave it, then it will work.

Emmanuel Verguet Mar 5, 2009 - 1:09 AM

I’m not using customizable toolbars and menus. And yes, CExtGridCellCheckListComboBox is the control that fit my needs, but now, how can I add this control in my toolbar. Like a CExtComboBox ?


Thanks.

Technical Support Mar 6, 2009 - 10:29 AM

Please update the …/Prof-UIS/Include/ExtComboBox.h and …/Prof-UIS/Src/ExtComboBox.cpp files from the following ZIP file and re-build required configurations of the Prof-UIS library.

http://www.prof-uis.com/download/forums/tmp/NewCombo285.zip

Now the new CExtCheckComboBox class is ready for use in your project. There are only three interesting methods in this class because they work with a set of check boxes:
void CheckSet(
INT nIndex,
bool bCheck = true
);
bool CheckGet( INT nIndex ) const;
void CheckAll(
bool bCheck = true
);

Technical Support Mar 4, 2009 - 12:50 PM

Please run the ProfUIS_Controls sample application, select the Grid page and click the CheckCombo hyperlink at the bottom of the displayed dialog page (it’s second from bottom in the leftmost column of hyperlinks). As result, the column with check combo box cells will be selected in the grid window at the top of dialog page. Please try to play with the grid cells in this column and let us know whether that is the combo box type you need in toolbar? Please also let us know whether you are using customizable toolbars and menus?