From 461dae941dac51a523a4280d3e1800143b720305 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 7 Feb 2004 14:26:00 +0000 Subject: [PATCH] fixes for compiling with more stuff disabled in setup.h (patch 889211) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/appcmn.cpp | 5 +++++ src/generic/htmllbox.cpp | 3 +++ src/generic/logg.cpp | 4 ++++ src/generic/wizard.cpp | 4 ++++ src/msw/accel.cpp | 3 +++ src/msw/cursor.cpp | 2 ++ src/msw/nativdlg.cpp | 33 ++++++++++++++++++++++++++++----- src/msw/ole/dataobj.cpp | 4 ++++ 8 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 769a9d18b5..1255c30938 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -465,7 +465,12 @@ void wxAppBase::OnIdle(wxIdleEvent& WXUNUSED(event)) wxLog *wxGUIAppTraitsBase::CreateLogTarget() { +#if wxUSE_LOGGUI return new wxLogGui; +#else + // wem ust have something! + return new wxLogStderr; +#endif } #endif // wxUSE_LOG diff --git a/src/generic/htmllbox.cpp b/src/generic/htmllbox.cpp index 4bbcf8399b..91be6e7ac7 100644 --- a/src/generic/htmllbox.cpp +++ b/src/generic/htmllbox.cpp @@ -28,6 +28,8 @@ #include "wx/dcclient.h" #endif //WX_PRECOMP +#if wxUSE_HTML + #include "wx/htmllbox.h" #include "wx/html/htmlcell.h" @@ -315,3 +317,4 @@ wxCoord wxHtmlListBox::OnMeasureItem(size_t n) const return cell->GetHeight() + cell->GetDescent() + 4; } +#endif diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index eb5e17745c..5871419db7 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -224,6 +224,8 @@ void wxLogStatus(wxFrame *pFrame, const wxChar *szFormat, ...) // wxLogGui implementation (FIXME MT-unsafe) // ---------------------------------------------------------------------------- +#if wxUSE_LOGGUI + wxLogGui::wxLogGui() { Clear(); @@ -420,6 +422,8 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t) } } +#endif // wxUSE_LOGGUI + // ---------------------------------------------------------------------------- // wxLogWindow and wxLogFrame implementation // ---------------------------------------------------------------------------- diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index bb0e6c6048..bd75dd9760 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -309,6 +309,7 @@ void wxWizard::AddBitmapRow(wxBoxSizer *mainColumn) wxEXPAND // No border, (mostly useless) horizontal stretching ); +#if wxUSE_STATBMP if ( m_bitmap.Ok() ) { m_statbmp = new wxStaticBitmap(this, -1, m_bitmap); @@ -324,6 +325,7 @@ void wxWizard::AddBitmapRow(wxBoxSizer *mainColumn) wxEXPAND // No border, (mostly useless) vertical stretching ); } +#endif // Added to m_sizerBmpAndPage in FinishLayout m_sizerPage = new wxWizardSizer(this); @@ -555,6 +557,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) bmpIsDefault = FALSE; } +#if wxUSE_STATBMP // change the bitmap if: // 1) a default bitmap was selected in constructor // 2) this page was constructed with a bitmap @@ -568,6 +571,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) bmp = m_page->GetBitmap(); m_statbmp->SetBitmap(bmp); } +#endif // and update the buttons state m_btnPrev->Enable(HasPrevPage(m_page)); diff --git a/src/msw/accel.cpp b/src/msw/accel.cpp index 563ce9929c..b25c03c146 100644 --- a/src/msw/accel.cpp +++ b/src/msw/accel.cpp @@ -26,6 +26,8 @@ #include "wx/accel.h" +#if wxUSE_ACCEL + #include "wx/msw/private.h" IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) @@ -166,3 +168,4 @@ bool wxAcceleratorTable::Translate(wxWindow *window, WXMSG *wxmsg) const return Ok() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg); } +#endif diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index 6333efd187..bd27803b40 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -172,6 +172,7 @@ wxCursor::wxCursor() { } +#if wxUSE_IMAGE wxCursor::wxCursor(const wxImage& image) { // image has to be of the standard cursor size, otherwise we won't be able @@ -200,6 +201,7 @@ wxCursor::wxCursor(const wxImage& image) m_refData = new wxCursorRefData(hcursor, true /* delete it later */); } +#endif wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), diff --git a/src/msw/nativdlg.cpp b/src/msw/nativdlg.cpp index 9c8c53505c..519176b336 100644 --- a/src/msw/nativdlg.cpp +++ b/src/msw/nativdlg.cpp @@ -185,25 +185,32 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) if (str == wxT("BUTTON")) { int style1 = (style & 0xFF); +#if wxUSE_CHECKBOX if ((style1 == BS_3STATE) || (style1 == BS_AUTO3STATE) || (style1 == BS_AUTOCHECKBOX) || (style1 == BS_CHECKBOX)) { win = new wxCheckBox; } - else if ((style1 == BS_AUTORADIOBUTTON) || (style1 == BS_RADIOBUTTON)) + else +#endif +#if wxUSE_RADIOBTN + if ((style1 == BS_AUTORADIOBUTTON) || (style1 == BS_RADIOBUTTON)) { win = new wxRadioButton; } + else +#endif #if wxUSE_BMPBUTTON #if defined(__WIN32__) && defined(BS_BITMAP) - else if (style & BS_BITMAP) + if (style & BS_BITMAP) { // TODO: how to find the bitmap? win = new wxBitmapButton; wxLogError(wxT("Have not yet implemented bitmap button as BS_BITMAP button.")); } + else #endif - else if (style1 == BS_OWNERDRAW) + if (style1 == BS_OWNERDRAW) { // TODO: how to find the bitmap? // TODO: can't distinguish between bitmap button and bitmap static. @@ -213,25 +220,34 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) // with a switch in the drawing code. Call default proc if BS_BITMAP. win = new wxBitmapButton; } + else #endif - else if ((style1 == BS_PUSHBUTTON) || (style1 == BS_DEFPUSHBUTTON)) +#if wxUSE_BUTTON + if ((style1 == BS_PUSHBUTTON) || (style1 == BS_DEFPUSHBUTTON)) { win = new wxButton; } - else if (style1 == BS_GROUPBOX) + else +#endif +#if wxUSE_STATBOX + if (style1 == BS_GROUPBOX) { win = new wxStaticBox; } else +#endif { wxLogError(wxT("Don't know what kind of button this is: id = %ld"), id); } } +#if wxUSE_COMBOBOX else if (str == wxT("COMBOBOX")) { win = new wxComboBox; } +#endif +#if wxUSE_TEXTCTRL // TODO: Problem if the user creates a multiline - but not rich text - text control, // since wxWin assumes RichEdit control for this. Should have m_isRichText in // wxTextCtrl. Also, convert as much of the window style as is necessary @@ -242,14 +258,19 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) { win = new wxTextCtrl; } +#endif +#if wxUSE_LISTBOX else if (str == wxT("LISTBOX")) { win = new wxListBox; } +#endif +#if wxUSE_SCROLLBAR else if (str == wxT("SCROLLBAR")) { win = new wxScrollBar; } +#endif #if defined(__WIN95__) && wxUSE_SPINBTN else if (str == wxT("MSCTLS_UPDOWN32")) { @@ -263,6 +284,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) win = new wxSlider; } #endif // wxUSE_SLIDER +#if wxUSE_STATTEXT else if (str == wxT("STATIC")) { int style1 = (style & 0xFF); @@ -285,6 +307,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) #endif #endif /* wxUSE_STATBMP */ } +#endif else { wxString msg(wxT("Don't know how to convert from Windows class ")); diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 6a4ef30670..68d5aa77fa 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -1220,6 +1220,8 @@ static const wxChar *GetTymedName(DWORD tymed) // wxDataObject // ---------------------------------------------------------------------------- +#if wxUSE_DATAOBJ + wxDataObject::wxDataObject() { } @@ -1241,3 +1243,5 @@ const wxChar *wxDataObject::GetFormatName(wxDataFormat format) #endif +#endif + -- 2.45.2