From e1d3601acaecd1c69c453b60610ba98f619bd383 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 5 Jan 2011 06:56:36 +0000 Subject: [PATCH] set eol-style and keywords properties on new files git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66584 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/rtti.h | 2 +- include/wx/variantbase.h | 558 ++++++------- include/wx/xtictor.h | 1040 ++++++++++++------------ include/wx/xtihandler.h | 220 ++--- include/wx/xtiprop.h | 1194 ++++++++++++++-------------- include/wx/xtitypes.h | 1162 +++++++++++++-------------- samples/xti/classlist.cpp | 2 +- samples/xti/classlist.h | 2 +- samples/xti/codereadercallback.cpp | 552 ++++++------- samples/xti/codereadercallback.h | 208 ++--- samples/xti/xti.bkl | 2 +- samples/xti/xti.cpp | 2 +- src/common/bmpbtncmn.cpp | 186 ++--- src/common/checkboxcmn.cpp | 178 ++--- src/common/checklstcmn.cpp | 204 ++--- src/common/dirctrlcmn.cpp | 170 ++-- src/common/gridcmn.cpp | 178 ++--- src/common/odcombocmn.cpp | 110 +-- src/common/panelcmn.cpp | 174 ++-- src/common/radiobtncmn.cpp | 186 ++--- src/common/scrolbarcmn.cpp | 180 ++--- src/common/slidercmn.cpp | 216 ++--- src/common/spinbtncmn.cpp | 198 ++--- src/common/statbmpcmn.cpp | 170 ++-- src/common/statboxcmn.cpp | 162 ++-- src/common/statlinecmn.cpp | 160 ++-- 26 files changed, 3708 insertions(+), 3708 deletions(-) diff --git a/include/wx/rtti.h b/include/wx/rtti.h index 12e4461a4b..e49838935c 100644 --- a/include/wx/rtti.h +++ b/include/wx/rtti.h @@ -4,7 +4,7 @@ // Author: Julian Smart // Modified by: Ron Lee // Created: 01/02/97 -// RCS-ID: $Id: rtti.h 48412 2007-08-27 17:04:02Z FM $ +// RCS-ID: $Id$ // Copyright: (c) 1997 Julian Smart // (c) 2001 Ron Lee // Licence: wxWindows licence diff --git a/include/wx/variantbase.h b/include/wx/variantbase.h index 5745c92af5..4d994f37a9 100644 --- a/include/wx/variantbase.h +++ b/include/wx/variantbase.h @@ -1,279 +1,279 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/variantbase.h -// Purpose: wxVariantBase class, a minimal version of wxVariant used by XTI -// Author: Julian Smart -// Modified by: Francesco Montorsi -// Created: 10/09/98 -// RCS-ID: $Id: variant.h 44625 2007-03-07 11:35:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_VARIANTBASE_H_ -#define _WX_VARIANTBASE_H_ - -#include "wx/defs.h" - -#if wxUSE_VARIANT - -#include "wx/string.h" -#include "wx/arrstr.h" -#include "wx/cpp.h" -#include - -#if wxUSE_DATETIME - #include "wx/datetime.h" -#endif // wxUSE_DATETIME - -#include "wx/iosfwrap.h" - -class wxTypeInfo; -class wxObject; -class wxClassInfo; - -/* - * wxVariantData stores the actual data in a wxVariant object, - * to allow it to store any type of data. - * Derive from this to provide custom data handling. - * - * NB: To prevent addition of extra vtbl pointer to wxVariantData, - * we don't multiple-inherit from wxObjectRefData. Instead, - * we simply replicate the wxObject ref-counting scheme. - * - * NB: When you construct a wxVariantData, it will have refcount - * of one. Refcount will not be further increased when - * it is passed to wxVariant. This simulates old common - * scenario where wxVariant took ownership of wxVariantData - * passed to it. - * If you create wxVariantData for other reasons than passing - * it to wxVariant, technically you are not required to call - * DecRef() before deleting it. - * - * TODO: in order to replace wxPropertyValue, we would need - * to consider adding constructors that take pointers to C++ variables, - * or removing that functionality from the wxProperty library. - * Essentially wxPropertyValue takes on some of the wxValidator functionality - * by storing pointers and not just actual values, allowing update of C++ data - * to be handled automatically. Perhaps there's another way of doing this without - * overloading wxVariant with unnecessary functionality. - */ - -class WXDLLIMPEXP_BASE wxVariantData -{ - friend class wxVariantBase; - -public: - wxVariantData() - : m_count(1) - { } - -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& WXUNUSED(str)) const { return false; } - virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; } -#endif - virtual bool Write(wxString& WXUNUSED(str)) const { return false; } - virtual bool Read(wxString& WXUNUSED(str)) { return false; } - - // Override these to provide common functionality - virtual bool Eq(wxVariantData& data) const = 0; - - // What type is it? Return a string name. - virtual wxString GetType() const = 0; - - // returns the type info of the content - virtual const wxTypeInfo* GetTypeInfo() const = 0; - - // If it based on wxObject return the ClassInfo. - virtual wxClassInfo* GetValueClassInfo() { return NULL; } - - int GetRefCount() const - { return m_count; } - void IncRef() - { m_count++; } - void DecRef() - { - if ( --m_count == 0 ) - delete this; - } - -protected: - // Protected dtor should make some incompatible code - // break more louder. That is, they should do data->DecRef() - // instead of delete data. - virtual ~wxVariantData() {} - -private: - int m_count; -}; - -template class wxVariantDataT : public wxVariantData -{ -public: - wxVariantDataT(const T& d) : m_data(d) {} - virtual ~wxVariantDataT() {} - - // get a ref to the stored data - T & Get() { return m_data; } - - // get a const ref to the stored data - const T & Get() const { return m_data; } - - // set the data - void Set(const T& d) { m_data = d; } - - // Override these to provide common functionality - virtual bool Eq(wxVariantData& WXUNUSED(data)) const - { return false; /* FIXME!! */ } - - // What type is it? Return a string name. - virtual wxString GetType() const - { return GetTypeInfo()->GetTypeName(); } - - // return a heap allocated duplicate - //virtual wxVariantData* Clone() const { return new wxVariantDataT( Get() ); } - - // returns the type info of the contentc - virtual const wxTypeInfo* GetTypeInfo() const { return wxGetTypeInfo( (T*) NULL ); } - -private: - T m_data; -}; - - -/* - * wxVariantBase can store any kind of data, but has some basic types - * built in. - */ - -class WXDLLIMPEXP_BASE wxVariantBase -{ -public: - wxVariantBase(); - wxVariantBase(const wxVariantBase& variant); - wxVariantBase(wxVariantData* data, const wxString& name = wxEmptyString); - - template - wxVariantBase(const T& data, const wxString& name = wxEmptyString) : - m_data(new wxVariantDataT(data)), m_name(name) {} - - virtual ~wxVariantBase(); - - // generic assignment - void operator= (const wxVariantBase& variant); - - // Assignment using data, e.g. - // myVariant = new wxStringVariantData("hello"); - void operator= (wxVariantData* variantData); - - bool operator== (const wxVariantBase& variant) const; - bool operator!= (const wxVariantBase& variant) const; - - // Sets/gets name - inline void SetName(const wxString& name) { m_name = name; } - inline const wxString& GetName() const { return m_name; } - - // Tests whether there is data - bool IsNull() const; - - // FIXME: used by wxVariantBase code but is nice wording... - bool IsEmpty() const { return IsNull(); } - - // For compatibility with wxWidgets <= 2.6, this doesn't increase - // reference count. - wxVariantData* GetData() const { return m_data; } - void SetData(wxVariantData* data) ; - - // make a 'clone' of the object - void Ref(const wxVariantBase& clone); - - // destroy a reference - void UnRef(); - - // Make NULL (i.e. delete the data) - void MakeNull(); - - // write contents to a string (e.g. for debugging) - wxString MakeString() const; - - // Delete data and name - void Clear(); - - // Returns a string representing the type of the variant, - // e.g. "string", "bool", "stringlist", "list", "double", "long" - wxString GetType() const; - - bool IsType(const wxString& type) const; - bool IsValueKindOf(const wxClassInfo* type) const; - - // FIXME wxXTI methods: - - // get the typeinfo of the stored object - const wxTypeInfo* GetTypeInfo() const - { - if (!m_data) - return NULL; - return m_data->GetTypeInfo(); - } - - // get a ref to the stored data - template T& Get(wxTEMPLATED_MEMBER_FIX(T)) - { - wxVariantDataT *dataptr = - wx_dynamic_cast(wxVariantDataT*, m_data); - wxASSERT_MSG( dataptr, - wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) ); - return dataptr->Get(); - } - - // get a const ref to the stored data - template const T& Get(wxTEMPLATED_MEMBER_FIX(T)) const - { - const wxVariantDataT *dataptr = - wx_dynamic_cast(const wxVariantDataT*, m_data); - wxASSERT_MSG( dataptr, - wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) ); - return dataptr->Get(); - } - - template bool HasData(wxTEMPLATED_MEMBER_FIX(T)) const - { - const wxVariantDataT *dataptr = - wx_dynamic_cast(const wxVariantDataT*, m_data); - return dataptr != NULL; - } - - // returns this value as string - wxString GetAsString() const; - - // gets the stored data casted to a wxObject*, - // returning NULL if cast is not possible - wxObject* GetAsObject(); - -protected: - wxVariantData* m_data; - wxString m_name; -}; - -#include "wx/dynarray.h" -WX_DECLARE_OBJARRAY_WITH_DECL(wxVariantBase, wxVariantBaseArray, class WXDLLIMPEXP_BASE); - - -// templated streaming, every type must have their specialization for these methods - -template -void wxStringReadValue( const wxString &s, T &data ); - -template -void wxStringWriteValue( wxString &s, const T &data); - -template -void wxToStringConverter( const wxVariantBase &v, wxString &s wxTEMPLATED_FUNCTION_FIX(T)) \ - { wxStringWriteValue( s, v.wxTEMPLATED_MEMBER_CALL(Get, T) ); } - -template -void wxFromStringConverter( const wxString &s, wxVariantBase &v wxTEMPLATED_FUNCTION_FIX(T)) \ - { T d; wxStringReadValue( s, d ); v = wxVariantBase(d); } - - -#endif // wxUSE_VARIANT -#endif // _WX_VARIANTBASE_H_ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/variantbase.h +// Purpose: wxVariantBase class, a minimal version of wxVariant used by XTI +// Author: Julian Smart +// Modified by: Francesco Montorsi +// Created: 10/09/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_VARIANTBASE_H_ +#define _WX_VARIANTBASE_H_ + +#include "wx/defs.h" + +#if wxUSE_VARIANT + +#include "wx/string.h" +#include "wx/arrstr.h" +#include "wx/cpp.h" +#include + +#if wxUSE_DATETIME + #include "wx/datetime.h" +#endif // wxUSE_DATETIME + +#include "wx/iosfwrap.h" + +class wxTypeInfo; +class wxObject; +class wxClassInfo; + +/* + * wxVariantData stores the actual data in a wxVariant object, + * to allow it to store any type of data. + * Derive from this to provide custom data handling. + * + * NB: To prevent addition of extra vtbl pointer to wxVariantData, + * we don't multiple-inherit from wxObjectRefData. Instead, + * we simply replicate the wxObject ref-counting scheme. + * + * NB: When you construct a wxVariantData, it will have refcount + * of one. Refcount will not be further increased when + * it is passed to wxVariant. This simulates old common + * scenario where wxVariant took ownership of wxVariantData + * passed to it. + * If you create wxVariantData for other reasons than passing + * it to wxVariant, technically you are not required to call + * DecRef() before deleting it. + * + * TODO: in order to replace wxPropertyValue, we would need + * to consider adding constructors that take pointers to C++ variables, + * or removing that functionality from the wxProperty library. + * Essentially wxPropertyValue takes on some of the wxValidator functionality + * by storing pointers and not just actual values, allowing update of C++ data + * to be handled automatically. Perhaps there's another way of doing this without + * overloading wxVariant with unnecessary functionality. + */ + +class WXDLLIMPEXP_BASE wxVariantData +{ + friend class wxVariantBase; + +public: + wxVariantData() + : m_count(1) + { } + +#if wxUSE_STD_IOSTREAM + virtual bool Write(wxSTD ostream& WXUNUSED(str)) const { return false; } + virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; } +#endif + virtual bool Write(wxString& WXUNUSED(str)) const { return false; } + virtual bool Read(wxString& WXUNUSED(str)) { return false; } + + // Override these to provide common functionality + virtual bool Eq(wxVariantData& data) const = 0; + + // What type is it? Return a string name. + virtual wxString GetType() const = 0; + + // returns the type info of the content + virtual const wxTypeInfo* GetTypeInfo() const = 0; + + // If it based on wxObject return the ClassInfo. + virtual wxClassInfo* GetValueClassInfo() { return NULL; } + + int GetRefCount() const + { return m_count; } + void IncRef() + { m_count++; } + void DecRef() + { + if ( --m_count == 0 ) + delete this; + } + +protected: + // Protected dtor should make some incompatible code + // break more louder. That is, they should do data->DecRef() + // instead of delete data. + virtual ~wxVariantData() {} + +private: + int m_count; +}; + +template class wxVariantDataT : public wxVariantData +{ +public: + wxVariantDataT(const T& d) : m_data(d) {} + virtual ~wxVariantDataT() {} + + // get a ref to the stored data + T & Get() { return m_data; } + + // get a const ref to the stored data + const T & Get() const { return m_data; } + + // set the data + void Set(const T& d) { m_data = d; } + + // Override these to provide common functionality + virtual bool Eq(wxVariantData& WXUNUSED(data)) const + { return false; /* FIXME!! */ } + + // What type is it? Return a string name. + virtual wxString GetType() const + { return GetTypeInfo()->GetTypeName(); } + + // return a heap allocated duplicate + //virtual wxVariantData* Clone() const { return new wxVariantDataT( Get() ); } + + // returns the type info of the contentc + virtual const wxTypeInfo* GetTypeInfo() const { return wxGetTypeInfo( (T*) NULL ); } + +private: + T m_data; +}; + + +/* + * wxVariantBase can store any kind of data, but has some basic types + * built in. + */ + +class WXDLLIMPEXP_BASE wxVariantBase +{ +public: + wxVariantBase(); + wxVariantBase(const wxVariantBase& variant); + wxVariantBase(wxVariantData* data, const wxString& name = wxEmptyString); + + template + wxVariantBase(const T& data, const wxString& name = wxEmptyString) : + m_data(new wxVariantDataT(data)), m_name(name) {} + + virtual ~wxVariantBase(); + + // generic assignment + void operator= (const wxVariantBase& variant); + + // Assignment using data, e.g. + // myVariant = new wxStringVariantData("hello"); + void operator= (wxVariantData* variantData); + + bool operator== (const wxVariantBase& variant) const; + bool operator!= (const wxVariantBase& variant) const; + + // Sets/gets name + inline void SetName(const wxString& name) { m_name = name; } + inline const wxString& GetName() const { return m_name; } + + // Tests whether there is data + bool IsNull() const; + + // FIXME: used by wxVariantBase code but is nice wording... + bool IsEmpty() const { return IsNull(); } + + // For compatibility with wxWidgets <= 2.6, this doesn't increase + // reference count. + wxVariantData* GetData() const { return m_data; } + void SetData(wxVariantData* data) ; + + // make a 'clone' of the object + void Ref(const wxVariantBase& clone); + + // destroy a reference + void UnRef(); + + // Make NULL (i.e. delete the data) + void MakeNull(); + + // write contents to a string (e.g. for debugging) + wxString MakeString() const; + + // Delete data and name + void Clear(); + + // Returns a string representing the type of the variant, + // e.g. "string", "bool", "stringlist", "list", "double", "long" + wxString GetType() const; + + bool IsType(const wxString& type) const; + bool IsValueKindOf(const wxClassInfo* type) const; + + // FIXME wxXTI methods: + + // get the typeinfo of the stored object + const wxTypeInfo* GetTypeInfo() const + { + if (!m_data) + return NULL; + return m_data->GetTypeInfo(); + } + + // get a ref to the stored data + template T& Get(wxTEMPLATED_MEMBER_FIX(T)) + { + wxVariantDataT *dataptr = + wx_dynamic_cast(wxVariantDataT*, m_data); + wxASSERT_MSG( dataptr, + wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) ); + return dataptr->Get(); + } + + // get a const ref to the stored data + template const T& Get(wxTEMPLATED_MEMBER_FIX(T)) const + { + const wxVariantDataT *dataptr = + wx_dynamic_cast(const wxVariantDataT*, m_data); + wxASSERT_MSG( dataptr, + wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) ); + return dataptr->Get(); + } + + template bool HasData(wxTEMPLATED_MEMBER_FIX(T)) const + { + const wxVariantDataT *dataptr = + wx_dynamic_cast(const wxVariantDataT*, m_data); + return dataptr != NULL; + } + + // returns this value as string + wxString GetAsString() const; + + // gets the stored data casted to a wxObject*, + // returning NULL if cast is not possible + wxObject* GetAsObject(); + +protected: + wxVariantData* m_data; + wxString m_name; +}; + +#include "wx/dynarray.h" +WX_DECLARE_OBJARRAY_WITH_DECL(wxVariantBase, wxVariantBaseArray, class WXDLLIMPEXP_BASE); + + +// templated streaming, every type must have their specialization for these methods + +template +void wxStringReadValue( const wxString &s, T &data ); + +template +void wxStringWriteValue( wxString &s, const T &data); + +template +void wxToStringConverter( const wxVariantBase &v, wxString &s wxTEMPLATED_FUNCTION_FIX(T)) \ + { wxStringWriteValue( s, v.wxTEMPLATED_MEMBER_CALL(Get, T) ); } + +template +void wxFromStringConverter( const wxString &s, wxVariantBase &v wxTEMPLATED_FUNCTION_FIX(T)) \ + { T d; wxStringReadValue( s, d ); v = wxVariantBase(d); } + + +#endif // wxUSE_VARIANT +#endif // _WX_VARIANTBASE_H_ diff --git a/include/wx/xtictor.h b/include/wx/xtictor.h index 1fab31b217..522aa48d58 100644 --- a/include/wx/xtictor.h +++ b/include/wx/xtictor.h @@ -1,520 +1,520 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xtictor.h -// Purpose: XTI constructors -// Author: Stefan Csomor -// Modified by: Francesco Montorsi -// Created: 27/07/03 -// RCS-ID: $Id: xti.h 47299 2007-07-10 15:58:27Z FM $ -// Copyright: (c) 1997 Julian Smart -// (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _XTICTOR_H_ -#define _XTICTOR_H_ - -#include "wx/defs.h" - -#if wxUSE_EXTENDED_RTTI - -#include "wx/string.h" -#include "wx/variant.h" - -class WXDLLIMPEXP_BASE wxObject; -class WXDLLIMPEXP_BASE wxClassInfo; -class WXDLLIMPEXP_BASE wxDynamicClassInfo; -class WXDLLIMPEXP_BASE wxHashTable; -class WXDLLIMPEXP_BASE wxHashTable_Node; -class WXDLLIMPEXP_BASE wxObjectRefData; -class WXDLLIMPEXP_BASE wxEvent; -class WXDLLIMPEXP_BASE wxEvtHandler; - -// ---------------------------------------------------------------------------- -// Constructor Bridges -// ---------------------------------------------------------------------------- - -// A constructor bridge allows to call a ctor with an arbitrary number -// or parameters during runtime -class WXDLLIMPEXP_BASE wxObjectAllocatorAndCreator -{ -public: - virtual ~wxObjectAllocatorAndCreator() { } - virtual bool Create(wxObject * &o, wxVariantBase *args) = 0; -}; - -// a direct constructor bridge calls the operator new for this class and -// passes all params to the constructor. Needed for classes that cannot be -// instantiated using alloc-create semantics -class WXDLLIMPEXP_BASE wxObjectAllocator : public wxObjectAllocatorAndCreator -{ -public: - virtual bool Create(wxObject * &o, wxVariantBase *args) = 0; -}; - - -// ---------------------------------------------------------------------------- -// Constructor Bridges for all Numbers of Params -// ---------------------------------------------------------------------------- - -// no params - -template -struct wxObjectAllocatorAndCreator_0 : public wxObjectAllocatorAndCreator -{ - bool Create(wxObject * &o, wxVariantBase *) - { - Class *obj = wx_dynamic_cast(Class*, o); - return obj->Create(); - } -}; - -struct wxObjectAllocatorAndCreator_Dummy : public wxObjectAllocatorAndCreator -{ - bool Create(wxObject *&, wxVariantBase *) - { - return true; - } -}; - -#define wxCONSTRUCTOR_0(klass) \ - wxObjectAllocatorAndCreator_0 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { NULL }; \ - const int klass::ms_constructorPropertiesCount = 0; - -#define wxCONSTRUCTOR_DUMMY(klass) \ - wxObjectAllocatorAndCreator_Dummy constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { NULL }; \ - const int klass::ms_constructorPropertiesCount = 0; - -// direct constructor version - -template -struct wxDirectConstructorBridge_0 : public wxObjectAllocator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - o = new Class( ); - return o != NULL; - } -}; - -#define wxDIRECT_CONSTRUCTOR_0(klass) \ - wxDirectConstructorBridge_0 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { NULL }; \ - const int klass::ms_constructorPropertiesCount = 0; - - -// 1 param - -template -struct wxObjectAllocatorAndCreator_1 : public wxObjectAllocatorAndCreator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - Class *obj = wx_dynamic_cast(Class*, o); - return obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0) - ); - } -}; - -#define wxCONSTRUCTOR_1(klass,t0,v0) \ - wxObjectAllocatorAndCreator_1 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) }; \ - const int klass::ms_constructorPropertiesCount = 1; - -// direct constructor version - -template -struct wxDirectConstructorBridge_1 : public wxObjectAllocator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0) - ); - return o != NULL; - } -}; - -#define wxDIRECT_CONSTRUCTOR_1(klass,t0,v0) \ - wxDirectConstructorBridge_1 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) }; \ - const int klass::ms_constructorPropertiesCount = 1; - - -// 2 params - -template -struct wxObjectAllocatorAndCreator_2 : public wxObjectAllocatorAndCreator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - Class *obj = wx_dynamic_cast(Class*, o); - return obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1) - ); - } -}; - -#define wxCONSTRUCTOR_2(klass,t0,v0,t1,v1) \ - wxObjectAllocatorAndCreator_2 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1) }; \ - const int klass::ms_constructorPropertiesCount = 2; - -// direct constructor version - -template -struct wxDirectConstructorBridge_2 : public wxObjectAllocator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1) - ); - return o != NULL; - } -}; - -#define wxDIRECT_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \ - wxDirectConstructorBridge_2 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1) }; \ - const int klass::ms_constructorPropertiesCount = 2; - - -// 3 params - -template -struct wxObjectAllocatorAndCreator_3 : public wxObjectAllocatorAndCreator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - Class *obj = wx_dynamic_cast(Class*, o); - return obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2) - ); - } -}; - -#define wxCONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \ - wxObjectAllocatorAndCreator_3 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), wxT(#v2) }; \ - const int klass::ms_constructorPropertiesCount = 3; - -// direct constructor version - -template -struct wxDirectConstructorBridge_3 : public wxObjectAllocator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2) - ); - return o != NULL; - } -}; - -#define wxDIRECT_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \ - wxDirectConstructorBridge_3 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), wxT(#v2) }; \ - const int klass::ms_constructorPropertiesCount = 3; - - -// 4 params - -template -struct wxObjectAllocatorAndCreator_4 : public wxObjectAllocatorAndCreator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - Class *obj = wx_dynamic_cast(Class*, o); - return obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T3) - ); - } -}; - -#define wxCONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \ - wxObjectAllocatorAndCreator_4 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = \ - { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3) }; \ - const int klass::ms_constructorPropertiesCount = 4; - -// direct constructor version - -template -struct wxDirectConstructorBridge_4 : public wxObjectAllocator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T3) - ); - return o != NULL; - } -}; - -#define wxDIRECT_CONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \ - wxDirectConstructorBridge_4 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = \ - { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3) }; \ - const int klass::ms_constructorPropertiesCount = 4; - - -// 5 params - -template -struct wxObjectAllocatorAndCreator_5 : public wxObjectAllocatorAndCreator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - Class *obj = wx_dynamic_cast(Class*, o); - return obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T4) - ); - } -}; - -#define wxCONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \ - wxObjectAllocatorAndCreator_5 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = \ - { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4) }; \ - const int klass::ms_constructorPropertiesCount = 5; - -// direct constructor version - -template -struct wxDirectConstructorBridge_5 : public wxObjectAllocator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T4) - ); - return o != NULL; - } -}; - -#define wxDIRECT_CONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \ - wxDirectConstructorBridge_5 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = \ - { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4) }; \ - const int klass::ms_constructorPropertiesCount = 5; - - -// 6 params - -template -struct wxObjectAllocatorAndCreator_6 : public wxObjectAllocatorAndCreator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - Class *obj = wx_dynamic_cast(Class*, o); - return obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), - args[5].wxTEMPLATED_MEMBER_CALL(Get, T5) - ); - } -}; - -#define wxCONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \ - wxObjectAllocatorAndCreator_6 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = \ - { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5) }; \ - const int klass::ms_constructorPropertiesCount = 6; - -// direct constructor version - -template -struct wxDirectConstructorBridge_6 : public wxObjectAllocator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), - args[5].wxTEMPLATED_MEMBER_CALL(Get, T5) - ); - return o != NULL; - } -}; - -#define wxDIRECT_CONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \ - wxDirectConstructorBridge_6 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), \ - wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5) }; \ - const int klass::ms_constructorPropertiesCount = 6; - - -// 7 params - -template -struct wxObjectAllocatorAndCreator_7 : public wxObjectAllocatorAndCreator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - Class *obj = wx_dynamic_cast(Class*, o); - return obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), - args[5].wxTEMPLATED_MEMBER_CALL(Get, T5), - args[6].wxTEMPLATED_MEMBER_CALL(Get, T6) - ); - } -}; - -#define wxCONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \ - wxObjectAllocatorAndCreator_7 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), \ - wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6) }; \ - const int klass::ms_constructorPropertiesCount = 7; - -// direct constructor version - -template -struct wxDirectConstructorBridge_7 : public wxObjectAllocator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T5), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T6) - ); - return o != NULL; - } -}; - -#define wxDIRECT_CONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \ - wxDirectConstructorBridge_7 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = \ - { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6) }; \ - const int klass::ms_constructorPropertiesCount = 7; - - -// 8 params - -template -struct wxObjectAllocatorAndCreator_8 : public wxObjectAllocatorAndCreator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - Class *obj = wx_dynamic_cast(Class*, o); - return obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), - args[5].wxTEMPLATED_MEMBER_CALL(Get, T5), - args[6].wxTEMPLATED_MEMBER_CALL(Get, T6), - args[7].wxTEMPLATED_MEMBER_CALL(Get, T7) - ); - } -}; - -#define wxCONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \ - wxObjectAllocatorAndCreator_8 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = \ - { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6), wxT(#v7) }; \ - const int klass::ms_constructorPropertiesCount = 8; - -// direct constructor version - -template -struct wxDirectConstructorBridge_8 : public wxObjectAllocator -{ - bool Create(wxObject * &o, wxVariantBase *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), - args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), - args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), - args[3].wxTEMPLATED_MEMBER_CALL(Get, T5), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T6), - args[4].wxTEMPLATED_MEMBER_CALL(Get, T7) - ); - return o != NULL; - } -}; - -#define wxDIRECT_CONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \ - wxDirectConstructorBridge_8 constructor##klass; \ - wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ - const wxChar *klass::ms_constructorProperties[] = \ - { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6), wxT(#v7) }; \ - const int klass::ms_constructorPropertiesCount = 8; - -#endif // wxUSE_EXTENDED_RTTI -#endif // _XTICTOR_H_ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/xtictor.h +// Purpose: XTI constructors +// Author: Stefan Csomor +// Modified by: Francesco Montorsi +// Created: 27/07/03 +// RCS-ID: $Id$ +// Copyright: (c) 1997 Julian Smart +// (c) 2003 Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _XTICTOR_H_ +#define _XTICTOR_H_ + +#include "wx/defs.h" + +#if wxUSE_EXTENDED_RTTI + +#include "wx/string.h" +#include "wx/variant.h" + +class WXDLLIMPEXP_BASE wxObject; +class WXDLLIMPEXP_BASE wxClassInfo; +class WXDLLIMPEXP_BASE wxDynamicClassInfo; +class WXDLLIMPEXP_BASE wxHashTable; +class WXDLLIMPEXP_BASE wxHashTable_Node; +class WXDLLIMPEXP_BASE wxObjectRefData; +class WXDLLIMPEXP_BASE wxEvent; +class WXDLLIMPEXP_BASE wxEvtHandler; + +// ---------------------------------------------------------------------------- +// Constructor Bridges +// ---------------------------------------------------------------------------- + +// A constructor bridge allows to call a ctor with an arbitrary number +// or parameters during runtime +class WXDLLIMPEXP_BASE wxObjectAllocatorAndCreator +{ +public: + virtual ~wxObjectAllocatorAndCreator() { } + virtual bool Create(wxObject * &o, wxVariantBase *args) = 0; +}; + +// a direct constructor bridge calls the operator new for this class and +// passes all params to the constructor. Needed for classes that cannot be +// instantiated using alloc-create semantics +class WXDLLIMPEXP_BASE wxObjectAllocator : public wxObjectAllocatorAndCreator +{ +public: + virtual bool Create(wxObject * &o, wxVariantBase *args) = 0; +}; + + +// ---------------------------------------------------------------------------- +// Constructor Bridges for all Numbers of Params +// ---------------------------------------------------------------------------- + +// no params + +template +struct wxObjectAllocatorAndCreator_0 : public wxObjectAllocatorAndCreator +{ + bool Create(wxObject * &o, wxVariantBase *) + { + Class *obj = wx_dynamic_cast(Class*, o); + return obj->Create(); + } +}; + +struct wxObjectAllocatorAndCreator_Dummy : public wxObjectAllocatorAndCreator +{ + bool Create(wxObject *&, wxVariantBase *) + { + return true; + } +}; + +#define wxCONSTRUCTOR_0(klass) \ + wxObjectAllocatorAndCreator_0 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { NULL }; \ + const int klass::ms_constructorPropertiesCount = 0; + +#define wxCONSTRUCTOR_DUMMY(klass) \ + wxObjectAllocatorAndCreator_Dummy constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { NULL }; \ + const int klass::ms_constructorPropertiesCount = 0; + +// direct constructor version + +template +struct wxDirectConstructorBridge_0 : public wxObjectAllocator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + o = new Class( ); + return o != NULL; + } +}; + +#define wxDIRECT_CONSTRUCTOR_0(klass) \ + wxDirectConstructorBridge_0 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { NULL }; \ + const int klass::ms_constructorPropertiesCount = 0; + + +// 1 param + +template +struct wxObjectAllocatorAndCreator_1 : public wxObjectAllocatorAndCreator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + Class *obj = wx_dynamic_cast(Class*, o); + return obj->Create( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0) + ); + } +}; + +#define wxCONSTRUCTOR_1(klass,t0,v0) \ + wxObjectAllocatorAndCreator_1 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) }; \ + const int klass::ms_constructorPropertiesCount = 1; + +// direct constructor version + +template +struct wxDirectConstructorBridge_1 : public wxObjectAllocator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + o = new Class( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0) + ); + return o != NULL; + } +}; + +#define wxDIRECT_CONSTRUCTOR_1(klass,t0,v0) \ + wxDirectConstructorBridge_1 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) }; \ + const int klass::ms_constructorPropertiesCount = 1; + + +// 2 params + +template +struct wxObjectAllocatorAndCreator_2 : public wxObjectAllocatorAndCreator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + Class *obj = wx_dynamic_cast(Class*, o); + return obj->Create( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1) + ); + } +}; + +#define wxCONSTRUCTOR_2(klass,t0,v0,t1,v1) \ + wxObjectAllocatorAndCreator_2 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1) }; \ + const int klass::ms_constructorPropertiesCount = 2; + +// direct constructor version + +template +struct wxDirectConstructorBridge_2 : public wxObjectAllocator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + o = new Class( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1) + ); + return o != NULL; + } +}; + +#define wxDIRECT_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \ + wxDirectConstructorBridge_2 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1) }; \ + const int klass::ms_constructorPropertiesCount = 2; + + +// 3 params + +template +struct wxObjectAllocatorAndCreator_3 : public wxObjectAllocatorAndCreator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + Class *obj = wx_dynamic_cast(Class*, o); + return obj->Create( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2) + ); + } +}; + +#define wxCONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \ + wxObjectAllocatorAndCreator_3 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), wxT(#v2) }; \ + const int klass::ms_constructorPropertiesCount = 3; + +// direct constructor version + +template +struct wxDirectConstructorBridge_3 : public wxObjectAllocator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + o = new Class( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2) + ); + return o != NULL; + } +}; + +#define wxDIRECT_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \ + wxDirectConstructorBridge_3 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), wxT(#v2) }; \ + const int klass::ms_constructorPropertiesCount = 3; + + +// 4 params + +template +struct wxObjectAllocatorAndCreator_4 : public wxObjectAllocatorAndCreator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + Class *obj = wx_dynamic_cast(Class*, o); + return obj->Create( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T3) + ); + } +}; + +#define wxCONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \ + wxObjectAllocatorAndCreator_4 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = \ + { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3) }; \ + const int klass::ms_constructorPropertiesCount = 4; + +// direct constructor version + +template +struct wxDirectConstructorBridge_4 : public wxObjectAllocator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + o = new Class( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T3) + ); + return o != NULL; + } +}; + +#define wxDIRECT_CONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \ + wxDirectConstructorBridge_4 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = \ + { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3) }; \ + const int klass::ms_constructorPropertiesCount = 4; + + +// 5 params + +template +struct wxObjectAllocatorAndCreator_5 : public wxObjectAllocatorAndCreator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + Class *obj = wx_dynamic_cast(Class*, o); + return obj->Create( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T4) + ); + } +}; + +#define wxCONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \ + wxObjectAllocatorAndCreator_5 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = \ + { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4) }; \ + const int klass::ms_constructorPropertiesCount = 5; + +// direct constructor version + +template +struct wxDirectConstructorBridge_5 : public wxObjectAllocator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + o = new Class( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T4) + ); + return o != NULL; + } +}; + +#define wxDIRECT_CONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \ + wxDirectConstructorBridge_5 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = \ + { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4) }; \ + const int klass::ms_constructorPropertiesCount = 5; + + +// 6 params + +template +struct wxObjectAllocatorAndCreator_6 : public wxObjectAllocatorAndCreator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + Class *obj = wx_dynamic_cast(Class*, o); + return obj->Create( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), + args[5].wxTEMPLATED_MEMBER_CALL(Get, T5) + ); + } +}; + +#define wxCONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \ + wxObjectAllocatorAndCreator_6 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = \ + { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5) }; \ + const int klass::ms_constructorPropertiesCount = 6; + +// direct constructor version + +template +struct wxDirectConstructorBridge_6 : public wxObjectAllocator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + o = new Class( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), + args[5].wxTEMPLATED_MEMBER_CALL(Get, T5) + ); + return o != NULL; + } +}; + +#define wxDIRECT_CONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \ + wxDirectConstructorBridge_6 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), \ + wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5) }; \ + const int klass::ms_constructorPropertiesCount = 6; + + +// 7 params + +template +struct wxObjectAllocatorAndCreator_7 : public wxObjectAllocatorAndCreator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + Class *obj = wx_dynamic_cast(Class*, o); + return obj->Create( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), + args[5].wxTEMPLATED_MEMBER_CALL(Get, T5), + args[6].wxTEMPLATED_MEMBER_CALL(Get, T6) + ); + } +}; + +#define wxCONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \ + wxObjectAllocatorAndCreator_7 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), \ + wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6) }; \ + const int klass::ms_constructorPropertiesCount = 7; + +// direct constructor version + +template +struct wxDirectConstructorBridge_7 : public wxObjectAllocator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + o = new Class( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T5), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T6) + ); + return o != NULL; + } +}; + +#define wxDIRECT_CONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \ + wxDirectConstructorBridge_7 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = \ + { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6) }; \ + const int klass::ms_constructorPropertiesCount = 7; + + +// 8 params + +template +struct wxObjectAllocatorAndCreator_8 : public wxObjectAllocatorAndCreator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + Class *obj = wx_dynamic_cast(Class*, o); + return obj->Create( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), + args[5].wxTEMPLATED_MEMBER_CALL(Get, T5), + args[6].wxTEMPLATED_MEMBER_CALL(Get, T6), + args[7].wxTEMPLATED_MEMBER_CALL(Get, T7) + ); + } +}; + +#define wxCONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \ + wxObjectAllocatorAndCreator_8 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = \ + { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6), wxT(#v7) }; \ + const int klass::ms_constructorPropertiesCount = 8; + +// direct constructor version + +template +struct wxDirectConstructorBridge_8 : public wxObjectAllocator +{ + bool Create(wxObject * &o, wxVariantBase *args) + { + o = new Class( + args[0].wxTEMPLATED_MEMBER_CALL(Get, T0), + args[1].wxTEMPLATED_MEMBER_CALL(Get, T1), + args[2].wxTEMPLATED_MEMBER_CALL(Get, T2), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T3), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T4), + args[3].wxTEMPLATED_MEMBER_CALL(Get, T5), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T6), + args[4].wxTEMPLATED_MEMBER_CALL(Get, T7) + ); + return o != NULL; + } +}; + +#define wxDIRECT_CONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \ + wxDirectConstructorBridge_8 constructor##klass; \ + wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ + const wxChar *klass::ms_constructorProperties[] = \ + { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6), wxT(#v7) }; \ + const int klass::ms_constructorPropertiesCount = 8; + +#endif // wxUSE_EXTENDED_RTTI +#endif // _XTICTOR_H_ diff --git a/include/wx/xtihandler.h b/include/wx/xtihandler.h index 2da2c9745a..a7aa7b2cde 100644 --- a/include/wx/xtihandler.h +++ b/include/wx/xtihandler.h @@ -1,110 +1,110 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xtihandler.h -// Purpose: XTI handlers -// Author: Stefan Csomor -// Modified by: Francesco Montorsi -// Created: 27/07/03 -// RCS-ID: $Id: xti.h 47299 2007-07-10 15:58:27Z FM $ -// Copyright: (c) 1997 Julian Smart -// (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _XTIHANDLER_H_ -#define _XTIHANDLER_H_ - -#include "wx/defs.h" - -#if wxUSE_EXTENDED_RTTI - -#include "wx/string.h" - -class WXDLLIMPEXP_BASE wxObject; -class WXDLLIMPEXP_BASE wxClassInfo; -class WXDLLIMPEXP_BASE wxDynamicClassInfo; -class WXDLLIMPEXP_BASE wxHashTable; -class WXDLLIMPEXP_BASE wxHashTable_Node; -class WXDLLIMPEXP_BASE wxObjectRefData; -class WXDLLIMPEXP_BASE wxEvent; -class WXDLLIMPEXP_BASE wxEvtHandler; - -typedef void (wxObject::*wxObjectEventFunction)(wxEvent&); - -// ---------------------------------------------------------------------------- -// Handler Info -// -// this describes an event sink -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxHandlerInfo -{ - friend class WXDLLIMPEXP_BASE wxDynamicClassInfo; - -public: - wxHandlerInfo(wxHandlerInfo* &iter, - wxClassInfo* itsClass, - const wxString& name, - wxObjectEventFunction address, - const wxClassInfo* eventClassInfo) : - m_eventFunction(address), - m_name(name), - m_eventClassInfo(eventClassInfo), - m_itsClass(itsClass) - { - Insert(iter); - } - - ~wxHandlerInfo() - { Remove(); } - - // return the name of this handler - const wxString& GetName() const { return m_name; } - - // return the class info of the event - const wxClassInfo *GetEventClassInfo() const { return m_eventClassInfo; } - - // get the handler function pointer - wxObjectEventFunction GetEventFunction() const { return m_eventFunction; } - - // returns NULL if this is the last handler of this class - wxHandlerInfo* GetNext() const { return m_next; } - - // return the class this property is declared in - const wxClassInfo* GetDeclaringClass() const { return m_itsClass; } - -private: - - // inserts this handler at the end of the linked chain which begins - // with "iter" handler. - void Insert(wxHandlerInfo* &iter); - - // removes this handler from the linked chain of the m_itsClass handlers. - void Remove(); - - wxObjectEventFunction m_eventFunction; - wxString m_name; - const wxClassInfo* m_eventClassInfo; - wxHandlerInfo* m_next; - wxClassInfo* m_itsClass; -}; - -#define wxHANDLER(name,eventClassType) \ - static wxHandlerInfo _handlerInfo##name( first, class_t::GetClassInfoStatic(), \ - wxT(#name), (wxObjectEventFunction) (wxEventFunction) &name, \ - CLASSINFO( eventClassType ) ); - -#define wxBEGIN_HANDLERS_TABLE(theClass) \ - wxHandlerInfo *theClass::GetHandlersStatic() \ - { \ - typedef theClass class_t; \ - static wxHandlerInfo* first = NULL; - -#define wxEND_HANDLERS_TABLE() \ - return first; } - -#define wxEMPTY_HANDLERS_TABLE(theClass) \ - wxBEGIN_HANDLERS_TABLE(theClass) \ - wxEND_HANDLERS_TABLE() - -#endif // wxUSE_EXTENDED_RTTI -#endif // _XTIHANDLER_H_ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/xtihandler.h +// Purpose: XTI handlers +// Author: Stefan Csomor +// Modified by: Francesco Montorsi +// Created: 27/07/03 +// RCS-ID: $Id$ +// Copyright: (c) 1997 Julian Smart +// (c) 2003 Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _XTIHANDLER_H_ +#define _XTIHANDLER_H_ + +#include "wx/defs.h" + +#if wxUSE_EXTENDED_RTTI + +#include "wx/string.h" + +class WXDLLIMPEXP_BASE wxObject; +class WXDLLIMPEXP_BASE wxClassInfo; +class WXDLLIMPEXP_BASE wxDynamicClassInfo; +class WXDLLIMPEXP_BASE wxHashTable; +class WXDLLIMPEXP_BASE wxHashTable_Node; +class WXDLLIMPEXP_BASE wxObjectRefData; +class WXDLLIMPEXP_BASE wxEvent; +class WXDLLIMPEXP_BASE wxEvtHandler; + +typedef void (wxObject::*wxObjectEventFunction)(wxEvent&); + +// ---------------------------------------------------------------------------- +// Handler Info +// +// this describes an event sink +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_BASE wxHandlerInfo +{ + friend class WXDLLIMPEXP_BASE wxDynamicClassInfo; + +public: + wxHandlerInfo(wxHandlerInfo* &iter, + wxClassInfo* itsClass, + const wxString& name, + wxObjectEventFunction address, + const wxClassInfo* eventClassInfo) : + m_eventFunction(address), + m_name(name), + m_eventClassInfo(eventClassInfo), + m_itsClass(itsClass) + { + Insert(iter); + } + + ~wxHandlerInfo() + { Remove(); } + + // return the name of this handler + const wxString& GetName() const { return m_name; } + + // return the class info of the event + const wxClassInfo *GetEventClassInfo() const { return m_eventClassInfo; } + + // get the handler function pointer + wxObjectEventFunction GetEventFunction() const { return m_eventFunction; } + + // returns NULL if this is the last handler of this class + wxHandlerInfo* GetNext() const { return m_next; } + + // return the class this property is declared in + const wxClassInfo* GetDeclaringClass() const { return m_itsClass; } + +private: + + // inserts this handler at the end of the linked chain which begins + // with "iter" handler. + void Insert(wxHandlerInfo* &iter); + + // removes this handler from the linked chain of the m_itsClass handlers. + void Remove(); + + wxObjectEventFunction m_eventFunction; + wxString m_name; + const wxClassInfo* m_eventClassInfo; + wxHandlerInfo* m_next; + wxClassInfo* m_itsClass; +}; + +#define wxHANDLER(name,eventClassType) \ + static wxHandlerInfo _handlerInfo##name( first, class_t::GetClassInfoStatic(), \ + wxT(#name), (wxObjectEventFunction) (wxEventFunction) &name, \ + CLASSINFO( eventClassType ) ); + +#define wxBEGIN_HANDLERS_TABLE(theClass) \ + wxHandlerInfo *theClass::GetHandlersStatic() \ + { \ + typedef theClass class_t; \ + static wxHandlerInfo* first = NULL; + +#define wxEND_HANDLERS_TABLE() \ + return first; } + +#define wxEMPTY_HANDLERS_TABLE(theClass) \ + wxBEGIN_HANDLERS_TABLE(theClass) \ + wxEND_HANDLERS_TABLE() + +#endif // wxUSE_EXTENDED_RTTI +#endif // _XTIHANDLER_H_ diff --git a/include/wx/xtiprop.h b/include/wx/xtiprop.h index b2f9ea0999..abd3584ead 100644 --- a/include/wx/xtiprop.h +++ b/include/wx/xtiprop.h @@ -1,597 +1,597 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xtiprop.h -// Purpose: XTI properties -// Author: Stefan Csomor -// Modified by: Francesco Montorsi -// Created: 27/07/03 -// RCS-ID: $Id: xti.h 47299 2007-07-10 15:58:27Z FM $ -// Copyright: (c) 1997 Julian Smart -// (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _XTIPROP_H_ -#define _XTIPROP_H_ - -#include "wx/defs.h" - -#if wxUSE_EXTENDED_RTTI - -#include "wx/string.h" -#include "wx/variant.h" -#include "wx/intl.h" -#include "wx/log.h" -#include "wx/xtitypes.h" - -class WXDLLIMPEXP_BASE wxObject; -class WXDLLIMPEXP_BASE wxClassInfo; -class WXDLLIMPEXP_BASE wxDynamicClassInfo; -class WXDLLIMPEXP_BASE wxHashTable; -class WXDLLIMPEXP_BASE wxHashTable_Node; -class WXDLLIMPEXP_BASE wxObjectRefData; -class WXDLLIMPEXP_BASE wxEvent; -class WXDLLIMPEXP_BASE wxEvtHandler; - -// ---------------------------------------------------------------------------- -// Property Accessors -// -// wxPropertySetter/Getter/CollectionGetter/CollectionAdder are all property -// accessors which are managed by wxPropertyAccessor class which in turn is -// handled by wxPropertyInfo. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxPropertySetter -{ -public: - wxPropertySetter( const wxString name ) { m_name = name; } - virtual ~wxPropertySetter() {} - - virtual void Set( wxObject *object, const wxVariantBase &variantValue ) const = 0; - const wxString& GetName() const { return m_name; } - -private: - wxString m_name; -}; - -class WXDLLIMPEXP_BASE wxPropertyGetter -{ -public: - wxPropertyGetter( const wxString name ) { m_name = name; } - virtual ~wxPropertyGetter() {} - - virtual void Get( const wxObject *object, wxVariantBase& result) const = 0; - const wxString& GetName() const { return m_name; } - -private: - wxString m_name; -}; - -class WXDLLIMPEXP_BASE wxPropertyCollectionGetter -{ -public: - wxPropertyCollectionGetter( const wxString name ) { m_name = name; } - virtual ~wxPropertyCollectionGetter() {} - - virtual void Get( const wxObject *object, wxVariantBaseArray& result) const = 0; - const wxString& GetName() const { return m_name; } - -private: - wxString m_name; -}; - -template void WXDLLIMPEXP_BASE \ - wxCollectionToVariantArray( const coll_t& coll, wxVariantBaseArray& result ); - -class WXDLLIMPEXP_BASE wxPropertyCollectionAdder -{ -public: - wxPropertyCollectionAdder( const wxString name ) { m_name = name; } - virtual ~wxPropertyCollectionAdder() {} - - virtual void Add( wxObject *object, const wxVariantBase &variantValue ) const= 0; - const wxString& GetName() const { return m_name; } - -private: - wxString m_name; -}; - -#define wxPROPERTY_SETTER( property, Klass, valueType, setterMethod ) \ -class wxPropertySetter##property : public wxPropertySetter \ -{ \ -public: \ - wxINFUNC_CLASS_TYPE_FIX(Klass) \ - wxPropertySetter##property() : wxPropertySetter( wxT(#setterMethod) ) {} \ - virtual ~wxPropertySetter##property() {} \ - \ - void Set( wxObject *object, const wxVariantBase &variantValue ) const \ - { \ - Klass *obj = dynamic_cast(object); \ - if ( variantValue.wxTEMPLATED_MEMBER_CALL(HasData, valueType) ) \ - obj->setterMethod(variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType)); \ - else \ - obj->setterMethod(*variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType*)); \ - } \ -}; - -#define wxPROPERTY_GETTER( property, Klass, valueType, gettermethod ) \ -class wxPropertyGetter##property : public wxPropertyGetter \ -{ \ -public: \ - wxINFUNC_CLASS_TYPE_FIX(Klass) \ - wxPropertyGetter##property() : wxPropertyGetter( wxT(#gettermethod) ) {} \ - virtual ~wxPropertyGetter##property() {} \ - \ - void Get( const wxObject *object, wxVariantBase &result) const \ - { \ - const Klass *obj = dynamic_cast(object); \ - result = wxVariantBase( obj->gettermethod() ); \ - } \ -}; - -#define wxPROPERTY_COLLECTION_ADDER( property, Klass, valueType, addermethod ) \ -class wxPropertyCollectionAdder##property : public wxPropertyCollectionAdder \ -{ \ -public: \ - wxINFUNC_CLASS_TYPE_FIX(Klass) \ - wxPropertyCollectionAdder##property() : wxPropertyCollectionAdder( wxT(#addermethod) ) {} \ - virtual ~wxPropertyCollectionAdder##property() {} \ - \ - void Add( wxObject *object, const wxVariantBase &variantValue ) const \ - { \ - Klass *obj = dynamic_cast(object); \ - if ( variantValue.wxTEMPLATED_MEMBER_CALL(HasData, valueType) ) \ - obj->addermethod(variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType)); \ - else \ - obj->addermethod(*variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType*)); \ - } \ -}; - -#define wxPROPERTY_COLLECTION_GETTER( property, Klass, valueType, gettermethod ) \ -class wxPropertyCollectionGetter##property : public wxPropertyCollectionGetter \ -{ \ -public: \ - wxINFUNC_CLASS_TYPE_FIX(Klass) \ - wxPropertyCollectionGetter##property() : wxPropertyCollectionGetter( wxT(#gettermethod) ) {} \ - virtual ~wxPropertyCollectionGetter##property() {} \ - \ - void Get( const wxObject *object, wxVariantBaseArray &result) const \ - { \ - const Klass *obj = dynamic_cast(object); \ - wxCollectionToVariantArray( obj->gettermethod(), result ); \ - } \ -}; - -class WXDLLIMPEXP_BASE wxPropertyAccessor -{ -public: - wxPropertyAccessor( wxPropertySetter *setter, wxPropertyGetter *getter, - wxPropertyCollectionAdder *adder, wxPropertyCollectionGetter *collectionGetter ) - { m_setter = setter; m_getter = getter; m_adder = adder; - m_collectionGetter = collectionGetter; } - - virtual ~wxPropertyAccessor() {} - - // Setting a simple property (non-collection) - virtual void SetProperty(wxObject *object, const wxVariantBase &value) const - { - if ( m_setter ) - m_setter->Set( object, value ); - else - wxLogError( _("SetProperty called w/o valid setter") ); - } - - // Getting a simple property (non-collection) - virtual void GetProperty(const wxObject *object, wxVariantBase &result) const - { - if ( m_getter ) - m_getter->Get( object, result ); - else - wxLogError( _("GetProperty called w/o valid getter") ); - } - - // Adding an element to a collection property - virtual void AddToPropertyCollection(wxObject *object, const wxVariantBase &value) const - { - if ( m_adder ) - m_adder->Add( object, value ); - else - wxLogError( _("AddToPropertyCollection called w/o valid adder") ); - } - - // Getting a collection property - virtual void GetPropertyCollection( const wxObject *obj, wxVariantBaseArray &result) const - { - if ( m_collectionGetter ) - m_collectionGetter->Get( obj, result); - else - wxLogError( _("GetPropertyCollection called w/o valid collection getter") ); - } - - virtual bool HasSetter() const { return m_setter != NULL; } - virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL; } - virtual bool HasGetter() const { return m_getter != NULL; } - virtual bool HasAdder() const { return m_adder != NULL; } - - virtual const wxString& GetCollectionGetterName() const - { return m_collectionGetter->GetName(); } - virtual const wxString& GetGetterName() const - { return m_getter->GetName(); } - virtual const wxString& GetSetterName() const - { return m_setter->GetName(); } - virtual const wxString& GetAdderName() const - { return m_adder->GetName(); } - -protected: - wxPropertySetter *m_setter; - wxPropertyCollectionAdder *m_adder; - wxPropertyGetter *m_getter; - wxPropertyCollectionGetter* m_collectionGetter; -}; - -class WXDLLIMPEXP_BASE wxGenericPropertyAccessor : public wxPropertyAccessor -{ -public: - wxGenericPropertyAccessor( const wxString &propName ); - virtual ~wxGenericPropertyAccessor(); - - void RenameProperty( const wxString& WXUNUSED_UNLESS_DEBUG(oldName), - const wxString& newName ) - { - wxASSERT( oldName == m_propertyName ); m_propertyName = newName; - } - - virtual bool HasSetter() const { return true; } - virtual bool HasGetter() const { return true; } - virtual bool HasAdder() const { return false; } - virtual bool HasCollectionGetter() const { return false; } - - virtual const wxString& GetGetterName() const - { return m_getterName; } - virtual const wxString& GetSetterName() const - { return m_setterName; } - - virtual void SetProperty(wxObject *object, const wxVariantBase &value) const; - virtual void GetProperty(const wxObject *object, wxVariantBase &value) const; - - // Adding an element to a collection property - virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), - const wxVariantBase &WXUNUSED(value)) const - { - wxLogError( _("AddToPropertyCollection called on a generic accessor") ); - } - - // Getting a collection property - virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), - wxVariantBaseArray &WXUNUSED(result)) const - { - wxLogError ( _("GetPropertyCollection called on a generic accessor") ); - } - -private: - struct wxGenericPropertyAccessorInternal; - wxGenericPropertyAccessorInternal* m_data; - wxString m_propertyName; - wxString m_setterName; - wxString m_getterName; -}; - -typedef long wxPropertyInfoFlags; -enum -{ - // will be removed in future releases - wxPROP_DEPRECATED = 0x00000001, - - // object graph property, will be streamed with priority (after constructor properties) - wxPROP_OBJECT_GRAPH = 0x00000002, - - // this will only be streamed out and in as enum/set, the internal representation - // is still a long - wxPROP_ENUM_STORE_LONG = 0x00000004, - - // don't stream out this property, needed eg to avoid streaming out children - // that are always created by their parents - wxPROP_DONT_STREAM = 0x00000008 -}; - - -// ---------------------------------------------------------------------------- -// Property Support -// -// wxPropertyInfo is used to inquire of the property by name. It doesn't -// provide access to the property, only information about it. If you -// want access, look at wxPropertyAccessor. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxPropertyInfo -{ - friend class WXDLLIMPEXP_BASE wxDynamicClassInfo; - -public: - wxPropertyInfo(wxPropertyInfo* &iter, - wxClassInfo* itsClass, - const wxString& name, - const wxString& typeName, - wxPropertyAccessor *accessor, - wxVariantBase dv, - wxPropertyInfoFlags flags = 0, - const wxString& helpString = wxEmptyString, - const wxString& groupString = wxEmptyString) : - m_itsClass(itsClass), - m_name(name), - m_typeInfo(NULL), - m_typeName(typeName), - m_collectionElementTypeInfo(NULL), - m_accessor(accessor), - m_defaultValue(dv), - m_flags(flags), - m_helpString(helpString), - m_groupString(groupString) - { - Insert(iter); - } - -#if wxUSE_UNICODE - wxPropertyInfo(wxPropertyInfo* &iter, - wxClassInfo* itsClass, - const wxString& name, - const char* typeName, - wxPropertyAccessor *accessor, - wxVariantBase dv, - wxPropertyInfoFlags flags = 0, - const wxString& helpString = wxEmptyString, - const wxString& groupString = wxEmptyString) : - m_itsClass(itsClass), - m_name(name), - m_typeInfo(NULL), - m_typeName(wxString::FromAscii(typeName)), - m_collectionElementTypeInfo(NULL), - m_accessor(accessor), - m_defaultValue(dv), - m_flags(flags), - m_helpString(helpString), - m_groupString(groupString) - { - Insert(iter); - } -#endif - wxPropertyInfo(wxPropertyInfo* &iter, - wxClassInfo* itsClass, - const wxString& name, - wxEventSourceTypeInfo* type, - wxPropertyAccessor *accessor, - wxVariantBase dv, - wxPropertyInfoFlags flags = 0, - const wxString& helpString = wxEmptyString, - const wxString& groupString = wxEmptyString) : - m_itsClass(itsClass), - m_name(name), - m_typeInfo(type), - m_collectionElementTypeInfo(NULL), - m_accessor(accessor), - m_defaultValue(dv), - m_flags(flags), - m_helpString(helpString), - m_groupString(groupString) - { - Insert(iter); - } - - wxPropertyInfo(wxPropertyInfo* &iter, - wxClassInfo* itsClass, const wxString& name, - const wxString& collectionTypeName, - const wxString& elementTypeName, - wxPropertyAccessor *accessor, - wxPropertyInfoFlags flags = 0, - const wxString& helpString = wxEmptyString, - const wxString& groupString = wxEmptyString) : - m_itsClass(itsClass), - m_name(name), - m_typeInfo(NULL), - m_typeName(collectionTypeName), - m_collectionElementTypeInfo(NULL), - m_collectionElementTypeName(elementTypeName), - m_accessor(accessor), - m_flags(flags), - m_helpString(helpString), - m_groupString(groupString) - { - Insert(iter); - } - -#if wxUSE_UNICODE - wxPropertyInfo(wxPropertyInfo* &iter, - wxClassInfo* itsClass, const wxString& name, - const char* collectionTypeName, - const char* elementTypeName, - wxPropertyAccessor *accessor, - wxPropertyInfoFlags flags = 0, - const wxString& helpString = wxEmptyString, - const wxString& groupString = wxEmptyString) : - m_itsClass(itsClass), - m_name(name), - m_typeInfo(NULL), - m_typeName(wxString::FromAscii(collectionTypeName)), - m_collectionElementTypeInfo(NULL), - m_collectionElementTypeName(wxString::FromAscii(elementTypeName)), - m_accessor(accessor), - m_flags(flags), - m_helpString(helpString), - m_groupString(groupString) - { - Insert(iter); - } -#endif - ~wxPropertyInfo() - { Remove(); } - - // return the class this property is declared in - const wxClassInfo* GetDeclaringClass() const { return m_itsClass; } - - // return the name of this property - const wxString& GetName() const { return m_name; } - - // returns the flags of this property - wxPropertyInfoFlags GetFlags() const { return m_flags; } - - // returns the short help string of this property - const wxString& GetHelpString() const { return m_helpString; } - - // returns the group string of this property - const wxString& GetGroupString() const { return m_groupString; } - - // return the element type info of this property (for collections, otherwise NULL) - const wxTypeInfo * GetCollectionElementTypeInfo() const - { - if ( m_collectionElementTypeInfo == NULL ) - m_collectionElementTypeInfo = wxTypeInfo::FindType(m_collectionElementTypeName); - return m_collectionElementTypeInfo; - } - - // return the type info of this property - const wxTypeInfo * GetTypeInfo() const - { - if ( m_typeInfo == NULL ) - m_typeInfo = wxTypeInfo::FindType(m_typeName); - return m_typeInfo; - } - - // return the accessor for this property - wxPropertyAccessor* GetAccessor() const { return m_accessor; } - - // returns NULL if this is the last property of this class - wxPropertyInfo* GetNext() const { return m_next; } - - // returns the default value of this property, its kind may be wxT_VOID if it is not valid - wxVariantBase GetDefaultValue() const { return m_defaultValue; } - -private: - - // inserts this property at the end of the linked chain which begins - // with "iter" property. - void Insert(wxPropertyInfo* &iter); - - // removes this property from the linked chain of the m_itsClass properties. - void Remove(); - - wxClassInfo* m_itsClass; - wxString m_name; - mutable wxTypeInfo* m_typeInfo; - wxString m_typeName; - mutable wxTypeInfo* m_collectionElementTypeInfo; - wxString m_collectionElementTypeName; - wxPropertyAccessor* m_accessor; - wxVariantBase m_defaultValue; - wxPropertyInfoFlags m_flags; - wxString m_helpString; - wxString m_groupString; - wxPropertyInfo* m_next; - - // FIXME: what's this comment about?? - // string representation of the default value - // to be assigned by the designer to the property - // when the component is dropped on the container. -}; - -WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxPropertyInfo*, wxPropertyInfoMap, - class WXDLLIMPEXP_BASE ); - -#define wxBEGIN_PROPERTIES_TABLE(theClass) \ - wxPropertyInfo *theClass::GetPropertiesStatic() \ - { \ - typedef theClass class_t; \ - static wxPropertyInfo* first = NULL; - -#define wxEND_PROPERTIES_TABLE() \ - return first; } - -#define wxHIDE_PROPERTY( pname ) \ - static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ - wxT(#pname), typeid(void).name(), NULL, wxVariantBase(), wxPROP_DONT_STREAM, \ - wxEmptyString, wxEmptyString ); - -#define wxPROPERTY( pname, type, setter, getter, defaultValue, flags, help, group) \ - wxPROPERTY_SETTER( pname, class_t, type, setter ) \ - static wxPropertySetter##pname _setter##pname; \ - wxPROPERTY_GETTER( pname, class_t, type, getter ) \ - static wxPropertyGetter##pname _getter##pname; \ - static wxPropertyAccessor _accessor##pname( &_setter##pname, \ - &_getter##pname, NULL, NULL ); \ - static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ - wxT(#pname), typeid(type).name(), &_accessor##pname, \ - wxVariantBase(defaultValue), flags, group, help ); - -#define wxPROPERTY_FLAGS( pname, flags, type, setter, getter,defaultValue, \ - pflags, help, group) \ - wxPROPERTY_SETTER( pname, class_t, type, setter ) \ - static wxPropertySetter##pname _setter##pname; \ - wxPROPERTY_GETTER( pname, class_t, type, getter ) \ - static wxPropertyGetter##pname _getter##pname; \ - static wxPropertyAccessor _accessor##pname( &_setter##pname, \ - &_getter##pname, NULL, NULL ); \ - static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ - wxT(#pname), typeid(flags).name(), &_accessor##pname, \ - wxVariantBase(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group ); - -#define wxREADONLY_PROPERTY( pname, type, getter,defaultValue, flags, help, group) \ - wxPROPERTY_GETTER( pname, class_t, type, getter ) \ - static wxPropertyGetter##pname _getter##pname; \ - static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL ); \ - static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ - wxT(#pname), typeid(type).name(),&_accessor##pname, \ - wxVariantBase(defaultValue), flags, help, group ); - -#define wxREADONLY_PROPERTY_FLAGS( pname, flags, type, getter,defaultValue, \ - pflags, help, group) \ - wxPROPERTY_GETTER( pname, class_t, type, getter ) \ - static wxPropertyGetter##pname _getter##pname; \ - static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL ); \ - static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ - wxT(#pname), typeid(flags).name(),&_accessor##pname, \ - wxVariantBase(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group ); - -#define wxPROPERTY_COLLECTION( pname, colltype, addelemtype, adder, getter, \ - flags, help, group ) \ - wxPROPERTY_COLLECTION_ADDER( pname, class_t, addelemtype, adder ) \ - static wxPropertyCollectionAdder##pname _adder##pname; \ - wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter ) \ - static wxPropertyCollectionGetter##pname _collectionGetter##pname; \ - static wxPropertyAccessor _accessor##pname( NULL, NULL,&_adder##pname, \ - &_collectionGetter##pname ); \ - static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ - wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(), \ - &_accessor##pname, flags, help, group ); - -#define wxREADONLY_PROPERTY_COLLECTION( pname, colltype, addelemtype, getter, \ - flags, help, group) \ - wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter ) \ - static wxPropertyCollectionGetter##pname _collectionGetter##pname; \ - static wxPropertyAccessor _accessor##pname( NULL, NULL, NULL, \ - &_collectionGetter##pname ); \ - static wxPropertyInfo _propertyInfo##pname( first,class_t::GetClassInfoStatic(), \ - wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(), \ - &_accessor##pname, flags, help, group ); - -#define wxEVENT_PROPERTY( name, eventType, eventClass ) \ - static wxEventSourceTypeInfo _typeInfo##name( eventType, CLASSINFO( eventClass ) ); \ - static wxPropertyInfo _propertyInfo##name( first,class_t::GetClassInfoStatic(), \ - wxT(#name), &_typeInfo##name, NULL, wxVariantBase() ); - -#define wxEVENT_RANGE_PROPERTY( name, eventType, lastEventType, eventClass ) \ - static wxEventSourceTypeInfo _typeInfo##name( eventType, lastEventType, \ - CLASSINFO( eventClass ) ); \ - static wxPropertyInfo _propertyInfo##name( first, class_t::GetClassInfoStatic(), \ - wxT(#name), &_typeInfo##name, NULL, wxVariantBase() ); - -// ---------------------------------------------------------------------------- -// Implementation Helper for Simple Properties -// ---------------------------------------------------------------------------- - -#define wxIMPLEMENT_PROPERTY(name, type) \ -private: \ - type m_##name; \ -public: \ - void Set##name( type const & p) { m_##name = p; } \ - type const & Get##name() const { return m_##name; } - -#endif // wxUSE_EXTENDED_RTTI -#endif // _XTIPROP_H_ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/xtiprop.h +// Purpose: XTI properties +// Author: Stefan Csomor +// Modified by: Francesco Montorsi +// Created: 27/07/03 +// RCS-ID: $Id$ +// Copyright: (c) 1997 Julian Smart +// (c) 2003 Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _XTIPROP_H_ +#define _XTIPROP_H_ + +#include "wx/defs.h" + +#if wxUSE_EXTENDED_RTTI + +#include "wx/string.h" +#include "wx/variant.h" +#include "wx/intl.h" +#include "wx/log.h" +#include "wx/xtitypes.h" + +class WXDLLIMPEXP_BASE wxObject; +class WXDLLIMPEXP_BASE wxClassInfo; +class WXDLLIMPEXP_BASE wxDynamicClassInfo; +class WXDLLIMPEXP_BASE wxHashTable; +class WXDLLIMPEXP_BASE wxHashTable_Node; +class WXDLLIMPEXP_BASE wxObjectRefData; +class WXDLLIMPEXP_BASE wxEvent; +class WXDLLIMPEXP_BASE wxEvtHandler; + +// ---------------------------------------------------------------------------- +// Property Accessors +// +// wxPropertySetter/Getter/CollectionGetter/CollectionAdder are all property +// accessors which are managed by wxPropertyAccessor class which in turn is +// handled by wxPropertyInfo. +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_BASE wxPropertySetter +{ +public: + wxPropertySetter( const wxString name ) { m_name = name; } + virtual ~wxPropertySetter() {} + + virtual void Set( wxObject *object, const wxVariantBase &variantValue ) const = 0; + const wxString& GetName() const { return m_name; } + +private: + wxString m_name; +}; + +class WXDLLIMPEXP_BASE wxPropertyGetter +{ +public: + wxPropertyGetter( const wxString name ) { m_name = name; } + virtual ~wxPropertyGetter() {} + + virtual void Get( const wxObject *object, wxVariantBase& result) const = 0; + const wxString& GetName() const { return m_name; } + +private: + wxString m_name; +}; + +class WXDLLIMPEXP_BASE wxPropertyCollectionGetter +{ +public: + wxPropertyCollectionGetter( const wxString name ) { m_name = name; } + virtual ~wxPropertyCollectionGetter() {} + + virtual void Get( const wxObject *object, wxVariantBaseArray& result) const = 0; + const wxString& GetName() const { return m_name; } + +private: + wxString m_name; +}; + +template void WXDLLIMPEXP_BASE \ + wxCollectionToVariantArray( const coll_t& coll, wxVariantBaseArray& result ); + +class WXDLLIMPEXP_BASE wxPropertyCollectionAdder +{ +public: + wxPropertyCollectionAdder( const wxString name ) { m_name = name; } + virtual ~wxPropertyCollectionAdder() {} + + virtual void Add( wxObject *object, const wxVariantBase &variantValue ) const= 0; + const wxString& GetName() const { return m_name; } + +private: + wxString m_name; +}; + +#define wxPROPERTY_SETTER( property, Klass, valueType, setterMethod ) \ +class wxPropertySetter##property : public wxPropertySetter \ +{ \ +public: \ + wxINFUNC_CLASS_TYPE_FIX(Klass) \ + wxPropertySetter##property() : wxPropertySetter( wxT(#setterMethod) ) {} \ + virtual ~wxPropertySetter##property() {} \ + \ + void Set( wxObject *object, const wxVariantBase &variantValue ) const \ + { \ + Klass *obj = dynamic_cast(object); \ + if ( variantValue.wxTEMPLATED_MEMBER_CALL(HasData, valueType) ) \ + obj->setterMethod(variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType)); \ + else \ + obj->setterMethod(*variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType*)); \ + } \ +}; + +#define wxPROPERTY_GETTER( property, Klass, valueType, gettermethod ) \ +class wxPropertyGetter##property : public wxPropertyGetter \ +{ \ +public: \ + wxINFUNC_CLASS_TYPE_FIX(Klass) \ + wxPropertyGetter##property() : wxPropertyGetter( wxT(#gettermethod) ) {} \ + virtual ~wxPropertyGetter##property() {} \ + \ + void Get( const wxObject *object, wxVariantBase &result) const \ + { \ + const Klass *obj = dynamic_cast(object); \ + result = wxVariantBase( obj->gettermethod() ); \ + } \ +}; + +#define wxPROPERTY_COLLECTION_ADDER( property, Klass, valueType, addermethod ) \ +class wxPropertyCollectionAdder##property : public wxPropertyCollectionAdder \ +{ \ +public: \ + wxINFUNC_CLASS_TYPE_FIX(Klass) \ + wxPropertyCollectionAdder##property() : wxPropertyCollectionAdder( wxT(#addermethod) ) {} \ + virtual ~wxPropertyCollectionAdder##property() {} \ + \ + void Add( wxObject *object, const wxVariantBase &variantValue ) const \ + { \ + Klass *obj = dynamic_cast(object); \ + if ( variantValue.wxTEMPLATED_MEMBER_CALL(HasData, valueType) ) \ + obj->addermethod(variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType)); \ + else \ + obj->addermethod(*variantValue.wxTEMPLATED_MEMBER_CALL(Get, valueType*)); \ + } \ +}; + +#define wxPROPERTY_COLLECTION_GETTER( property, Klass, valueType, gettermethod ) \ +class wxPropertyCollectionGetter##property : public wxPropertyCollectionGetter \ +{ \ +public: \ + wxINFUNC_CLASS_TYPE_FIX(Klass) \ + wxPropertyCollectionGetter##property() : wxPropertyCollectionGetter( wxT(#gettermethod) ) {} \ + virtual ~wxPropertyCollectionGetter##property() {} \ + \ + void Get( const wxObject *object, wxVariantBaseArray &result) const \ + { \ + const Klass *obj = dynamic_cast(object); \ + wxCollectionToVariantArray( obj->gettermethod(), result ); \ + } \ +}; + +class WXDLLIMPEXP_BASE wxPropertyAccessor +{ +public: + wxPropertyAccessor( wxPropertySetter *setter, wxPropertyGetter *getter, + wxPropertyCollectionAdder *adder, wxPropertyCollectionGetter *collectionGetter ) + { m_setter = setter; m_getter = getter; m_adder = adder; + m_collectionGetter = collectionGetter; } + + virtual ~wxPropertyAccessor() {} + + // Setting a simple property (non-collection) + virtual void SetProperty(wxObject *object, const wxVariantBase &value) const + { + if ( m_setter ) + m_setter->Set( object, value ); + else + wxLogError( _("SetProperty called w/o valid setter") ); + } + + // Getting a simple property (non-collection) + virtual void GetProperty(const wxObject *object, wxVariantBase &result) const + { + if ( m_getter ) + m_getter->Get( object, result ); + else + wxLogError( _("GetProperty called w/o valid getter") ); + } + + // Adding an element to a collection property + virtual void AddToPropertyCollection(wxObject *object, const wxVariantBase &value) const + { + if ( m_adder ) + m_adder->Add( object, value ); + else + wxLogError( _("AddToPropertyCollection called w/o valid adder") ); + } + + // Getting a collection property + virtual void GetPropertyCollection( const wxObject *obj, wxVariantBaseArray &result) const + { + if ( m_collectionGetter ) + m_collectionGetter->Get( obj, result); + else + wxLogError( _("GetPropertyCollection called w/o valid collection getter") ); + } + + virtual bool HasSetter() const { return m_setter != NULL; } + virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL; } + virtual bool HasGetter() const { return m_getter != NULL; } + virtual bool HasAdder() const { return m_adder != NULL; } + + virtual const wxString& GetCollectionGetterName() const + { return m_collectionGetter->GetName(); } + virtual const wxString& GetGetterName() const + { return m_getter->GetName(); } + virtual const wxString& GetSetterName() const + { return m_setter->GetName(); } + virtual const wxString& GetAdderName() const + { return m_adder->GetName(); } + +protected: + wxPropertySetter *m_setter; + wxPropertyCollectionAdder *m_adder; + wxPropertyGetter *m_getter; + wxPropertyCollectionGetter* m_collectionGetter; +}; + +class WXDLLIMPEXP_BASE wxGenericPropertyAccessor : public wxPropertyAccessor +{ +public: + wxGenericPropertyAccessor( const wxString &propName ); + virtual ~wxGenericPropertyAccessor(); + + void RenameProperty( const wxString& WXUNUSED_UNLESS_DEBUG(oldName), + const wxString& newName ) + { + wxASSERT( oldName == m_propertyName ); m_propertyName = newName; + } + + virtual bool HasSetter() const { return true; } + virtual bool HasGetter() const { return true; } + virtual bool HasAdder() const { return false; } + virtual bool HasCollectionGetter() const { return false; } + + virtual const wxString& GetGetterName() const + { return m_getterName; } + virtual const wxString& GetSetterName() const + { return m_setterName; } + + virtual void SetProperty(wxObject *object, const wxVariantBase &value) const; + virtual void GetProperty(const wxObject *object, wxVariantBase &value) const; + + // Adding an element to a collection property + virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), + const wxVariantBase &WXUNUSED(value)) const + { + wxLogError( _("AddToPropertyCollection called on a generic accessor") ); + } + + // Getting a collection property + virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), + wxVariantBaseArray &WXUNUSED(result)) const + { + wxLogError ( _("GetPropertyCollection called on a generic accessor") ); + } + +private: + struct wxGenericPropertyAccessorInternal; + wxGenericPropertyAccessorInternal* m_data; + wxString m_propertyName; + wxString m_setterName; + wxString m_getterName; +}; + +typedef long wxPropertyInfoFlags; +enum +{ + // will be removed in future releases + wxPROP_DEPRECATED = 0x00000001, + + // object graph property, will be streamed with priority (after constructor properties) + wxPROP_OBJECT_GRAPH = 0x00000002, + + // this will only be streamed out and in as enum/set, the internal representation + // is still a long + wxPROP_ENUM_STORE_LONG = 0x00000004, + + // don't stream out this property, needed eg to avoid streaming out children + // that are always created by their parents + wxPROP_DONT_STREAM = 0x00000008 +}; + + +// ---------------------------------------------------------------------------- +// Property Support +// +// wxPropertyInfo is used to inquire of the property by name. It doesn't +// provide access to the property, only information about it. If you +// want access, look at wxPropertyAccessor. +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_BASE wxPropertyInfo +{ + friend class WXDLLIMPEXP_BASE wxDynamicClassInfo; + +public: + wxPropertyInfo(wxPropertyInfo* &iter, + wxClassInfo* itsClass, + const wxString& name, + const wxString& typeName, + wxPropertyAccessor *accessor, + wxVariantBase dv, + wxPropertyInfoFlags flags = 0, + const wxString& helpString = wxEmptyString, + const wxString& groupString = wxEmptyString) : + m_itsClass(itsClass), + m_name(name), + m_typeInfo(NULL), + m_typeName(typeName), + m_collectionElementTypeInfo(NULL), + m_accessor(accessor), + m_defaultValue(dv), + m_flags(flags), + m_helpString(helpString), + m_groupString(groupString) + { + Insert(iter); + } + +#if wxUSE_UNICODE + wxPropertyInfo(wxPropertyInfo* &iter, + wxClassInfo* itsClass, + const wxString& name, + const char* typeName, + wxPropertyAccessor *accessor, + wxVariantBase dv, + wxPropertyInfoFlags flags = 0, + const wxString& helpString = wxEmptyString, + const wxString& groupString = wxEmptyString) : + m_itsClass(itsClass), + m_name(name), + m_typeInfo(NULL), + m_typeName(wxString::FromAscii(typeName)), + m_collectionElementTypeInfo(NULL), + m_accessor(accessor), + m_defaultValue(dv), + m_flags(flags), + m_helpString(helpString), + m_groupString(groupString) + { + Insert(iter); + } +#endif + wxPropertyInfo(wxPropertyInfo* &iter, + wxClassInfo* itsClass, + const wxString& name, + wxEventSourceTypeInfo* type, + wxPropertyAccessor *accessor, + wxVariantBase dv, + wxPropertyInfoFlags flags = 0, + const wxString& helpString = wxEmptyString, + const wxString& groupString = wxEmptyString) : + m_itsClass(itsClass), + m_name(name), + m_typeInfo(type), + m_collectionElementTypeInfo(NULL), + m_accessor(accessor), + m_defaultValue(dv), + m_flags(flags), + m_helpString(helpString), + m_groupString(groupString) + { + Insert(iter); + } + + wxPropertyInfo(wxPropertyInfo* &iter, + wxClassInfo* itsClass, const wxString& name, + const wxString& collectionTypeName, + const wxString& elementTypeName, + wxPropertyAccessor *accessor, + wxPropertyInfoFlags flags = 0, + const wxString& helpString = wxEmptyString, + const wxString& groupString = wxEmptyString) : + m_itsClass(itsClass), + m_name(name), + m_typeInfo(NULL), + m_typeName(collectionTypeName), + m_collectionElementTypeInfo(NULL), + m_collectionElementTypeName(elementTypeName), + m_accessor(accessor), + m_flags(flags), + m_helpString(helpString), + m_groupString(groupString) + { + Insert(iter); + } + +#if wxUSE_UNICODE + wxPropertyInfo(wxPropertyInfo* &iter, + wxClassInfo* itsClass, const wxString& name, + const char* collectionTypeName, + const char* elementTypeName, + wxPropertyAccessor *accessor, + wxPropertyInfoFlags flags = 0, + const wxString& helpString = wxEmptyString, + const wxString& groupString = wxEmptyString) : + m_itsClass(itsClass), + m_name(name), + m_typeInfo(NULL), + m_typeName(wxString::FromAscii(collectionTypeName)), + m_collectionElementTypeInfo(NULL), + m_collectionElementTypeName(wxString::FromAscii(elementTypeName)), + m_accessor(accessor), + m_flags(flags), + m_helpString(helpString), + m_groupString(groupString) + { + Insert(iter); + } +#endif + ~wxPropertyInfo() + { Remove(); } + + // return the class this property is declared in + const wxClassInfo* GetDeclaringClass() const { return m_itsClass; } + + // return the name of this property + const wxString& GetName() const { return m_name; } + + // returns the flags of this property + wxPropertyInfoFlags GetFlags() const { return m_flags; } + + // returns the short help string of this property + const wxString& GetHelpString() const { return m_helpString; } + + // returns the group string of this property + const wxString& GetGroupString() const { return m_groupString; } + + // return the element type info of this property (for collections, otherwise NULL) + const wxTypeInfo * GetCollectionElementTypeInfo() const + { + if ( m_collectionElementTypeInfo == NULL ) + m_collectionElementTypeInfo = wxTypeInfo::FindType(m_collectionElementTypeName); + return m_collectionElementTypeInfo; + } + + // return the type info of this property + const wxTypeInfo * GetTypeInfo() const + { + if ( m_typeInfo == NULL ) + m_typeInfo = wxTypeInfo::FindType(m_typeName); + return m_typeInfo; + } + + // return the accessor for this property + wxPropertyAccessor* GetAccessor() const { return m_accessor; } + + // returns NULL if this is the last property of this class + wxPropertyInfo* GetNext() const { return m_next; } + + // returns the default value of this property, its kind may be wxT_VOID if it is not valid + wxVariantBase GetDefaultValue() const { return m_defaultValue; } + +private: + + // inserts this property at the end of the linked chain which begins + // with "iter" property. + void Insert(wxPropertyInfo* &iter); + + // removes this property from the linked chain of the m_itsClass properties. + void Remove(); + + wxClassInfo* m_itsClass; + wxString m_name; + mutable wxTypeInfo* m_typeInfo; + wxString m_typeName; + mutable wxTypeInfo* m_collectionElementTypeInfo; + wxString m_collectionElementTypeName; + wxPropertyAccessor* m_accessor; + wxVariantBase m_defaultValue; + wxPropertyInfoFlags m_flags; + wxString m_helpString; + wxString m_groupString; + wxPropertyInfo* m_next; + + // FIXME: what's this comment about?? + // string representation of the default value + // to be assigned by the designer to the property + // when the component is dropped on the container. +}; + +WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxPropertyInfo*, wxPropertyInfoMap, + class WXDLLIMPEXP_BASE ); + +#define wxBEGIN_PROPERTIES_TABLE(theClass) \ + wxPropertyInfo *theClass::GetPropertiesStatic() \ + { \ + typedef theClass class_t; \ + static wxPropertyInfo* first = NULL; + +#define wxEND_PROPERTIES_TABLE() \ + return first; } + +#define wxHIDE_PROPERTY( pname ) \ + static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ + wxT(#pname), typeid(void).name(), NULL, wxVariantBase(), wxPROP_DONT_STREAM, \ + wxEmptyString, wxEmptyString ); + +#define wxPROPERTY( pname, type, setter, getter, defaultValue, flags, help, group) \ + wxPROPERTY_SETTER( pname, class_t, type, setter ) \ + static wxPropertySetter##pname _setter##pname; \ + wxPROPERTY_GETTER( pname, class_t, type, getter ) \ + static wxPropertyGetter##pname _getter##pname; \ + static wxPropertyAccessor _accessor##pname( &_setter##pname, \ + &_getter##pname, NULL, NULL ); \ + static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ + wxT(#pname), typeid(type).name(), &_accessor##pname, \ + wxVariantBase(defaultValue), flags, group, help ); + +#define wxPROPERTY_FLAGS( pname, flags, type, setter, getter,defaultValue, \ + pflags, help, group) \ + wxPROPERTY_SETTER( pname, class_t, type, setter ) \ + static wxPropertySetter##pname _setter##pname; \ + wxPROPERTY_GETTER( pname, class_t, type, getter ) \ + static wxPropertyGetter##pname _getter##pname; \ + static wxPropertyAccessor _accessor##pname( &_setter##pname, \ + &_getter##pname, NULL, NULL ); \ + static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ + wxT(#pname), typeid(flags).name(), &_accessor##pname, \ + wxVariantBase(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group ); + +#define wxREADONLY_PROPERTY( pname, type, getter,defaultValue, flags, help, group) \ + wxPROPERTY_GETTER( pname, class_t, type, getter ) \ + static wxPropertyGetter##pname _getter##pname; \ + static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL ); \ + static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ + wxT(#pname), typeid(type).name(),&_accessor##pname, \ + wxVariantBase(defaultValue), flags, help, group ); + +#define wxREADONLY_PROPERTY_FLAGS( pname, flags, type, getter,defaultValue, \ + pflags, help, group) \ + wxPROPERTY_GETTER( pname, class_t, type, getter ) \ + static wxPropertyGetter##pname _getter##pname; \ + static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL ); \ + static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ + wxT(#pname), typeid(flags).name(),&_accessor##pname, \ + wxVariantBase(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group ); + +#define wxPROPERTY_COLLECTION( pname, colltype, addelemtype, adder, getter, \ + flags, help, group ) \ + wxPROPERTY_COLLECTION_ADDER( pname, class_t, addelemtype, adder ) \ + static wxPropertyCollectionAdder##pname _adder##pname; \ + wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter ) \ + static wxPropertyCollectionGetter##pname _collectionGetter##pname; \ + static wxPropertyAccessor _accessor##pname( NULL, NULL,&_adder##pname, \ + &_collectionGetter##pname ); \ + static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ + wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(), \ + &_accessor##pname, flags, help, group ); + +#define wxREADONLY_PROPERTY_COLLECTION( pname, colltype, addelemtype, getter, \ + flags, help, group) \ + wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter ) \ + static wxPropertyCollectionGetter##pname _collectionGetter##pname; \ + static wxPropertyAccessor _accessor##pname( NULL, NULL, NULL, \ + &_collectionGetter##pname ); \ + static wxPropertyInfo _propertyInfo##pname( first,class_t::GetClassInfoStatic(), \ + wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(), \ + &_accessor##pname, flags, help, group ); + +#define wxEVENT_PROPERTY( name, eventType, eventClass ) \ + static wxEventSourceTypeInfo _typeInfo##name( eventType, CLASSINFO( eventClass ) ); \ + static wxPropertyInfo _propertyInfo##name( first,class_t::GetClassInfoStatic(), \ + wxT(#name), &_typeInfo##name, NULL, wxVariantBase() ); + +#define wxEVENT_RANGE_PROPERTY( name, eventType, lastEventType, eventClass ) \ + static wxEventSourceTypeInfo _typeInfo##name( eventType, lastEventType, \ + CLASSINFO( eventClass ) ); \ + static wxPropertyInfo _propertyInfo##name( first, class_t::GetClassInfoStatic(), \ + wxT(#name), &_typeInfo##name, NULL, wxVariantBase() ); + +// ---------------------------------------------------------------------------- +// Implementation Helper for Simple Properties +// ---------------------------------------------------------------------------- + +#define wxIMPLEMENT_PROPERTY(name, type) \ +private: \ + type m_##name; \ +public: \ + void Set##name( type const & p) { m_##name = p; } \ + type const & Get##name() const { return m_##name; } + +#endif // wxUSE_EXTENDED_RTTI +#endif // _XTIPROP_H_ diff --git a/include/wx/xtitypes.h b/include/wx/xtitypes.h index 81331a885a..212fba1951 100644 --- a/include/wx/xtitypes.h +++ b/include/wx/xtitypes.h @@ -1,581 +1,581 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xtitypes.h -// Purpose: enum, set, basic types support -// Author: Stefan Csomor -// Modified by: Francesco Montorsi -// Created: 27/07/03 -// RCS-ID: $Id: xti.h 47299 2007-07-10 15:58:27Z FM $ -// Copyright: (c) 1997 Julian Smart -// (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _XTITYPES_H_ -#define _XTITYPES_H_ - -#include "wx/defs.h" - -#if wxUSE_EXTENDED_RTTI - -#include "wx/string.h" -#include "wx/hashmap.h" -#include "wx/arrstr.h" -#include "wx/flags.h" -#include "wx/intl.h" -#include "wx/log.h" -#include - -class WXDLLIMPEXP_BASE wxClassInfo; - -// ---------------------------------------------------------------------------- -// Enum Support -// -// In the header files XTI requires no change from pure c++ code, however in the -// implementation, an enum needs to be enumerated eg: -// -// wxBEGIN_ENUM( wxFlavor ) -// wxENUM_MEMBER( Vanilla ) -// wxENUM_MEMBER( Chocolate ) -// wxENUM_MEMBER( Strawberry ) -// wxEND_ENUM( wxFlavor ) -// ---------------------------------------------------------------------------- - -struct WXDLLIMPEXP_BASE wxEnumMemberData -{ - const wxChar* m_name; - int m_value; -}; - -class WXDLLIMPEXP_BASE wxEnumData -{ -public: - wxEnumData( wxEnumMemberData* data ); - - // returns true if the member has been found and sets the int value - // pointed to accordingly (if ptr != null ) - // if not found returns false, value left unchanged - bool HasEnumMemberValue( const wxChar *name, int *value = NULL ) const; - - // returns the value of the member, if not found in debug mode an - // assert is issued, in release 0 is returned - int GetEnumMemberValue(const wxChar *name ) const; - - // returns the name of the enum member having the passed in value - // returns an emtpy string if not found - const wxChar *GetEnumMemberName(int value) const; - - // returns the number of members in this enum - int GetEnumCount() const { return m_count; } - - // returns the value of the nth member - int GetEnumMemberValueByIndex( int n ) const; - - // returns the value of the nth member - const wxChar *GetEnumMemberNameByIndex( int n ) const; - -private: - wxEnumMemberData *m_members; - int m_count; -}; - -#define wxBEGIN_ENUM( e ) \ - wxEnumMemberData s_enumDataMembers##e[] = { - -#define wxENUM_MEMBER( v ) { wxT(#v), v }, - -#define wxEND_ENUM( e ) \ - { NULL, 0 } }; \ - wxEnumData s_enumData##e( s_enumDataMembers##e ); \ - wxEnumData *wxGetEnumData(e) { return &s_enumData##e; } \ - template<> void wxStringReadValue(const wxString& s, e &data ) \ - { data = (e) s_enumData##e.GetEnumMemberValue(s); } \ - template<> void wxStringWriteValue(wxString &s, const e &data ) \ - { s = s_enumData##e.GetEnumMemberName((int)data); } \ - void FromLong##e( long data, wxVariantBase& result ) \ - { result = wxVariantBase((e)data); } \ - void ToLong##e( const wxVariantBase& data, long &result ) \ - { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get, e); } \ - \ - wxTO_STRING_IMP( e ) \ - wxFROM_STRING_IMP( e ) \ - wxEnumTypeInfo s_typeInfo##e(wxT_ENUM, &s_enumData##e, \ - &wxTO_STRING( e ), &wxFROM_STRING( e ), &ToLong##e, \ - &FromLong##e, typeid(e).name() ); - - -// ---------------------------------------------------------------------------- -// Set Support -// -// in the header : -// -// enum wxFlavor -// { -// Vanilla, -// Chocolate, -// Strawberry, -// }; -// -// typedef wxBitset wxCoupe; -// -// in the implementation file : -// -// wxBEGIN_ENUM( wxFlavor ) -// wxENUM_MEMBER( Vanilla ) -// wxENUM_MEMBER( Chocolate ) -// wxENUM_MEMBER( Strawberry ) -// wxEND_ENUM( wxFlavor ) -// -// wxIMPLEMENT_SET_STREAMING( wxCoupe, wxFlavor ) -// -// implementation note: no partial specialization for streaming, but a delegation -// to a different class -// -// ---------------------------------------------------------------------------- - -// in order to remove dependancy on string tokenizer -void WXDLLIMPEXP_BASE wxSetStringToArray( const wxString &s, wxArrayString &array ); - -template -void wxSetFromString(const wxString &s, wxBitset &data ) -{ - wxEnumData* edata = wxGetEnumData((e) 0); - data.reset(); - - wxArrayString array; - wxSetStringToArray( s, array ); - wxString flag; - for ( int i = 0; i < array.Count(); ++i ) - { - flag = array[i]; - int ivalue; - if ( edata->HasEnumMemberValue( flag, &ivalue ) ) - { - data.set( (e) ivalue ); - } - } -} - -template -void wxSetToString( wxString &s, const wxBitset &data ) -{ - wxEnumData* edata = wxGetEnumData((e) 0); - int count = edata->GetEnumCount(); - int i; - s.Clear(); - for ( i = 0; i < count; i++ ) - { - e value = (e) edata->GetEnumMemberValueByIndex(i); - if ( data.test( value ) ) - { - // this could also be done by the templated calls - if ( !s.empty() ) - s += wxT("|"); - s += edata->GetEnumMemberNameByIndex(i); - } - } -} - -#define wxIMPLEMENT_SET_STREAMING(SetName,e) \ - template<> void wxStringReadValue(const wxString &s, wxBitset &data ) \ - { wxSetFromString( s, data ); } \ - template<> void wxStringWriteValue( wxString &s, const wxBitset &data ) \ - { wxSetToString( s, data ); } \ - void FromLong##SetName( long data, wxVariantBase& result ) \ - { result = wxVariantBase(SetName((unsigned long)data)); } \ - void ToLong##SetName( const wxVariantBase& data, long &result ) \ - { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get, SetName).to_ulong(); } \ - wxTO_STRING_IMP( SetName ) \ - wxFROM_STRING_IMP( SetName ) \ - wxEnumTypeInfo s_typeInfo##SetName(wxT_SET, &s_enumData##e, \ - &wxTO_STRING( SetName ), &wxFROM_STRING( SetName ), \ - &ToLong##SetName, &FromLong##SetName, typeid(SetName).name() ); - -template -void wxFlagsFromString(const wxString &s, e &data ) -{ - wxEnumData* edata = wxGetEnumData((e*) 0); - data.m_data = 0; - - wxArrayString array; - wxSetStringToArray( s, array ); - wxString flag; - for ( size_t i = 0; i < array.Count(); ++i ) - { - flag = array[i]; - int ivalue; - if ( edata->HasEnumMemberValue( flag, &ivalue ) ) - { - data.m_data |= ivalue; - } - } -} - -template -void wxFlagsToString( wxString &s, const e& data ) -{ - wxEnumData* edata = wxGetEnumData((e*) 0); - int count = edata->GetEnumCount(); - int i; - s.Clear(); - long dataValue = data.m_data; - for ( i = 0; i < count; i++ ) - { - int value = edata->GetEnumMemberValueByIndex(i); - // make this to allow for multi-bit constants to work - if ( value && ( dataValue & value ) == value ) - { - // clear the flags we just set - dataValue &= ~value; - // this could also be done by the templated calls - if ( !s.empty() ) - s +=wxT("|"); - s += edata->GetEnumMemberNameByIndex(i); - } - } -} - -#define wxBEGIN_FLAGS( e ) \ - wxEnumMemberData s_enumDataMembers##e[] = { - -#define wxFLAGS_MEMBER( v ) { wxT(#v), v }, - -#define wxEND_FLAGS( e ) \ - { NULL, 0 } }; \ - wxEnumData s_enumData##e( s_enumDataMembers##e ); \ - wxEnumData *wxGetEnumData(e*) { return &s_enumData##e; } \ - template<> void wxStringReadValue(const wxString &s, e &data ) \ - { wxFlagsFromString( s, data ); } \ - template<> void wxStringWriteValue( wxString &s, const e& data ) \ - { wxFlagsToString( s, data ); } \ - void FromLong##e( long data, wxVariantBase& result ) \ - { result = wxVariantBase(e(data)); } \ - void ToLong##e( const wxVariantBase& data, long &result ) \ - { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get, e).m_data; } \ - wxTO_STRING_IMP( e ) \ - wxFROM_STRING_IMP( e ) \ - wxEnumTypeInfo s_typeInfo##e(wxT_SET, &s_enumData##e, \ - &wxTO_STRING( e ), &wxFROM_STRING( e ), &ToLong##e, \ - &FromLong##e, typeid(e).name() ); - -// ---------------------------------------------------------------------------- -// Type Information -// ---------------------------------------------------------------------------- - -// All data exposed by the RTTI is characterized using the following classes. -// The first characterization is done by wxTypeKind. All enums up to and including -// wxT_CUSTOM represent so called simple types. These cannot be divided any further. -// They can be converted to and from wxStrings, that's all. -// Other wxTypeKinds can instead be splitted recursively into smaller parts until -// the simple types are reached. - -enum wxTypeKind -{ - wxT_VOID = 0, // unknown type - wxT_BOOL, - wxT_CHAR, - wxT_UCHAR, - wxT_INT, - wxT_UINT, - wxT_LONG, - wxT_ULONG, - wxT_FLOAT, - wxT_DOUBLE, - wxT_STRING, // must be wxString - wxT_SET, // must be wxBitset<> template - wxT_ENUM, - wxT_CUSTOM, // user defined type (e.g. wxPoint) - - wxT_LAST_SIMPLE_TYPE_KIND = wxT_CUSTOM, - - wxT_OBJECT_PTR, // object reference - wxT_OBJECT, // embedded object - wxT_COLLECTION, // collection - - wxT_DELEGATE, // for connecting against an event source - - wxT_LAST_TYPE_KIND = wxT_DELEGATE // sentinel for bad data, asserts, debugging -}; - -class WXDLLIMPEXP_BASE wxVariantBase; -class WXDLLIMPEXP_BASE wxTypeInfo; - -WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxTypeInfo*, wxTypeInfoMap, class WXDLLIMPEXP_BASE ); - -class WXDLLIMPEXP_BASE wxTypeInfo -{ -public: - typedef void (*wxVariant2StringFnc)( const wxVariantBase& data, wxString &result ); - typedef void (*wxString2VariantFnc)( const wxString& data, wxVariantBase &result ); - - wxTypeInfo(wxTypeKind kind, - wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL, - const wxString &name = wxEmptyString): - m_toString(to), m_fromString(from), m_kind(kind), m_name(name) - { - Register(); - } -#if wxUSE_UNICODE - wxTypeInfo(wxTypeKind kind, - wxVariant2StringFnc to, wxString2VariantFnc from, - const char *name): - m_toString(to), m_fromString(from), m_kind(kind), - m_name(wxString::FromAscii(name)) - { - Register(); - } -#endif - - virtual ~wxTypeInfo() - { - Unregister(); - } - - // return the kind of this type (wxT_... constants) - wxTypeKind GetKind() const { return m_kind; } - - // returns the unique name of this type - const wxString& GetTypeName() const { return m_name; } - - // is this type a delegate type - bool IsDelegateType() const { return m_kind == wxT_DELEGATE; } - - // is this type a custom type - bool IsCustomType() const { return m_kind == wxT_CUSTOM; } - - // is this type an object type - bool IsObjectType() const { return m_kind == wxT_OBJECT || m_kind == wxT_OBJECT_PTR; } - - // can the content of this type be converted to and from strings ? - bool HasStringConverters() const { return m_toString != NULL && m_fromString != NULL; } - - // convert a wxVariantBase holding data of this type into a string - void ConvertToString( const wxVariantBase& data, wxString &result ) const - { - if ( m_toString ) - (*m_toString)( data, result ); - else - wxLogError( wxGetTranslation(_T("String conversions not supported")) ); - } - - // convert a string into a wxVariantBase holding the corresponding data in this type - void ConvertFromString( const wxString& data, wxVariantBase &result ) const - { - if( m_fromString ) - (*m_fromString)( data, result ); - else - wxLogError( wxGetTranslation(_T("String conversions not supported")) ); - } - - // statics: - -#if wxUSE_UNICODE - static wxTypeInfo *FindType(const char *typeName) - { return FindType( wxString::FromAscii(typeName) ); } -#endif - static wxTypeInfo *FindType(const wxChar *typeName); - static wxTypeInfo *FindType(const wxString& typeName) - { -#if wxUSE_UNICODE - return FindType( typeName.wchar_str() ); -#else - return FindType( typeName.char_str() ); -#endif - } - -private: - void Register(); - void Unregister(); - - wxVariant2StringFnc m_toString; - wxString2VariantFnc m_fromString; - - wxTypeKind m_kind; - wxString m_name; - - // the static list of all types we know about - static wxTypeInfoMap* ms_typeTable; -}; - -class WXDLLIMPEXP_BASE wxBuiltInTypeInfo : public wxTypeInfo -{ -public: - wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to = NULL, - wxString2VariantFnc from = NULL, - const wxString &name = wxEmptyString ) : - wxTypeInfo( kind, to, from, name ) - { wxASSERT_MSG( GetKind() < wxT_SET, wxT("Illegal Kind for Base Type") ); } - -#if wxUSE_UNICODE - wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to, - wxString2VariantFnc from , const char *name ) : - wxTypeInfo( kind, to, from, name ) - { wxASSERT_MSG( GetKind() < wxT_SET, wxT("Illegal Kind for Base Type") ); } -#endif -}; - -class WXDLLIMPEXP_BASE wxCustomTypeInfo : public wxTypeInfo -{ -public: - wxCustomTypeInfo( const wxString &name, wxVariant2StringFnc to, - wxString2VariantFnc from ) : - wxTypeInfo( wxT_CUSTOM, to, from, name ) - {} - -#if wxUSE_UNICODE - wxCustomTypeInfo( const char *name , wxVariant2StringFnc to, - wxString2VariantFnc from ) : - wxTypeInfo( wxT_CUSTOM, to, from, name ) - {} -#endif -}; - -class WXDLLIMPEXP_BASE wxEnumTypeInfo : public wxTypeInfo -{ -public: - typedef void (*converterToLong_t)( const wxVariantBase& data, long &result ); - typedef void (*converterFromLong_t)( long data, wxVariantBase &result ); - - wxEnumTypeInfo( wxTypeKind kind, wxEnumData* enumInfo, wxVariant2StringFnc to, - wxString2VariantFnc from, converterToLong_t toLong, - converterFromLong_t fromLong, const wxString &name ) : - wxTypeInfo( kind, to, from, name ), m_toLong( toLong ), m_fromLong( fromLong ) - { - wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET, - wxT("Illegal Kind for Enum Type")); - m_enumInfo = enumInfo; - } - -#if wxUSE_UNICODE - wxEnumTypeInfo( wxTypeKind kind, wxEnumData* enumInfo, wxVariant2StringFnc to, - wxString2VariantFnc from, converterToLong_t toLong, - converterFromLong_t fromLong, const char * name ) : - wxTypeInfo( kind, to, from, name ), m_toLong( toLong ), m_fromLong( fromLong ) - { - wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET, - wxT("Illegal Kind for Enum Type")); - m_enumInfo = enumInfo; - } -#endif - const wxEnumData* GetEnumData() const { return m_enumInfo; } - - // convert a wxVariantBase holding data of this type into a long - void ConvertToLong( const wxVariantBase& data, long &result ) const - { - if( m_toLong ) - (*m_toLong)( data, result ); - else - wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ); - } - - // convert a long into a wxVariantBase holding the corresponding data in this type - void ConvertFromLong( long data, wxVariantBase &result ) const - { - if( m_fromLong ) - (*m_fromLong)( data, result ); - else - wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ); - } - -private: - converterToLong_t m_toLong; - converterFromLong_t m_fromLong; - - wxEnumData *m_enumInfo; // Kind == wxT_ENUM or Kind == wxT_SET -}; - -class WXDLLIMPEXP_BASE wxClassTypeInfo : public wxTypeInfo -{ -public: - wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo, - wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL, - const wxString &name = wxEmptyString); - -#if wxUSE_UNICODE - wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo, wxVariant2StringFnc to, - wxString2VariantFnc from , const char *name ); -#endif - - const wxClassInfo *GetClassInfo() const { return m_classInfo; } - -private: - wxClassInfo *m_classInfo; // Kind == wxT_OBJECT - could be NULL -}; - -class WXDLLIMPEXP_BASE wxCollectionTypeInfo : public wxTypeInfo -{ -public: - wxCollectionTypeInfo( const wxString &elementName, wxVariant2StringFnc to, - wxString2VariantFnc from , const wxString &name) : - wxTypeInfo( wxT_COLLECTION, to, from, name ) - { m_elementTypeName = elementName; m_elementType = NULL; } - -#if wxUSE_UNICODE - wxCollectionTypeInfo( const char *elementName, wxVariant2StringFnc to, - wxString2VariantFnc from , const char *name ) : - wxTypeInfo( wxT_COLLECTION, to, from, name ) - { m_elementTypeName = wxString::FromAscii( elementName ); m_elementType = NULL; } -#endif - - const wxTypeInfo* GetElementType() const - { - if ( m_elementType == NULL ) - m_elementType = wxTypeInfo::FindType( m_elementTypeName ); - return m_elementType; - } - -private: - mutable wxTypeInfo * m_elementType; - wxString m_elementTypeName; -}; - -class WXDLLIMPEXP_BASE wxEventSourceTypeInfo : public wxTypeInfo -{ -public: - wxEventSourceTypeInfo( int eventType, wxClassInfo* eventClass, - wxVariant2StringFnc to = NULL, - wxString2VariantFnc from = NULL ); - wxEventSourceTypeInfo( int eventType, int lastEventType, wxClassInfo* eventClass, - wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL ); - - int GetEventType() const { return m_eventType; } - int GetLastEventType() const { return m_lastEventType; } - const wxClassInfo* GetEventClass() const { return m_eventClass; } - -private: - const wxClassInfo *m_eventClass; // (extended will merge into classinfo) - int m_eventType; - int m_lastEventType; -}; - -template const wxTypeInfo* wxGetTypeInfo( T * ) \ - { return wxTypeInfo::FindType(typeid(T).name()); } - -// this macro is for usage with custom, non-object derived classes and structs, -// wxPoint is such a custom type - -#if wxUSE_FUNC_TEMPLATE_POINTER - #define wxCUSTOM_TYPE_INFO( e, toString, fromString ) \ - wxCustomTypeInfo s_typeInfo##e(typeid(e).name(), &toString, &fromString); -#else - #define wxCUSTOM_TYPE_INFO( e, toString, fromString ) \ - void ToString##e( const wxVariantBase& data, wxString &result ) \ - { toString(data, result); } \ - void FromString##e( const wxString& data, wxVariantBase &result ) \ - { fromString(data, result); } \ - wxCustomTypeInfo s_typeInfo##e(typeid(e).name(), \ - &ToString##e, &FromString##e); -#endif - -#define wxCOLLECTION_TYPE_INFO( element, collection ) \ - wxCollectionTypeInfo s_typeInfo##collection( typeid(element).name(), \ - NULL, NULL, typeid(collection).name() ); - -// sometimes a compiler invents specializations that are nowhere called, -// use this macro to satisfy the refs, currently we don't have to play -// tricks, but if we will have to according to the compiler, we will use -// that macro for that - -#define wxILLEGAL_TYPE_SPECIALIZATION( a ) - -#endif // wxUSE_EXTENDED_RTTI -#endif // _XTITYPES_H_ +///////////////////////////////////////////////////////////////////////////// +// Name: wx/xtitypes.h +// Purpose: enum, set, basic types support +// Author: Stefan Csomor +// Modified by: Francesco Montorsi +// Created: 27/07/03 +// RCS-ID: $Id$ +// Copyright: (c) 1997 Julian Smart +// (c) 2003 Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _XTITYPES_H_ +#define _XTITYPES_H_ + +#include "wx/defs.h" + +#if wxUSE_EXTENDED_RTTI + +#include "wx/string.h" +#include "wx/hashmap.h" +#include "wx/arrstr.h" +#include "wx/flags.h" +#include "wx/intl.h" +#include "wx/log.h" +#include + +class WXDLLIMPEXP_BASE wxClassInfo; + +// ---------------------------------------------------------------------------- +// Enum Support +// +// In the header files XTI requires no change from pure c++ code, however in the +// implementation, an enum needs to be enumerated eg: +// +// wxBEGIN_ENUM( wxFlavor ) +// wxENUM_MEMBER( Vanilla ) +// wxENUM_MEMBER( Chocolate ) +// wxENUM_MEMBER( Strawberry ) +// wxEND_ENUM( wxFlavor ) +// ---------------------------------------------------------------------------- + +struct WXDLLIMPEXP_BASE wxEnumMemberData +{ + const wxChar* m_name; + int m_value; +}; + +class WXDLLIMPEXP_BASE wxEnumData +{ +public: + wxEnumData( wxEnumMemberData* data ); + + // returns true if the member has been found and sets the int value + // pointed to accordingly (if ptr != null ) + // if not found returns false, value left unchanged + bool HasEnumMemberValue( const wxChar *name, int *value = NULL ) const; + + // returns the value of the member, if not found in debug mode an + // assert is issued, in release 0 is returned + int GetEnumMemberValue(const wxChar *name ) const; + + // returns the name of the enum member having the passed in value + // returns an emtpy string if not found + const wxChar *GetEnumMemberName(int value) const; + + // returns the number of members in this enum + int GetEnumCount() const { return m_count; } + + // returns the value of the nth member + int GetEnumMemberValueByIndex( int n ) const; + + // returns the value of the nth member + const wxChar *GetEnumMemberNameByIndex( int n ) const; + +private: + wxEnumMemberData *m_members; + int m_count; +}; + +#define wxBEGIN_ENUM( e ) \ + wxEnumMemberData s_enumDataMembers##e[] = { + +#define wxENUM_MEMBER( v ) { wxT(#v), v }, + +#define wxEND_ENUM( e ) \ + { NULL, 0 } }; \ + wxEnumData s_enumData##e( s_enumDataMembers##e ); \ + wxEnumData *wxGetEnumData(e) { return &s_enumData##e; } \ + template<> void wxStringReadValue(const wxString& s, e &data ) \ + { data = (e) s_enumData##e.GetEnumMemberValue(s); } \ + template<> void wxStringWriteValue(wxString &s, const e &data ) \ + { s = s_enumData##e.GetEnumMemberName((int)data); } \ + void FromLong##e( long data, wxVariantBase& result ) \ + { result = wxVariantBase((e)data); } \ + void ToLong##e( const wxVariantBase& data, long &result ) \ + { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get, e); } \ + \ + wxTO_STRING_IMP( e ) \ + wxFROM_STRING_IMP( e ) \ + wxEnumTypeInfo s_typeInfo##e(wxT_ENUM, &s_enumData##e, \ + &wxTO_STRING( e ), &wxFROM_STRING( e ), &ToLong##e, \ + &FromLong##e, typeid(e).name() ); + + +// ---------------------------------------------------------------------------- +// Set Support +// +// in the header : +// +// enum wxFlavor +// { +// Vanilla, +// Chocolate, +// Strawberry, +// }; +// +// typedef wxBitset wxCoupe; +// +// in the implementation file : +// +// wxBEGIN_ENUM( wxFlavor ) +// wxENUM_MEMBER( Vanilla ) +// wxENUM_MEMBER( Chocolate ) +// wxENUM_MEMBER( Strawberry ) +// wxEND_ENUM( wxFlavor ) +// +// wxIMPLEMENT_SET_STREAMING( wxCoupe, wxFlavor ) +// +// implementation note: no partial specialization for streaming, but a delegation +// to a different class +// +// ---------------------------------------------------------------------------- + +// in order to remove dependancy on string tokenizer +void WXDLLIMPEXP_BASE wxSetStringToArray( const wxString &s, wxArrayString &array ); + +template +void wxSetFromString(const wxString &s, wxBitset &data ) +{ + wxEnumData* edata = wxGetEnumData((e) 0); + data.reset(); + + wxArrayString array; + wxSetStringToArray( s, array ); + wxString flag; + for ( int i = 0; i < array.Count(); ++i ) + { + flag = array[i]; + int ivalue; + if ( edata->HasEnumMemberValue( flag, &ivalue ) ) + { + data.set( (e) ivalue ); + } + } +} + +template +void wxSetToString( wxString &s, const wxBitset &data ) +{ + wxEnumData* edata = wxGetEnumData((e) 0); + int count = edata->GetEnumCount(); + int i; + s.Clear(); + for ( i = 0; i < count; i++ ) + { + e value = (e) edata->GetEnumMemberValueByIndex(i); + if ( data.test( value ) ) + { + // this could also be done by the templated calls + if ( !s.empty() ) + s += wxT("|"); + s += edata->GetEnumMemberNameByIndex(i); + } + } +} + +#define wxIMPLEMENT_SET_STREAMING(SetName,e) \ + template<> void wxStringReadValue(const wxString &s, wxBitset &data ) \ + { wxSetFromString( s, data ); } \ + template<> void wxStringWriteValue( wxString &s, const wxBitset &data ) \ + { wxSetToString( s, data ); } \ + void FromLong##SetName( long data, wxVariantBase& result ) \ + { result = wxVariantBase(SetName((unsigned long)data)); } \ + void ToLong##SetName( const wxVariantBase& data, long &result ) \ + { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get, SetName).to_ulong(); } \ + wxTO_STRING_IMP( SetName ) \ + wxFROM_STRING_IMP( SetName ) \ + wxEnumTypeInfo s_typeInfo##SetName(wxT_SET, &s_enumData##e, \ + &wxTO_STRING( SetName ), &wxFROM_STRING( SetName ), \ + &ToLong##SetName, &FromLong##SetName, typeid(SetName).name() ); + +template +void wxFlagsFromString(const wxString &s, e &data ) +{ + wxEnumData* edata = wxGetEnumData((e*) 0); + data.m_data = 0; + + wxArrayString array; + wxSetStringToArray( s, array ); + wxString flag; + for ( size_t i = 0; i < array.Count(); ++i ) + { + flag = array[i]; + int ivalue; + if ( edata->HasEnumMemberValue( flag, &ivalue ) ) + { + data.m_data |= ivalue; + } + } +} + +template +void wxFlagsToString( wxString &s, const e& data ) +{ + wxEnumData* edata = wxGetEnumData((e*) 0); + int count = edata->GetEnumCount(); + int i; + s.Clear(); + long dataValue = data.m_data; + for ( i = 0; i < count; i++ ) + { + int value = edata->GetEnumMemberValueByIndex(i); + // make this to allow for multi-bit constants to work + if ( value && ( dataValue & value ) == value ) + { + // clear the flags we just set + dataValue &= ~value; + // this could also be done by the templated calls + if ( !s.empty() ) + s +=wxT("|"); + s += edata->GetEnumMemberNameByIndex(i); + } + } +} + +#define wxBEGIN_FLAGS( e ) \ + wxEnumMemberData s_enumDataMembers##e[] = { + +#define wxFLAGS_MEMBER( v ) { wxT(#v), v }, + +#define wxEND_FLAGS( e ) \ + { NULL, 0 } }; \ + wxEnumData s_enumData##e( s_enumDataMembers##e ); \ + wxEnumData *wxGetEnumData(e*) { return &s_enumData##e; } \ + template<> void wxStringReadValue(const wxString &s, e &data ) \ + { wxFlagsFromString( s, data ); } \ + template<> void wxStringWriteValue( wxString &s, const e& data ) \ + { wxFlagsToString( s, data ); } \ + void FromLong##e( long data, wxVariantBase& result ) \ + { result = wxVariantBase(e(data)); } \ + void ToLong##e( const wxVariantBase& data, long &result ) \ + { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get, e).m_data; } \ + wxTO_STRING_IMP( e ) \ + wxFROM_STRING_IMP( e ) \ + wxEnumTypeInfo s_typeInfo##e(wxT_SET, &s_enumData##e, \ + &wxTO_STRING( e ), &wxFROM_STRING( e ), &ToLong##e, \ + &FromLong##e, typeid(e).name() ); + +// ---------------------------------------------------------------------------- +// Type Information +// ---------------------------------------------------------------------------- + +// All data exposed by the RTTI is characterized using the following classes. +// The first characterization is done by wxTypeKind. All enums up to and including +// wxT_CUSTOM represent so called simple types. These cannot be divided any further. +// They can be converted to and from wxStrings, that's all. +// Other wxTypeKinds can instead be splitted recursively into smaller parts until +// the simple types are reached. + +enum wxTypeKind +{ + wxT_VOID = 0, // unknown type + wxT_BOOL, + wxT_CHAR, + wxT_UCHAR, + wxT_INT, + wxT_UINT, + wxT_LONG, + wxT_ULONG, + wxT_FLOAT, + wxT_DOUBLE, + wxT_STRING, // must be wxString + wxT_SET, // must be wxBitset<> template + wxT_ENUM, + wxT_CUSTOM, // user defined type (e.g. wxPoint) + + wxT_LAST_SIMPLE_TYPE_KIND = wxT_CUSTOM, + + wxT_OBJECT_PTR, // object reference + wxT_OBJECT, // embedded object + wxT_COLLECTION, // collection + + wxT_DELEGATE, // for connecting against an event source + + wxT_LAST_TYPE_KIND = wxT_DELEGATE // sentinel for bad data, asserts, debugging +}; + +class WXDLLIMPEXP_BASE wxVariantBase; +class WXDLLIMPEXP_BASE wxTypeInfo; + +WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxTypeInfo*, wxTypeInfoMap, class WXDLLIMPEXP_BASE ); + +class WXDLLIMPEXP_BASE wxTypeInfo +{ +public: + typedef void (*wxVariant2StringFnc)( const wxVariantBase& data, wxString &result ); + typedef void (*wxString2VariantFnc)( const wxString& data, wxVariantBase &result ); + + wxTypeInfo(wxTypeKind kind, + wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL, + const wxString &name = wxEmptyString): + m_toString(to), m_fromString(from), m_kind(kind), m_name(name) + { + Register(); + } +#if wxUSE_UNICODE + wxTypeInfo(wxTypeKind kind, + wxVariant2StringFnc to, wxString2VariantFnc from, + const char *name): + m_toString(to), m_fromString(from), m_kind(kind), + m_name(wxString::FromAscii(name)) + { + Register(); + } +#endif + + virtual ~wxTypeInfo() + { + Unregister(); + } + + // return the kind of this type (wxT_... constants) + wxTypeKind GetKind() const { return m_kind; } + + // returns the unique name of this type + const wxString& GetTypeName() const { return m_name; } + + // is this type a delegate type + bool IsDelegateType() const { return m_kind == wxT_DELEGATE; } + + // is this type a custom type + bool IsCustomType() const { return m_kind == wxT_CUSTOM; } + + // is this type an object type + bool IsObjectType() const { return m_kind == wxT_OBJECT || m_kind == wxT_OBJECT_PTR; } + + // can the content of this type be converted to and from strings ? + bool HasStringConverters() const { return m_toString != NULL && m_fromString != NULL; } + + // convert a wxVariantBase holding data of this type into a string + void ConvertToString( const wxVariantBase& data, wxString &result ) const + { + if ( m_toString ) + (*m_toString)( data, result ); + else + wxLogError( wxGetTranslation(_T("String conversions not supported")) ); + } + + // convert a string into a wxVariantBase holding the corresponding data in this type + void ConvertFromString( const wxString& data, wxVariantBase &result ) const + { + if( m_fromString ) + (*m_fromString)( data, result ); + else + wxLogError( wxGetTranslation(_T("String conversions not supported")) ); + } + + // statics: + +#if wxUSE_UNICODE + static wxTypeInfo *FindType(const char *typeName) + { return FindType( wxString::FromAscii(typeName) ); } +#endif + static wxTypeInfo *FindType(const wxChar *typeName); + static wxTypeInfo *FindType(const wxString& typeName) + { +#if wxUSE_UNICODE + return FindType( typeName.wchar_str() ); +#else + return FindType( typeName.char_str() ); +#endif + } + +private: + void Register(); + void Unregister(); + + wxVariant2StringFnc m_toString; + wxString2VariantFnc m_fromString; + + wxTypeKind m_kind; + wxString m_name; + + // the static list of all types we know about + static wxTypeInfoMap* ms_typeTable; +}; + +class WXDLLIMPEXP_BASE wxBuiltInTypeInfo : public wxTypeInfo +{ +public: + wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to = NULL, + wxString2VariantFnc from = NULL, + const wxString &name = wxEmptyString ) : + wxTypeInfo( kind, to, from, name ) + { wxASSERT_MSG( GetKind() < wxT_SET, wxT("Illegal Kind for Base Type") ); } + +#if wxUSE_UNICODE + wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to, + wxString2VariantFnc from , const char *name ) : + wxTypeInfo( kind, to, from, name ) + { wxASSERT_MSG( GetKind() < wxT_SET, wxT("Illegal Kind for Base Type") ); } +#endif +}; + +class WXDLLIMPEXP_BASE wxCustomTypeInfo : public wxTypeInfo +{ +public: + wxCustomTypeInfo( const wxString &name, wxVariant2StringFnc to, + wxString2VariantFnc from ) : + wxTypeInfo( wxT_CUSTOM, to, from, name ) + {} + +#if wxUSE_UNICODE + wxCustomTypeInfo( const char *name , wxVariant2StringFnc to, + wxString2VariantFnc from ) : + wxTypeInfo( wxT_CUSTOM, to, from, name ) + {} +#endif +}; + +class WXDLLIMPEXP_BASE wxEnumTypeInfo : public wxTypeInfo +{ +public: + typedef void (*converterToLong_t)( const wxVariantBase& data, long &result ); + typedef void (*converterFromLong_t)( long data, wxVariantBase &result ); + + wxEnumTypeInfo( wxTypeKind kind, wxEnumData* enumInfo, wxVariant2StringFnc to, + wxString2VariantFnc from, converterToLong_t toLong, + converterFromLong_t fromLong, const wxString &name ) : + wxTypeInfo( kind, to, from, name ), m_toLong( toLong ), m_fromLong( fromLong ) + { + wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET, + wxT("Illegal Kind for Enum Type")); + m_enumInfo = enumInfo; + } + +#if wxUSE_UNICODE + wxEnumTypeInfo( wxTypeKind kind, wxEnumData* enumInfo, wxVariant2StringFnc to, + wxString2VariantFnc from, converterToLong_t toLong, + converterFromLong_t fromLong, const char * name ) : + wxTypeInfo( kind, to, from, name ), m_toLong( toLong ), m_fromLong( fromLong ) + { + wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET, + wxT("Illegal Kind for Enum Type")); + m_enumInfo = enumInfo; + } +#endif + const wxEnumData* GetEnumData() const { return m_enumInfo; } + + // convert a wxVariantBase holding data of this type into a long + void ConvertToLong( const wxVariantBase& data, long &result ) const + { + if( m_toLong ) + (*m_toLong)( data, result ); + else + wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ); + } + + // convert a long into a wxVariantBase holding the corresponding data in this type + void ConvertFromLong( long data, wxVariantBase &result ) const + { + if( m_fromLong ) + (*m_fromLong)( data, result ); + else + wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ); + } + +private: + converterToLong_t m_toLong; + converterFromLong_t m_fromLong; + + wxEnumData *m_enumInfo; // Kind == wxT_ENUM or Kind == wxT_SET +}; + +class WXDLLIMPEXP_BASE wxClassTypeInfo : public wxTypeInfo +{ +public: + wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo, + wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL, + const wxString &name = wxEmptyString); + +#if wxUSE_UNICODE + wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo, wxVariant2StringFnc to, + wxString2VariantFnc from , const char *name ); +#endif + + const wxClassInfo *GetClassInfo() const { return m_classInfo; } + +private: + wxClassInfo *m_classInfo; // Kind == wxT_OBJECT - could be NULL +}; + +class WXDLLIMPEXP_BASE wxCollectionTypeInfo : public wxTypeInfo +{ +public: + wxCollectionTypeInfo( const wxString &elementName, wxVariant2StringFnc to, + wxString2VariantFnc from , const wxString &name) : + wxTypeInfo( wxT_COLLECTION, to, from, name ) + { m_elementTypeName = elementName; m_elementType = NULL; } + +#if wxUSE_UNICODE + wxCollectionTypeInfo( const char *elementName, wxVariant2StringFnc to, + wxString2VariantFnc from , const char *name ) : + wxTypeInfo( wxT_COLLECTION, to, from, name ) + { m_elementTypeName = wxString::FromAscii( elementName ); m_elementType = NULL; } +#endif + + const wxTypeInfo* GetElementType() const + { + if ( m_elementType == NULL ) + m_elementType = wxTypeInfo::FindType( m_elementTypeName ); + return m_elementType; + } + +private: + mutable wxTypeInfo * m_elementType; + wxString m_elementTypeName; +}; + +class WXDLLIMPEXP_BASE wxEventSourceTypeInfo : public wxTypeInfo +{ +public: + wxEventSourceTypeInfo( int eventType, wxClassInfo* eventClass, + wxVariant2StringFnc to = NULL, + wxString2VariantFnc from = NULL ); + wxEventSourceTypeInfo( int eventType, int lastEventType, wxClassInfo* eventClass, + wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL ); + + int GetEventType() const { return m_eventType; } + int GetLastEventType() const { return m_lastEventType; } + const wxClassInfo* GetEventClass() const { return m_eventClass; } + +private: + const wxClassInfo *m_eventClass; // (extended will merge into classinfo) + int m_eventType; + int m_lastEventType; +}; + +template const wxTypeInfo* wxGetTypeInfo( T * ) \ + { return wxTypeInfo::FindType(typeid(T).name()); } + +// this macro is for usage with custom, non-object derived classes and structs, +// wxPoint is such a custom type + +#if wxUSE_FUNC_TEMPLATE_POINTER + #define wxCUSTOM_TYPE_INFO( e, toString, fromString ) \ + wxCustomTypeInfo s_typeInfo##e(typeid(e).name(), &toString, &fromString); +#else + #define wxCUSTOM_TYPE_INFO( e, toString, fromString ) \ + void ToString##e( const wxVariantBase& data, wxString &result ) \ + { toString(data, result); } \ + void FromString##e( const wxString& data, wxVariantBase &result ) \ + { fromString(data, result); } \ + wxCustomTypeInfo s_typeInfo##e(typeid(e).name(), \ + &ToString##e, &FromString##e); +#endif + +#define wxCOLLECTION_TYPE_INFO( element, collection ) \ + wxCollectionTypeInfo s_typeInfo##collection( typeid(element).name(), \ + NULL, NULL, typeid(collection).name() ); + +// sometimes a compiler invents specializations that are nowhere called, +// use this macro to satisfy the refs, currently we don't have to play +// tricks, but if we will have to according to the compiler, we will use +// that macro for that + +#define wxILLEGAL_TYPE_SPECIALIZATION( a ) + +#endif // wxUSE_EXTENDED_RTTI +#endif // _XTITYPES_H_ diff --git a/samples/xti/classlist.cpp b/samples/xti/classlist.cpp index 2c84834a89..32dd4d908e 100644 --- a/samples/xti/classlist.cpp +++ b/samples/xti/classlist.cpp @@ -4,7 +4,7 @@ // Author: Francesco Montorsi // Modified by: // Created: 03/06/2007 14:49:55 -// RCS-ID: $Id: classlist.cpp 48186 2007-08-19 19:59:54Z FM $ +// RCS-ID: $Id$ // Copyright: (c) 2007 Francesco Montorsi // Licence: wxWidgets license ///////////////////////////////////////////////////////////////////////////// diff --git a/samples/xti/classlist.h b/samples/xti/classlist.h index dcb416f958..b8187c9868 100644 --- a/samples/xti/classlist.h +++ b/samples/xti/classlist.h @@ -4,7 +4,7 @@ // Author: Francesco Montorsi // Modified by: // Created: 03/06/2007 14:49:55 -// RCS-ID: $Id: classlist.h 47845 2007-08-01 12:53:50Z FM $ +// RCS-ID: $Id$ // Copyright: (c) 2007 Francesco Montorsi // Licence: wxWidgets license //////////////////////////////////////////////////// diff --git a/samples/xti/codereadercallback.cpp b/samples/xti/codereadercallback.cpp index 0ba0bd23b3..131a19d3e4 100644 --- a/samples/xti/codereadercallback.cpp +++ b/samples/xti/codereadercallback.cpp @@ -1,276 +1,276 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/xtistrm.cpp -// Purpose: streaming runtime metadata information -// Author: Stefan Csomor -// Modified by: -// Created: 27/07/03 -// RCS-ID: $Id: xtistrm.cpp 47828 2007-07-31 19:26:56Z FM $ -// Copyright: (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/xtistrm.h" - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/hash.h" - #include "wx/event.h" -#endif - -#include -#include -#include -using namespace std; - -#include "wx/tokenzr.h" -#include "wx/txtstrm.h" -#include "codereadercallback.h" - -#if !wxUSE_EXTENDED_RTTI - #error This sample requires XTI (eXtended RTTI) enabled -#endif - -// ---------------------------------------------------------------------------- -// wxObjectCodeReaderCallback - depersisting to code -// ---------------------------------------------------------------------------- - -struct wxObjectCodeReaderCallback::wxObjectCodeReaderCallbackInternal -{ -#if wxUSE_UNICODE - map m_objectNames; -#else - map m_objectNames; -#endif - - void SetObjectName(int objectID, const wxString &name ) - { - if ( m_objectNames.find(objectID) != m_objectNames.end() ) - { - wxLogError( _("Passing a already registered object to SetObjectName") ); - return ; - } - m_objectNames[objectID] = (const wxChar *)name; - } - - wxString GetObjectName( int objectID ) - { - if ( objectID == wxNullObjectID ) - return wxT("NULL"); - - if ( m_objectNames.find(objectID) == m_objectNames.end() ) - { - wxLogError( _("Passing an unkown object to GetObject") ); - return wxEmptyString; - } - return wxString( m_objectNames[objectID].c_str() ); - } -}; - -wxObjectCodeReaderCallback::wxObjectCodeReaderCallback(wxTextOutputStream *out) -: m_fp(out) -{ - m_data = new wxObjectCodeReaderCallbackInternal; -} - -wxObjectCodeReaderCallback::~wxObjectCodeReaderCallback() -{ - delete m_data; -} - -void wxObjectCodeReaderCallback::AllocateObject(int objectID, wxClassInfo *classInfo, - wxVariantBaseArray &WXUNUSED(metadata)) -{ - wxString objectName = wxString::Format( wxT("LocalObject_%d"), objectID ); - m_fp->WriteString( wxString::Format( wxT("\t%s *%s = new %s;\n"), - classInfo->GetClassName(), - objectName.c_str(), - classInfo->GetClassName()) ); - m_data->SetObjectName( objectID, objectName ); -} - -void wxObjectCodeReaderCallback::DestroyObject(int objectID, wxClassInfo *WXUNUSED(classInfo)) -{ - m_fp->WriteString( wxString::Format( wxT("\tdelete %s;\n"), - m_data->GetObjectName( objectID).c_str() ) ); -} - -wxString wxObjectCodeReaderCallback::ValueAsCode( const wxVariantBase ¶m ) -{ - wxString value; - const wxTypeInfo* type = param.GetTypeInfo(); - if ( type->GetKind() == wxT_CUSTOM ) - { - const wxCustomTypeInfo* cti = wx_dynamic_cast(const wxCustomTypeInfo*, type); - if ( cti ) - { - value.Printf( wxT("%s(%s)"), cti->GetTypeName().c_str(), - param.GetAsString().c_str() ); - } - else - { - wxLogError ( _("Internal error, illegal wxCustomTypeInfo") ); - } - } - else if ( type->GetKind() == wxT_STRING ) - { - value.Printf( wxT("\"%s\""),param.GetAsString().c_str() ); - } - else - { - value.Printf( wxT("%s"), param.GetAsString().c_str() ); - } - return value; -} - -void wxObjectCodeReaderCallback::CreateObject(int objectID, - const wxClassInfo *WXUNUSED(classInfo), - int paramCount, - wxVariantBase *params, - int *objectIDValues, - const wxClassInfo **WXUNUSED(objectClassInfos), - wxVariantBaseArray &WXUNUSED(metadata) - ) -{ - int i; - m_fp->WriteString( wxString::Format( wxT("\t%s->Create("), - m_data->GetObjectName(objectID).c_str() ) ); - for (i = 0; i < paramCount; i++) - { - if ( objectIDValues[i] != wxInvalidObjectID ) - { - wxString str = - wxString::Format( wxT("%s"), - m_data->GetObjectName( objectIDValues[i] ).c_str() ); - m_fp->WriteString( str ); - } - else - { - m_fp->WriteString( - wxString::Format( wxT("%s"), ValueAsCode(params[i]).c_str() ) ); - } - if (i < paramCount - 1) - m_fp->WriteString( wxT(", ")); - } - m_fp->WriteString( wxT(");\n") ); -} - -void wxObjectCodeReaderCallback::ConstructObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxVariantBase *params, - int *objectIDValues, - const wxClassInfo **WXUNUSED(objectClassInfos), - wxVariantBaseArray &WXUNUSED(metadata) - ) -{ - wxString objectName = wxString::Format( wxT("LocalObject_%d"), objectID ); - m_fp->WriteString( wxString::Format( wxT("\t%s *%s = new %s("), - classInfo->GetClassName(), - objectName.c_str(), - classInfo->GetClassName()) ); - m_data->SetObjectName( objectID, objectName ); - - int i; - for (i = 0; i < paramCount; i++) - { - if ( objectIDValues[i] != wxInvalidObjectID ) - m_fp->WriteString( wxString::Format( wxT("%s"), - m_data->GetObjectName( objectIDValues[i] ).c_str() ) ); - else - { - m_fp->WriteString( - wxString::Format( wxT("%s"), ValueAsCode(params[i]).c_str() ) ); - } - if (i < paramCount - 1) - m_fp->WriteString( wxT(", ") ); - } - m_fp->WriteString( wxT(");\n") ); -} - -void wxObjectCodeReaderCallback::SetProperty(int objectID, - const wxClassInfo *WXUNUSED(classInfo), - const wxPropertyInfo* propertyInfo, - const wxVariantBase &value) -{ - m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"), - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetSetterName().c_str(), - ValueAsCode(value).c_str()) ); -} - -void wxObjectCodeReaderCallback::SetPropertyAsObject(int objectID, - const wxClassInfo *WXUNUSED(classInfo), - const wxPropertyInfo* propertyInfo, - int valueObjectId) -{ - if ( propertyInfo->GetTypeInfo()->GetKind() == wxT_OBJECT ) - m_fp->WriteString( wxString::Format( wxT("\t%s->%s(*%s);\n"), - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetSetterName().c_str(), - m_data->GetObjectName( valueObjectId).c_str() ) ); - else - m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"), - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetSetterName().c_str(), - m_data->GetObjectName( valueObjectId).c_str() ) ); -} - -void wxObjectCodeReaderCallback::AddToPropertyCollection( int objectID, - const wxClassInfo *WXUNUSED(classInfo), - const wxPropertyInfo* propertyInfo, - const wxVariantBase &value) -{ - m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"), - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetAdderName().c_str(), - ValueAsCode(value).c_str()) ); -} - -// sets the corresponding property (value is an object) -void wxObjectCodeReaderCallback:: - AddToPropertyCollectionAsObject(int WXUNUSED(objectID), - const wxClassInfo *WXUNUSED(classInfo), - const wxPropertyInfo* WXUNUSED(propertyInfo), - int WXUNUSED(valueObjectId)) -{ - // TODO -} - -void wxObjectCodeReaderCallback::SetConnect(int eventSourceObjectID, - const wxClassInfo *WXUNUSED(eventSourceClassInfo), - const wxPropertyInfo *delegateInfo, - const wxClassInfo *eventSinkClassInfo, - const wxHandlerInfo* handlerInfo, - int eventSinkObjectID ) -{ - wxString ehsource = m_data->GetObjectName( eventSourceObjectID ); - wxString ehsink = m_data->GetObjectName(eventSinkObjectID); - wxString ehsinkClass = eventSinkClassInfo->GetClassName(); - const wxEventSourceTypeInfo *delegateTypeInfo = - wx_dynamic_cast(const wxEventSourceTypeInfo*, delegateInfo->GetTypeInfo()); - if ( delegateTypeInfo ) - { - int eventType = delegateTypeInfo->GetEventType(); - wxString handlerName = handlerInfo->GetName(); - - wxString code = - wxString::Format( - wxT("\t%s->Connect( %s->GetId(), %d, ") - wxT("(wxObjectEventFunction)(wxEventFunction) & %s::%s, NULL, %s );"), - ehsource.c_str(), ehsource.c_str(), eventType, ehsinkClass.c_str(), - handlerName.c_str(), ehsink.c_str() ); - - m_fp->WriteString( code ); - } - else - { - wxLogError(_("delegate has no type info")); - } -} +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/xtistrm.cpp +// Purpose: streaming runtime metadata information +// Author: Stefan Csomor +// Modified by: +// Created: 27/07/03 +// RCS-ID: $Id$ +// Copyright: (c) 2003 Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/xtistrm.h" + +#ifndef WX_PRECOMP + #include "wx/object.h" + #include "wx/hash.h" + #include "wx/event.h" +#endif + +#include +#include +#include +using namespace std; + +#include "wx/tokenzr.h" +#include "wx/txtstrm.h" +#include "codereadercallback.h" + +#if !wxUSE_EXTENDED_RTTI + #error This sample requires XTI (eXtended RTTI) enabled +#endif + +// ---------------------------------------------------------------------------- +// wxObjectCodeReaderCallback - depersisting to code +// ---------------------------------------------------------------------------- + +struct wxObjectCodeReaderCallback::wxObjectCodeReaderCallbackInternal +{ +#if wxUSE_UNICODE + map m_objectNames; +#else + map m_objectNames; +#endif + + void SetObjectName(int objectID, const wxString &name ) + { + if ( m_objectNames.find(objectID) != m_objectNames.end() ) + { + wxLogError( _("Passing a already registered object to SetObjectName") ); + return ; + } + m_objectNames[objectID] = (const wxChar *)name; + } + + wxString GetObjectName( int objectID ) + { + if ( objectID == wxNullObjectID ) + return wxT("NULL"); + + if ( m_objectNames.find(objectID) == m_objectNames.end() ) + { + wxLogError( _("Passing an unkown object to GetObject") ); + return wxEmptyString; + } + return wxString( m_objectNames[objectID].c_str() ); + } +}; + +wxObjectCodeReaderCallback::wxObjectCodeReaderCallback(wxTextOutputStream *out) +: m_fp(out) +{ + m_data = new wxObjectCodeReaderCallbackInternal; +} + +wxObjectCodeReaderCallback::~wxObjectCodeReaderCallback() +{ + delete m_data; +} + +void wxObjectCodeReaderCallback::AllocateObject(int objectID, wxClassInfo *classInfo, + wxVariantBaseArray &WXUNUSED(metadata)) +{ + wxString objectName = wxString::Format( wxT("LocalObject_%d"), objectID ); + m_fp->WriteString( wxString::Format( wxT("\t%s *%s = new %s;\n"), + classInfo->GetClassName(), + objectName.c_str(), + classInfo->GetClassName()) ); + m_data->SetObjectName( objectID, objectName ); +} + +void wxObjectCodeReaderCallback::DestroyObject(int objectID, wxClassInfo *WXUNUSED(classInfo)) +{ + m_fp->WriteString( wxString::Format( wxT("\tdelete %s;\n"), + m_data->GetObjectName( objectID).c_str() ) ); +} + +wxString wxObjectCodeReaderCallback::ValueAsCode( const wxVariantBase ¶m ) +{ + wxString value; + const wxTypeInfo* type = param.GetTypeInfo(); + if ( type->GetKind() == wxT_CUSTOM ) + { + const wxCustomTypeInfo* cti = wx_dynamic_cast(const wxCustomTypeInfo*, type); + if ( cti ) + { + value.Printf( wxT("%s(%s)"), cti->GetTypeName().c_str(), + param.GetAsString().c_str() ); + } + else + { + wxLogError ( _("Internal error, illegal wxCustomTypeInfo") ); + } + } + else if ( type->GetKind() == wxT_STRING ) + { + value.Printf( wxT("\"%s\""),param.GetAsString().c_str() ); + } + else + { + value.Printf( wxT("%s"), param.GetAsString().c_str() ); + } + return value; +} + +void wxObjectCodeReaderCallback::CreateObject(int objectID, + const wxClassInfo *WXUNUSED(classInfo), + int paramCount, + wxVariantBase *params, + int *objectIDValues, + const wxClassInfo **WXUNUSED(objectClassInfos), + wxVariantBaseArray &WXUNUSED(metadata) + ) +{ + int i; + m_fp->WriteString( wxString::Format( wxT("\t%s->Create("), + m_data->GetObjectName(objectID).c_str() ) ); + for (i = 0; i < paramCount; i++) + { + if ( objectIDValues[i] != wxInvalidObjectID ) + { + wxString str = + wxString::Format( wxT("%s"), + m_data->GetObjectName( objectIDValues[i] ).c_str() ); + m_fp->WriteString( str ); + } + else + { + m_fp->WriteString( + wxString::Format( wxT("%s"), ValueAsCode(params[i]).c_str() ) ); + } + if (i < paramCount - 1) + m_fp->WriteString( wxT(", ")); + } + m_fp->WriteString( wxT(");\n") ); +} + +void wxObjectCodeReaderCallback::ConstructObject(int objectID, + const wxClassInfo *classInfo, + int paramCount, + wxVariantBase *params, + int *objectIDValues, + const wxClassInfo **WXUNUSED(objectClassInfos), + wxVariantBaseArray &WXUNUSED(metadata) + ) +{ + wxString objectName = wxString::Format( wxT("LocalObject_%d"), objectID ); + m_fp->WriteString( wxString::Format( wxT("\t%s *%s = new %s("), + classInfo->GetClassName(), + objectName.c_str(), + classInfo->GetClassName()) ); + m_data->SetObjectName( objectID, objectName ); + + int i; + for (i = 0; i < paramCount; i++) + { + if ( objectIDValues[i] != wxInvalidObjectID ) + m_fp->WriteString( wxString::Format( wxT("%s"), + m_data->GetObjectName( objectIDValues[i] ).c_str() ) ); + else + { + m_fp->WriteString( + wxString::Format( wxT("%s"), ValueAsCode(params[i]).c_str() ) ); + } + if (i < paramCount - 1) + m_fp->WriteString( wxT(", ") ); + } + m_fp->WriteString( wxT(");\n") ); +} + +void wxObjectCodeReaderCallback::SetProperty(int objectID, + const wxClassInfo *WXUNUSED(classInfo), + const wxPropertyInfo* propertyInfo, + const wxVariantBase &value) +{ + m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"), + m_data->GetObjectName(objectID).c_str(), + propertyInfo->GetAccessor()->GetSetterName().c_str(), + ValueAsCode(value).c_str()) ); +} + +void wxObjectCodeReaderCallback::SetPropertyAsObject(int objectID, + const wxClassInfo *WXUNUSED(classInfo), + const wxPropertyInfo* propertyInfo, + int valueObjectId) +{ + if ( propertyInfo->GetTypeInfo()->GetKind() == wxT_OBJECT ) + m_fp->WriteString( wxString::Format( wxT("\t%s->%s(*%s);\n"), + m_data->GetObjectName(objectID).c_str(), + propertyInfo->GetAccessor()->GetSetterName().c_str(), + m_data->GetObjectName( valueObjectId).c_str() ) ); + else + m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"), + m_data->GetObjectName(objectID).c_str(), + propertyInfo->GetAccessor()->GetSetterName().c_str(), + m_data->GetObjectName( valueObjectId).c_str() ) ); +} + +void wxObjectCodeReaderCallback::AddToPropertyCollection( int objectID, + const wxClassInfo *WXUNUSED(classInfo), + const wxPropertyInfo* propertyInfo, + const wxVariantBase &value) +{ + m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"), + m_data->GetObjectName(objectID).c_str(), + propertyInfo->GetAccessor()->GetAdderName().c_str(), + ValueAsCode(value).c_str()) ); +} + +// sets the corresponding property (value is an object) +void wxObjectCodeReaderCallback:: + AddToPropertyCollectionAsObject(int WXUNUSED(objectID), + const wxClassInfo *WXUNUSED(classInfo), + const wxPropertyInfo* WXUNUSED(propertyInfo), + int WXUNUSED(valueObjectId)) +{ + // TODO +} + +void wxObjectCodeReaderCallback::SetConnect(int eventSourceObjectID, + const wxClassInfo *WXUNUSED(eventSourceClassInfo), + const wxPropertyInfo *delegateInfo, + const wxClassInfo *eventSinkClassInfo, + const wxHandlerInfo* handlerInfo, + int eventSinkObjectID ) +{ + wxString ehsource = m_data->GetObjectName( eventSourceObjectID ); + wxString ehsink = m_data->GetObjectName(eventSinkObjectID); + wxString ehsinkClass = eventSinkClassInfo->GetClassName(); + const wxEventSourceTypeInfo *delegateTypeInfo = + wx_dynamic_cast(const wxEventSourceTypeInfo*, delegateInfo->GetTypeInfo()); + if ( delegateTypeInfo ) + { + int eventType = delegateTypeInfo->GetEventType(); + wxString handlerName = handlerInfo->GetName(); + + wxString code = + wxString::Format( + wxT("\t%s->Connect( %s->GetId(), %d, ") + wxT("(wxObjectEventFunction)(wxEventFunction) & %s::%s, NULL, %s );"), + ehsource.c_str(), ehsource.c_str(), eventType, ehsinkClass.c_str(), + handlerName.c_str(), ehsink.c_str() ); + + m_fp->WriteString( code ); + } + else + { + wxLogError(_("delegate has no type info")); + } +} diff --git a/samples/xti/codereadercallback.h b/samples/xti/codereadercallback.h index b0b8df975d..b5875725e2 100644 --- a/samples/xti/codereadercallback.h +++ b/samples/xti/codereadercallback.h @@ -1,104 +1,104 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xtistrm.h -// Purpose: streaming runtime metadata information (extended class info) -// Author: Stefan Csomor -// Modified by: -// Created: 27/07/03 -// RCS-ID: $Id: xtistrm.h 47827 2007-07-31 19:25:09Z FM $ -// Copyright: (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _CODEDEPERSISTER_ -#define _CODEDEPERSISTER_ - -#include "wx/defs.h" - -/* -wxObjectCodeReaderCallback implements the callbacks that will depersist -an object into a C++ initialization function. -*/ - -class WXDLLIMPEXP_BASE wxTextOutputStream; - -class WXDLLIMPEXP_BASE wxObjectCodeReaderCallback: public wxObjectWriterCallback -{ -private: - struct wxObjectCodeReaderCallbackInternal; - wxObjectCodeReaderCallbackInternal * m_data; - wxTextOutputStream *m_fp; - wxString ValueAsCode( const wxVariantBase ¶m ); - -public: - wxObjectCodeReaderCallback(wxTextOutputStream *out); - virtual ~wxObjectCodeReaderCallback(); - - // allocate the new object on the heap, that object will have the passed in ID - virtual void AllocateObject(int objectID, wxClassInfo *classInfo, - wxVariantBaseArray &metadata); - - // initialize the already allocated object having the ID objectID - // with the Create method creation parameters which are objects are - // having their Ids passed in objectIDValues having objectId <> wxInvalidObjectID - - virtual void CreateObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxVariantBase *variantValues, - int *objectIDValues, - const wxClassInfo **objectClassInfos, - wxVariantBaseArray &metadata - ); - - // construct the new object on the heap, that object will have the - // passed in ID (for objects that don't support allocate-create type - // of creation) creation parameters which are objects are having their - // Ids passed in objectIDValues having objectId <> wxInvalidObjectID - - virtual void ConstructObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxVariantBase *VariantValues, - int *objectIDValues, - const wxClassInfo **objectClassInfos, - wxVariantBaseArray &metadata); - - // destroy the heap-allocated object having the ID objectID, this may - // be used if an object is embedded in another object and set via value - // semantics, so the intermediate object can be destroyed after safely - virtual void DestroyObject(int objectID, wxClassInfo *classInfo); - - // set the corresponding property - virtual void SetProperty(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo, - const wxVariantBase &variantValue); - - // sets the corresponding property (value is an object) - virtual void SetPropertyAsObject(int objectId, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo, - int valueObjectId); - - // adds an element to a property collection - virtual void AddToPropertyCollection( int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo, - const wxVariantBase &VariantValue); - - // sets the corresponding property (value is an object) - virtual void AddToPropertyCollectionAsObject(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo, - int valueObjectId); - - // sets the corresponding event handler - virtual void SetConnect(int eventSourceObjectID, - const wxClassInfo *eventSourceClassInfo, - const wxPropertyInfo *delegateInfo, - const wxClassInfo *eventSinkClassInfo, - const wxHandlerInfo* handlerInfo, - int eventSinkObjectID ); -}; - -#endif +///////////////////////////////////////////////////////////////////////////// +// Name: wx/xtistrm.h +// Purpose: streaming runtime metadata information (extended class info) +// Author: Stefan Csomor +// Modified by: +// Created: 27/07/03 +// RCS-ID: $Id$ +// Copyright: (c) 2003 Stefan Csomor +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _CODEDEPERSISTER_ +#define _CODEDEPERSISTER_ + +#include "wx/defs.h" + +/* +wxObjectCodeReaderCallback implements the callbacks that will depersist +an object into a C++ initialization function. +*/ + +class WXDLLIMPEXP_BASE wxTextOutputStream; + +class WXDLLIMPEXP_BASE wxObjectCodeReaderCallback: public wxObjectWriterCallback +{ +private: + struct wxObjectCodeReaderCallbackInternal; + wxObjectCodeReaderCallbackInternal * m_data; + wxTextOutputStream *m_fp; + wxString ValueAsCode( const wxVariantBase ¶m ); + +public: + wxObjectCodeReaderCallback(wxTextOutputStream *out); + virtual ~wxObjectCodeReaderCallback(); + + // allocate the new object on the heap, that object will have the passed in ID + virtual void AllocateObject(int objectID, wxClassInfo *classInfo, + wxVariantBaseArray &metadata); + + // initialize the already allocated object having the ID objectID + // with the Create method creation parameters which are objects are + // having their Ids passed in objectIDValues having objectId <> wxInvalidObjectID + + virtual void CreateObject(int objectID, + const wxClassInfo *classInfo, + int paramCount, + wxVariantBase *variantValues, + int *objectIDValues, + const wxClassInfo **objectClassInfos, + wxVariantBaseArray &metadata + ); + + // construct the new object on the heap, that object will have the + // passed in ID (for objects that don't support allocate-create type + // of creation) creation parameters which are objects are having their + // Ids passed in objectIDValues having objectId <> wxInvalidObjectID + + virtual void ConstructObject(int objectID, + const wxClassInfo *classInfo, + int paramCount, + wxVariantBase *VariantValues, + int *objectIDValues, + const wxClassInfo **objectClassInfos, + wxVariantBaseArray &metadata); + + // destroy the heap-allocated object having the ID objectID, this may + // be used if an object is embedded in another object and set via value + // semantics, so the intermediate object can be destroyed after safely + virtual void DestroyObject(int objectID, wxClassInfo *classInfo); + + // set the corresponding property + virtual void SetProperty(int objectID, + const wxClassInfo *classInfo, + const wxPropertyInfo* propertyInfo, + const wxVariantBase &variantValue); + + // sets the corresponding property (value is an object) + virtual void SetPropertyAsObject(int objectId, + const wxClassInfo *classInfo, + const wxPropertyInfo* propertyInfo, + int valueObjectId); + + // adds an element to a property collection + virtual void AddToPropertyCollection( int objectID, + const wxClassInfo *classInfo, + const wxPropertyInfo* propertyInfo, + const wxVariantBase &VariantValue); + + // sets the corresponding property (value is an object) + virtual void AddToPropertyCollectionAsObject(int objectID, + const wxClassInfo *classInfo, + const wxPropertyInfo* propertyInfo, + int valueObjectId); + + // sets the corresponding event handler + virtual void SetConnect(int eventSourceObjectID, + const wxClassInfo *eventSourceClassInfo, + const wxPropertyInfo *delegateInfo, + const wxClassInfo *eventSinkClassInfo, + const wxHandlerInfo* handlerInfo, + int eventSinkObjectID ); +}; + +#endif diff --git a/samples/xti/xti.bkl b/samples/xti/xti.bkl index dd37d900fb..7212594fa2 100644 --- a/samples/xti/xti.bkl +++ b/samples/xti/xti.bkl @@ -1,5 +1,5 @@ - + diff --git a/samples/xti/xti.cpp b/samples/xti/xti.cpp index 2d56115d5d..a6cee4f4d3 100644 --- a/samples/xti/xti.cpp +++ b/samples/xti/xti.cpp @@ -4,7 +4,7 @@ // Author: Stefan Csomor, Francesco Montorsi // Modified by: // Created: 13/5/2007 -// RCS-ID: $Id: xti.cpp 48407 2007-08-26 23:17:23Z FM $ +// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor, Francesco Montorsi // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// diff --git a/src/common/bmpbtncmn.cpp b/src/common/bmpbtncmn.cpp index 821f2315e2..2a615da5ff 100644 --- a/src/common/bmpbtncmn.cpp +++ b/src/common/bmpbtncmn.cpp @@ -1,93 +1,93 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/bmpbtncmn.cpp -// Purpose: wxBitmapButton common code -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: bmpbuttn.cpp 45338 2007-04-08 22:18:35Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_BMPBUTTON - -#include "wx/bmpbuttn.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/dcmemory.h" - #include "wx/image.h" -#endif - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxBitmapButtonStyle ) -wxBEGIN_FLAGS( wxBitmapButtonStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxBU_AUTODRAW) - wxFLAGS_MEMBER(wxBU_LEFT) - wxFLAGS_MEMBER(wxBU_RIGHT) - wxFLAGS_MEMBER(wxBU_TOP) - wxFLAGS_MEMBER(wxBU_BOTTOM) -wxEND_FLAGS( wxBitmapButtonStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxBitmapButton, wxButton, "wx/bmpbuttn.h") - -wxBEGIN_PROPERTIES_TABLE(wxBitmapButton) - wxPROPERTY_FLAGS( WindowStyle, wxBitmapButtonStyle, long, \ - SetWindowStyleFlag, GetWindowStyleFlag, \ - wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), \ - wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxBitmapButton) - -wxCONSTRUCTOR_5( wxBitmapButton, wxWindow*, Parent, wxWindowID, Id, \ - wxBitmap, Bitmap, wxPoint, Position, wxSize, Size ) - -/* -TODO PROPERTIES : - -long "style" , wxBU_AUTODRAW -bool "default" , 0 -bitmap "selected" , -bitmap "focus" , -bitmap "disabled" , -*/ - -#endif // wxUSE_BMPBUTTON +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/bmpbtncmn.cpp +// Purpose: wxBitmapButton common code +// Author: Julian Smart +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_BMPBUTTON + +#include "wx/bmpbuttn.h" + +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/dcmemory.h" + #include "wx/image.h" +#endif + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxBitmapButtonStyle ) +wxBEGIN_FLAGS( wxBitmapButtonStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) + + wxFLAGS_MEMBER(wxBU_AUTODRAW) + wxFLAGS_MEMBER(wxBU_LEFT) + wxFLAGS_MEMBER(wxBU_RIGHT) + wxFLAGS_MEMBER(wxBU_TOP) + wxFLAGS_MEMBER(wxBU_BOTTOM) +wxEND_FLAGS( wxBitmapButtonStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxBitmapButton, wxButton, "wx/bmpbuttn.h") + +wxBEGIN_PROPERTIES_TABLE(wxBitmapButton) + wxPROPERTY_FLAGS( WindowStyle, wxBitmapButtonStyle, long, \ + SetWindowStyleFlag, GetWindowStyleFlag, \ + wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), \ + wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxBitmapButton) + +wxCONSTRUCTOR_5( wxBitmapButton, wxWindow*, Parent, wxWindowID, Id, \ + wxBitmap, Bitmap, wxPoint, Position, wxSize, Size ) + +/* +TODO PROPERTIES : + +long "style" , wxBU_AUTODRAW +bool "default" , 0 +bitmap "selected" , +bitmap "focus" , +bitmap "disabled" , +*/ + +#endif // wxUSE_BMPBUTTON diff --git a/src/common/checkboxcmn.cpp b/src/common/checkboxcmn.cpp index 867239b1bc..ba419d86ae 100644 --- a/src/common/checkboxcmn.cpp +++ b/src/common/checkboxcmn.cpp @@ -1,89 +1,89 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/checkboxcmn.cpp -// Purpose: wxCheckBox common code -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: checkbox.cpp 45492 2007-04-16 00:53:05Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHECKBOX - -#include "wx/checkbox.h" - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxCheckBoxStyle ) -wxBEGIN_FLAGS( wxCheckBoxStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxNO_BORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - -wxEND_FLAGS( wxCheckBoxStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckBox, wxControl, "wx/checkbox.h") - -wxBEGIN_PROPERTIES_TABLE(wxCheckBox) - wxEVENT_PROPERTY( Click, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEvent ) - - wxPROPERTY( Font, wxFont, SetFont, GetFont, wxEMPTY_PARAMETER_VALUE, \ - 0 /*flags*/, wxT("Helpstring"), wxT("group")) - wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString(), \ - 0 /*flags*/, wxT("Helpstring"), wxT("group")) - wxPROPERTY( Value,bool, SetValue, GetValue, wxEMPTY_PARAMETER_VALUE, \ - 0 /*flags*/, wxT("Helpstring"), wxT("group")) - - wxPROPERTY_FLAGS( WindowStyle, wxCheckBoxStyle, long, SetWindowStyleFlag, \ - GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxCheckBox) - -wxCONSTRUCTOR_6( wxCheckBox, wxWindow*, Parent, wxWindowID, Id, \ - wxString, Label, wxPoint, Position, wxSize, Size, long, WindowStyle ) - - -#endif // wxUSE_CHECKBOX +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/checkboxcmn.cpp +// Purpose: wxCheckBox common code +// Author: Julian Smart +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_CHECKBOX + +#include "wx/checkbox.h" + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxCheckBoxStyle ) +wxBEGIN_FLAGS( wxCheckBoxStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxNO_BORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) + +wxEND_FLAGS( wxCheckBoxStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckBox, wxControl, "wx/checkbox.h") + +wxBEGIN_PROPERTIES_TABLE(wxCheckBox) + wxEVENT_PROPERTY( Click, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEvent ) + + wxPROPERTY( Font, wxFont, SetFont, GetFont, wxEMPTY_PARAMETER_VALUE, \ + 0 /*flags*/, wxT("Helpstring"), wxT("group")) + wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString(), \ + 0 /*flags*/, wxT("Helpstring"), wxT("group")) + wxPROPERTY( Value,bool, SetValue, GetValue, wxEMPTY_PARAMETER_VALUE, \ + 0 /*flags*/, wxT("Helpstring"), wxT("group")) + + wxPROPERTY_FLAGS( WindowStyle, wxCheckBoxStyle, long, SetWindowStyleFlag, \ + GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxCheckBox) + +wxCONSTRUCTOR_6( wxCheckBox, wxWindow*, Parent, wxWindowID, Id, \ + wxString, Label, wxPoint, Position, wxSize, Size, long, WindowStyle ) + + +#endif // wxUSE_CHECKBOX diff --git a/src/common/checklstcmn.cpp b/src/common/checklstcmn.cpp index 64012b99e4..6721038c15 100644 --- a/src/common/checklstcmn.cpp +++ b/src/common/checklstcmn.cpp @@ -1,102 +1,102 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/checklstcmn.cpp -// Purpose: wxCheckListBox common code -// Author: Vadim Zeitlin -// Modified by: -// Created: 16.11.97 -// RCS-ID: $Id: checklst.cpp 45515 2007-04-17 01:19:43Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHECKLISTBOX - -#include "wx/checklst.h" - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/colour.h" - #include "wx/font.h" - #include "wx/bitmap.h" - #include "wx/window.h" - #include "wx/listbox.h" - #include "wx/dcmemory.h" - #include "wx/settings.h" - #include "wx/log.h" -#endif - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxCheckListBoxStyle ) -wxBEGIN_FLAGS( wxCheckListBoxStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxLB_SINGLE) - wxFLAGS_MEMBER(wxLB_MULTIPLE) - wxFLAGS_MEMBER(wxLB_EXTENDED) - wxFLAGS_MEMBER(wxLB_HSCROLL) - wxFLAGS_MEMBER(wxLB_ALWAYS_SB) - wxFLAGS_MEMBER(wxLB_NEEDED_SB) - wxFLAGS_MEMBER(wxLB_SORT) - wxFLAGS_MEMBER(wxLB_OWNERDRAW) - -wxEND_FLAGS( wxCheckListBoxStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckListBox, wxListBox, "wx/checklst.h") - -wxBEGIN_PROPERTIES_TABLE(wxCheckListBox) - wxEVENT_PROPERTY( Toggle, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEvent ) - wxPROPERTY_FLAGS( WindowStyle, wxCheckListBoxStyle, long, SetWindowStyleFlag, \ - GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, wxLB_OWNERDRAW /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxCheckListBox) - -wxCONSTRUCTOR_4( wxCheckListBox, wxWindow*, Parent, wxWindowID, Id, \ - wxPoint, Position, wxSize, Size ) - - -#endif +/////////////////////////////////////////////////////////////////////////////// +// Name: src/common/checklstcmn.cpp +// Purpose: wxCheckListBox common code +// Author: Vadim Zeitlin +// Modified by: +// Created: 16.11.97 +// RCS-ID: $Id$ +// Copyright: (c) 1998 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_CHECKLISTBOX + +#include "wx/checklst.h" + +#ifndef WX_PRECOMP + #include "wx/object.h" + #include "wx/colour.h" + #include "wx/font.h" + #include "wx/bitmap.h" + #include "wx/window.h" + #include "wx/listbox.h" + #include "wx/dcmemory.h" + #include "wx/settings.h" + #include "wx/log.h" +#endif + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxCheckListBoxStyle ) +wxBEGIN_FLAGS( wxCheckListBoxStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) + + wxFLAGS_MEMBER(wxLB_SINGLE) + wxFLAGS_MEMBER(wxLB_MULTIPLE) + wxFLAGS_MEMBER(wxLB_EXTENDED) + wxFLAGS_MEMBER(wxLB_HSCROLL) + wxFLAGS_MEMBER(wxLB_ALWAYS_SB) + wxFLAGS_MEMBER(wxLB_NEEDED_SB) + wxFLAGS_MEMBER(wxLB_SORT) + wxFLAGS_MEMBER(wxLB_OWNERDRAW) + +wxEND_FLAGS( wxCheckListBoxStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckListBox, wxListBox, "wx/checklst.h") + +wxBEGIN_PROPERTIES_TABLE(wxCheckListBox) + wxEVENT_PROPERTY( Toggle, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEvent ) + wxPROPERTY_FLAGS( WindowStyle, wxCheckListBoxStyle, long, SetWindowStyleFlag, \ + GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, wxLB_OWNERDRAW /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxCheckListBox) + +wxCONSTRUCTOR_4( wxCheckListBox, wxWindow*, Parent, wxWindowID, Id, \ + wxPoint, Position, wxSize, Size ) + + +#endif diff --git a/src/common/dirctrlcmn.cpp b/src/common/dirctrlcmn.cpp index 9a1974b14a..9415453d83 100644 --- a/src/common/dirctrlcmn.cpp +++ b/src/common/dirctrlcmn.cpp @@ -1,85 +1,85 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/dirctrlcmn.cpp -// Purpose: wxGenericDirCtrl common code -// Author: Harm van der Heijden, Robert Roebling, Julian Smart -// Modified by: -// Created: 12/12/98 -// RCS-ID: $Id: dirctrlg.cpp 45395 2007-04-11 00:23:19Z VZ $ -// Copyright: (c) Harm van der Heijden, Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DIRDLG || wxUSE_FILEDLG - -#include "wx/generic/dirctrlg.h" - -//----------------------------------------------------------------------------- -// XTI -//----------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxGenericDirCtrlStyle ) -wxBEGIN_FLAGS( wxGenericDirCtrlStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxDIRCTRL_DIR_ONLY) - wxFLAGS_MEMBER(wxDIRCTRL_3D_INTERNAL) - wxFLAGS_MEMBER(wxDIRCTRL_SELECT_FIRST) - wxFLAGS_MEMBER(wxDIRCTRL_SHOW_FILTERS) -wxEND_FLAGS( wxGenericDirCtrlStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxGenericDirCtrl, wxControl, "wx/dirctrl.h") - -wxBEGIN_PROPERTIES_TABLE(wxGenericDirCtrl) - wxHIDE_PROPERTY( Children ) - - wxPROPERTY( DefaultPath, wxString, SetDefaultPath, GetDefaultPath, \ - wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), wxT("group")) - wxPROPERTY( Filter, wxString, SetFilter, GetFilter, wxEMPTY_PARAMETER_VALUE, \ - 0 /*flags*/, wxT("Helpstring"), wxT("group") ) - wxPROPERTY( DefaultFilter, int, SetFilterIndex, GetFilterIndex, \ - wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), wxT("group") ) - - wxPROPERTY_FLAGS( WindowStyle, wxGenericDirCtrlStyle, long, SetWindowStyleFlag, \ - GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0, wxT("Helpstring"), \ - wxT("group") ) -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxGenericDirCtrl) - -wxCONSTRUCTOR_8( wxGenericDirCtrl, wxWindow*, Parent, wxWindowID, Id, \ - wxString, DefaultPath, wxPoint, Position, wxSize, Size, \ - long, WindowStyle, wxString, Filter, int, DefaultFilter ) - -#endif // wxUSE_DIRDLG || wxUSE_FILEDLG +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/dirctrlcmn.cpp +// Purpose: wxGenericDirCtrl common code +// Author: Harm van der Heijden, Robert Roebling, Julian Smart +// Modified by: +// Created: 12/12/98 +// RCS-ID: $Id$ +// Copyright: (c) Harm van der Heijden, Robert Roebling and Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_DIRDLG || wxUSE_FILEDLG + +#include "wx/generic/dirctrlg.h" + +//----------------------------------------------------------------------------- +// XTI +//----------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxGenericDirCtrlStyle ) +wxBEGIN_FLAGS( wxGenericDirCtrlStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) + + wxFLAGS_MEMBER(wxDIRCTRL_DIR_ONLY) + wxFLAGS_MEMBER(wxDIRCTRL_3D_INTERNAL) + wxFLAGS_MEMBER(wxDIRCTRL_SELECT_FIRST) + wxFLAGS_MEMBER(wxDIRCTRL_SHOW_FILTERS) +wxEND_FLAGS( wxGenericDirCtrlStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxGenericDirCtrl, wxControl, "wx/dirctrl.h") + +wxBEGIN_PROPERTIES_TABLE(wxGenericDirCtrl) + wxHIDE_PROPERTY( Children ) + + wxPROPERTY( DefaultPath, wxString, SetDefaultPath, GetDefaultPath, \ + wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), wxT("group")) + wxPROPERTY( Filter, wxString, SetFilter, GetFilter, wxEMPTY_PARAMETER_VALUE, \ + 0 /*flags*/, wxT("Helpstring"), wxT("group") ) + wxPROPERTY( DefaultFilter, int, SetFilterIndex, GetFilterIndex, \ + wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), wxT("group") ) + + wxPROPERTY_FLAGS( WindowStyle, wxGenericDirCtrlStyle, long, SetWindowStyleFlag, \ + GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0, wxT("Helpstring"), \ + wxT("group") ) +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxGenericDirCtrl) + +wxCONSTRUCTOR_8( wxGenericDirCtrl, wxWindow*, Parent, wxWindowID, Id, \ + wxString, DefaultPath, wxPoint, Position, wxSize, Size, \ + long, WindowStyle, wxString, Filter, int, DefaultFilter ) + +#endif // wxUSE_DIRDLG || wxUSE_FILEDLG diff --git a/src/common/gridcmn.cpp b/src/common/gridcmn.cpp index ac75bfc171..84dfb72782 100644 --- a/src/common/gridcmn.cpp +++ b/src/common/gridcmn.cpp @@ -1,89 +1,89 @@ -/////////////////////////////////////////////////////////////////////////// -// Name: src/common/gridcmn.cpp -// Purpose: wxGrid common code -// Author: Michael Bedward (based on code by Julian Smart, Robin Dunn) -// Modified by: Robin Dunn, Vadim Zeitlin, Santiago Palacios -// Created: 1/08/1999 -// RCS-ID: $Id: grid.cpp 45814 2007-05-05 10:16:40Z RR $ -// Copyright: (c) Michael Bedward (mbedward@ozemail.com.au) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_GRID - -#include "wx/grid.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/dcclient.h" - #include "wx/settings.h" - #include "wx/log.h" - #include "wx/textctrl.h" - #include "wx/checkbox.h" - #include "wx/combobox.h" - #include "wx/valtext.h" - #include "wx/intl.h" - #include "wx/math.h" - #include "wx/listbox.h" -#endif - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxGridStyle ) -wxBEGIN_FLAGS( wxGridStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) -wxEND_FLAGS( wxGridStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxGrid, wxScrolledWindow, "wx/grid.h") - -wxBEGIN_PROPERTIES_TABLE(wxGrid) - wxHIDE_PROPERTY( Children ) - wxPROPERTY_FLAGS( WindowStyle, wxGridStyle, long, SetWindowStyleFlag, \ - GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxGrid) - -wxCONSTRUCTOR_5( wxGrid, wxWindow*, Parent, wxWindowID, Id, wxPoint, Position, \ - wxSize, Size, long, WindowStyle ) - -/* - TODO : Expose more information of a list's layout, etc. via appropriate objects (e.g., NotebookPageInfo) -*/ - -#endif // wxUSE_GRID +/////////////////////////////////////////////////////////////////////////// +// Name: src/common/gridcmn.cpp +// Purpose: wxGrid common code +// Author: Michael Bedward (based on code by Julian Smart, Robin Dunn) +// Modified by: Robin Dunn, Vadim Zeitlin, Santiago Palacios +// Created: 1/08/1999 +// RCS-ID: $Id$ +// Copyright: (c) Michael Bedward (mbedward@ozemail.com.au) +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_GRID + +#include "wx/grid.h" + +#ifndef WX_PRECOMP + #include "wx/utils.h" + #include "wx/dcclient.h" + #include "wx/settings.h" + #include "wx/log.h" + #include "wx/textctrl.h" + #include "wx/checkbox.h" + #include "wx/combobox.h" + #include "wx/valtext.h" + #include "wx/intl.h" + #include "wx/math.h" + #include "wx/listbox.h" +#endif + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxGridStyle ) +wxBEGIN_FLAGS( wxGridStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) +wxEND_FLAGS( wxGridStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxGrid, wxScrolledWindow, "wx/grid.h") + +wxBEGIN_PROPERTIES_TABLE(wxGrid) + wxHIDE_PROPERTY( Children ) + wxPROPERTY_FLAGS( WindowStyle, wxGridStyle, long, SetWindowStyleFlag, \ + GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxGrid) + +wxCONSTRUCTOR_5( wxGrid, wxWindow*, Parent, wxWindowID, Id, wxPoint, Position, \ + wxSize, Size, long, WindowStyle ) + +/* + TODO : Expose more information of a list's layout, etc. via appropriate objects (e.g., NotebookPageInfo) +*/ + +#endif // wxUSE_GRID diff --git a/src/common/odcombocmn.cpp b/src/common/odcombocmn.cpp index 1f6f5fec09..2301e7eb3e 100644 --- a/src/common/odcombocmn.cpp +++ b/src/common/odcombocmn.cpp @@ -1,55 +1,55 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/odcombocmn.cpp -// Purpose: wxOwnerDrawnComboBox common code -// Author: Jaakko Salli -// Modified by: -// Created: Apr-30-2006 -// RCS-ID: $Id: odcombo.cpp 45397 2007-04-11 10:32:01Z MBN $ -// Copyright: (c) 2005 Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ODCOMBOBOX - -#include "wx/odcombo.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/combobox.h" - #include "wx/dcclient.h" - #include "wx/settings.h" - #include "wx/dialog.h" -#endif - -#include "wx/combo.h" - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxIMPLEMENT_DYNAMIC_CLASS2_XTI(wxOwnerDrawnComboBox, wxComboCtrl, \ - wxControlWithItems, "wx/odcombo.h") - -wxBEGIN_PROPERTIES_TABLE(wxOwnerDrawnComboBox) -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxOwnerDrawnComboBox) - -wxCONSTRUCTOR_5( wxOwnerDrawnComboBox , wxWindow* , Parent , wxWindowID , \ - Id , wxString , Value , wxPoint , Position , wxSize , Size ) - -#endif // wxUSE_ODCOMBOBOX +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/odcombocmn.cpp +// Purpose: wxOwnerDrawnComboBox common code +// Author: Jaakko Salli +// Modified by: +// Created: Apr-30-2006 +// RCS-ID: $Id$ +// Copyright: (c) 2005 Jaakko Salli +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_ODCOMBOBOX + +#include "wx/odcombo.h" + +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/combobox.h" + #include "wx/dcclient.h" + #include "wx/settings.h" + #include "wx/dialog.h" +#endif + +#include "wx/combo.h" + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxIMPLEMENT_DYNAMIC_CLASS2_XTI(wxOwnerDrawnComboBox, wxComboCtrl, \ + wxControlWithItems, "wx/odcombo.h") + +wxBEGIN_PROPERTIES_TABLE(wxOwnerDrawnComboBox) +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxOwnerDrawnComboBox) + +wxCONSTRUCTOR_5( wxOwnerDrawnComboBox , wxWindow* , Parent , wxWindowID , \ + Id , wxString , Value , wxPoint , Position , wxSize , Size ) + +#endif // wxUSE_ODCOMBOBOX diff --git a/src/common/panelcmn.cpp b/src/common/panelcmn.cpp index 60192f151d..fc6788c3ae 100644 --- a/src/common/panelcmn.cpp +++ b/src/common/panelcmn.cpp @@ -1,87 +1,87 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/panelcmn.cpp -// Purpose: wxPanel common code -// Author: Julian Smart, Robert Roebling, Vadim Zeitlin -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: panelg.cpp 45056 2007-03-25 22:41:11Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/font.h" - #include "wx/colour.h" - #include "wx/settings.h" - #include "wx/log.h" - #include "wx/panel.h" - #include "wx/containr.h" -#endif - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxPanelStyle ) -wxBEGIN_FLAGS( wxPanelStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) -wxEND_FLAGS( wxPanelStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxPanel, wxWindow, "wx/panel.h") - -wxBEGIN_PROPERTIES_TABLE(wxPanel) - wxPROPERTY_FLAGS( WindowStyle, wxPanelStyle, long, \ - SetWindowStyleFlag, GetWindowStyleFlag, \ - wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style - // style wxTAB_TRAVERSAL -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxPanel) - -wxCONSTRUCTOR_6( wxPanel, wxWindow*, Parent, wxWindowID, Id, \ - wxPoint, Position, wxSize, Size, long, WindowStyle, \ - wxString, Name) - - +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/panelcmn.cpp +// Purpose: wxPanel common code +// Author: Julian Smart, Robert Roebling, Vadim Zeitlin +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/object.h" + #include "wx/font.h" + #include "wx/colour.h" + #include "wx/settings.h" + #include "wx/log.h" + #include "wx/panel.h" + #include "wx/containr.h" +#endif + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxPanelStyle ) +wxBEGIN_FLAGS( wxPanelStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) +wxEND_FLAGS( wxPanelStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxPanel, wxWindow, "wx/panel.h") + +wxBEGIN_PROPERTIES_TABLE(wxPanel) + wxPROPERTY_FLAGS( WindowStyle, wxPanelStyle, long, \ + SetWindowStyleFlag, GetWindowStyleFlag, \ + wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style + // style wxTAB_TRAVERSAL +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxPanel) + +wxCONSTRUCTOR_6( wxPanel, wxWindow*, Parent, wxWindowID, Id, \ + wxPoint, Position, wxSize, Size, long, WindowStyle, \ + wxString, Name) + + diff --git a/src/common/radiobtncmn.cpp b/src/common/radiobtncmn.cpp index a50e707c7f..5623b274e3 100644 --- a/src/common/radiobtncmn.cpp +++ b/src/common/radiobtncmn.cpp @@ -1,93 +1,93 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/radiobtncmn.cpp -// Purpose: wxRadioButton common code -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: radiobut.cpp 41144 2006-09-10 23:08:13Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RADIOBTN - -#include "wx/radiobut.h" - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/dcscreen.h" -#endif - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxRadioButtonStyle ) -wxBEGIN_FLAGS( wxRadioButtonStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxRB_GROUP) -wxEND_FLAGS( wxRadioButtonStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioButton, wxControl, "wx/radiobut.h") - -wxBEGIN_PROPERTIES_TABLE(wxRadioButton) - wxEVENT_PROPERTY( Click, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEvent ) - wxPROPERTY( Font, wxFont, SetFont, GetFont , wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString(), 0 /*flags*/, \ - wxT("Helpstring"), wxT("group") ) - wxPROPERTY( Value,bool, SetValue, GetValue, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group") ) - wxPROPERTY_FLAGS( WindowStyle, wxRadioButtonStyle, long, SetWindowStyleFlag, \ - GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxRadioButton) - -wxCONSTRUCTOR_6( wxRadioButton, wxWindow*, Parent, wxWindowID, Id, \ - wxString, Label, wxPoint, Position, wxSize, Size, long, WindowStyle ) - - -#endif // wxUSE_RADIOBTN +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/radiobtncmn.cpp +// Purpose: wxRadioButton common code +// Author: Julian Smart +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_RADIOBTN + +#include "wx/radiobut.h" + +#ifndef WX_PRECOMP + #include "wx/settings.h" + #include "wx/dcscreen.h" +#endif + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxRadioButtonStyle ) +wxBEGIN_FLAGS( wxRadioButtonStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) + + wxFLAGS_MEMBER(wxRB_GROUP) +wxEND_FLAGS( wxRadioButtonStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioButton, wxControl, "wx/radiobut.h") + +wxBEGIN_PROPERTIES_TABLE(wxRadioButton) + wxEVENT_PROPERTY( Click, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEvent ) + wxPROPERTY( Font, wxFont, SetFont, GetFont , wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString(), 0 /*flags*/, \ + wxT("Helpstring"), wxT("group") ) + wxPROPERTY( Value,bool, SetValue, GetValue, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group") ) + wxPROPERTY_FLAGS( WindowStyle, wxRadioButtonStyle, long, SetWindowStyleFlag, \ + GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxRadioButton) + +wxCONSTRUCTOR_6( wxRadioButton, wxWindow*, Parent, wxWindowID, Id, \ + wxString, Label, wxPoint, Position, wxSize, Size, long, WindowStyle ) + + +#endif // wxUSE_RADIOBTN diff --git a/src/common/scrolbarcmn.cpp b/src/common/scrolbarcmn.cpp index 6cedc3a392..2825d47cd5 100644 --- a/src/common/scrolbarcmn.cpp +++ b/src/common/scrolbarcmn.cpp @@ -1,90 +1,90 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/scrolbarcmn.cpp -// Purpose: wxScrollBar common code -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: scrolbar.cpp 39476 2006-05-30 13:43:18Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SCROLLBAR - -#include "wx/scrolbar.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/settings.h" -#endif - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxScrollBarStyle ) -wxBEGIN_FLAGS( wxScrollBarStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxSB_HORIZONTAL) - wxFLAGS_MEMBER(wxSB_VERTICAL) -wxEND_FLAGS( wxScrollBarStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxScrollBar, wxControl, "wx/scrolbar.h") - -wxBEGIN_PROPERTIES_TABLE(wxScrollBar) - wxEVENT_RANGE_PROPERTY( Scroll, wxEVT_SCROLL_TOP, \ - wxEVT_SCROLL_CHANGED, wxScrollEvent ) - - wxPROPERTY( ThumbPosition, int, SetThumbPosition, GetThumbPosition, 0, \ - 0 /*flags*/, wxT("Helpstring"), wxT("group")) - wxPROPERTY( Range, int, SetRange, GetRange, 0, \ - 0 /*flags*/, wxT("Helpstring"), wxT("group")) - wxPROPERTY( ThumbSize, int, SetThumbSize, GetThumbSize, 0, \ - 0 /*flags*/, wxT("Helpstring"), wxT("group")) - wxPROPERTY( PageSize, int, SetPageSize, GetPageSize, 0, \ - 0 /*flags*/, wxT("Helpstring"), wxT("group")) - - wxPROPERTY_FLAGS( WindowStyle, wxScrollBarStyle, long, SetWindowStyleFlag, \ - GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxScrollBar) - -wxCONSTRUCTOR_5( wxScrollBar, wxWindow*, Parent, wxWindowID, Id, \ - wxPoint, Position, wxSize, Size, long, WindowStyle ) - -#endif // wxUSE_SCROLLBAR +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/scrolbarcmn.cpp +// Purpose: wxScrollBar common code +// Author: Julian Smart +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_SCROLLBAR + +#include "wx/scrolbar.h" + +#ifndef WX_PRECOMP + #include "wx/utils.h" + #include "wx/settings.h" +#endif + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxScrollBarStyle ) +wxBEGIN_FLAGS( wxScrollBarStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) + + wxFLAGS_MEMBER(wxSB_HORIZONTAL) + wxFLAGS_MEMBER(wxSB_VERTICAL) +wxEND_FLAGS( wxScrollBarStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxScrollBar, wxControl, "wx/scrolbar.h") + +wxBEGIN_PROPERTIES_TABLE(wxScrollBar) + wxEVENT_RANGE_PROPERTY( Scroll, wxEVT_SCROLL_TOP, \ + wxEVT_SCROLL_CHANGED, wxScrollEvent ) + + wxPROPERTY( ThumbPosition, int, SetThumbPosition, GetThumbPosition, 0, \ + 0 /*flags*/, wxT("Helpstring"), wxT("group")) + wxPROPERTY( Range, int, SetRange, GetRange, 0, \ + 0 /*flags*/, wxT("Helpstring"), wxT("group")) + wxPROPERTY( ThumbSize, int, SetThumbSize, GetThumbSize, 0, \ + 0 /*flags*/, wxT("Helpstring"), wxT("group")) + wxPROPERTY( PageSize, int, SetPageSize, GetPageSize, 0, \ + 0 /*flags*/, wxT("Helpstring"), wxT("group")) + + wxPROPERTY_FLAGS( WindowStyle, wxScrollBarStyle, long, SetWindowStyleFlag, \ + GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxScrollBar) + +wxCONSTRUCTOR_5( wxScrollBar, wxWindow*, Parent, wxWindowID, Id, \ + wxPoint, Position, wxSize, Size, long, WindowStyle ) + +#endif // wxUSE_SCROLLBAR diff --git a/src/common/slidercmn.cpp b/src/common/slidercmn.cpp index ecec156209..998593b7ee 100644 --- a/src/common/slidercmn.cpp +++ b/src/common/slidercmn.cpp @@ -1,108 +1,108 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/slidercmn.cpp -// Purpose: wxSlider common code -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: slider95.cpp 41054 2006-09-07 19:01:45Z ABX $ -// Copyright: (c) Julian Smart 1998 -// Vadim Zeitlin 2004 -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SLIDER - -#include "wx/slider.h" - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxSliderStyle ) -wxBEGIN_FLAGS( wxSliderStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxSL_HORIZONTAL) - wxFLAGS_MEMBER(wxSL_VERTICAL) - wxFLAGS_MEMBER(wxSL_AUTOTICKS) - wxFLAGS_MEMBER(wxSL_LABELS) - wxFLAGS_MEMBER(wxSL_LEFT) - wxFLAGS_MEMBER(wxSL_TOP) - wxFLAGS_MEMBER(wxSL_RIGHT) - wxFLAGS_MEMBER(wxSL_BOTTOM) - wxFLAGS_MEMBER(wxSL_BOTH) - wxFLAGS_MEMBER(wxSL_SELRANGE) - wxFLAGS_MEMBER(wxSL_INVERSE) -wxEND_FLAGS( wxSliderStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxSlider, wxControl, "wx/slider.h") - -wxBEGIN_PROPERTIES_TABLE(wxSlider) - wxEVENT_RANGE_PROPERTY( Scroll, wxEVT_SCROLL_TOP, wxEVT_SCROLL_CHANGED, wxScrollEvent ) - wxEVENT_PROPERTY( Updated, wxEVT_COMMAND_SLIDER_UPDATED, wxCommandEvent ) - - wxPROPERTY( Value, int, SetValue, GetValue, 0, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - wxPROPERTY( Minimum, int, SetMin, GetMin, 0, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - wxPROPERTY( Maximum, int, SetMax, GetMax, 0, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - wxPROPERTY( PageSize, int, SetPageSize, GetLineSize, 1, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - wxPROPERTY( LineSize, int, SetLineSize, GetLineSize, 1, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - wxPROPERTY( ThumbLength, int, SetThumbLength, GetThumbLength, 1, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - - wxPROPERTY_FLAGS( WindowStyle, wxSliderStyle, long, SetWindowStyleFlag, \ - GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxSlider) - -wxCONSTRUCTOR_8( wxSlider, wxWindow*, Parent, wxWindowID, Id, int, Value, \ - int, Minimum, int, Maximum, wxPoint, Position, wxSize, Size, \ - long, WindowStyle ) - -#endif // wxUSE_SLIDER +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/slidercmn.cpp +// Purpose: wxSlider common code +// Author: Julian Smart +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart 1998 +// Vadim Zeitlin 2004 +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_SLIDER + +#include "wx/slider.h" + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxSliderStyle ) +wxBEGIN_FLAGS( wxSliderStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) + + wxFLAGS_MEMBER(wxSL_HORIZONTAL) + wxFLAGS_MEMBER(wxSL_VERTICAL) + wxFLAGS_MEMBER(wxSL_AUTOTICKS) + wxFLAGS_MEMBER(wxSL_LABELS) + wxFLAGS_MEMBER(wxSL_LEFT) + wxFLAGS_MEMBER(wxSL_TOP) + wxFLAGS_MEMBER(wxSL_RIGHT) + wxFLAGS_MEMBER(wxSL_BOTTOM) + wxFLAGS_MEMBER(wxSL_BOTH) + wxFLAGS_MEMBER(wxSL_SELRANGE) + wxFLAGS_MEMBER(wxSL_INVERSE) +wxEND_FLAGS( wxSliderStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxSlider, wxControl, "wx/slider.h") + +wxBEGIN_PROPERTIES_TABLE(wxSlider) + wxEVENT_RANGE_PROPERTY( Scroll, wxEVT_SCROLL_TOP, wxEVT_SCROLL_CHANGED, wxScrollEvent ) + wxEVENT_PROPERTY( Updated, wxEVT_COMMAND_SLIDER_UPDATED, wxCommandEvent ) + + wxPROPERTY( Value, int, SetValue, GetValue, 0, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + wxPROPERTY( Minimum, int, SetMin, GetMin, 0, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + wxPROPERTY( Maximum, int, SetMax, GetMax, 0, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + wxPROPERTY( PageSize, int, SetPageSize, GetLineSize, 1, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + wxPROPERTY( LineSize, int, SetLineSize, GetLineSize, 1, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + wxPROPERTY( ThumbLength, int, SetThumbLength, GetThumbLength, 1, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + + wxPROPERTY_FLAGS( WindowStyle, wxSliderStyle, long, SetWindowStyleFlag, \ + GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxSlider) + +wxCONSTRUCTOR_8( wxSlider, wxWindow*, Parent, wxWindowID, Id, int, Value, \ + int, Minimum, int, Maximum, wxPoint, Position, wxSize, Size, \ + long, WindowStyle ) + +#endif // wxUSE_SLIDER diff --git a/src/common/spinbtncmn.cpp b/src/common/spinbtncmn.cpp index b89d1ef1db..2d427121f1 100644 --- a/src/common/spinbtncmn.cpp +++ b/src/common/spinbtncmn.cpp @@ -1,99 +1,99 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/spinbtncmn.cpp -// Purpose: wxSpinButton common code -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: spinbutt.cpp 44657 2007-03-07 22:56:34Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/app.h" -#endif - -#if wxUSE_SPINBTN - -#include "wx/spinbutt.h" - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxSpinButtonStyle ) -wxBEGIN_FLAGS( wxSpinButtonStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxSP_HORIZONTAL) - wxFLAGS_MEMBER(wxSP_VERTICAL) - wxFLAGS_MEMBER(wxSP_ARROW_KEYS) - wxFLAGS_MEMBER(wxSP_WRAP) -wxEND_FLAGS( wxSpinButtonStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxSpinButton, wxControl, "wx/spinbut.h") - -wxBEGIN_PROPERTIES_TABLE(wxSpinButton) - wxEVENT_RANGE_PROPERTY( Spin, wxEVT_SCROLL_TOP, wxEVT_SCROLL_CHANGED, wxSpinEvent ) - - wxPROPERTY( Value, int, SetValue, GetValue, 0, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - wxPROPERTY( Min, int, SetMin, GetMin, 0, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - wxPROPERTY( Max, int, SetMax, GetMax, 0, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - - wxPROPERTY_FLAGS( WindowStyle, wxSpinButtonStyle, long, SetWindowStyleFlag, \ - GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxSpinButton) - -wxCONSTRUCTOR_5( wxSpinButton, wxWindow*, Parent, wxWindowID, Id, \ - wxPoint, Position, wxSize, Size, long, WindowStyle ) - -IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent) - - -#endif // wxUSE_SPINBTN +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/spinbtncmn.cpp +// Purpose: wxSpinButton common code +// Author: Julian Smart +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif + +#if wxUSE_SPINBTN + +#include "wx/spinbutt.h" + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxSpinButtonStyle ) +wxBEGIN_FLAGS( wxSpinButtonStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) + + wxFLAGS_MEMBER(wxSP_HORIZONTAL) + wxFLAGS_MEMBER(wxSP_VERTICAL) + wxFLAGS_MEMBER(wxSP_ARROW_KEYS) + wxFLAGS_MEMBER(wxSP_WRAP) +wxEND_FLAGS( wxSpinButtonStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxSpinButton, wxControl, "wx/spinbut.h") + +wxBEGIN_PROPERTIES_TABLE(wxSpinButton) + wxEVENT_RANGE_PROPERTY( Spin, wxEVT_SCROLL_TOP, wxEVT_SCROLL_CHANGED, wxSpinEvent ) + + wxPROPERTY( Value, int, SetValue, GetValue, 0, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + wxPROPERTY( Min, int, SetMin, GetMin, 0, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + wxPROPERTY( Max, int, SetMax, GetMax, 0, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + + wxPROPERTY_FLAGS( WindowStyle, wxSpinButtonStyle, long, SetWindowStyleFlag, \ + GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxSpinButton) + +wxCONSTRUCTOR_5( wxSpinButton, wxWindow*, Parent, wxWindowID, Id, \ + wxPoint, Position, wxSize, Size, long, WindowStyle ) + +IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent) + + +#endif // wxUSE_SPINBTN diff --git a/src/common/statbmpcmn.cpp b/src/common/statbmpcmn.cpp index acc10b342b..0b51444db8 100644 --- a/src/common/statbmpcmn.cpp +++ b/src/common/statbmpcmn.cpp @@ -1,85 +1,85 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/statbmpcmn.cpp -// Purpose: wxStaticBitmap common code -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: statbmp.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STATBMP - -#include "wx/statbmp.h" - -// --------------------------------------------------------------------------- -// XTI -// --------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxStaticBitmapStyle ) -wxBEGIN_FLAGS( wxStaticBitmapStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - -wxEND_FLAGS( wxStaticBitmapStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticBitmap, wxControl, "wx/statbmp.h") - -wxBEGIN_PROPERTIES_TABLE(wxStaticBitmap) - wxPROPERTY_FLAGS( WindowStyle, wxStaticBitmapStyle, long, \ - SetWindowStyleFlag, GetWindowStyleFlag, \ - wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), \ - wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxStaticBitmap) - -wxCONSTRUCTOR_5( wxStaticBitmap, wxWindow*, Parent, wxWindowID, Id, \ - wxBitmap, Bitmap, wxPoint, Position, wxSize, Size ) - -/* - TODO PROPERTIES : - bitmap -*/ - -#endif // wxUSE_STATBMP +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/statbmpcmn.cpp +// Purpose: wxStaticBitmap common code +// Author: Julian Smart +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// =========================================================================== +// declarations +// =========================================================================== + +// --------------------------------------------------------------------------- +// headers +// --------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_STATBMP + +#include "wx/statbmp.h" + +// --------------------------------------------------------------------------- +// XTI +// --------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxStaticBitmapStyle ) +wxBEGIN_FLAGS( wxStaticBitmapStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) + +wxEND_FLAGS( wxStaticBitmapStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticBitmap, wxControl, "wx/statbmp.h") + +wxBEGIN_PROPERTIES_TABLE(wxStaticBitmap) + wxPROPERTY_FLAGS( WindowStyle, wxStaticBitmapStyle, long, \ + SetWindowStyleFlag, GetWindowStyleFlag, \ + wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, wxT("Helpstring"), \ + wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxStaticBitmap) + +wxCONSTRUCTOR_5( wxStaticBitmap, wxWindow*, Parent, wxWindowID, Id, \ + wxBitmap, Bitmap, wxPoint, Position, wxSize, Size ) + +/* + TODO PROPERTIES : + bitmap +*/ + +#endif // wxUSE_STATBMP diff --git a/src/common/statboxcmn.cpp b/src/common/statboxcmn.cpp index 6916286afb..5038b4c3c2 100644 --- a/src/common/statboxcmn.cpp +++ b/src/common/statboxcmn.cpp @@ -1,81 +1,81 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/statboxcmn.cpp -// Purpose: wxStaticBox common code -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: statbox.cpp 45008 2007-03-22 02:28:06Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STATBOX - -#include "wx/statbox.h" - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxStaticBoxStyle ) -wxBEGIN_FLAGS( wxStaticBoxStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) -wxEND_FLAGS( wxStaticBoxStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticBox, wxControl, "wx/statbox.h") - -wxBEGIN_PROPERTIES_TABLE(wxStaticBox) - wxPROPERTY( Label, wxString, SetLabel, GetLabel, wxString(), 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) - wxPROPERTY_FLAGS( WindowStyle, wxStaticBoxStyle, long, SetWindowStyleFlag, \ - GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxStaticBox) - -wxCONSTRUCTOR_6( wxStaticBox, wxWindow*, Parent, wxWindowID, Id, \ - wxString, Label, wxPoint, Position, wxSize, Size, \ - long, WindowStyle ) - -#endif // wxUSE_STATBOX +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/statboxcmn.cpp +// Purpose: wxStaticBox common code +// Author: Julian Smart +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_STATBOX + +#include "wx/statbox.h" + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxStaticBoxStyle ) +wxBEGIN_FLAGS( wxStaticBoxStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) +wxEND_FLAGS( wxStaticBoxStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticBox, wxControl, "wx/statbox.h") + +wxBEGIN_PROPERTIES_TABLE(wxStaticBox) + wxPROPERTY( Label, wxString, SetLabel, GetLabel, wxString(), 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) + wxPROPERTY_FLAGS( WindowStyle, wxStaticBoxStyle, long, SetWindowStyleFlag, \ + GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxStaticBox) + +wxCONSTRUCTOR_6( wxStaticBox, wxWindow*, Parent, wxWindowID, Id, \ + wxString, Label, wxPoint, Position, wxSize, Size, \ + long, WindowStyle ) + +#endif // wxUSE_STATBOX diff --git a/src/common/statlinecmn.cpp b/src/common/statlinecmn.cpp index af1c82562d..f2b0de3a30 100644 --- a/src/common/statlinecmn.cpp +++ b/src/common/statlinecmn.cpp @@ -1,80 +1,80 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/statlinecmn.cpp -// Purpose: wxStaticLine common code -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id: statline.cpp 41054 2006-09-07 19:01:45Z ABX $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/statline.h" - -#if wxUSE_STATLINE - -// ---------------------------------------------------------------------------- -// XTI -// ---------------------------------------------------------------------------- - -wxDEFINE_FLAGS( wxStaticLineStyle ) -wxBEGIN_FLAGS( wxStaticLineStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxLI_HORIZONTAL) - wxFLAGS_MEMBER(wxLI_VERTICAL) -wxEND_FLAGS( wxStaticLineStyle ) - -wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticLine, wxControl, "wx/statline.h") - -wxBEGIN_PROPERTIES_TABLE(wxStaticLine) - wxPROPERTY_FLAGS( WindowStyle, wxStaticLineStyle, long, SetWindowStyleFlag, \ - GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ - wxT("Helpstring"), wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxEMPTY_HANDLERS_TABLE(wxStaticLine) - -wxCONSTRUCTOR_5( wxStaticLine, wxWindow*, Parent, wxWindowID, Id, \ - wxPoint, Position, wxSize, Size, long, WindowStyle) - -#endif // wxUSE_STATLINE +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/statlinecmn.cpp +// Purpose: wxStaticLine common code +// Author: Vadim Zeitlin +// Created: 28.06.99 +// Version: $Id$ +// Copyright: (c) 1998 Vadim Zeitlin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/statline.h" + +#if wxUSE_STATLINE + +// ---------------------------------------------------------------------------- +// XTI +// ---------------------------------------------------------------------------- + +wxDEFINE_FLAGS( wxStaticLineStyle ) +wxBEGIN_FLAGS( wxStaticLineStyle ) + // new style border flags, we put them first to + // use them for streaming out + wxFLAGS_MEMBER(wxBORDER_SIMPLE) + wxFLAGS_MEMBER(wxBORDER_SUNKEN) + wxFLAGS_MEMBER(wxBORDER_DOUBLE) + wxFLAGS_MEMBER(wxBORDER_RAISED) + wxFLAGS_MEMBER(wxBORDER_STATIC) + wxFLAGS_MEMBER(wxBORDER_NONE) + + // old style border flags + wxFLAGS_MEMBER(wxSIMPLE_BORDER) + wxFLAGS_MEMBER(wxSUNKEN_BORDER) + wxFLAGS_MEMBER(wxDOUBLE_BORDER) + wxFLAGS_MEMBER(wxRAISED_BORDER) + wxFLAGS_MEMBER(wxSTATIC_BORDER) + wxFLAGS_MEMBER(wxBORDER) + + // standard window styles + wxFLAGS_MEMBER(wxTAB_TRAVERSAL) + wxFLAGS_MEMBER(wxCLIP_CHILDREN) + wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) + wxFLAGS_MEMBER(wxWANTS_CHARS) + wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) + wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) + wxFLAGS_MEMBER(wxVSCROLL) + wxFLAGS_MEMBER(wxHSCROLL) + + wxFLAGS_MEMBER(wxLI_HORIZONTAL) + wxFLAGS_MEMBER(wxLI_VERTICAL) +wxEND_FLAGS( wxStaticLineStyle ) + +wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticLine, wxControl, "wx/statline.h") + +wxBEGIN_PROPERTIES_TABLE(wxStaticLine) + wxPROPERTY_FLAGS( WindowStyle, wxStaticLineStyle, long, SetWindowStyleFlag, \ + GetWindowStyleFlag, wxEMPTY_PARAMETER_VALUE, 0 /*flags*/, \ + wxT("Helpstring"), wxT("group")) // style +wxEND_PROPERTIES_TABLE() + +wxEMPTY_HANDLERS_TABLE(wxStaticLine) + +wxCONSTRUCTOR_5( wxStaticLine, wxWindow*, Parent, wxWindowID, Id, \ + wxPoint, Position, wxSize, Size, long, WindowStyle) + +#endif // wxUSE_STATLINE -- 2.45.2