]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/editors.cpp
remove the long deprecated wxTabCtrl class
[wxWidgets.git] / src / propgrid / editors.cpp
index 0f63021c567b7b721db9cb458fd15b16c1ec66b1..570ec33a80fe1326058b74de69ef467a60f8c1bb 100644 (file)
@@ -283,9 +283,22 @@ void wxPGTextCtrlEditor::UpdateControl( wxPGProperty* property, wxWindow* ctrl )
     else
         s = property->GetDisplayedString();
 
-    tc->SetValue(s);    
-}
+    tc->SetValue(s);
+
+    // Update font boldness
+    wxPropertyGrid* pg = property->GetGrid();
+    if ( pg->HasFlag(wxPG_BOLD_MODIFIED) )
+    {
+        if ( property->HasFlag(wxPG_PROP_MODIFIED) )
+            tc->SetFont(pg->GetCaptionFont());
+        else
+            tc->SetFont(pg->GetFont());
 
+#if defined(__WXMSW__) && !defined(__WXWINCE__)
+        ::SendMessage(GetHwndOf(tc), EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
+#endif
+    }
+}
 
 // Provided so that, for example, ComboBox editor can use the same code
 // (multiple inheritance would get way too messy).
@@ -691,6 +704,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 +892,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 +1304,7 @@ void wxSimpleCheckBox::SetValue( int value )
 
     wxPropertyGrid* propGrid = (wxPropertyGrid*) GetParent()->GetParent();
     wxASSERT( propGrid->IsKindOf(CLASSINFO(wxPropertyGrid)) );
-    propGrid->OnCustomEditorEvent(evt);
+    propGrid->HandleCustomEditorEvent(evt);
 }
 
 
@@ -1401,14 +1407,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 +1590,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 +1712,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 +1773,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 +1870,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