Replaced 'InlineHelp' property attribute with 'Hint'; Use SetHint() wxTextCtrl and wxComboCtrl member function to set it; Added a small section about help string and hint text in propgrid overview

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2009-12-26 10:45:04 +00:00
parent 107defe36a
commit 534090e354
8 changed files with 108 additions and 16 deletions

View File

@@ -482,7 +482,7 @@ void wxPGTextCtrlEditor_OnFocus( wxPGProperty* property,
wxTextCtrl* tc )
{
// Make sure there is correct text (instead of unspecified value
// indicator or inline help)
// indicator or hint text)
int flags = property->HasFlag(wxPG_PROP_READONLY) ?
0 : wxPG_EDITABLE_VALUE;
wxString correctText = property->GetValueAsString(flags);
@@ -656,7 +656,17 @@ public:
int flags ) const
{
wxPropertyGrid* pg = GetGrid();
pg->OnComboItemPaint( this, item, &dc, (wxRect&)rect, flags );
// Handle hint text via super class
if ( (flags & wxODCB_PAINTING_CONTROL) &&
ShouldUseHintText(flags) )
{
wxOwnerDrawnComboBox::OnDrawItem(dc, rect, item, flags);
}
else
{
pg->OnComboItemPaint( this, item, &dc, (wxRect&)rect, flags );
}
}
virtual wxCoord OnMeasureItem( size_t item ) const
@@ -1032,7 +1042,11 @@ wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid,
cb->SetButtonPosition(si.y,0,wxRIGHT);
cb->SetMargins(wxPG_XBEFORETEXT-1);
wxPGChoiceEditor_SetCustomPaintWidth( propGrid, cb, property->GetCommonValue() );
// Set hint text
cb->SetHint(property->GetHintText());
wxPGChoiceEditor_SetCustomPaintWidth( propGrid, cb,
property->GetCommonValue() );
if ( index >= 0 && index < (int)cb->GetCount() )
{
@@ -1898,6 +1912,9 @@ wxWindow* wxPropertyGrid::GenerateEditorTextCtrl( const wxPoint& pos,
tc->AutoComplete(attrVal.GetArrayString());
}
// Set hint text
tc->SetHint(prop->GetHintText());
return tc;
}