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 » CExtGridCellDropListComboBox drop list bug Collapse All
Subject Author Date
Offer Har Mar 21, 2010 - 6:33 AM

Dear Support,


We have a grid with a CExtGridCellDropListComboBox with long texts. We made the column wide, so the text will be visible, however the drop-list width does not get the same width as the column, and the texts are cut.


Even worse, at a certain columns width, the drop-list width get narrower and narrower then the column width... as we make the column wider, the drop-list get narrower....


Please fix.


Thanks,


Ron.

Technical Support Mar 23, 2010 - 10:58 AM

This is the previous case. This is the default behavior. The popup list box with is always equal to the cell’s width or minimal needed width:
http://www.prof-uis.com/download/forums/tmp/ProfUIS_Controls-GridPage-ComboBoxColumn4.png

Offer Har Mar 23, 2010 - 12:07 PM

But there is a bug... read my mail... Please make the column very wide - half a screen.... 1000 pixels wide and you’ll see that the drop list is not 1000 pixels wide!

Technical Support Mar 23, 2010 - 12:57 PM

Yes, you are right. We should extend the maximal available size of popup list boxes to the work area size of the monitor where the popup list box should appear. Please update the source code for the following method:

CSize CExtGridCell::OnPopupListBoxQueryMaxSize(
            CExtPopupInplaceListBox & wndListBox,
            CExtGridCell::TrackCellStateInfo_t & _tcsi
            )
{
            // returned CSize( 0, 0 ) means no limit in size - what means use monitor limits
            __EXT_DEBUG_GRID_ASSERT_VALID( this );
            __EXT_DEBUG_GRID_ASSERT( (&_tcsi.m_cell) == this );
            __EXT_DEBUG_GRID_ASSERT_VALID( (&_tcsi.m_wndGrid) );
            __EXT_DEBUG_GRID_ASSERT( wndListBox.GetSafeHwnd() != NULL );
CSize _size = _tcsi.m_wndGrid.OnGridCellPopupListBoxQueryMaxSize( wndListBox, _tcsi );
            if( _size.cx >= 0 && _size.cy >= 0 )
                        return _size;
CRect rcCellScreen = _tcsi.m_rcCell;
            _tcsi.m_wndGrid.ClientToScreen( &rcCellScreen );
CExtPaintManager::monitor_parms_t _mp;
            CExtPaintManager::stat_GetMonitorParms( _mp, rcCellScreen );
CRect rcAvailableSpaces(
                        rcCellScreen.left - _mp.m_rcWorkArea.left - 1,
                        rcCellScreen.top - _mp.m_rcWorkArea.top - 1,
                        _mp.m_rcWorkArea.right - rcCellScreen.right - 1,
                        _mp.m_rcWorkArea.bottom - rcCellScreen.bottom - 1
                        );
CSize sizeAvailable = rcAvailableSpaces.Size();
            return sizeAvailable;
}

Offer Har Mar 24, 2010 - 9:05 AM

Dear Support,


Your solution still have some bug.


I had a case that the column width was ~700, and the sizeAvailable.cx was only 212.... Please check (I have lots if images showing the bug if you want...)


However, I added this line before the return, and I can live with it for now...:

sizeAvailable.cx = max(200, rcCellScreen.Width());



I realy do not understand why you make all the computations there for this simple task. Please fix for the next version.


Ron.

Technical Support Mar 25, 2010 - 2:37 AM

Could you please comment the sizeAvailable.cx = max(200, rcCellScreen.Width()); suggested line of code and create a screen shot demonstrating the problem for us?

Offer Har Mar 25, 2010 - 2:50 AM

Dear Support,


I’m out of the office for 10 days. The bug is there... very easy to reproduce... the picture will just show you how the width is less then the cell width. I also saw it in the cx variable that the value was not close to the cell width.


Ron.

Offer Har Mar 22, 2010 - 12:52 PM

Dear Support,


Please try and widen the combo’s column... up to half screen, and you’ll see it.


Ron.

Technical Support Mar 23, 2010 - 9:27 AM

Here is what we see:
http://www.prof-uis.com/download/forums/tmp/ProfUIS_Controls-GridPage-ComboBoxColumn2.png

And we think this is correct and good looking. The CExtGridCell::OnPopupListBoxAdjustSize() virtual method computes the actual size of popup list box. There is the similar CExtGridWnd::OnGridCellPopupListBoxAdjustSize() virtual method. You can override the CExtGridWnd::OnGridCellPopupListBoxAdjustSize() virtual method in your grid class and make it containing only the following two lines of code:

_tcsi.m_bAlingListBoxWidthToCellWidthMin = false;
return false;

Then you will see the following:
http://www.prof-uis.com/download/forums/tmp/ProfUIS_Controls-GridPage-ComboBoxColumn3.png
Is that what you need?


Offer Har Mar 23, 2010 - 9:58 AM

Dear Support,


I need the drop-list width to be computed as follows:


1. If the cell width is less then X then X


2. If the cell width is more then X, then the cell’s width.


If this is too complicated, then I need the drop-list to be exactly the same width as the cell. This is not what i see now when the cell is very wide (half screen for example)

Technical Support Mar 22, 2010 - 11:39 AM

Here is the screen shot of the ComboBox column on the Grid dialog page in the ProfUIS_Controls sample application:
http://www.prof-uis.com/download/forums/tmp/ProfUIS_Controls-GridPage-ComboBoxColumn.png
The combo box cells are initialized in the CPageGrid::_InitColumnComboBox() method. How did you initialized your combo box grid cells?