1. new wxList code
2. fixes to allow compilation at -W4 with VisualC++ 6.0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -41,9 +41,10 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Eliminate double/float warnings
|
||||
// suppress some Visual C++ warnings
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable:4244)
|
||||
# pragma warning(disable:4244) // cobversion from double to float
|
||||
# pragma warning(disable:4100) // unreferenced formal parameter
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -368,8 +368,8 @@ private: \
|
||||
|
||||
@memo declare list class 'name' containing elements of type 'T'
|
||||
*/
|
||||
#define WX_DECLARE_LIST(T, name) typedef T _L##name; \
|
||||
_WX_DECLARE_LIST(_L##name, name)
|
||||
#define WX_DECLARE_OBJARRAY(T, name) typedef T _L##name; \
|
||||
_WX_DECLARE_LIST(_L##name, name)
|
||||
/**
|
||||
To use a list class you must
|
||||
<ll>
|
||||
@@ -387,7 +387,7 @@ private: \
|
||||
|
||||
@memo define (must include listimpl.cpp!) list class 'name'
|
||||
*/
|
||||
#define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!"
|
||||
#define WX_DEFINE_OBJARRAY(name) "don't forget to include listimpl.cpp!"
|
||||
//@}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -345,6 +345,26 @@ class WXDLLEXPORT wxCommandEvent: public wxEvent
|
||||
wxClientData* m_clientObject; // Arbitrary client object
|
||||
};
|
||||
|
||||
// this class adds a possibility to react (from the user) code to a control
|
||||
// notification: allow or veto the operation being reported.
|
||||
class WXDLLEXPORT wxNotifyEvent : public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
|
||||
: wxCommandEvent(commandType, id) { m_bAllow = TRUE; }
|
||||
|
||||
// veto the operation (by default it's allowed)
|
||||
void Veto() { m_bAllow = FALSE; }
|
||||
|
||||
// for implementation code only: is the operation allowed?
|
||||
bool IsAllowed() const { return m_bAllow; }
|
||||
|
||||
private:
|
||||
bool m_bAllow;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxCommandEvent)
|
||||
};
|
||||
|
||||
// Scroll event class
|
||||
/*
|
||||
wxEVT_SCROLL_TOP
|
||||
|
@@ -169,6 +169,10 @@ public:
|
||||
~wxTempFile();
|
||||
|
||||
private:
|
||||
// no copy ctor/assignment operator
|
||||
wxTempFile(const wxTempFile&);
|
||||
wxTempFile& operator=(const wxTempFile&);
|
||||
|
||||
wxString m_strName, // name of the file to replace in Commit()
|
||||
m_strTemp; // temporary file name
|
||||
wxFile m_file; // the temporary file
|
||||
|
@@ -353,11 +353,13 @@ extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor);
|
||||
|
||||
class WXDLLEXPORT wxResourceCache: public wxList
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxResourceCache)
|
||||
public:
|
||||
wxResourceCache();
|
||||
wxResourceCache(const unsigned int the_key_type);
|
||||
~wxResourceCache();
|
||||
public:
|
||||
wxResourceCache() { }
|
||||
wxResourceCache(const unsigned int keyType) : wxList(keyType) { }
|
||||
~wxResourceCache();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxResourceCache)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -37,13 +37,27 @@ class wxNotebookEvent : public wxCommandEvent
|
||||
public:
|
||||
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||
int nSel = -1, int nOldSel = -1)
|
||||
: wxCommandEvent(commandType, id) { m_nSel = nSel; m_nOldSel = nOldSel; }
|
||||
: wxCommandEvent(commandType, id)
|
||||
{
|
||||
m_bAllow = TRUE;
|
||||
m_nSel = nSel;
|
||||
m_nOldSel = nOldSel;
|
||||
}
|
||||
|
||||
// accessors
|
||||
int GetSelection() const { return m_nSel; }
|
||||
int GetOldSelection() const { return m_nOldSel; }
|
||||
|
||||
// for wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING event this method may be called
|
||||
// to disallow the page change
|
||||
void Veto() { m_bAllow = FALSE; }
|
||||
|
||||
// implementation: for wxNotebook usage only
|
||||
bool Allowed() const { return m_bAllow; }
|
||||
|
||||
private:
|
||||
bool m_bAllow;
|
||||
|
||||
int m_nSel, // currently selected page
|
||||
m_nOldSel; // previously selected page
|
||||
|
||||
|
@@ -37,13 +37,27 @@ class wxNotebookEvent : public wxCommandEvent
|
||||
public:
|
||||
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||
int nSel = -1, int nOldSel = -1)
|
||||
: wxCommandEvent(commandType, id) { m_nSel = nSel; m_nOldSel = nOldSel; }
|
||||
: wxCommandEvent(commandType, id)
|
||||
{
|
||||
m_bAllow = TRUE;
|
||||
m_nSel = nSel;
|
||||
m_nOldSel = nOldSel;
|
||||
}
|
||||
|
||||
// accessors
|
||||
int GetSelection() const { return m_nSel; }
|
||||
int GetOldSelection() const { return m_nOldSel; }
|
||||
|
||||
// for wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING event this method may be called
|
||||
// to disallow the page change
|
||||
void Veto() { m_bAllow = FALSE; }
|
||||
|
||||
// implementation: for wxNotebook usage only
|
||||
bool Allowed() const { return m_bAllow; }
|
||||
|
||||
private:
|
||||
bool m_bAllow;
|
||||
|
||||
int m_nSel, // currently selected page
|
||||
m_nOldSel; // previously selected page
|
||||
|
||||
|
@@ -2,13 +2,26 @@
|
||||
// Name: list.h
|
||||
// Purpose: wxList, wxStringList classes
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Modified by: VZ at 16/11/98: WX_DECLARE_LIST() and typesafe lists added
|
||||
// Created: 29/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 Julian Smart
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
All this is quite ugly but serves two purposes:
|
||||
1. Be almost 100% compatible with old, untyped, wxList class
|
||||
2. Ensure compile-time type checking for the linked lists
|
||||
|
||||
The idea is to have one base class (wxListBase) working with "void *" data,
|
||||
but to hide these untyped functions - i.e. make them protected, so they
|
||||
can only be used from derived classes which have inline member functions
|
||||
working with right types. This achieves the 2nd goal. As for the first one,
|
||||
we provide a special derivation of wxListBase called wxList which looks just
|
||||
like the old class.
|
||||
*/
|
||||
|
||||
#ifndef _WX_LISTH__
|
||||
#define _WX_LISTH__
|
||||
|
||||
@@ -16,133 +29,445 @@
|
||||
#pragma interface "list.h"
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// headers
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/debug.h"
|
||||
#include "wx/object.h"
|
||||
|
||||
class WXDLLEXPORT wxList;
|
||||
// due to circular header dependencies this function has to be declared here
|
||||
// (normally it's found in utils.h which includes itself list.h...)
|
||||
extern char* WXDLLEXPORT copystring(const char *s);
|
||||
|
||||
#define wxKEY_NONE 0
|
||||
#define wxKEY_INTEGER 1
|
||||
#define wxKEY_STRING 2
|
||||
class WXDLLEXPORT wxNode: public wxObject
|
||||
class WXDLLEXPORT wxObjectListNode;
|
||||
typedef wxObjectListNode wxNode;
|
||||
|
||||
// undef it to get rid of old, deprecated functions
|
||||
#define wxLIST_COMPATIBILITY
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// constants
|
||||
// -----------------------------------------------------------------------------
|
||||
enum wxKeyType
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxNode)
|
||||
private:
|
||||
|
||||
wxObject *data;
|
||||
wxNode *next;
|
||||
wxNode *previous;
|
||||
wxKEY_NONE,
|
||||
wxKEY_INTEGER,
|
||||
wxKEY_STRING
|
||||
};
|
||||
|
||||
public:
|
||||
wxList *list;
|
||||
// -----------------------------------------------------------------------------
|
||||
// types
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Optional key stuff
|
||||
union
|
||||
{
|
||||
// type of compare function for list sort operation (as in 'qsort'): it should
|
||||
// return a negative value, 0 or positive value if the first element is less
|
||||
// than, equal or greater than the second
|
||||
typedef int (*wxSortCompareFunction)(const void *elem1, const void *elem2);
|
||||
|
||||
//
|
||||
typedef int (*wxListIterateFunction)(void *current);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// key stuff: a list may be optionally keyed on integer or string key
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
union wxListKeyValue
|
||||
{
|
||||
long integer;
|
||||
char *string;
|
||||
} key;
|
||||
|
||||
wxNode(wxList *the_list = (wxList *) NULL, wxNode *last_one = (wxNode *) NULL, wxNode *next_one = (wxNode *) NULL, wxObject *object = (wxObject *) NULL);
|
||||
wxNode(wxList *the_list, wxNode *last_one, wxNode *next_one,
|
||||
wxObject *object, long the_key);
|
||||
wxNode(wxList *the_list, wxNode *last_one, wxNode *next_one,
|
||||
wxObject *object, const char *the_key);
|
||||
~wxNode(void);
|
||||
|
||||
inline wxNode *Next(void) const { return next; }
|
||||
inline wxNode *Previous(void) const { return previous; }
|
||||
inline wxObject *Data(void) const { return (wxObject *)data; }
|
||||
inline void SetData(wxObject *the_data) { data = the_data; }
|
||||
};
|
||||
|
||||
// type of compare function for list sort operation (as in 'qsort')
|
||||
typedef int (*wxSortCompareFunction)(const void *elem1, const void *elem2);
|
||||
typedef int (*wxListIterateFunction)(wxObject *o);
|
||||
|
||||
class WXDLLEXPORT wxList: public wxObject
|
||||
// a struct which may contain both types of keys
|
||||
//
|
||||
// implementation note: on one hand, this class allows to have only one function
|
||||
// for any keyed operation instead of 2 almost equivalent. OTOH, it's needed to
|
||||
// resolve ambiguity which we would otherwise have with wxStringList::Find() and
|
||||
// wxList::Find(const char *).
|
||||
class WXDLLEXPORT wxListKey
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxList)
|
||||
public:
|
||||
// implicit ctors
|
||||
wxListKey()
|
||||
{ m_keyType = wxKEY_NONE; }
|
||||
wxListKey(long i)
|
||||
{ m_keyType = wxKEY_INTEGER; m_key.integer = i; }
|
||||
wxListKey(const char *s)
|
||||
{ m_keyType = wxKEY_STRING; m_key.string = strdup(s); }
|
||||
wxListKey(const wxString& s)
|
||||
{ m_keyType = wxKEY_STRING; m_key.string = strdup(s.c_str()); }
|
||||
|
||||
public:
|
||||
int n;
|
||||
int destroy_data;
|
||||
wxNode *first_node;
|
||||
wxNode *last_node;
|
||||
unsigned int key_type;
|
||||
// accessors
|
||||
wxKeyType GetKeyType() const { return m_keyType; }
|
||||
const char *GetString() const
|
||||
{ wxASSERT( m_keyType == wxKEY_STRING ); return m_key.string; }
|
||||
long GetNumber() const
|
||||
{ wxASSERT( m_keyType == wxKEY_INTEGER ); return m_key.integer; }
|
||||
|
||||
wxList(void);
|
||||
wxList(const unsigned int the_key_type);
|
||||
wxList(int N, wxObject *Objects[]);
|
||||
wxList(wxObject *object, ...);
|
||||
|
||||
~wxList(void);
|
||||
// comparaison
|
||||
bool operator==(wxListKeyValue value) const
|
||||
{
|
||||
switch ( m_keyType )
|
||||
{
|
||||
default:
|
||||
wxFAIL_MSG("bad key type.");
|
||||
// let compiler optimize the line above away in release build
|
||||
// by not putting return here...
|
||||
|
||||
inline int Number(void) const { return n; }
|
||||
inline int GetCount(void) const { return n; }
|
||||
case wxKEY_STRING:
|
||||
return strcmp(m_key.string, value.string) == 0;
|
||||
|
||||
// Append to end of list
|
||||
wxNode *Append(wxObject *object);
|
||||
case wxKEY_INTEGER:
|
||||
return m_key.integer == value.integer;
|
||||
}
|
||||
}
|
||||
|
||||
// Insert at front of list
|
||||
wxNode *Insert(wxObject *object);
|
||||
// dtor
|
||||
~wxListKey()
|
||||
{
|
||||
if ( m_keyType == wxKEY_STRING )
|
||||
free(m_key.string);
|
||||
}
|
||||
|
||||
// Insert before given node
|
||||
wxNode *Insert(wxNode *position, wxObject *object);
|
||||
|
||||
// Keyed append
|
||||
wxNode *Append(long key, wxObject *object);
|
||||
wxNode *Append(const char *key, wxObject *object);
|
||||
|
||||
bool DeleteNode(wxNode *node);
|
||||
bool DeleteObject(wxObject *object); // Finds object pointer and
|
||||
// deletes node (and object if
|
||||
// DeleteContents is on)
|
||||
virtual void Clear(void); // Delete all nodes
|
||||
|
||||
inline wxNode *First(void) const { return first_node; }
|
||||
inline wxNode *Last(void) const { return last_node; }
|
||||
wxNode *Nth(int i) const; // nth node counting from 0
|
||||
|
||||
// Keyed search
|
||||
virtual wxNode *Find(long key) const;
|
||||
virtual wxNode *Find(const char *key) const;
|
||||
|
||||
virtual wxNode *Member(wxObject *object) const;
|
||||
|
||||
inline void DeleteContents(int destroy) { destroy_data = destroy; }
|
||||
// Instruct it to destroy user data
|
||||
// when deleting nodes
|
||||
// this function allows the sorting of arbitrary lists by giving
|
||||
// a function to compare two list elements.
|
||||
void Sort(const wxSortCompareFunction compfunc);
|
||||
|
||||
wxObject *FirstThat(wxListIterateFunction func);
|
||||
void ForEach(wxListIterateFunction func);
|
||||
wxObject *LastThat(wxListIterateFunction func);
|
||||
private:
|
||||
wxKeyType m_keyType;
|
||||
wxListKeyValue m_key;
|
||||
};
|
||||
|
||||
// String list class. N.B. this always copies strings
|
||||
// with Add and deletes them itself.
|
||||
class WXDLLEXPORT wxStringList: public wxList
|
||||
// -----------------------------------------------------------------------------
|
||||
// wxNodeBase class is a (base for) node in a double linked list
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxNodeBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStringList)
|
||||
friend class wxListBase;
|
||||
public:
|
||||
// ctor
|
||||
wxNodeBase(wxListBase *list = (wxListBase *)NULL,
|
||||
wxNodeBase *previous = (wxNodeBase *)NULL,
|
||||
wxNodeBase *next = (wxNodeBase *)NULL,
|
||||
void *data = NULL,
|
||||
const wxListKey& key = wxListKey());
|
||||
|
||||
public:
|
||||
wxStringList(void);
|
||||
wxStringList(const wxStringList& list);
|
||||
wxStringList(const char *first ...);
|
||||
~wxStringList(void);
|
||||
virtual ~wxNodeBase();
|
||||
|
||||
virtual wxNode *Add(const char *s);
|
||||
virtual void Delete(const char *s);
|
||||
virtual char **ListToArray(bool new_copies = FALSE) const;
|
||||
virtual void Sort(void);
|
||||
virtual bool Member(const char *s) const;
|
||||
virtual void Clear(void);
|
||||
void operator= (const wxStringList& list);
|
||||
char* operator[] (int i) const;
|
||||
// @@ no check is done that the list is really keyed on strings
|
||||
const char *GetKeyString() const { return m_key.string; }
|
||||
|
||||
#ifdef wxLIST_COMPATIBILITY
|
||||
// compatibility methods
|
||||
wxNode *Next() const { return (wxNode *)GetNext(); }
|
||||
wxNode *Previous() const { return (wxNode *)GetPrevious(); }
|
||||
wxObject *Data() const { return (wxObject *)GetData(); }
|
||||
#endif // wxLIST_COMPATIBILITY
|
||||
|
||||
protected:
|
||||
// all these are going to be "overloaded" in the derived classes
|
||||
wxNodeBase *GetNext() const { return m_next; }
|
||||
wxNodeBase *GetPrevious() const { return m_previous; }
|
||||
|
||||
void *GetData() const { return m_data; }
|
||||
void SetData(void *data) { m_data = data; }
|
||||
|
||||
virtual void DeleteData() { }
|
||||
|
||||
private:
|
||||
// optional key stuff
|
||||
wxListKeyValue m_key;
|
||||
|
||||
void *m_data; // user data
|
||||
wxNodeBase *m_next, // next and previous nodes in the list
|
||||
*m_previous;
|
||||
|
||||
wxListBase *m_list; // list we belong to
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// a double-linked list class
|
||||
// -----------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxListBase : public wxObject
|
||||
{
|
||||
friend class wxNodeBase; // should be able to call DetachNode()
|
||||
public:
|
||||
// default ctor & dtor
|
||||
wxListBase(wxKeyType keyType = wxKEY_NONE) { Init(keyType); }
|
||||
virtual ~wxListBase();
|
||||
|
||||
// accessors
|
||||
// count of items in the list
|
||||
size_t GetCount() const { return m_count; }
|
||||
|
||||
// operations
|
||||
// delete all nodes
|
||||
virtual void Clear();
|
||||
// instruct it to destroy user data when deleting nodes
|
||||
void DeleteContents(bool destroy) { m_destroy = destroy; }
|
||||
|
||||
protected:
|
||||
// all methods here are "overloaded" in derived classes to provide compile
|
||||
// time type checking
|
||||
|
||||
// create a node for the list of this type
|
||||
virtual wxNodeBase *CreateNode(wxNodeBase *prev, wxNodeBase *next,
|
||||
void *data,
|
||||
const wxListKey& key = wxListKey()) = 0;
|
||||
|
||||
// ctors
|
||||
// from an array
|
||||
wxListBase(size_t count, void *elements[]);
|
||||
// from a sequence of objects
|
||||
wxListBase(void *object, ... /* terminate with NULL */);
|
||||
|
||||
// copy ctor and assignment operator
|
||||
wxListBase(const wxListBase& list)
|
||||
{ DoCopy(list); }
|
||||
wxListBase& operator=(const wxListBase& list)
|
||||
{ Clear(); DoCopy(list); return *this; }
|
||||
|
||||
// get list head/tail
|
||||
wxNodeBase *GetFirst() const { return m_nodeFirst; }
|
||||
wxNodeBase *GetLast() const { return m_nodeLast; }
|
||||
|
||||
// by (0-based) index
|
||||
wxNodeBase *Item(size_t index) const;
|
||||
|
||||
// get the list item's data
|
||||
void *operator[](size_t index) const
|
||||
{ wxNodeBase *node = Item(index); return node ? node->GetData() : NULL; }
|
||||
|
||||
// operations
|
||||
// append to end of list
|
||||
wxNodeBase *Append(void *object);
|
||||
// insert a new item at the beginning of the list
|
||||
wxNodeBase *Insert(void *object) { return Insert(NULL, object); }
|
||||
// insert before given node or at front of list if prev == NULL
|
||||
wxNodeBase *Insert(wxNodeBase *prev, void *object);
|
||||
|
||||
// keyed append
|
||||
wxNodeBase *Append(long key, void *object);
|
||||
wxNodeBase *Append(const char *key, void *object);
|
||||
|
||||
// removes node from the list but doesn't delete it (returns pointer
|
||||
// to the node or NULL if it wasn't found in the list)
|
||||
wxNodeBase *DetachNode(wxNodeBase *node);
|
||||
// delete element from list, returns FALSE if node not found
|
||||
bool DeleteNode(wxNodeBase *node);
|
||||
// finds object pointer and deletes node (and object if DeleteContents
|
||||
// is on), returns FALSE if object not found
|
||||
bool DeleteObject(void *object);
|
||||
|
||||
// search (all return NULL if item not found)
|
||||
// by data
|
||||
wxNodeBase *Find(void *object) const;
|
||||
|
||||
// by key
|
||||
wxNodeBase *Find(const wxListKey& key) const;
|
||||
|
||||
// this function allows the sorting of arbitrary lists by giving
|
||||
// a function to compare two list elements. The list is sorted in place.
|
||||
void Sort(wxSortCompareFunction compfunc);
|
||||
|
||||
// functions for iterating over the list
|
||||
void *FirstThat(wxListIterateFunction func);
|
||||
void ForEach(wxListIterateFunction func);
|
||||
void *LastThat(wxListIterateFunction func);
|
||||
|
||||
private:
|
||||
// helpers
|
||||
// common part of all ctors
|
||||
void Init(wxKeyType keyType);
|
||||
// common part of copy ctor and assignment operator
|
||||
void DoCopy(const wxListBase& list);
|
||||
// common part of all Append()s
|
||||
wxNodeBase *AppendCommon(wxNodeBase *node);
|
||||
// free node's data and node itself
|
||||
void DoDeleteNode(wxNodeBase *node);
|
||||
|
||||
size_t m_count; // number of elements in the list
|
||||
bool m_destroy; // destroy user data when deleting list items?
|
||||
wxNodeBase *m_nodeFirst, // pointers to the head and tail of the list
|
||||
*m_nodeLast;
|
||||
|
||||
wxKeyType m_keyType; // type of our keys (may be wxKEY_NONE)
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// macros for definition of "template" list type
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// and now some heavy magic...
|
||||
|
||||
// declare a list type named 'name' and containing elements of type 'T *'
|
||||
// (as a by product of macro expansion you also get wx##name##Node
|
||||
// wxNode-dervied type)
|
||||
//
|
||||
// implementation details:
|
||||
// 1. we define _WX_LIST_ITEM_TYPE_##name typedef to save in it the item type
|
||||
// for the list of given type - this allows us to pass only the list name
|
||||
// to WX_DEFINE_LIST() even if it needs both the name and the type
|
||||
//
|
||||
// 2. We redefine all not type-safe wxList functions withtype-safe versions
|
||||
// which don't take any place (everything is inline), but bring compile
|
||||
// time error checking.
|
||||
|
||||
#define WX_DECLARE_LIST_2(T, name, nodetype) \
|
||||
typedef int (*wxSortFuncFor_##name)(const T *, const T *); \
|
||||
\
|
||||
class WXDLLEXPORT nodetype : public wxNodeBase \
|
||||
{ \
|
||||
public: \
|
||||
nodetype(wxListBase *list = (wxListBase *)NULL, \
|
||||
nodetype *previous = (nodetype *)NULL, \
|
||||
nodetype *next = (nodetype *)NULL, \
|
||||
T *data = NULL, \
|
||||
const wxListKey& key = wxListKey()) \
|
||||
: wxNodeBase(list, previous, next, data, key) { } \
|
||||
\
|
||||
nodetype *GetNext() const \
|
||||
{ return (nodetype *)wxNodeBase::GetNext(); } \
|
||||
nodetype *GetPrevious() const \
|
||||
{ return (nodetype *)wxNodeBase::GetPrevious(); } \
|
||||
\
|
||||
T *GetData() const \
|
||||
{ return (T *)wxNodeBase::GetData(); } \
|
||||
void SetData(T *data) \
|
||||
{ wxNodeBase::SetData(data); } \
|
||||
\
|
||||
virtual void DeleteData(); \
|
||||
}; \
|
||||
\
|
||||
class name : public wxListBase \
|
||||
{ \
|
||||
public: \
|
||||
name(wxKeyType keyType = wxKEY_NONE) : wxListBase(keyType) \
|
||||
{ } \
|
||||
name(size_t count, T *elements[]) \
|
||||
: wxListBase(count, (void **)elements) { } \
|
||||
\
|
||||
nodetype *GetFirst() const \
|
||||
{ return (nodetype *)wxListBase::GetFirst(); } \
|
||||
nodetype *GetLast() const \
|
||||
{ return (nodetype *)wxListBase::GetLast(); } \
|
||||
\
|
||||
nodetype *Item(size_t index) const \
|
||||
{ return (nodetype *)wxListBase::Item(index); } \
|
||||
\
|
||||
T *operator[](size_t index) const \
|
||||
{ \
|
||||
nodetype *node = Item(index); \
|
||||
return node ? node->GetData() : NULL; \
|
||||
} \
|
||||
\
|
||||
nodetype *Append(T *object) \
|
||||
{ return (nodetype *)wxListBase::Append(object); } \
|
||||
nodetype *Insert(T *object) \
|
||||
{ return (nodetype *)Insert(NULL, object); } \
|
||||
nodetype *Insert(nodetype *prev, T *object) \
|
||||
{ return (nodetype *)wxListBase::Insert(prev, object); } \
|
||||
\
|
||||
nodetype *Append(long key, void *object) \
|
||||
{ return (nodetype *)wxListBase::Append(key, object); } \
|
||||
nodetype *Append(const char *key, void *object) \
|
||||
{ return (nodetype *)wxListBase::Append(key, object); } \
|
||||
\
|
||||
nodetype *DetachNode(nodetype *node) \
|
||||
{ return (nodetype *)wxListBase::DetachNode(node); } \
|
||||
bool DeleteNode(nodetype *node) \
|
||||
{ return wxListBase::DeleteNode(node); } \
|
||||
bool DeleteObject(T *object) \
|
||||
{ return wxListBase::DeleteObject(object); } \
|
||||
\
|
||||
nodetype *Find(T *object) const \
|
||||
{ return (nodetype *)wxListBase::Find(object); } \
|
||||
\
|
||||
virtual nodetype *Find(const wxListKey& key) const \
|
||||
{ return (nodetype *)wxListBase::Find(key); } \
|
||||
\
|
||||
void Sort(wxSortFuncFor_##name func) \
|
||||
{ wxListBase::Sort((wxSortCompareFunction)func); } \
|
||||
\
|
||||
protected: \
|
||||
wxNodeBase *CreateNode(wxNodeBase *prev, wxNodeBase *next, \
|
||||
void *data, \
|
||||
const wxListKey& key = wxListKey()) \
|
||||
{ \
|
||||
return new nodetype(this, \
|
||||
(nodetype *)prev, (nodetype *)next, \
|
||||
(T *)data, key); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define WX_DECLARE_LIST(elementtype, listname) \
|
||||
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
|
||||
WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node)
|
||||
|
||||
// this macro must be inserted in your program after
|
||||
// #include <wx/listimpl.cpp>
|
||||
#define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!"
|
||||
|
||||
|
||||
// =============================================================================
|
||||
// now we can define classes 100% compatible with the old ones
|
||||
// =============================================================================
|
||||
|
||||
#ifdef wxLIST_COMPATIBILITY
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// wxList compatibility class: in fact, it's a list of wxObjects
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
WX_DECLARE_LIST_2(wxObject, wxObjectList, wxObjectListNode);
|
||||
|
||||
class WXDLLEXPORT wxList : public wxObjectList
|
||||
{
|
||||
public:
|
||||
wxList(int key_type = wxKEY_NONE) : wxObjectList((wxKeyType)key_type) { }
|
||||
|
||||
// compatibility methods
|
||||
int Number() const { return GetCount(); }
|
||||
wxNode *First() const { return (wxNode *)GetFirst(); }
|
||||
wxNode *Last() const { return (wxNode *)GetLast(); }
|
||||
wxNode *Nth(size_t index) const { return (wxNode *)Item(index); }
|
||||
wxNode *Member(wxObject *object) const { return (wxNode *)Find(object); }
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// wxStringList class for compatibility with the old code
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
WX_DECLARE_LIST_2(char, wxStringListBase, wxStringListNode);
|
||||
|
||||
class WXDLLEXPORT wxStringList : public wxStringListBase
|
||||
{
|
||||
public:
|
||||
// ctors and such
|
||||
// default
|
||||
wxStringList() { DeleteContents(TRUE); }
|
||||
wxStringList(const char *first ...);
|
||||
|
||||
// operations
|
||||
// makes a copy of the string
|
||||
wxNode *Add(const char *s)
|
||||
{ return (wxNode *)wxStringListBase::Append(copystring(s)); }
|
||||
|
||||
void Delete(const char *s)
|
||||
{ wxStringListBase::DeleteObject((char *)s); }
|
||||
|
||||
char **ListToArray(bool new_copies = FALSE) const;
|
||||
bool Member(const char *s) const;
|
||||
|
||||
// alphabetic sort
|
||||
void Sort();
|
||||
|
||||
// compatibility methods
|
||||
int Number() const { return GetCount(); }
|
||||
wxNode *First() const { return (wxNode *)GetFirst(); }
|
||||
wxNode *Last() const { return (wxNode *)GetLast(); }
|
||||
wxNode *Nth(size_t index) const { return (wxNode *)Item(index); }
|
||||
};
|
||||
|
||||
#endif // wxLIST_COMPATIBILITY
|
||||
|
||||
#endif
|
||||
// _WX_LISTH__
|
||||
|
@@ -1,111 +1,24 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: listimpl.cpp
|
||||
// Purpose: helper file for implementation of dynamic lists
|
||||
// Purpose: second-part of macro based implementation of template lists
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 16.10.97
|
||||
// Modified by:
|
||||
// Created: 16/11/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1997 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright: (c) 1998 Vadim Zeitlin
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*****************************************************************************
|
||||
* Purpose: implements methods of "template" class declared in DECLARE_LIST *
|
||||
* macro and which couldn't be implemented inline (because they *
|
||||
* need the full definition of type T in scope) *
|
||||
* *
|
||||
* Usage: 1) #include dynarray.h *
|
||||
* 2) WX_DECLARE_LIST *
|
||||
* 3) #include listimpl.cpp *
|
||||
* 4) WX_DEFINE_LIST *
|
||||
*****************************************************************************/
|
||||
|
||||
// macro implements remaining (not inline) methods of template list
|
||||
// (it's private to this file)
|
||||
#define _DEFINE_LIST(T, name) \
|
||||
name::~name() \
|
||||
{ \
|
||||
Empty(); \
|
||||
} \
|
||||
\
|
||||
void name::DoCopy(const name& src) \
|
||||
{ \
|
||||
for ( uint ui = 0; ui < src.Count(); ui++ ) \
|
||||
Add(src[ui]); \
|
||||
} \
|
||||
\
|
||||
name& name::operator=(const name& src) \
|
||||
{ \
|
||||
Empty(); \
|
||||
DoCopy(src); \
|
||||
\
|
||||
return *this; \
|
||||
} \
|
||||
\
|
||||
name::name(const name& src) \
|
||||
{ \
|
||||
DoCopy(src); \
|
||||
} \
|
||||
\
|
||||
void name::Empty() \
|
||||
{ \
|
||||
for ( uint ui = 0; ui < Count(); ui++ ) \
|
||||
delete (T*)BaseArray::Item(ui); \
|
||||
\
|
||||
BaseArray::Clear(); \
|
||||
} \
|
||||
\
|
||||
void name::Remove(uint uiIndex) \
|
||||
{ \
|
||||
wxCHECK( uiIndex < Count() ); \
|
||||
\
|
||||
delete (T*)BaseArray::Item(uiIndex); \
|
||||
\
|
||||
BaseArray::Remove(uiIndex); \
|
||||
} \
|
||||
\
|
||||
void name::Add(const T& item) \
|
||||
{ \
|
||||
T* pItem = new T(item); \
|
||||
if ( pItem != NULL ) \
|
||||
Add(pItem); \
|
||||
} \
|
||||
\
|
||||
void name::Insert(const T& item, uint uiIndex) \
|
||||
{ \
|
||||
T* pItem = new T(item); \
|
||||
if ( pItem != NULL ) \
|
||||
Insert(pItem, uiIndex); \
|
||||
} \
|
||||
\
|
||||
int name::Index(const T& Item, Bool bFromEnd) const \
|
||||
{ \
|
||||
if ( bFromEnd ) { \
|
||||
if ( Count() > 0 ) { \
|
||||
uint ui = Count() - 1; \
|
||||
do { \
|
||||
if ( (T*)BaseArray::Item(ui) == &Item ) \
|
||||
return ui; \
|
||||
ui--; \
|
||||
} \
|
||||
while ( ui != 0 ); \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
for( uint ui = 0; ui < Count(); ui++ ) { \
|
||||
if( (T*)BaseArray::Item(ui) == &Item ) \
|
||||
return ui; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
return NOT_FOUND; \
|
||||
}
|
||||
#define _DEFINE_LIST(T, name) \
|
||||
void wx##name##Node::DeleteData() \
|
||||
{ \
|
||||
delete (T *)GetData(); \
|
||||
}
|
||||
|
||||
// redefine the macro so that now it will generate the class implementation
|
||||
// old value would provoke a compile-time error if this file is not included
|
||||
#undef WX_DEFINE_LIST
|
||||
#define WX_DEFINE_LIST(name) _DEFINE_LIST(_L##name, name)
|
||||
#define WX_DEFINE_LIST(name) _DEFINE_LIST(_WX_LIST_ITEM_TYPE_##name, name)
|
||||
|
||||
// don't pollute preprocessor's name space
|
||||
#undef _DEFINE_LIST
|
||||
|
||||
//#undef _DEFINE_LIST
|
||||
|
@@ -54,7 +54,7 @@ public:
|
||||
// Window procedure
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual void MSWOnMouseMove(int x, int y, WXUINT flags);
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
|
@@ -418,8 +418,8 @@ class WXDLLEXPORT wxListCtrl: public wxControl
|
||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||
|
||||
// IMPLEMENTATION
|
||||
bool MSWCommand(WXUINT param, WXWORD id);
|
||||
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||
|
||||
// Recreate window - seems to be necessary when changing a style.
|
||||
void RecreateWindow(void);
|
||||
@@ -442,11 +442,9 @@ protected:
|
||||
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxListEvent: public wxCommandEvent
|
||||
class WXDLLEXPORT wxListEvent : public wxNotifyEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListEvent)
|
||||
|
||||
public:
|
||||
public:
|
||||
wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||
|
||||
int m_code;
|
||||
@@ -457,6 +455,8 @@ class WXDLLEXPORT wxListEvent: public wxCommandEvent
|
||||
wxPoint m_pointDrag;
|
||||
|
||||
wxListItem m_item;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxListEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
|
||||
|
@@ -44,12 +44,16 @@ WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages);
|
||||
// ----------------------------------------------------------------------------
|
||||
// notebook events
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxNotebookEvent : public wxCommandEvent
|
||||
class WXDLLEXPORT wxNotebookEvent : public wxNotifyEvent
|
||||
{
|
||||
public:
|
||||
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||
int nSel = -1, int nOldSel = -1)
|
||||
: wxCommandEvent(commandType, id) { m_nSel = nSel; m_nOldSel = nOldSel; }
|
||||
: wxNotifyEvent(commandType, id)
|
||||
{
|
||||
m_nSel = nSel;
|
||||
m_nOldSel = nOldSel;
|
||||
}
|
||||
|
||||
// accessors
|
||||
// the currently selected page (-1 if none)
|
||||
@@ -173,7 +177,7 @@ public:
|
||||
// base class virtuals
|
||||
// -------------------
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||
virtual void SetConstraintSizes(bool recurse = TRUE);
|
||||
virtual bool DoPhase(int nPhase);
|
||||
|
||||
|
@@ -91,6 +91,10 @@ public:
|
||||
virtual bool DeleteAll();
|
||||
|
||||
private:
|
||||
// no copy ctor/assignment operator
|
||||
wxRegConfig(const wxRegConfig&);
|
||||
wxRegConfig& operator=(const wxRegConfig&);
|
||||
|
||||
// these keys are opened during all lifetime of wxRegConfig object
|
||||
wxRegKey m_keyLocalRoot, m_keyLocal,
|
||||
m_keyGlobalRoot, m_keyGlobal;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SETUP_H_
|
||||
@@ -44,23 +44,23 @@
|
||||
#define wxUSE_HELP 1
|
||||
// 0 for no help facility
|
||||
#define wxUSE_RESOURCES 1
|
||||
// 0 for no wxGetResource/wxWriteResource
|
||||
// 0 for no wxGetResource/wxWriteResource
|
||||
#define wxUSE_CONSTRAINTS 1
|
||||
// 0 for no window layout constraint system
|
||||
|
||||
|
||||
#define wxUSE_TIMEDATE 1
|
||||
// 0 for no wxTime/wxDate classes
|
||||
|
||||
|
||||
#define wxUSE_CLIPBOARD 1
|
||||
// 0 for no clipboard functions
|
||||
// 0 for no clipboard functions
|
||||
#define wxUSE_SPLINES 1
|
||||
// 0 for no splines
|
||||
// 0 for no splines
|
||||
#define wxUSE_XFIG_SPLINE_CODE 1
|
||||
// 1 for XFIG spline code, 0 for AIAI spline code.
|
||||
// 1 for XFIG spline code, 0 for AIAI spline code.
|
||||
// AIAI spline code is slower, but freer of copyright issues.
|
||||
|
||||
#define wxUSE_DRAG_AND_DROP 1
|
||||
// 0 for no drag and drop
|
||||
// 0 for no drag and drop
|
||||
|
||||
#define wxUSE_TOOLBAR 1
|
||||
// Define 1 to use toolbar classes
|
||||
@@ -79,7 +79,7 @@
|
||||
#define wxUSE_SCROLLBAR 1
|
||||
// Define 1 to compile contributed wxScrollBar class
|
||||
#define wxUSE_XPM_IN_X 1
|
||||
#define wxUSE_XPM_IN_MSW 0
|
||||
#define wxUSE_XPM_IN_MSW 1
|
||||
// Define 1 to support the XPM package in wxBitmap,
|
||||
// separated by platform. If 1, you must link in
|
||||
// the XPM library to your applications.
|
||||
@@ -103,7 +103,7 @@
|
||||
// symbol if 1?
|
||||
|
||||
#define HAVE_SOCKET 1
|
||||
// Use WinSock if 1
|
||||
// Use WinSock if 1
|
||||
#define wxUSE_DOC_VIEW_ARCHITECTURE 1
|
||||
// Set to 0 to disable document/view architecture
|
||||
#define wxUSE_PRINTING_ARCHITECTURE 1
|
||||
@@ -114,12 +114,12 @@
|
||||
#define wxUSE_DYNAMIC_CLASSES 1
|
||||
// If 1, enables provision of run-time type information.
|
||||
// NOW MANDATORY: don't change.
|
||||
#define wxUSE_MEMORY_TRACING 1
|
||||
#define wxUSE_MEMORY_TRACING 0
|
||||
// If 1, enables debugging versions of wxObject::new and
|
||||
// wxObject::delete *IF* __WXDEBUG__ is also defined.
|
||||
// WARNING: this code may not work with all architectures, especially
|
||||
// if alignment is an issue.
|
||||
#define wxUSE_DEBUG_CONTEXT 1
|
||||
#define wxUSE_DEBUG_CONTEXT 0
|
||||
// If 1, enables wxDebugContext, for
|
||||
// writing error messages to file, etc.
|
||||
// If __WXDEBUG__ is not defined, will still use
|
||||
@@ -128,7 +128,7 @@
|
||||
// since you may well need to output
|
||||
// an error log in a production
|
||||
// version (or non-debugging beta)
|
||||
#define wxUSE_GLOBAL_MEMORY_OPERATORS 1
|
||||
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
|
||||
// In debug mode, cause new and delete to be redefined globally.
|
||||
// If this causes problems (e.g. link errors), set this to 0.
|
||||
|
||||
@@ -162,10 +162,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define wxUSE_APPLE_IEEE 1
|
||||
// if enabled, the float codec written by Apple
|
||||
// will be used to write, in a portable way,
|
||||
// float on the disk
|
||||
#define wxUSE_APPLE_IEEE 1
|
||||
// if enabled, the float codec written by Apple
|
||||
// will be used to write, in a portable way,
|
||||
// float on the disk
|
||||
|
||||
/*
|
||||
* MS Windows/Windows NT
|
||||
@@ -218,9 +218,9 @@
|
||||
|
||||
#define wxUSE_TYPEDEFS 0
|
||||
// Use typedefs not classes for wxPoint
|
||||
// and others, to reduce overhead and avoid
|
||||
// MS C7 memory bug. Bounds checker
|
||||
// complains about deallocating
|
||||
// and others, to reduce overhead and avoid
|
||||
// MS C7 memory bug. Bounds checker
|
||||
// complains about deallocating
|
||||
// arrays of wxPoints if wxPoint is a class.
|
||||
|
||||
#if (!defined(WIN32) && !defined(__WIN32__)) || defined(__GNUWIN32__) || defined(__BORLANDC__)
|
||||
|
@@ -67,10 +67,10 @@ class WXDLLEXPORT wxSpinButton: public wxControl
|
||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||
|
||||
// IMPLEMENTATION
|
||||
bool MSWCommand(WXUINT param, WXWORD id);
|
||||
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
||||
void MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control);
|
||||
void MSWOnHScroll(WXWORD wParam, WXWORD pos, WXHWND control);
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||
virtual void MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control);
|
||||
virtual void MSWOnHScroll(WXWORD wParam, WXWORD pos, WXHWND control);
|
||||
|
||||
protected:
|
||||
int m_min;
|
||||
|
@@ -122,8 +122,9 @@ class WXDLLEXPORT wxTabCtrl: public wxControl
|
||||
void OnKillFocus(wxFocusEvent& event) { Default() ; }
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
bool MSWCommand(WXUINT param, WXWORD id);
|
||||
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
@@ -81,8 +81,8 @@ class WXDLLEXPORT wxToolBar95: public wxToolBarBase
|
||||
bool Realize() { return CreateTools(); };
|
||||
|
||||
// IMPLEMENTATION
|
||||
bool MSWCommand(WXUINT param, WXWORD id);
|
||||
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
@@ -410,8 +410,8 @@ public:
|
||||
// implementation
|
||||
// --------------
|
||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||
bool MSWCommand(WXUINT param, WXWORD id);
|
||||
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||
|
||||
protected:
|
||||
// SetImageList helper
|
||||
@@ -448,7 +448,7 @@ private:
|
||||
// NB: note that not all accessors make sense for all events, see the event
|
||||
// descriptions below
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxTreeEvent : public wxCommandEvent
|
||||
class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent
|
||||
{
|
||||
friend wxTreeCtrl;
|
||||
public:
|
||||
@@ -470,10 +470,6 @@ public:
|
||||
// keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only)
|
||||
int GetCode() const { return m_code; }
|
||||
|
||||
// set return code for wxEVT_COMMAND_TREE_ITEM_{EXPAND|COLLAPS}ING events
|
||||
// call this to forbid the change in item status
|
||||
void Veto() { m_code = TRUE; }
|
||||
|
||||
private:
|
||||
// @@ we could save some space by using union here
|
||||
int m_code;
|
||||
|
@@ -81,7 +81,7 @@ WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
|
||||
WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize;
|
||||
WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition;
|
||||
|
||||
class WXDLLEXPORT wxWindow: public wxEvtHandler
|
||||
class WXDLLEXPORT wxWindow : public wxEvtHandler
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxWindow)
|
||||
|
||||
@@ -89,18 +89,17 @@ class WXDLLEXPORT wxWindow: public wxEvtHandler
|
||||
friend class wxPaintDC;
|
||||
|
||||
public:
|
||||
wxWindow(void);
|
||||
inline wxWindow(wxWindow *parent, wxWindowID id,
|
||||
wxWindow();
|
||||
wxWindow(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{
|
||||
m_children = new wxList;
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
virtual ~wxWindow(void);
|
||||
virtual ~wxWindow();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@@ -109,25 +108,25 @@ public:
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
// Fit the window around the items
|
||||
virtual void Fit(void);
|
||||
virtual void Fit();
|
||||
|
||||
// Show or hide the window
|
||||
virtual bool Show(bool show);
|
||||
|
||||
// Is the window shown?
|
||||
virtual bool IsShown(void) const;
|
||||
virtual bool IsShown() const;
|
||||
|
||||
// Raise the window to the top of the Z order
|
||||
virtual void Raise(void);
|
||||
virtual void Raise();
|
||||
|
||||
// Lower the window to the bottom of the Z order
|
||||
virtual void Lower(void);
|
||||
virtual void Lower();
|
||||
|
||||
// Is the window enabled?
|
||||
virtual bool IsEnabled(void) const;
|
||||
virtual bool IsEnabled() const;
|
||||
|
||||
// For compatibility
|
||||
inline bool Enabled(void) const { return IsEnabled(); }
|
||||
inline bool Enabled() const { return IsEnabled(); }
|
||||
|
||||
// Dialog support: override these and call
|
||||
// base class members to add functionality
|
||||
@@ -135,30 +134,30 @@ public:
|
||||
|
||||
// Transfer values to controls. If returns FALSE,
|
||||
// it's an application error (pops up a dialog)
|
||||
virtual bool TransferDataToWindow(void);
|
||||
virtual bool TransferDataToWindow();
|
||||
|
||||
// Transfer values from controls. If returns FALSE,
|
||||
// transfer failed: don't quit
|
||||
virtual bool TransferDataFromWindow(void);
|
||||
virtual bool TransferDataFromWindow();
|
||||
|
||||
// Validate controls. If returns FALSE,
|
||||
// validation failed: don't quit
|
||||
virtual bool Validate(void);
|
||||
virtual bool Validate();
|
||||
|
||||
// Return code for dialogs
|
||||
inline void SetReturnCode(int retCode);
|
||||
inline int GetReturnCode(void);
|
||||
inline int GetReturnCode();
|
||||
|
||||
// Set the cursor
|
||||
virtual void SetCursor(const wxCursor& cursor);
|
||||
inline virtual wxCursor *GetCursor(void) const { return (wxCursor *)& m_windowCursor; };
|
||||
inline virtual wxCursor *GetCursor() const { return (wxCursor *)& m_windowCursor; };
|
||||
|
||||
// Get the window with the focus
|
||||
static wxWindow *FindFocus(void);
|
||||
static wxWindow *FindFocus();
|
||||
|
||||
// Get character size
|
||||
virtual int GetCharHeight(void) const;
|
||||
virtual int GetCharWidth(void) const;
|
||||
virtual int GetCharHeight() const;
|
||||
virtual int GetCharWidth() const;
|
||||
|
||||
// Get overall window size
|
||||
virtual void GetSize(int *width, int *height) const;
|
||||
@@ -184,11 +183,11 @@ public:
|
||||
virtual void ScreenToClient(int *x, int *y) const;
|
||||
|
||||
// Set the focus to this window
|
||||
virtual void SetFocus(void);
|
||||
virtual void SetFocus();
|
||||
|
||||
// Capture/release mouse
|
||||
virtual void CaptureMouse(void);
|
||||
virtual void ReleaseMouse(void);
|
||||
virtual void CaptureMouse();
|
||||
virtual void ReleaseMouse();
|
||||
|
||||
// Enable or disable the window
|
||||
virtual void Enable(bool enable);
|
||||
@@ -211,13 +210,13 @@ public:
|
||||
|
||||
// Set/get the window title
|
||||
virtual inline void SetTitle(const wxString& WXUNUSED(title)) {};
|
||||
inline virtual wxString GetTitle(void) const { return wxString(""); };
|
||||
inline virtual wxString GetTitle() const { return wxString(""); };
|
||||
// Most windows have the concept of a label; for frames, this is the
|
||||
// title; for items, this is the label or button text.
|
||||
inline virtual wxString GetLabel(void) const { return GetTitle(); }
|
||||
inline virtual wxString GetLabel() const { return GetTitle(); }
|
||||
|
||||
// Set/get the window name (used for resource setting in X)
|
||||
inline virtual wxString GetName(void) const;
|
||||
inline virtual wxString GetName() const;
|
||||
inline virtual void SetName(const wxString& name);
|
||||
|
||||
// Centre the window
|
||||
@@ -252,7 +251,7 @@ public:
|
||||
// Caret manipulation
|
||||
virtual void CreateCaret(int w, int h);
|
||||
virtual void CreateCaret(const wxBitmap *bitmap);
|
||||
virtual void DestroyCaret(void);
|
||||
virtual void DestroyCaret();
|
||||
virtual void ShowCaret(bool show);
|
||||
virtual void SetCaretPos(int x, int y);
|
||||
virtual void GetCaretPos(int *x, int *y) const;
|
||||
@@ -268,31 +267,31 @@ public:
|
||||
virtual void MakeModal(bool modal);
|
||||
|
||||
// Get the private handle (platform-dependent)
|
||||
inline void *GetHandle(void) const;
|
||||
inline void *GetHandle() const;
|
||||
|
||||
// Set/get the window's relatives
|
||||
inline wxWindow *GetParent(void) const;
|
||||
inline wxWindow *GetParent() const;
|
||||
inline void SetParent(wxWindow *p) ;
|
||||
inline wxWindow *GetGrandParent(void) const;
|
||||
inline wxWindow *GetGrandParent() const;
|
||||
inline wxList *GetChildren() const;
|
||||
|
||||
// Set/get the window's font
|
||||
virtual void SetFont(const wxFont& f);
|
||||
inline virtual wxFont *GetFont(void) const;
|
||||
inline virtual wxFont *GetFont() const;
|
||||
|
||||
// Set/get the window's validator
|
||||
void SetValidator(const wxValidator& validator);
|
||||
inline wxValidator *GetValidator(void) const;
|
||||
inline wxValidator *GetValidator() const;
|
||||
|
||||
// Set/get the window's style
|
||||
inline void SetWindowStyleFlag(long flag);
|
||||
inline long GetWindowStyleFlag(void) const;
|
||||
inline long GetWindowStyleFlag() const;
|
||||
|
||||
// Set/get double-clickability
|
||||
// TODO: we probably wish to get rid of this, and
|
||||
// always allow double clicks.
|
||||
inline void SetDoubleClick(bool flag);
|
||||
inline bool GetDoubleClick(void) const;
|
||||
inline bool GetDoubleClick() const;
|
||||
inline void AllowDoubleClick(bool value) { SetDoubleClick(value); }
|
||||
|
||||
// Handle a control command
|
||||
@@ -300,7 +299,7 @@ public:
|
||||
|
||||
// Set/get event handler
|
||||
inline void SetEventHandler(wxEvtHandler *handler);
|
||||
inline wxEvtHandler *GetEventHandler(void) const;
|
||||
inline wxEvtHandler *GetEventHandler() const;
|
||||
|
||||
// Push/pop event handler (i.e. allow a chain of event handlers
|
||||
// be searched)
|
||||
@@ -311,33 +310,33 @@ public:
|
||||
virtual bool Close(bool force = FALSE);
|
||||
|
||||
// Destroy the window (delayed, if a managed window)
|
||||
virtual bool Destroy(void) ;
|
||||
virtual bool Destroy() ;
|
||||
|
||||
// Mode for telling default OnSize members to
|
||||
// call Layout(), if not using Sizers, just top-down constraints
|
||||
inline void SetAutoLayout(bool a);
|
||||
inline bool GetAutoLayout(void) const;
|
||||
inline bool GetAutoLayout() const;
|
||||
|
||||
// Set/get constraints
|
||||
inline wxLayoutConstraints *GetConstraints(void) const;
|
||||
inline wxLayoutConstraints *GetConstraints() const;
|
||||
void SetConstraints(wxLayoutConstraints *c);
|
||||
|
||||
// Set/get window background colour
|
||||
inline virtual void SetBackgroundColour(const wxColour& col);
|
||||
inline virtual wxColour GetBackgroundColour(void) const;
|
||||
inline virtual wxColour GetBackgroundColour() const;
|
||||
|
||||
// Set/get window foreground colour
|
||||
inline virtual void SetForegroundColour(const wxColour& col);
|
||||
inline virtual wxColour GetForegroundColour(void) const;
|
||||
inline virtual wxColour GetForegroundColour() const;
|
||||
|
||||
// For backward compatibility
|
||||
inline virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||
inline virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
|
||||
inline virtual wxFont *GetLabelFont(void) const { return GetFont(); };
|
||||
inline virtual wxFont *GetButtonFont(void) const { return GetFont(); };
|
||||
inline virtual wxFont *GetLabelFont() const { return GetFont(); };
|
||||
inline virtual wxFont *GetButtonFont() const { return GetFont(); };
|
||||
|
||||
// Get the default button, if there is one
|
||||
inline virtual wxButton *GetDefaultItem(void) const;
|
||||
inline virtual wxButton *GetDefaultItem() const;
|
||||
inline virtual void SetDefaultItem(wxButton *but);
|
||||
|
||||
virtual void SetAcceleratorTable(const wxAcceleratorTable& accel);
|
||||
@@ -365,27 +364,27 @@ public:
|
||||
const wxFont *theFont = NULL, bool use16 = FALSE) const;
|
||||
|
||||
// Is the window retained?
|
||||
inline bool IsRetained(void) const;
|
||||
inline bool IsRetained() const;
|
||||
|
||||
// Warp the pointer the given position
|
||||
virtual void WarpPointer(int x_pos, int y_pos) ;
|
||||
|
||||
// Clear the window
|
||||
virtual void Clear(void);
|
||||
virtual void Clear();
|
||||
|
||||
// Find a window by id or name
|
||||
virtual wxWindow *FindWindow(long id);
|
||||
virtual wxWindow *FindWindow(const wxString& name);
|
||||
|
||||
// Constraint operations
|
||||
bool Layout(void);
|
||||
bool Layout();
|
||||
void SetSizer(wxSizer *sizer); // Adds sizer child to this window
|
||||
inline wxSizer *GetSizer(void) const ;
|
||||
inline wxWindow *GetSizerParent(void) const ;
|
||||
inline wxSizer *GetSizer() const ;
|
||||
inline wxWindow *GetSizerParent() const ;
|
||||
inline void SetSizerParent(wxWindow *win);
|
||||
|
||||
// Do Update UI processing for controls
|
||||
void UpdateWindowUI(void);
|
||||
void UpdateWindowUI();
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
@@ -410,15 +409,18 @@ public:
|
||||
|
||||
// Windows subclassing
|
||||
void SubclassWin(WXHWND hWnd);
|
||||
void UnsubclassWin(void);
|
||||
virtual long Default(void);
|
||||
void UnsubclassWin();
|
||||
virtual long Default();
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
// returns TRUE if the event was processed
|
||||
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||
|
||||
virtual wxWindow *FindItem(int id) const;
|
||||
virtual wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const ;
|
||||
virtual void PreDelete(WXHDC dc); // Allows system cleanup
|
||||
// TO DO: how many of these need to be virtual?
|
||||
virtual WXHWND GetHWND(void) const ;
|
||||
virtual WXHWND GetHWND() const ;
|
||||
virtual void SetHWND(WXHWND hWnd);
|
||||
|
||||
// Make a Windows extended style from the given wxWindows window style
|
||||
@@ -429,23 +431,23 @@ public:
|
||||
virtual void AddChild(wxWindow *child); // Adds reference to the child object
|
||||
virtual void RemoveChild(wxWindow *child); // Removes reference to child
|
||||
// (but doesn't delete the child object)
|
||||
virtual void DestroyChildren(void); // Removes and destroys all children
|
||||
virtual void DestroyChildren(); // Removes and destroys all children
|
||||
|
||||
inline bool IsBeingDeleted(void);
|
||||
inline bool IsBeingDeleted();
|
||||
|
||||
// MSW only: TRUE if this control is part of the main control
|
||||
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
||||
|
||||
// Constraint implementation
|
||||
void UnsetConstraints(wxLayoutConstraints *c);
|
||||
inline wxList *GetConstraintsInvolvedIn(void) const ;
|
||||
inline wxList *GetConstraintsInvolvedIn() const ;
|
||||
// Back-pointer to other windows we're involved with, so if we delete
|
||||
// this window, we must delete any constraints we're involved with.
|
||||
void AddConstraintReference(wxWindow *otherWin);
|
||||
void RemoveConstraintReference(wxWindow *otherWin);
|
||||
void DeleteRelatedConstraints(void);
|
||||
void DeleteRelatedConstraints();
|
||||
|
||||
virtual void ResetConstraints(void);
|
||||
virtual void ResetConstraints();
|
||||
virtual void SetConstraintSizes(bool recurse = TRUE);
|
||||
virtual bool LayoutPhase1(int *noChanges);
|
||||
virtual bool LayoutPhase2(int *noChanges);
|
||||
@@ -487,25 +489,25 @@ public:
|
||||
virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
|
||||
|
||||
// Make sure the window style reflects the HWND style (roughly)
|
||||
virtual void AdoptAttributesFromHWND(void);
|
||||
virtual void AdoptAttributesFromHWND();
|
||||
|
||||
// Setup background and foreground colours correctly
|
||||
virtual void SetupColours(void);
|
||||
virtual void SetupColours();
|
||||
|
||||
// Saves the last message information before calling base version
|
||||
virtual bool ProcessEvent(wxEvent& event);
|
||||
|
||||
// Handlers
|
||||
virtual void MSWOnCreate(WXLPCREATESTRUCT cs);
|
||||
virtual bool MSWOnPaint(void);
|
||||
virtual WXHICON MSWOnQueryDragIcon(void) { return 0; }
|
||||
virtual bool MSWOnPaint();
|
||||
virtual WXHICON MSWOnQueryDragIcon() { return 0; }
|
||||
virtual void MSWOnSize(int x, int y, WXUINT flag);
|
||||
virtual void MSWOnWindowPosChanging(void *lpPos);
|
||||
virtual void MSWOnHScroll(WXWORD nSBCode, WXWORD pos, WXHWND control);
|
||||
virtual void MSWOnVScroll(WXWORD nSBCode, WXWORD pos, WXHWND control);
|
||||
virtual bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
||||
virtual long MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual long MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual WXHBRUSH MSWOnCtlColor(WXHDC dc, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWOnColorChange(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
@@ -514,11 +516,11 @@ public:
|
||||
virtual bool MSWOnEraseBkgnd(WXHDC pDC);
|
||||
virtual void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
|
||||
virtual void MSWOnInitMenuPopup(WXHMENU menu, int pos, bool isSystem);
|
||||
virtual bool MSWOnClose(void);
|
||||
virtual bool MSWOnClose();
|
||||
// Return TRUE to end session, FALSE to veto end session.
|
||||
virtual bool MSWOnQueryEndSession(long logOff);
|
||||
virtual bool MSWOnEndSession(bool endSession, long logOff);
|
||||
virtual bool MSWOnDestroy(void);
|
||||
virtual bool MSWOnDestroy();
|
||||
virtual bool MSWOnSetFocus(WXHWND wnd);
|
||||
virtual bool MSWOnKillFocus(WXHWND wnd);
|
||||
virtual void MSWOnDropFiles(WXWPARAM wParam);
|
||||
@@ -565,10 +567,10 @@ public:
|
||||
virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWProcessMessage(WXMSG* pMsg);
|
||||
virtual bool MSWTranslateMessage(WXMSG* pMsg);
|
||||
virtual void MSWDestroyWindow(void);
|
||||
virtual void MSWDestroyWindow();
|
||||
|
||||
// Detach "Window" menu from menu bar so it doesn't get deleted
|
||||
void MSWDetachWindowMenu(void);
|
||||
void MSWDetachWindowMenu();
|
||||
|
||||
inline WXFARPROC MSWGetOldWndProc() const;
|
||||
inline void MSWSetOldWndProc(WXFARPROC proc);
|
||||
@@ -578,9 +580,9 @@ public:
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
inline void SetShowing(bool show);
|
||||
inline bool IsUserEnabled(void) const;
|
||||
inline bool GetUseCtl3D(void) const ;
|
||||
inline bool GetTransparentBackground(void) const ;
|
||||
inline bool IsUserEnabled() const;
|
||||
inline bool GetUseCtl3D() const ;
|
||||
inline bool GetTransparentBackground() const ;
|
||||
|
||||
// Responds to colour changes: passes event on to children.
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
@@ -590,7 +592,7 @@ public:
|
||||
|
||||
// Sends an OnInitDialog event, which in turns transfers data to
|
||||
// to the window via validators.
|
||||
virtual void InitDialog(void);
|
||||
virtual void InitDialog();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//// PROTECTED DATA
|
||||
@@ -678,57 +680,61 @@ public:
|
||||
bool m_isBeingDeleted; // Fudge because can't access parent
|
||||
// when being deleted
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//// INLINES
|
||||
|
||||
inline void *wxWindow::GetHandle(void) const { return (void *)GetHWND(); }
|
||||
inline void *wxWindow::GetHandle() const { return (void *)GetHWND(); }
|
||||
inline int wxWindow::GetId() const { return m_windowId; }
|
||||
inline void wxWindow::SetId(int id) { m_windowId = id; }
|
||||
inline wxWindow *wxWindow::GetParent(void) const { return m_windowParent; }
|
||||
inline wxWindow *wxWindow::GetParent() const { return m_windowParent; }
|
||||
inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; }
|
||||
inline wxWindow *wxWindow::GetGrandParent(void) const { return (m_windowParent ? m_windowParent->m_windowParent : NULL); }
|
||||
inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : NULL); }
|
||||
inline wxList *wxWindow::GetChildren() const { return m_children; }
|
||||
inline wxFont *wxWindow::GetFont(void) const { return (wxFont *) & m_windowFont; }
|
||||
inline wxString wxWindow::GetName(void) const { return m_windowName; }
|
||||
inline wxFont *wxWindow::GetFont() const { return (wxFont *) & m_windowFont; }
|
||||
inline wxString wxWindow::GetName() const { return m_windowName; }
|
||||
inline void wxWindow::SetName(const wxString& name) { m_windowName = name; }
|
||||
inline long wxWindow::GetWindowStyleFlag(void) const { return m_windowStyle; }
|
||||
inline long wxWindow::GetWindowStyleFlag() const { return m_windowStyle; }
|
||||
inline void wxWindow::SetWindowStyleFlag(long flag) { m_windowStyle = flag; }
|
||||
inline void wxWindow::SetDoubleClick(bool flag) { m_doubleClickAllowed = flag; }
|
||||
inline bool wxWindow::GetDoubleClick(void) const { return m_doubleClickAllowed; }
|
||||
inline bool wxWindow::GetDoubleClick() const { return m_doubleClickAllowed; }
|
||||
inline void wxWindow::SetEventHandler(wxEvtHandler *handler) { m_windowEventHandler = handler; }
|
||||
inline wxEvtHandler *wxWindow::GetEventHandler(void) const { return m_windowEventHandler; }
|
||||
inline wxEvtHandler *wxWindow::GetEventHandler() const { return m_windowEventHandler; }
|
||||
inline void wxWindow::SetAutoLayout(bool a) { m_autoLayout = a; }
|
||||
inline bool wxWindow::GetAutoLayout(void) const { return m_autoLayout; }
|
||||
inline wxLayoutConstraints *wxWindow::GetConstraints(void) const { return m_constraints; }
|
||||
inline bool wxWindow::GetAutoLayout() const { return m_autoLayout; }
|
||||
inline wxLayoutConstraints *wxWindow::GetConstraints() const { return m_constraints; }
|
||||
inline void wxWindow::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; };
|
||||
inline wxColour wxWindow::GetBackgroundColour(void) const { return m_backgroundColour; };
|
||||
inline wxColour wxWindow::GetBackgroundColour() const { return m_backgroundColour; };
|
||||
inline void wxWindow::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; };
|
||||
inline wxColour wxWindow::GetForegroundColour(void) const { return m_foregroundColour; };
|
||||
inline wxColour wxWindow::GetForegroundColour() const { return m_foregroundColour; };
|
||||
|
||||
inline wxButton *wxWindow::GetDefaultItem(void) const { return m_defaultItem; }
|
||||
inline wxButton *wxWindow::GetDefaultItem() const { return m_defaultItem; }
|
||||
inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; }
|
||||
inline bool wxWindow::IsRetained(void) const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); }
|
||||
inline bool wxWindow::IsRetained() const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); }
|
||||
|
||||
inline void wxWindow::SetShowing(bool show) { m_isShown = show; }
|
||||
inline wxList *wxWindow::GetConstraintsInvolvedIn(void) const { return m_constraintsInvolvedIn; }
|
||||
inline wxSizer *wxWindow::GetSizer(void) const { return m_windowSizer; }
|
||||
inline wxWindow *wxWindow::GetSizerParent(void) const { return m_sizerParent; }
|
||||
inline wxList *wxWindow::GetConstraintsInvolvedIn() const { return m_constraintsInvolvedIn; }
|
||||
inline wxSizer *wxWindow::GetSizer() const { return m_windowSizer; }
|
||||
inline wxWindow *wxWindow::GetSizerParent() const { return m_sizerParent; }
|
||||
inline void wxWindow::SetSizerParent(wxWindow *win) { m_sizerParent = win; }
|
||||
inline WXFARPROC wxWindow::MSWGetOldWndProc() const { return m_oldWndProc; }
|
||||
inline void wxWindow::MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
|
||||
inline wxValidator *wxWindow::GetValidator(void) const { return m_windowValidator; }
|
||||
inline bool wxWindow::IsUserEnabled(void) const { return m_winEnabled; }
|
||||
inline bool wxWindow::GetUseCtl3D(void) const { return m_useCtl3D; }
|
||||
inline bool wxWindow::GetTransparentBackground(void) const { return m_backgroundTransparent; }
|
||||
inline wxValidator *wxWindow::GetValidator() const { return m_windowValidator; }
|
||||
inline bool wxWindow::IsUserEnabled() const { return m_winEnabled; }
|
||||
inline bool wxWindow::GetUseCtl3D() const { return m_useCtl3D; }
|
||||
inline bool wxWindow::GetTransparentBackground() const { return m_backgroundTransparent; }
|
||||
inline void wxWindow::SetReturnCode(int retCode) { m_returnCode = retCode; }
|
||||
inline int wxWindow::GetReturnCode(void) { return m_returnCode; }
|
||||
inline bool wxWindow::IsBeingDeleted(void) { return m_isBeingDeleted; }
|
||||
inline int wxWindow::GetReturnCode() { return m_returnCode; }
|
||||
inline bool wxWindow::IsBeingDeleted() { return m_isBeingDeleted; }
|
||||
|
||||
// Window specific (so far)
|
||||
WXDLLEXPORT wxWindow* wxGetActiveWindow(void);
|
||||
WXDLLEXPORT wxWindow* wxGetActiveWindow();
|
||||
|
||||
WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows;
|
||||
|
||||
@@ -736,7 +742,7 @@ WXDLLEXPORT int wxCharCodeMSWToWX(int keySym);
|
||||
WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
|
||||
|
||||
// Allocates control ids
|
||||
WXDLLEXPORT int NewControlId(void);
|
||||
WXDLLEXPORT int NewControlId();
|
||||
|
||||
#endif
|
||||
// _WX_WINDOW_H_
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// Created: ??/??/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) AUTHOR
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COLOUR_H_
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
*/
|
||||
|
||||
private:
|
||||
bool m_isInit;
|
||||
bool m_isInit;
|
||||
unsigned char m_red;
|
||||
unsigned char m_blue;
|
||||
unsigned char m_green;
|
||||
@@ -92,4 +92,4 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_COLOUR_H_
|
||||
// _WX_COLOUR_H_
|
||||
|
Reference in New Issue
Block a user