From 575821fad84c6f60602ffce6f8f6e727247ce651 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 12 Apr 2012 05:33:29 +0000 Subject: [PATCH] Add missing interface items for Phoenix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/pickerbase.h | 5 +++++ interface/wx/clrpicker.h | 11 +++++++++++ interface/wx/filepicker.h | 25 +++++++++++++++++++++++++ interface/wx/fontpicker.h | 12 ++++++++++++ interface/wx/pickerbase.h | 31 +++++++++++++++++++++++++++++++ 5 files changed, 84 insertions(+) diff --git a/include/wx/pickerbase.h b/include/wx/pickerbase.h index 16afd715f0..8b9be3dd0f 100644 --- a/include/wx/pickerbase.h +++ b/include/wx/pickerbase.h @@ -106,6 +106,11 @@ public: // public API wxControl *GetPickerCtrl() { return m_picker; } + void SetTextCtrl(wxTextCtrl* text) + { m_text = text; } + void SetPickerCtrl(wxControl* picker) + { m_picker = picker; } + // methods that derived class must/may override virtual void UpdatePickerFromTextCtrl() = 0; virtual void UpdateTextCtrlFromPicker() = 0; diff --git a/interface/wx/clrpicker.h b/interface/wx/clrpicker.h index 913c0fe831..be3c08ac8c 100644 --- a/interface/wx/clrpicker.h +++ b/interface/wx/clrpicker.h @@ -6,6 +6,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#define wxCLRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) +#define wxCLRP_DEFAULT_STYLE 0 +#define wxCLRP_SHOW_LABEL 0x0008 + +wxEventType wxEVT_COMMAND_COLOURPICKER_CHANGED; + + /** @class wxColourPickerCtrl @@ -46,6 +53,8 @@ class wxColourPickerCtrl : public wxPickerBase { public: + wxColourPickerCtrl(); + /** Initializes the object and calls Create() with all the parameters. */ @@ -122,6 +131,8 @@ public: class wxColourPickerEvent : public wxCommandEvent { public: + wxColourPickerEvent(); + /** The constructor is not normally used by the user code. */ diff --git a/interface/wx/filepicker.h b/interface/wx/filepicker.h index 3053fcefc3..40cd69a499 100644 --- a/interface/wx/filepicker.h +++ b/interface/wx/filepicker.h @@ -6,6 +6,25 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#define wxFLP_OPEN 0x0400 +#define wxFLP_SAVE 0x0800 +#define wxFLP_OVERWRITE_PROMPT 0x1000 +#define wxFLP_FILE_MUST_EXIST 0x2000 +#define wxFLP_CHANGE_DIR 0x4000 +#define wxFLP_SMALL wxPB_SMALL +#define wxFLP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) +#define wxFLP_DEFAULT_STYLE (wxFLP_OPEN|wxFLP_FILE_MUST_EXIST) + +#define wxDIRP_DIR_MUST_EXIST 0x0008 +#define wxDIRP_CHANGE_DIR 0x0010 +#define wxDIRP_SMALL wxPB_SMALL +#define wxDIRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) +#define wxDIRP_DEFAULT_STYLE (wxDIRP_DIR_MUST_EXIST) + +wxEventType wxEVT_COMMAND_FILEPICKER_CHANGED; +wxEventType wxEVT_COMMAND_DIRPICKER_CHANGED; + + /** @class wxFilePickerCtrl @@ -60,6 +79,8 @@ class wxFilePickerCtrl : public wxPickerBase { public: + wxFilePickerCtrl(); + /** Initializes the object and calls Create() with all the parameters. @@ -201,6 +222,8 @@ public: class wxDirPickerCtrl : public wxPickerBase { public: + wxDirPickerCtrl(); + /** Initializes the object and calls Create() with all the parameters. @@ -311,6 +334,8 @@ public: class wxFileDirPickerEvent : public wxCommandEvent { public: + wxFileDirPickerEvent(); + /** The constructor is not normally used by the user code. */ diff --git a/interface/wx/fontpicker.h b/interface/wx/fontpicker.h index 0cbb18adeb..e354fc3742 100644 --- a/interface/wx/fontpicker.h +++ b/interface/wx/fontpicker.h @@ -6,6 +6,16 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// + +#define wxFNTP_FONTDESC_AS_LABEL 0x0008 +#define wxFNTP_USEFONT_FOR_LABEL 0x0010 +#define wxFONTBTN_DEFAULT_STYLE (wxFNTP_FONTDESC_AS_LABEL | wxFNTP_USEFONT_FOR_LABEL) +#define wxFNTP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) +#define wxFNTP_DEFAULT_STYLE (wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL) + +wxEventType wxEVT_COMMAND_FONTPICKER_CHANGED; + + /** @class wxFontPickerCtrl @@ -49,6 +59,8 @@ class wxFontPickerCtrl : public wxPickerBase { public: + wxFontPickerCtrl(); + /** Initializes the object and calls Create() with all the parameters. diff --git a/interface/wx/pickerbase.h b/interface/wx/pickerbase.h index eec1fec175..c4b2f108f5 100644 --- a/interface/wx/pickerbase.h +++ b/interface/wx/pickerbase.h @@ -6,6 +6,11 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// + +#define wxPB_USE_TEXTCTRL 0x0002 +#define wxPB_SMALL 0x8000 + + /** @class wxPickerBase @@ -33,6 +38,20 @@ class wxPickerBase : public wxControl { public: + wxPickerBase(); + virtual ~wxPickerBase(); + + // if present, intercepts wxPB_USE_TEXTCTRL style and creates the text control + // The 3rd argument is the initial wxString to display in the text control + bool CreateBase(wxWindow *parent, + wxWindowID id, + const wxString& text = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxButtonNameStr); + /** Returns the margin (in pixel) between the picker and the text control. @@ -138,5 +157,17 @@ public: This function can be used only when HasTextCtrl() returns @true. */ void SetTextCtrlProportion(int prop); + + + void SetTextCtrl(wxTextCtrl* text); + void SetPickerCtrl(wxControl* picker); + + virtual void UpdatePickerFromTextCtrl() = 0; + virtual void UpdateTextCtrlFromPicker() = 0; + +protected: + virtual long GetTextCtrlStyle(long style) const; + virtual long GetPickerStyle(long style) const; + void PostCreation(); }; -- 2.45.2