1. added wxGTK::wxToolBar::SetToolShortHelp() and test for it in sample
2. fix a crash if SetSelection is called too early in wxTextCtrl 3. patch for mouse position in wxTreeCtrl events git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -506,6 +506,18 @@ void wxToolBar::SetToolSeparation( int separation )
|
||||
m_toolSeparation = separation;
|
||||
}
|
||||
|
||||
void wxToolBar::SetToolShortHelp( int id, const wxString& helpString )
|
||||
{
|
||||
wxToolBarTool *tool = (wxToolBarTool *)FindById(id);
|
||||
|
||||
if ( tool )
|
||||
{
|
||||
(void)tool->SetShortHelp(helpString);
|
||||
gtk_tooltips_set_tip(m_toolbar->tooltips, tool->m_item,
|
||||
helpString.mbc_str(), "");
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxToolBar idle handling
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -555,4 +567,4 @@ void wxToolBar::OnInternalIdle()
|
||||
UpdateWindowUI();
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // wxUSE_TOOLBAR_NATIVE
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/settings.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -646,6 +647,14 @@ void wxTextCtrl::SetSelection( long from, long to )
|
||||
{
|
||||
wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
|
||||
|
||||
if ( (m_windowStyle & wxTE_MULTILINE) &&
|
||||
!GTK_TEXT(m_text)->line_start_cache )
|
||||
{
|
||||
// tell the programmer that it didn't work
|
||||
wxLogDebug(_T("Can't call SetSelection() before realizing the control"));
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user