From: Stefan Csomor Date: Tue, 20 Nov 2007 16:21:04 +0000 (+0000) Subject: mac cleanup X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9553702e463d217eb90465d008ea0ed41d7a658b mac cleanup git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 57cab57ad9..3cd1e3307d 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -7202,7 +7202,7 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords ) return; } -#if !(defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS) +#if !defined(__WXMAC__) wxClientDC dc( m_gridWin ); PrepareDC( dc ); #endif @@ -7228,7 +7228,7 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords ) // Otherwise refresh redraws the highlight! m_currentCellCoords = coords; -#if defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS +#if defined(__WXMAC__) m_gridWin->Refresh(true /*, & r */); #else DrawGridCellArea( dc, cells ); @@ -7240,7 +7240,7 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords ) m_currentCellCoords = coords; wxGridCellAttr *attr = GetCellAttr( coords ); -#if !(defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS) +#if !defined(__WXMAC__) DrawCellHighlight( dc, attr ); #endif attr->DecRef(); @@ -7813,7 +7813,6 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) ) int rightCol = GetColPos( internalXToCol(right) ); int bottomRow = internalYToRow(bottom); -#if !defined(__WXMAC__) || wxMAC_USE_CORE_GRAPHICS wxRegion clippedcells(0, 0, cw, ch); int i, j, cell_rows, cell_cols; @@ -7841,30 +7840,6 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) ) } } } -#else - wxRegion clippedcells( left, top, right - left, bottom - top ); - - int i, j, cell_rows, cell_cols; - wxRect rect; - - for (j=topRow; j<=bottomRow; j++) - { - for (i=leftCol; i<=rightCol; i++) - { - GetCellSize( j, i, &cell_rows, &cell_cols ); - if ((cell_rows > 1) || (cell_cols > 1)) - { - rect = CellToRect(j, i); - clippedcells.Subtract(rect); - } - else if ((cell_rows < 0) || (cell_cols < 0)) - { - rect = CellToRect(j + cell_rows, i + cell_cols); - clippedcells.Subtract(rect); - } - } - } -#endif dc.SetClippingRegion( clippedcells ); diff --git a/src/generic/helpext.cpp b/src/generic/helpext.cpp index 28a1eb0252..fcf5f1f82a 100644 --- a/src/generic/helpext.cpp +++ b/src/generic/helpext.cpp @@ -15,7 +15,7 @@ #pragma hdrstop #endif -#if wxUSE_HELP && !defined(__WXWINCE__) && (!defined(__WXMAC__) || defined(__WXMAC_OSX__)) +#if wxUSE_HELP && !defined(__WXWINCE__) #ifndef WX_PRECOMP #include "wx/list.h" diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index fbb923ae18..32c3e8c581 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1415,7 +1415,7 @@ bool wxListLineData::SetAttributes(wxDC *dc, #ifdef __WXMAC__ { if (m_owner->HasFocus() -#ifdef __WXMAC__ +#if !defined(__WXUNIVERSAL__) && IsControlActive( (ControlRef)m_owner->GetHandle() ) #endif ) @@ -1479,7 +1479,7 @@ void wxListLineData::Draw( wxDC *dc ) { int flags = wxCONTROL_SELECTED; if (m_owner->HasFocus() -#ifdef __WXMAC__ +#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__) && IsControlActive( (ControlRef)m_owner->GetHandle() ) #endif ) @@ -5021,7 +5021,6 @@ bool wxGenericListCtrl::Create(wxWindow *parent, m_mainWin = new wxListMainWindow( this, wxID_ANY, wxPoint(0, 0), size, style ); -#ifdef __WXMAC_CARBON__ // Human Interface Guidelines ask us for a special font in this case if ( GetWindowVariant() == wxWINDOW_VARIANT_NORMAL ) { @@ -5029,13 +5028,11 @@ bool wxGenericListCtrl::Create(wxWindow *parent, font.MacCreateThemeFont( kThemeViewsFont ); SetFont( font ); } -#endif if ( InReportView() ) { CreateHeaderWindow(); -#ifdef __WXMAC_CARBON__ if (m_headerWin) { wxFont font; @@ -5043,7 +5040,6 @@ bool wxGenericListCtrl::Create(wxWindow *parent, m_headerWin->SetFont( font ); CalculateAndSetHeaderHeight(); } -#endif if ( HasFlag(wxLC_NO_HEADER) ) // VZ: why do we create it at all then? diff --git a/src/generic/renderg.cpp b/src/generic/renderg.cpp index 68c9b3d538..b5080a4d22 100644 --- a/src/generic/renderg.cpp +++ b/src/generic/renderg.cpp @@ -666,7 +666,7 @@ wxRendererGeneric::DrawItemSelectionRect(wxWindow * WXUNUSED(win), dc.SetBrush(brush); if ((flags & wxCONTROL_CURRENT) && (flags & wxCONTROL_FOCUSED) -#ifdef __WXMAC__ +#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__) && IsControlActive( (ControlRef)win->GetHandle() ) #endif ) diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 958de8cc0b..2108da42c4 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -213,8 +213,10 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) // following the mouse movement while it drags the sash, without it we only // draw the sash at the new position but only resize the windows when the // dragging is finished -#if defined( __WXMAC__ ) && defined(TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX == 1 - bool isLive = true ; // FIXME: why? +#if defined( __WXMAC__ ) + // FIXME : this should be usable also with no live update, but then this + // currently is not visible + bool isLive = true; #else bool isLive = HasFlag(wxSP_LIVE_UPDATE); #endif diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index d30b80d4f0..d28e2bc4b9 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -790,7 +790,7 @@ void wxGenericTreeCtrl::Init() m_lastOnSame = false; -#ifdef __WXMAC_CARBON__ +#ifdef __WXMAC__ m_normalFont.MacCreateThemeFont( kThemeViewsFont ) ; #else m_normalFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ); @@ -2250,7 +2250,7 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) { int flags = wxCONTROL_SELECTED; if (m_hasFocus -#ifdef __WXMAC__ +#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__) && IsControlActive( (ControlRef)GetHandle() ) #endif ) @@ -2390,7 +2390,7 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level wxColour colText; if ( item->IsSelected() -#ifdef __WXMAC__ +#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__) // On wxMac, if the tree doesn't have the focus we draw an empty // rectangle, so we want to make sure that the text is visible // against the normal background, not the highlightbackground, so