]> git.saurik.com Git - wxWidgets.git/commitdiff
wxDataViewChoiceRenderer's editor control should have the same size as the cell.
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 28 Mar 2011 14:10:31 +0000 (14:10 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 28 Mar 2011 14:10:31 +0000 (14:10 +0000)
It looks weird when it's significantly shorter than the content cell being edited.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/datavcmn.cpp

index 3e52749a09e6a6cd7154bcdbc1e27c18b206baab..10d606aefe9ebb610c34aed122636d408e3a0911 100644 (file)
@@ -1484,7 +1484,14 @@ wxDataViewChoiceRenderer::wxDataViewChoiceRenderer( const wxArrayString& choices
 
 wxControl* wxDataViewChoiceRenderer::CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
 {
-    wxChoice* c = new wxChoice(parent, wxID_ANY, labelRect.GetTopLeft(), wxDefaultSize, m_choices );
+    wxChoice* c = new wxChoice
+                      (
+                          parent,
+                          wxID_ANY,
+                          labelRect.GetTopLeft(),
+                          wxSize(labelRect.GetWidth(), -1),
+                          m_choices
+                      );
     c->Move(labelRect.GetRight() - c->GetRect().width, wxDefaultCoord);
     c->SetStringSelection( value.GetString() );
     return c;