00001 
00002 
00003 
00004 
00005 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00016 
00017 #ifndef _WXXTRA_GENERIC_COMBOCONTROL_H_
00018 #define _WXXTRA_GENERIC_COMBOCONTROL_H_
00019 
00020 #include <wx/wx.h>
00021 #include <wx/xrc/xmlres.h>
00022 
00023 #if wxUSE_COMBOCTRL
00024 #undef wxXTRA_COMBOCTRL
00025 #else
00026 #define wxXTRA_COMBOCTRL 1
00027 
00028 #include "combo.h"
00029 
00030 
00031 #if !defined(wxCOMBOCONTROL_FULLY_FEATURED)
00032 
00033 
00034 
00035 
00036 
00037 #if defined(__WXUNIVERSAL__)
00038 
00039 
00040 
00041 
00042 #define wxACTION_COMBOBOX_POPUP     _T("popup")
00043 #define wxACTION_COMBOBOX_DISMISS   _T("dismiss")
00044 
00045 #endif
00046 
00047 extern WXDLLIMPEXP_DATA_CORE(const wxChar *) wxComboBoxNameStr;
00048 
00049 class WXDLLEXPORT wxGenericComboControl : public wxComboCtrlBase
00050 {
00051 public:
00052     
00053     wxGenericComboControl() : wxComboCtrlBase() { Init(); }
00054 
00055     wxGenericComboControl(wxWindow *parent,
00056                           wxWindowID id = wxID_ANY,
00057                           const wxString& value = wxEmptyString,
00058                           const wxPoint& pos = wxDefaultPosition,
00059                           const wxSize& size = wxDefaultSize,
00060                           long style = 0,
00061                           const wxValidator& validator = wxDefaultValidator,
00062                           const wxString& name = wxComboBoxNameStr)
00063         : wxComboCtrlBase()
00064     {
00065         Init();
00066 
00067         (void)Create(parent, id, value, pos, size, style, validator, name);
00068     }
00069 
00070     bool Create(wxWindow *parent,
00071                 wxWindowID id = wxID_ANY,
00072                 const wxString& value = wxEmptyString,
00073                 const wxPoint& pos = wxDefaultPosition,
00074                 const wxSize& size = wxDefaultSize,
00075                 long style = 0,
00076                 const wxValidator& validator = wxDefaultValidator,
00077                 const wxString& name = wxComboBoxNameStr);
00078 
00079     virtual ~wxGenericComboControl();
00080 
00081     static int GetFeatures() { return wxComboCtrlFeatures::All; }
00082 
00083 #if defined(__WXUNIVERSAL__)
00084     
00085     virtual bool PerformAction(const wxControlAction& action,
00086                                long numArg = 0l,
00087                                const wxString& strArg = wxEmptyString);
00088 #endif
00089 
00090 protected:
00091 
00092     
00093     virtual void OnResize();
00094 
00095     
00096     void OnPaintEvent( wxPaintEvent& event );
00097     void OnMouseEvent( wxMouseEvent& event );
00098 
00099 private:
00100     void Init();
00101 
00102     DECLARE_EVENT_TABLE()
00103 
00104     DECLARE_DYNAMIC_CLASS(wxGenericComboControl)
00105 };
00106 
00107 
00108 #ifndef _WX_COMBOCONTROL_H_
00109 
00110 
00111 
00112 
00113 class WXDLLEXPORT wxComboCtrl : public wxGenericComboControl
00114 {
00115 public:
00116     wxComboCtrl() : wxGenericComboControl() {}
00117 
00118     wxComboCtrl(wxWindow *parent,
00119                    wxWindowID id = wxID_ANY,
00120                    const wxString& value = wxEmptyString,
00121                    const wxPoint& pos = wxDefaultPosition,
00122                    const wxSize& size = wxDefaultSize,
00123                    long style = 0,
00124                    const wxValidator& validator = wxDefaultValidator,
00125                    const wxString& name = wxComboBoxNameStr)
00126         : wxGenericComboControl()
00127     {
00128         (void)Create(parent, id, value, pos, size, style, validator, name);
00129     }
00130 
00131     virtual ~wxComboCtrl() {}
00132 
00133 protected:
00134 
00135 private:
00136     DECLARE_DYNAMIC_CLASS(wxComboCtrl)
00137 };
00138 
00139 #endif // _WX_COMBOCONTROL_H_
00140 
00141 #else
00142 
00143 #define wxGenericComboControl   wxComboCtrl
00144 
00145 #endif // !defined(wxCOMBOCONTROL_FULLY_FEATURED)
00146 
00147 #endif // wxUSE_COMBOCONTROL
00148 #endif
00149