]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/editors.cpp
Avoid redraw artifacts from the border after resizing
[wxWidgets.git] / src / propgrid / editors.cpp
index 0f63021c567b7b721db9cb458fd15b16c1ec66b1..d3a4418c6b3079daf8e264898ad26002ff49437c 100644 (file)
@@ -691,6 +691,8 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
 
         if ( flags & wxODCB_PAINTING_CONTROL )
             renderFlags |= wxPGCellRenderer::Control;
+        else
+            renderFlags |= wxPGCellRenderer::ChoicePopup;
 
         if ( flags & wxODCB_PAINTING_SELECTED )
             renderFlags |= wxPGCellRenderer::Selected;
@@ -877,15 +879,6 @@ wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid,
     else
         cb->SetSelection( -1 );
 
-    // Connect event handling
-    wxWindowID id = cb->GetId();
-    propGrid->Connect(id, wxEVT_COMMAND_COMBOBOX_SELECTED,
-        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
-    propGrid->Connect(id, wxEVT_COMMAND_TEXT_UPDATED,
-        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
-    propGrid->Connect(id, wxEVT_COMMAND_TEXT_ENTER,
-        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
-
 #ifdef __WXMSW__
     cb->Show();
 #endif
@@ -1298,7 +1291,7 @@ void wxSimpleCheckBox::SetValue( int value )
 
     wxPropertyGrid* propGrid = (wxPropertyGrid*) GetParent()->GetParent();
     wxASSERT( propGrid->IsKindOf(CLASSINFO(wxPropertyGrid)) );
-    propGrid->OnCustomEditorEvent(evt);
+    propGrid->HandleCustomEditorEvent(evt);
 }
 
 
@@ -1401,14 +1394,6 @@ wxPGWindowList wxPGCheckBoxEditor::CreateControls( wxPropertyGrid* propGrid,
 
     cb->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
 
-    cb->Connect( wxPG_SUBID1, wxEVT_LEFT_DOWN,
-            (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
-            &wxPropertyGrid::OnCustomEditorEvent, NULL, propGrid );
-
-    cb->Connect( wxPG_SUBID1, wxEVT_LEFT_DCLICK,
-            (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
-            &wxPropertyGrid::OnCustomEditorEvent, NULL, propGrid );
-
     if ( property->GetChoiceSelection() > 0 &&
          !property->IsValueUnspecified() )
         cb->m_state = 1;
@@ -1592,6 +1577,9 @@ void wxPropertyGrid::CorrectEditorWidgetSizeX()
 
 void wxPropertyGrid::CorrectEditorWidgetPosY()
 {
+    if ( m_selColumn == -1 )
+        return;
+
     if ( m_selected && (m_wndEditor || m_wndEditor2) ) 
     {
         wxRect r = GetEditorWidgetRect(m_selected, m_selColumn);
@@ -1711,13 +1699,6 @@ wxWindow* wxPropertyGrid::GenerateEditorTextCtrl( const wxPoint& pos,
     if ( maxLen > 0 )
         tc->SetMaxLength( maxLen );
 
-    // Connect event handling
-    id = ed->GetId();
-    this->Connect(id, wxEVT_COMMAND_TEXT_UPDATED,
-        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
-    this->Connect(id, wxEVT_COMMAND_TEXT_ENTER,
-        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
-
     return (wxWindow*) ed;
 }
 
@@ -1779,11 +1760,6 @@ wxWindow* wxPropertyGrid::GenerateEditorButton( const wxPoint& pos, const wxSize
     if ( selected->HasFlag(wxPG_PROP_READONLY) )
         but->Disable();
 
-    // Connect event handling
-    id = but->GetId();
-    this->Connect(id, wxEVT_COMMAND_BUTTON_CLICKED,
-        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
-
     return but;
 }
 
@@ -1881,17 +1857,10 @@ wxPGMultiButton::wxPGMultiButton( wxPropertyGrid* pg, const wxSize& sz )
     SetBackgroundColour(pg->GetCellBackgroundColour());
 }
 
-void wxPGMultiButton::Finalize( wxPropertyGrid* propGrid, const wxPoint& pos )
+void wxPGMultiButton::Finalize( wxPropertyGrid* WXUNUSED(propGrid),
+                                const wxPoint& pos )
 {
     Move( pos.x + m_fullEditorSize.x - m_buttonsWidth, pos.y );
-
-    // Connect event handling
-    for ( unsigned int i=0; i<GetCount(); i++ )
-    {
-        wxWindowID id = GetButtonId(i);
-        propGrid->Connect(id, wxEVT_COMMAND_BUTTON_CLICKED,
-            wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
-    }
 }
 
 int wxPGMultiButton::GenId( int id ) const