combog.h

Go to the documentation of this file.
00001 // $Id: combog.h 1417 2006-07-06 19:56:27Z alex $
00002 /* @@tag:xara-cn-tp@@ THIRD PARTY COPYRIGHT */
00003 // The following line makes normalize.pl skip type fixing
00004 /* SKIPFIXTYPES: START */
00005 
00007 // Name:        wx/generic/combo.h
00008 // Purpose:     Generic wxComboControl
00009 // Author:      Jaakko Salli
00010 // Modified by:
00011 // Created:     Apr-30-2006
00012 // RCS-ID:      
00013 // Copyright:   (c) Jaakko Salli
00014 // Licence:     wxWindows licence
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 // Only define generic if native doesn't have all the features
00031 #if !defined(wxCOMBOCONTROL_FULLY_FEATURED)
00032 
00033 // ----------------------------------------------------------------------------
00034 // Generic wxComboCtrl
00035 // ----------------------------------------------------------------------------
00036 
00037 #if defined(__WXUNIVERSAL__)
00038 
00039 // all actions of single line text controls are supported
00040 
00041 // popup/dismiss the choice window
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     // ctors and such
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     // we have our own input handler and our own actions
00085     virtual bool PerformAction(const wxControlAction& action,
00086                                long numArg = 0l,
00087                                const wxString& strArg = wxEmptyString);
00088 #endif
00089 
00090 protected:
00091 
00092     // Mandatory virtuals
00093     virtual void OnResize();
00094 
00095     // Event handlers
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 // If native wxComboCtrl was not defined, then prepare a simple
00111 // front-end so that wxRTTI works as expected.
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     // _WX_GENERIC_COMBOCONTROL_H_

Generated on Sat Nov 10 03:49:00 2007 for Camelot by  doxygen 1.4.4