X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bef7a62d8f57c5219c0ca952d5593ea5dcf2e008..90bddb8566eed2a2b16de533a655d1c04d9a584f:/src/generic/treectlg.cpp?ds=sidebyside diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 82cd049b80..69094f0757 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -440,7 +440,7 @@ void wxTreeTextCtrl::OnKeyUp( wxKeyEvent &event ) sx = parentSize.x - myPos.x; if (mySize.x > sx) sx = mySize.x; - SetSize(sx, wxDefaultSize.y); + SetSize(sx, wxDefaultCoord); } event.Skip(); @@ -448,16 +448,17 @@ void wxTreeTextCtrl::OnKeyUp( wxKeyEvent &event ) void wxTreeTextCtrl::OnKillFocus( wxFocusEvent &event ) { - if ( m_finished ) - { - event.Skip(); - return; - } - - if ( AcceptChanges() ) + if ( !m_finished ) { + AcceptChanges(); + // We must finish regardless of success, otherwise we'll get + // focus problems: Finish(); } + + // We must let the native text control handle focus, too, otherwise + // it could have problems with the cursor (e.g., in wxGTK): + event.Skip(); } // ----------------------------------------------------------------------------- @@ -791,9 +792,10 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent, #endif wxVisualAttributes attr = GetDefaultAttributes(); - SetDefaultForegroundColour( attr.colFg ); - SetDefaultBackgroundColour( attr.colBg ); - SetDefaultFont(attr.font); + SetOwnForegroundColour( attr.colFg ); + SetOwnBackgroundColour( attr.colBg ); + if (!m_hasFont) + SetOwnFont(attr.font); // m_dottedPen = wxPen( "grey", 0, wxDOT ); too slow under XFree86 m_dottedPen = wxPen( wxT("grey"), 0, 0 );