From c757b5fee093bbc3686f1e474316396b742fb888 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 3 Jun 2006 19:20:23 +0000 Subject: [PATCH] correct access for virtuals, unneeded includes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39538 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/clrpicker.h | 4 +--- include/wx/filepicker.h | 29 ++++++++++++++--------------- include/wx/fontpicker.h | 5 ++--- include/wx/generic/filepickerg.h | 13 ++++++++----- include/wx/gtk/clrpicker.h | 2 +- include/wx/gtk/fontpicker.h | 1 + include/wx/pickerbase.h | 9 ++++++--- src/common/clrpickercmn.cpp | 1 + src/common/fontpickercmn.cpp | 2 ++ src/common/pickerbase.cpp | 1 + src/generic/clrpickerg.cpp | 7 ++----- src/generic/filepickerg.cpp | 7 +------ src/generic/fontpickerg.cpp | 7 ++----- src/gtk/clrpicker.cpp | 3 --- src/gtk/filepicker.cpp | 7 +------ src/gtk/fontpicker.cpp | 3 --- 16 files changed, 43 insertions(+), 58 deletions(-) diff --git a/include/wx/clrpicker.h b/include/wx/clrpicker.h index e36b8cca94..1742257d00 100644 --- a/include/wx/clrpicker.h +++ b/include/wx/clrpicker.h @@ -17,7 +17,6 @@ #if wxUSE_COLOURPICKERCTRL -#include "wx/control.h" #include "wx/pickerbase.h" @@ -137,11 +136,10 @@ public: // internal functions // event handler for our picker void OnColourChange(wxColourPickerEvent &); +protected: virtual long GetPickerStyle(long style) const { return (style & wxCLRP_SHOW_LABEL); } -protected: - // true if the next UpdateTextCtrl() call is to ignore bool m_bIgnoreNextTextCtrlUpdate; diff --git a/include/wx/filepicker.h b/include/wx/filepicker.h index 0564cf0e8e..d82fecb82a 100644 --- a/include/wx/filepicker.h +++ b/include/wx/filepicker.h @@ -14,15 +14,12 @@ #include "wx/defs.h" - #if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL -#include "wx/control.h" #include "wx/pickerbase.h" -#include "wx/filedlg.h" #include "wx/filename.h" - +class WXDLLIMPEXP_CORE wxDialog; class WXDLLIMPEXP_CORE wxFileDirPickerEvent; extern WXDLLEXPORT_DATA(const wxChar) wxFilePickerWidgetLabel[]; @@ -220,13 +217,6 @@ public: // overrides return true; } - // extracts the style for our picker from wxFileDirPickerCtrlBase's style - long GetPickerStyle(long style) const - { - return (style & (wxFLP_OPEN|wxFLP_SAVE|wxFLP_OVERWRITE_PROMPT| - wxFLP_FILE_MUST_EXIST|wxFLP_CHANGE_DIR)); - } - bool CheckPath(const wxString &path) const { return HasFlag(wxFLP_SAVE) || wxFileName::FileExists(path); @@ -238,6 +228,14 @@ public: // overrides wxEventType GetEventType() const { return wxEVT_COMMAND_FILEPICKER_CHANGED; } +protected: + // extracts the style for our picker from wxFileDirPickerCtrlBase's style + long GetPickerStyle(long style) const + { + return (style & (wxFLP_OPEN|wxFLP_SAVE|wxFLP_OVERWRITE_PROMPT| + wxFLP_FILE_MUST_EXIST|wxFLP_CHANGE_DIR)); + } + private: DECLARE_DYNAMIC_CLASS(wxFilePickerCtrl) }; @@ -299,10 +297,6 @@ public: // overrides return true; } - // extracts the style for our picker from wxFileDirPickerCtrlBase's style - long GetPickerStyle(long style) const - { return (style & (wxDIRP_DIR_MUST_EXIST|wxDIRP_CHANGE_DIR)); } - bool CheckPath(const wxString &path) const { if (HasFlag(wxDIRP_DIR_MUST_EXIST)) return wxFileName::DirExists(path); else return true; } @@ -312,6 +306,11 @@ public: // overrides wxEventType GetEventType() const { return wxEVT_COMMAND_DIRPICKER_CHANGED; } +protected: + // extracts the style for our picker from wxFileDirPickerCtrlBase's style + long GetPickerStyle(long style) const + { return (style & (wxDIRP_DIR_MUST_EXIST|wxDIRP_CHANGE_DIR)); } + private: DECLARE_DYNAMIC_CLASS(wxDirPickerCtrl) }; diff --git a/include/wx/fontpicker.h b/include/wx/fontpicker.h index e559e8d780..4175ba3f05 100644 --- a/include/wx/fontpicker.h +++ b/include/wx/fontpicker.h @@ -17,7 +17,6 @@ #if wxUSE_FONTPICKERCTRL -#include "wx/control.h" #include "wx/pickerbase.h" @@ -156,12 +155,12 @@ public: // internal functions virtual wxString Font2String(const wxFont &font); virtual wxFont String2Font(const wxString &font); +protected: + // extracts the style for our picker from wxFontPickerCtrl's style long GetPickerStyle(long style) const { return (style & (wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL)); } -protected: - // true if the next UpdateTextCtrl() call is to ignore bool m_bIgnoreNextTextCtrlUpdate; diff --git a/include/wx/generic/filepickerg.h b/include/wx/generic/filepickerg.h index 51a019b8df..ec23c505bd 100644 --- a/include/wx/generic/filepickerg.h +++ b/include/wx/generic/filepickerg.h @@ -13,7 +13,6 @@ #define _WX_FILEDIRPICKER_H_ #include "wx/button.h" -#include "wx/filename.h" #include "wx/filedlg.h" #include "wx/dirdlg.h" @@ -136,12 +135,14 @@ public: // overrideable return p; } + wxEventType GetEventType() const + { return wxEVT_COMMAND_FILEPICKER_CHANGED; } + +protected: void UpdateDialogPath(wxDialog *p) { wxStaticCast(p, wxFileDialog)->SetPath(m_path); } void UpdatePathFromDialog(wxDialog *p) { m_path = wxStaticCast(p, wxFileDialog)->GetPath(); } - wxEventType GetEventType() const - { return wxEVT_COMMAND_FILEPICKER_CHANGED; } private: DECLARE_DYNAMIC_CLASS(wxGenericFileButton) @@ -193,12 +194,14 @@ public: // overrideable GetDialogStyle()); } + wxEventType GetEventType() const + { return wxEVT_COMMAND_DIRPICKER_CHANGED; } + +protected: void UpdateDialogPath(wxDialog *p) { wxStaticCast(p, wxDirDialog)->SetPath(m_path); } void UpdatePathFromDialog(wxDialog *p) { m_path = wxStaticCast(p, wxDirDialog)->GetPath(); } - wxEventType GetEventType() const - { return wxEVT_COMMAND_DIRPICKER_CHANGED; } private: DECLARE_DYNAMIC_CLASS(wxGenericDirButton) diff --git a/include/wx/gtk/clrpicker.h b/include/wx/gtk/clrpicker.h index 5e54c4c298..5a301ad9b6 100644 --- a/include/wx/gtk/clrpicker.h +++ b/include/wx/gtk/clrpicker.h @@ -52,9 +52,9 @@ public: // overrides const wxValidator& validator = wxDefaultValidator, const wxString& name = wxColourPickerWidgetNameStr); +protected: void UpdateColour(); - public: // used by the GTK callback only GdkColor *GetGdkColor() const diff --git a/include/wx/gtk/fontpicker.h b/include/wx/gtk/fontpicker.h index 8c97e936be..06ba2ed99f 100644 --- a/include/wx/gtk/fontpicker.h +++ b/include/wx/gtk/fontpicker.h @@ -51,6 +51,7 @@ public: // overrides const wxValidator& validator = wxDefaultValidator, const wxString& name = wxFontPickerWidgetNameStr); +protected: void UpdateFont(); diff --git a/include/wx/pickerbase.h b/include/wx/pickerbase.h index d5bd9a5c47..64714f4399 100644 --- a/include/wx/pickerbase.h +++ b/include/wx/pickerbase.h @@ -12,9 +12,11 @@ #ifndef _WX_PICKERBASE_H_BASE_ #define _WX_PICKERBASE_H_BASE_ -#include "wx/defs.h" -#include "wx/button.h" -#include "wx/textctrl.h" +#include "wx/control.h" + +class WXDLLIMPEXP_CORE wxTextCtrl; + +extern WXDLLEXPORT_DATA(const wxChar) wxButtonNameStr[]; // ---------------------------------------------------------------------------- // wxPickerBase is the base class for the picker controls which support @@ -70,6 +72,7 @@ public: // wxWindow overrides int maxW = wxDefaultCoord, int maxH = wxDefaultCoord, int incW = wxDefaultCoord, int incH = wxDefaultCoord ); +protected: void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); diff --git a/src/common/clrpickercmn.cpp b/src/common/clrpickercmn.cpp index 412eaadc7b..9007e15ad8 100644 --- a/src/common/clrpickercmn.cpp +++ b/src/common/clrpickercmn.cpp @@ -28,6 +28,7 @@ #include "wx/clrpicker.h" +#include "wx/textctrl.h" // ============================================================================ diff --git a/src/common/fontpickercmn.cpp b/src/common/fontpickercmn.cpp index a3b766e571..35bb1653f6 100644 --- a/src/common/fontpickercmn.cpp +++ b/src/common/fontpickercmn.cpp @@ -27,6 +27,8 @@ #if wxUSE_FONTPICKERCTRL #include "wx/fontpicker.h" + +#include "wx/textctrl.h" #include "wx/fontenum.h" #include "wx/tokenzr.h" diff --git a/src/common/pickerbase.cpp b/src/common/pickerbase.cpp index 68ff4a88ee..6d56d2da25 100644 --- a/src/common/pickerbase.cpp +++ b/src/common/pickerbase.cpp @@ -26,6 +26,7 @@ #include "wx/pickerbase.h" +#include "wx/textctrl.h" // ============================================================================ // implementation diff --git a/src/generic/clrpickerg.cpp b/src/generic/clrpickerg.cpp index e0db6bbb01..497bfa0a01 100644 --- a/src/generic/clrpickerg.cpp +++ b/src/generic/clrpickerg.cpp @@ -24,11 +24,10 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP - #include "wx/window.h" -#endif //WX_PRECOMP +#if wxUSE_COLOURPICKERCTRL #include "wx/clrpicker.h" + #include "wx/colordlg.h" @@ -36,8 +35,6 @@ // implementation // ============================================================================ -#if wxUSE_COLOURPICKERCTRL - wxColourData wxGenericColourButton::ms_data; IMPLEMENT_DYNAMIC_CLASS(wxGenericColourButton, wxButton) diff --git a/src/generic/filepickerg.cpp b/src/generic/filepickerg.cpp index f5f128d50d..55583a121e 100644 --- a/src/generic/filepickerg.cpp +++ b/src/generic/filepickerg.cpp @@ -24,20 +24,15 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP - #include "wx/window.h" -#endif //WX_PRECOMP +#if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL #include "wx/filepicker.h" -#include "wx/filedlg.h" // ============================================================================ // implementation // ============================================================================ -#if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL - IMPLEMENT_DYNAMIC_CLASS(wxGenericFileButton, wxButton) IMPLEMENT_DYNAMIC_CLASS(wxGenericDirButton, wxButton) diff --git a/src/generic/fontpickerg.cpp b/src/generic/fontpickerg.cpp index 1a67f07b85..06a5c5c539 100644 --- a/src/generic/fontpickerg.cpp +++ b/src/generic/fontpickerg.cpp @@ -24,11 +24,10 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP - #include "wx/window.h" -#endif //WX_PRECOMP +#if wxUSE_FONTPICKERCTRL #include "wx/fontpicker.h" + #include "wx/fontdlg.h" @@ -36,8 +35,6 @@ // implementation // ============================================================================ -#if wxUSE_FONTPICKERCTRL - wxFontData wxGenericFontButton::ms_data; IMPLEMENT_DYNAMIC_CLASS(wxGenericFontButton, wxButton) diff --git a/src/gtk/clrpicker.cpp b/src/gtk/clrpicker.cpp index 9b5cc89a47..5ba0324488 100644 --- a/src/gtk/clrpicker.cpp +++ b/src/gtk/clrpicker.cpp @@ -21,9 +21,6 @@ #include "wx/clrpicker.h" -#include "wx/gtk/private.h" - -#include #include // ============================================================================ diff --git a/src/gtk/filepicker.cpp b/src/gtk/filepicker.cpp index f6dc7254df..6784f90430 100644 --- a/src/gtk/filepicker.cpp +++ b/src/gtk/filepicker.cpp @@ -21,13 +21,8 @@ #include "wx/filepicker.h" -#include "wx/gtk/private.h" +#include "wx/tooltip.h" -#if wxUSE_TOOLTIPS - #include "wx/tooltip.h" -#endif - -#include #include #include // chdir diff --git a/src/gtk/fontpicker.cpp b/src/gtk/fontpicker.cpp index 5c7f24b383..27d8bb19bf 100644 --- a/src/gtk/fontpicker.cpp +++ b/src/gtk/fontpicker.cpp @@ -24,9 +24,6 @@ #include "wx/fontutil.h" // for wxNativeFontInfo #include "wx/gtk/private.h" -#include -#include - // ============================================================================ // implementation // ============================================================================ -- 2.45.2