Adapted wxPGComboBox margins setup to changes in wxComboCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -147,7 +147,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Number added to image width for SetCustomPaintWidth
|
// Number added to image width for SetCustomPaintWidth
|
||||||
#define ODCB_CUST_PAINT_MARGIN 9
|
#define ODCB_CUST_PAINT_MARGIN 6
|
||||||
|
|
||||||
// Milliseconds to wait for two mouse-ups after focus inorder
|
// Milliseconds to wait for two mouse-ups after focus inorder
|
||||||
// to trigger a double-click.
|
// to trigger a double-click.
|
||||||
@@ -786,23 +786,28 @@ bool wxPGChoiceEditor_SetCustomPaintWidth( wxPropertyGrid* propGrid, wxPGComboBo
|
|||||||
wxPGProperty* property = propGrid->GetSelectedProperty();
|
wxPGProperty* property = propGrid->GetSelectedProperty();
|
||||||
wxASSERT( property );
|
wxASSERT( property );
|
||||||
|
|
||||||
|
wxSize imageSize;
|
||||||
|
bool res;
|
||||||
|
|
||||||
if ( cmnVal >= 0 )
|
if ( cmnVal >= 0 )
|
||||||
{
|
{
|
||||||
// Yes, a common value is being selected
|
// Yes, a common value is being selected
|
||||||
property->SetCommonValue( cmnVal );
|
property->SetCommonValue( cmnVal );
|
||||||
wxSize imageSize = propGrid->GetCommonValue(cmnVal)->
|
imageSize = propGrid->GetCommonValue(cmnVal)->
|
||||||
GetRenderer()->GetImageSize(property, 1, cmnVal);
|
GetRenderer()->GetImageSize(property, 1, cmnVal);
|
||||||
if ( imageSize.x ) imageSize.x += ODCB_CUST_PAINT_MARGIN;
|
res = false;
|
||||||
cb->SetCustomPaintWidth( imageSize.x );
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxSize imageSize = propGrid->GetImageSize(property, -1);
|
imageSize = propGrid->GetImageSize(property, -1);
|
||||||
if ( imageSize.x ) imageSize.x += ODCB_CUST_PAINT_MARGIN;
|
res = true;
|
||||||
cb->SetCustomPaintWidth( imageSize.x );
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( imageSize.x )
|
||||||
|
imageSize.x += ODCB_CUST_PAINT_MARGIN;
|
||||||
|
cb->SetCustomPaintWidth( imageSize.x );
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateControls calls this with CB_READONLY in extraStyle
|
// CreateControls calls this with CB_READONLY in extraStyle
|
||||||
|
Reference in New Issue
Block a user