X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb7f24c1b54564d27e2a8b15526bdda91859495f..5b952139e838585734114dd147f7747d6084a0af:/src/generic/treectlg.cpp?ds=sidebyside diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index dd4fdecff9..d8017cd81c 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -261,12 +261,12 @@ private: // tree ctrl images for the normal, selected, expanded and // expanded+selected states - short m_images[wxTreeItemIcon_Max]; + int m_images[wxTreeItemIcon_Max]; wxCoord m_x; // (virtual) offset from top wxCoord m_y; // (virtual) offset from left - short m_width; // width of this item - unsigned char m_height; // height of this item + int m_width; // width of this item + int m_height; // height of this item // use bitfields to save size int m_isCollapsed :1; @@ -375,6 +375,16 @@ wxTreeTextCtrl::wxTreeTextCtrl(wxGenericTreeCtrl *owner, // FIXME: what are all these hardcoded 4, 8 and 11s really? x += image_w; w -= image_w + 4; +#ifdef __WXMAC__ + wxSize bs = DoGetBestSize() ; + // edit control height + if ( h > bs.y - 8 ) + { + int diff = h - ( bs.y - 8 ) ; + h -= diff ; + y += diff / 2 ; + } +#endif (void)Create(m_owner, wxID_ANY, m_startValue, wxPoint(x - 4, y - 4), wxSize(w + 11, h + 8)); @@ -2884,8 +2894,6 @@ void wxGenericTreeCtrl::Edit( const wxTreeItemId& item ) return; } - m_itemEdited = itemEdit; - // We have to call this here because the label in // question might just have been added and no screen // update taken place. @@ -3478,6 +3486,15 @@ void wxGenericTreeCtrl::OnGetToolTip( wxTreeEvent &event ) } +wxSize wxGenericTreeCtrl::DoGetBestSize() const +{ + // something is better than nothing... + // 100x80 is what the MSW version will get from the default + // wxControl::DoGetBestSize + return wxSize(100,80); +} + + // NOTE: If using the wxListBox visual attributes works everywhere then this can // be removed, as well as the #else case below. #define _USE_VISATTR 0