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
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Eliminate double/float warnings
|
// suppress some Visual C++ warnings
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# pragma warning(disable:4244)
|
# pragma warning(disable:4244) // cobversion from double to float
|
||||||
|
# pragma warning(disable:4100) // unreferenced formal parameter
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@@ -368,8 +368,8 @@ private: \
|
|||||||
|
|
||||||
@memo declare list class 'name' containing elements of type 'T'
|
@memo declare list class 'name' containing elements of type 'T'
|
||||||
*/
|
*/
|
||||||
#define WX_DECLARE_LIST(T, name) typedef T _L##name; \
|
#define WX_DECLARE_OBJARRAY(T, name) typedef T _L##name; \
|
||||||
_WX_DECLARE_LIST(_L##name, name)
|
_WX_DECLARE_LIST(_L##name, name)
|
||||||
/**
|
/**
|
||||||
To use a list class you must
|
To use a list class you must
|
||||||
<ll>
|
<ll>
|
||||||
@@ -387,7 +387,7 @@ private: \
|
|||||||
|
|
||||||
@memo define (must include listimpl.cpp!) list class 'name'
|
@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
|
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
|
// Scroll event class
|
||||||
/*
|
/*
|
||||||
wxEVT_SCROLL_TOP
|
wxEVT_SCROLL_TOP
|
||||||
|
@@ -169,6 +169,10 @@ public:
|
|||||||
~wxTempFile();
|
~wxTempFile();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// no copy ctor/assignment operator
|
||||||
|
wxTempFile(const wxTempFile&);
|
||||||
|
wxTempFile& operator=(const wxTempFile&);
|
||||||
|
|
||||||
wxString m_strName, // name of the file to replace in Commit()
|
wxString m_strName, // name of the file to replace in Commit()
|
||||||
m_strTemp; // temporary file name
|
m_strTemp; // temporary file name
|
||||||
wxFile m_file; // the temporary file
|
wxFile m_file; // the temporary file
|
||||||
|
@@ -353,11 +353,13 @@ extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor);
|
|||||||
|
|
||||||
class WXDLLEXPORT wxResourceCache: public wxList
|
class WXDLLEXPORT wxResourceCache: public wxList
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxResourceCache)
|
public:
|
||||||
public:
|
wxResourceCache() { }
|
||||||
wxResourceCache();
|
wxResourceCache(const unsigned int keyType) : wxList(keyType) { }
|
||||||
wxResourceCache(const unsigned int the_key_type);
|
~wxResourceCache();
|
||||||
~wxResourceCache();
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxResourceCache)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -37,13 +37,27 @@ class wxNotebookEvent : public wxCommandEvent
|
|||||||
public:
|
public:
|
||||||
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||||
int nSel = -1, int nOldSel = -1)
|
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
|
// accessors
|
||||||
int GetSelection() const { return m_nSel; }
|
int GetSelection() const { return m_nSel; }
|
||||||
int GetOldSelection() const { return m_nOldSel; }
|
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:
|
private:
|
||||||
|
bool m_bAllow;
|
||||||
|
|
||||||
int m_nSel, // currently selected page
|
int m_nSel, // currently selected page
|
||||||
m_nOldSel; // previously selected page
|
m_nOldSel; // previously selected page
|
||||||
|
|
||||||
|
@@ -37,13 +37,27 @@ class wxNotebookEvent : public wxCommandEvent
|
|||||||
public:
|
public:
|
||||||
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||||
int nSel = -1, int nOldSel = -1)
|
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
|
// accessors
|
||||||
int GetSelection() const { return m_nSel; }
|
int GetSelection() const { return m_nSel; }
|
||||||
int GetOldSelection() const { return m_nOldSel; }
|
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:
|
private:
|
||||||
|
bool m_bAllow;
|
||||||
|
|
||||||
int m_nSel, // currently selected page
|
int m_nSel, // currently selected page
|
||||||
m_nOldSel; // previously selected page
|
m_nOldSel; // previously selected page
|
||||||
|
|
||||||
|
@@ -2,13 +2,26 @@
|
|||||||
// Name: list.h
|
// Name: list.h
|
||||||
// Purpose: wxList, wxStringList classes
|
// Purpose: wxList, wxStringList classes
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Modified by: VZ at 16/11/98: WX_DECLARE_LIST() and typesafe lists added
|
||||||
// Created: 29/01/98
|
// Created: 29/01/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Julian Smart
|
// Copyright: (c) 1998 Julian Smart
|
||||||
// Licence: wxWindows license
|
// 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__
|
#ifndef _WX_LISTH__
|
||||||
#define _WX_LISTH__
|
#define _WX_LISTH__
|
||||||
|
|
||||||
@@ -16,133 +29,445 @@
|
|||||||
#pragma interface "list.h"
|
#pragma interface "list.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
|
#include "wx/debug.h"
|
||||||
#include "wx/object.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
|
class WXDLLEXPORT wxObjectListNode;
|
||||||
#define wxKEY_INTEGER 1
|
typedef wxObjectListNode wxNode;
|
||||||
#define wxKEY_STRING 2
|
|
||||||
class WXDLLEXPORT wxNode: public wxObject
|
// undef it to get rid of old, deprecated functions
|
||||||
|
#define wxLIST_COMPATIBILITY
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// constants
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
enum wxKeyType
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxNode)
|
wxKEY_NONE,
|
||||||
private:
|
wxKEY_INTEGER,
|
||||||
|
wxKEY_STRING
|
||||||
wxObject *data;
|
};
|
||||||
wxNode *next;
|
|
||||||
wxNode *previous;
|
|
||||||
|
|
||||||
public:
|
// -----------------------------------------------------------------------------
|
||||||
wxList *list;
|
// types
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Optional key stuff
|
// type of compare function for list sort operation (as in 'qsort'): it should
|
||||||
union
|
// 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;
|
long integer;
|
||||||
char *string;
|
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')
|
// a struct which may contain both types of keys
|
||||||
typedef int (*wxSortCompareFunction)(const void *elem1, const void *elem2);
|
//
|
||||||
typedef int (*wxListIterateFunction)(wxObject *o);
|
// 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
|
||||||
class WXDLLEXPORT wxList: public wxObject
|
// 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:
|
// accessors
|
||||||
int n;
|
wxKeyType GetKeyType() const { return m_keyType; }
|
||||||
int destroy_data;
|
const char *GetString() const
|
||||||
wxNode *first_node;
|
{ wxASSERT( m_keyType == wxKEY_STRING ); return m_key.string; }
|
||||||
wxNode *last_node;
|
long GetNumber() const
|
||||||
unsigned int key_type;
|
{ wxASSERT( m_keyType == wxKEY_INTEGER ); return m_key.integer; }
|
||||||
|
|
||||||
wxList(void);
|
// comparaison
|
||||||
wxList(const unsigned int the_key_type);
|
bool operator==(wxListKeyValue value) const
|
||||||
wxList(int N, wxObject *Objects[]);
|
{
|
||||||
wxList(wxObject *object, ...);
|
switch ( m_keyType )
|
||||||
|
{
|
||||||
~wxList(void);
|
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; }
|
case wxKEY_STRING:
|
||||||
inline int GetCount(void) const { return n; }
|
return strcmp(m_key.string, value.string) == 0;
|
||||||
|
|
||||||
// Append to end of list
|
case wxKEY_INTEGER:
|
||||||
wxNode *Append(wxObject *object);
|
return m_key.integer == value.integer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Insert at front of list
|
// dtor
|
||||||
wxNode *Insert(wxObject *object);
|
~wxListKey()
|
||||||
|
{
|
||||||
|
if ( m_keyType == wxKEY_STRING )
|
||||||
|
free(m_key.string);
|
||||||
|
}
|
||||||
|
|
||||||
// Insert before given node
|
private:
|
||||||
wxNode *Insert(wxNode *position, wxObject *object);
|
wxKeyType m_keyType;
|
||||||
|
wxListKeyValue m_key;
|
||||||
// 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);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// String list class. N.B. this always copies strings
|
// -----------------------------------------------------------------------------
|
||||||
// with Add and deletes them itself.
|
// wxNodeBase class is a (base for) node in a double linked list
|
||||||
class WXDLLEXPORT wxStringList: public wxList
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
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:
|
virtual ~wxNodeBase();
|
||||||
wxStringList(void);
|
|
||||||
wxStringList(const wxStringList& list);
|
|
||||||
wxStringList(const char *first ...);
|
|
||||||
~wxStringList(void);
|
|
||||||
|
|
||||||
virtual wxNode *Add(const char *s);
|
// @@ no check is done that the list is really keyed on strings
|
||||||
virtual void Delete(const char *s);
|
const char *GetKeyString() const { return m_key.string; }
|
||||||
virtual char **ListToArray(bool new_copies = FALSE) const;
|
|
||||||
virtual void Sort(void);
|
#ifdef wxLIST_COMPATIBILITY
|
||||||
virtual bool Member(const char *s) const;
|
// compatibility methods
|
||||||
virtual void Clear(void);
|
wxNode *Next() const { return (wxNode *)GetNext(); }
|
||||||
void operator= (const wxStringList& list);
|
wxNode *Previous() const { return (wxNode *)GetPrevious(); }
|
||||||
char* operator[] (int i) const;
|
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
|
#endif
|
||||||
// _WX_LISTH__
|
// _WX_LISTH__
|
||||||
|
@@ -1,111 +1,24 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: listimpl.cpp
|
// Name: listimpl.cpp
|
||||||
// Purpose: helper file for implementation of dynamic lists
|
// Purpose: second-part of macro based implementation of template lists
|
||||||
// Author: Vadim Zeitlin
|
// Author: Vadim Zeitlin
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 16.10.97
|
// Created: 16/11/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1997 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
// Copyright: (c) 1998 Vadim Zeitlin
|
||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/*****************************************************************************
|
#define _DEFINE_LIST(T, name) \
|
||||||
* Purpose: implements methods of "template" class declared in DECLARE_LIST *
|
void wx##name##Node::DeleteData() \
|
||||||
* macro and which couldn't be implemented inline (because they *
|
{ \
|
||||||
* need the full definition of type T in scope) *
|
delete (T *)GetData(); \
|
||||||
* *
|
}
|
||||||
* 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; \
|
|
||||||
}
|
|
||||||
|
|
||||||
// redefine the macro so that now it will generate the class implementation
|
// 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
|
// old value would provoke a compile-time error if this file is not included
|
||||||
#undef WX_DEFINE_LIST
|
#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
|
// don't pollute preprocessor's name space
|
||||||
#undef _DEFINE_LIST
|
//#undef _DEFINE_LIST
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ public:
|
|||||||
// Window procedure
|
// Window procedure
|
||||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
virtual void MSWOnMouseMove(int x, int y, WXUINT flags);
|
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);
|
void OnEraseBackground(wxEraseEvent& event);
|
||||||
|
|
||||||
|
@@ -418,8 +418,8 @@ class WXDLLEXPORT wxListCtrl: public wxControl
|
|||||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||||
|
|
||||||
// IMPLEMENTATION
|
// IMPLEMENTATION
|
||||||
bool MSWCommand(WXUINT param, WXWORD id);
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||||
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||||
|
|
||||||
// Recreate window - seems to be necessary when changing a style.
|
// Recreate window - seems to be necessary when changing a style.
|
||||||
void RecreateWindow(void);
|
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);
|
wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||||
|
|
||||||
int m_code;
|
int m_code;
|
||||||
@@ -457,6 +455,8 @@ class WXDLLEXPORT wxListEvent: public wxCommandEvent
|
|||||||
wxPoint m_pointDrag;
|
wxPoint m_pointDrag;
|
||||||
|
|
||||||
wxListItem m_item;
|
wxListItem m_item;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxListEvent)
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
|
typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
|
||||||
|
@@ -44,12 +44,16 @@ WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages);
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// notebook events
|
// notebook events
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
class WXDLLEXPORT wxNotebookEvent : public wxCommandEvent
|
class WXDLLEXPORT wxNotebookEvent : public wxNotifyEvent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||||
int nSel = -1, int nOldSel = -1)
|
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
|
// accessors
|
||||||
// the currently selected page (-1 if none)
|
// the currently selected page (-1 if none)
|
||||||
@@ -173,7 +177,7 @@ public:
|
|||||||
// base class virtuals
|
// base class virtuals
|
||||||
// -------------------
|
// -------------------
|
||||||
virtual void Command(wxCommandEvent& event);
|
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 void SetConstraintSizes(bool recurse = TRUE);
|
||||||
virtual bool DoPhase(int nPhase);
|
virtual bool DoPhase(int nPhase);
|
||||||
|
|
||||||
|
@@ -91,6 +91,10 @@ public:
|
|||||||
virtual bool DeleteAll();
|
virtual bool DeleteAll();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// no copy ctor/assignment operator
|
||||||
|
wxRegConfig(const wxRegConfig&);
|
||||||
|
wxRegConfig& operator=(const wxRegConfig&);
|
||||||
|
|
||||||
// these keys are opened during all lifetime of wxRegConfig object
|
// these keys are opened during all lifetime of wxRegConfig object
|
||||||
wxRegKey m_keyLocalRoot, m_keyLocal,
|
wxRegKey m_keyLocalRoot, m_keyLocal,
|
||||||
m_keyGlobalRoot, m_keyGlobal;
|
m_keyGlobalRoot, m_keyGlobal;
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// Created: 01/02/97
|
// Created: 01/02/97
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart
|
// Copyright: (c) Julian Smart
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_SETUP_H_
|
#ifndef _WX_SETUP_H_
|
||||||
@@ -44,23 +44,23 @@
|
|||||||
#define wxUSE_HELP 1
|
#define wxUSE_HELP 1
|
||||||
// 0 for no help facility
|
// 0 for no help facility
|
||||||
#define wxUSE_RESOURCES 1
|
#define wxUSE_RESOURCES 1
|
||||||
// 0 for no wxGetResource/wxWriteResource
|
// 0 for no wxGetResource/wxWriteResource
|
||||||
#define wxUSE_CONSTRAINTS 1
|
#define wxUSE_CONSTRAINTS 1
|
||||||
// 0 for no window layout constraint system
|
// 0 for no window layout constraint system
|
||||||
|
|
||||||
#define wxUSE_TIMEDATE 1
|
#define wxUSE_TIMEDATE 1
|
||||||
// 0 for no wxTime/wxDate classes
|
// 0 for no wxTime/wxDate classes
|
||||||
|
|
||||||
#define wxUSE_CLIPBOARD 1
|
#define wxUSE_CLIPBOARD 1
|
||||||
// 0 for no clipboard functions
|
// 0 for no clipboard functions
|
||||||
#define wxUSE_SPLINES 1
|
#define wxUSE_SPLINES 1
|
||||||
// 0 for no splines
|
// 0 for no splines
|
||||||
#define wxUSE_XFIG_SPLINE_CODE 1
|
#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.
|
// AIAI spline code is slower, but freer of copyright issues.
|
||||||
|
|
||||||
#define wxUSE_DRAG_AND_DROP 1
|
#define wxUSE_DRAG_AND_DROP 1
|
||||||
// 0 for no drag and drop
|
// 0 for no drag and drop
|
||||||
|
|
||||||
#define wxUSE_TOOLBAR 1
|
#define wxUSE_TOOLBAR 1
|
||||||
// Define 1 to use toolbar classes
|
// Define 1 to use toolbar classes
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
#define wxUSE_SCROLLBAR 1
|
#define wxUSE_SCROLLBAR 1
|
||||||
// Define 1 to compile contributed wxScrollBar class
|
// Define 1 to compile contributed wxScrollBar class
|
||||||
#define wxUSE_XPM_IN_X 1
|
#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,
|
// Define 1 to support the XPM package in wxBitmap,
|
||||||
// separated by platform. If 1, you must link in
|
// separated by platform. If 1, you must link in
|
||||||
// the XPM library to your applications.
|
// the XPM library to your applications.
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
// symbol if 1?
|
// symbol if 1?
|
||||||
|
|
||||||
#define HAVE_SOCKET 1
|
#define HAVE_SOCKET 1
|
||||||
// Use WinSock if 1
|
// Use WinSock if 1
|
||||||
#define wxUSE_DOC_VIEW_ARCHITECTURE 1
|
#define wxUSE_DOC_VIEW_ARCHITECTURE 1
|
||||||
// Set to 0 to disable document/view architecture
|
// Set to 0 to disable document/view architecture
|
||||||
#define wxUSE_PRINTING_ARCHITECTURE 1
|
#define wxUSE_PRINTING_ARCHITECTURE 1
|
||||||
@@ -114,12 +114,12 @@
|
|||||||
#define wxUSE_DYNAMIC_CLASSES 1
|
#define wxUSE_DYNAMIC_CLASSES 1
|
||||||
// If 1, enables provision of run-time type information.
|
// If 1, enables provision of run-time type information.
|
||||||
// NOW MANDATORY: don't change.
|
// NOW MANDATORY: don't change.
|
||||||
#define wxUSE_MEMORY_TRACING 1
|
#define wxUSE_MEMORY_TRACING 0
|
||||||
// If 1, enables debugging versions of wxObject::new and
|
// If 1, enables debugging versions of wxObject::new and
|
||||||
// wxObject::delete *IF* __WXDEBUG__ is also defined.
|
// wxObject::delete *IF* __WXDEBUG__ is also defined.
|
||||||
// WARNING: this code may not work with all architectures, especially
|
// WARNING: this code may not work with all architectures, especially
|
||||||
// if alignment is an issue.
|
// if alignment is an issue.
|
||||||
#define wxUSE_DEBUG_CONTEXT 1
|
#define wxUSE_DEBUG_CONTEXT 0
|
||||||
// If 1, enables wxDebugContext, for
|
// If 1, enables wxDebugContext, for
|
||||||
// writing error messages to file, etc.
|
// writing error messages to file, etc.
|
||||||
// If __WXDEBUG__ is not defined, will still use
|
// If __WXDEBUG__ is not defined, will still use
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
// since you may well need to output
|
// since you may well need to output
|
||||||
// an error log in a production
|
// an error log in a production
|
||||||
// version (or non-debugging beta)
|
// 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.
|
// In debug mode, cause new and delete to be redefined globally.
|
||||||
// If this causes problems (e.g. link errors), set this to 0.
|
// If this causes problems (e.g. link errors), set this to 0.
|
||||||
|
|
||||||
@@ -162,10 +162,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define wxUSE_APPLE_IEEE 1
|
#define wxUSE_APPLE_IEEE 1
|
||||||
// if enabled, the float codec written by Apple
|
// if enabled, the float codec written by Apple
|
||||||
// will be used to write, in a portable way,
|
// will be used to write, in a portable way,
|
||||||
// float on the disk
|
// float on the disk
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MS Windows/Windows NT
|
* MS Windows/Windows NT
|
||||||
@@ -218,9 +218,9 @@
|
|||||||
|
|
||||||
#define wxUSE_TYPEDEFS 0
|
#define wxUSE_TYPEDEFS 0
|
||||||
// Use typedefs not classes for wxPoint
|
// Use typedefs not classes for wxPoint
|
||||||
// and others, to reduce overhead and avoid
|
// and others, to reduce overhead and avoid
|
||||||
// MS C7 memory bug. Bounds checker
|
// MS C7 memory bug. Bounds checker
|
||||||
// complains about deallocating
|
// complains about deallocating
|
||||||
// arrays of wxPoints if wxPoint is a class.
|
// arrays of wxPoints if wxPoint is a class.
|
||||||
|
|
||||||
#if (!defined(WIN32) && !defined(__WIN32__)) || defined(__GNUWIN32__) || defined(__BORLANDC__)
|
#if (!defined(WIN32) && !defined(__WIN32__)) || defined(__GNUWIN32__) || defined(__BORLANDC__)
|
||||||
|
@@ -67,10 +67,10 @@ class WXDLLEXPORT wxSpinButton: public wxControl
|
|||||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||||
|
|
||||||
// IMPLEMENTATION
|
// IMPLEMENTATION
|
||||||
bool MSWCommand(WXUINT param, WXWORD id);
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||||
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||||
void MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control);
|
virtual void MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control);
|
||||||
void MSWOnHScroll(WXWORD wParam, WXWORD pos, WXHWND control);
|
virtual void MSWOnHScroll(WXWORD wParam, WXWORD pos, WXHWND control);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_min;
|
int m_min;
|
||||||
|
@@ -122,8 +122,9 @@ class WXDLLEXPORT wxTabCtrl: public wxControl
|
|||||||
void OnKillFocus(wxFocusEvent& event) { Default() ; }
|
void OnKillFocus(wxFocusEvent& event) { Default() ; }
|
||||||
|
|
||||||
void Command(wxCommandEvent& event);
|
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
|
// Responds to colour changes
|
||||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
|
@@ -81,8 +81,8 @@ class WXDLLEXPORT wxToolBar95: public wxToolBarBase
|
|||||||
bool Realize() { return CreateTools(); };
|
bool Realize() { return CreateTools(); };
|
||||||
|
|
||||||
// IMPLEMENTATION
|
// IMPLEMENTATION
|
||||||
bool MSWCommand(WXUINT param, WXWORD id);
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||||
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||||
|
|
||||||
// Responds to colour changes
|
// Responds to colour changes
|
||||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
|
@@ -410,8 +410,8 @@ public:
|
|||||||
// implementation
|
// implementation
|
||||||
// --------------
|
// --------------
|
||||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||||
bool MSWCommand(WXUINT param, WXWORD id);
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||||
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);
|
virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// SetImageList helper
|
// SetImageList helper
|
||||||
@@ -448,7 +448,7 @@ private:
|
|||||||
// NB: note that not all accessors make sense for all events, see the event
|
// NB: note that not all accessors make sense for all events, see the event
|
||||||
// descriptions below
|
// descriptions below
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
class WXDLLEXPORT wxTreeEvent : public wxCommandEvent
|
class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent
|
||||||
{
|
{
|
||||||
friend wxTreeCtrl;
|
friend wxTreeCtrl;
|
||||||
public:
|
public:
|
||||||
@@ -470,10 +470,6 @@ public:
|
|||||||
// keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only)
|
// keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only)
|
||||||
int GetCode() const { return m_code; }
|
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:
|
private:
|
||||||
// @@ we could save some space by using union here
|
// @@ we could save some space by using union here
|
||||||
int m_code;
|
int m_code;
|
||||||
|
@@ -81,7 +81,7 @@ WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
|
|||||||
WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize;
|
WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize;
|
||||||
WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition;
|
WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition;
|
||||||
|
|
||||||
class WXDLLEXPORT wxWindow: public wxEvtHandler
|
class WXDLLEXPORT wxWindow : public wxEvtHandler
|
||||||
{
|
{
|
||||||
DECLARE_ABSTRACT_CLASS(wxWindow)
|
DECLARE_ABSTRACT_CLASS(wxWindow)
|
||||||
|
|
||||||
@@ -89,18 +89,17 @@ class WXDLLEXPORT wxWindow: public wxEvtHandler
|
|||||||
friend class wxPaintDC;
|
friend class wxPaintDC;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxWindow(void);
|
wxWindow();
|
||||||
inline wxWindow(wxWindow *parent, wxWindowID id,
|
wxWindow(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = wxPanelNameStr)
|
const wxString& name = wxPanelNameStr)
|
||||||
{
|
{
|
||||||
m_children = new wxList;
|
|
||||||
Create(parent, id, pos, size, style, name);
|
Create(parent, id, pos, size, style, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~wxWindow(void);
|
virtual ~wxWindow();
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxWindowID id,
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
@@ -109,25 +108,25 @@ public:
|
|||||||
const wxString& name = wxPanelNameStr);
|
const wxString& name = wxPanelNameStr);
|
||||||
|
|
||||||
// Fit the window around the items
|
// Fit the window around the items
|
||||||
virtual void Fit(void);
|
virtual void Fit();
|
||||||
|
|
||||||
// Show or hide the window
|
// Show or hide the window
|
||||||
virtual bool Show(bool show);
|
virtual bool Show(bool show);
|
||||||
|
|
||||||
// Is the window shown?
|
// Is the window shown?
|
||||||
virtual bool IsShown(void) const;
|
virtual bool IsShown() const;
|
||||||
|
|
||||||
// Raise the window to the top of the Z order
|
// 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
|
// Lower the window to the bottom of the Z order
|
||||||
virtual void Lower(void);
|
virtual void Lower();
|
||||||
|
|
||||||
// Is the window enabled?
|
// Is the window enabled?
|
||||||
virtual bool IsEnabled(void) const;
|
virtual bool IsEnabled() const;
|
||||||
|
|
||||||
// For compatibility
|
// For compatibility
|
||||||
inline bool Enabled(void) const { return IsEnabled(); }
|
inline bool Enabled() const { return IsEnabled(); }
|
||||||
|
|
||||||
// Dialog support: override these and call
|
// Dialog support: override these and call
|
||||||
// base class members to add functionality
|
// base class members to add functionality
|
||||||
@@ -135,30 +134,30 @@ public:
|
|||||||
|
|
||||||
// Transfer values to controls. If returns FALSE,
|
// Transfer values to controls. If returns FALSE,
|
||||||
// it's an application error (pops up a dialog)
|
// it's an application error (pops up a dialog)
|
||||||
virtual bool TransferDataToWindow(void);
|
virtual bool TransferDataToWindow();
|
||||||
|
|
||||||
// Transfer values from controls. If returns FALSE,
|
// Transfer values from controls. If returns FALSE,
|
||||||
// transfer failed: don't quit
|
// transfer failed: don't quit
|
||||||
virtual bool TransferDataFromWindow(void);
|
virtual bool TransferDataFromWindow();
|
||||||
|
|
||||||
// Validate controls. If returns FALSE,
|
// Validate controls. If returns FALSE,
|
||||||
// validation failed: don't quit
|
// validation failed: don't quit
|
||||||
virtual bool Validate(void);
|
virtual bool Validate();
|
||||||
|
|
||||||
// Return code for dialogs
|
// Return code for dialogs
|
||||||
inline void SetReturnCode(int retCode);
|
inline void SetReturnCode(int retCode);
|
||||||
inline int GetReturnCode(void);
|
inline int GetReturnCode();
|
||||||
|
|
||||||
// Set the cursor
|
// Set the cursor
|
||||||
virtual void SetCursor(const wxCursor& 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
|
// Get the window with the focus
|
||||||
static wxWindow *FindFocus(void);
|
static wxWindow *FindFocus();
|
||||||
|
|
||||||
// Get character size
|
// Get character size
|
||||||
virtual int GetCharHeight(void) const;
|
virtual int GetCharHeight() const;
|
||||||
virtual int GetCharWidth(void) const;
|
virtual int GetCharWidth() const;
|
||||||
|
|
||||||
// Get overall window size
|
// Get overall window size
|
||||||
virtual void GetSize(int *width, int *height) const;
|
virtual void GetSize(int *width, int *height) const;
|
||||||
@@ -184,11 +183,11 @@ public:
|
|||||||
virtual void ScreenToClient(int *x, int *y) const;
|
virtual void ScreenToClient(int *x, int *y) const;
|
||||||
|
|
||||||
// Set the focus to this window
|
// Set the focus to this window
|
||||||
virtual void SetFocus(void);
|
virtual void SetFocus();
|
||||||
|
|
||||||
// Capture/release mouse
|
// Capture/release mouse
|
||||||
virtual void CaptureMouse(void);
|
virtual void CaptureMouse();
|
||||||
virtual void ReleaseMouse(void);
|
virtual void ReleaseMouse();
|
||||||
|
|
||||||
// Enable or disable the window
|
// Enable or disable the window
|
||||||
virtual void Enable(bool enable);
|
virtual void Enable(bool enable);
|
||||||
@@ -211,13 +210,13 @@ public:
|
|||||||
|
|
||||||
// Set/get the window title
|
// Set/get the window title
|
||||||
virtual inline void SetTitle(const wxString& WXUNUSED(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
|
// Most windows have the concept of a label; for frames, this is the
|
||||||
// title; for items, this is the label or button text.
|
// 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)
|
// 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);
|
inline virtual void SetName(const wxString& name);
|
||||||
|
|
||||||
// Centre the window
|
// Centre the window
|
||||||
@@ -252,7 +251,7 @@ public:
|
|||||||
// Caret manipulation
|
// Caret manipulation
|
||||||
virtual void CreateCaret(int w, int h);
|
virtual void CreateCaret(int w, int h);
|
||||||
virtual void CreateCaret(const wxBitmap *bitmap);
|
virtual void CreateCaret(const wxBitmap *bitmap);
|
||||||
virtual void DestroyCaret(void);
|
virtual void DestroyCaret();
|
||||||
virtual void ShowCaret(bool show);
|
virtual void ShowCaret(bool show);
|
||||||
virtual void SetCaretPos(int x, int y);
|
virtual void SetCaretPos(int x, int y);
|
||||||
virtual void GetCaretPos(int *x, int *y) const;
|
virtual void GetCaretPos(int *x, int *y) const;
|
||||||
@@ -268,31 +267,31 @@ public:
|
|||||||
virtual void MakeModal(bool modal);
|
virtual void MakeModal(bool modal);
|
||||||
|
|
||||||
// Get the private handle (platform-dependent)
|
// Get the private handle (platform-dependent)
|
||||||
inline void *GetHandle(void) const;
|
inline void *GetHandle() const;
|
||||||
|
|
||||||
// Set/get the window's relatives
|
// Set/get the window's relatives
|
||||||
inline wxWindow *GetParent(void) const;
|
inline wxWindow *GetParent() const;
|
||||||
inline void SetParent(wxWindow *p) ;
|
inline void SetParent(wxWindow *p) ;
|
||||||
inline wxWindow *GetGrandParent(void) const;
|
inline wxWindow *GetGrandParent() const;
|
||||||
inline wxList *GetChildren() const;
|
inline wxList *GetChildren() const;
|
||||||
|
|
||||||
// Set/get the window's font
|
// Set/get the window's font
|
||||||
virtual void SetFont(const wxFont& f);
|
virtual void SetFont(const wxFont& f);
|
||||||
inline virtual wxFont *GetFont(void) const;
|
inline virtual wxFont *GetFont() const;
|
||||||
|
|
||||||
// Set/get the window's validator
|
// Set/get the window's validator
|
||||||
void SetValidator(const wxValidator& validator);
|
void SetValidator(const wxValidator& validator);
|
||||||
inline wxValidator *GetValidator(void) const;
|
inline wxValidator *GetValidator() const;
|
||||||
|
|
||||||
// Set/get the window's style
|
// Set/get the window's style
|
||||||
inline void SetWindowStyleFlag(long flag);
|
inline void SetWindowStyleFlag(long flag);
|
||||||
inline long GetWindowStyleFlag(void) const;
|
inline long GetWindowStyleFlag() const;
|
||||||
|
|
||||||
// Set/get double-clickability
|
// Set/get double-clickability
|
||||||
// TODO: we probably wish to get rid of this, and
|
// TODO: we probably wish to get rid of this, and
|
||||||
// always allow double clicks.
|
// always allow double clicks.
|
||||||
inline void SetDoubleClick(bool flag);
|
inline void SetDoubleClick(bool flag);
|
||||||
inline bool GetDoubleClick(void) const;
|
inline bool GetDoubleClick() const;
|
||||||
inline void AllowDoubleClick(bool value) { SetDoubleClick(value); }
|
inline void AllowDoubleClick(bool value) { SetDoubleClick(value); }
|
||||||
|
|
||||||
// Handle a control command
|
// Handle a control command
|
||||||
@@ -300,7 +299,7 @@ public:
|
|||||||
|
|
||||||
// Set/get event handler
|
// Set/get event handler
|
||||||
inline void SetEventHandler(wxEvtHandler *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
|
// Push/pop event handler (i.e. allow a chain of event handlers
|
||||||
// be searched)
|
// be searched)
|
||||||
@@ -311,33 +310,33 @@ public:
|
|||||||
virtual bool Close(bool force = FALSE);
|
virtual bool Close(bool force = FALSE);
|
||||||
|
|
||||||
// Destroy the window (delayed, if a managed window)
|
// Destroy the window (delayed, if a managed window)
|
||||||
virtual bool Destroy(void) ;
|
virtual bool Destroy() ;
|
||||||
|
|
||||||
// Mode for telling default OnSize members to
|
// Mode for telling default OnSize members to
|
||||||
// call Layout(), if not using Sizers, just top-down constraints
|
// call Layout(), if not using Sizers, just top-down constraints
|
||||||
inline void SetAutoLayout(bool a);
|
inline void SetAutoLayout(bool a);
|
||||||
inline bool GetAutoLayout(void) const;
|
inline bool GetAutoLayout() const;
|
||||||
|
|
||||||
// Set/get constraints
|
// Set/get constraints
|
||||||
inline wxLayoutConstraints *GetConstraints(void) const;
|
inline wxLayoutConstraints *GetConstraints() const;
|
||||||
void SetConstraints(wxLayoutConstraints *c);
|
void SetConstraints(wxLayoutConstraints *c);
|
||||||
|
|
||||||
// Set/get window background colour
|
// Set/get window background colour
|
||||||
inline virtual void SetBackgroundColour(const wxColour& col);
|
inline virtual void SetBackgroundColour(const wxColour& col);
|
||||||
inline virtual wxColour GetBackgroundColour(void) const;
|
inline virtual wxColour GetBackgroundColour() const;
|
||||||
|
|
||||||
// Set/get window foreground colour
|
// Set/get window foreground colour
|
||||||
inline virtual void SetForegroundColour(const wxColour& col);
|
inline virtual void SetForegroundColour(const wxColour& col);
|
||||||
inline virtual wxColour GetForegroundColour(void) const;
|
inline virtual wxColour GetForegroundColour() const;
|
||||||
|
|
||||||
// For backward compatibility
|
// For backward compatibility
|
||||||
inline virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
|
inline virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||||
inline virtual void SetLabelFont(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 *GetLabelFont() const { return GetFont(); };
|
||||||
inline virtual wxFont *GetButtonFont(void) const { return GetFont(); };
|
inline virtual wxFont *GetButtonFont() const { return GetFont(); };
|
||||||
|
|
||||||
// Get the default button, if there is one
|
// 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);
|
inline virtual void SetDefaultItem(wxButton *but);
|
||||||
|
|
||||||
virtual void SetAcceleratorTable(const wxAcceleratorTable& accel);
|
virtual void SetAcceleratorTable(const wxAcceleratorTable& accel);
|
||||||
@@ -365,27 +364,27 @@ public:
|
|||||||
const wxFont *theFont = NULL, bool use16 = FALSE) const;
|
const wxFont *theFont = NULL, bool use16 = FALSE) const;
|
||||||
|
|
||||||
// Is the window retained?
|
// Is the window retained?
|
||||||
inline bool IsRetained(void) const;
|
inline bool IsRetained() const;
|
||||||
|
|
||||||
// Warp the pointer the given position
|
// Warp the pointer the given position
|
||||||
virtual void WarpPointer(int x_pos, int y_pos) ;
|
virtual void WarpPointer(int x_pos, int y_pos) ;
|
||||||
|
|
||||||
// Clear the window
|
// Clear the window
|
||||||
virtual void Clear(void);
|
virtual void Clear();
|
||||||
|
|
||||||
// Find a window by id or name
|
// Find a window by id or name
|
||||||
virtual wxWindow *FindWindow(long id);
|
virtual wxWindow *FindWindow(long id);
|
||||||
virtual wxWindow *FindWindow(const wxString& name);
|
virtual wxWindow *FindWindow(const wxString& name);
|
||||||
|
|
||||||
// Constraint operations
|
// Constraint operations
|
||||||
bool Layout(void);
|
bool Layout();
|
||||||
void SetSizer(wxSizer *sizer); // Adds sizer child to this window
|
void SetSizer(wxSizer *sizer); // Adds sizer child to this window
|
||||||
inline wxSizer *GetSizer(void) const ;
|
inline wxSizer *GetSizer() const ;
|
||||||
inline wxWindow *GetSizerParent(void) const ;
|
inline wxWindow *GetSizerParent() const ;
|
||||||
inline void SetSizerParent(wxWindow *win);
|
inline void SetSizerParent(wxWindow *win);
|
||||||
|
|
||||||
// Do Update UI processing for controls
|
// Do Update UI processing for controls
|
||||||
void UpdateWindowUI(void);
|
void UpdateWindowUI();
|
||||||
|
|
||||||
void OnEraseBackground(wxEraseEvent& event);
|
void OnEraseBackground(wxEraseEvent& event);
|
||||||
void OnChar(wxKeyEvent& event);
|
void OnChar(wxKeyEvent& event);
|
||||||
@@ -410,15 +409,18 @@ public:
|
|||||||
|
|
||||||
// Windows subclassing
|
// Windows subclassing
|
||||||
void SubclassWin(WXHWND hWnd);
|
void SubclassWin(WXHWND hWnd);
|
||||||
void UnsubclassWin(void);
|
void UnsubclassWin();
|
||||||
virtual long Default(void);
|
virtual long Default();
|
||||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
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 *FindItem(int id) const;
|
||||||
virtual wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const ;
|
virtual wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const ;
|
||||||
virtual void PreDelete(WXHDC dc); // Allows system cleanup
|
virtual void PreDelete(WXHDC dc); // Allows system cleanup
|
||||||
// TO DO: how many of these need to be virtual?
|
// TO DO: how many of these need to be virtual?
|
||||||
virtual WXHWND GetHWND(void) const ;
|
virtual WXHWND GetHWND() const ;
|
||||||
virtual void SetHWND(WXHWND hWnd);
|
virtual void SetHWND(WXHWND hWnd);
|
||||||
|
|
||||||
// Make a Windows extended style from the given wxWindows window style
|
// 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 AddChild(wxWindow *child); // Adds reference to the child object
|
||||||
virtual void RemoveChild(wxWindow *child); // Removes reference to child
|
virtual void RemoveChild(wxWindow *child); // Removes reference to child
|
||||||
// (but doesn't delete the child object)
|
// (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
|
// MSW only: TRUE if this control is part of the main control
|
||||||
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
||||||
|
|
||||||
// Constraint implementation
|
// Constraint implementation
|
||||||
void UnsetConstraints(wxLayoutConstraints *c);
|
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
|
// Back-pointer to other windows we're involved with, so if we delete
|
||||||
// this window, we must delete any constraints we're involved with.
|
// this window, we must delete any constraints we're involved with.
|
||||||
void AddConstraintReference(wxWindow *otherWin);
|
void AddConstraintReference(wxWindow *otherWin);
|
||||||
void RemoveConstraintReference(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 void SetConstraintSizes(bool recurse = TRUE);
|
||||||
virtual bool LayoutPhase1(int *noChanges);
|
virtual bool LayoutPhase1(int *noChanges);
|
||||||
virtual bool LayoutPhase2(int *noChanges);
|
virtual bool LayoutPhase2(int *noChanges);
|
||||||
@@ -487,25 +489,25 @@ public:
|
|||||||
virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
|
virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
|
||||||
|
|
||||||
// Make sure the window style reflects the HWND style (roughly)
|
// Make sure the window style reflects the HWND style (roughly)
|
||||||
virtual void AdoptAttributesFromHWND(void);
|
virtual void AdoptAttributesFromHWND();
|
||||||
|
|
||||||
// Setup background and foreground colours correctly
|
// Setup background and foreground colours correctly
|
||||||
virtual void SetupColours(void);
|
virtual void SetupColours();
|
||||||
|
|
||||||
// Saves the last message information before calling base version
|
// Saves the last message information before calling base version
|
||||||
virtual bool ProcessEvent(wxEvent& event);
|
virtual bool ProcessEvent(wxEvent& event);
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
virtual void MSWOnCreate(WXLPCREATESTRUCT cs);
|
virtual void MSWOnCreate(WXLPCREATESTRUCT cs);
|
||||||
virtual bool MSWOnPaint(void);
|
virtual bool MSWOnPaint();
|
||||||
virtual WXHICON MSWOnQueryDragIcon(void) { return 0; }
|
virtual WXHICON MSWOnQueryDragIcon() { return 0; }
|
||||||
virtual void MSWOnSize(int x, int y, WXUINT flag);
|
virtual void MSWOnSize(int x, int y, WXUINT flag);
|
||||||
virtual void MSWOnWindowPosChanging(void *lpPos);
|
virtual void MSWOnWindowPosChanging(void *lpPos);
|
||||||
virtual void MSWOnHScroll(WXWORD nSBCode, WXWORD pos, WXHWND control);
|
virtual void MSWOnHScroll(WXWORD nSBCode, WXWORD pos, WXHWND control);
|
||||||
virtual void MSWOnVScroll(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 bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
|
||||||
virtual long MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam);
|
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,
|
virtual WXHBRUSH MSWOnCtlColor(WXHDC dc, WXHWND pWnd, WXUINT nCtlColor,
|
||||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
virtual bool MSWOnColorChange(WXHWND hWnd, 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 bool MSWOnEraseBkgnd(WXHDC pDC);
|
||||||
virtual void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
|
virtual void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
|
||||||
virtual void MSWOnInitMenuPopup(WXHMENU menu, int pos, bool isSystem);
|
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.
|
// Return TRUE to end session, FALSE to veto end session.
|
||||||
virtual bool MSWOnQueryEndSession(long logOff);
|
virtual bool MSWOnQueryEndSession(long logOff);
|
||||||
virtual bool MSWOnEndSession(bool endSession, long logOff);
|
virtual bool MSWOnEndSession(bool endSession, long logOff);
|
||||||
virtual bool MSWOnDestroy(void);
|
virtual bool MSWOnDestroy();
|
||||||
virtual bool MSWOnSetFocus(WXHWND wnd);
|
virtual bool MSWOnSetFocus(WXHWND wnd);
|
||||||
virtual bool MSWOnKillFocus(WXHWND wnd);
|
virtual bool MSWOnKillFocus(WXHWND wnd);
|
||||||
virtual void MSWOnDropFiles(WXWPARAM wParam);
|
virtual void MSWOnDropFiles(WXWPARAM wParam);
|
||||||
@@ -565,10 +567,10 @@ public:
|
|||||||
virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
virtual bool MSWProcessMessage(WXMSG* pMsg);
|
virtual bool MSWProcessMessage(WXMSG* pMsg);
|
||||||
virtual bool MSWTranslateMessage(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
|
// Detach "Window" menu from menu bar so it doesn't get deleted
|
||||||
void MSWDetachWindowMenu(void);
|
void MSWDetachWindowMenu();
|
||||||
|
|
||||||
inline WXFARPROC MSWGetOldWndProc() const;
|
inline WXFARPROC MSWGetOldWndProc() const;
|
||||||
inline void MSWSetOldWndProc(WXFARPROC proc);
|
inline void MSWSetOldWndProc(WXFARPROC proc);
|
||||||
@@ -578,9 +580,9 @@ public:
|
|||||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
|
|
||||||
inline void SetShowing(bool show);
|
inline void SetShowing(bool show);
|
||||||
inline bool IsUserEnabled(void) const;
|
inline bool IsUserEnabled() const;
|
||||||
inline bool GetUseCtl3D(void) const ;
|
inline bool GetUseCtl3D() const ;
|
||||||
inline bool GetTransparentBackground(void) const ;
|
inline bool GetTransparentBackground() const ;
|
||||||
|
|
||||||
// Responds to colour changes: passes event on to children.
|
// Responds to colour changes: passes event on to children.
|
||||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
@@ -590,7 +592,7 @@ public:
|
|||||||
|
|
||||||
// Sends an OnInitDialog event, which in turns transfers data to
|
// Sends an OnInitDialog event, which in turns transfers data to
|
||||||
// to the window via validators.
|
// to the window via validators.
|
||||||
virtual void InitDialog(void);
|
virtual void InitDialog();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
//// PROTECTED DATA
|
//// PROTECTED DATA
|
||||||
@@ -678,57 +680,61 @@ public:
|
|||||||
bool m_isBeingDeleted; // Fudge because can't access parent
|
bool m_isBeingDeleted; // Fudge because can't access parent
|
||||||
// when being deleted
|
// when being deleted
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
private:
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
//// INLINES
|
//// 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 int wxWindow::GetId() const { return m_windowId; }
|
||||||
inline void wxWindow::SetId(int id) { m_windowId = id; }
|
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 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 wxList *wxWindow::GetChildren() const { return m_children; }
|
||||||
inline wxFont *wxWindow::GetFont(void) const { return (wxFont *) & m_windowFont; }
|
inline wxFont *wxWindow::GetFont() const { return (wxFont *) & m_windowFont; }
|
||||||
inline wxString wxWindow::GetName(void) const { return m_windowName; }
|
inline wxString wxWindow::GetName() const { return m_windowName; }
|
||||||
inline void wxWindow::SetName(const wxString& name) { m_windowName = name; }
|
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::SetWindowStyleFlag(long flag) { m_windowStyle = flag; }
|
||||||
inline void wxWindow::SetDoubleClick(bool flag) { m_doubleClickAllowed = 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 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 void wxWindow::SetAutoLayout(bool a) { m_autoLayout = a; }
|
||||||
inline bool wxWindow::GetAutoLayout(void) const { return m_autoLayout; }
|
inline bool wxWindow::GetAutoLayout() const { return m_autoLayout; }
|
||||||
inline wxLayoutConstraints *wxWindow::GetConstraints(void) const { return m_constraints; }
|
inline wxLayoutConstraints *wxWindow::GetConstraints() const { return m_constraints; }
|
||||||
inline void wxWindow::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; };
|
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 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 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 void wxWindow::SetShowing(bool show) { m_isShown = show; }
|
||||||
inline wxList *wxWindow::GetConstraintsInvolvedIn(void) const { return m_constraintsInvolvedIn; }
|
inline wxList *wxWindow::GetConstraintsInvolvedIn() const { return m_constraintsInvolvedIn; }
|
||||||
inline wxSizer *wxWindow::GetSizer(void) const { return m_windowSizer; }
|
inline wxSizer *wxWindow::GetSizer() const { return m_windowSizer; }
|
||||||
inline wxWindow *wxWindow::GetSizerParent(void) const { return m_sizerParent; }
|
inline wxWindow *wxWindow::GetSizerParent() const { return m_sizerParent; }
|
||||||
inline void wxWindow::SetSizerParent(wxWindow *win) { m_sizerParent = win; }
|
inline void wxWindow::SetSizerParent(wxWindow *win) { m_sizerParent = win; }
|
||||||
inline WXFARPROC wxWindow::MSWGetOldWndProc() const { return m_oldWndProc; }
|
inline WXFARPROC wxWindow::MSWGetOldWndProc() const { return m_oldWndProc; }
|
||||||
inline void wxWindow::MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
|
inline void wxWindow::MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
|
||||||
inline wxValidator *wxWindow::GetValidator(void) const { return m_windowValidator; }
|
inline wxValidator *wxWindow::GetValidator() const { return m_windowValidator; }
|
||||||
inline bool wxWindow::IsUserEnabled(void) const { return m_winEnabled; }
|
inline bool wxWindow::IsUserEnabled() const { return m_winEnabled; }
|
||||||
inline bool wxWindow::GetUseCtl3D(void) const { return m_useCtl3D; }
|
inline bool wxWindow::GetUseCtl3D() const { return m_useCtl3D; }
|
||||||
inline bool wxWindow::GetTransparentBackground(void) const { return m_backgroundTransparent; }
|
inline bool wxWindow::GetTransparentBackground() const { return m_backgroundTransparent; }
|
||||||
inline void wxWindow::SetReturnCode(int retCode) { m_returnCode = retCode; }
|
inline void wxWindow::SetReturnCode(int retCode) { m_returnCode = retCode; }
|
||||||
inline int wxWindow::GetReturnCode(void) { return m_returnCode; }
|
inline int wxWindow::GetReturnCode() { return m_returnCode; }
|
||||||
inline bool wxWindow::IsBeingDeleted(void) { return m_isBeingDeleted; }
|
inline bool wxWindow::IsBeingDeleted() { return m_isBeingDeleted; }
|
||||||
|
|
||||||
// Window specific (so far)
|
// Window specific (so far)
|
||||||
WXDLLEXPORT wxWindow* wxGetActiveWindow(void);
|
WXDLLEXPORT wxWindow* wxGetActiveWindow();
|
||||||
|
|
||||||
WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows;
|
WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows;
|
||||||
|
|
||||||
@@ -736,7 +742,7 @@ WXDLLEXPORT int wxCharCodeMSWToWX(int keySym);
|
|||||||
WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
|
WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
|
||||||
|
|
||||||
// Allocates control ids
|
// Allocates control ids
|
||||||
WXDLLEXPORT int NewControlId(void);
|
WXDLLEXPORT int NewControlId();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _WX_WINDOW_H_
|
// _WX_WINDOW_H_
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// Created: ??/??/98
|
// Created: ??/??/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) AUTHOR
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_COLOUR_H_
|
#ifndef _WX_COLOUR_H_
|
||||||
@@ -77,7 +77,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_isInit;
|
bool m_isInit;
|
||||||
unsigned char m_red;
|
unsigned char m_red;
|
||||||
unsigned char m_blue;
|
unsigned char m_blue;
|
||||||
unsigned char m_green;
|
unsigned char m_green;
|
||||||
@@ -92,4 +92,4 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _WX_COLOUR_H_
|
// _WX_COLOUR_H_
|
||||||
|
@@ -28,6 +28,11 @@
|
|||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
|
||||||
|
// there are just too many of those...
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4706) // assignment within conditional expression
|
||||||
|
#endif // VC++
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -1545,5 +1550,9 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
|
|||||||
pattern++;
|
pattern++;
|
||||||
return ((*str == '\0') && (*pattern == '\0'));
|
return ((*str == '\0') && (*pattern == '\0'));
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(default:4706) // assignment within conditional expression
|
||||||
|
#endif // VC++
|
@@ -328,7 +328,7 @@ wxString wxColourDatabase::FindName (const wxColour& colour) const
|
|||||||
|
|
||||||
if (col->Red () == red && col->Green () == green && col->Blue () == blue)
|
if (col->Red () == red && col->Green () == green && col->Blue () == blue)
|
||||||
{
|
{
|
||||||
char *found = node->key.string;
|
const char *found = node->GetKeyString();
|
||||||
if (found)
|
if (found)
|
||||||
return wxString(found);
|
return wxString(found);
|
||||||
}
|
}
|
||||||
@@ -621,12 +621,6 @@ wxSize wxGetDisplaySize()
|
|||||||
return wxSize(x, y);
|
return wxSize(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxResourceCache::wxResourceCache () : wxList() {
|
|
||||||
}
|
|
||||||
|
|
||||||
wxResourceCache::wxResourceCache (const unsigned int the_key_type) : wxList(the_key_type) {
|
|
||||||
}
|
|
||||||
|
|
||||||
wxResourceCache::~wxResourceCache () {
|
wxResourceCache::~wxResourceCache () {
|
||||||
wxNode *node = First ();
|
wxNode *node = First ();
|
||||||
while (node) {
|
while (node) {
|
||||||
|
@@ -275,10 +275,8 @@ bool wxMsgCatalog::Load(const char *szDirPrefix, const char *szName)
|
|||||||
// examine header
|
// examine header
|
||||||
bool bValid = (size_t)nSize > sizeof(wxMsgCatalogHeader);
|
bool bValid = (size_t)nSize > sizeof(wxMsgCatalogHeader);
|
||||||
|
|
||||||
wxMsgCatalogHeader *pHeader;
|
wxMsgCatalogHeader *pHeader = (wxMsgCatalogHeader *)m_pData;
|
||||||
if ( bValid ) {
|
if ( bValid ) {
|
||||||
pHeader = (wxMsgCatalogHeader *)m_pData;
|
|
||||||
|
|
||||||
// we'll have to swap all the integers if it's true
|
// we'll have to swap all the integers if it's true
|
||||||
m_bSwapped = pHeader->magic == MSGCATALOG_MAGIC_SW;
|
m_bSwapped = pHeader->magic == MSGCATALOG_MAGIC_SW;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,10 @@
|
|||||||
|
|
||||||
#if wxUSE_ODBC
|
#if wxUSE_ODBC
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4706) // assignment within conditional expression
|
||||||
|
#endif // VC++
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
#include "wx/dialog.h"
|
#include "wx/dialog.h"
|
||||||
@@ -1827,4 +1831,8 @@ bool wxQueryField::IsDirty(void) {
|
|||||||
return dirty;
|
return dirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(default:4706) // assignment within conditional expression
|
||||||
|
#endif // VC++
|
||||||
|
|
||||||
#endif // wxUSE_ODBC
|
#endif // wxUSE_ODBC
|
||||||
|
@@ -20,6 +20,12 @@
|
|||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_WX_RESOURCES
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4706) // assignment within conditional expression
|
||||||
|
#endif // VC++
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/setup.h"
|
#include "wx/setup.h"
|
||||||
@@ -59,8 +65,6 @@
|
|||||||
|
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
|
|
||||||
#if wxUSE_WX_RESOURCES
|
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -2853,4 +2857,8 @@ wxControl *wxWindow::CreateItem(const wxItemResource *resource, const wxItemReso
|
|||||||
return table->CreateItem((wxWindow *)this, resource, parentResource);
|
return table->CreateItem((wxWindow *)this, resource, parentResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(default:4706) // assignment within conditional expression
|
||||||
|
#endif // VC++
|
||||||
|
|
||||||
#endif // wxUSE_WX_RESOURCES
|
#endif // wxUSE_WX_RESOURCES
|
||||||
|
@@ -195,7 +195,7 @@ void wxToolBarBase::AddSeparator ()
|
|||||||
{
|
{
|
||||||
wxToolBarTool *tool = new wxToolBarTool;
|
wxToolBarTool *tool = new wxToolBarTool;
|
||||||
tool->m_toolStyle = wxTOOL_STYLE_SEPARATOR;
|
tool->m_toolStyle = wxTOOL_STYLE_SEPARATOR;
|
||||||
m_tools.Append(tool);
|
m_tools.Append(-1, tool);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxToolBarBase::ClearTools(void)
|
void wxToolBarBase::ClearTools(void)
|
||||||
|
@@ -50,10 +50,15 @@
|
|||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// use debug CRT functions for memory leak detections in VC++
|
// use debug CRT functions for memory leak detections in VC++ if we're not
|
||||||
/* Here we go again commenting it out. PLEASE don't
|
// using wxWindows own methods
|
||||||
* uncomment this again.
|
#if defined(__WXDEBUG__) && defined(_MSC_VER) && !wxUSE_GLOBAL_MEMORY_OPERATORS
|
||||||
#if defined(__WXDEBUG__) && defined(_MSC_VER)
|
#define wxUSE_VC_CRTDBG
|
||||||
|
#else
|
||||||
|
#undef wxUSE_VC_CRTDBG
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef wxUSE_VC_CRTDBG
|
||||||
// VC++ uses this macro as debug/release mode indicator
|
// VC++ uses this macro as debug/release mode indicator
|
||||||
#ifndef _DEBUG
|
#ifndef _DEBUG
|
||||||
#define _DEBUG
|
#define _DEBUG
|
||||||
@@ -61,7 +66,6 @@
|
|||||||
|
|
||||||
#include <crtdbg.h>
|
#include <crtdbg.h>
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
|
|
||||||
extern char *wxBuffer;
|
extern char *wxBuffer;
|
||||||
extern char *wxOsVersion;
|
extern char *wxOsVersion;
|
||||||
@@ -115,32 +119,12 @@ bool wxApp::Initialize()
|
|||||||
{
|
{
|
||||||
wxBuffer = new char[1500];
|
wxBuffer = new char[1500];
|
||||||
|
|
||||||
/* PLEASE don't uncomment this again. IT DOESN'T WORK when building
|
#ifdef wxUSE_VC_CRTDBG
|
||||||
* using the makefile.
|
|
||||||
#if defined(__WXDEBUG__) && defined(_MSC_VER)
|
|
||||||
// do check for memory leaks on program exit
|
// do check for memory leaks on program exit
|
||||||
// (another useful flag is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free
|
// (another useful flag is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free
|
||||||
// deallocated memory which may be used to simulate low-memory condition)
|
// deallocated memory which may be used to simulate low-memory condition)
|
||||||
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
|
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
|
||||||
#endif // debug build under MS VC++
|
#endif // debug build under MS VC++
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// 22/11/98: we're converting to wxLogDebug instead of wxTrace,
|
|
||||||
// so these are now obsolete.
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
|
||||||
#if defined(_WINDLL)
|
|
||||||
streambuf* sBuf = NULL;
|
|
||||||
#else // EXE
|
|
||||||
streambuf* sBuf = new wxDebugStreamBuf;
|
|
||||||
#endif // DLL
|
|
||||||
|
|
||||||
ostream* oStr = new ostream(sBuf) ;
|
|
||||||
wxDebugContext::SetStream(oStr, sBuf);
|
|
||||||
#endif // wxUSE_MEMORY_TRACING
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxClassInfo::InitializeClasses();
|
wxClassInfo::InitializeClasses();
|
||||||
|
|
||||||
|
@@ -739,35 +739,35 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla
|
|||||||
bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
|
bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
|
||||||
{
|
{
|
||||||
#if wxUSE_XPM_IN_MSW
|
#if wxUSE_XPM_IN_MSW
|
||||||
HDC dc = NULL;
|
HDC dc = NULL;
|
||||||
|
|
||||||
Visual *visual = NULL;
|
XImage ximage;
|
||||||
XImage ximage;
|
|
||||||
|
dc = CreateCompatibleDC(NULL);
|
||||||
dc = CreateCompatibleDC(NULL);
|
if (dc)
|
||||||
if (dc)
|
{
|
||||||
{
|
|
||||||
if (SelectObject(dc, (HBITMAP) M_BITMAPHANDLERDATA->m_hBitmap))
|
if (SelectObject(dc, (HBITMAP) M_BITMAPHANDLERDATA->m_hBitmap))
|
||||||
{ /* for following SetPixel */
|
{
|
||||||
/* fill the XImage struct 'by hand' */
|
/* for following SetPixel */
|
||||||
ximage.width = M_BITMAPHANDLERDATA->m_width;
|
/* fill the XImage struct 'by hand' */
|
||||||
ximage.height = M_BITMAPHANDLERDATA->m_height;
|
ximage.width = M_BITMAPHANDLERDATA->m_width;
|
||||||
ximage.depth = M_BITMAPHANDLERDATA->m_depth;
|
ximage.height = M_BITMAPHANDLERDATA->m_height;
|
||||||
ximage.bitmap = (void *)M_BITMAPHANDLERDATA->m_hBitmap;
|
ximage.depth = M_BITMAPHANDLERDATA->m_depth;
|
||||||
int errorStatus = XpmWriteFileFromImage(&dc, WXSTRINGCAST name,
|
ximage.bitmap = (HBITMAP)M_BITMAPHANDLERDATA->m_hBitmap;
|
||||||
&ximage, (XImage *) NULL, (XpmAttributes *) NULL);
|
int errorStatus = XpmWriteFileFromImage(&dc, WXSTRINGCAST name,
|
||||||
|
&ximage, (XImage *) NULL, (XpmAttributes *) NULL);
|
||||||
if (dc)
|
|
||||||
DeleteDC(dc);
|
if (dc)
|
||||||
|
DeleteDC(dc);
|
||||||
if (errorStatus == XpmSuccess)
|
|
||||||
return TRUE; /* no error */
|
if (errorStatus == XpmSuccess)
|
||||||
else
|
return TRUE; /* no error */
|
||||||
return FALSE;
|
else
|
||||||
|
return FALSE;
|
||||||
} else return FALSE;
|
} else return FALSE;
|
||||||
} else return FALSE;
|
} else return FALSE;
|
||||||
#else
|
#else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// Created: 04/01/98
|
// Created: 04/01/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart and Markus Holzem
|
// Copyright: (c) Julian Smart and Markus Holzem
|
||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -52,8 +52,8 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
|||||||
|
|
||||||
if ( style & wxBU_AUTODRAW )
|
if ( style & wxBU_AUTODRAW )
|
||||||
{
|
{
|
||||||
m_marginX = wxDEFAULT_BUTTON_MARGIN;
|
m_marginX = wxDEFAULT_BUTTON_MARGIN;
|
||||||
m_marginY = wxDEFAULT_BUTTON_MARGIN;
|
m_marginY = wxDEFAULT_BUTTON_MARGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
int x = pos.x;
|
int x = pos.x;
|
||||||
@@ -67,10 +67,10 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
|||||||
m_windowId = id;
|
m_windowId = id;
|
||||||
|
|
||||||
if ( width == -1 && bitmap.Ok())
|
if ( width == -1 && bitmap.Ok())
|
||||||
width = bitmap.GetWidth() + 2*m_marginX;
|
width = bitmap.GetWidth() + 2*m_marginX;
|
||||||
|
|
||||||
if ( height == -1 && bitmap.Ok())
|
if ( height == -1 && bitmap.Ok())
|
||||||
height = bitmap.GetHeight() + 2*m_marginY;
|
height = bitmap.GetHeight() + 2*m_marginY;
|
||||||
|
|
||||||
HWND wx_button =
|
HWND wx_button =
|
||||||
CreateWindowEx(0, "BUTTON", "", BS_OWNERDRAW | WS_TABSTOP | WS_CHILD,
|
CreateWindowEx(0, "BUTTON", "", BS_OWNERDRAW | WS_TABSTOP | WS_CHILD,
|
||||||
@@ -97,22 +97,22 @@ void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
|
|||||||
|
|
||||||
bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||||
{
|
{
|
||||||
long style = GetWindowLong((HWND) GetHWND(), GWL_STYLE);
|
long style = GetWindowLong((HWND) GetHWND(), GWL_STYLE);
|
||||||
#if defined(__WIN95__)
|
#if defined(__WIN95__)
|
||||||
if (style & BS_BITMAP)
|
if (style & BS_BITMAP)
|
||||||
{
|
{
|
||||||
// Should we call Default() here?
|
// Should we call Default() here?
|
||||||
// Default();
|
// Default();
|
||||||
|
|
||||||
// Let default procedure draw the bitmap, which is defined
|
// Let default procedure draw the bitmap, which is defined
|
||||||
// in the Windows resource.
|
// in the Windows resource.
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT) item;
|
LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT) item;
|
||||||
|
|
||||||
wxBitmap* bitmap = &m_buttonBitmap;
|
wxBitmap* bitmap = &m_buttonBitmap;
|
||||||
|
|
||||||
UINT state = lpDIS->itemState;
|
UINT state = lpDIS->itemState;
|
||||||
if ((state & ODS_SELECTED) && m_buttonBitmapSelected.Ok())
|
if ((state & ODS_SELECTED) && m_buttonBitmapSelected.Ok())
|
||||||
@@ -143,24 +143,24 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
|||||||
DrawFace((WXHDC) hDC, lpDIS->rcItem.left, lpDIS->rcItem.top, lpDIS->rcItem.right, lpDIS->rcItem.bottom,
|
DrawFace((WXHDC) hDC, lpDIS->rcItem.left, lpDIS->rcItem.top, lpDIS->rcItem.right, lpDIS->rcItem.bottom,
|
||||||
((state & ODS_SELECTED) == ODS_SELECTED));
|
((state & ODS_SELECTED) == ODS_SELECTED));
|
||||||
|
|
||||||
// Centre the bitmap in the control area
|
// Centre the bitmap in the control area
|
||||||
int x1 = (int) (x + ((width - bitmap->GetWidth()) / 2));
|
int x1 = (int) (x + ((width - bitmap->GetWidth()) / 2));
|
||||||
int y1 = (int) (y + ((height - bitmap->GetHeight()) / 2));
|
int y1 = (int) (y + ((height - bitmap->GetHeight()) / 2));
|
||||||
|
|
||||||
if ( (state & ODS_SELECTED) && (GetWindowStyleFlag() & wxBU_AUTODRAW) )
|
if ( (state & ODS_SELECTED) && (GetWindowStyleFlag() & wxBU_AUTODRAW) )
|
||||||
{
|
{
|
||||||
x1 ++;
|
x1 ++;
|
||||||
y1 ++;
|
y1 ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
::BitBlt(hDC, x1, y1, bitmap->GetWidth(), bitmap->GetHeight(), memDC, 0, 0, SRCCOPY);
|
::BitBlt(hDC, x1, y1, bitmap->GetWidth(), bitmap->GetHeight(), memDC, 0, 0, SRCCOPY);
|
||||||
|
|
||||||
if ( (state & ODS_DISABLED) && (GetWindowStyleFlag() & wxBU_AUTODRAW) )
|
if ( (state & ODS_DISABLED) && (GetWindowStyleFlag() & wxBU_AUTODRAW) )
|
||||||
DrawButtonDisable( (WXHDC) hDC, lpDIS->rcItem.left, lpDIS->rcItem.top, lpDIS->rcItem.right, lpDIS->rcItem.bottom, TRUE ) ;
|
DrawButtonDisable( (WXHDC) hDC, lpDIS->rcItem.left, lpDIS->rcItem.top, lpDIS->rcItem.right, lpDIS->rcItem.bottom, TRUE ) ;
|
||||||
else if ( (state & ODS_FOCUS) && (GetWindowStyleFlag() & wxBU_AUTODRAW) )
|
else if ( (state & ODS_FOCUS) && (GetWindowStyleFlag() & wxBU_AUTODRAW) )
|
||||||
DrawButtonFocus( (WXHDC) hDC, lpDIS->rcItem.left, lpDIS->rcItem.top, lpDIS->rcItem.right, lpDIS->rcItem.bottom, ((state & ODS_SELECTED) == ODS_SELECTED));
|
DrawButtonFocus( (WXHDC) hDC, lpDIS->rcItem.left, lpDIS->rcItem.top, lpDIS->rcItem.right, lpDIS->rcItem.bottom, ((state & ODS_SELECTED) == ODS_SELECTED));
|
||||||
|
|
||||||
::SelectObject(memDC, old);
|
::SelectObject(memDC, old);
|
||||||
|
|
||||||
::DeleteDC(memDC);
|
::DeleteDC(memDC);
|
||||||
|
|
||||||
@@ -169,8 +169,8 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
|||||||
|
|
||||||
void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel )
|
void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel )
|
||||||
{
|
{
|
||||||
HPEN oldp;
|
HPEN oldp;
|
||||||
HBRUSH oldb ;
|
HBRUSH oldb ;
|
||||||
|
|
||||||
HPEN penBorder;
|
HPEN penBorder;
|
||||||
HPEN penLight;
|
HPEN penLight;
|
||||||
@@ -178,51 +178,51 @@ void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, int right, int botto
|
|||||||
HBRUSH brushFace;
|
HBRUSH brushFace;
|
||||||
COLORREF ms_color;
|
COLORREF ms_color;
|
||||||
|
|
||||||
ms_color = GetSysColor(COLOR_WINDOWFRAME) ;
|
ms_color = GetSysColor(COLOR_WINDOWFRAME) ;
|
||||||
penBorder = CreatePen(PS_SOLID,0,ms_color) ;
|
penBorder = CreatePen(PS_SOLID,0,ms_color) ;
|
||||||
|
|
||||||
ms_color = GetSysColor(COLOR_BTNSHADOW) ;
|
ms_color = GetSysColor(COLOR_BTNSHADOW) ;
|
||||||
penShadow = CreatePen(PS_SOLID,0,ms_color) ;
|
penShadow = CreatePen(PS_SOLID,0,ms_color) ;
|
||||||
|
|
||||||
ms_color = GetSysColor(COLOR_BTNHIGHLIGHT) ;
|
ms_color = GetSysColor(COLOR_BTNHIGHLIGHT) ;
|
||||||
penLight = CreatePen(PS_SOLID,0,ms_color) ;
|
penLight = CreatePen(PS_SOLID,0,ms_color) ;
|
||||||
|
|
||||||
ms_color = GetSysColor(COLOR_BTNFACE) ;
|
ms_color = GetSysColor(COLOR_BTNFACE) ;
|
||||||
brushFace = CreateSolidBrush(ms_color) ;
|
brushFace = CreateSolidBrush(ms_color) ;
|
||||||
|
|
||||||
oldp = (HPEN) SelectObject( (HDC) dc, GetStockObject( NULL_PEN ) ) ;
|
oldp = (HPEN) SelectObject( (HDC) dc, GetStockObject( NULL_PEN ) ) ;
|
||||||
oldb = (HBRUSH) SelectObject( (HDC) dc, brushFace ) ;
|
oldb = (HBRUSH) SelectObject( (HDC) dc, brushFace ) ;
|
||||||
Rectangle( (HDC) dc, left, top, right, bottom ) ;
|
Rectangle( (HDC) dc, left, top, right, bottom ) ;
|
||||||
SelectObject( (HDC) dc, penBorder) ;
|
SelectObject( (HDC) dc, penBorder) ;
|
||||||
MoveToEx((HDC) dc,left+1,top,NULL);LineTo((HDC) dc,right-1,top);
|
MoveToEx((HDC) dc,left+1,top,NULL);LineTo((HDC) dc,right-1,top);
|
||||||
MoveToEx((HDC) dc,left,top+1,NULL);LineTo((HDC) dc,left,bottom-1);
|
MoveToEx((HDC) dc,left,top+1,NULL);LineTo((HDC) dc,left,bottom-1);
|
||||||
MoveToEx((HDC) dc,left+1,bottom-1,NULL);LineTo((HDC) dc,right-1,bottom-1);
|
MoveToEx((HDC) dc,left+1,bottom-1,NULL);LineTo((HDC) dc,right-1,bottom-1);
|
||||||
MoveToEx((HDC) dc,right-1,top+1,NULL);LineTo((HDC) dc,right-1,bottom-1);
|
MoveToEx((HDC) dc,right-1,top+1,NULL);LineTo((HDC) dc,right-1,bottom-1);
|
||||||
|
|
||||||
SelectObject( (HDC) dc, penShadow) ;
|
SelectObject( (HDC) dc, penShadow) ;
|
||||||
if (sel)
|
if (sel)
|
||||||
{
|
{
|
||||||
MoveToEx((HDC) dc,left+1 ,bottom-2 ,NULL) ;
|
MoveToEx((HDC) dc,left+1 ,bottom-2 ,NULL) ;
|
||||||
LineTo((HDC) dc, left+1 ,top+1) ;
|
LineTo((HDC) dc, left+1 ,top+1) ;
|
||||||
LineTo((HDC) dc, right-2 ,top+1) ;
|
LineTo((HDC) dc, right-2 ,top+1) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MoveToEx((HDC) dc,left+1 ,bottom-2 ,NULL) ;
|
MoveToEx((HDC) dc,left+1 ,bottom-2 ,NULL) ;
|
||||||
LineTo((HDC) dc, right-2 ,bottom-2) ;
|
LineTo((HDC) dc, right-2 ,bottom-2) ;
|
||||||
LineTo((HDC) dc, right-2 ,top) ;
|
LineTo((HDC) dc, right-2 ,top) ;
|
||||||
MoveToEx((HDC) dc,left+2 ,bottom-3 ,NULL) ;
|
MoveToEx((HDC) dc,left+2 ,bottom-3 ,NULL) ;
|
||||||
LineTo((HDC) dc, right-3 ,bottom-3) ;
|
LineTo((HDC) dc, right-3 ,bottom-3) ;
|
||||||
LineTo((HDC) dc, right-3 ,top+1) ;
|
LineTo((HDC) dc, right-3 ,top+1) ;
|
||||||
|
|
||||||
SelectObject( (HDC) dc, penLight) ;
|
SelectObject( (HDC) dc, penLight) ;
|
||||||
|
|
||||||
MoveToEx((HDC) dc,left+1 ,bottom-2 ,NULL) ;
|
MoveToEx((HDC) dc,left+1 ,bottom-2 ,NULL) ;
|
||||||
LineTo((HDC) dc, left+1 ,top+1) ;
|
LineTo((HDC) dc, left+1 ,top+1) ;
|
||||||
LineTo((HDC) dc, right-2 ,top+1) ;
|
LineTo((HDC) dc, right-2 ,top+1) ;
|
||||||
}
|
}
|
||||||
SelectObject((HDC) dc,oldp) ;
|
SelectObject((HDC) dc,oldp) ;
|
||||||
SelectObject((HDC) dc,oldb) ;
|
SelectObject((HDC) dc,oldb) ;
|
||||||
|
|
||||||
DeleteObject(penBorder);
|
DeleteObject(penBorder);
|
||||||
DeleteObject(penLight);
|
DeleteObject(penLight);
|
||||||
@@ -234,28 +234,28 @@ void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, int right, int botto
|
|||||||
|
|
||||||
void wxBitmapButton::DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel )
|
void wxBitmapButton::DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel )
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
rect.left = left;
|
rect.left = left;
|
||||||
rect.top = top;
|
rect.top = top;
|
||||||
rect.right = right;
|
rect.right = right;
|
||||||
rect.bottom = bottom;
|
rect.bottom = bottom;
|
||||||
InflateRect( &rect, - FOCUS_MARGIN, - FOCUS_MARGIN ) ;
|
InflateRect( &rect, - FOCUS_MARGIN, - FOCUS_MARGIN ) ;
|
||||||
if ( sel )
|
if ( sel )
|
||||||
OffsetRect( &rect, 1, 1 ) ;
|
OffsetRect( &rect, 1, 1 ) ;
|
||||||
DrawFocusRect( (HDC) dc, &rect ) ;
|
DrawFocusRect( (HDC) dc, &rect ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern HBRUSH wxDisableButtonBrush;
|
extern HBRUSH wxDisableButtonBrush;
|
||||||
void wxBitmapButton::DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg )
|
void wxBitmapButton::DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg )
|
||||||
{
|
{
|
||||||
HBRUSH old = (HBRUSH) SelectObject( (HDC) dc, wxDisableButtonBrush ) ;
|
HBRUSH old = (HBRUSH) SelectObject( (HDC) dc, wxDisableButtonBrush ) ;
|
||||||
|
|
||||||
if ( with_marg )
|
if ( with_marg )
|
||||||
::PatBlt( (HDC) dc, left + m_marginX, top + m_marginY,
|
::PatBlt( (HDC) dc, left + m_marginX, top + m_marginY,
|
||||||
right - 2 * m_marginX, bottom - 2 * m_marginY,
|
right - 2 * m_marginX, bottom - 2 * m_marginY,
|
||||||
0xfa0089ul ) ;
|
0xfa0089ul ) ;
|
||||||
else ::PatBlt( (HDC) dc, left, top, right, bottom, 0xfa0089ul ) ;
|
else ::PatBlt( (HDC) dc, left, top, right, bottom, 0xfa0089ul ) ;
|
||||||
|
|
||||||
::SelectObject( (HDC) dc, old ) ;
|
::SelectObject( (HDC) dc, old ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -240,6 +240,12 @@ void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
control_width = longest + cx*5;
|
control_width = longest + cx*5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If non-default width...
|
||||||
|
control_width = w1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Choice drop-down list depends on number of items (limited to 10)
|
// Choice drop-down list depends on number of items (limited to 10)
|
||||||
if (h1 <= 0)
|
if (h1 <= 0)
|
||||||
@@ -250,10 +256,6 @@ void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
h1 = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)*(wxMin(10, m_noStrings) + 1);
|
h1 = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)*(wxMin(10, m_noStrings) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If non-default width...
|
|
||||||
if (w1 >= 0)
|
|
||||||
control_width = w1;
|
|
||||||
|
|
||||||
control_height = h1;
|
control_height = h1;
|
||||||
|
|
||||||
// Calculations may have made text size too small
|
// Calculations may have made text size too small
|
||||||
|
@@ -185,7 +185,8 @@ long wxControl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
return wxWindow::MSWWindowProc(nMsg, wParam, lParam);
|
return wxWindow::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxControl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
bool wxControl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam,
|
||||||
|
WXLPARAM* WXUNUSED(result))
|
||||||
{
|
{
|
||||||
#if defined(__WIN95__)
|
#if defined(__WIN95__)
|
||||||
wxCommandEvent event(wxEVT_NULL, m_windowId);
|
wxCommandEvent event(wxEVT_NULL, m_windowId);
|
||||||
@@ -235,18 +236,18 @@ bool wxControl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
default :
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event.SetEventType(eventType);
|
event.SetEventType(eventType);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
|
|
||||||
if ( !GetEventHandler()->ProcessEvent(event) )
|
if ( !GetEventHandler()->ProcessEvent(event) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
#else // !Win95
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
308
src/msw/dc.cpp
308
src/msw/dc.cpp
@@ -6,7 +6,7 @@
|
|||||||
// Created: 01/02/97
|
// Created: 01/02/97
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart and Markus Holzem
|
// Copyright: (c) Julian Smart and Markus Holzem
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -242,7 +242,7 @@ void wxDC::SetPalette(const wxPalette& palette)
|
|||||||
m_oldPalette = 0;
|
m_oldPalette = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_palette.Ok() && m_palette.GetHPALETTE())
|
if (m_palette.Ok() && m_palette.GetHPALETTE())
|
||||||
@@ -474,28 +474,28 @@ void wxDC::DrawRectangle(long x, long y, long width, long height)
|
|||||||
do_pen = m_pen.Ok() && m_pen.GetStyle() != wxTRANSPARENT;
|
do_pen = m_pen.Ok() && m_pen.GetStyle() != wxTRANSPARENT;
|
||||||
|
|
||||||
if (do_brush) {
|
if (do_brush) {
|
||||||
HPEN orig_pen = NULL;
|
HPEN orig_pen = NULL;
|
||||||
|
|
||||||
if (do_pen || !m_pen.Ok())
|
if (do_pen || !m_pen.Ok())
|
||||||
orig_pen = (HPEN) ::SelectObject((HDC) m_hDC, (HPEN) ::GetStockObject(NULL_PEN));
|
orig_pen = (HPEN) ::SelectObject((HDC) m_hDC, (HPEN) ::GetStockObject(NULL_PEN));
|
||||||
|
|
||||||
(void)Rectangle((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y),
|
(void)Rectangle((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y),
|
||||||
XLOG2DEV(x2) + 1, YLOG2DEV(y2) + 1);
|
XLOG2DEV(x2) + 1, YLOG2DEV(y2) + 1);
|
||||||
|
|
||||||
if (do_pen || !m_pen.Ok())
|
if (do_pen || !m_pen.Ok())
|
||||||
::SelectObject((HDC) m_hDC , orig_pen);
|
::SelectObject((HDC) m_hDC , orig_pen);
|
||||||
}
|
}
|
||||||
if (do_pen) {
|
if (do_pen) {
|
||||||
HBRUSH orig_brush = NULL;
|
HBRUSH orig_brush = NULL;
|
||||||
|
|
||||||
if (do_brush || !m_brush.Ok())
|
if (do_brush || !m_brush.Ok())
|
||||||
orig_brush = (HBRUSH) ::SelectObject((HDC) m_hDC, (HBRUSH) ::GetStockObject(NULL_BRUSH));
|
orig_brush = (HBRUSH) ::SelectObject((HDC) m_hDC, (HBRUSH) ::GetStockObject(NULL_BRUSH));
|
||||||
|
|
||||||
(void)Rectangle((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y),
|
(void)Rectangle((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y),
|
||||||
XLOG2DEV(x2), YLOG2DEV(y2));
|
XLOG2DEV(x2), YLOG2DEV(y2));
|
||||||
|
|
||||||
if (do_brush || !m_brush.Ok())
|
if (do_brush || !m_brush.Ok())
|
||||||
::SelectObject((HDC) m_hDC, orig_brush);
|
::SelectObject((HDC) m_hDC, orig_brush);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
(void)Rectangle((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
|
(void)Rectangle((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
|
||||||
@@ -563,16 +563,16 @@ void wxDC::DrawEllipticArc(long x,long y,long w,long h,double sa,double ea)
|
|||||||
if (m_signY > 0)
|
if (m_signY > 0)
|
||||||
{
|
{
|
||||||
(void)Pie((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2)+1, YLOG2DEV(y2)+1,
|
(void)Pie((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2)+1, YLOG2DEV(y2)+1,
|
||||||
rx1, ry1, rx2, ry2);
|
rx1, ry1, rx2, ry2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(void)Pie((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y)-1, XLOG2DEV(x2)+1, YLOG2DEV(y2),
|
(void)Pie((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y)-1, XLOG2DEV(x2)+1, YLOG2DEV(y2),
|
||||||
rx1, ry1-1, rx2, ry2-1);
|
rx1, ry1-1, rx2, ry2-1);
|
||||||
}
|
}
|
||||||
::SelectObject((HDC) m_hDC, orig_pen);
|
::SelectObject((HDC) m_hDC, orig_pen);
|
||||||
(void)Arc((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2),
|
(void)Arc((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2),
|
||||||
rx1, ry1, rx2, ry2);
|
rx1, ry1, rx2, ry2);
|
||||||
|
|
||||||
CalcBoundingBox(x, y);
|
CalcBoundingBox(x, y);
|
||||||
CalcBoundingBox(x2, y2);
|
CalcBoundingBox(x2, y2);
|
||||||
@@ -692,7 +692,7 @@ void wxDC::DrawText(const wxString& text, long x, long y, bool use16bit)
|
|||||||
if (m_textForegroundColour.Ok())
|
if (m_textForegroundColour.Ok())
|
||||||
SetTextColor((HDC) m_hDC, m_textForegroundColour.GetPixel() ) ;
|
SetTextColor((HDC) m_hDC, m_textForegroundColour.GetPixel() ) ;
|
||||||
|
|
||||||
DWORD old_background;
|
DWORD old_background = 0;
|
||||||
if (m_textBackgroundColour.Ok())
|
if (m_textBackgroundColour.Ok())
|
||||||
{
|
{
|
||||||
old_background = SetBkColor((HDC) m_hDC, m_textBackgroundColour.GetPixel() ) ;
|
old_background = SetBkColor((HDC) m_hDC, m_textBackgroundColour.GetPixel() ) ;
|
||||||
@@ -1007,42 +1007,42 @@ void wxDC::SetDeviceOrigin(long x, long y)
|
|||||||
|
|
||||||
long wxDC::DeviceToLogicalX(long x) const
|
long wxDC::DeviceToLogicalX(long x) const
|
||||||
{
|
{
|
||||||
return (long) (((x) - m_deviceOriginX)/(m_logicalScaleX*m_userScaleX*m_signX*m_systemScaleX) - m_logicalOriginX) ;
|
return (long) (((x) - m_deviceOriginX)/(m_logicalScaleX*m_userScaleX*m_signX*m_systemScaleX) - m_logicalOriginX) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::DeviceToLogicalXRel(long x) const
|
long wxDC::DeviceToLogicalXRel(long x) const
|
||||||
{
|
{
|
||||||
return (long) ((x)/(m_logicalScaleX*m_userScaleX*m_signX*m_systemScaleX)) ;
|
return (long) ((x)/(m_logicalScaleX*m_userScaleX*m_signX*m_systemScaleX)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::DeviceToLogicalY(long y) const
|
long wxDC::DeviceToLogicalY(long y) const
|
||||||
{
|
{
|
||||||
return (long) (((y) - m_deviceOriginY)/(m_logicalScaleY*m_userScaleY*m_signY*m_systemScaleY) - m_logicalOriginY) ;
|
return (long) (((y) - m_deviceOriginY)/(m_logicalScaleY*m_userScaleY*m_signY*m_systemScaleY) - m_logicalOriginY) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::DeviceToLogicalYRel(long y) const
|
long wxDC::DeviceToLogicalYRel(long y) const
|
||||||
{
|
{
|
||||||
return (long) ((y)/(m_logicalScaleY*m_userScaleY*m_signY*m_systemScaleY)) ;
|
return (long) ((y)/(m_logicalScaleY*m_userScaleY*m_signY*m_systemScaleY)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::LogicalToDeviceX(long x) const
|
long wxDC::LogicalToDeviceX(long x) const
|
||||||
{
|
{
|
||||||
return (long) (floor((x) - m_logicalOriginX)*m_logicalScaleX*m_userScaleX*m_signX*m_systemScaleX + m_deviceOriginX) ;
|
return (long) (floor((x) - m_logicalOriginX)*m_logicalScaleX*m_userScaleX*m_signX*m_systemScaleX + m_deviceOriginX) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::LogicalToDeviceXRel(long x) const
|
long wxDC::LogicalToDeviceXRel(long x) const
|
||||||
{
|
{
|
||||||
return (long) (floor(x)*m_logicalScaleX*m_userScaleX*m_signX*m_systemScaleX) ;
|
return (long) (floor(x)*m_logicalScaleX*m_userScaleX*m_signX*m_systemScaleX) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::LogicalToDeviceY(long y) const
|
long wxDC::LogicalToDeviceY(long y) const
|
||||||
{
|
{
|
||||||
return (long) (floor((y) - m_logicalOriginY)*m_logicalScaleY*m_userScaleY*m_signY*m_systemScaleY + m_deviceOriginY);
|
return (long) (floor((y) - m_logicalOriginY)*m_logicalScaleY*m_userScaleY*m_signY*m_systemScaleY + m_deviceOriginY);
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::LogicalToDeviceYRel(long y) const
|
long wxDC::LogicalToDeviceYRel(long y) const
|
||||||
{
|
{
|
||||||
return (long) (floor(y)*m_logicalScaleY*m_userScaleY*m_signY*m_systemScaleY) ;
|
return (long) (floor(y)*m_logicalScaleY*m_userScaleY*m_signY*m_systemScaleY) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This group of functions may not do any conversion
|
// This group of functions may not do any conversion
|
||||||
@@ -1051,50 +1051,50 @@ long wxDC::LogicalToDeviceYRel(long y) const
|
|||||||
|
|
||||||
long wxDC::ImplDeviceToLogicalX(long x) const
|
long wxDC::ImplDeviceToLogicalX(long x) const
|
||||||
{
|
{
|
||||||
// return (m_scaleGDI ? x : DeviceToLogicalX(x));
|
// return (m_scaleGDI ? x : DeviceToLogicalX(x));
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::ImplDeviceToLogicalY(long y) const
|
long wxDC::ImplDeviceToLogicalY(long y) const
|
||||||
{
|
{
|
||||||
// return (m_scaleGDI ? y : DeviceToLogicalY(y));
|
// return (m_scaleGDI ? y : DeviceToLogicalY(y));
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::ImplDeviceToLogicalXRel(long x) const
|
long wxDC::ImplDeviceToLogicalXRel(long x) const
|
||||||
{
|
{
|
||||||
// return (m_scaleGDI ? x : DeviceToLogicalXRel(x));
|
// return (m_scaleGDI ? x : DeviceToLogicalXRel(x));
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::ImplDeviceToLogicalYRel(long y) const
|
long wxDC::ImplDeviceToLogicalYRel(long y) const
|
||||||
{
|
{
|
||||||
// return (m_scaleGDI ? y : DeviceToLogicalYRel(y));
|
// return (m_scaleGDI ? y : DeviceToLogicalYRel(y));
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::ImplLogicalToDeviceX(long x) const
|
long wxDC::ImplLogicalToDeviceX(long x) const
|
||||||
{
|
{
|
||||||
// return (m_scaleGDI ? (floor(double(x))) : LogicalToDeviceX(x));
|
// return (m_scaleGDI ? (floor(double(x))) : LogicalToDeviceX(x));
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::ImplLogicalToDeviceY(long y) const
|
long wxDC::ImplLogicalToDeviceY(long y) const
|
||||||
{
|
{
|
||||||
// return (m_scaleGDI ? (floor(double(y))) : LogicalToDeviceY(y));
|
// return (m_scaleGDI ? (floor(double(y))) : LogicalToDeviceY(y));
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::ImplLogicalToDeviceXRel(long x) const
|
long wxDC::ImplLogicalToDeviceXRel(long x) const
|
||||||
{
|
{
|
||||||
// return (m_scaleGDI ? (floor(double(x))) : LogicalToDeviceXRel(x));
|
// return (m_scaleGDI ? (floor(double(x))) : LogicalToDeviceXRel(x));
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxDC::ImplLogicalToDeviceYRel(long y) const
|
long wxDC::ImplLogicalToDeviceYRel(long y) const
|
||||||
{
|
{
|
||||||
// return (m_scaleGDI ? (floor(double(y))) : LogicalToDeviceYRel(y));
|
// return (m_scaleGDI ? (floor(double(y))) : LogicalToDeviceYRel(y));
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDC::Blit(long xdest, long ydest, long width, long height,
|
bool wxDC::Blit(long xdest, long ydest, long width, long height,
|
||||||
@@ -1111,11 +1111,11 @@ bool wxDC::Blit(long xdest, long ydest, long width, long height,
|
|||||||
COLORREF old_background = ::GetBkColor((HDC)m_hDC);
|
COLORREF old_background = ::GetBkColor((HDC)m_hDC);
|
||||||
if (m_textForegroundColour.Ok())
|
if (m_textForegroundColour.Ok())
|
||||||
{
|
{
|
||||||
::SetTextColor((HDC) m_hDC, m_textForegroundColour.GetPixel() ) ;
|
::SetTextColor((HDC) m_hDC, m_textForegroundColour.GetPixel() ) ;
|
||||||
}
|
}
|
||||||
if (m_textBackgroundColour.Ok())
|
if (m_textBackgroundColour.Ok())
|
||||||
{
|
{
|
||||||
::SetBkColor((HDC) m_hDC, m_textBackgroundColour.GetPixel() ) ;
|
::SetBkColor((HDC) m_hDC, m_textBackgroundColour.GetPixel() ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD dwRop = rop == wxCOPY ? SRCCOPY :
|
DWORD dwRop = rop == wxCOPY ? SRCCOPY :
|
||||||
@@ -1132,12 +1132,12 @@ bool wxDC::Blit(long xdest, long ydest, long width, long height,
|
|||||||
rop == wxSRC_AND ? SRCAND :
|
rop == wxSRC_AND ? SRCAND :
|
||||||
SRCCOPY;
|
SRCCOPY;
|
||||||
|
|
||||||
bool success;
|
bool success = TRUE;
|
||||||
if (useMask && source->m_selectedBitmap.Ok() && source->m_selectedBitmap.GetMask())
|
if (useMask && source->m_selectedBitmap.Ok() && source->m_selectedBitmap.GetMask())
|
||||||
{
|
{
|
||||||
|
|
||||||
#if 0 // __WIN32__
|
#if 0 // __WIN32__
|
||||||
// Not implemented under Win95 (or maybe a specific device?)
|
// Not implemented under Win95 (or maybe a specific device?)
|
||||||
if (MaskBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height,
|
if (MaskBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height,
|
||||||
(HDC) source->m_hDC, xsrc1, ysrc1, (HBITMAP) source->m_selectedBitmap.GetMask()->GetMaskBitmap(),
|
(HDC) source->m_hDC, xsrc1, ysrc1, (HBITMAP) source->m_selectedBitmap.GetMask()->GetMaskBitmap(),
|
||||||
0, 0, 0xAACC0020))
|
0, 0, 0xAACC0020))
|
||||||
@@ -1149,116 +1149,116 @@ bool wxDC::Blit(long xdest, long ydest, long width, long height,
|
|||||||
{
|
{
|
||||||
// Old code
|
// Old code
|
||||||
#if 0
|
#if 0
|
||||||
HDC dc_mask = CreateCompatibleDC((HDC) source->m_hDC);
|
HDC dc_mask = CreateCompatibleDC((HDC) source->m_hDC);
|
||||||
::SelectObject(dc_mask, (HBITMAP) source->m_selectedBitmap.GetMask()->GetMaskBitmap());
|
::SelectObject(dc_mask, (HBITMAP) source->m_selectedBitmap.GetMask()->GetMaskBitmap());
|
||||||
success = (BitBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height,
|
success = (BitBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height,
|
||||||
dc_mask, xsrc1, ysrc1, 0x00220326 /* NOTSRCAND */) != 0);
|
dc_mask, xsrc1, ysrc1, 0x00220326 /* NOTSRCAND */) != 0);
|
||||||
success = (BitBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height,
|
success = (BitBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height,
|
||||||
(HDC) source->m_hDC, xsrc1, ysrc1, SRCPAINT) != 0);
|
(HDC) source->m_hDC, xsrc1, ysrc1, SRCPAINT) != 0);
|
||||||
::SelectObject(dc_mask, 0);
|
::SelectObject(dc_mask, 0);
|
||||||
::DeleteDC(dc_mask);
|
::DeleteDC(dc_mask);
|
||||||
#endif
|
#endif
|
||||||
// New code from Chris Breeze, 15/7/98
|
// New code from Chris Breeze, 15/7/98
|
||||||
// Blit bitmap with mask
|
// Blit bitmap with mask
|
||||||
|
|
||||||
if (IsKindOf(CLASSINFO(wxPrinterDC)))
|
if (IsKindOf(CLASSINFO(wxPrinterDC)))
|
||||||
{
|
{
|
||||||
// If we are printing source colours are screen colours
|
// If we are printing source colours are screen colours
|
||||||
// not printer colours and so we need copy the bitmap
|
// not printer colours and so we need copy the bitmap
|
||||||
// pixel by pixel.
|
// pixel by pixel.
|
||||||
RECT rect;
|
RECT rect;
|
||||||
HDC dc_mask = ::CreateCompatibleDC((HDC) source->m_hDC);
|
HDC dc_mask = ::CreateCompatibleDC((HDC) source->m_hDC);
|
||||||
HDC dc_src = (HDC) source->m_hDC;
|
HDC dc_src = (HDC) source->m_hDC;
|
||||||
|
|
||||||
::SelectObject(dc_mask, (HBITMAP) source->m_selectedBitmap.GetMask()->GetMaskBitmap());
|
::SelectObject(dc_mask, (HBITMAP) source->m_selectedBitmap.GetMask()->GetMaskBitmap());
|
||||||
for (int x = 0; x < width; x++)
|
for (int x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
for (int y = 0; y < height; y++)
|
for (int y = 0; y < height; y++)
|
||||||
{
|
{
|
||||||
COLORREF cref = ::GetPixel(dc_mask, x, y);
|
COLORREF cref = ::GetPixel(dc_mask, x, y);
|
||||||
if (cref)
|
if (cref)
|
||||||
{
|
{
|
||||||
HBRUSH brush = ::CreateSolidBrush(::GetPixel(dc_src, x, y));
|
HBRUSH brush = ::CreateSolidBrush(::GetPixel(dc_src, x, y));
|
||||||
rect.left = xdest1 + x; rect.right = rect.left + 1;
|
rect.left = xdest1 + x; rect.right = rect.left + 1;
|
||||||
rect.top = ydest1 + y; rect.bottom = rect.top + 1;
|
rect.top = ydest1 + y; rect.bottom = rect.top + 1;
|
||||||
::FillRect((HDC) m_hDC, &rect, brush);
|
::FillRect((HDC) m_hDC, &rect, brush);
|
||||||
::DeleteObject(brush);
|
::DeleteObject(brush);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
::SelectObject(dc_mask, 0);
|
::SelectObject(dc_mask, 0);
|
||||||
::DeleteDC(dc_mask);
|
::DeleteDC(dc_mask);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// create a temp buffer bitmap and DCs to access it and the mask
|
// create a temp buffer bitmap and DCs to access it and the mask
|
||||||
HDC dc_mask = ::CreateCompatibleDC((HDC) source->m_hDC);
|
HDC dc_mask = ::CreateCompatibleDC((HDC) source->m_hDC);
|
||||||
HDC dc_buffer = ::CreateCompatibleDC((HDC) m_hDC);
|
HDC dc_buffer = ::CreateCompatibleDC((HDC) m_hDC);
|
||||||
HBITMAP buffer_bmap = ::CreateCompatibleBitmap((HDC) m_hDC, width, height);
|
HBITMAP buffer_bmap = ::CreateCompatibleBitmap((HDC) m_hDC, width, height);
|
||||||
::SelectObject(dc_mask, (HBITMAP) source->m_selectedBitmap.GetMask()->GetMaskBitmap());
|
::SelectObject(dc_mask, (HBITMAP) source->m_selectedBitmap.GetMask()->GetMaskBitmap());
|
||||||
::SelectObject(dc_buffer, buffer_bmap);
|
::SelectObject(dc_buffer, buffer_bmap);
|
||||||
|
|
||||||
// copy dest to buffer
|
// copy dest to buffer
|
||||||
::BitBlt(dc_buffer, 0, 0, (int)width, (int)height,
|
::BitBlt(dc_buffer, 0, 0, (int)width, (int)height,
|
||||||
(HDC) m_hDC, xdest1, ydest1, SRCCOPY);
|
(HDC) m_hDC, xdest1, ydest1, SRCCOPY);
|
||||||
|
|
||||||
// copy src to buffer using selected raster op
|
// copy src to buffer using selected raster op
|
||||||
::BitBlt(dc_buffer, 0, 0, (int)width, (int)height,
|
::BitBlt(dc_buffer, 0, 0, (int)width, (int)height,
|
||||||
(HDC) source->m_hDC, xsrc1, ysrc1, dwRop);
|
(HDC) source->m_hDC, xsrc1, ysrc1, dwRop);
|
||||||
|
|
||||||
// set masked area in buffer to BLACK (pixel value 0)
|
// set masked area in buffer to BLACK (pixel value 0)
|
||||||
COLORREF prevBkCol = ::SetBkColor((HDC) m_hDC, RGB(255, 255, 255));
|
COLORREF prevBkCol = ::SetBkColor((HDC) m_hDC, RGB(255, 255, 255));
|
||||||
COLORREF prevCol = ::SetTextColor((HDC) m_hDC, RGB(0, 0, 0));
|
COLORREF prevCol = ::SetTextColor((HDC) m_hDC, RGB(0, 0, 0));
|
||||||
::BitBlt(dc_buffer, 0, 0, (int)width, (int)height,
|
::BitBlt(dc_buffer, 0, 0, (int)width, (int)height,
|
||||||
dc_mask, xsrc1, ysrc1, SRCAND);
|
dc_mask, xsrc1, ysrc1, SRCAND);
|
||||||
|
|
||||||
// set unmasked area in dest to BLACK
|
// set unmasked area in dest to BLACK
|
||||||
::SetBkColor((HDC) m_hDC, RGB(0, 0, 0));
|
::SetBkColor((HDC) m_hDC, RGB(0, 0, 0));
|
||||||
::SetTextColor((HDC) m_hDC, RGB(255, 255, 255));
|
::SetTextColor((HDC) m_hDC, RGB(255, 255, 255));
|
||||||
::BitBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height,
|
::BitBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height,
|
||||||
dc_mask, xsrc1, ysrc1, SRCAND);
|
dc_mask, xsrc1, ysrc1, SRCAND);
|
||||||
::SetBkColor((HDC) m_hDC, prevBkCol); // restore colours to original values
|
::SetBkColor((HDC) m_hDC, prevBkCol); // restore colours to original values
|
||||||
::SetTextColor((HDC) m_hDC, prevCol);
|
::SetTextColor((HDC) m_hDC, prevCol);
|
||||||
|
|
||||||
// OR buffer to dest
|
// OR buffer to dest
|
||||||
success = (::BitBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height,
|
success = (::BitBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height,
|
||||||
dc_buffer, 0, 0, SRCPAINT) != 0);
|
dc_buffer, 0, 0, SRCPAINT) != 0);
|
||||||
|
|
||||||
// tidy up temporary DCs and bitmap
|
// tidy up temporary DCs and bitmap
|
||||||
::SelectObject(dc_mask, 0);
|
::SelectObject(dc_mask, 0);
|
||||||
::DeleteDC(dc_mask);
|
::DeleteDC(dc_mask);
|
||||||
::SelectObject(dc_buffer, 0);
|
::SelectObject(dc_buffer, 0);
|
||||||
::DeleteDC(dc_buffer);
|
::DeleteDC(dc_buffer);
|
||||||
::DeleteObject(buffer_bmap);
|
::DeleteObject(buffer_bmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IsKindOf(CLASSINFO(wxPrinterDC)))
|
if (IsKindOf(CLASSINFO(wxPrinterDC)))
|
||||||
{
|
{
|
||||||
// If we are printing source colours are screen colours
|
// If we are printing source colours are screen colours
|
||||||
// not printer colours and so we need copy the bitmap
|
// not printer colours and so we need copy the bitmap
|
||||||
// pixel by pixel.
|
// pixel by pixel.
|
||||||
HDC dc_src = (HDC) source->m_hDC;
|
HDC dc_src = (HDC) source->m_hDC;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
for (int x = 0; x < width; x++)
|
for (int x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
for (int y = 0; y < height; y++)
|
for (int y = 0; y < height; y++)
|
||||||
{
|
{
|
||||||
HBRUSH brush = ::CreateSolidBrush(::GetPixel(dc_src, x, y));
|
HBRUSH brush = ::CreateSolidBrush(::GetPixel(dc_src, x, y));
|
||||||
rect.left = xdest1 + x; rect.right = rect.left + 1;
|
rect.left = xdest1 + x; rect.right = rect.left + 1;
|
||||||
rect.top = ydest1 + y; rect.bottom = rect.top + 1;
|
rect.top = ydest1 + y; rect.bottom = rect.top + 1;
|
||||||
::FillRect((HDC) m_hDC, &rect, brush);
|
::FillRect((HDC) m_hDC, &rect, brush);
|
||||||
::DeleteObject(brush);
|
::DeleteObject(brush);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
success = (BitBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height, (HDC) source->m_hDC,
|
success = (BitBlt((HDC) m_hDC, xdest1, ydest1, (int)width, (int)height, (HDC) source->m_hDC,
|
||||||
xsrc1, ysrc1, dwRop) != 0);
|
xsrc1, ysrc1, dwRop) != 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
::SetTextColor((HDC)m_hDC, old_textground);
|
::SetTextColor((HDC)m_hDC, old_textground);
|
||||||
::SetBkColor((HDC)m_hDC, old_background);
|
::SetBkColor((HDC)m_hDC, old_background);
|
||||||
@@ -1356,8 +1356,8 @@ void wxDC::GetTextExtent(const wxString& string, float *x, float *y,
|
|||||||
wxFont *theFont, bool use16bit) const
|
wxFont *theFont, bool use16bit) const
|
||||||
{
|
{
|
||||||
long x1, y1, descent1, externalLeading1;
|
long x1, y1, descent1, externalLeading1;
|
||||||
GetTextExtent(string, & x1, & y1, & descent1, & externalLeading1, theFont, use16bit);
|
GetTextExtent(string, & x1, & y1, & descent1, & externalLeading1, theFont, use16bit);
|
||||||
*x = x1; *y = y1;
|
*x = x1; *y = y1;
|
||||||
if (descent)
|
if (descent)
|
||||||
*descent = descent1;
|
*descent = descent1;
|
||||||
if (externalLeading)
|
if (externalLeading)
|
||||||
@@ -1473,10 +1473,10 @@ void wx_draw_open_spline(wxDC *dc, wxSpline *spline)
|
|||||||
while ((node = node->Next()) != NULL)
|
while ((node = node->Next()) != NULL)
|
||||||
{
|
{
|
||||||
p = (wxPoint *)node->Data();
|
p = (wxPoint *)node->Data();
|
||||||
x1 = x2;
|
x1 = x2;
|
||||||
y1 = y2;
|
y1 = y2;
|
||||||
x2 = p->x;
|
x2 = p->x;
|
||||||
y2 = p->y;
|
y2 = p->y;
|
||||||
cx4 = (double)(x1 + x2) / 2;
|
cx4 = (double)(x1 + x2) / 2;
|
||||||
cy4 = (double)(y1 + y2) / 2;
|
cy4 = (double)(y1 + y2) / 2;
|
||||||
cx3 = (double)(x1 + cx4) / 2;
|
cx3 = (double)(x1 + cx4) / 2;
|
||||||
@@ -1484,8 +1484,8 @@ void wx_draw_open_spline(wxDC *dc, wxSpline *spline)
|
|||||||
|
|
||||||
wx_quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
|
wx_quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
|
||||||
|
|
||||||
cx1 = cx4;
|
cx1 = cx4;
|
||||||
cy1 = cy4;
|
cy1 = cy4;
|
||||||
cx2 = (double)(cx1 + x2) / 2;
|
cx2 = (double)(cx1 + x2) / 2;
|
||||||
cy2 = (double)(cy1 + y2) / 2;
|
cy2 = (double)(cy1 + y2) / 2;
|
||||||
}
|
}
|
||||||
@@ -1499,23 +1499,23 @@ void wx_draw_open_spline(wxDC *dc, wxSpline *spline)
|
|||||||
|
|
||||||
/********************* CURVES FOR SPLINES *****************************
|
/********************* CURVES FOR SPLINES *****************************
|
||||||
|
|
||||||
The following spline drawing routine is from
|
The following spline drawing routine is from
|
||||||
|
|
||||||
"An Algorithm for High-Speed Curve Generation"
|
"An Algorithm for High-Speed Curve Generation"
|
||||||
by George Merrill Chaikin,
|
by George Merrill Chaikin,
|
||||||
Computer Graphics and Image Processing, 3, Academic Press,
|
Computer Graphics and Image Processing, 3, Academic Press,
|
||||||
1974, 346-349.
|
1974, 346-349.
|
||||||
|
|
||||||
and
|
and
|
||||||
|
|
||||||
"On Chaikin's Algorithm" by R. F. Riesenfeld,
|
"On Chaikin's Algorithm" by R. F. Riesenfeld,
|
||||||
Computer Graphics and Image Processing, 4, Academic Press,
|
Computer Graphics and Image Processing, 4, Academic Press,
|
||||||
1975, 304-310.
|
1975, 304-310.
|
||||||
|
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
#define half(z1, z2) ((z1+z2)/2.0)
|
#define half(z1, z2) ((z1+z2)/2.0)
|
||||||
#define THRESHOLD 5
|
#define THRESHOLD 5
|
||||||
|
|
||||||
/* iterative version */
|
/* iterative version */
|
||||||
|
|
||||||
@@ -1531,16 +1531,16 @@ void wx_quadratic_spline(double a1, double b1, double a2, double b2, double a3,
|
|||||||
while (wx_spline_pop(&x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)) {
|
while (wx_spline_pop(&x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)) {
|
||||||
xmid = (double)half(x2, x3);
|
xmid = (double)half(x2, x3);
|
||||||
ymid = (double)half(y2, y3);
|
ymid = (double)half(y2, y3);
|
||||||
if (fabs(x1 - xmid) < THRESHOLD && fabs(y1 - ymid) < THRESHOLD &&
|
if (fabs(x1 - xmid) < THRESHOLD && fabs(y1 - ymid) < THRESHOLD &&
|
||||||
fabs(xmid - x4) < THRESHOLD && fabs(ymid - y4) < THRESHOLD) {
|
fabs(xmid - x4) < THRESHOLD && fabs(ymid - y4) < THRESHOLD) {
|
||||||
wx_spline_add_point((double)wx_round(x1), (double)wx_round(y1));
|
wx_spline_add_point((double)wx_round(x1), (double)wx_round(y1));
|
||||||
wx_spline_add_point((double)wx_round(xmid), (double)wx_round(ymid));
|
wx_spline_add_point((double)wx_round(xmid), (double)wx_round(ymid));
|
||||||
} else {
|
} else {
|
||||||
wx_spline_push(xmid, ymid, (double)half(xmid, x3), (double)half(ymid, y3),
|
wx_spline_push(xmid, ymid, (double)half(xmid, x3), (double)half(ymid, y3),
|
||||||
(double)half(x3, x4), (double)half(y3, y4), x4, y4);
|
(double)half(x3, x4), (double)half(y3, y4), x4, y4);
|
||||||
wx_spline_push(x1, y1, (double)half(x1, x2), (double)half(y1, y2),
|
wx_spline_push(x1, y1, (double)half(x1, x2), (double)half(y1, y2),
|
||||||
(double)half(x2, xmid), (double)half(y2, ymid), xmid, ymid);
|
(double)half(x2, xmid), (double)half(y2, ymid), xmid, ymid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1582,7 +1582,7 @@ int wx_spline_pop(double *x1, double *y1, double *x2, double *y2,
|
|||||||
double *x3, double *y3, double *x4, double *y4)
|
double *x3, double *y3, double *x4, double *y4)
|
||||||
{
|
{
|
||||||
if (wx_stack_count == 0)
|
if (wx_stack_count == 0)
|
||||||
return (0);
|
return (0);
|
||||||
wx_stack_top--;
|
wx_stack_top--;
|
||||||
wx_stack_count--;
|
wx_stack_count--;
|
||||||
*x1 = wx_stack_top->x1;
|
*x1 = wx_stack_top->x1;
|
||||||
|
@@ -473,7 +473,8 @@ BOOL ReadDIB(LPSTR lpFileName, HBITMAP *bitmap, HPALETTE *palette)
|
|||||||
goto ErrExit;
|
goto ErrExit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(nNumColors = (WORD)lpbi->biClrUsed))
|
nNumColors = (WORD)lpbi->biClrUsed;
|
||||||
|
if ( nNumColors == 0 )
|
||||||
{
|
{
|
||||||
/* no color table for 24-bit, default size otherwise */
|
/* no color table for 24-bit, default size otherwise */
|
||||||
if (lpbi->biBitCount != 24)
|
if (lpbi->biBitCount != 24)
|
||||||
@@ -594,7 +595,8 @@ BOOL PASCAL MakeBitmapAndPalette(HDC hDC, HANDLE hDIB,
|
|||||||
lpInfo = (LPBITMAPINFOHEADER) GlobalLock(hDIB);
|
lpInfo = (LPBITMAPINFOHEADER) GlobalLock(hDIB);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((hPalette = MakeDIBPalette(lpInfo)))
|
hPalette = MakeDIBPalette(lpInfo);
|
||||||
|
if ( hPalette )
|
||||||
{
|
{
|
||||||
// Need to realize palette for converting DIB to bitmap.
|
// Need to realize palette for converting DIB to bitmap.
|
||||||
hOldPal = SelectPalette(hDC, hPalette, TRUE);
|
hOldPal = SelectPalette(hDC, hPalette, TRUE);
|
||||||
|
@@ -271,7 +271,8 @@ int wxFileDialog::ShowModal(void)
|
|||||||
extension = extension + strlen( extension ) +1;
|
extension = extension + strlen( extension ) +1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (extension = strrchr( extension, '.' )) // != "blabla"
|
extension = strrchr( extension, '.' );
|
||||||
|
if ( extension // != "blabla"
|
||||||
&& !strrchr( extension, '*' ) // != "blabla.*"
|
&& !strrchr( extension, '*' ) // != "blabla.*"
|
||||||
&& !strrchr( extension, '?' ) // != "blabla.?"
|
&& !strrchr( extension, '?' ) // != "blabla.?"
|
||||||
&& extension[1] // != "blabla."
|
&& extension[1] // != "blabla."
|
||||||
|
@@ -626,9 +626,9 @@ bool wxFrame::MSWOnPaint(void)
|
|||||||
if (m_iconized)
|
if (m_iconized)
|
||||||
{
|
{
|
||||||
HICON the_icon;
|
HICON the_icon;
|
||||||
if (m_icon.Ok())
|
if (m_icon.Ok())
|
||||||
the_icon = (HICON) m_icon.GetHICON();
|
the_icon = (HICON) m_icon.GetHICON();
|
||||||
if (the_icon == 0)
|
else
|
||||||
the_icon = (HICON) m_defaultIcon;
|
the_icon = (HICON) m_defaultIcon;
|
||||||
|
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
@@ -1037,7 +1037,6 @@ void wxFrame::PositionToolBar(void)
|
|||||||
// propagate our state change to all child frames
|
// propagate our state change to all child frames
|
||||||
void wxFrame::IconizeChildFrames(bool bIconize)
|
void wxFrame::IconizeChildFrames(bool bIconize)
|
||||||
{
|
{
|
||||||
wxWindow *child = NULL;
|
|
||||||
for ( wxNode *node = GetChildren()->First(); node; node = node->Next() ) {
|
for ( wxNode *node = GetChildren()->First(); node; node = node->Next() ) {
|
||||||
wxWindow *win = (wxWindow *)node->Data();
|
wxWindow *win = (wxWindow *)node->Data();
|
||||||
if ( win->IsKindOf(CLASSINFO(wxFrame)) ) {
|
if ( win->IsKindOf(CLASSINFO(wxFrame)) ) {
|
||||||
|
@@ -1111,22 +1111,31 @@ bool wxListCtrl::MSWCommand(WXUINT cmd, WXWORD id)
|
|||||||
else return FALSE;
|
else return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxListCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
bool wxListCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result)
|
||||||
{
|
{
|
||||||
wxListEvent event(wxEVT_NULL, m_windowId);
|
wxListEvent event(wxEVT_NULL, m_windowId);
|
||||||
wxEventType eventType = wxEVT_NULL;
|
wxEventType eventType = wxEVT_NULL;
|
||||||
NMHDR *hdr1 = (NMHDR *) lParam;
|
NMHDR *hdr1 = (NMHDR *) lParam;
|
||||||
switch ( hdr1->code )
|
switch ( hdr1->code )
|
||||||
{
|
{
|
||||||
|
case LVN_BEGINRDRAG:
|
||||||
|
eventType = wxEVT_COMMAND_LIST_BEGIN_RDRAG;
|
||||||
|
// fall through
|
||||||
|
|
||||||
case LVN_BEGINDRAG:
|
case LVN_BEGINDRAG:
|
||||||
{
|
if ( eventType == wxEVT_NULL )
|
||||||
eventType = wxEVT_COMMAND_LIST_BEGIN_DRAG;
|
{
|
||||||
NM_LISTVIEW *hdr = (NM_LISTVIEW *)lParam;
|
eventType = wxEVT_COMMAND_LIST_BEGIN_DRAG;
|
||||||
event.m_itemIndex = hdr->iItem;
|
}
|
||||||
event.m_pointDrag.x = hdr->ptAction.x;
|
|
||||||
event.m_pointDrag.y = hdr->ptAction.y;
|
{
|
||||||
break;
|
NM_LISTVIEW *hdr = (NM_LISTVIEW *)lParam;
|
||||||
}
|
event.m_itemIndex = hdr->iItem;
|
||||||
|
event.m_pointDrag.x = hdr->ptAction.x;
|
||||||
|
event.m_pointDrag.y = hdr->ptAction.y;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case LVN_BEGINLABELEDIT:
|
case LVN_BEGINLABELEDIT:
|
||||||
{
|
{
|
||||||
eventType = wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT;
|
eventType = wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT;
|
||||||
@@ -1134,15 +1143,7 @@ bool wxListCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
wxConvertFromMSWListItem(this, event.m_item, info->item, (HWND) GetHWND());
|
wxConvertFromMSWListItem(this, event.m_item, info->item, (HWND) GetHWND());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LVN_BEGINRDRAG:
|
|
||||||
{
|
|
||||||
eventType = wxEVT_COMMAND_LIST_BEGIN_RDRAG;
|
|
||||||
NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
|
|
||||||
event.m_itemIndex = hdr->iItem;
|
|
||||||
event.m_pointDrag.x = hdr->ptAction.x;
|
|
||||||
event.m_pointDrag.y = hdr->ptAction.y;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LVN_COLUMNCLICK:
|
case LVN_COLUMNCLICK:
|
||||||
{
|
{
|
||||||
eventType = wxEVT_COMMAND_LIST_COL_CLICK;
|
eventType = wxEVT_COMMAND_LIST_COL_CLICK;
|
||||||
@@ -1228,8 +1229,7 @@ bool wxListCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
}
|
}
|
||||||
|
|
||||||
default :
|
default :
|
||||||
return wxControl::MSWNotify(wParam, lParam);
|
return wxControl::MSWNotify(wParam, lParam, result);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
@@ -1252,7 +1252,9 @@ bool wxListCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
// wxConvertToMSWListItem(this, event.m_item, info->item);
|
// wxConvertToMSWListItem(this, event.m_item, info->item);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
*result = !event.IsAllowed();
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *wxListCtrl::AddPool(const wxString& str)
|
char *wxListCtrl::AddPool(const wxString& str)
|
||||||
@@ -1430,8 +1432,8 @@ static void wxConvertToMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_
|
|||||||
// List event
|
// List event
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxCommandEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxCommandEvent)
|
||||||
|
|
||||||
wxListEvent::wxListEvent(wxEventType commandType, int id):
|
wxListEvent::wxListEvent(wxEventType commandType, int id)
|
||||||
wxCommandEvent(commandType, id)
|
: wxNotifyEvent(commandType, id)
|
||||||
{
|
{
|
||||||
m_code = 0;
|
m_code = 0;
|
||||||
m_itemIndex = 0;
|
m_itemIndex = 0;
|
||||||
|
@@ -595,8 +595,6 @@ long wxMDIParentFrame::MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARA
|
|||||||
|
|
||||||
bool wxMDIParentFrame::MSWProcessMessage(WXMSG* msg)
|
bool wxMDIParentFrame::MSWProcessMessage(WXMSG* msg)
|
||||||
{
|
{
|
||||||
MSG *pMsg = (MSG *)msg;
|
|
||||||
|
|
||||||
if ((m_currentChild != (wxWindow *)NULL) && (m_currentChild->GetHWND() != (WXHWND) NULL) && m_currentChild->MSWProcessMessage(msg))
|
if ((m_currentChild != (wxWindow *)NULL) && (m_currentChild->GetHWND() != (WXHWND) NULL) && m_currentChild->MSWProcessMessage(msg))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@@ -231,10 +231,10 @@ void wxMenu::Append(int Id, const wxString& label,
|
|||||||
void wxMenu::Delete(int id)
|
void wxMenu::Delete(int id)
|
||||||
{
|
{
|
||||||
wxNode *node;
|
wxNode *node;
|
||||||
wxMenuItem *item;
|
|
||||||
int pos;
|
int pos;
|
||||||
HMENU menu;
|
HMENU menu;
|
||||||
|
|
||||||
|
wxMenuItem *item = NULL;
|
||||||
for (pos = 0, node = m_menuItems.First(); node; node = node->Next(), pos++) {
|
for (pos = 0, node = m_menuItems.First(); node; node = node->Next(), pos++) {
|
||||||
item = (wxMenuItem *)node->Data();
|
item = (wxMenuItem *)node->Data();
|
||||||
if (item->GetId() == id)
|
if (item->GetId() == id)
|
||||||
@@ -310,9 +310,9 @@ void wxMenu::SetTitle(const wxString& label)
|
|||||||
{
|
{
|
||||||
if ( !label.IsEmpty() )
|
if ( !label.IsEmpty() )
|
||||||
{
|
{
|
||||||
if ( !InsertMenu(hMenu, 0, MF_BYPOSITION | MF_STRING,
|
if ( !InsertMenu(hMenu, 0u, MF_BYPOSITION | MF_STRING,
|
||||||
idMenuTitle, m_title) ||
|
(unsigned)idMenuTitle, m_title) ||
|
||||||
!InsertMenu(hMenu, 1, MF_BYPOSITION, -1, NULL) )
|
!InsertMenu(hMenu, 1u, MF_BYPOSITION, (unsigned)-1, NULL) )
|
||||||
{
|
{
|
||||||
wxLogLastError("InsertMenu");
|
wxLogLastError("InsertMenu");
|
||||||
}
|
}
|
||||||
@@ -332,9 +332,9 @@ void wxMenu::SetTitle(const wxString& label)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// modify the title
|
// modify the title
|
||||||
if ( !ModifyMenu(hMenu, 0,
|
if ( !ModifyMenu(hMenu, 0u,
|
||||||
MF_BYPOSITION | MF_STRING,
|
MF_BYPOSITION | MF_STRING,
|
||||||
idMenuTitle, m_title) )
|
(unsigned)idMenuTitle, m_title) )
|
||||||
{
|
{
|
||||||
wxLogLastError("ModifyMenu");
|
wxLogLastError("ModifyMenu");
|
||||||
}
|
}
|
||||||
@@ -667,7 +667,7 @@ bool wxMenuBar::Checked(int Id) const
|
|||||||
if (!item)
|
if (!item)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
int Flag ;
|
int Flag = 0;
|
||||||
|
|
||||||
if (itemMenu->m_hMenu)
|
if (itemMenu->m_hMenu)
|
||||||
Flag=GetMenuState((HMENU)itemMenu->m_hMenu, Id, MF_BYCOMMAND) ;
|
Flag=GetMenuState((HMENU)itemMenu->m_hMenu, Id, MF_BYCOMMAND) ;
|
||||||
@@ -892,8 +892,11 @@ wxMenuItem *wxMenuBar::FindItemForId (int Id, wxMenu ** itemMenu) const
|
|||||||
wxMenuItem *item = NULL;
|
wxMenuItem *item = NULL;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < m_menuCount; i++)
|
for (i = 0; i < m_menuCount; i++)
|
||||||
if ((item = m_menus[i]->FindItemForId (Id, itemMenu)))
|
{
|
||||||
|
item = m_menus[i]->FindItemForId (Id, itemMenu);
|
||||||
|
if (item)
|
||||||
return item;
|
return item;
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -376,12 +376,19 @@ LRESULT WINAPI ibDefWindowProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lPa
|
|||||||
cx = GetSystemMetrics( SM_CXFRAME ) ;
|
cx = GetSystemMetrics( SM_CXFRAME ) ;
|
||||||
cy = GetSystemMetrics( SM_CYFRAME ) ;
|
cy = GetSystemMetrics( SM_CYFRAME ) ;
|
||||||
}
|
}
|
||||||
|
else if (TestWinStyle(hWnd, WS_BORDER ))
|
||||||
|
{
|
||||||
|
cx = GetSystemMetrics( SM_CXBORDER ) ;
|
||||||
|
cy = GetSystemMetrics( SM_CYBORDER ) ;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (TestWinStyle(hWnd, WS_BORDER ))
|
{
|
||||||
{
|
// VZ: I don't know what should be here, but the vars must
|
||||||
cx = GetSystemMetrics( SM_CXBORDER ) ;
|
// be inited!
|
||||||
cy = GetSystemMetrics( SM_CYBORDER ) ;
|
wxFAIL_MSG("don't know how to initialize cx, cy");
|
||||||
}
|
|
||||||
|
cx = cy = 0;
|
||||||
|
}
|
||||||
|
|
||||||
GetIconRect( hWnd, &rcMenu ) ;
|
GetIconRect( hWnd, &rcMenu ) ;
|
||||||
GetMinButtonRect( hWnd, &rcMin ) ;
|
GetMinButtonRect( hWnd, &rcMin ) ;
|
||||||
@@ -865,7 +872,8 @@ BOOL PASCAL DrawCaption( HDC hDC, HWND hWnd, LPRECT lprc,
|
|||||||
int cy ;
|
int cy ;
|
||||||
SIZE Size ;
|
SIZE Size ;
|
||||||
|
|
||||||
if ((lpsz = (char*)GlobalAllocPtr( GHND, ui + 2 )))
|
lpsz = (char*)GlobalAllocPtr( GHND, ui + 2 );
|
||||||
|
if (lpsz)
|
||||||
{
|
{
|
||||||
UINT nBkMode ;
|
UINT nBkMode ;
|
||||||
|
|
||||||
@@ -1074,7 +1082,8 @@ BOOL PASCAL DoMenu( HWND hWnd )
|
|||||||
if (!TestWinStyle(hWnd, WS_SYSMENU))
|
if (!TestWinStyle(hWnd, WS_SYSMENU))
|
||||||
return FALSE ;
|
return FALSE ;
|
||||||
|
|
||||||
if ((hDC = GetWindowDC( hWnd )))
|
hDC = GetWindowDC( hWnd );
|
||||||
|
if (hDC)
|
||||||
{
|
{
|
||||||
// Invert the icon
|
// Invert the icon
|
||||||
//
|
//
|
||||||
|
@@ -437,7 +437,7 @@ void wxNotebook::Command(wxCommandEvent& event)
|
|||||||
wxFAIL_MSG("wxNotebook::Command not implemented");
|
wxFAIL_MSG("wxNotebook::Command not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxNotebook::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
bool wxNotebook::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM* result)
|
||||||
{
|
{
|
||||||
wxNotebookEvent event(wxEVT_NULL, m_windowId);
|
wxNotebookEvent event(wxEVT_NULL, m_windowId);
|
||||||
|
|
||||||
@@ -451,21 +451,18 @@ bool wxNotebook::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING);
|
event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// prevent this msg from being passed to wxControl::MSWNotify which would
|
default:
|
||||||
// retrun FALSE disabling the change of page
|
return wxControl::MSWNotify(wParam, lParam, result);
|
||||||
case UDN_DELTAPOS:
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
default :
|
|
||||||
return wxControl::MSWNotify(wParam, lParam);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event.SetSelection(TabCtrl_GetCurSel(m_hwnd));
|
event.SetSelection(TabCtrl_GetCurSel(m_hwnd));
|
||||||
event.SetOldSelection(m_nSelection);
|
event.SetOldSelection(m_nSelection);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
event.SetInt(LOWORD(wParam));
|
event.SetInt(LOWORD(wParam)); // ctrl id
|
||||||
|
|
||||||
return GetEventHandler()->ProcessEvent(event);
|
bool processed = GetEventHandler()->ProcessEvent(event);
|
||||||
|
*result = !event.IsAllowed();
|
||||||
|
return processed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -475,11 +472,32 @@ bool wxNotebook::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
// hide the currently active panel and show the new one
|
// hide the currently active panel and show the new one
|
||||||
void wxNotebook::ChangePage(int nOldSel, int nSel)
|
void wxNotebook::ChangePage(int nOldSel, int nSel)
|
||||||
{
|
{
|
||||||
|
// MT-FIXME should use a real semaphore
|
||||||
|
static bool s_bInsideChangePage = FALSE;
|
||||||
|
|
||||||
|
// when we call ProcessEvent(), our own OnSelChange() is called which calls
|
||||||
|
// this function - break the infinite loop
|
||||||
|
if ( s_bInsideChangePage )
|
||||||
|
return;
|
||||||
|
|
||||||
// it's not an error (the message may be generated by the tab control itself)
|
// it's not an error (the message may be generated by the tab control itself)
|
||||||
// and it may happen - just do nothing
|
// and it may happen - just do nothing
|
||||||
if ( nSel == nOldSel )
|
if ( nSel == nOldSel )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
s_bInsideChangePage = TRUE;
|
||||||
|
|
||||||
|
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId);
|
||||||
|
event.SetSelection(nSel);
|
||||||
|
event.SetOldSelection(nOldSel);
|
||||||
|
event.SetEventObject(this);
|
||||||
|
if ( ProcessEvent(event) && !event.IsAllowed() )
|
||||||
|
{
|
||||||
|
// program doesn't allow the page change
|
||||||
|
s_bInsideChangePage = FALSE;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( nOldSel != -1 )
|
if ( nOldSel != -1 )
|
||||||
m_aPages[nOldSel]->Show(FALSE);
|
m_aPages[nOldSel]->Show(FALSE);
|
||||||
|
|
||||||
@@ -487,7 +505,11 @@ void wxNotebook::ChangePage(int nOldSel, int nSel)
|
|||||||
pPage->Show(TRUE);
|
pPage->Show(TRUE);
|
||||||
pPage->SetFocus();
|
pPage->SetFocus();
|
||||||
|
|
||||||
|
event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
|
||||||
|
ProcessEvent(event);
|
||||||
|
|
||||||
m_nSelection = nSel;
|
m_nSelection = nSel;
|
||||||
|
s_bInsideChangePage = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNotebook::OnEraseBackground(wxEraseEvent& event)
|
void wxNotebook::OnEraseBackground(wxEraseEvent& event)
|
||||||
|
@@ -358,6 +358,11 @@ wxDataObject::~wxDataObject()
|
|||||||
const char *wxDataObject::GetFormatName(wxDataFormat format)
|
const char *wxDataObject::GetFormatName(wxDataFormat format)
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
|
// case 'xxx' is not a valid value for switch of enum 'wxDataFormat'
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4063)
|
||||||
|
#endif // VC++
|
||||||
|
|
||||||
static char s_szBuf[128];
|
static char s_szBuf[128];
|
||||||
switch ( format ) {
|
switch ( format ) {
|
||||||
case CF_TEXT: return "CF_TEXT";
|
case CF_TEXT: return "CF_TEXT";
|
||||||
@@ -380,9 +385,14 @@ const char *wxDataObject::GetFormatName(wxDataFormat format)
|
|||||||
sprintf(s_szBuf, "clipboard format %d (unknown)", format);
|
sprintf(s_szBuf, "clipboard format %d (unknown)", format);
|
||||||
return s_szBuf;
|
return s_szBuf;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(default:4063)
|
||||||
|
#endif // VC++
|
||||||
|
|
||||||
|
#else // !Debug
|
||||||
return "";
|
return "";
|
||||||
#endif
|
#endif // Debug
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -371,7 +371,7 @@ bool wxFileDropTarget::OnDrop(long x, long y, const void *pData)
|
|||||||
HDROP hdrop = (HDROP)pData; // @@ it works, but I'm not sure about it
|
HDROP hdrop = (HDROP)pData; // @@ it works, but I'm not sure about it
|
||||||
|
|
||||||
// get number of files (magic value -1)
|
// get number of files (magic value -1)
|
||||||
UINT nFiles = ::DragQueryFile(hdrop, -1, NULL, 0);
|
UINT nFiles = ::DragQueryFile(hdrop, (unsigned)-1, NULL, 0u);
|
||||||
|
|
||||||
// for each file get the length, allocate memory and then get the name
|
// for each file get the length, allocate memory and then get the name
|
||||||
char **aszFiles = new char *[nFiles];
|
char **aszFiles = new char *[nFiles];
|
||||||
|
@@ -144,7 +144,7 @@ wxRegKey::StdKey wxRegKey::ExtractKeyName(wxString& strKey)
|
|||||||
{
|
{
|
||||||
wxString strRoot = strKey.Left(REG_SEPARATOR);
|
wxString strRoot = strKey.Left(REG_SEPARATOR);
|
||||||
|
|
||||||
HKEY hRootKey;
|
HKEY hRootKey = 0;
|
||||||
size_t ui;
|
size_t ui;
|
||||||
for ( ui = 0; ui < nStdKeys; ui++ ) {
|
for ( ui = 0; ui < nStdKeys; ui++ ) {
|
||||||
if ( strRoot.CmpNoCase(aStdKeys[ui].szName) == 0 ||
|
if ( strRoot.CmpNoCase(aStdKeys[ui].szName) == 0 ||
|
||||||
|
@@ -233,19 +233,16 @@ bool wxSpinButton::MSWCommand(WXUINT cmd, WXWORD id)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSpinButton::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
bool wxSpinButton::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM* result)
|
||||||
{
|
{
|
||||||
NMHDR* hdr1 = (NMHDR*) lParam;
|
NMHDR* hdr1 = (NMHDR*) lParam;
|
||||||
switch ( hdr1->code )
|
switch ( hdr1->code )
|
||||||
{
|
{
|
||||||
/* We don't process this message, currently */
|
/* We don't process this message, currently */
|
||||||
case UDN_DELTAPOS:
|
case UDN_DELTAPOS:
|
||||||
{
|
|
||||||
return wxControl::MSWNotify(wParam, lParam);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default :
|
default :
|
||||||
return wxControl::MSWNotify(wParam, lParam);
|
return wxControl::MSWNotify(wParam, lParam, result);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// Created: 04/01/98
|
// Created: 04/01/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart and Markus Holzem
|
// Copyright: (c) Julian Smart and Markus Holzem
|
||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -50,9 +50,9 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
|
|||||||
m_foregroundColour = parent->GetForegroundColour() ;
|
m_foregroundColour = parent->GetForegroundColour() ;
|
||||||
|
|
||||||
if ( id == -1 )
|
if ( id == -1 )
|
||||||
m_windowId = (int)NewControlId();
|
m_windowId = (int)NewControlId();
|
||||||
else
|
else
|
||||||
m_windowId = id;
|
m_windowId = id;
|
||||||
|
|
||||||
int x = pos.x;
|
int x = pos.x;
|
||||||
int y = pos.y;
|
int y = pos.y;
|
||||||
@@ -60,9 +60,9 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
|
|||||||
int height = size.y;
|
int height = size.y;
|
||||||
|
|
||||||
if ( width < 0 && bitmap.Ok() )
|
if ( width < 0 && bitmap.Ok() )
|
||||||
width = bitmap.GetWidth();
|
width = bitmap.GetWidth();
|
||||||
if ( height < 0 && bitmap.Ok() )
|
if ( height < 0 && bitmap.Ok() )
|
||||||
height = bitmap.GetHeight();
|
height = bitmap.GetHeight();
|
||||||
|
|
||||||
m_windowStyle = style;
|
m_windowStyle = style;
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
|
|||||||
rect.left = x; rect.top = y; rect.right = x + w; rect.bottom = y + h;
|
rect.left = x; rect.top = y; rect.right = x + w; rect.bottom = y + h;
|
||||||
|
|
||||||
if ( bitmap.Ok() )
|
if ( bitmap.Ok() )
|
||||||
MoveWindow((HWND) GetHWND(), x, y, bitmap.GetWidth(), bitmap.GetHeight(),
|
MoveWindow((HWND) GetHWND(), x, y, bitmap.GetWidth(), bitmap.GetHeight(),
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
InvalidateRect((HWND) GetParent()->GetHWND(), &rect, TRUE);
|
InvalidateRect((HWND) GetParent()->GetHWND(), &rect, TRUE);
|
||||||
@@ -143,45 +143,45 @@ void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
|
|||||||
|
|
||||||
bool wxStaticBitmap::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
bool wxStaticBitmap::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||||
{
|
{
|
||||||
long style = GetWindowLong((HWND) GetHWND(), GWL_STYLE);
|
long style = GetWindowLong((HWND) GetHWND(), GWL_STYLE);
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
if ((style & 0xFF) == SS_BITMAP)
|
if ((style & 0xFF) == SS_BITMAP)
|
||||||
{
|
{
|
||||||
// Should we call Default() here?
|
// Should we call Default() here?
|
||||||
// Default();
|
// Default();
|
||||||
|
|
||||||
// Let default procedure draw the bitmap, which is defined
|
// Let default procedure draw the bitmap, which is defined
|
||||||
// in the Windows resource.
|
// in the Windows resource.
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT) item;
|
LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT) item;
|
||||||
|
|
||||||
wxBitmap* bitmap = &m_messageBitmap;
|
wxBitmap* bitmap = &m_messageBitmap;
|
||||||
if ( !bitmap->Ok() )
|
if ( !bitmap->Ok() )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
HDC hDC = lpDIS->hDC;
|
HDC hDC = lpDIS->hDC;
|
||||||
HDC memDC = ::CreateCompatibleDC(hDC);
|
HDC memDC = ::CreateCompatibleDC(hDC);
|
||||||
|
|
||||||
HBITMAP old = (HBITMAP) ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP());
|
HBITMAP old = (HBITMAP) ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP());
|
||||||
|
|
||||||
if (!old)
|
if (!old)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
int x = lpDIS->rcItem.left;
|
int x = lpDIS->rcItem.left;
|
||||||
int y = lpDIS->rcItem.top;
|
int y = lpDIS->rcItem.top;
|
||||||
int width = lpDIS->rcItem.right - x;
|
int width = lpDIS->rcItem.right - x;
|
||||||
int height = lpDIS->rcItem.bottom - y;
|
int height = lpDIS->rcItem.bottom - y;
|
||||||
|
|
||||||
// Centre the bitmap in the control area
|
// Centre the bitmap in the control area
|
||||||
int x1 = (int) (x + ((width - bitmap->GetWidth()) / 2));
|
int x1 = (int) (x + ((width - bitmap->GetWidth()) / 2));
|
||||||
int y1 = (int) (y + ((height - bitmap->GetHeight()) / 2));
|
int y1 = (int) (y + ((height - bitmap->GetHeight()) / 2));
|
||||||
|
|
||||||
::BitBlt(hDC, x1, y1, bitmap->GetWidth(), bitmap->GetHeight(), memDC, 0, 0, SRCCOPY);
|
::BitBlt(hDC, x1, y1, bitmap->GetWidth(), bitmap->GetHeight(), memDC, 0, 0, SRCCOPY);
|
||||||
|
|
||||||
::SelectObject(memDC, old);
|
::SelectObject(memDC, old);
|
||||||
|
|
||||||
::DeleteDC(memDC);
|
::DeleteDC(memDC);
|
||||||
|
|
||||||
|
@@ -146,7 +146,7 @@ bool wxTabCtrl::MSWCommand(WXUINT cmd, WXWORD id)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTabCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
bool wxTabCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result)
|
||||||
{
|
{
|
||||||
wxTabEvent event(wxEVT_NULL, m_windowId);
|
wxTabEvent event(wxEVT_NULL, m_windowId);
|
||||||
wxEventType eventType = wxEVT_NULL;
|
wxEventType eventType = wxEVT_NULL;
|
||||||
@@ -154,37 +154,29 @@ bool wxTabCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
switch ( hdr1->code )
|
switch ( hdr1->code )
|
||||||
{
|
{
|
||||||
case TCN_SELCHANGE:
|
case TCN_SELCHANGE:
|
||||||
{
|
|
||||||
eventType = wxEVT_COMMAND_TAB_SEL_CHANGED;
|
eventType = wxEVT_COMMAND_TAB_SEL_CHANGED;
|
||||||
event.SetInt( (int) LOWORD(wParam) ) ;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case TCN_SELCHANGING:
|
case TCN_SELCHANGING:
|
||||||
{
|
|
||||||
eventType = wxEVT_COMMAND_TAB_SEL_CHANGING;
|
eventType = wxEVT_COMMAND_TAB_SEL_CHANGING;
|
||||||
event.SetInt( (int) LOWORD(wParam) ) ;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case TTN_NEEDTEXT:
|
case TTN_NEEDTEXT:
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
// if (tool->m_shortHelpString != "")
|
// if (tool->m_shortHelpString != "")
|
||||||
// ttText->lpszText = (char *) (const char *)tool->m_shortHelpString;
|
// ttText->lpszText = (char *) (const char *)tool->m_shortHelpString;
|
||||||
return wxControl::MSWNotify(wParam, lParam);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
default :
|
default :
|
||||||
return wxControl::MSWNotify(wParam, lParam);
|
return wxControl::MSWNotify(wParam, lParam, result);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
event.SetEventType(eventType);
|
event.SetEventType(eventType);
|
||||||
|
event.SetInt( (int) LOWORD(wParam) ) ;
|
||||||
|
|
||||||
if ( !ProcessEvent(event) )
|
return ProcessEvent(event);
|
||||||
return FALSE;
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Responds to colour changes, and passes event on to children.
|
// Responds to colour changes, and passes event on to children.
|
||||||
|
@@ -325,7 +325,9 @@ bool wxToolBar95::MSWCommand(WXUINT cmd, WXWORD id)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxToolBar95::MSWNotify(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)
|
bool wxToolBar95::MSWNotify(WXWPARAM WXUNUSED(wParam),
|
||||||
|
WXLPARAM lParam,
|
||||||
|
WXLPARAM *result)
|
||||||
{
|
{
|
||||||
// First check if this applies to us
|
// First check if this applies to us
|
||||||
NMHDR *hdr = (NMHDR *)lParam;
|
NMHDR *hdr = (NMHDR *)lParam;
|
||||||
|
@@ -490,12 +490,18 @@ wxTreeItemId wxTreeCtrl::DoInsertItem(const wxTreeItemId& parent,
|
|||||||
|
|
||||||
tvIns.item.mask = mask;
|
tvIns.item.mask = mask;
|
||||||
|
|
||||||
HTREEITEM id = (HTREEITEM) TreeView_InsertItem(wxhWnd, &tvIns);
|
HTREEITEM id = TreeView_InsertItem(wxhWnd, &tvIns);
|
||||||
if ( id == 0 )
|
if ( id == 0 )
|
||||||
{
|
{
|
||||||
wxLogLastError("TreeView_InsertItem");
|
wxLogLastError("TreeView_InsertItem");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( data != NULL )
|
||||||
|
{
|
||||||
|
// associate the application tree item with Win32 tree item handle
|
||||||
|
data->SetId((WXHTREEITEM)id);
|
||||||
|
}
|
||||||
|
|
||||||
return wxTreeItemId((WXHTREEITEM)id);
|
return wxTreeItemId((WXHTREEITEM)id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -763,7 +769,7 @@ bool wxTreeCtrl::MSWCommand(WXUINT cmd, WXWORD id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// process WM_NOTIFY Windows message
|
// process WM_NOTIFY Windows message
|
||||||
bool wxTreeCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
bool wxTreeCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result)
|
||||||
{
|
{
|
||||||
wxTreeEvent event(wxEVT_NULL, m_windowId);
|
wxTreeEvent event(wxEVT_NULL, m_windowId);
|
||||||
wxEventType eventType = wxEVT_NULL;
|
wxEventType eventType = wxEVT_NULL;
|
||||||
@@ -889,36 +895,28 @@ bool wxTreeCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return wxControl::MSWNotify(wParam, lParam);
|
return wxControl::MSWNotify(wParam, lParam, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
event.SetEventType(eventType);
|
event.SetEventType(eventType);
|
||||||
|
|
||||||
bool rc = GetEventHandler()->ProcessEvent(event);
|
bool processed = GetEventHandler()->ProcessEvent(event);
|
||||||
|
|
||||||
// post processing
|
// post processing
|
||||||
switch ( hdr->code )
|
if ( hdr->code == TVN_DELETEITEM )
|
||||||
{
|
{
|
||||||
// NB: we might process this message using wxWindows event tables, but
|
// NB: we might process this message using wxWindows event tables, but
|
||||||
// due to overhead of wxWin event system we prefer to do it here
|
// due to overhead of wxWin event system we prefer to do it here
|
||||||
// (otherwise deleting a tree with many items is just too slow)
|
// (otherwise deleting a tree with many items is just too slow)
|
||||||
case TVN_DELETEITEM:
|
NM_TREEVIEW* tv = (NM_TREEVIEW *)lParam;
|
||||||
{
|
wxTreeItemData *data = (wxTreeItemData *)tv->itemOld.lParam;
|
||||||
NM_TREEVIEW* tv = (NM_TREEVIEW *)lParam;
|
delete data; // may be NULL, ok
|
||||||
wxTreeItemData *data = (wxTreeItemData *)tv->itemOld.lParam;
|
|
||||||
delete data; // may be NULL, ok
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TVN_ITEMEXPANDING:
|
|
||||||
// if user called Veto(), don't allow expansion/collapse by
|
|
||||||
// returning TRUE from here
|
|
||||||
rc = event.m_code != 0;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
*result = !event.IsAllowed();
|
||||||
|
|
||||||
|
return processed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -928,7 +926,7 @@ bool wxTreeCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxCommandEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxCommandEvent)
|
||||||
|
|
||||||
wxTreeEvent::wxTreeEvent(wxEventType commandType, int id)
|
wxTreeEvent::wxTreeEvent(wxEventType commandType, int id)
|
||||||
: wxCommandEvent(commandType, id)
|
: wxNotifyEvent(commandType, id)
|
||||||
{
|
{
|
||||||
m_code = 0;
|
m_code = 0;
|
||||||
m_itemOld = 0;
|
m_itemOld = 0;
|
||||||
|
@@ -174,7 +174,9 @@ bool wxWindow::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindow::MSWNotify(WXWPARAM WXUNUSED(wParam), WXLPARAM WXUNUSED(lParam))
|
bool wxWindow::MSWNotify(WXWPARAM WXUNUSED(wParam),
|
||||||
|
WXLPARAM WXUNUSED(lParam),
|
||||||
|
WXLPARAM* WXUNUSED(result))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -193,8 +195,11 @@ void wxWindow::SetHWND(WXHWND hWnd)
|
|||||||
m_hWnd = hWnd;
|
m_hWnd = hWnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructor
|
// ----------------------------------------------------------------------------
|
||||||
wxWindow::wxWindow(void)
|
// constructors and such
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxWindow::Init()
|
||||||
{
|
{
|
||||||
// Generic
|
// Generic
|
||||||
m_windowId = 0;
|
m_windowId = 0;
|
||||||
@@ -202,7 +207,6 @@ wxWindow::wxWindow(void)
|
|||||||
m_windowStyle = 0;
|
m_windowStyle = 0;
|
||||||
m_windowParent = NULL;
|
m_windowParent = NULL;
|
||||||
m_windowEventHandler = this;
|
m_windowEventHandler = this;
|
||||||
m_windowName = "";
|
|
||||||
m_windowCursor = *wxSTANDARD_CURSOR;
|
m_windowCursor = *wxSTANDARD_CURSOR;
|
||||||
m_children = new wxList;
|
m_children = new wxList;
|
||||||
m_doubleClickAllowed = 0 ;
|
m_doubleClickAllowed = 0 ;
|
||||||
@@ -217,41 +221,35 @@ wxWindow::wxWindow(void)
|
|||||||
// MSW-specific
|
// MSW-specific
|
||||||
m_hWnd = 0;
|
m_hWnd = 0;
|
||||||
m_winEnabled = TRUE;
|
m_winEnabled = TRUE;
|
||||||
m_caretWidth = 0; m_caretHeight = 0;
|
m_caretWidth = m_caretHeight = 0;
|
||||||
m_caretEnabled = FALSE;
|
m_caretEnabled =
|
||||||
m_caretShown = FALSE;
|
m_caretShown = FALSE;
|
||||||
m_inOnSize = FALSE;
|
m_inOnSize = FALSE;
|
||||||
m_minSizeX = -1;
|
m_minSizeX =
|
||||||
m_minSizeY = -1;
|
m_minSizeY =
|
||||||
m_maxSizeX = -1;
|
m_maxSizeX =
|
||||||
m_maxSizeY = -1;
|
m_maxSizeY = -1;
|
||||||
// m_paintHDC = 0;
|
|
||||||
// m_tempHDC = 0;
|
|
||||||
m_isBeingDeleted = FALSE;
|
m_isBeingDeleted = FALSE;
|
||||||
m_oldWndProc = 0;
|
m_oldWndProc = 0;
|
||||||
#ifndef __WIN32__
|
#ifndef __WIN32__
|
||||||
m_globalHandle = 0;
|
m_globalHandle = 0;
|
||||||
#endif
|
#endif
|
||||||
m_useCtl3D = FALSE;
|
m_useCtl3D = FALSE;
|
||||||
|
m_mouseInWindow = FALSE;
|
||||||
|
|
||||||
|
m_windowParent = NULL;
|
||||||
m_defaultItem = NULL;
|
m_defaultItem = NULL;
|
||||||
|
|
||||||
wxSystemSettings settings;
|
wxSystemSettings settings;
|
||||||
|
|
||||||
m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_3DFACE) ;
|
m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_3DFACE) ;
|
||||||
// m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_WINDOW) ; ;
|
|
||||||
m_foregroundColour = *wxBLACK;
|
m_foregroundColour = *wxBLACK;
|
||||||
|
|
||||||
/*
|
|
||||||
wxColour(GetRValue(GetSysColor(COLOR_WINDOW)),
|
|
||||||
GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE)));
|
|
||||||
*/
|
|
||||||
|
|
||||||
// wxWnd
|
// wxWnd
|
||||||
m_lastMsg = 0;
|
m_lastMsg = 0;
|
||||||
m_lastWParam = 0;
|
m_lastWParam = 0;
|
||||||
m_lastLParam = 0;
|
m_lastLParam = 0;
|
||||||
// m_acceleratorTable = 0;
|
|
||||||
m_hMenu = 0;
|
m_hMenu = 0;
|
||||||
|
|
||||||
m_xThumbSize = 0;
|
m_xThumbSize = 0;
|
||||||
@@ -268,8 +266,13 @@ wxWindow::wxWindow(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxWindow::wxWindow()
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
wxWindow::~wxWindow(void)
|
wxWindow::~wxWindow()
|
||||||
{
|
{
|
||||||
m_isBeingDeleted = TRUE;
|
m_isBeingDeleted = TRUE;
|
||||||
|
|
||||||
@@ -346,7 +349,7 @@ wxWindow::~wxWindow(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Destroy the window (delayed, if a managed window)
|
// Destroy the window (delayed, if a managed window)
|
||||||
bool wxWindow::Destroy(void)
|
bool wxWindow::Destroy()
|
||||||
{
|
{
|
||||||
delete this;
|
delete this;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -354,72 +357,18 @@ bool wxWindow::Destroy(void)
|
|||||||
|
|
||||||
extern char wxCanvasClassName[];
|
extern char wxCanvasClassName[];
|
||||||
|
|
||||||
// Constructor
|
// real construction (Init() must have been called before!)
|
||||||
bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
// Generic
|
Init();
|
||||||
m_isBeingDeleted = FALSE;
|
|
||||||
m_windowId = 0;
|
|
||||||
m_isShown = TRUE;
|
|
||||||
m_windowStyle = 0;
|
|
||||||
m_windowParent = NULL;
|
|
||||||
m_windowEventHandler = this;
|
|
||||||
m_windowName = "";
|
|
||||||
m_windowCursor = *wxSTANDARD_CURSOR;
|
|
||||||
m_doubleClickAllowed = 0 ;
|
|
||||||
m_winCaptured = FALSE;
|
|
||||||
m_constraints = NULL;
|
|
||||||
m_constraintsInvolvedIn = NULL;
|
|
||||||
m_windowSizer = NULL;
|
|
||||||
m_sizerParent = NULL;
|
|
||||||
m_autoLayout = FALSE;
|
|
||||||
m_windowValidator = NULL;
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
|
||||||
m_pDropTarget = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// MSW-specific
|
wxCHECK_MSG( parent, FALSE, "can't create wxWindow without parent" );
|
||||||
m_hWnd = 0;
|
|
||||||
m_winEnabled = TRUE;
|
|
||||||
m_caretWidth = 0; m_caretHeight = 0;
|
|
||||||
m_caretEnabled = FALSE;
|
|
||||||
m_caretShown = FALSE;
|
|
||||||
m_inOnSize = FALSE;
|
|
||||||
m_minSizeX = -1;
|
|
||||||
m_minSizeY = -1;
|
|
||||||
m_maxSizeX = -1;
|
|
||||||
m_maxSizeY = -1;
|
|
||||||
m_oldWndProc = 0;
|
|
||||||
#ifndef __WIN32__
|
|
||||||
m_globalHandle = 0;
|
|
||||||
#endif
|
|
||||||
m_useCtl3D = FALSE;
|
|
||||||
m_defaultItem = NULL;
|
|
||||||
m_windowParent = NULL;
|
|
||||||
m_mouseInWindow = FALSE;
|
|
||||||
if (!parent)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (parent) parent->AddChild(this);
|
parent->AddChild(this);
|
||||||
|
|
||||||
// wxWnd
|
|
||||||
m_lastMsg = 0;
|
|
||||||
m_lastWParam = 0;
|
|
||||||
m_lastLParam = 0;
|
|
||||||
m_hMenu = 0;
|
|
||||||
|
|
||||||
m_xThumbSize = 0;
|
|
||||||
m_yThumbSize = 0;
|
|
||||||
m_backgroundTransparent = FALSE;
|
|
||||||
|
|
||||||
m_lastXPos = (float)-1.0;
|
|
||||||
m_lastYPos = (float)-1.0;
|
|
||||||
m_lastEvent = -1;
|
|
||||||
m_returnCode = 0;
|
|
||||||
|
|
||||||
SetName(name);
|
SetName(name);
|
||||||
|
|
||||||
@@ -441,10 +390,6 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
wxSystemSettings settings;
|
wxSystemSettings settings;
|
||||||
|
|
||||||
m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_WINDOW) ; ;
|
|
||||||
// m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_3DFACE) ;
|
|
||||||
m_foregroundColour = *wxBLACK;
|
|
||||||
|
|
||||||
m_windowStyle = style;
|
m_windowStyle = style;
|
||||||
|
|
||||||
DWORD msflags = 0;
|
DWORD msflags = 0;
|
||||||
@@ -466,15 +411,13 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
|||||||
(m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER))
|
(m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER))
|
||||||
msflags |= WS_BORDER;
|
msflags |= WS_BORDER;
|
||||||
|
|
||||||
m_mouseInWindow = FALSE ;
|
|
||||||
|
|
||||||
MSWCreate(m_windowId, parent, wxCanvasClassName, this, NULL,
|
MSWCreate(m_windowId, parent, wxCanvasClassName, this, NULL,
|
||||||
x, y, width, height, msflags, NULL, exStyle);
|
x, y, width, height, msflags, NULL, exStyle);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::SetFocus(void)
|
void wxWindow::SetFocus()
|
||||||
{
|
{
|
||||||
HWND hWnd = (HWND) GetHWND();
|
HWND hWnd = (HWND) GetHWND();
|
||||||
if (hWnd)
|
if (hWnd)
|
||||||
@@ -489,7 +432,7 @@ void wxWindow::Enable(bool enable)
|
|||||||
::EnableWindow(hWnd, (BOOL)enable);
|
::EnableWindow(hWnd, (BOOL)enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::CaptureMouse(void)
|
void wxWindow::CaptureMouse()
|
||||||
{
|
{
|
||||||
HWND hWnd = (HWND) GetHWND();
|
HWND hWnd = (HWND) GetHWND();
|
||||||
if (hWnd && !m_winCaptured)
|
if (hWnd && !m_winCaptured)
|
||||||
@@ -499,7 +442,7 @@ void wxWindow::CaptureMouse(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::ReleaseMouse(void)
|
void wxWindow::ReleaseMouse()
|
||||||
{
|
{
|
||||||
if (m_winCaptured)
|
if (m_winCaptured)
|
||||||
{
|
{
|
||||||
@@ -814,7 +757,8 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y,
|
|||||||
HFONT was = 0;
|
HFONT was = 0;
|
||||||
if (fontToUse && fontToUse->Ok())
|
if (fontToUse && fontToUse->Ok())
|
||||||
{
|
{
|
||||||
if ((fnt=(HFONT) fontToUse->GetResourceHandle()))
|
fnt = (HFONT)fontToUse->GetResourceHandle();
|
||||||
|
if ( fnt )
|
||||||
was = (HFONT) SelectObject(dc,fnt) ;
|
was = (HFONT) SelectObject(dc,fnt) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -996,10 +940,11 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
}
|
}
|
||||||
case WM_QUERYDRAGICON:
|
case WM_QUERYDRAGICON:
|
||||||
{
|
{
|
||||||
HICON hIcon = 0;
|
HICON hIcon = (HICON)MSWOnQueryDragIcon();
|
||||||
if ((hIcon = (HICON) MSWOnQueryDragIcon()))
|
if ( hIcon )
|
||||||
return (long)hIcon;
|
return (long)hIcon;
|
||||||
else return MSWDefWindowProc(message, wParam, lParam );
|
else
|
||||||
|
return MSWDefWindowProc(message, wParam, lParam );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1181,9 +1126,10 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
#if defined(__WIN95__)
|
#if defined(__WIN95__)
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
{
|
{
|
||||||
if (!MSWOnNotify(wParam, lParam))
|
// for some messages (TVN_ITEMEXPANDING for example), the return
|
||||||
return MSWDefWindowProc(message, wParam, lParam );
|
// value of WM_NOTIFY handler is important, so don't just return 0
|
||||||
break;
|
// if we processed the message
|
||||||
|
return MSWOnNotify(wParam, lParam);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
case WM_MENUSELECT:
|
case WM_MENUSELECT:
|
||||||
@@ -1475,7 +1421,7 @@ void wxRemoveHandleAssociation(wxWindow *win)
|
|||||||
|
|
||||||
// Default destroyer - override if you destroy it in some other way
|
// Default destroyer - override if you destroy it in some other way
|
||||||
// (e.g. with MDI child windows)
|
// (e.g. with MDI child windows)
|
||||||
void wxWindow::MSWDestroyWindow(void)
|
void wxWindow::MSWDestroyWindow()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1562,7 +1508,7 @@ void wxWindow::MSWOnCreate(WXLPCREATESTRUCT WXUNUSED(cs))
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindow::MSWOnClose(void)
|
bool wxWindow::MSWOnClose()
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -1604,7 +1550,7 @@ bool wxWindow::MSWOnEndSession(bool endSession, long logOff)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindow::MSWOnDestroy(void)
|
bool wxWindow::MSWOnDestroy()
|
||||||
{
|
{
|
||||||
// delete our drop target if we've got one
|
// delete our drop target if we've got one
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
@@ -1621,7 +1567,7 @@ bool wxWindow::MSWOnDestroy(void)
|
|||||||
|
|
||||||
// Deal with child commands from buttons etc.
|
// Deal with child commands from buttons etc.
|
||||||
|
|
||||||
bool wxWindow::MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam)
|
long wxWindow::MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam)
|
||||||
{
|
{
|
||||||
#if defined(__WIN95__)
|
#if defined(__WIN95__)
|
||||||
// Find a child window to send the notification to, e.g. a toolbar.
|
// Find a child window to send the notification to, e.g. a toolbar.
|
||||||
@@ -1640,8 +1586,12 @@ bool wxWindow::MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
HWND hWnd = (HWND)hdr->hwndFrom;
|
HWND hWnd = (HWND)hdr->hwndFrom;
|
||||||
wxWindow *win = wxFindWinFromHandle((WXHWND) hWnd);
|
wxWindow *win = wxFindWinFromHandle((WXHWND) hWnd);
|
||||||
|
|
||||||
|
WXLPARAM result = 0;
|
||||||
|
|
||||||
if ( win )
|
if ( win )
|
||||||
return win->MSWNotify(wParam, lParam);
|
{
|
||||||
|
win->MSWNotify(wParam, lParam, &result);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Rely on MSWNotify to check whether the message
|
// Rely on MSWNotify to check whether the message
|
||||||
@@ -1650,15 +1600,15 @@ bool wxWindow::MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxWindow *child = (wxWindow *)node->Data();
|
wxWindow *child = (wxWindow *)node->Data();
|
||||||
if ( child->MSWNotify(wParam, lParam) )
|
if ( child->MSWNotify(wParam, lParam, &result) )
|
||||||
return TRUE;
|
break;
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return result;
|
||||||
|
#endif // Win95
|
||||||
|
|
||||||
#endif
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1926,34 +1876,32 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
|
|||||||
lDlgCode = ::SendMessage(msg->hwnd, WM_GETDLGCODE, 0, 0);
|
lDlgCode = ::SendMessage(msg->hwnd, WM_GETDLGCODE, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bForward;
|
bool bForward = TRUE;
|
||||||
if ( bProcess ) {
|
if ( bProcess ) {
|
||||||
switch ( msg->wParam ) {
|
switch ( msg->wParam ) {
|
||||||
case VK_TAB:
|
case VK_TAB:
|
||||||
if ( lDlgCode & DLGC_WANTTAB ) // this is FALSE for Ctrl-Tab
|
if ( lDlgCode & DLGC_WANTTAB ) // FALSE for Ctrl-Tab
|
||||||
bProcess = FALSE;
|
bProcess = FALSE;
|
||||||
else
|
else
|
||||||
bForward = !(::GetKeyState(VK_SHIFT) & 0x100);
|
bForward = !(::GetKeyState(VK_SHIFT) & 0x100);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VK_UP:
|
case VK_UP:
|
||||||
case VK_LEFT:
|
case VK_LEFT:
|
||||||
if ( (lDlgCode & DLGC_WANTARROWS) || bCtrlDown )
|
if ( (lDlgCode & DLGC_WANTARROWS) || bCtrlDown )
|
||||||
bProcess = FALSE;
|
bProcess = FALSE;
|
||||||
else
|
else
|
||||||
bForward = FALSE;
|
bForward = FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VK_DOWN:
|
case VK_DOWN:
|
||||||
case VK_RIGHT:
|
case VK_RIGHT:
|
||||||
if ( (lDlgCode & DLGC_WANTARROWS) || bCtrlDown )
|
if ( (lDlgCode & DLGC_WANTARROWS) || bCtrlDown )
|
||||||
bProcess = FALSE;
|
bProcess = FALSE;
|
||||||
else
|
break;
|
||||||
bForward = TRUE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
bProcess = FALSE;
|
bProcess = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1987,7 +1935,7 @@ long wxWindow::MSWOnMDIActivate(long WXUNUSED(flag), WXHWND WXUNUSED(activate),
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::MSWDetachWindowMenu(void)
|
void wxWindow::MSWDetachWindowMenu()
|
||||||
{
|
{
|
||||||
if (m_hMenu)
|
if (m_hMenu)
|
||||||
{
|
{
|
||||||
@@ -2006,7 +1954,7 @@ void wxWindow::MSWDetachWindowMenu(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindow::MSWOnPaint(void)
|
bool wxWindow::MSWOnPaint()
|
||||||
{
|
{
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
HRGN hRegion = ::CreateRectRgn(0, 0, 0, 0); // Dummy call to get a handle
|
HRGN hRegion = ::CreateRectRgn(0, 0, 0, 0); // Dummy call to get a handle
|
||||||
@@ -2659,7 +2607,7 @@ bool wxWindow::MSWOnInitDialog(WXHWND WXUNUSED(hWndFocus))
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::InitDialog(void)
|
void wxWindow::InitDialog()
|
||||||
{
|
{
|
||||||
wxInitDialogEvent event(GetId());
|
wxInitDialogEvent event(GetId());
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
@@ -2682,7 +2630,8 @@ void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font)
|
|||||||
{
|
{
|
||||||
// the_font->UseResource();
|
// the_font->UseResource();
|
||||||
// the_font->RealizeResource();
|
// the_font->RealizeResource();
|
||||||
if ((fnt=(HFONT) the_font->GetResourceHandle()))
|
fnt = (HFONT)the_font->GetResourceHandle();
|
||||||
|
if ( fnt )
|
||||||
was = (HFONT) SelectObject(dc,fnt) ;
|
was = (HFONT) SelectObject(dc,fnt) ;
|
||||||
}
|
}
|
||||||
GetTextMetrics(dc, &tm);
|
GetTextMetrics(dc, &tm);
|
||||||
@@ -2881,7 +2830,7 @@ void wxWindow::ShowCaret(bool show)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::DestroyCaret(void)
|
void wxWindow::DestroyCaret()
|
||||||
{
|
{
|
||||||
m_caretEnabled = FALSE;
|
m_caretEnabled = FALSE;
|
||||||
}
|
}
|
||||||
@@ -2899,7 +2848,7 @@ void wxWindow::GetCaretPos(int *x, int *y) const
|
|||||||
*y = point.y;
|
*y = point.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindow *wxGetActiveWindow(void)
|
wxWindow *wxGetActiveWindow()
|
||||||
{
|
{
|
||||||
HWND hWnd = GetActiveWindow();
|
HWND hWnd = GetActiveWindow();
|
||||||
if (hWnd != 0)
|
if (hWnd != 0)
|
||||||
@@ -3007,7 +2956,7 @@ void wxWindow::Centre(int direction)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* TODO (maybe)
|
/* TODO (maybe)
|
||||||
void wxWindow::OnPaint(void)
|
void wxWindow::OnPaint()
|
||||||
{
|
{
|
||||||
PaintSelectionHandles();
|
PaintSelectionHandles();
|
||||||
}
|
}
|
||||||
@@ -3404,7 +3353,7 @@ void wxWindow::SubclassWin(WXHWND hWnd)
|
|||||||
SetWindowLong((HWND) hWnd, GWL_WNDPROC, (LONG) wxWndProc);
|
SetWindowLong((HWND) hWnd, GWL_WNDPROC, (LONG) wxWndProc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::UnsubclassWin(void)
|
void wxWindow::UnsubclassWin()
|
||||||
{
|
{
|
||||||
wxRemoveHandleAssociation(this);
|
wxRemoveHandleAssociation(this);
|
||||||
|
|
||||||
@@ -3541,7 +3490,7 @@ bool wxWindow::IsEnabled(void) const
|
|||||||
|
|
||||||
// Transfer values to controls. If returns FALSE,
|
// Transfer values to controls. If returns FALSE,
|
||||||
// it's an application error (pops up a dialog)
|
// it's an application error (pops up a dialog)
|
||||||
bool wxWindow::TransferDataToWindow(void)
|
bool wxWindow::TransferDataToWindow()
|
||||||
{
|
{
|
||||||
wxNode *node = GetChildren()->First();
|
wxNode *node = GetChildren()->First();
|
||||||
while ( node )
|
while ( node )
|
||||||
@@ -3561,7 +3510,7 @@ bool wxWindow::TransferDataToWindow(void)
|
|||||||
|
|
||||||
// Transfer values from controls. If returns FALSE,
|
// Transfer values from controls. If returns FALSE,
|
||||||
// validation failed: don't quit
|
// validation failed: don't quit
|
||||||
bool wxWindow::TransferDataFromWindow(void)
|
bool wxWindow::TransferDataFromWindow()
|
||||||
{
|
{
|
||||||
wxNode *node = GetChildren()->First();
|
wxNode *node = GetChildren()->First();
|
||||||
while ( node )
|
while ( node )
|
||||||
@@ -3577,7 +3526,7 @@ bool wxWindow::TransferDataFromWindow(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindow::Validate(void)
|
bool wxWindow::Validate()
|
||||||
{
|
{
|
||||||
wxNode *node = GetChildren()->First();
|
wxNode *node = GetChildren()->First();
|
||||||
while ( node )
|
while ( node )
|
||||||
@@ -3594,7 +3543,7 @@ bool wxWindow::Validate(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the window with the focus
|
// Get the window with the focus
|
||||||
wxWindow *wxWindow::FindFocus(void)
|
wxWindow *wxWindow::FindFocus()
|
||||||
{
|
{
|
||||||
HWND hWnd = ::GetFocus();
|
HWND hWnd = ::GetFocus();
|
||||||
if ( hWnd )
|
if ( hWnd )
|
||||||
@@ -3617,7 +3566,7 @@ void wxWindow::RemoveChild(wxWindow *child)
|
|||||||
child->m_windowParent = NULL;
|
child->m_windowParent = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::DestroyChildren(void)
|
void wxWindow::DestroyChildren()
|
||||||
{
|
{
|
||||||
if (GetChildren()) {
|
if (GetChildren()) {
|
||||||
wxNode *node;
|
wxNode *node;
|
||||||
@@ -3733,7 +3682,7 @@ void wxWindow::RemoveConstraintReference(wxWindow *otherWin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset any constraints that mention this window
|
// Reset any constraints that mention this window
|
||||||
void wxWindow::DeleteRelatedConstraints(void)
|
void wxWindow::DeleteRelatedConstraints()
|
||||||
{
|
{
|
||||||
if (m_constraintsInvolvedIn)
|
if (m_constraintsInvolvedIn)
|
||||||
{
|
{
|
||||||
@@ -3775,7 +3724,7 @@ void wxWindow::SetSizer(wxSizer *sizer)
|
|||||||
* New version
|
* New version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool wxWindow::Layout(void)
|
bool wxWindow::Layout()
|
||||||
{
|
{
|
||||||
if (GetConstraints())
|
if (GetConstraints())
|
||||||
{
|
{
|
||||||
@@ -3875,7 +3824,7 @@ bool wxWindow::DoPhase(int phase)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::ResetConstraints(void)
|
void wxWindow::ResetConstraints()
|
||||||
{
|
{
|
||||||
wxLayoutConstraints *constr = GetConstraints();
|
wxLayoutConstraints *constr = GetConstraints();
|
||||||
if (constr)
|
if (constr)
|
||||||
@@ -4137,7 +4086,7 @@ void wxWindow::OnDefaultAction(wxControl *initiatingItem)
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::Clear(void)
|
void wxWindow::Clear()
|
||||||
{
|
{
|
||||||
wxClientDC dc(this);
|
wxClientDC dc(this);
|
||||||
wxBrush brush(GetBackgroundColour(), wxSOLID);
|
wxBrush brush(GetBackgroundColour(), wxSOLID);
|
||||||
@@ -4146,7 +4095,7 @@ void wxWindow::Clear(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fits the panel around the items
|
// Fits the panel around the items
|
||||||
void wxWindow::Fit(void)
|
void wxWindow::Fit()
|
||||||
{
|
{
|
||||||
int maxX = 0;
|
int maxX = 0;
|
||||||
int maxY = 0;
|
int maxY = 0;
|
||||||
@@ -4315,7 +4264,7 @@ int y_pages = 0;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Setup background and foreground colours correctly
|
// Setup background and foreground colours correctly
|
||||||
void wxWindow::SetupColours(void)
|
void wxWindow::SetupColours()
|
||||||
{
|
{
|
||||||
if (GetParent())
|
if (GetParent())
|
||||||
SetBackgroundColour(GetParent()->GetBackgroundColour());
|
SetBackgroundColour(GetParent()->GetBackgroundColour());
|
||||||
@@ -4350,13 +4299,13 @@ void wxWindow::OnIdle(wxIdleEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Raise the window to the top of the Z order
|
// Raise the window to the top of the Z order
|
||||||
void wxWindow::Raise(void)
|
void wxWindow::Raise()
|
||||||
{
|
{
|
||||||
::BringWindowToTop((HWND) GetHWND());
|
::BringWindowToTop((HWND) GetHWND());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lower the window to the bottom of the Z order
|
// Lower the window to the bottom of the Z order
|
||||||
void wxWindow::Lower(void)
|
void wxWindow::Lower()
|
||||||
{
|
{
|
||||||
::SetWindowPos((HWND) GetHWND(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
|
::SetWindowPos((HWND) GetHWND(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user