merged 2.4 branch into the trunk

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-12-04 14:11:26 +00:00
parent 59a944cb63
commit 2b5f62a0b2
1057 changed files with 37805 additions and 24034 deletions

View File

@@ -75,6 +75,8 @@ void name::RemoveAt(size_t uiIndex, size_t nRemove) \
\
void name::Add(const T& item, size_t nInsert) \
{ \
if (nInsert == 0) \
return; \
T* pItem = new T(item); \
size_t nOldSize = GetCount(); \
if ( pItem != NULL ) \
@@ -85,6 +87,8 @@ void name::Add(const T& item, size_t nInsert) \
\
void name::Insert(const T& item, size_t uiIndex, size_t nInsert) \
{ \
if (nInsert == 0) \
return; \
T* pItem = new T(item); \
if ( pItem != NULL ) \
wxBaseArrayPtrVoid::Insert(pItem, uiIndex, nInsert); \

View File

@@ -22,6 +22,7 @@
class WXDLLEXPORT wxArtProvidersList;
class WXDLLEXPORT wxArtProviderCache;
class wxArtProviderModule;
// ----------------------------------------------------------------------------
// Types
@@ -113,10 +114,13 @@ public:
const wxArtClient& client = wxART_OTHER,
const wxSize& size = wxDefaultSize);
protected:
friend class wxArtProviderModule;
// Initializes default provider
static void InitStdProvider();
// Destroy caches & all providers
static void CleanUpProviders();
protected:
// Derived classes must override this method to create requested
// art resource. This method is called only once per instance's
// lifetime for each requested wxArtID.

View File

@@ -23,92 +23,96 @@
// of new/delete
// ----------------------------------------------------------------------------
class wxCharBuffer
{
public:
wxCharBuffer(const char *str)
: m_str(str ? strdup(str) : NULL)
{
}
#define DEFINE_BUFFER(classname, chartype, strdupfunc) \
class classname \
{ \
public: \
classname(const chartype *str) \
: m_str(str ? strdupfunc(str) : NULL) \
{ \
} \
\
classname(size_t len) \
: m_str((chartype *)malloc((len + 1)*sizeof(chartype))) \
{ \
m_str[len] = (chartype)0; \
} \
\
/* no need to check for NULL, free() does it */ \
~classname() { free(m_str); } \
\
/* \
WARNING: \
\
the copy ctor and assignment operators change the passed in object \
even although it is declared as "const", so: \
\
a) it shouldn't be really const \
b) you shouldn't use it afterwards (or know that it was reset) \
\
This is very ugly but is unfortunately needed to make the normal use\
of classname buffer objects possible and is very similar to what \
std::auto_ptr<> does (as if it were an excuse...) \
*/ \
\
/* \
because of the remark above, release() is declared const even if it \
isn't really const \
*/ \
chartype *release() const \
{ \
chartype *p = m_str; \
((classname *)this)->m_str = NULL; \
return p; \
} \
\
classname(const classname& src) \
: m_str(src.release()) \
{ \
} \
\
classname& operator=(const chartype *str) \
{ \
free(m_str); \
m_str = str ? strdupfunc(str) : NULL; \
return *this; \
} \
\
classname& operator=(const classname& src) \
{ \
free(m_str); \
m_str = src.release(); \
\
return *this; \
} \
\
chartype *data() { return m_str; } \
const chartype *data() const { return m_str; } \
operator const chartype *() const { return m_str; } \
chartype operator[](size_t n) const { return m_str[n]; } \
\
private: \
chartype *m_str; \
}
wxCharBuffer(size_t len)
: m_str((char *)malloc((len + 1)*sizeof(char)))
{
m_str[len] = '\0';
}
// no need to check for NULL, free() does it
~wxCharBuffer() { free(m_str); }
wxCharBuffer(const wxCharBuffer& src)
: m_str(src.m_str)
{
// no reference count yet...
((wxCharBuffer*)&src)->m_str = (char *)NULL;
}
wxCharBuffer& operator=(const wxCharBuffer& src)
{
m_str = src.m_str;
// no reference count yet...
((wxCharBuffer*)&src)->m_str = (char *)NULL;
return *this;
}
const char *data() const { return m_str; }
operator const char *() const { return m_str; }
char operator[](size_t n) const { return m_str[n]; }
private:
char *m_str;
};
DEFINE_BUFFER(wxCharBuffer, char, strdup);
#if wxUSE_WCHAR_T
class wxWCharBuffer
inline wchar_t *wxWcsdupReplacement(const wchar_t *wcs)
{
public:
wxWCharBuffer(const wchar_t *wcs)
: m_wcs((wchar_t *)NULL)
{
if (wcs) {
size_t siz = (wxWcslen(wcs) + 1)*sizeof(wchar_t);
m_wcs = (wchar_t *)malloc(siz);
memcpy(m_wcs, wcs, siz);
}
}
wxWCharBuffer(size_t len)
: m_wcs((wchar_t *)malloc((len + 1)*sizeof(wchar_t)))
{
m_wcs[len] = L'\0';
}
const size_t siz = (wxWcslen(wcs) + 1)*sizeof(wchar_t);
wchar_t *wcsCopy = (wchar_t *)malloc(siz);
memcpy(wcsCopy, wcs, siz);
return wcsCopy;
}
// no need to check for NULL, free() does it
~wxWCharBuffer() { free(m_wcs); }
wxWCharBuffer(const wxWCharBuffer& src)
: m_wcs(src.m_wcs)
{
// no reference count yet...
((wxWCharBuffer*)&src)->m_wcs = (wchar_t *)NULL;
}
wxWCharBuffer& operator=(const wxWCharBuffer& src)
{
m_wcs = src.m_wcs;
// no reference count yet...
((wxWCharBuffer*)&src)->m_wcs = (wchar_t *)NULL;
return *this;
}
const wchar_t *data() const { return m_wcs; }
operator const wchar_t *() const { return m_wcs; }
wchar_t operator[](size_t n) const { return m_wcs[n]; }
private:
wchar_t *m_wcs;
};
DEFINE_BUFFER(wxWCharBuffer, wchar_t, wxWcsdupReplacement);
#endif // wxUSE_WCHAR_T
#undef DEFINE_BUFFER
#if wxUSE_UNICODE
#define wxMB2WXbuf wxWCharBuffer
#define wxWX2MBbuf wxCharBuffer
@@ -125,101 +129,146 @@ private:
// A class for holding growable data buffers (not necessarily strings)
// ----------------------------------------------------------------------------
// This class manages the actual data buffer pointer and is ref-counted.
class wxMemoryBufferData
{
public:
// the initial size and also the size added by ResizeIfNeeded()
enum { BLOCK_SIZE = 1024 };
friend class wxMemoryBuffer;
// everyting is private as it can only be used by wxMemoryBuffer
private:
wxMemoryBufferData(size_t size = wxMemoryBufferData::BLOCK_SIZE)
: m_data(size ? malloc(size) : NULL), m_size(size), m_len(0), m_ref(0)
{
}
~wxMemoryBufferData() { free(m_data); }
void ResizeIfNeeded(size_t newSize)
{
if (newSize > m_size)
{
void *dataOld = m_data;
m_data = realloc(m_data, newSize + wxMemoryBufferData::BLOCK_SIZE);
if ( !m_data )
{
free(dataOld);
}
m_size = newSize + wxMemoryBufferData::BLOCK_SIZE;
}
}
void IncRef() { m_ref += 1; }
void DecRef()
{
m_ref -= 1;
if (m_ref == 0) // are there no more references?
delete this;
}
// the buffer containing the data
void *m_data;
// the size of the buffer
size_t m_size;
// the amount of data currently in the buffer
size_t m_len;
// the reference count
size_t m_ref;
};
class wxMemoryBuffer
{
public:
enum { BLOCK_SIZE = 1024 };
wxMemoryBuffer(size_t size = wxMemoryBuffer::BLOCK_SIZE)
: m_data(malloc(size)), m_size(size), m_len(0)
// ctor and dtor
wxMemoryBuffer(size_t size = wxMemoryBufferData::BLOCK_SIZE)
{
m_bufdata = new wxMemoryBufferData(size);
m_bufdata->IncRef();
}
~wxMemoryBuffer() { m_bufdata->DecRef(); }
// copy and assignment
wxMemoryBuffer(const wxMemoryBuffer& src)
: m_bufdata(src.m_bufdata)
{
m_bufdata->IncRef();
}
wxMemoryBuffer& operator=(const wxMemoryBuffer& src)
{
m_bufdata->DecRef();
m_bufdata = src.m_bufdata;
m_bufdata->IncRef();
return *this;
}
~wxMemoryBuffer() { free(m_data); }
// Accessors
void* GetData() const { return m_data; }
size_t GetBufSize() const { return m_size; }
size_t GetDataLen() const { return m_len; }
void *GetData() const { return m_bufdata->m_data; }
size_t GetBufSize() const { return m_bufdata->m_size; }
size_t GetDataLen() const { return m_bufdata->m_len; }
void SetBufSize(size_t size) { ResizeIfNeeded(size); }
void SetBufSize(size_t size) { m_bufdata->ResizeIfNeeded(size); }
void SetDataLen(size_t len)
{
wxASSERT(len <= m_size);
m_len = len;
wxASSERT(len <= m_bufdata->m_size);
m_bufdata->m_len = len;
}
// Ensure the buffer is big enough and return a pointer to it
void* GetWriteBuf(size_t sizeNeeded)
void *GetWriteBuf(size_t sizeNeeded)
{
ResizeIfNeeded(sizeNeeded);
return m_data;
m_bufdata->ResizeIfNeeded(sizeNeeded);
return m_bufdata->m_data;
}
// Update the length after the write
void UngetWriteBuf(size_t sizeUsed) { SetDataLen(sizeUsed); }
// Like the above, but appends to the buffer
void* GetAppendBuf(size_t sizeNeeded)
void *GetAppendBuf(size_t sizeNeeded)
{
ResizeIfNeeded(m_len + sizeNeeded);
return (char*)m_data + m_len;
m_bufdata->ResizeIfNeeded(m_bufdata->m_len + sizeNeeded);
return (char*)m_bufdata->m_data + m_bufdata->m_len;
}
// Update the length after the append
void UngetAppendBuf(size_t sizeUsed)
{
SetDataLen(m_bufdata->m_len + sizeUsed);
}
void UngetAppendBuf(size_t sizeUsed) { SetDataLen(m_len + sizeUsed); }
// Other ways to append to the buffer
void AppendByte(char data) {
ResizeIfNeeded(m_len + 1);
*(((char*)m_data)+m_len) = data;
m_len += 1;
void AppendByte(char data)
{
wxCHECK_RET( m_bufdata->m_data, _T("invalid wxMemoryBuffer") );
m_bufdata->ResizeIfNeeded(m_bufdata->m_len + 1);
*(((char*)m_bufdata->m_data) + m_bufdata->m_len) = data;
m_bufdata->m_len += 1;
}
void AppendData(void* data, size_t len)
{
memcpy(GetAppendBuf(len), data, len);
UngetAppendBuf(len);
}
operator const char *() const { return (const char*)m_data; }
// Copy and assignment
wxMemoryBuffer(const wxMemoryBuffer& src)
: m_data(src.m_data), m_size(src.m_size), m_len(src.m_len)
{
// no reference count yet...
((wxMemoryBuffer*)&src)->m_data = NULL;
((wxMemoryBuffer*)&src)->m_size = 0;
((wxMemoryBuffer*)&src)->m_len = 0;
}
wxMemoryBuffer& operator=(const wxMemoryBuffer& src)
{
m_data = src.m_data;
m_size = src.m_size;
m_len = src.m_len;
// no reference count yet...
((wxMemoryBuffer*)&src)->m_data = NULL;
((wxMemoryBuffer*)&src)->m_size = 0;
((wxMemoryBuffer*)&src)->m_len = 0;
return *this;
}
protected:
void ResizeIfNeeded(size_t newSize)
{
if (newSize > m_size)
{
m_data = realloc(m_data, newSize + wxMemoryBuffer::BLOCK_SIZE);
wxASSERT(m_data != NULL);
m_size = newSize + wxMemoryBuffer::BLOCK_SIZE;
}
}
operator const char *() const { return (const char*)GetData(); }
private:
void* m_data;
size_t m_size;
size_t m_len;
wxMemoryBufferData* m_bufdata;
};
// ----------------------------------------------------------------------------

View File

@@ -16,7 +16,7 @@
#include "wx/wxprec.h"
#ifdef __BORDLANDC__
#ifdef __BORLANDC__
#pragma hdrstop
#endif

View File

@@ -95,6 +95,14 @@
# endif
#endif /* !defined(wxUSE_MIMETYPE) */
#ifndef wxUSE_PROLOGIO
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_PROLOGIO must be defined."
# else
# define wxUSE_PROLOGIO 0
# endif
#endif /* !defined(wxUSE_PROLOGIO) */
#ifndef wxUSE_PROTOCOL
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_PROTOCOL must be defined."
@@ -675,6 +683,14 @@
# endif
#endif /* !defined(wxUSE_TREECTRL) */
#ifndef wxUSE_WX_RESOURCES
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_WX_RESOURCES must be defined."
# else
# define wxUSE_WX_RESOURCES 0
# endif
#endif /* !defined(wxUSE_WX_RESOURCES) */
#ifndef wxUSE_WXHTML_HELP
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_WXHTML_HELP must be defined."
@@ -1168,5 +1184,14 @@
# endif
#endif /* wxUSE_CLIPBOARD */
#if wxUSE_WX_RESOURCES && !wxUSE_PROLOGIO
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxr resources require PrologIO"
# else
# undef wxUSE_PROLOGIO
# define wxUSE_PROLOGIO 1
# endif
#endif /* wxUSE_WX_RESOURCES */
#endif /* wxUSE_GUI */

View File

@@ -26,7 +26,7 @@
class WXDLLEXPORT wxCommand : public wxObject
{
public:
wxCommand(bool canUndoIt = FALSE, const wxString& name = "");
wxCommand(bool canUndoIt = FALSE, const wxString& name = wxT(""));
~wxCommand();
// Override this to perform a command

View File

@@ -218,9 +218,11 @@ public:
#elif defined(__WXMAC__)
void* m_macPageFormat ;
void* m_macPrintSettings ;
void* m_macPrintSession ;
#endif
private:
int m_printNoCopies;
int m_printOrientation;
bool m_printCollate;

View File

@@ -14,9 +14,9 @@
#if wxUSE_COLOURDLG
#if defined(__WXMSW__)
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/colordlg.h"
#elif defined(__WXMAC__)
#elif defined(__WXMAC__) && !defined(__WXUNIVERSAL__)
#include "wx/mac/colordlg.h"
#else
#include "wx/generic/colrdlgg.h"

View File

@@ -17,6 +17,8 @@
#pragma interface "datetime.h"
#endif
#include "wx/defs.h"
#if wxUSE_DATETIME
#include <time.h>
@@ -657,8 +659,10 @@ public:
// ------------------------------------------------------------------------
// set to the given week day in the same week as this one
wxDateTime& SetToWeekDayInSameWeek(WeekDay weekday);
inline wxDateTime GetWeekDayInSameWeek(WeekDay weekday) const;
wxDateTime& SetToWeekDayInSameWeek(WeekDay weekday,
WeekFlags flags = Monday_First);
inline wxDateTime GetWeekDayInSameWeek(WeekDay weekday,
WeekFlags flags = Monday_First) const;
// set to the next week day following this one
wxDateTime& SetToNextWeekDay(WeekDay weekday);
@@ -692,8 +696,12 @@ public:
// sets the date to the given day of the given week in the year,
// returns TRUE on success and FALSE if given date doesn't exist (e.g.
// numWeek is > 53)
bool SetToTheWeek(wxDateTime_t numWeek, WeekDay weekday = Mon);
inline wxDateTime GetWeek(wxDateTime_t numWeek, WeekDay weekday = Mon) const;
bool SetToTheWeek(wxDateTime_t numWeek,
WeekDay weekday = Mon,
WeekFlags flags = Monday_First);
inline wxDateTime GetWeek(wxDateTime_t numWeek,
WeekDay weekday = Mon,
WeekFlags flags = Monday_First) const;
// sets the date to the last day of the given (or current) month or the
// given (or current) year
@@ -843,6 +851,15 @@ public:
// adoption of the Gregorian calendar is simply unknown.
bool IsGregorianDate(GregorianAdoption country = Gr_Standard) const;
// dos date and time format
// ------------------------------------------------------------------------
// set from the DOS packed format
wxDateTime& SetFromDOS(unsigned long ddt);
// pack the date in DOS format
unsigned long GetAsDOS() const;
// comparison (see also functions below for operator versions)
// ------------------------------------------------------------------------

View File

@@ -156,7 +156,8 @@ inline bool wxDateTime::SetToLastWeekDay(WeekDay weekday,
return SetToWeekDay(weekday, -1, month, year);
}
inline wxDateTime wxDateTime::GetWeekDayInSameWeek(WeekDay weekday) const
inline wxDateTime wxDateTime::GetWeekDayInSameWeek(WeekDay weekday,
WeekFlags flags) const
{
MODIFY_AND_RETURN( SetToWeekDayInSameWeek(weekday) );
}
@@ -191,11 +192,12 @@ inline wxDateTime wxDateTime::GetLastWeekDay(WeekDay weekday,
}
inline wxDateTime wxDateTime::GetWeek(wxDateTime_t numWeek,
WeekDay weekday) const
WeekDay weekday,
WeekFlags flags) const
{
wxDateTime dt(*this);
return dt.SetToTheWeek(numWeek, weekday) ? dt : wxInvalidDateTime;
return dt.SetToTheWeek(numWeek, weekday, flags) ? dt : wxInvalidDateTime;
}
inline wxDateTime wxDateTime::GetLastMonthDay(Month month, int year) const

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////
// Name: db.h
// Name: wx/db.h
// Purpose: Header file wxDb class. The wxDb class represents a connection
// to an ODBC data source. The wxDb class allows operations on the data
// source such as opening and closing the data source.
@@ -32,13 +32,8 @@
//
///////////////////////////////////////////////////////////////////////////////
/*
// SYNOPSIS START
// SYNOPSIS STOP
*/
#ifndef DB_DOT_H
#define DB_DOT_H
#ifndef _WX_DB_H_
#define _WX_DB_H_
// BJO 20000503: introduce new GetColumns members which are more database independant and
@@ -58,36 +53,40 @@
#include "wx/string.h"
#ifdef __VISUALC__
// include standard Windows headers
#if defined(__WXMSW__) && !wxUSE_MFC
#ifndef STRICT
#define STRICT 1
#endif
// we need to include standard Windows headers but we can't include
// <windows.h> directly when using MFC because it includes it itself in a
// different manner
#if wxUSE_MFC
#include <afxwin.h>
#else // !wxUSE_MFC
#ifndef STRICT
#define STRICT 1
#endif
#include <windows.h>
#include "wx/msw/winundef.h"
#endif
#include <windows.h>
#include "wx/msw/winundef.h"
#endif // wxUSE_MFC/!wxUSE_MFC
// If you use the wxDbCreateDataSource() function with MSW/VC6,
// you cannot use the iODBC headers, you must use the VC headers,
// plus the odbcinst.h header - gt Nov 2 2000
//
// Must add "odbccp32.lib" in \wx2\wxWindows\src\makevc.env to the WINLIBS= line
//
// If you use the wxDbCreateDataSource() function with MSW/VC6,
// you cannot use the iODBC headers, you must use the VC headers,
// plus the odbcinst.h header - gt Nov 2 2000
//
// Must add "odbccp32.lib" in \wx2\wxWindows\src\makevc.env to the WINLIBS= line
//
#include "sql.h"
#include "sqlext.h"
#include "odbcinst.h"
#elif defined( __VMS )
// For OpenVMS use the ones from the library
extern "C" {
#include <isql.h>
#include <isqlext.h>
}
#else
extern "C" {
#include "wx/isql.h"
#include "wx/isqlext.h"
}
// For OpenVMS use the ones from the library
extern "C" {
#include <isql.h>
#include <isqlext.h>
}
#else // !__VISUALC__, !__VMS
extern "C" {
#include "wx/isql.h"
#include "wx/isqlext.h"
}
#endif
@@ -715,7 +714,7 @@ int WXDLLEXPORT wxDbConnectionsInUse(void);
// Writes a message to the wxLog window (stdout usually) when an internal error
// situation occurs. This function only works in DEBUG builds
const wxChar WXDLLEXPORT *wxDbLogExtendedErrorMsg(const wxChar *userText,
const wxChar* WXDLLEXPORT wxDbLogExtendedErrorMsg(const wxChar *userText,
wxDb *pDb,
const wxChar *ErrFile,
int ErrLine);
@@ -772,10 +771,11 @@ bool WXDLLEXPORT FreeDbConnection(wxDB *pDb);
void WXDLLEXPORT CloseDbConnections(void);
int WXDLLEXPORT NumberDbConnectionsInUse(void);
bool SqlLog(sqlLog state, const char *filename = SQL_LOG_FILENAME);
bool SqlLog(sqlLog state, const wxChar *filename = SQL_LOG_FILENAME);
bool WXDLLEXPORT GetDataSource(HENV henv, char *Dsn, SWORD DsnMax, char *DsDesc, SWORD DsDescMax,
UWORD direction = SQL_FETCH_NEXT);
#endif // Deprecated structures/classes/functions
#endif
#endif // _WX_DB_H_

View File

@@ -123,12 +123,13 @@
// Use of wxFalse instead of FALSE suppresses compiler warnings about testing
// constant expression
WXDLLEXPORT_DATA(extern const bool) wxFalse;
#define wxAssertFailure wxFalse
// special form of assert: always triggers it (in debug mode)
#define wxFAIL wxASSERT(wxFalse)
#define wxFAIL wxASSERT(wxAssertFailure)
// FAIL with some message
#define wxFAIL_MSG(msg) wxASSERT_MSG(wxFalse, msg)
#define wxFAIL_MSG(msg) wxASSERT_MSG(wxAssertFailure, msg)
// NB: the following macros work also in release mode!

View File

@@ -1099,6 +1099,7 @@ enum wxBorder
* wxRadioButton style flag
*/
#define wxRB_GROUP 0x0004
#define wxRB_SINGLE 0x0008
/*
* wxGauge flags
@@ -1172,8 +1173,12 @@ enum wxBorder
*/
#define wxTC_RIGHTJUSTIFY 0x0010
#define wxTC_FIXEDWIDTH 0x0020
#define wxTC_OWNERDRAW 0x0040
#define wxTC_TOP 0x0000 // default
#define wxTC_LEFT 0x0020
#define wxTC_RIGHT 0x0040
#define wxTC_BOTTOM 0x0080
#define wxTC_MULTILINE wxNB_MULTILINE
#define wxTC_OWNERDRAW 0x0200
// wxToolBar style flags
#define wxTB_HORIZONTAL wxHORIZONTAL // == 0x0004
@@ -1794,11 +1799,11 @@ enum wxPrintMode
// macro to specify "All Files" on different platforms
#if defined(__WXMSW__) || defined(__WXPM__)
# define wxALL_FILES_PATTERN "*.*"
# define wxALL_FILES gettext_noop("All files (*.*)|*.*")
# define wxALL_FILES_PATTERN wxT("*.*")
# define wxALL_FILES gettext_noop(wxT("All files (*.*)|*.*"))
#else
# define wxALL_FILES_PATTERN "*"
# define wxALL_FILES gettext_noop("All files (*)|*")
# define wxALL_FILES_PATTERN wxT("*")
# define wxALL_FILES gettext_noop(wxT("All files (*)|*"))
#endif
// ---------------------------------------------------------------------------
@@ -2083,13 +2088,24 @@ typedef GtkWidget *WXWidget;
#endif
#ifdef __WXGTK20__
/* Input method thing */
typedef struct _GtkIMMulticontext GtkIMMulticontext;
#endif // __WXGTK20__
#endif // __WXGTK__
#if defined(__WXGTK20__) || (defined(__WXX11__) && wxUSE_UNICODE)
#define wxUSE_PANGO 1
#else
#define wxUSE_PANGO 0
#endif
#if wxUSE_PANGO
/* Stand-ins for Pango types */
typedef struct _PangoContext PangoContext;
typedef struct _PangoLayout PangoLayout;
typedef struct _PangoFontDescription PangoFontDescription;
#endif // GTK+ 2.0
#endif // GTK
#endif
#ifdef __WXMGL__
typedef struct window_t *WXWidget;

View File

@@ -29,26 +29,26 @@
class WXDLLEXPORT wxDocMDIParentFrame: public wxMDIParentFrame
{
DECLARE_CLASS(wxDocMDIParentFrame)
public:
wxDocMDIParentFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id,
const wxString& title, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame");
public:
wxDocMDIParentFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id,
const wxString& title, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame"));
// Extend event processing to search the document manager's event table
virtual bool ProcessEvent(wxEvent& event);
// Extend event processing to search the document manager's event table
virtual bool ProcessEvent(wxEvent& event);
wxDocManager *GetDocumentManager(void) const { return m_docManager; }
wxDocManager *GetDocumentManager(void) const { return m_docManager; }
void OnExit(wxCommandEvent& event);
void OnMRUFile(wxCommandEvent& event);
void OnCloseWindow(wxCloseEvent& event);
void OnExit(wxCommandEvent& event);
void OnMRUFile(wxCommandEvent& event);
void OnCloseWindow(wxCloseEvent& event);
protected:
wxDocManager *m_docManager;
protected:
wxDocManager *m_docManager;
DECLARE_EVENT_TABLE()
private:
DECLARE_CLASS(wxDocMDIParentFrame)
DECLARE_EVENT_TABLE()
};
/*
@@ -57,31 +57,31 @@ DECLARE_EVENT_TABLE()
class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame
{
DECLARE_CLASS(wxDocMDIChildFrame)
public:
wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id,
const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long type = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame"));
~wxDocMDIChildFrame();
public:
wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id,
const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long type = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame");
~wxDocMDIChildFrame(void);
// Extend event processing to search the view's event table
virtual bool ProcessEvent(wxEvent& event);
// Extend event processing to search the view's event table
virtual bool ProcessEvent(wxEvent& event);
void OnActivate(wxActivateEvent& event);
void OnCloseWindow(wxCloseEvent& event);
void OnActivate(wxActivateEvent& event);
void OnCloseWindow(wxCloseEvent& event);
inline wxDocument *GetDocument(void) const { return m_childDocument; }
inline wxView *GetView(void) const { return m_childView; }
inline void SetDocument(wxDocument *doc) { m_childDocument = doc; }
inline void SetView(wxView *view) { m_childView = view; }
bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); }
protected:
wxDocument* m_childDocument;
wxView* m_childView;
DECLARE_EVENT_TABLE()
inline wxDocument *GetDocument() const { return m_childDocument; }
inline wxView *GetView(void) const { return m_childView; }
inline void SetDocument(wxDocument *doc) { m_childDocument = doc; }
inline void SetView(wxView *view) { m_childView = view; }
bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); }
protected:
wxDocument* m_childDocument;
wxView* m_childView;
private:
DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxDocMDIChildFrame)
};
#endif

View File

@@ -64,8 +64,6 @@ enum
class WXDLLEXPORT wxDocument : public wxEvtHandler
{
DECLARE_ABSTRACT_CLASS(wxDocument)
public:
wxDocument(wxDocument *parent = (wxDocument *) NULL);
~wxDocument();
@@ -160,12 +158,13 @@ protected:
wxDocument* m_documentParent;
wxCommandProcessor* m_commandProcessor;
bool m_savedYet;
private:
DECLARE_ABSTRACT_CLASS(wxDocument)
};
class WXDLLEXPORT wxView: public wxEvtHandler
{
DECLARE_ABSTRACT_CLASS(wxView)
public:
// wxView(wxDocument *doc = (wxDocument *) NULL);
wxView();
@@ -222,12 +221,14 @@ protected:
wxDocument* m_viewDocument;
wxString m_viewTypeName;
wxWindow* m_viewFrame;
private:
DECLARE_ABSTRACT_CLASS(wxView)
};
// Represents user interface (and other) properties of documents and views
class WXDLLEXPORT wxDocTemplate: public wxObject
{
DECLARE_CLASS(wxDocTemplate)
friend class WXDLLEXPORT wxDocManager;
@@ -286,6 +287,9 @@ protected:
// For dynamic creation of appropriate instances.
wxClassInfo* m_docClassInfo;
wxClassInfo* m_viewClassInfo;
private:
DECLARE_CLASS(wxDocTemplate)
};
// One object of this class may be created in an application, to manage all
@@ -333,9 +337,6 @@ public:
// called when file format detection didn't work, can be overridden to do
// something in this case
// This is of course completely stupid, because if the file dialog is
// cancelled you get an assert. Brilliant. -- JACS
// virtual void OnOpenFileFailure() { wxFAIL_MSG(_T("file format mismatch")); }
virtual void OnOpenFileFailure() { }
virtual wxDocument *CreateDocument(const wxString& path, long flags = 0);
@@ -427,8 +428,6 @@ protected:
class WXDLLEXPORT wxDocChildFrame : public wxFrame
{
DECLARE_CLASS(wxDocChildFrame)
public:
wxDocChildFrame(wxDocument *doc,
wxView *view,
@@ -438,7 +437,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long type = wxDEFAULT_FRAME_STYLE,
const wxString& name = "frame");
const wxString& name = wxT("frame"));
~wxDocChildFrame();
// Extend event processing to search the view's event table
@@ -457,6 +456,8 @@ protected:
wxDocument* m_childDocument;
wxView* m_childView;
private:
DECLARE_CLASS(wxDocChildFrame)
DECLARE_EVENT_TABLE()
};
@@ -466,8 +467,6 @@ protected:
class WXDLLEXPORT wxDocParentFrame : public wxFrame
{
DECLARE_CLASS(wxDocParentFrame)
public:
wxDocParentFrame(wxDocManager *manager,
wxFrame *frame,
@@ -476,7 +475,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long type = wxDEFAULT_FRAME_STYLE,
const wxString& name = "frame");
const wxString& name = wxT("frame"));
// Extend event processing to search the document manager's event table
virtual bool ProcessEvent(wxEvent& event);
@@ -490,6 +489,8 @@ public:
protected:
wxDocManager *m_docManager;
private:
DECLARE_CLASS(wxDocParentFrame)
DECLARE_EVENT_TABLE()
};
@@ -500,10 +501,8 @@ protected:
#if wxUSE_PRINTING_ARCHITECTURE
class WXDLLEXPORT wxDocPrintout : public wxPrintout
{
DECLARE_DYNAMIC_CLASS(wxDocPrintout)
public:
wxDocPrintout(wxView *view = (wxView *) NULL, const wxString& title = "Printout");
wxDocPrintout(wxView *view = (wxView *) NULL, const wxString& title = wxT("Printout"));
bool OnPrintPage(int page);
bool HasPage(int page);
bool OnBeginDocument(int startPage, int endPage);
@@ -513,6 +512,9 @@ public:
protected:
wxView* m_printoutView;
private:
DECLARE_DYNAMIC_CLASS(wxDocPrintout)
};
#endif // wxUSE_PRINTING_ARCHITECTURE
@@ -522,8 +524,6 @@ protected:
class WXDLLEXPORT wxFileHistory : public wxObject
{
DECLARE_DYNAMIC_CLASS(wxFileHistory)
public:
wxFileHistory(int maxFiles = 9);
~wxFileHistory();
@@ -563,6 +563,9 @@ protected:
wxList m_fileMenus;
// Max files to maintain
int m_fileMaxFiles;
private:
DECLARE_DYNAMIC_CLASS(wxFileHistory)
};
#if wxUSE_STD_IOSTREAM

View File

@@ -8,7 +8,7 @@ class WXDLLEXPORT wxMemoryDC;
class WXDLLEXPORT wxDC;
#if defined(__WXMSW__)
#ifdef __WIN16__
#if defined(__WIN16__) || defined(__WXUNIVERSAL__)
#include "wx/generic/dragimgg.h"
#define wxDragImage wxGenericDragImage
#define sm_classwxDragImage sm_classwxGenericDragImage

View File

@@ -25,7 +25,7 @@
#if wxUSE_DYNAMIC_LOADER
#include "wx/hash.h"
#include "wx/hashmap.h"
#include "wx/module.h"
// FIXME: can this go in private.h or something too??
@@ -38,11 +38,10 @@
#include "wx/msw/private.h"
#endif
// Ugh, I'd much rather this was typesafe, but no time
// to rewrite wxHashTable right now..
class WXDLLEXPORT wxPluginLibrary;
typedef wxHashTable wxDLManifest;
typedef wxHashTable wxDLImports;
WX_DECLARE_EXPORTED_STRING_HASH_MAP(wxPluginLibrary *, wxDLManifest);
typedef wxDLManifest wxDLImports;
// ----------------------------------------------------------------------------
// conditional compilation
@@ -168,7 +167,7 @@ protected:
// no copy ctor/assignment operators
// or we'd try to unload the library twice
DECLARE_NO_COPY_CLASS(wxDynamicLibrary)
DECLARE_NO_COPY_CLASS(wxDynamicLibrary)
};
@@ -234,7 +233,7 @@ private:
void RegisterModules(); // Init any wxModules in the lib.
void UnregisterModules(); // Cleanup any wxModules we installed.
DECLARE_NO_COPY_CLASS(wxPluginLibrary)
DECLARE_NO_COPY_CLASS(wxPluginLibrary)
};
@@ -257,7 +256,7 @@ public:
// Instance methods.
wxPluginManager() : m_entry(0) {};
wxPluginManager() : m_entry(NULL) {};
wxPluginManager(const wxString &libname, int flags = wxDL_DEFAULT)
{
Load(libname, flags);
@@ -277,14 +276,21 @@ public:
static void ClearManifest() { delete ms_manifest; ms_manifest = NULL; }
private:
// return the pointer to the entry for the library with given name in
// ms_manifest or NULL if none
static wxPluginLibrary *FindByName(const wxString& name)
{
const wxDLManifest::iterator i = ms_manifest->find(name);
return i == ms_manifest->end() ? NULL : i->second;
}
static wxDLManifest* ms_manifest; // Static hash of loaded libs.
wxPluginLibrary* m_entry; // Cache our entry in the manifest.
// We could allow this class to be copied if we really
// wanted to, but not without modification.
DECLARE_NO_COPY_CLASS(wxPluginManager)
DECLARE_NO_COPY_CLASS(wxPluginManager)
};

View File

@@ -62,7 +62,7 @@ class WXDLLEXPORT wxEncodingConverter : public wxObject
wxEncodingConverter();
~wxEncodingConverter() { if (m_Table) delete[] m_Table; }
// Initialize convertion. Both output or input encoding may
// Initialize conversion. Both output or input encoding may
// be wxFONTENCODING_UNICODE, but only if wxUSE_WCHAR_T is set to 1.
//
// All subsequent calls to Convert() will interpret it's argument

View File

@@ -817,22 +817,7 @@ class WXDLLEXPORT wxKeyEvent : public wxEvent
{
public:
wxKeyEvent(wxEventType keyType = wxEVT_NULL);
wxKeyEvent(const wxKeyEvent& evt) : wxEvent(evt)
{
m_x = evt.m_x;
m_y = evt.m_y;
m_keyCode = evt.m_keyCode;
m_controlDown = evt.m_controlDown;
m_shiftDown = evt.m_shiftDown;
m_altDown = evt.m_altDown;
m_metaDown = evt.m_metaDown;
m_scanCode = evt.m_scanCode;
m_rawCode = evt.m_rawCode;
m_rawFlags = evt.m_rawFlags;
}
wxKeyEvent(const wxKeyEvent& evt);
// Find state of shift/control keys
bool ControlDown() const { return m_controlDown; }
@@ -914,8 +899,14 @@ public:
bool m_metaDown;
bool m_scanCode;
// these fields contain the platform-specific information about the pressed
// key
#if wxUSE_UNICODE
// This contains the full Unicode character
// in a character events in Unicode mode
wxChar m_uniChar;
#endif
// these fields contain the platform-specific information about
// key that was pressed
wxUint32 m_rawCode;
wxUint32 m_rawFlags;

View File

@@ -150,34 +150,25 @@ WXDLLEXPORT int wxOpen( const wxChar *pathname, int flags, mode_t mode );
// functions
// ----------------------------------------------------------------------------
WXDLLEXPORT bool wxFileExists(const wxString& filename);
#define FileExists wxFileExists
// does the path exist? (may have or not '/' or '\\' at the end)
WXDLLEXPORT bool wxPathExists(const wxChar *pszPathName);
#define wxDirExists wxPathExists
#define DirExists wxDirExists
WXDLLEXPORT bool wxIsAbsolutePath(const wxString& filename);
#define IsAbsolutePath wxIsAbsolutePath
// Get filename
WXDLLEXPORT wxChar* wxFileNameFromPath(wxChar *path);
WXDLLEXPORT wxString wxFileNameFromPath(const wxString& path);
#define FileNameFromPath wxFileNameFromPath
// Get directory
WXDLLEXPORT wxString wxPathOnly(const wxString& path);
#define PathOnly wxPathOnly
// wxString version
WXDLLEXPORT wxString wxRealPath(const wxString& path);
WXDLLEXPORT void wxDos2UnixFilename(wxChar *s);
#define Dos2UnixFilename wxDos2UnixFilename
WXDLLEXPORT void wxUnix2DosFilename(wxChar *s);
#define Unix2DosFilename wxUnix2DosFilename
// Strip the extension, in situ
WXDLLEXPORT void wxStripExtension(wxChar *buffer);
@@ -251,6 +242,19 @@ WXDLLEXPORT bool wxMkdir(const wxString& dir, int perm = 0777);
// Remove directory. Flags reserved for future use.
WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0);
// compatibility defines, don't use in new code
#define wxDirExists wxPathExists
#if WXWIN_COMPATIBILITY_2
#define FileExists wxFileExists
#define DirExists wxDirExists
#define IsAbsolutePath wxIsAbsolutePath
#define FileNameFromPath wxFileNameFromPath
#define PathOnly wxPathOnly
#define Dos2UnixFilename wxDos2UnixFilename
#define Unix2DosFilename wxUnix2DosFilename
#endif
// ----------------------------------------------------------------------------
// separators in file names
// ----------------------------------------------------------------------------

View File

@@ -274,14 +274,21 @@ public:
// Comparison
// compares with the rules of this platform
bool SameAs(const wxFileName &filepath,
wxPathFormat format = wxPATH_NATIVE);
// compares with the rules of the given platforms format
bool SameAs(const wxFileName& filepath,
wxPathFormat format = wxPATH_NATIVE) const;
// uses the current platform settings
bool operator==(const wxFileName& filename) { return SameAs(filename); }
bool operator==(const wxString& filename)
{ return *this == wxFileName(filename); }
// compare with another filename object
bool operator==(const wxFileName& filename) const
{ return SameAs(filename); }
bool operator!=(const wxFileName& filename) const
{ return !SameAs(filename); }
// compare with a filename string interpreted as a native file name
bool operator==(const wxString& filename) const
{ return SameAs(wxFileName(filename)); }
bool operator!=(const wxString& filename) const
{ return !SameAs(wxFileName(filename)); }
// are the file names of this type cases sensitive?
static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );

View File

@@ -180,6 +180,13 @@ public:
// remove all items from the m_Handlers list
static void CleanUpHandlers();
// Returns the native path for a file URL
static wxString URLToNativePath( const wxString& url );
// Returns the file URL for a native path
static wxString NativePathToURL( const wxString& path );
protected:
wxString m_Path;
// the path (location) we are currently in

View File

@@ -182,6 +182,10 @@ public:
wxString GetStyleString() const;
wxString GetWeightString() const;
// Unofficial API, don't use
virtual void SetNoAntiAliasing( bool no = TRUE ) { }
virtual bool GetNoAntiAliasing() { return FALSE; }
// the default encoding is used for creating all fonts with default
// encoding parameter
static wxFontEncoding GetDefaultEncoding() { return ms_encodingDefault; }
@@ -191,7 +195,7 @@ protected:
// get the internal data
wxFontRefData *GetFontData() const
{ return (wxFontRefData *)m_refData; }
private:
// the currently default encoding: by default, it's the default system
// encoding, but may be changed by the application using

View File

@@ -71,6 +71,15 @@ enum wxFontEncoding
wxFONTENCODING_UTF7, // UTF-7 Unicode encoding
wxFONTENCODING_UTF8, // UTF-8 Unicode encoding
// Far Eastern encodings
// Chinese
wxFONTENCODING_GB2312 = wxFONTENCODING_CP936, // Simplified Chinese
wxFONTENCODING_BIG5 = wxFONTENCODING_CP950, // Traditional Chinese
// Japanese (see http://zsigri.tripod.com/fontboard/cjk/jis.html)
wxFONTENCODING_SHIFT_JIS = wxFONTENCODING_CP932, // Shift JIS
wxFONTENCODING_EUC_JP, // Extended Unix Codepage for Japanese
wxFONTENCODING_UNICODE, // Unicode - currently used only by
// wxEncodingConverter class

View File

@@ -72,7 +72,9 @@ enum wxXLFDField
// further it might make sense to make it a real class with virtual methods
struct WXDLLEXPORT wxNativeFontInfo
{
#if defined(_WX_X_FONTLIKE)
#if wxUSE_PANGO
PangoFontDescription *description;
#elif defined(_WX_X_FONTLIKE)
// the members can't be accessed directly as we only parse the
// xFontName on demand
private:
@@ -113,8 +115,6 @@ public:
FATTRS fa;
FONTMETRICS fm;
FACENAMEDESC fn;
#elif defined(__WXGTK20__)
PangoFontDescription *description;
#else // other platforms
//
// This is a generic implementation that should work on all ports

View File

@@ -86,8 +86,10 @@ public:
virtual wxMenuBar *GetMenuBar() const { return m_frameMenuBar; }
#endif // wxUSE_MENUS
#ifdef WXWIN_COMPATIBILITY_2_2
// call this to simulate a menu command
bool Command(int id) { return ProcessCommand(id); }
#endif // WXWIN_COMPATIBILITY_2_2
// process menu command: returns TRUE if processed
bool ProcessCommand(int id);

View File

@@ -15,7 +15,7 @@
#include "wx/wxprec.h"
#ifdef __BORDLANDC__
#ifdef __BORLANDC__
#pragma hdrstop
#endif

View File

@@ -16,7 +16,7 @@
#include "wx/wxprec.h"
#ifdef __BORDLANDC__
#ifdef __BORLANDC__
#pragma hdrstop
#endif

View File

@@ -151,10 +151,10 @@ enum wxStockCursor
#ifdef __WXMSW__
// Load from a resource
#define wxICON(X) wxIcon("" #X "")
#define wxICON(X) wxIcon(wxT(#X))
#elif defined(__WXPM__)
// Load from a resource
#define wxICON(X) wxIcon("" #X "")
#define wxICON(X) wxIcon(wxT(#X))
#elif defined(__WXMGL__)
// Initialize from an included XPM
#define wxICON(X) wxIcon( (const char**) X##_xpm )
@@ -172,7 +172,7 @@ enum wxStockCursor
#define wxICON(X) wxIcon( X##_xpm )
#else
// This will usually mean something on any platform
#define wxICON(X) wxIcon("" #X "")
#define wxICON(X) wxIcon(wxT(#X))
#endif // platform
/* Another macro: this one is for portable creation of bitmaps. We assume that
@@ -180,7 +180,7 @@ enum wxStockCursor
*/
#if defined(__WXMSW__) || defined(__WXPM__)
#define wxBITMAP(name) wxBitmap(#name, wxBITMAP_TYPE_RESOURCE)
#define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE)
#elif defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__) || defined(__WXMAC__) || defined(__WXMGL__)
// Initialize from an included XPM
#define wxBITMAP(name) wxBitmap( (const char**) name##_xpm )
@@ -247,6 +247,7 @@ public:
wxRealPoint operator-(const wxRealPoint& pt) const { return wxRealPoint(x - pt.x, y - pt.y); }
bool operator==(const wxRealPoint& pt) const { return x == pt.x && y == pt.y; }
bool operator!=(const wxRealPoint& pt) const { return x != pt.x || y != pt.y; }
};
class WXDLLEXPORT wxPoint

View File

@@ -43,12 +43,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS,
const wxString& name = wxCalendarNameStr)
{
Init();
(void)Create(parent, id, date, pos, size, style, name);
}
const wxString& name = wxCalendarNameStr);
bool Create(wxWindow *parent,
wxWindowID id,

View File

@@ -102,9 +102,9 @@ public:
int defaultFilter = 0,
const wxString& name = wxTreeCtrlNameStr );
void Init();
virtual void Init();
~wxGenericDirCtrl();
virtual ~wxGenericDirCtrl();
void OnExpandItem(wxTreeEvent &event );
void OnCollapseItem(wxTreeEvent &event );
@@ -113,52 +113,52 @@ public:
void OnSize(wxSizeEvent &event );
// Try to expand as much of the given path as possible.
bool ExpandPath(const wxString& path);
virtual bool ExpandPath(const wxString& path);
// Accessors
inline wxString GetDefaultPath() const { return m_defaultPath; }
void SetDefaultPath(const wxString& path) { m_defaultPath = path; }
virtual inline wxString GetDefaultPath() const { return m_defaultPath; }
virtual void SetDefaultPath(const wxString& path) { m_defaultPath = path; }
// Get dir or filename
wxString GetPath() const;
virtual wxString GetPath() const;
// Get selected filename path only (else empty string).
// I.e. don't count a directory as a selection
wxString GetFilePath() const;
void SetPath(const wxString& path);
virtual wxString GetFilePath() const;
virtual void SetPath(const wxString& path);
void ShowHidden( bool show );
bool GetShowHidden() { return m_showHidden; }
virtual void ShowHidden( bool show );
virtual bool GetShowHidden() { return m_showHidden; }
wxString GetFilter() const { return m_filter; }
void SetFilter(const wxString& filter);
virtual wxString GetFilter() const { return m_filter; }
virtual void SetFilter(const wxString& filter);
int GetFilterIndex() const { return m_currentFilter; }
void SetFilterIndex(int n);
virtual int GetFilterIndex() const { return m_currentFilter; }
virtual void SetFilterIndex(int n);
wxTreeItemId GetRootId() { return m_rootId; }
virtual wxTreeItemId GetRootId() { return m_rootId; }
wxTreeCtrl* GetTreeCtrl() const { return m_treeCtrl; }
wxDirFilterListCtrl* GetFilterListCtrl() const { return m_filterListCtrl; }
virtual wxTreeCtrl* GetTreeCtrl() const { return m_treeCtrl; }
virtual wxDirFilterListCtrl* GetFilterListCtrl() const { return m_filterListCtrl; }
// Helper
void SetupSections();
virtual void SetupSections();
// Parse the filter into an array of filters and an array of descriptions
int ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions);
virtual int ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions);
// Find the child that matches the first part of 'path'.
// E.g. if a child path is "/usr" and 'path' is "/usr/include"
// then the child for /usr is returned.
// If the path string has been used (we're at the leaf), done is set to TRUE
wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& done);
virtual wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& done);
// Resize the components of the control
void DoResize();
virtual void DoResize();
// Collapse & expand the tree, thus re-creating it from scratch:
void ReCreateTree();
virtual void ReCreateTree();
protected:
void ExpandDir(wxTreeItemId parentId);

View File

@@ -1,4 +1,4 @@
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Name: wx/generic/dragimgg.h
// Purpose: wxDragImage class: a kind of a cursor, that can cope
// with more sophisticated images
@@ -22,6 +22,7 @@
#include "wx/cursor.h"
#include "wx/treectrl.h"
#include "wx/listctrl.h"
#include "wx/log.h"
/*
To use this class, create a wxDragImage when you start dragging, for example:

View File

@@ -89,13 +89,16 @@ public:
void OnHome( wxCommandEvent &event );
void OnListOk( wxCommandEvent &event );
void OnNew( wxCommandEvent &event );
void OnChoice( wxCommandEvent &event );
void OnChoiceFilter( wxCommandEvent &event );
void OnTextEnter( wxCommandEvent &event );
void OnCheck( wxCommandEvent &event );
void HandleAction( const wxString &fn );
protected:
// use the filter with the given index
void DoSetFilterIndex(int filterindex);
wxString m_message;
long m_dialogStyle;
wxString m_dir;

View File

@@ -1824,7 +1824,7 @@ protected:
bool GetModelValues();
bool SetModelValues();
friend class wxGridSelection;
friend class WXDLLEXPORT wxGridSelection;
DECLARE_DYNAMIC_CLASS( wxGrid )
DECLARE_EVENT_TABLE()

View File

@@ -82,7 +82,7 @@ private:
wxGrid *m_grid;
wxGrid::wxGridSelectionModes m_selectionMode;
friend class wxGrid;
friend class WXDLLEXPORT wxGrid;
};
#endif // #ifdef __WXGRIDSEL_H__

View File

@@ -86,7 +86,7 @@ DECLARE_ABSTRACT_CLASS(wxHTMLHelpControllerBase)
@file Name of help directory.
@return true on success
*/
virtual bool LoadFile(const wxString& file = "");
virtual bool LoadFile(const wxString& file = wxT(""));
/** Display list of all help entries.
@return true on success

View File

@@ -61,9 +61,7 @@ enum wxLayoutAlignment
class WXDLLEXPORT wxQueryLayoutInfoEvent: public wxEvent
{
DECLARE_DYNAMIC_CLASS(wxQueryLayoutInfoEvent)
public:
wxQueryLayoutInfoEvent(wxWindowID id = 0)
{
SetEventType(wxEVT_QUERY_LAYOUT_INFO);
@@ -99,7 +97,9 @@ protected:
wxSize m_size;
wxLayoutOrientation m_orientation;
wxLayoutAlignment m_alignment;
private:
DECLARE_DYNAMIC_CLASS(wxQueryLayoutInfoEvent)
};
typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEvent&);
@@ -113,7 +113,6 @@ typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEv
class WXDLLEXPORT wxCalculateLayoutEvent: public wxEvent
{
DECLARE_DYNAMIC_CLASS(wxCalculateLayoutEvent)
public:
wxCalculateLayoutEvent(wxWindowID id = 0)
{
@@ -135,6 +134,9 @@ public:
protected:
int m_flags;
wxRect m_rect;
private:
DECLARE_DYNAMIC_CLASS(wxCalculateLayoutEvent)
};
typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEvent&);
@@ -149,7 +151,6 @@ typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEv
// an IDE-style interface.
class WXDLLEXPORT wxSashLayoutWindow: public wxSashWindow
{
DECLARE_CLASS(wxSashLayoutWindow)
public:
wxSashLayoutWindow()
{
@@ -157,13 +158,13 @@ public:
}
wxSashLayoutWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = "layoutWindow")
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow"))
{
Create(parent, id, pos, size, style, name);
}
bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = "layoutWindow");
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow"));
// Accessors
inline wxLayoutAlignment GetAlignment() const { return m_alignment; };
@@ -190,7 +191,9 @@ private:
wxLayoutOrientation m_orientation;
wxSize m_defaultSize;
DECLARE_EVENT_TABLE()
private:
DECLARE_CLASS(wxSashLayoutWindow)
DECLARE_EVENT_TABLE()
};
#endif // wxUSE_SASH

View File

@@ -72,7 +72,7 @@ public:
const wxSize &size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString &name = "listctrl" )
const wxString &name = wxT("listctrl") )
{
Create(parent, id, pos, size, style, validator, name);
}
@@ -84,7 +84,7 @@ public:
const wxSize &size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString &name = "listctrl" );
const wxString &name = wxT("listctrl") );
bool GetColumn( int col, wxListItem& item ) const;
bool SetColumn( int col, wxListItem& item );
@@ -246,7 +246,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator &validator = wxDefaultValidator,
const wxString &name = "listctrl" )
const wxString &name = wxT("listctrl") )
: wxGenericListCtrl(parent, id, pos, size, style, validator, name)
{
}

View File

@@ -265,6 +265,8 @@ private:
#if wxUSE_GENERIC_MDI_AS_NATIVE
class wxMDIChildFrame ;
//-----------------------------------------------------------------------------
// wxMDIParentFrame
//-----------------------------------------------------------------------------
@@ -284,6 +286,9 @@ public:
{
}
wxMDIChildFrame * GetActiveChild() const ;
private:
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
};

View File

@@ -82,8 +82,8 @@ public:
virtual void InitDialog();
#ifdef __WXUNIVERSAL__
virtual bool IsCanvasWindow() { return TRUE; }
virtual bool ProvidesBackground() { return TRUE; }
virtual bool IsCanvasWindow() const { return TRUE; }
virtual bool ProvidesBackground() const { return TRUE; }
#endif
WX_DECLARE_CONTROL_CONTAINER();

View File

@@ -69,13 +69,7 @@ public:
class WXDLLEXPORT wxSashWindow: public wxWindow
{
DECLARE_DYNAMIC_CLASS(wxSashWindow)
public:
////////////////////////////////////////////////////////////////////////////
// Public API
// Default constructor
wxSashWindow()
{
@@ -84,7 +78,7 @@ public:
// Normal constructor
wxSashWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = "sashWindow")
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow"))
{
Init();
Create(parent, id, pos, size, style, name);
@@ -93,7 +87,7 @@ public:
~wxSashWindow();
bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = "sashWindow");
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow"));
// Set whether there's a sash in this position
void SetSashVisible(wxSashEdgePosition edge, bool sash);
@@ -144,6 +138,11 @@ public:
// Adjusts the panes
void OnSize(wxSizeEvent& event);
#ifdef __WXMSW__
// Handle cursor correctly
void OnSetCursor(wxSetCursorEvent& event);
#endif // wxMSW
// Draws borders
void DrawBorders(wxDC& dc);
@@ -189,8 +188,11 @@ private:
wxColour m_hilightColour;
wxColour m_faceColour;
bool m_mouseCaptured;
wxCursor* m_currentCursor;
DECLARE_EVENT_TABLE()
private:
DECLARE_DYNAMIC_CLASS(wxSashWindow)
DECLARE_EVENT_TABLE()
};
BEGIN_DECLARE_EVENT_TYPES()
@@ -207,9 +209,7 @@ enum wxSashDragStatus
class WXDLLEXPORT wxSashEvent: public wxCommandEvent
{
DECLARE_DYNAMIC_CLASS(wxSashEvent)
public:
public:
inline wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE) {
m_eventType = (wxEventType) wxEVT_SASH_DRAGGED; m_id = id; m_edge = edge; }
@@ -224,10 +224,14 @@ class WXDLLEXPORT wxSashEvent: public wxCommandEvent
//// dragging the top below the bottom)
inline void SetDragStatus(wxSashDragStatus status) { m_dragStatus = status; }
inline wxSashDragStatus GetDragStatus() const { return m_dragStatus; }
private:
private:
wxSashEdgePosition m_edge;
wxRect m_dragRect;
wxSashDragStatus m_dragStatus;
private:
DECLARE_DYNAMIC_CLASS(wxSashEvent)
};
typedef void (wxEvtHandler::*wxSashEventFunction)(wxSashEvent&);

View File

@@ -69,6 +69,8 @@ public:
// lay out the window and its children
virtual bool Layout();
virtual void DoSetVirtualSize(int x, int y);
protected:
// this is needed for wxEVT_PAINT processing hack described in
// wxScrollHelperEvtHandler::ProcessEvent()

View File

@@ -71,7 +71,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_3D,
const wxString& name = "splitter")
const wxString& name = wxT("splitter"))
{
Init();
Create(parent, id, pos, size, style, name);
@@ -83,7 +83,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_3D,
const wxString& name = "splitter");
const wxString& name = wxT("splitter"));
// Gets the only or left/top pane
wxWindow *GetWindow1() const { return m_windowOne; }

View File

@@ -92,7 +92,9 @@ public:
void SetBorderY(int y);
void OnPaint(wxPaintEvent& event);
void OnSize(wxSizeEvent& event);
void OnLeftDown(wxMouseEvent& event);
void OnRightDown(wxMouseEvent& event);
virtual void InitColours();
@@ -105,6 +107,8 @@ protected:
wxArrayString m_statusStrings;
// the last known width of the client rect (used to rebuild cache)
int m_lastClientWidth;
// the widths of the status bar panes in pixels
wxArrayInt m_widthsAbs;

View File

@@ -117,6 +117,15 @@ public:
// get the data associated with the item
wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
// get the item's text colour
wxColour GetItemTextColour(const wxTreeItemId& item) const;
// get the item's background colour
wxColour GetItemBackgroundColour(const wxTreeItemId& item) const;
// get the item's font
wxFont GetItemFont(const wxTreeItemId& item) const;
// modifiers
// ---------

View File

@@ -29,8 +29,6 @@ class wxMouseEvent;
class WXDLLEXPORT wxTreeLayout: public wxObject
{
DECLARE_ABSTRACT_CLASS(wxTreeLayout)
public:
wxTreeLayout();
virtual ~wxTreeLayout() { }
@@ -49,7 +47,7 @@ public:
// Optional redefinition
void Initialize(void);
inline virtual void SetNodeName(long WXUNUSED(id), const wxString& WXUNUSED(name)) {}
inline virtual wxString GetNodeName(long WXUNUSED(id)) { return wxString(""); }
inline virtual wxString GetNodeName(long WXUNUSED(id)) { return wxString(wxT("")); }
virtual void GetNodeSize(long id, long *x, long *y, wxDC& dc);
virtual void Draw(wxDC& dc);
virtual void DrawNodes(wxDC& dc);
@@ -76,8 +74,6 @@ public:
private:
void CalcLayout(long node_id, int level, wxDC& dc);
// Members
protected:
long m_parentNode;
long m_lastY;
@@ -87,6 +83,9 @@ protected:
long m_topMargin;
long m_leftMargin;
bool m_orientation; // TRUE for top-to-bottom, FALSE for left-to-right
private:
DECLARE_ABSTRACT_CLASS(wxTreeLayout)
};
class WXDLLEXPORT wxStoredNode
@@ -105,7 +104,6 @@ public:
class WXDLLEXPORT wxTreeLayoutStored: public wxTreeLayout
{
DECLARE_DYNAMIC_CLASS(wxTreeLayoutStored)
public:
wxTreeLayoutStored(int noNodes = 200);
virtual ~wxTreeLayoutStored(void);
@@ -130,7 +128,7 @@ public:
virtual void SetClientData(long id, long clientData);
virtual long GetClientData(long id) const;
virtual long AddChild(const wxString& name, const wxString& parent = "");
virtual long AddChild(const wxString& name, const wxString& parent = wxT(""));
virtual long AddChild(const wxString& name, long parent);
virtual long NameToId(const wxString& name);
@@ -139,6 +137,9 @@ private:
wxStoredNode* m_nodes;
int m_num;
int m_maxNodes;
private:
DECLARE_DYNAMIC_CLASS(wxTreeLayoutStored)
};
// For backward compatibility

View File

@@ -59,11 +59,11 @@ public :
inline wxPoint2DInt( const wxPoint &pt );
// noops for this class, just return the coords
inline void GetFloor( wxInt32 *x , wxInt32 *y );
inline void GetRounded( wxInt32 *x , wxInt32 *y );
inline void GetFloor( wxInt32 *x , wxInt32 *y ) const;
inline void GetRounded( wxInt32 *x , wxInt32 *y ) const;
inline wxDouble GetVectorLength();
wxDouble GetVectorAngle();
inline wxDouble GetVectorLength() const;
wxDouble GetVectorAngle() const;
inline void SetVectorLength( wxDouble length );
void SetVectorAngle( wxDouble degrees );
void SetPolarCoordinates( wxInt32 angle , wxInt32 length );
@@ -133,7 +133,7 @@ inline wxPoint2DInt::wxPoint2DInt( const wxPoint &pt )
m_y = pt.y;
}
inline void wxPoint2DInt::GetFloor( wxInt32 *x , wxInt32 *y )
inline void wxPoint2DInt::GetFloor( wxInt32 *x , wxInt32 *y ) const
{
if ( x )
*x = m_x;
@@ -141,12 +141,12 @@ inline void wxPoint2DInt::GetFloor( wxInt32 *x , wxInt32 *y )
*y = m_y;
}
inline void wxPoint2DInt::GetRounded( wxInt32 *x , wxInt32 *y )
inline void wxPoint2DInt::GetRounded( wxInt32 *x , wxInt32 *y ) const
{
GetFloor(x, y);
}
inline wxDouble wxPoint2DInt::GetVectorLength()
inline wxDouble wxPoint2DInt::GetVectorLength() const
{
// cast needed MIPSpro compiler under SGI
return sqrt( (double)(m_x)*(m_x) + (m_y)*(m_y) );
@@ -304,8 +304,8 @@ public :
{ m_x = (wxDouble) pt.x ; m_y = (wxDouble) pt.y ; }
// two different conversions to integers, floor and rounding
inline void GetFloor( wxInt32 *x , wxInt32 *y );
inline void GetRounded( wxInt32 *x , wxInt32 *y );
inline void GetFloor( wxInt32 *x , wxInt32 *y ) const;
inline void GetRounded( wxInt32 *x , wxInt32 *y ) const;
inline wxDouble GetVectorLength() const;
wxDouble GetVectorAngle() const ;
@@ -315,10 +315,10 @@ public :
// set the vector length to 1.0, preserving the angle
void Normalize();
inline wxDouble GetDistance( const wxPoint2DDouble &pt );
inline wxDouble GetDistanceSquare( const wxPoint2DDouble &pt );
inline wxDouble GetDotProduct( const wxPoint2DDouble &vec );
inline wxDouble GetCrossProduct( const wxPoint2DDouble &vec );
inline wxDouble GetDistance( const wxPoint2DDouble &pt ) const;
inline wxDouble GetDistanceSquare( const wxPoint2DDouble &pt ) const;
inline wxDouble GetDotProduct( const wxPoint2DDouble &vec ) const;
inline wxDouble GetCrossProduct( const wxPoint2DDouble &vec ) const;
// the reflection of this point
inline wxPoint2DDouble operator-();
@@ -369,13 +369,13 @@ inline wxPoint2DDouble::wxPoint2DDouble( const wxPoint2DDouble &pt )
m_y = pt.m_y;
}
inline void wxPoint2DDouble::GetFloor( wxInt32 *x , wxInt32 *y )
inline void wxPoint2DDouble::GetFloor( wxInt32 *x , wxInt32 *y ) const
{
*x = (wxInt32) floor( m_x );
*y = (wxInt32) floor( m_y );
}
inline void wxPoint2DDouble::GetRounded( wxInt32 *x , wxInt32 *y )
inline void wxPoint2DDouble::GetRounded( wxInt32 *x , wxInt32 *y ) const
{
*x = (wxInt32) floor( m_x + 0.5 );
*y = (wxInt32) floor( m_y + 0.5);
@@ -393,22 +393,22 @@ inline void wxPoint2DDouble::SetVectorLength( wxDouble length )
m_y = (m_y * length / before) ;
}
inline wxDouble wxPoint2DDouble::GetDistance( const wxPoint2DDouble &pt )
inline wxDouble wxPoint2DDouble::GetDistance( const wxPoint2DDouble &pt ) const
{
return sqrt( GetDistanceSquare( pt ) );
}
inline wxDouble wxPoint2DDouble::GetDistanceSquare( const wxPoint2DDouble &pt )
inline wxDouble wxPoint2DDouble::GetDistanceSquare( const wxPoint2DDouble &pt ) const
{
return ( (pt.m_x-m_x)*(pt.m_x-m_x) + (pt.m_y-m_y)*(pt.m_y-m_y) );
}
inline wxDouble wxPoint2DDouble::GetDotProduct( const wxPoint2DDouble &vec )
inline wxDouble wxPoint2DDouble::GetDotProduct( const wxPoint2DDouble &vec ) const
{
return ( m_x * vec.m_x + m_y * vec.m_y );
}
inline wxDouble wxPoint2DDouble::GetCrossProduct( const wxPoint2DDouble &vec )
inline wxDouble wxPoint2DDouble::GetCrossProduct( const wxPoint2DDouble &vec ) const
{
return ( m_x * vec.m_y - vec.m_x * m_y );
}

View File

@@ -5,6 +5,8 @@
#if wxUSE_GLCANVAS
#define wxGLCanvasName _T("GLCanvas")
#if defined(__WXMSW__)
#include "wx/msw/glcanvas.h"
#elif defined(__WXMOTIF__)

View File

@@ -65,6 +65,7 @@ public:
// --------------
void ApplyWidgetStyle();
bool IsOwnGtkWindow( GdkWindow *window );
protected:
virtual wxSize DoGetBestSize() const;

View File

@@ -47,7 +47,7 @@ public:
// Implicit conversion from the colour name
wxColour( const wxString &colourName ) { InitFromName(colourName); }
wxColour( const char *colourName ) { InitFromName(colourName); }
wxColour( const char *colourName ) { InitFromName( wxString::FromAscii(colourName) ); }
#if wxUSE_UNICODE
wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); }
#endif

View File

@@ -108,6 +108,8 @@ public:
// implementation
virtual void SetFocus();
void OnSize( wxSizeEvent &event );
void OnChar( wxKeyEvent &event );

View File

@@ -22,10 +22,8 @@ class wxDataObject : public wxDataObjectBase
{
public:
wxDataObject();
#ifdef __DARWIN__
virtual ~wxDataObject() { }
#endif
virtual ~wxDataObject();
virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
};

View File

@@ -118,6 +118,8 @@ public:
wxWindow *m_owner;
wxRegion m_currentClippingRegion;
wxRegion m_paintClippingRegion;
// PangoContext stuff for GTK 2.0
#ifdef __WXGTK20__
PangoContext *m_context;
PangoFontDescription *m_fontdesc;

View File

@@ -96,6 +96,9 @@ public:
virtual void SetEncoding(wxFontEncoding encoding);
virtual void SetNativeFontInfo( const wxNativeFontInfo& info );
virtual void SetNoAntiAliasing( bool no = TRUE );
virtual bool GetNoAntiAliasing();
// implementation from now on
void Unshare();

View File

@@ -84,6 +84,7 @@ public:
virtual void OnInternalIdle();
bool m_menuBarDetached;
int m_menuBarHeight;
bool m_toolBarDetached;
protected:
@@ -95,8 +96,14 @@ protected:
virtual void DoGetClientSize( int *width, int *height ) const;
#if wxUSE_MENUS_NATIVE
virtual void DetachMenuBar();
virtual void AttachMenuBar(wxMenuBar *menubar);
public:
// Menu size is dynamic now, call this whenever it might change.
void UpdateMenuBarSize();
#endif // wxUSE_MENUS_NATIVE
DECLARE_DYNAMIC_CLASS(wxFrame)

View File

@@ -42,25 +42,32 @@ extern const wxChar* wxGaugeNameStr;
class wxGauge: public wxControl
{
public:
inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; m_useProgressBar = TRUE; }
wxGauge() { Init(); }
inline wxGauge( wxWindow *parent, wxWindowID id, int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr )
wxGauge( wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr )
{
Create(parent, id, range, pos, size, style, validator, name);
Init();
Create(parent, id, range, pos, size, style, validator, name);
}
bool Create( wxWindow *parent, wxWindowID id, int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr );
void SetShadowWidth( int WXUNUSED(w) ) {};
void SetBezelFace( int WXUNUSED(w) ) {};
bool Create( wxWindow *parent,
wxWindowID id, int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr );
void SetShadowWidth( int WXUNUSED(w) ) { }
void SetBezelFace( int WXUNUSED(w) ) { }
void SetRange( int r );
void SetValue( int pos );
int GetShadowWidth() const { return 0; };
@@ -68,17 +75,27 @@ public:
int GetRange() const;
int GetValue() const;
// Are we a Win95/GTK progress bar, or a normal gauge?
inline bool GetProgressBar() const { return m_useProgressBar; }
// implementation
// -------------
void ApplyWidgetStyle();
int m_rangeMax;
int m_gaugePos;
bool m_useProgressBar;
// the max and current gauge values
int m_rangeMax,
m_gaugePos;
// obsolete functions, don't use
#ifdef WXWIN_COMPATIBILITY_2_2
bool GetProgressBar() const { return TRUE; }
#endif // WXWIN_COMPATIBILITY_2_2
protected:
// common part of all ctors
void Init() { m_rangeMax = m_gaugePos = 0; }
// set the gauge value to the value of m_gaugePos
void DoSetGauge();
private:
DECLARE_DYNAMIC_CLASS(wxGauge)
};

View File

@@ -6,7 +6,7 @@
// Created: 17/8/98
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(__APPLE__)
@@ -65,15 +65,15 @@ class WXDLLEXPORT wxGLContext: public wxObject
{
public:
wxGLContext( bool isRGB, wxWindow *win, const wxPalette& palette = wxNullPalette );
wxGLContext(
bool WXUNUSED(isRGB), wxWindow *win,
wxGLContext(
bool WXUNUSED(isRGB), wxWindow *win,
const wxPalette& WXUNUSED(palette),
const wxGLContext *other /* for sharing display lists */
);
~wxGLContext();
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxChar *colour);
void SwapBuffers();
void SetupPixelFormat();
@@ -91,7 +91,7 @@ public:
GtkWidget *m_widget;
wxPalette m_palette;
wxWindow* m_window;
private:
DECLARE_CLASS(wxGLContext)
};
@@ -110,51 +110,52 @@ public:
m_vi = (void*) NULL;
m_exposed = FALSE;
}
wxGLCanvas( wxWindow *parent, wxWindowID id = -1,
wxGLCanvas( wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = wxGLCanvasName,
int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette );
wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL,
wxWindowID id = -1,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = wxGLCanvasName,
int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette );
wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL,
wxWindowID id = -1,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = wxGLCanvasName,
int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette );
bool Create( wxWindow *parent,
const wxGLContext *shared = (wxGLContext*)NULL,
const wxGLCanvas *shared_context_of = (wxGLCanvas*)NULL,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette );
bool Create( wxWindow *parent,
const wxGLContext *shared = (wxGLContext*)NULL,
const wxGLCanvas *shared_context_of = (wxGLCanvas*)NULL,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette );
~wxGLCanvas();
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxChar *colour);
void SwapBuffers();
void OnSize(wxSizeEvent& event);
void OnInternalIdle();
inline wxGLContext* GetContext() const { return m_glContext; }
inline wxGLContext* GetContext() const { return m_glContext; }
// implementation
wxGLContext *m_glContext,
*m_sharedContext;
wxGLCanvas *m_sharedContextOf;
@@ -162,10 +163,10 @@ public:
bool m_canFreeVi;
GtkWidget *m_glWidget;
bool m_exposed;
// returns an XVisualInfo* based on desired GL attributes;
// returns NULL if an appropriate visual is not found. The
// caller is reponsible for using XFree() to deallocate
// caller is reponsible for using XFree() to deallocate
// the returned structure.
static void* ChooseGLVisual(int *attribList);

View File

@@ -122,12 +122,15 @@ public:
// selection internally instead of querying the notebook for it
int m_selection;
// flag set to TRUE while we're inside "switch_page" callback
bool m_inSwitchPage;
protected:
// remove one page from the notebook but do not destroy it
virtual wxNotebookPage *DoRemovePage(int nPage);
private:
// the padding set by SetPadding()
int m_padding;
DECLARE_DYNAMIC_CLASS(wxNotebook)

View File

@@ -146,11 +146,11 @@ public:
void Reset() { m_current = 0u; }
void Reset(const wxRegion& region);
operator bool () const;
bool HaveRects() const;
operator bool () const { return HaveRects(); }
void operator ++ ();
void operator ++ (int);
wxRegionIterator& operator ++ ();
wxRegionIterator operator ++ (int);
wxCoord GetX() const;
wxCoord GetY() const;

View File

@@ -12,7 +12,7 @@
#define __GTKSCROLLBARH__
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface
#pragma interface "scrolbar.h"
#endif
#include "wx/defs.h"

View File

@@ -157,6 +157,17 @@ public:
// and sets m_widgetStyle to this value.
GtkStyle *GetWidgetStyle();
#ifdef __WXGTK20__
// Returns the default context which usually is anti-aliased
PangoContext *GtkGetPangoDefaultContext();
// Returns the X11 context which renders on the X11 client
// side (which can be remote) and which usually is not
// anti-aliased and is thus faster
PangoContext *GtkGetPangoX11Context();
PangoContext *m_x11Context;
#endif
// Called by SetFont() and SetXXXColour etc
void SetWidgetStyle();
@@ -195,11 +206,15 @@ public:
// this widget will be queried for GTK's focus events
GtkWidget *m_focusWidget;
#ifdef __WXGTK20__
GtkIMMulticontext *m_imContext;
#else
#if HAVE_XIM
// XIM support for wxWindows
GdkIC *m_ic;
GdkICAttr *m_icattr;
#endif
#endif
#ifndef __WXGTK20__
// The area to be cleared (and not just refreshed)

View File

@@ -65,6 +65,7 @@ public:
// --------------
void ApplyWidgetStyle();
bool IsOwnGtkWindow( GdkWindow *window );
protected:
virtual wxSize DoGetBestSize() const;

View File

@@ -47,7 +47,7 @@ public:
// Implicit conversion from the colour name
wxColour( const wxString &colourName ) { InitFromName(colourName); }
wxColour( const char *colourName ) { InitFromName(colourName); }
wxColour( const char *colourName ) { InitFromName( wxString::FromAscii(colourName) ); }
#if wxUSE_UNICODE
wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); }
#endif

View File

@@ -108,6 +108,8 @@ public:
// implementation
virtual void SetFocus();
void OnSize( wxSizeEvent &event );
void OnChar( wxKeyEvent &event );

View File

@@ -22,10 +22,8 @@ class wxDataObject : public wxDataObjectBase
{
public:
wxDataObject();
#ifdef __DARWIN__
virtual ~wxDataObject() { }
#endif
virtual ~wxDataObject();
virtual bool IsSupportedFormat( const wxDataFormat& format, Direction dir = Get ) const;
};

View File

@@ -118,6 +118,8 @@ public:
wxWindow *m_owner;
wxRegion m_currentClippingRegion;
wxRegion m_paintClippingRegion;
// PangoContext stuff for GTK 2.0
#ifdef __WXGTK20__
PangoContext *m_context;
PangoFontDescription *m_fontdesc;

View File

@@ -96,6 +96,9 @@ public:
virtual void SetEncoding(wxFontEncoding encoding);
virtual void SetNativeFontInfo( const wxNativeFontInfo& info );
virtual void SetNoAntiAliasing( bool no = TRUE );
virtual bool GetNoAntiAliasing();
// implementation from now on
void Unshare();

View File

@@ -84,6 +84,7 @@ public:
virtual void OnInternalIdle();
bool m_menuBarDetached;
int m_menuBarHeight;
bool m_toolBarDetached;
protected:
@@ -95,8 +96,14 @@ protected:
virtual void DoGetClientSize( int *width, int *height ) const;
#if wxUSE_MENUS_NATIVE
virtual void DetachMenuBar();
virtual void AttachMenuBar(wxMenuBar *menubar);
public:
// Menu size is dynamic now, call this whenever it might change.
void UpdateMenuBarSize();
#endif // wxUSE_MENUS_NATIVE
DECLARE_DYNAMIC_CLASS(wxFrame)

View File

@@ -42,25 +42,32 @@ extern const wxChar* wxGaugeNameStr;
class wxGauge: public wxControl
{
public:
inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; m_useProgressBar = TRUE; }
wxGauge() { Init(); }
inline wxGauge( wxWindow *parent, wxWindowID id, int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr )
wxGauge( wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr )
{
Create(parent, id, range, pos, size, style, validator, name);
Init();
Create(parent, id, range, pos, size, style, validator, name);
}
bool Create( wxWindow *parent, wxWindowID id, int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr );
void SetShadowWidth( int WXUNUSED(w) ) {};
void SetBezelFace( int WXUNUSED(w) ) {};
bool Create( wxWindow *parent,
wxWindowID id, int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr );
void SetShadowWidth( int WXUNUSED(w) ) { }
void SetBezelFace( int WXUNUSED(w) ) { }
void SetRange( int r );
void SetValue( int pos );
int GetShadowWidth() const { return 0; };
@@ -68,17 +75,27 @@ public:
int GetRange() const;
int GetValue() const;
// Are we a Win95/GTK progress bar, or a normal gauge?
inline bool GetProgressBar() const { return m_useProgressBar; }
// implementation
// -------------
void ApplyWidgetStyle();
int m_rangeMax;
int m_gaugePos;
bool m_useProgressBar;
// the max and current gauge values
int m_rangeMax,
m_gaugePos;
// obsolete functions, don't use
#ifdef WXWIN_COMPATIBILITY_2_2
bool GetProgressBar() const { return TRUE; }
#endif // WXWIN_COMPATIBILITY_2_2
protected:
// common part of all ctors
void Init() { m_rangeMax = m_gaugePos = 0; }
// set the gauge value to the value of m_gaugePos
void DoSetGauge();
private:
DECLARE_DYNAMIC_CLASS(wxGauge)
};

View File

@@ -6,7 +6,7 @@
// Created: 17/8/98
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(__APPLE__)
@@ -65,15 +65,15 @@ class WXDLLEXPORT wxGLContext: public wxObject
{
public:
wxGLContext( bool isRGB, wxWindow *win, const wxPalette& palette = wxNullPalette );
wxGLContext(
bool WXUNUSED(isRGB), wxWindow *win,
wxGLContext(
bool WXUNUSED(isRGB), wxWindow *win,
const wxPalette& WXUNUSED(palette),
const wxGLContext *other /* for sharing display lists */
);
~wxGLContext();
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxChar *colour);
void SwapBuffers();
void SetupPixelFormat();
@@ -91,7 +91,7 @@ public:
GtkWidget *m_widget;
wxPalette m_palette;
wxWindow* m_window;
private:
DECLARE_CLASS(wxGLContext)
};
@@ -110,51 +110,52 @@ public:
m_vi = (void*) NULL;
m_exposed = FALSE;
}
wxGLCanvas( wxWindow *parent, wxWindowID id = -1,
wxGLCanvas( wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = wxGLCanvasName,
int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette );
wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL,
wxWindowID id = -1,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = wxGLCanvasName,
int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette );
wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL,
wxWindowID id = -1,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = wxGLCanvasName,
int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette );
bool Create( wxWindow *parent,
const wxGLContext *shared = (wxGLContext*)NULL,
const wxGLCanvas *shared_context_of = (wxGLCanvas*)NULL,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette );
bool Create( wxWindow *parent,
const wxGLContext *shared = (wxGLContext*)NULL,
const wxGLCanvas *shared_context_of = (wxGLCanvas*)NULL,
wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette );
~wxGLCanvas();
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxChar *colour);
void SwapBuffers();
void OnSize(wxSizeEvent& event);
void OnInternalIdle();
inline wxGLContext* GetContext() const { return m_glContext; }
inline wxGLContext* GetContext() const { return m_glContext; }
// implementation
wxGLContext *m_glContext,
*m_sharedContext;
wxGLCanvas *m_sharedContextOf;
@@ -162,10 +163,10 @@ public:
bool m_canFreeVi;
GtkWidget *m_glWidget;
bool m_exposed;
// returns an XVisualInfo* based on desired GL attributes;
// returns NULL if an appropriate visual is not found. The
// caller is reponsible for using XFree() to deallocate
// caller is reponsible for using XFree() to deallocate
// the returned structure.
static void* ChooseGLVisual(int *attribList);

View File

@@ -122,12 +122,15 @@ public:
// selection internally instead of querying the notebook for it
int m_selection;
// flag set to TRUE while we're inside "switch_page" callback
bool m_inSwitchPage;
protected:
// remove one page from the notebook but do not destroy it
virtual wxNotebookPage *DoRemovePage(int nPage);
private:
// the padding set by SetPadding()
int m_padding;
DECLARE_DYNAMIC_CLASS(wxNotebook)

View File

@@ -146,11 +146,11 @@ public:
void Reset() { m_current = 0u; }
void Reset(const wxRegion& region);
operator bool () const;
bool HaveRects() const;
operator bool () const { return HaveRects(); }
void operator ++ ();
void operator ++ (int);
wxRegionIterator& operator ++ ();
wxRegionIterator operator ++ (int);
wxCoord GetX() const;
wxCoord GetY() const;

View File

@@ -12,7 +12,7 @@
#define __GTKSCROLLBARH__
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface
#pragma interface "scrolbar.h"
#endif
#include "wx/defs.h"

View File

@@ -157,6 +157,17 @@ public:
// and sets m_widgetStyle to this value.
GtkStyle *GetWidgetStyle();
#ifdef __WXGTK20__
// Returns the default context which usually is anti-aliased
PangoContext *GtkGetPangoDefaultContext();
// Returns the X11 context which renders on the X11 client
// side (which can be remote) and which usually is not
// anti-aliased and is thus faster
PangoContext *GtkGetPangoX11Context();
PangoContext *m_x11Context;
#endif
// Called by SetFont() and SetXXXColour etc
void SetWidgetStyle();
@@ -195,11 +206,15 @@ public:
// this widget will be queried for GTK's focus events
GtkWidget *m_focusWidget;
#ifdef __WXGTK20__
GtkIMMulticontext *m_imContext;
#else
#if HAVE_XIM
// XIM support for wxWindows
GdkIC *m_ic;
GdkICAttr *m_icattr;
#endif
#endif
#ifndef __WXGTK20__
// The area to be cleared (and not just refreshed)

View File

@@ -62,9 +62,9 @@ protected:
_wxHashTable_NodeBase** dstTable,
BucketFromNode func, ProcessNode proc );
static void** AllocTable( size_t size )
static void** AllocTable( size_t sz )
{
return (void **)calloc(size, sizeof(void*));
return (void **)calloc(sz, sizeof(void*));
}
};
@@ -172,10 +172,10 @@ public: \
const_pointer operator ->() const { return &(m_node->m_value); } \
}; \
\
CLASSNAME( size_type size = 10, const hasher& hfun = hasher(), \
CLASSNAME( size_type sz = 10, const hasher& hfun = hasher(), \
const key_equal& k_eq = key_equal(), \
const key_extractor& k_ex = key_extractor() ) \
: m_tableBuckets( GetNextPrime( size ) ), \
: m_tableBuckets( GetNextPrime( sz ) ), \
m_items( 0 ), \
m_hasher( hfun ), \
m_equals( k_eq ), \
@@ -218,7 +218,12 @@ public: \
\
/* removes all elements from the hash table, but does not */ \
/* shrink it ( perhaps it should ) */ \
void clear() { DeleteNodes( m_tableBuckets, (_wxHashTable_NodeBase**)m_table, DeleteNode ); } \
void clear() \
{ \
DeleteNodes( m_tableBuckets, (_wxHashTable_NodeBase**)m_table, \
DeleteNode ); \
m_items = 0; \
} \
\
size_type size() const { return m_items; } \
size_type max_size() const { return size_type(-1); } \

View File

@@ -31,11 +31,9 @@
// Defines the API for help controllers
class WXDLLEXPORT wxHelpControllerBase: public wxObject
{
DECLARE_CLASS(wxHelpControllerBase)
public:
inline wxHelpControllerBase() {}
inline ~wxHelpControllerBase() {};
inline ~wxHelpControllerBase() {}
// Must call this to set the filename and server name.
// server is only required when implementing TCP/IP-based
@@ -47,7 +45,7 @@ public:
virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
// If file is "", reloads file given in Initialize
virtual bool LoadFile(const wxString& file = "") = 0;
virtual bool LoadFile(const wxString& file = wxT("")) = 0;
// Displays the contents
virtual bool DisplayContents(void) = 0;
@@ -59,11 +57,11 @@ public:
virtual bool DisplayContextPopup(int WXUNUSED(contextId)) { return FALSE; };
// Display the text in a popup, if possible
virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return FALSE; };
virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return FALSE; }
// By default, uses KeywordSection to display a topic. Implementations
// may override this for more specific behaviour.
virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); };
virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); }
virtual bool DisplayBlock(long blockNo) = 0;
virtual bool KeywordSearch(const wxString& k) = 0;
/// Allows one to override the default settings for the help frame.
@@ -80,11 +78,14 @@ public:
wxPoint *WXUNUSED(pos) = NULL,
bool *WXUNUSED(newFrameEachTime) = NULL)
{
return (wxFrame*) NULL;// does nothing by default
return (wxFrame*) NULL; // does nothing by default
}
virtual bool Quit(void) = 0;
virtual void OnQuit(void) {};
virtual bool Quit() = 0;
virtual void OnQuit() {}
private:
DECLARE_CLASS(wxHelpControllerBase)
};
#endif // wxUSE_HELP

View File

@@ -67,7 +67,6 @@ See mod_*.cpp and htmlwin.cpp for example :-)
FORCE_LINK(m_hline) \
FORCE_LINK(m_links) \
FORCE_LINK(m_tables) \
FORCE_LINK(m_meta) \
FORCE_LINK(m_style)

View File

@@ -57,7 +57,7 @@ public:
virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize(file); }
virtual bool Initialize(const wxString& file);
virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
virtual bool LoadFile(const wxString& file = "");
virtual bool LoadFile(const wxString& file = wxT(""));
virtual bool DisplaySection(int sectionNo);
virtual bool DisplaySection(const wxString& section) { return Display(section); }
virtual bool DisplayBlock(long blockNo) { return DisplaySection(blockNo); }

View File

@@ -93,23 +93,23 @@ struct wxHtmlContentsItem
};
//------------------------------------------------------------------------------
// wxSearchEngine
// wxHtmlSearchEngine
// This class takes input streams and scans them for occurence
// of keyword(s)
//------------------------------------------------------------------------------
class WXDLLEXPORT wxSearchEngine : public wxObject
class WXDLLEXPORT wxHtmlSearchEngine : public wxObject
{
public:
wxSearchEngine() : wxObject() {m_Keyword = NULL; }
~wxSearchEngine() {if (m_Keyword) delete[] m_Keyword; }
wxHtmlSearchEngine() : wxObject() {m_Keyword = NULL; }
~wxHtmlSearchEngine() {if (m_Keyword) delete[] m_Keyword; }
// Sets the keyword we will be searching for
virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only);
// Scans the stream for the keyword.
// Returns TRUE if the stream contains keyword, fALSE otherwise
virtual bool Scan(wxInputStream *stream);
virtual bool Scan(const wxFSFile& file);
private:
wxChar *m_Keyword;
@@ -139,7 +139,7 @@ public:
private:
wxHtmlHelpData* m_Data;
wxSearchEngine m_Engine;
wxHtmlSearchEngine m_Engine;
wxString m_Keyword, m_Name;
wxChar *m_LastPage;
wxHtmlContentsItem* m_ContentsItem;

View File

@@ -33,7 +33,9 @@
#include "wx/stattext.h"
#include "wx/html/htmlwin.h"
#include "wx/html/htmprint.h"
class WXDLLEXPORT wxButton;
class WXDLLEXPORT wxTextCtrl;
// style flags for the Help Frame

View File

@@ -219,6 +219,9 @@ public:
void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align; m_LastLayout = -1;}
void SetBackgroundColour(const wxColour& clr) {m_UseBkColour = TRUE; m_BkColour = clr;}
// returns background colour (of wxNullColour if none set), so that widgets can
// adapt to it:
wxColour GetBackgroundColour();
void SetBorder(const wxColour& clr1, const wxColour& clr2) {m_UseBorder = TRUE; m_BorderColour1 = clr1, m_BorderColour2 = clr2;}
virtual wxHtmlLinkInfo* GetLink(int x = 0, int y = 0) const;
virtual const wxHtmlCell* Find(int condition, const void* param) const;

View File

@@ -65,6 +65,20 @@ public:
virtual wxString ReadFile(const wxFSFile& file) const;
};
//--------------------------------------------------------------------------------
// wxHtmlFilterHTML
// filter for text/html
//--------------------------------------------------------------------------------
class wxHtmlFilterHTML : public wxHtmlFilter
{
DECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML)
public:
virtual bool CanRead(const wxFSFile& file) const;
virtual wxString ReadFile(const wxFSFile& file) const;
};
#endif // wxUSE_HTML

View File

@@ -72,6 +72,9 @@ public:
virtual void InitParser(const wxString& source);
// This must be called after Parse().
virtual void DoneParser();
// May be called during parsing to immediately return from Parse().
virtual void StopParsing() { m_stopParsing = TRUE; }
// Parses the m_Source from begin_pos to end_pos-1.
// (in noparams version it parses whole m_Source)
@@ -117,6 +120,11 @@ public:
// Restores parser's state from stack or returns FALSE if the stack is
// empty
virtual bool RestoreState();
// Parses HTML string 'markup' and extracts charset info from <meta> tag
// if present. Returns empty string if the tag is missing.
// For wxHTML's internal use.
static wxString ExtractCharsetInformation(const wxString& markup);
protected:
// DOM structure
@@ -173,6 +181,9 @@ protected:
// entity parse
wxHtmlEntitiesParser *m_entitiesParser;
// flag indicating that the parser should stop
bool m_stopParsing;
};
@@ -242,7 +253,11 @@ public:
wxChar GetEntityChar(const wxString& entity);
// Returns character that represents given Unicode code
#if wxUSE_UNICODE
wxChar GetCharForCode(unsigned code) { return (wxChar)code; }
#else
wxChar GetCharForCode(unsigned code);
#endif
protected:
#if wxUSE_WCHAR_T && !wxUSE_UNICODE

View File

@@ -98,7 +98,7 @@ enum {
class WXDLLEXPORT wxHtmlPrintout : public wxPrintout
{
public:
wxHtmlPrintout(const wxString& title = "Printout");
wxHtmlPrintout(const wxString& title = wxT("Printout"));
~wxHtmlPrintout();
void SetHtmlText(const wxString& html, const wxString &basepath = wxEmptyString, bool isdir = TRUE);
@@ -176,7 +176,7 @@ private:
class WXDLLEXPORT wxHtmlEasyPrinting : public wxObject
{
public:
wxHtmlEasyPrinting(const wxString& name = "Printing", wxFrame *parent_frame = NULL);
wxHtmlEasyPrinting(const wxString& name = wxT("Printing"), wxFrame *parent_frame = NULL);
~wxHtmlEasyPrinting();
bool PreviewFile(const wxString &htmlfile);

View File

@@ -32,7 +32,7 @@ I STRONGLY recommend reading and understanding these macros!!
class HTML_Handler_##name : public wxHtmlWinTagHandler \
{ \
public: \
wxString GetSupportedTags() {return tags;}
wxString GetSupportedTags() {return wxT(tags);}

View File

@@ -117,10 +117,12 @@ public:
const wxHtmlLinkInfo& GetLink() const { return m_Link; }
void SetLink(const wxHtmlLinkInfo& link);
#if !wxUSE_UNICODE
void SetInputEncoding(wxFontEncoding enc);
wxFontEncoding GetInputEncoding() const { return m_InputEnc; }
wxFontEncoding GetOutputEncoding() const { return m_OutputEnc; }
wxEncodingConverter *GetEncodingConverter() const { return m_EncConv; }
#endif
// creates font depending on m_Font* members.
virtual wxFont* CreateCurrentFont();
@@ -161,7 +163,9 @@ private:
wxFont* m_FontsTable[2][2][2][2][7];
wxString m_FontsFacesTable[2][2][2][2][7];
#if !wxUSE_UNICODE
wxFontEncoding m_FontsEncTable[2][2][2][2][7];
#endif
// table of loaded fonts. 1st four indexes are 0 or 1, depending on on/off
// state of these flags (from left to right):
// [bold][italic][underlined][fixed_size]
@@ -172,9 +176,11 @@ private:
wxString m_FontFaceFixed, m_FontFaceNormal;
// html font sizes and faces of fixed and proportional fonts
#if !wxUSE_UNICODE
wxFontEncoding m_InputEnc, m_OutputEnc;
// I/O font encodings
wxEncodingConverter *m_EncConv;
#endif
};

View File

@@ -44,7 +44,7 @@ class WXDLLEXPORT wxImageHandler: public wxObject
{
public:
wxImageHandler()
: m_name(""), m_extension(""), m_mime(), m_type(0)
: m_name(wxT("")), m_extension(wxT("")), m_mime(), m_type(0)
{ }
#if wxUSE_STREAMS
@@ -97,7 +97,7 @@ public:
WX_DECLARE_EXPORTED_HASH_MAP(unsigned long, wxImageHistogramEntry,
wxIntegerHash, wxIntegerEqual,
wxImageHistogram);
wxImageHistogram)
//-----------------------------------------------------------------------------
// wxImage
@@ -121,7 +121,7 @@ public:
wxImage( const wxImage* image );
#if WXWIN_COMPATIBILITY_2_2 && wxUSE_GUI
// convertion to/from wxBitmap (deprecated, use wxBitmap's methods instead):
// conversion to/from wxBitmap (deprecated, use wxBitmap's methods instead):
wxImage( const wxBitmap &bitmap );
wxBitmap ConvertToBitmap() const;
#ifdef __WXGTK__
@@ -248,9 +248,9 @@ public:
return *this;
}
bool operator == (const wxImage& image)
bool operator == (const wxImage& image) const
{ return m_refData == image.m_refData; }
bool operator != (const wxImage& image)
bool operator != (const wxImage& image) const
{ return m_refData != image.m_refData; }
static wxList& GetHandlers() { return sm_handlers; }

View File

@@ -25,23 +25,23 @@
class WXDLLEXPORT wxGIFHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxGIFHandler)
public:
inline wxGIFHandler()
{
m_name = "GIF file";
m_extension = "gif";
m_type = wxBITMAP_TYPE_GIF;
m_mime = "image/gif";
};
inline wxGIFHandler()
{
m_name = wxT("GIF file");
m_extension = wxT("gif");
m_type = wxBITMAP_TYPE_GIF;
m_mime = wxT("image/gif");
}
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
private:
DECLARE_DYNAMIC_CLASS(wxGIFHandler)
};
#endif

View File

@@ -24,8 +24,6 @@
class WXDLLEXPORT wxIFFHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxIFFHandler)
public:
wxIFFHandler()
{
@@ -33,13 +31,16 @@ public:
m_extension = wxT("iff");
m_type = wxBITMAP_TYPE_IFF;
m_mime = wxT("image/x-iff");
};
}
#if wxUSE_STREAMS
virtual bool LoadFile(wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1);
virtual bool SaveFile(wxImage *image, wxOutputStream& stream, bool verbose=TRUE);
virtual bool DoCanRead(wxInputStream& stream);
#endif
private:
DECLARE_DYNAMIC_CLASS(wxIFFHandler)
};
#endif // wxUSE_IMAGE && wxUSE_IFF

View File

@@ -23,23 +23,23 @@
#if wxUSE_LIBJPEG
class WXDLLEXPORT wxJPEGHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxJPEGHandler)
public:
inline wxJPEGHandler()
{
m_name = "JPEG file";
m_extension = "jpg";
m_type = wxBITMAP_TYPE_JPEG;
m_mime = "image/jpeg";
};
inline wxJPEGHandler()
{
m_name = wxT("JPEG file");
m_extension = wxT("jpg");
m_type = wxBITMAP_TYPE_JPEG;
m_mime = wxT("image/jpeg");
}
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
private:
DECLARE_DYNAMIC_CLASS(wxJPEGHandler)
};
#endif

View File

@@ -24,23 +24,23 @@
#if wxUSE_PCX
class WXDLLEXPORT wxPCXHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxPCXHandler)
public:
inline wxPCXHandler()
{
m_name = "PCX file";
m_extension = "pcx";
m_type = wxBITMAP_TYPE_PCX;
m_mime = "image/pcx";
};
inline wxPCXHandler()
{
m_name = wxT("PCX file");
m_extension = wxT("pcx");
m_type = wxBITMAP_TYPE_PCX;
m_mime = wxT("image/pcx");
}
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif // wxUSE_STREAMS
private:
DECLARE_DYNAMIC_CLASS(wxPCXHandler)
};
#endif // wxUSE_PCX

View File

@@ -23,23 +23,23 @@
#if wxUSE_LIBPNG
class WXDLLEXPORT wxPNGHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxPNGHandler)
public:
inline wxPNGHandler()
{
m_name = "PNG file";
m_extension = "png";
m_type = wxBITMAP_TYPE_PNG;
m_mime = "image/png";
};
inline wxPNGHandler()
{
m_name = wxT("PNG file");
m_extension = wxT("png");
m_type = wxBITMAP_TYPE_PNG;
m_mime = wxT("image/png");
}
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
private:
DECLARE_DYNAMIC_CLASS(wxPNGHandler)
};
#endif

View File

@@ -23,23 +23,23 @@
#if wxUSE_PNM
class WXDLLEXPORT wxPNMHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxPNMHandler)
public:
inline wxPNMHandler()
{
m_name = "PNM file";
m_extension = "pnm";
m_type = wxBITMAP_TYPE_PNM;
m_mime = "image/pnm";
};
inline wxPNMHandler()
{
m_name = wxT("PNM file");
m_extension = wxT("pnm");
m_type = wxBITMAP_TYPE_PNM;
m_mime = wxT("image/pnm");
}
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
private:
DECLARE_DYNAMIC_CLASS(wxPNMHandler)
};
#endif

View File

@@ -24,24 +24,24 @@
#if wxUSE_LIBTIFF
class WXDLLEXPORT wxTIFFHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxTIFFHandler)
public:
inline wxTIFFHandler()
{
m_name = "TIFF file";
m_extension = "tif";
m_type = wxBITMAP_TYPE_TIF;
m_mime = "image/tiff";
};
inline wxTIFFHandler()
{
m_name = wxT("TIFF file");
m_extension = wxT("tif");
m_type = wxBITMAP_TYPE_TIF;
m_mime = wxT("image/tiff");
}
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
virtual int GetImageCount( wxInputStream& stream );
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
virtual int GetImageCount( wxInputStream& stream );
#endif
private:
DECLARE_DYNAMIC_CLASS(wxTIFFHandler)
};
#endif

View File

@@ -23,23 +23,23 @@
class WXDLLEXPORT wxXPMHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxXPMHandler)
public:
inline wxXPMHandler()
{
m_name = wxT("XPM file");
m_extension = wxT("xpm");
m_type = wxBITMAP_TYPE_XPM;
m_mime = wxT("image/xpm");
};
inline wxXPMHandler()
{
m_name = wxT("XPM file");
m_extension = wxT("xpm");
m_type = wxBITMAP_TYPE_XPM;
m_mime = wxT("image/xpm");
}
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
private:
DECLARE_DYNAMIC_CLASS(wxXPMHandler)
};

View File

@@ -193,7 +193,7 @@ private:
class WXDLLEXPORT wxListBase : public wxObject
{
friend class wxNodeBase; // should be able to call DetachNode()
friend class WXDLLEXPORT wxNodeBase; // should be able to call DetachNode()
friend class wxHashTableBase; // should be able to call untyped Find()
private:
// common part of all ctors
@@ -235,7 +235,7 @@ public:
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 *Nth(size_t n) const { return (wxNode *)Item(n); }
#endif // wxLIST_COMPATIBILITY
protected:
@@ -274,8 +274,12 @@ protected:
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() : (wxNodeBase*)NULL; }
void *operator[](size_t n) const
{
wxNodeBase *node = Item(n);
return node ? node->GetData() : (wxNodeBase *)NULL;
}
// operations
// append to end of list

View File

@@ -44,7 +44,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxLC_REPORT,
const wxValidator& validator = wxDefaultValidator,
const wxString &name = "listctrl" )
const wxString &name = wxT("listctrl") )
{
Create(parent, id, pos, size, style, validator, name);
}

View File

@@ -50,29 +50,39 @@
// long", then check for specific compilers
#if defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
#define wxLongLong_t long
#define wxLongLongSuffix l
#define wxLongLongFmtSpec _T("l")
#define wxLongLongIsLong
#elif (defined(__VISUALC__) && defined(__WIN32__)) || defined( __VMS__ )
#define wxLongLong_t __int64
#define wxLongLongSuffix i64
#define wxLongLongFmtSpec _T("I64")
#elif defined(__BORLANDC__) && defined(__WIN32__) && (__BORLANDC__ >= 0x520)
#define wxLongLong_t __int64
#elif defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8
#define wxLongLong_t long long
#elif defined(__MINGW32__) || defined(__CYGWIN__) || defined(__WXMICROWIN__)
#define wxLongLongSuffix i64
#define wxLongLongFmtSpec _T("I64")
#elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \
defined(__MINGW32__) || \
defined(__CYGWIN__) || \
defined(__WXMICROWIN__) || \
(defined(__DJGPP__) && __DJGPP__ >= 2)
#define wxLongLong_t long long
#define wxLongLongSuffix ll
#define wxLongLongFmtSpec _T("ll")
#elif defined(__MWERKS__)
#if __option(longlong)
#define wxLongLong_t long long
#define wxLongLongSuffix ll
#define wxLongLongFmtSpec _T("ll")
#else
#error "The 64 bit integer support in CodeWarrior has been disabled."
#error "See the documentation on the 'longlong' pragma."
#endif
#elif defined(__VISAGECPP__) && __IBMCPP__ >= 400
#define wxLongLong_t long long
#elif defined(__DJGPP__) && __DJGPP__ >= 2
#define wxLongLong_t long long
#else // no native long long type
// both warning and pragma warning are not portable, but at least an
// unknown pragma should never be an error - except that, actually, some
// unknown pragma should never be an error -- except that, actually, some
// broken compilers don't like it, so we have to disable it in this case
// <sigh>
#if !(defined(__WATCOMC__) || defined(__VISAGECPP__))
@@ -85,6 +95,11 @@
#define wxUSE_LONGLONG_WX 1
#endif // compiler
// this macro allows to definea 64 bit constant in a portable way
#define wxMakeLongLong(x, s) x ## s
#define wxMakeLongLong2(x, s) wxMakeLongLong(x, s)
#define wxLL(x) wxMakeLongLong2(x, wxLongLongSuffix)
// the user may predefine wxUSE_LONGLONG_NATIVE and/or wxUSE_LONGLONG_NATIVE
// to disable automatic testing (useful for the test program which defines
// both classes) but by default we only use one class

View File

@@ -109,6 +109,8 @@ public:
static bool s_macDefaultEncodingIsPC ;
static bool s_macSupportPCMenuShortcuts ;
static long s_macAboutMenuItemId ;
static long s_macPreferencesMenuItemId ;
static long s_macExitMenuItemId ;
static wxString s_macHelpMenuTitleName ;
static bool s_macHasAppearance ;

View File

@@ -12,7 +12,7 @@
#ifndef _WX_MAC_DATAFORM_H
#define _WX_MAC_DATAFORM_H
class wxDataFormat
class WXDLLEXPORT wxDataFormat
{
public:
typedef unsigned long NativeFormat;

Some files were not shown because too many files have changed in this diff Show More