mac cleanup

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2007-11-20 16:21:04 +00:00
parent f50c925e80
commit 9553702e46
6 changed files with 14 additions and 41 deletions

View File

@@ -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 );

View File

@@ -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"

View File

@@ -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?

View File

@@ -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
)

View File

@@ -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

View File

@@ -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