From 00dd3b1897bd74276234f449f68e3f0805eb77dc Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Mon, 3 Feb 2003 20:56:40 +0000 Subject: [PATCH] Do not #include an header where a forward declaration suffixes. Do not include wx/wx.h directly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19091 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/imaglist.h | 8 +++++--- include/wx/generic/notebook.h | 22 +--------------------- include/wx/motif/bmpbuttn.h | 1 + include/wx/motif/button.h | 1 - include/wx/motif/cursor.h | 6 +----- include/wx/propform.h | 3 +++ src/common/bmpbase.cpp | 1 - src/generic/imaglist.cpp | 1 + src/generic/notebook.cpp | 22 ++++++++++++++++++++++ src/generic/propform.cpp | 5 ++++- src/generic/tabg.cpp | 3 ++- src/motif/mdi.cpp | 1 + src/motif/toolbar.cpp | 2 +- 13 files changed, 42 insertions(+), 34 deletions(-) diff --git a/include/wx/generic/imaglist.h b/include/wx/generic/imaglist.h index be21d3dcfa..792ef32ad0 100644 --- a/include/wx/generic/imaglist.h +++ b/include/wx/generic/imaglist.h @@ -16,9 +16,11 @@ #endif #include "wx/defs.h" -#include "wx/gdicmn.h" -#include "wx/bitmap.h" -#include "wx/dc.h" +#include "wx/list.h" + +class WXDLLEXPORT wxDC; +class WXDLLEXPORT wxBitmap; +class WXDLLEXPORT wxColour; /* * wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to diff --git a/include/wx/generic/notebook.h b/include/wx/generic/notebook.h index 3743ac8484..ccb9227047 100644 --- a/include/wx/generic/notebook.h +++ b/include/wx/generic/notebook.h @@ -18,10 +18,8 @@ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- -#include "wx/dynarray.h" #include "wx/event.h" #include "wx/control.h" -#include "wx/generic/tabg.h" // ---------------------------------------------------------------------------- // types @@ -30,30 +28,12 @@ // fwd declarations class WXDLLEXPORT wxImageList; class WXDLLEXPORT wxWindow; +class WXDLLEXPORT wxTabView; // ---------------------------------------------------------------------------- // wxNotebook // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxNotebook; - -// This reuses wxTabView to draw the tabs. -class WXDLLEXPORT wxNotebookTabView: public wxTabView -{ -DECLARE_DYNAMIC_CLASS(wxNotebookTabView) -public: - wxNotebookTabView(wxNotebook* notebook, long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR); - ~wxNotebookTabView(void); - - // Called when a tab is activated - virtual void OnTabActivate(int activateId, int deactivateId); - // Allows vetoing - virtual bool OnTabPreActivate(int activateId, int deactivateId); - -protected: - wxNotebook* m_notebook; -}; - class wxNotebook : public wxNotebookBase { public: diff --git a/include/wx/motif/bmpbuttn.h b/include/wx/motif/bmpbuttn.h index b1fa37bd96..d385c6ac69 100644 --- a/include/wx/motif/bmpbuttn.h +++ b/include/wx/motif/bmpbuttn.h @@ -17,6 +17,7 @@ #endif #include "wx/button.h" +#include "wx/bitmap.h" WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr; diff --git a/include/wx/motif/button.h b/include/wx/motif/button.h index dc69dceae7..08fe446a8a 100644 --- a/include/wx/motif/button.h +++ b/include/wx/motif/button.h @@ -17,7 +17,6 @@ #endif #include "wx/control.h" -#include "wx/gdicmn.h" WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr; diff --git a/include/wx/motif/cursor.h b/include/wx/motif/cursor.h index 8ec642b7c9..93b7a10f7e 100644 --- a/include/wx/motif/cursor.h +++ b/include/wx/motif/cursor.h @@ -17,11 +17,7 @@ #endif #include "wx/bitmap.h" -#if wxUSE_IMAGE -#include "wx/image.h" -#endif - - +#include "wx/list.h" /* Cursor for one display, so we can choose the correct one for * the current display. diff --git a/include/wx/propform.h b/include/wx/propform.h index 723fc50333..255b85204b 100644 --- a/include/wx/propform.h +++ b/include/wx/propform.h @@ -19,6 +19,9 @@ #if wxUSE_PROPSHEET #include "wx/prop.h" +#include "wx/panel.h" + +class WXDLLEXPORT wxPropertyFormView; //// //// Property form classes: for using an existing dialog or panel diff --git a/src/common/bmpbase.cpp b/src/common/bmpbase.cpp index 561c013ec3..e92f2c3b2c 100644 --- a/src/common/bmpbase.cpp +++ b/src/common/bmpbase.cpp @@ -21,7 +21,6 @@ #if defined(__WXMGL__) || defined(__WXMAC__) || defined(__WXMOTIF__) -#include "wx/wx.h" #include "wx/setup.h" #include "wx/utils.h" #include "wx/palette.h" diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 308c87d287..aa0e88d756 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -21,6 +21,7 @@ #include "wx/generic/imaglist.h" #include "wx/icon.h" #include "wx/image.h" +#include "wx/dc.h" //----------------------------------------------------------------------------- // wxImageList diff --git a/src/generic/notebook.cpp b/src/generic/notebook.cpp index 118b9dd1f7..0f6f0036aa 100644 --- a/src/generic/notebook.cpp +++ b/src/generic/notebook.cpp @@ -33,6 +33,7 @@ #include "wx/generic/imaglist.h" #include "wx/notebook.h" #include "wx/dcclient.h" +#include "wx/generic/tabg.h" // ---------------------------------------------------------------------------- // macros @@ -65,6 +66,27 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent) // implementation // ============================================================================ +// ============================================================================ +// Private class +// ============================================================================ + +// This reuses wxTabView to draw the tabs. +class WXDLLEXPORT wxNotebookTabView: public wxTabView +{ +DECLARE_DYNAMIC_CLASS(wxNotebookTabView) +public: + wxNotebookTabView(wxNotebook* notebook, long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR); + ~wxNotebookTabView(void); + + // Called when a tab is activated + virtual void OnTabActivate(int activateId, int deactivateId); + // Allows vetoing + virtual bool OnTabPreActivate(int activateId, int deactivateId); + +protected: + wxNotebook* m_notebook; +}; + // ---------------------------------------------------------------------------- // wxNotebook construction // ---------------------------------------------------------------------------- diff --git a/src/generic/propform.cpp b/src/generic/propform.cpp index 21dc41e4ae..5fc2aa91e0 100644 --- a/src/generic/propform.cpp +++ b/src/generic/propform.cpp @@ -23,9 +23,12 @@ #if wxUSE_PROPSHEET #ifndef WX_PRECOMP + #include "wx/choice.h" + #include "wx/checkbox.h" + #include "wx/slider.h" + #include "wx/msgdlg.h" #endif -#include "wx/wx.h" #include "wx/propform.h" #include diff --git a/src/generic/tabg.cpp b/src/generic/tabg.cpp index 07f83c62dc..bb3fc77c3d 100644 --- a/src/generic/tabg.cpp +++ b/src/generic/tabg.cpp @@ -23,7 +23,8 @@ #if wxUSE_TAB_DIALOG #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/settings.h" + #include "wx/intl.h" #endif #include diff --git a/src/motif/mdi.cpp b/src/motif/mdi.cpp index 4ee31d8bbc..ef6cb3a192 100644 --- a/src/motif/mdi.cpp +++ b/src/motif/mdi.cpp @@ -18,6 +18,7 @@ #define XtWindow XTWINDOW #endif +#include "wx/tab.h" #include "wx/mdi.h" #include "wx/menu.h" #include "wx/settings.h" diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp index a96885dd6c..c02fbac244 100644 --- a/src/motif/toolbar.cpp +++ b/src/motif/toolbar.cpp @@ -25,7 +25,7 @@ #define XtDisplay XTDISPLAY #endif -#include "wx/wx.h" +#include "wx/settings.h" #include "wx/app.h" #include "wx/timer.h" #include "wx/toolbar.h"