add some #if wxUSE_XXX (patch 1581470)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42208 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2006-10-21 16:39:42 +00:00
parent e4164aa980
commit 72c1ba98f2
7 changed files with 45 additions and 12 deletions

View File

@ -361,13 +361,16 @@ bool wxBitmapDataObject::SetData( size_t nSize, const void *pBuf )
#ifndef __LP64__ #ifndef __LP64__
Rect frame; Rect frame;
wxMacGetPictureBounds( picHandle, &frame ); wxMacGetPictureBounds( picHandle, &frame );
#if wxUSE_METAFILE
wxMetafile mf; wxMetafile mf;
mf.SetHMETAFILE( (WXHMETAFILE)m_pictHandle ); mf.SetHMETAFILE( (WXHMETAFILE)m_pictHandle );
#endif
wxMemoryDC mdc; wxMemoryDC mdc;
m_bitmap.Create( frame.right - frame.left, frame.bottom - frame.top ); m_bitmap.Create( frame.right - frame.left, frame.bottom - frame.top );
mdc.SelectObject( m_bitmap ); mdc.SelectObject( m_bitmap );
#if wxUSE_METAFILE
mf.Play( &mdc ); mf.Play( &mdc );
#endif
mdc.SelectObject( wxNullBitmap ); mdc.SelectObject( wxNullBitmap );
#endif #endif

View File

@ -11,6 +11,8 @@
#include "wx/wxprec.h" #include "wx/wxprec.h"
#if wxUSE_FILEDLG
#include "wx/filedlg.h" #include "wx/filedlg.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
@ -428,3 +430,6 @@ int wxFileDialog::ShowModal()
return (err == noErr) ? wxID_OK : wxID_CANCEL; return (err == noErr) ? wxID_OK : wxID_CANCEL;
} }
#endif // wxUSE_FILEDLG

View File

@ -20,6 +20,8 @@
// For compilers that support precompilation, includes "wx.h". // For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h" #include "wx/wxprec.h"
#if wxUSE_FONTDLG
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma hdrstop #pragma hdrstop
#endif #endif
@ -782,4 +784,6 @@ int FontFamilyStringToInt(const wxChar *family)
#endif // !USE_NATIVE_FONT_DIALOG_FOR_MACOSX #endif // !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
#endif #endif // wxMAC_USE_EXPERIMENTAL_FONTDIALOG
#endif // wxUSE_FONTDLG

View File

@ -117,6 +117,7 @@ bool wxFrame::Enable(bool enable)
return true; return true;
} }
#if wxUSE_STATUSBAR
wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id, wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
const wxString& name) const wxString& name)
{ {
@ -141,6 +142,7 @@ void wxFrame::PositionStatusBar()
m_frameStatusBar->SetSize(0, h, w, WX_MAC_STATUSBAR_HEIGHT); m_frameStatusBar->SetSize(0, h, w, WX_MAC_STATUSBAR_HEIGHT);
} }
} }
#endif // wxUSE_STATUSBAR
// Responds to colour changes, and passes event on to children. // Responds to colour changes, and passes event on to children.
void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
@ -148,6 +150,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
Refresh(); Refresh();
#if wxUSE_STATUSBAR
if ( m_frameStatusBar ) if ( m_frameStatusBar )
{ {
wxSysColourChangedEvent event2; wxSysColourChangedEvent event2;
@ -155,6 +158,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
event2.SetEventObject( m_frameStatusBar ); event2.SetEventObject( m_frameStatusBar );
m_frameStatusBar->ProcessEvent(event2); m_frameStatusBar->ProcessEvent(event2);
} }
#endif // wxUSE_STATUSBAR
// Propagate the event to the non-top-level children // Propagate the event to the non-top-level children
wxWindow::OnSysColourChanged(event); wxWindow::OnSysColourChanged(event);
@ -356,7 +360,6 @@ void wxFrame::PositionToolBar()
} }
#endif #endif
#if wxUSE_TOOLBAR
if (GetToolBar()) if (GetToolBar())
{ {
int tx, ty, tw, th; int tx, ty, tw, th;
@ -387,8 +390,8 @@ void wxFrame::PositionToolBar()
#endif #endif
} }
} }
#endif
} }
#endif // wxUSE_TOOLBAR
void wxFrame::PositionBars() void wxFrame::PositionBars()
{ {
@ -400,4 +403,4 @@ void wxFrame::PositionBars()
#endif #endif
} }
#endif

View File

@ -11,6 +11,8 @@
#include "wx/wxprec.h" #include "wx/wxprec.h"
#if wxUSE_STATUSBAR
#include "wx/statusbr.h" #include "wx/statusbr.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
@ -175,3 +177,6 @@ void wxStatusBarMac::MacHiliteChanged()
Refresh(); Refresh();
Update(); Update();
} }
#endif // wxUSE_STATUSBAR

View File

@ -11,6 +11,8 @@
#include "wx/wxprec.h" #include "wx/wxprec.h"
#if wxUSE_TIMER
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/dynarray.h" #include "wx/dynarray.h"
#endif #endif
@ -215,4 +217,7 @@ void wxTimer::Stop()
wxMacRemoveAllNotifiersForData( wxMacGetNotifierTable(), this ); wxMacRemoveAllNotifiersForData( wxMacGetNotifierTable(), this );
} }
#endif #endif // wxMAC_USE_CARBON_TIMER
#endif // wxUSE_TIMER

View File

@ -53,13 +53,15 @@ private :
PicHandle m_backpict ; PicHandle m_backpict ;
bool m_shown ; bool m_shown ;
long m_mark ; long m_mark ;
#if wxUSE_TIMER
wxMacToolTipTimer* m_timer ; wxMacToolTipTimer* m_timer ;
#endif
#if TARGET_CARBON #if TARGET_CARBON
wxMacCFStringHolder m_helpTextRef ; wxMacCFStringHolder m_helpTextRef ;
#endif #endif
} ; } ;
#if wxUSE_TIMER
class wxMacToolTipTimer : public wxTimer class wxMacToolTipTimer : public wxTimer
{ {
public: public:
@ -77,6 +79,7 @@ protected:
wxMacToolTip* m_tip; wxMacToolTip* m_tip;
long m_mark ; long m_mark ;
}; };
#endif // wxUSE_TIMER
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxToolTip // wxToolTip
@ -181,19 +184,22 @@ void wxToolTip::RemoveToolTips()
} }
// --- mac specific // --- mac specific
#if wxUSE_TIMER
wxMacToolTipTimer::wxMacToolTipTimer( wxMacToolTip *tip , int msec ) wxMacToolTipTimer::wxMacToolTipTimer( wxMacToolTip *tip , int msec )
{ {
m_tip = tip; m_tip = tip;
m_mark = tip->GetMark() ; m_mark = tip->GetMark() ;
Start(msec, true); Start(msec, true);
} }
#endif // wxUSE_TIMER
wxMacToolTip::wxMacToolTip() wxMacToolTip::wxMacToolTip()
{ {
m_window = NULL ; m_window = NULL ;
m_backpict = NULL ; m_backpict = NULL ;
#if wxUSE_TIMER
m_timer = NULL ; m_timer = NULL ;
#endif
m_mark = 0 ; m_mark = 0 ;
m_shown = false ; m_shown = false ;
} }
@ -208,21 +214,23 @@ void wxMacToolTip::Setup( WindowRef win , const wxString& text , const wxPoint&
m_window =win; m_window =win;
s_ToolTipWindowRef = m_window ; s_ToolTipWindowRef = m_window ;
m_backpict = NULL ; m_backpict = NULL ;
#if wxUSE_TIMER
if ( m_timer ) if ( m_timer )
delete m_timer ; delete m_timer ;
m_timer = new wxMacToolTipTimer( this , s_ToolTipDelay ) ; m_timer = new wxMacToolTipTimer( this , s_ToolTipDelay ) ;
#endif // wxUSE_TIMER
} }
wxMacToolTip::~wxMacToolTip() wxMacToolTip::~wxMacToolTip()
{ {
#if wxUSE_TIMER
if ( m_timer ) if ( m_timer )
{ {
delete m_timer ; delete m_timer ;
m_timer = NULL; m_timer = NULL;
} }
#endif // wxUSE_TIMER
if ( m_backpict ) if ( m_backpict )
Clear() ; Clear() ;
} }
@ -265,13 +273,13 @@ void wxToolTip::NotifyWindowDelete( WXHWND win )
void wxMacToolTip::Clear() void wxMacToolTip::Clear()
{ {
m_mark++ ; m_mark++ ;
#if wxUSE_TIMER
if ( m_timer ) if ( m_timer )
{ {
delete m_timer ; delete m_timer ;
m_timer = NULL ; m_timer = NULL ;
} }
#endif // wxUSE_TIMER
if ( !m_shown ) if ( !m_shown )
return ; return ;