Call SetToolTip() for the property editor control when wxPG_EX_HELP_AS_TOOLTIPS style is used
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4032,6 +4032,8 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
|||||||
wxPrintf( "P = NULL\n" );
|
wxPrintf( "P = NULL\n" );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
wxWindow* primaryCtrl = NULL;
|
||||||
|
|
||||||
// If we are frozen, then just set the values.
|
// If we are frozen, then just set the values.
|
||||||
if ( m_frozen )
|
if ( m_frozen )
|
||||||
{
|
{
|
||||||
@@ -4157,7 +4159,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
|||||||
|
|
||||||
m_wndEditor = wndList.m_primary;
|
m_wndEditor = wndList.m_primary;
|
||||||
m_wndEditor2 = wndList.m_secondary;
|
m_wndEditor2 = wndList.m_secondary;
|
||||||
wxWindow* primaryCtrl = GetEditorControl();
|
primaryCtrl = GetEditorControl();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Essentially, primaryCtrl == m_wndEditor
|
// Essentially, primaryCtrl == m_wndEditor
|
||||||
@@ -4285,34 +4287,30 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
|||||||
ClearInternalFlag(wxPG_FL_IN_SELECT_PROPERTY);
|
ClearInternalFlag(wxPG_FL_IN_SELECT_PROPERTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
const wxString* pHelpString = NULL;
|
||||||
|
|
||||||
//
|
if ( p )
|
||||||
// Show help text in status bar.
|
pHelpString = &p->GetHelpString();
|
||||||
// (if found and grid not embedded in manager with help box and
|
|
||||||
// style wxPG_EX_HELP_AS_TOOLTIPS is not used).
|
|
||||||
//
|
|
||||||
|
|
||||||
if ( !(GetExtraStyle() & wxPG_EX_HELP_AS_TOOLTIPS) )
|
if ( !(GetExtraStyle() & wxPG_EX_HELP_AS_TOOLTIPS) )
|
||||||
{
|
{
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
|
||||||
|
//
|
||||||
|
// Show help text in status bar.
|
||||||
|
// (if found and grid not embedded in manager with help box and
|
||||||
|
// style wxPG_EX_HELP_AS_TOOLTIPS is not used).
|
||||||
|
//
|
||||||
wxStatusBar* statusbar = GetStatusBar();
|
wxStatusBar* statusbar = GetStatusBar();
|
||||||
if ( statusbar )
|
if ( statusbar )
|
||||||
{
|
{
|
||||||
const wxString* pHelpString = (const wxString*) NULL;
|
if ( pHelpString && pHelpString->length() )
|
||||||
|
|
||||||
if ( p )
|
|
||||||
{
|
{
|
||||||
pHelpString = &p->GetHelpString();
|
// Set help box text.
|
||||||
if ( pHelpString->length() )
|
statusbar->SetStatusText( *pHelpString );
|
||||||
{
|
m_iFlags |= wxPG_FL_STRING_IN_STATUSBAR;
|
||||||
// Set help box text.
|
|
||||||
statusbar->SetStatusText( *pHelpString );
|
|
||||||
m_iFlags |= wxPG_FL_STRING_IN_STATUSBAR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else if ( m_iFlags & wxPG_FL_STRING_IN_STATUSBAR )
|
||||||
if ( (!pHelpString || !pHelpString->length()) &&
|
|
||||||
(m_iFlags & wxPG_FL_STRING_IN_STATUSBAR) )
|
|
||||||
{
|
{
|
||||||
// Clear help box - but only if it was written
|
// Clear help box - but only if it was written
|
||||||
// by us at previous time.
|
// by us at previous time.
|
||||||
@@ -4320,8 +4318,21 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
|||||||
m_iFlags &= ~(wxPG_FL_STRING_IN_STATUSBAR);
|
m_iFlags &= ~(wxPG_FL_STRING_IN_STATUSBAR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#if wxPG_SUPPORT_TOOLTIPS
|
||||||
|
//
|
||||||
|
// Show help as a tool tip on the editor control.
|
||||||
|
//
|
||||||
|
if ( pHelpString && pHelpString->length() &&
|
||||||
|
primaryCtrl )
|
||||||
|
{
|
||||||
|
primaryCtrl->SetToolTip(*pHelpString);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// call wx event handler (here so that it also occurs on deselection)
|
// call wx event handler (here so that it also occurs on deselection)
|
||||||
if ( !(flags & wxPG_SEL_DONT_SEND_EVENT) )
|
if ( !(flags & wxPG_SEL_DONT_SEND_EVENT) )
|
||||||
|
Reference in New Issue
Block a user