wxOSX fixes for wxGrid background, wxDataViewCtrl with wx[HV]SCROLL
styles and changing the window level.

See https://github.com/wxWidgets/wxWidgets/pull/1717
This commit is contained in:
Vadim Zeitlin
2020-02-04 02:31:38 +01:00
3 changed files with 11 additions and 9 deletions

View File

@@ -6176,15 +6176,9 @@ void wxGrid::DrawCell( wxDC& dc, const wxGridCellCoords& coords )
// Note: However, only if it is really _shown_, i.e. not hidden! // Note: However, only if it is really _shown_, i.e. not hidden!
if ( isCurrent && IsCellEditControlShown() ) if ( isCurrent && IsCellEditControlShown() )
{ {
// NB: this "#if..." is temporary and fixes a problem where the
// edit control is erased by this code after being rendered.
// On wxMac (QD build only), the cell editor is a wxTextCntl and is rendered
// implicitly, causing this out-of order render.
#if !defined(__WXMAC__)
wxGridCellEditor *editor = attr->GetEditor(this, row, col); wxGridCellEditor *editor = attr->GetEditor(this, row, col);
editor->PaintBackground(dc, rect, *attr); editor->PaintBackground(dc, rect, *attr);
editor->DecRef(); editor->DecRef();
#endif
} }
else else
{ {

View File

@@ -940,10 +940,14 @@ void wxNonOwnedWindowCocoaImpl::SetWindowStyleFlag( long style )
else if (( style & wxFRAME_FLOAT_ON_PARENT ) || ( style & wxFRAME_TOOL_WINDOW )) else if (( style & wxFRAME_FLOAT_ON_PARENT ) || ( style & wxFRAME_TOOL_WINDOW ))
level = NSFloatingWindowLevel; level = NSFloatingWindowLevel;
// Only update the level when it has changed, setting a level can cause the OS to reorder the windows in the level
if ( level != m_macWindowLevel )
{
[m_macWindow setLevel: level]; [m_macWindow setLevel: level];
m_macWindowLevel = level; m_macWindowLevel = level;
} }
} }
}
bool wxNonOwnedWindowCocoaImpl::SetBackgroundStyle(wxBackgroundStyle style) bool wxNonOwnedWindowCocoaImpl::SetBackgroundStyle(wxBackgroundStyle style)
{ {

View File

@@ -365,6 +365,10 @@ bool wxDataViewCtrl::Create(wxWindow *parent,
const wxValidator& validator, const wxValidator& validator,
const wxString& name) const wxString& name)
{ {
// Remove wxVSCROLL and wxHSCROLL from the style, since the dataview panel has scrollbars
// by default, and wxControl::Create trys to make some but crashes in the process
style &= ~(wxVSCROLL | wxHSCROLL);
DontCreatePeer(); DontCreatePeer();
if (!(wxControl::Create(parent,id,pos,size,style,validator,name))) if (!(wxControl::Create(parent,id,pos,size,style,validator,name)))
return false; return false;