*/
wxDEPRECATED( wxString GetValueString( int argFlags = 0 ) const );
- void UpdateControl( wxWindow* primary );
-
/**
Returns wxPGCell of given column.
*/
// moved to it.
void SubPropsChanged( int oldSelInd = -1 );
+ void UpdateControl( wxWindow* editorWnd );
+
int GetY2( int lh ) const;
wxString m_label;
return m_wndEditor2;
}
+ /**
+ Refreshes any active editor control.
+ */
+ void RefreshEditor();
+
// Events from editor controls are forward to this function
void HandleCustomEditorEvent( wxEvent &event );
*/
bool IsFrozen() const;
+ /**
+ Refreshes any active editor control.
+ */
+ void RefreshEditor();
+
/**
Redraws given property.
*/
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).
return wxNOT_FOUND;
}
-void wxPGProperty::UpdateControl( wxWindow* primary )
+void wxPGProperty::UpdateControl( wxWindow* editorWnd )
{
- if ( primary )
- GetEditorClass()->UpdateControl(this, primary);
+ if ( editorWnd )
+ GetEditorClass()->UpdateControl(this, editorWnd);
}
bool wxPGProperty::ValidateValue( wxVariant& WXUNUSED(value), wxPGValidationInfo& WXUNUSED(validationInfo) ) const
void wxPGProperty::RefreshEditor()
{
- if ( m_parent && GetParentState() )
- {
- wxPropertyGrid* pg = GetParentState()->GetGrid();
- if ( pg->GetSelectedProperty() == this )
- {
- wxWindow* editor = pg->GetEditorControl();
- if ( editor )
- GetEditorClass()->UpdateControl( this, editor );
- }
- }
-}
+ if ( !m_parent )
+ return;
+ wxPropertyGrid* pg = GetGrid();
+ if ( pg && pg->GetSelectedProperty() == this )
+ UpdateControl(pg->GetEditorControl());
+}
wxVariant wxPGProperty::GetDefaultValue() const
{
// -----------------------------------------------------------------------
+void wxPropertyGrid::RefreshEditor()
+{
+ if ( !m_selected || !m_wndEditor || m_frozen )
+ return;
+ m_selected->UpdateControl(m_wndEditor);
+}
+
+// -----------------------------------------------------------------------
+
// This method is not inline because it called dozens of times
// (i.e. two-arg function calls create smaller code size).
bool wxPropertyGrid::DoClearSelection()
pageIndex++;
}
+
+ // Update active editor control, if any
+ GetPropertyGrid()->RefreshEditor();
}
// -----------------------------------------------------------------------