]> git.saurik.com Git - wxWidgets.git/commitdiff
partially applied patch #895170: "Building with minimal setup.h - continuation"
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Sun, 30 May 2004 15:14:41 +0000 (15:14 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Sun, 30 May 2004 15:14:41 +0000 (15:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27513 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/button.h
include/wx/chkconf.h
include/wx/choicdlg.h
include/wx/log.h
src/common/wincmn.cpp
src/html/helpdata.cpp
src/msw/clipbrd.cpp
src/msw/display.cpp
src/msw/tglbtn.cpp
src/msw/window.cpp
src/univ/themes/win32.cpp

index 1e7f14a0f77e406c309a569e209d1859fe953624..428e6e0611e677b9b48c3d0179624f64fe0cb73a 100644 (file)
 
 #include "wx/defs.h"
 
-#if wxUSE_BUTTON
-
 // ----------------------------------------------------------------------------
-// wxButton flags
+// wxButton flags shared with other classes
 // ----------------------------------------------------------------------------
 
-// These two flags are obsolete
-#define wxBU_NOAUTODRAW      0x0000
-#define wxBU_AUTODRAW        0x0004
+#if wxUSE_TOGGLEBTN || wxUSE_BUTTON
 
 // These flags affect label alignment
 #define wxBU_LEFT            0x0040
 #define wxBU_RIGHT           0x0100
 #define wxBU_BOTTOM          0x0200
 
+#endif
+
+#if wxUSE_BUTTON
+
+// ----------------------------------------------------------------------------
+// wxButton specific flags
+// ----------------------------------------------------------------------------
+
+// These two flags are obsolete
+#define wxBU_NOAUTODRAW      0x0000
+#define wxBU_AUTODRAW        0x0004
+
 // by default, the buttons will be created with some (system dependent)
 // minimal size to make them look nicer, giving this style will make them as
 // small as possible
index 98e5bca5e33dfcbf7cf8a30d5d19c4dd3edae918..ddcf097547e3d1a94d6599dfa377dcb373ac4e5b 100644 (file)
 #    endif
 #endif /* controls */
 
+#if wxUSE_BMPBUTTON
+#    if !wxUSE_BUTTON
+#        ifdef wxABORT_ON_CONFIG_ERROR
+#            error "wxUSE_BMPBUTTON requires wxUSE_BUTTON"
+#        else
+#            undef wxUSE_BUTTON
+#            define wxUSE_BUTTON 1
+#        endif
+#    endif
+#endif /* wxUSE_BMPBUTTON */
+
 #if wxUSE_NOTEBOOK || wxUSE_LISTBOOK
 #   if defined(wxUSE_BOOKCTRL) && !wxUSE_BOOKCTRL
 #       ifdef wxABORT_ON_CONFIG_ERROR
 #   endif
 #endif /* wxUSE_RADIOBTN */
 
+#if wxUSE_HELP
+#   if !wxUSE_BMPBUTTON
+#       ifdef wxABORT_ON_CONFIG_ERROR
+#           error "wxUSE_HELP requires wxUSE_BMPBUTTON"
+#       else
+#           undef wxUSE_BMPBUTTON
+#           define wxUSE_BMPBUTTON 1
+#       endif
+#   endif
+#endif /* wxUSE_HELP */
+
 #if wxUSE_WXHTML_HELP
 #   if !wxUSE_HELP || !wxUSE_HTML || !wxUSE_COMBOBOX || !wxUSE_NOTEBOOK
 #       ifdef wxABORT_ON_CONFIG_ERROR
 #   endif
 #endif /* wxUSE_FILEDLG */
 
+#if !wxUSE_BUTTON
+#   if wxUSE_PROGRESSDLG || \
+       wxUSE_FONTDLG || \
+       wxUSE_FILEDLG || \
+       wxUSE_CHOICEDLG || \
+       wxUSE_NUMBERDLG || \
+       wxUSE_TEXTDLG || \
+       wxUSE_DIRDLG || \
+       wxUSE_STARTUP_TIPS || \
+       wxUSE_WIZARDDLG
+#       ifdef wxABORT_ON_CONFIG_ERROR
+#           error "Common and generic dialogs require wxUSE_BUTTON"
+#       else
+#           undef wxUSE_BUTTON
+#           define wxUSE_BUTTON 1
+#       endif
+#   endif
+#endif /* wxUSE_PROGRESSDLG */
+
 #if !wxUSE_TOOLBAR
 #   if wxUSE_TOOLBAR_NATIVE
 #        ifdef wxABORT_ON_CONFIG_ERROR
 #endif /* wxUSE_LOGWINDOW */
 
 #if wxUSE_LOG_DIALOG
-#    if !wxUSE_LISTCTRL
+#    if !wxUSE_LISTCTRL || !wxUSE_BUTTON
 #        ifdef wxABORT_ON_CONFIG_ERROR
-#            error "wxUSE_LOG_DIALOG requires wxUSE_LISTCTRL"
+#            error "wxUSE_LOG_DIALOG requires wxUSE_LISTCTRL and wxUSE_BUTTON"
 #        else
 #            undef wxUSE_LISTCTRL
 #            define wxUSE_LISTCTRL 1
+#            undef wxUSE_BUTTON
+#            define wxUSE_BUTTON 1
 #        endif
 #    endif
 #endif /* wxUSE_LOG_DIALOG */
index 52439ffd71489777e58ceca15470a126a154935e..daa7b778809ee6697c278eb2373fc2a3c96a4302 100644 (file)
@@ -1,7 +1,11 @@
 #ifndef _WX_CHOICDLG_H_BASE_
 #define _WX_CHOICDLG_H_BASE_
 
+#if wxUSE_CHOICEDLG
+
 #include "wx/generic/choicdgg.h"
 
+#endif
+
 #endif
     // _WX_CHOICDLG_H_BASE_
index eb7a58c98a677566bdaee654fb2348b4b5eb3dc0..6de7068a4427588924c1df4ccb923f537f2f3564 100644 (file)
 
 #include "wx/defs.h"
 
+// ----------------------------------------------------------------------------
+// common constants for use in wxUSE_LOG/!wxUSE_LOG
+// ----------------------------------------------------------------------------
+
+// the trace masks have been superceded by symbolic trace constants, they're
+// for compatibility only andwill be removed soon - do NOT use them
+
+// meaning of different bits of the trace mask (which allows selectively
+// enable/disable some trace messages)
+#define wxTraceMemAlloc 0x0001  // trace memory allocation (new/delete)
+#define wxTraceMessages 0x0002  // trace window messages/X callbacks
+#define wxTraceResAlloc 0x0004  // trace GDI resource allocation
+#define wxTraceRefCount 0x0008  // trace various ref counting operations
+
+#ifdef  __WXMSW__
+    #define wxTraceOleCalls 0x0100  // OLE interface calls
+#endif
+
 // ----------------------------------------------------------------------------
 // types
 // ----------------------------------------------------------------------------
@@ -93,20 +111,6 @@ enum
     #define wxTRACE_OleCalls wxT("ole")  // OLE interface calls
 #endif
 
-// the trace masks have been superceded by symbolic trace constants, they're
-// for compatibility only andwill be removed soon - do NOT use them
-
-// meaning of different bits of the trace mask (which allows selectively
-// enable/disable some trace messages)
-#define wxTraceMemAlloc 0x0001  // trace memory allocation (new/delete)
-#define wxTraceMessages 0x0002  // trace window messages/X callbacks
-#define wxTraceResAlloc 0x0004  // trace GDI resource allocation
-#define wxTraceRefCount 0x0008  // trace various ref counting operations
-
-#ifdef  __WXMSW__
-    #define wxTraceOleCalls 0x0100  // OLE interface calls
-#endif
-
 #include "wx/iosfwrap.h"
 
 // ----------------------------------------------------------------------------
@@ -444,9 +448,6 @@ extern void expdecl wxVLog##level(arg, const wxChar *szFormat,              \
                                       va_list argptr);                      \
 extern void expdecl wxLog##level(arg, const wxChar *szFormat,               \
                                      ...) ATTRIBUTE_PRINTF_2
-#define DECLARE_LOG_FUNCTION2(level, arg)                                   \
-    DECLARE_LOG_FUNCTION2_EXP(level, arg, WXDLLIMPEXP_BASE)
-
 #else // !wxUSE_LOG
 
 // log functions do nothing at all
@@ -454,7 +455,7 @@ extern void expdecl wxLog##level(arg, const wxChar *szFormat,               \
 inline void wxVLog##level(const wxChar *szFormat,                           \
                                      va_list argptr) { }                    \
 inline void wxLog##level(const wxChar *szFormat, ...) { }
-#define DECLARE_LOG_FUNCTION2(level, arg)                                   \
+#define DECLARE_LOG_FUNCTION2_EXP(level, arg, expdecl)                      \
 inline void wxVLog##level(arg, const wxChar *szFormat,                      \
                                      va_list argptr) {}                     \
 inline void wxLog##level(arg, const wxChar *szFormat, ...) { }
@@ -474,6 +475,9 @@ public:
 #define wxTRACE_OleCalls wxEmptyString // OLE interface calls
 
 #endif // wxUSE_LOG/!wxUSE_LOG
+#define DECLARE_LOG_FUNCTION2(level, arg)                                   \
+    DECLARE_LOG_FUNCTION2_EXP(level, arg, WXDLLIMPEXP_BASE)
+
 
 // a generic function for all levels (level is passes as parameter)
 DECLARE_LOG_FUNCTION2(Generic, wxLogLevel level);
@@ -492,6 +496,7 @@ DECLARE_LOG_FUNCTION(Status);
 
 #if wxUSE_GUI
     // this one is the same as previous except that it allows to explicitly
+    class wxFrame;
     // specify the frame to which the output should go
     DECLARE_LOG_FUNCTION2_EXP(Status, wxFrame *pFrame, WXDLLIMPEXP_CORE);
 #endif // wxUSE_GUI
index 0cb93c366559b6bd169fedbf1e7b3f48e3945260..d39583bbb8e2e2ab604fafa37f24c109d5cd8a25 100644 (file)
@@ -2570,9 +2570,11 @@ wxAccStatus wxWindowAccessible::GetName(int childId, wxString* name)
     // This will eventually be replaced by specialised
     // accessible classes, one for each kind of wxWidgets
     // control or window.
+#if wxUSE_BUTTON
     if (GetWindow()->IsKindOf(CLASSINFO(wxButton)))
         title = ((wxButton*) GetWindow())->GetLabel();
     else
+#endif
         title = GetWindow()->GetName();
 
     if (!title.IsEmpty())
index c0418b8d392ae0a489f003650281efe04cc29eae..88cad1d2a8898c5c647f6ff5b51405737afdc00e 100644 (file)
@@ -543,6 +543,7 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile,
     // Now store the contents range
     bookr->SetContentsRange(cont_start, m_ContentsCnt);
 
+#if wxUSE_FONTMAP
     // Convert encoding, if neccessary:
     if (encoding != wxFONTENCODING_SYSTEM)
     {
@@ -559,6 +560,11 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile,
                 conv.Convert(m_Contents[i].m_Name);
         }
     }
+#else
+    wxUnusedVar(IndexOld);
+    wxUnusedVar(ContentsOld);
+    wxASSERT_MSG(encoding == wxFONTENCODING_SYSTEM, wxT("Encoding can't be converted"));
+#endif
 
     m_BookRecords.Add(bookr);
     if (m_IndexCnt > 0)
index 49cc833ca9d30dcbaf5dcea1f074b46867a96aee..c3ed1b194b89ddf3354c7b988de9423796559fa7 100644 (file)
@@ -665,7 +665,7 @@ bool wxClipboard::AddData( wxDataObject *data )
         {
 #if 1
             // TODO
-            wxLogError("Not implemented because wxMetafileDataObject does not contain width and height values.");
+            wxLogError(wxT("Not implemented because wxMetafileDataObject does not contain width and height values."));
             return FALSE;
 #else
             wxMetafileDataObject* metaFileDataObject =
index 04ee1a7edfcf445ebe3fe2cb15728518a7613403..86f353b6d853ecfc40b8741806a2b61bfab8e975 100644 (file)
@@ -242,12 +242,16 @@ HRESULT WINAPI wxDDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc,
 // initialize gs_displays using DirectX functions
 static bool DoInitDirectX()
 {
+#if wxUSE_LOG
     // suppress the errors if ddraw.dll is not found
     wxLog::EnableLogging(false);
+#endif
 
     wxDynamicLibrary dllDX(_T("ddraw.dll"));
 
-    wxLog::EnableLogging(true);
+#if wxUSE_LOG
+    wxLog::EnableLogging();
+#endif
 
     if ( !dllDX.IsLoaded() )
         return false;
index 072604992c505fa3bab5398be3ef6f3272928e3b..9b6d07128d7e3f7118f16705d05de37f4c2f38f3 100644 (file)
@@ -130,11 +130,15 @@ wxSize wxToggleButton::DoGetBestSize() const
    // the button height is proportional to the height of the font used
    int hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar);
 
+#if wxUSE_BUTTON
    wxSize sz = wxButton::GetDefaultSize();
    if (wBtn > sz.x)
        sz.x = wBtn;
    if (hBtn > sz.y)
        sz.y = hBtn;
+#else
+   wxSize sz(wBtn, hBtn);
+#endif
 
    return sz;
 }
index ccb40f124c422f417a96d782eec7295f78cdbc25..6a4ffb7334591f6b0d09d742325fb9dff794b269 100644 (file)
@@ -1905,8 +1905,8 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
                                 return true;
                             }
                             else // no default button
-                            {
 #endif // wxUSE_BUTTON
+                            {
                                 // this is a quick and dirty test for a text
                                 // control
                                 if ( !(lDlgCode & DLGC_HASSETSEL) )
@@ -2346,9 +2346,11 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
 #ifndef __WXWINCE__
         case WM_PRINT:
             {
+#if wxUSE_LISTCTRL
                 // Don't call the wx handlers in this case
                 if ( wxIsKindOf(this, wxListCtrl) )
                     break;
+#endif
 
                 if ( lParam & PRF_ERASEBKGND )
                     HandleEraseBkgnd((WXHDC)(HDC)wParam);
@@ -5794,6 +5796,8 @@ bool wxWindowMSW::UnregisterHotKey(int hotkeyId)
     return true;
 }
 
+#if wxUSE_ACCEL
+
 bool wxWindowMSW::HandleHotKey(WXWPARAM wParam, WXLPARAM lParam)
 {
     int hotkeyId = wParam;
@@ -5810,6 +5814,8 @@ bool wxWindowMSW::HandleHotKey(WXWPARAM wParam, WXLPARAM lParam)
     return GetEventHandler()->ProcessEvent(event);
 }
 
+#endif // wxUSE_ACCEL
+
 #endif // wxUSE_HOTKEY
 
 // Not tested under WinCE
index 426420ec26f4b0efe24fd98b65b0c3b79e4a8276..cb69172cc561571ace5c4818344d6a7c4c234f36 100644 (file)
@@ -4543,7 +4543,9 @@ private:
    
     wxWin32FrameInputHandler *m_inputHnd;
     wxTopLevelWindow         *m_wnd;
+#if wxUSE_ACCEL
     wxAcceleratorTable        m_oldAccelTable;
+#endif
 };
 
 wxWin32SystemMenuEvtHandler::wxWin32SystemMenuEvtHandler(
@@ -4560,6 +4562,7 @@ void wxWin32SystemMenuEvtHandler::Attach(wxInputConsumer *consumer)
     m_wnd = wxStaticCast(consumer->GetInputWindow(), wxTopLevelWindow);
     m_wnd->PushEventHandler(this);
     
+#if wxUSE_ACCEL
     // VS: This code relies on using generic implementation of 
     //     wxAcceleratorTable in wxUniv!
     wxAcceleratorTable table = *m_wnd->GetAcceleratorTable();
@@ -4567,13 +4570,16 @@ void wxWin32SystemMenuEvtHandler::Attach(wxInputConsumer *consumer)
     table.Add(wxAcceleratorEntry(wxACCEL_ALT, WXK_SPACE, wxID_SYSTEM_MENU));
     table.Add(wxAcceleratorEntry(wxACCEL_ALT, WXK_F4, wxID_CLOSE_FRAME));
     m_wnd->SetAcceleratorTable(table);
+#endif
 }
 
 void wxWin32SystemMenuEvtHandler::Detach()
 {
     if ( m_wnd )
     {
+#if wxUSE_ACCEL
         m_wnd->SetAcceleratorTable(m_oldAccelTable);
+#endif
         m_wnd->RemoveEventHandler(this); 
         m_wnd = NULL;
     }
@@ -4595,10 +4601,16 @@ void wxWin32SystemMenuEvtHandler::OnSystemMenu(wxCommandEvent &WXUNUSED(event))
     pt.x = -pt.x + border;
     pt.y = -pt.y + border + FRAME_TITLEBAR_HEIGHT;
 
+#if wxUSE_ACCEL
     wxAcceleratorTable table = *m_wnd->GetAcceleratorTable();
     m_wnd->SetAcceleratorTable(wxNullAcceleratorTable);
+#endif
+
     m_inputHnd->PopupSystemMenu(m_wnd, pt);
+
+#if wxUSE_ACCEL
     m_wnd->SetAcceleratorTable(table);
+#endif
 }
 
 void wxWin32SystemMenuEvtHandler::OnCloseFrame(wxCommandEvent &WXUNUSED(event))