Source cleaning: whitespaces, tabs, -1/wxID_ANY/wxDefaultCoord, TRUE/true, FALSE/false.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -116,19 +116,19 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
|
typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
|
||||||
|
|
||||||
#define EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) \
|
#define EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) \
|
||||||
DECLARE_EVENT_TABLE_ENTRY( \
|
DECLARE_EVENT_TABLE_ENTRY( \
|
||||||
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
|
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
|
||||||
winid, \
|
winid, \
|
||||||
-1, \
|
wxID_ANY, \
|
||||||
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxNotebookEventFunction, &fn ), \
|
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxNotebookEventFunction, &fn ), \
|
||||||
NULL \
|
NULL \
|
||||||
),
|
),
|
||||||
|
|
||||||
#define EVT_NOTEBOOK_PAGE_CHANGING(winid, fn) \
|
#define EVT_NOTEBOOK_PAGE_CHANGING(winid, fn) \
|
||||||
DECLARE_EVENT_TABLE_ENTRY( \
|
DECLARE_EVENT_TABLE_ENTRY( \
|
||||||
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \
|
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \
|
||||||
winid, \
|
winid, \
|
||||||
-1, \
|
wxID_ANY, \
|
||||||
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxNotebookEventFunction, &fn ), \
|
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxNotebookEventFunction, &fn ), \
|
||||||
NULL \
|
NULL \
|
||||||
),
|
),
|
||||||
|
@@ -73,7 +73,7 @@ public:
|
|||||||
, m_baseInfo1(baseInfo1)
|
, m_baseInfo1(baseInfo1)
|
||||||
, m_baseInfo2(baseInfo2)
|
, m_baseInfo2(baseInfo2)
|
||||||
, m_next(sm_first)
|
, m_next(sm_first)
|
||||||
{
|
{
|
||||||
sm_first = this;
|
sm_first = this;
|
||||||
Register();
|
Register();
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ public:
|
|||||||
wxDEPRECATED( static void CleanUpClasses() );
|
wxDEPRECATED( static void CleanUpClasses() );
|
||||||
#endif
|
#endif
|
||||||
static void CleanUp();
|
static void CleanUp();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const wxChar *m_className;
|
const wxChar *m_className;
|
||||||
int m_objectSize;
|
int m_objectSize;
|
||||||
@@ -140,8 +140,8 @@ private:
|
|||||||
static wxClassInfo *GetBaseByName(const wxChar *name);
|
static wxClassInfo *GetBaseByName(const wxChar *name);
|
||||||
|
|
||||||
DECLARE_NO_COPY_CLASS(wxClassInfo)
|
DECLARE_NO_COPY_CLASS(wxClassInfo)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// registers the class
|
// registers the class
|
||||||
void Register();
|
void Register();
|
||||||
void Unregister();
|
void Unregister();
|
||||||
@@ -547,7 +547,7 @@ public:
|
|||||||
// get the runtime identity of this object
|
// get the runtime identity of this object
|
||||||
wxClassInfo *GetClassInfo() const
|
wxClassInfo *GetClassInfo() const
|
||||||
{
|
{
|
||||||
return wx_const_cast(wxClassInfo *, m_classInfo);
|
return wx_const_cast(wxClassInfo *, m_classInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObject* GetSuperClassInstance() const
|
wxObject* GetSuperClassInstance() const
|
||||||
|
@@ -36,23 +36,23 @@ class WXDLLEXPORT wxOwnerDrawn
|
|||||||
public:
|
public:
|
||||||
// ctor & dtor
|
// ctor & dtor
|
||||||
wxOwnerDrawn(const wxString& str = wxEmptyString,
|
wxOwnerDrawn(const wxString& str = wxEmptyString,
|
||||||
bool bCheckable = FALSE,
|
bool bCheckable = false,
|
||||||
bool bMenuItem = FALSE); // FIXME kludge for colors
|
bool bMenuItem = false); // FIXME kludge for colors
|
||||||
virtual ~wxOwnerDrawn() { }
|
virtual ~wxOwnerDrawn() { }
|
||||||
|
|
||||||
// fix appearance
|
// fix appearance
|
||||||
void SetFont(const wxFont& font)
|
void SetFont(const wxFont& font)
|
||||||
{ m_font = font; m_bOwnerDrawn = TRUE; }
|
{ m_font = font; m_bOwnerDrawn = true; }
|
||||||
|
|
||||||
wxFont& GetFont() const { return (wxFont &)m_font; }
|
wxFont& GetFont() const { return (wxFont &)m_font; }
|
||||||
|
|
||||||
void SetTextColour(const wxColour& colText)
|
void SetTextColour(const wxColour& colText)
|
||||||
{ m_colText = colText; m_bOwnerDrawn = TRUE; }
|
{ m_colText = colText; m_bOwnerDrawn = true; }
|
||||||
|
|
||||||
wxColour& GetTextColour() const { return (wxColour&) m_colText; }
|
wxColour& GetTextColour() const { return (wxColour&) m_colText; }
|
||||||
|
|
||||||
void SetBackgroundColour(const wxColour& colBack)
|
void SetBackgroundColour(const wxColour& colBack)
|
||||||
{ m_colBack = colBack; m_bOwnerDrawn = TRUE; }
|
{ m_colBack = colBack; m_bOwnerDrawn = true; }
|
||||||
|
|
||||||
wxColour& GetBackgroundColour() const
|
wxColour& GetBackgroundColour() const
|
||||||
{ return (wxColour&) m_colBack ; }
|
{ return (wxColour&) m_colBack ; }
|
||||||
@@ -61,17 +61,17 @@ public:
|
|||||||
const wxBitmap& bmpUnchecked = wxNullBitmap)
|
const wxBitmap& bmpUnchecked = wxNullBitmap)
|
||||||
{ m_bmpChecked = bmpChecked;
|
{ m_bmpChecked = bmpChecked;
|
||||||
m_bmpUnchecked = bmpUnchecked;
|
m_bmpUnchecked = bmpUnchecked;
|
||||||
m_bOwnerDrawn = TRUE; }
|
m_bOwnerDrawn = true; }
|
||||||
|
|
||||||
void SetBitmap(const wxBitmap& bmpChecked)
|
void SetBitmap(const wxBitmap& bmpChecked)
|
||||||
{ m_bmpChecked = bmpChecked;
|
{ m_bmpChecked = bmpChecked;
|
||||||
m_bOwnerDrawn = TRUE; }
|
m_bOwnerDrawn = true; }
|
||||||
|
|
||||||
void SetDisabledBitmap( const wxBitmap& bmpDisabled )
|
void SetDisabledBitmap( const wxBitmap& bmpDisabled )
|
||||||
{ m_bmpDisabled = bmpDisabled;
|
{ m_bmpDisabled = bmpDisabled;
|
||||||
m_bOwnerDrawn = TRUE; }
|
m_bOwnerDrawn = true; }
|
||||||
|
|
||||||
const wxBitmap& GetBitmap(bool bChecked = TRUE) const
|
const wxBitmap& GetBitmap(bool bChecked = true) const
|
||||||
{ return (bChecked ? m_bmpChecked : m_bmpUnchecked); }
|
{ return (bChecked ? m_bmpChecked : m_bmpUnchecked); }
|
||||||
|
|
||||||
const wxBitmap& GetDisabledBitmap() const
|
const wxBitmap& GetDisabledBitmap() const
|
||||||
@@ -87,7 +87,7 @@ public:
|
|||||||
{
|
{
|
||||||
ms_nLastMarginWidth = m_nMarginWidth = (size_t) nWidth;
|
ms_nLastMarginWidth = m_nMarginWidth = (size_t) nWidth;
|
||||||
if ( ((size_t) nWidth) != ms_nDefaultMarginWidth )
|
if ( ((size_t) nWidth) != ms_nDefaultMarginWidth )
|
||||||
m_bOwnerDrawn = TRUE;
|
m_bOwnerDrawn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetMarginWidth() const { return (int) m_nMarginWidth; }
|
int GetMarginWidth() const { return (int) m_nMarginWidth; }
|
||||||
@@ -103,16 +103,16 @@ public:
|
|||||||
// menu item if not empty
|
// menu item if not empty
|
||||||
void SetAccelString(const wxString& strAccel) { m_strAccel = strAccel; }
|
void SetAccelString(const wxString& strAccel) { m_strAccel = strAccel; }
|
||||||
|
|
||||||
// this function might seem strange, but if it returns FALSE it means that
|
// this function might seem strange, but if it returns false it means that
|
||||||
// no non-standard attribute are set, so there is no need for this control
|
// no non-standard attribute are set, so there is no need for this control
|
||||||
// to be owner-drawn. Moreover, you can force owner-drawn to FALSE if you
|
// to be owner-drawn. Moreover, you can force owner-drawn to false if you
|
||||||
// want to change, say, the color for the item but only if it is owner-drawn
|
// want to change, say, the color for the item but only if it is owner-drawn
|
||||||
// (see wxMenuItem::wxMenuItem for example)
|
// (see wxMenuItem::wxMenuItem for example)
|
||||||
bool IsOwnerDrawn() const { return m_bOwnerDrawn; }
|
bool IsOwnerDrawn() const { return m_bOwnerDrawn; }
|
||||||
|
|
||||||
// switch on/off owner-drawing the item
|
// switch on/off owner-drawing the item
|
||||||
void SetOwnerDrawn(bool ownerDrawn = TRUE) { m_bOwnerDrawn = ownerDrawn; }
|
void SetOwnerDrawn(bool ownerDrawn = true) { m_bOwnerDrawn = ownerDrawn; }
|
||||||
void ResetOwnerDrawn() { m_bOwnerDrawn = FALSE; }
|
void ResetOwnerDrawn() { m_bOwnerDrawn = false; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// constants used in OnDrawItem
|
// constants used in OnDrawItem
|
||||||
@@ -134,7 +134,7 @@ public:
|
|||||||
wxODDefault = 0x0020 // item is the default item
|
wxODDefault = 0x0020 // item is the default item
|
||||||
};
|
};
|
||||||
|
|
||||||
// virtual functions to implement drawing (return TRUE if processed)
|
// virtual functions to implement drawing (return true if processed)
|
||||||
virtual bool OnMeasureItem(size_t *pwidth, size_t *pheight);
|
virtual bool OnMeasureItem(size_t *pwidth, size_t *pheight);
|
||||||
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
|
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// Created: 01/02/97
|
// Created: 01/02/97
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart
|
// Copyright: (c) Julian Smart
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_PAPERH__
|
#ifndef _WX_PAPERH__
|
||||||
|
@@ -46,7 +46,7 @@ public:
|
|||||||
virtual void Position(const wxPoint& ptOrigin,
|
virtual void Position(const wxPoint& ptOrigin,
|
||||||
const wxSize& size);
|
const wxSize& size);
|
||||||
|
|
||||||
virtual bool IsTopLevel() const { return TRUE; }
|
virtual bool IsTopLevel() const { return true; }
|
||||||
|
|
||||||
DECLARE_NO_COPY_CLASS(wxPopupWindowBase)
|
DECLARE_NO_COPY_CLASS(wxPopupWindowBase)
|
||||||
};
|
};
|
||||||
@@ -97,9 +97,9 @@ public:
|
|||||||
//
|
//
|
||||||
// VZ: where is this used??
|
// VZ: where is this used??
|
||||||
virtual bool CanDismiss()
|
virtual bool CanDismiss()
|
||||||
{ return TRUE; }
|
{ return true; }
|
||||||
|
|
||||||
// called when a mouse is pressed while the popup is shown: return TRUE
|
// called when a mouse is pressed while the popup is shown: return true
|
||||||
// from here to prevent its normal processing by the popup (which consists
|
// from here to prevent its normal processing by the popup (which consists
|
||||||
// in dismissing it if the mouse is cilcked outside it)
|
// in dismissing it if the mouse is cilcked outside it)
|
||||||
virtual bool ProcessLeftDown(wxMouseEvent& event);
|
virtual bool ProcessLeftDown(wxMouseEvent& event);
|
||||||
|
@@ -63,22 +63,22 @@ public:
|
|||||||
wxPrintDialogData& GetPrintDialogData() const
|
wxPrintDialogData& GetPrintDialogData() const
|
||||||
{ return (wxPrintDialogData&) m_printDialogData; }
|
{ return (wxPrintDialogData&) m_printDialogData; }
|
||||||
bool GetAbort() const { return sm_abortIt; }
|
bool GetAbort() const { return sm_abortIt; }
|
||||||
|
|
||||||
static wxPrinterError GetLastError() { return sm_lastError; }
|
static wxPrinterError GetLastError() { return sm_lastError; }
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// OVERRIDES
|
// OVERRIDES
|
||||||
|
|
||||||
virtual bool Setup(wxWindow *parent) = 0;
|
virtual bool Setup(wxWindow *parent) = 0;
|
||||||
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE) = 0;
|
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true) = 0;
|
||||||
virtual wxDC* PrintDialog(wxWindow *parent) = 0;
|
virtual wxDC* PrintDialog(wxWindow *parent) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxPrintDialogData m_printDialogData;
|
wxPrintDialogData m_printDialogData;
|
||||||
wxPrintout* m_currentPrintout;
|
wxPrintout* m_currentPrintout;
|
||||||
|
|
||||||
static wxPrinterError sm_lastError;
|
static wxPrinterError sm_lastError;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static wxWindow* sm_abortWindow;
|
static wxWindow* sm_abortWindow;
|
||||||
static bool sm_abortIt;
|
static bool sm_abortIt;
|
||||||
@@ -407,7 +407,7 @@ public:
|
|||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = wxT("dialog"))
|
const wxString& name = wxT("dialog"))
|
||||||
: wxDialog(parent, -1, title, pos, size, style, name)
|
: wxDialog(parent, wxID_ANY, title, pos, size, style, name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -59,10 +59,10 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// ctors
|
// ctors
|
||||||
wxProcess(wxEvtHandler *parent = (wxEvtHandler *) NULL, int id = -1)
|
wxProcess(wxEvtHandler *parent = (wxEvtHandler *) NULL, int id = wxID_ANY)
|
||||||
{ Init(parent, id, wxPROCESS_DEFAULT); }
|
{ Init(parent, id, wxPROCESS_DEFAULT); }
|
||||||
|
|
||||||
wxProcess(int flags) { Init(NULL, -1, flags); }
|
wxProcess(int flags) { Init(NULL, wxID_ANY, flags); }
|
||||||
|
|
||||||
virtual ~wxProcess();
|
virtual ~wxProcess();
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ public:
|
|||||||
// call this before passing the object to wxExecute() to redirect the
|
// call this before passing the object to wxExecute() to redirect the
|
||||||
// launched process stdin/stdout, then use GetInputStream() and
|
// launched process stdin/stdout, then use GetInputStream() and
|
||||||
// GetOutputStream() to get access to them
|
// GetOutputStream() to get access to them
|
||||||
void Redirect() { m_redirect = TRUE; }
|
void Redirect() { m_redirect = true; }
|
||||||
bool IsRedirected() const { return m_redirect; }
|
bool IsRedirected() const { return m_redirect; }
|
||||||
|
|
||||||
// detach from the parent - should be called by the parent if it's deleted
|
// detach from the parent - should be called by the parent if it's deleted
|
||||||
@@ -88,10 +88,10 @@ public:
|
|||||||
// close the output stream indicating that nothing more will be written
|
// close the output stream indicating that nothing more will be written
|
||||||
void CloseOutput() { delete m_outputStream; m_outputStream = NULL; }
|
void CloseOutput() { delete m_outputStream; m_outputStream = NULL; }
|
||||||
|
|
||||||
// return TRUE if the child process stdout is not closed
|
// return true if the child process stdout is not closed
|
||||||
bool IsInputOpened() const;
|
bool IsInputOpened() const;
|
||||||
|
|
||||||
// return TRUE if any input is available on the child process stdout/err
|
// return true if any input is available on the child process stdout/err
|
||||||
bool IsInputAvailable() const;
|
bool IsInputAvailable() const;
|
||||||
bool IsErrorAvailable() const;
|
bool IsErrorAvailable() const;
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ public:
|
|||||||
// for backwards compatibility only, don't use
|
// for backwards compatibility only, don't use
|
||||||
#if WXWIN_COMPATIBILITY_2_2
|
#if WXWIN_COMPATIBILITY_2_2
|
||||||
wxProcess(wxEvtHandler *parent, bool redirect)
|
wxProcess(wxEvtHandler *parent, bool redirect)
|
||||||
{ Init(parent, -1, redirect ? wxPROCESS_REDIRECT : wxPROCESS_DEFAULT); }
|
{ Init(parent, wxID_ANY, redirect ? wxPROCESS_REDIRECT : wxPROCESS_DEFAULT); }
|
||||||
#endif // WXWIN_COMPATIBILITY_2_2
|
#endif // WXWIN_COMPATIBILITY_2_2
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -170,7 +170,7 @@ typedef void (wxEvtHandler::*wxProcessEventFunction)(wxProcessEvent&);
|
|||||||
|
|
||||||
#define EVT_END_PROCESS(id, func) \
|
#define EVT_END_PROCESS(id, func) \
|
||||||
DECLARE_EVENT_TABLE_ENTRY( \
|
DECLARE_EVENT_TABLE_ENTRY( \
|
||||||
wxEVT_END_PROCESS, id, -1, \
|
wxEVT_END_PROCESS, id, wxID_ANY, \
|
||||||
(wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxProcessEventFunction, & func ), NULL),
|
(wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxProcessEventFunction, & func ), NULL),
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// This class closely follows the implementation of the boost
|
// This class closely follows the implementation of the boost
|
||||||
// library scoped_ptr and is an adaption for c++ macro's in
|
// library scoped_ptr and is an adaption for c++ macro's in
|
||||||
// the wxWidgets project. The original authors of the boost
|
// the wxWidgets project. The original authors of the boost
|
||||||
// scoped_ptr are given below with their respective copyrights.
|
// scoped_ptr are given below with their respective copyrights.
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ DECLARE_DYNAMIC_CLASS(wxQuantize)
|
|||||||
//// Helpers
|
//// Helpers
|
||||||
|
|
||||||
// Converts input bitmap(s) into 8bit representation with custom palette
|
// Converts input bitmap(s) into 8bit representation with custom palette
|
||||||
|
|
||||||
// in_rows and out_rows are arrays [0..h-1] of pointer to rows
|
// in_rows and out_rows are arrays [0..h-1] of pointer to rows
|
||||||
// (in_rows contains w * 3 bytes per row, out_rows w bytes per row)
|
// (in_rows contains w * 3 bytes per row, out_rows w bytes per row)
|
||||||
// fills out_rows with indexes into palette (which is also stored into palette variable)
|
// fills out_rows with indexes into palette (which is also stored into palette variable)
|
||||||
|
@@ -59,14 +59,14 @@ const wxClassInfo* wxObject::ms_classParents[] = { NULL } ;
|
|||||||
wxClassInfo wxObject::ms_classInfo(ms_classParents , wxT("") , wxT("wxObject"),
|
wxClassInfo wxObject::ms_classInfo(ms_classParents , wxT("") , wxT("wxObject"),
|
||||||
(int) sizeof(wxObject), \
|
(int) sizeof(wxObject), \
|
||||||
(wxObjectConstructorFn) 0 ,
|
(wxObjectConstructorFn) 0 ,
|
||||||
(wxPropertyInfo*) NULL,(wxHandlerInfo*) NULL,0 , 0 ,
|
(wxPropertyInfo*) NULL,(wxHandlerInfo*) NULL,0 , 0 ,
|
||||||
0 , wxVariantOfPtrToObjectConverterwxObject , wxVariantToObjectConverterwxObject , wxObjectToVariantConverterwxObject);
|
0 , wxVariantOfPtrToObjectConverterwxObject , wxVariantToObjectConverterwxObject , wxObjectToVariantConverterwxObject);
|
||||||
template<> void wxStringReadValue(const wxString & , wxObject * & ){assert(0) ;}
|
template<> void wxStringReadValue(const wxString & , wxObject * & ){assert(0) ;}
|
||||||
template<> void wxStringWriteValue(wxString & , wxObject* const & ){assert(0) ;}
|
template<> void wxStringWriteValue(wxString & , wxObject* const & ){assert(0) ;}
|
||||||
template<> void wxStringReadValue(const wxString & , wxObject & ){assert(0) ;}
|
template<> void wxStringReadValue(const wxString & , wxObject & ){assert(0) ;}
|
||||||
template<> void wxStringWriteValue(wxString & , wxObject const & ){assert(0) ;}
|
template<> void wxStringWriteValue(wxString & , wxObject const & ){assert(0) ;}
|
||||||
wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &wxObject::ms_classInfo , NULL , NULL , typeid(wxObject*).name() ) ;
|
wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &wxObject::ms_classInfo , NULL , NULL , typeid(wxObject*).name() ) ;
|
||||||
wxClassTypeInfo s_typeInfowxObject(wxT_OBJECT , &wxObject::ms_classInfo , NULL , NULL , typeid(wxObject).name() ) ;
|
wxClassTypeInfo s_typeInfowxObject(wxT_OBJECT , &wxObject::ms_classInfo , NULL , NULL , typeid(wxObject).name() ) ;
|
||||||
#else
|
#else
|
||||||
wxClassInfo wxObject::ms_classInfo( wxT("wxObject"), 0, 0,
|
wxClassInfo wxObject::ms_classInfo( wxT("wxObject"), 0, 0,
|
||||||
(int) sizeof(wxObject),
|
(int) sizeof(wxObject),
|
||||||
@@ -82,9 +82,9 @@ wxClassInfo* wxClassInfo::sm_first = NULL;
|
|||||||
wxHashTable* wxClassInfo::sm_classTable = NULL;
|
wxHashTable* wxClassInfo::sm_classTable = NULL;
|
||||||
|
|
||||||
// These are here so we can avoid 'always true/false' warnings
|
// These are here so we can avoid 'always true/false' warnings
|
||||||
// by referring to these instead of TRUE/FALSE
|
// by referring to these instead of true/false
|
||||||
const bool wxTrue = TRUE;
|
const bool wxTrue = true;
|
||||||
const bool wxFalse = FALSE;
|
const bool wxFalse = false;
|
||||||
|
|
||||||
// Is this object a kind of (a subclass of) 'info'?
|
// Is this object a kind of (a subclass of) 'info'?
|
||||||
// E.g. is wxWindow a kind of wxObject?
|
// E.g. is wxWindow a kind of wxObject?
|
||||||
@@ -93,18 +93,18 @@ const bool wxFalse = FALSE;
|
|||||||
bool wxObject::IsKindOf(wxClassInfo *info) const
|
bool wxObject::IsKindOf(wxClassInfo *info) const
|
||||||
{
|
{
|
||||||
wxClassInfo *thisInfo = GetClassInfo();
|
wxClassInfo *thisInfo = GetClassInfo();
|
||||||
return (thisInfo) ? thisInfo->IsKindOf(info) : FALSE ;
|
return (thisInfo) ? thisInfo->IsKindOf(info) : false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING && defined( new )
|
#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING && defined( new )
|
||||||
#undef new
|
#undef new
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WX_WANT_NEW_SIZET_WXCHAR_INT
|
#ifdef _WX_WANT_NEW_SIZET_WXCHAR_INT
|
||||||
void *wxObject::operator new ( size_t size, const wxChar *fileName, int lineNum )
|
void *wxObject::operator new ( size_t size, const wxChar *fileName, int lineNum )
|
||||||
{
|
{
|
||||||
return wxDebugAlloc(size, (wxChar*) fileName, lineNum, TRUE);
|
return wxDebugAlloc(size, (wxChar*) fileName, lineNum, true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -132,21 +132,21 @@ void wxObject::operator delete ( void *buf, const wxChar *WXUNUSED(fileName), in
|
|||||||
#ifdef _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT
|
#ifdef _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT
|
||||||
void *wxObject::operator new[] ( size_t size, const wxChar* fileName, int lineNum )
|
void *wxObject::operator new[] ( size_t size, const wxChar* fileName, int lineNum )
|
||||||
{
|
{
|
||||||
return wxDebugAlloc(size, (wxChar*) fileName, lineNum, TRUE, TRUE);
|
return wxDebugAlloc(size, (wxChar*) fileName, lineNum, true, true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WX_WANT_ARRAY_DELETE_VOID
|
#ifdef _WX_WANT_ARRAY_DELETE_VOID
|
||||||
void wxObject::operator delete[] ( void *buf )
|
void wxObject::operator delete[] ( void *buf )
|
||||||
{
|
{
|
||||||
wxDebugFree(buf, TRUE);
|
wxDebugFree(buf, true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT
|
#ifdef _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT
|
||||||
void wxObject::operator delete[] (void * buf, const wxChar* WXUNUSED(fileName), int WXUNUSED(lineNum) )
|
void wxObject::operator delete[] (void * buf, const wxChar* WXUNUSED(fileName), int WXUNUSED(lineNum) )
|
||||||
{
|
{
|
||||||
wxDebugFree(buf, TRUE);
|
wxDebugFree(buf, true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ wxClassInfo::~wxClassInfo()
|
|||||||
info = info->m_next;
|
info = info->m_next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Unregister();
|
Unregister();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxClassInfo *wxClassInfo::FindClass(const wxChar *className)
|
wxClassInfo *wxClassInfo::FindClass(const wxChar *className)
|
||||||
@@ -222,7 +222,7 @@ void wxClassInfo::Register()
|
|||||||
// try to do some checks here
|
// try to do some checks here
|
||||||
wxASSERT_MSG( sm_classTable->Get(m_className) == NULL,
|
wxASSERT_MSG( sm_classTable->Get(m_className) == NULL,
|
||||||
_T("class already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() twice (may be by linking some object module(s) twice)?") );
|
_T("class already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() twice (may be by linking some object module(s) twice)?") );
|
||||||
|
|
||||||
sm_classTable->Put(m_className, (wxObject *)this);
|
sm_classTable->Put(m_className, (wxObject *)this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: paper.cpp
|
// Name: paper.cpp
|
||||||
// Purpose: Paper size classes
|
// Purpose: Paper size classes
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 04/01/98
|
// Created: 04/01/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart
|
// Copyright: (c) Julian Smart
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||||
@@ -330,7 +330,7 @@ bool wxPrintPaperModule::OnInit()
|
|||||||
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
|
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
|
||||||
wxThePrintPaperDatabase->CreateDatabase();
|
wxThePrintPaperDatabase->CreateDatabase();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPrintPaperModule::OnExit()
|
void wxPrintPaperModule::OnExit()
|
||||||
|
@@ -136,7 +136,7 @@ wxPopupWindowBase::~wxPopupWindowBase()
|
|||||||
|
|
||||||
bool wxPopupWindowBase::Create(wxWindow* WXUNUSED(parent), int WXUNUSED(flags))
|
bool wxPopupWindowBase::Create(wxWindow* WXUNUSED(parent), int WXUNUSED(flags))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPopupWindowBase::Position(const wxPoint& ptOrigin,
|
void wxPopupWindowBase::Position(const wxPoint& ptOrigin,
|
||||||
@@ -200,7 +200,7 @@ wxPopupTransientWindow::~wxPopupTransientWindow()
|
|||||||
PopHandlers();
|
PopHandlers();
|
||||||
#ifndef __WXX11__
|
#ifndef __WXX11__
|
||||||
delete m_handlerFocus;
|
delete m_handlerFocus;
|
||||||
#endif
|
#endif
|
||||||
delete m_handlerPopup;
|
delete m_handlerPopup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ void wxPopupTransientWindow::OnDismiss()
|
|||||||
bool wxPopupTransientWindow::ProcessLeftDown(wxMouseEvent& WXUNUSED(event))
|
bool wxPopupTransientWindow::ProcessLeftDown(wxMouseEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
// no special processing here
|
// no special processing here
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_COMBOBOX && defined(__WXUNIVERSAL__)
|
#if wxUSE_COMBOBOX && defined(__WXUNIVERSAL__)
|
||||||
|
@@ -82,14 +82,14 @@ wxPrinterBase::wxPrinterBase(wxPrintDialogData *data)
|
|||||||
{
|
{
|
||||||
m_currentPrintout = (wxPrintout *) NULL;
|
m_currentPrintout = (wxPrintout *) NULL;
|
||||||
sm_abortWindow = (wxWindow *) NULL;
|
sm_abortWindow = (wxWindow *) NULL;
|
||||||
sm_abortIt = FALSE;
|
sm_abortIt = false;
|
||||||
if (data)
|
if (data)
|
||||||
m_printDialogData = (*data);
|
m_printDialogData = (*data);
|
||||||
sm_lastError = wxPRINTER_NO_ERROR;
|
sm_lastError = wxPRINTER_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindow *wxPrinterBase::sm_abortWindow = (wxWindow *) NULL;
|
wxWindow *wxPrinterBase::sm_abortWindow = (wxWindow *) NULL;
|
||||||
bool wxPrinterBase::sm_abortIt = FALSE;
|
bool wxPrinterBase::sm_abortIt = false;
|
||||||
wxPrinterError wxPrinterBase::sm_lastError = wxPRINTER_NO_ERROR;
|
wxPrinterError wxPrinterBase::sm_lastError = wxPRINTER_NO_ERROR;
|
||||||
|
|
||||||
wxPrinterBase::~wxPrinterBase()
|
wxPrinterBase::~wxPrinterBase()
|
||||||
@@ -98,9 +98,9 @@ wxPrinterBase::~wxPrinterBase()
|
|||||||
|
|
||||||
void wxPrintAbortDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
|
void wxPrintAbortDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxPrinterBase::sm_abortIt = TRUE;
|
wxPrinterBase::sm_abortIt = true;
|
||||||
wxPrinterBase::sm_abortWindow->Show(FALSE);
|
wxPrinterBase::sm_abortWindow->Show(false);
|
||||||
wxPrinterBase::sm_abortWindow->Close(TRUE);
|
wxPrinterBase::sm_abortWindow->Close(true);
|
||||||
wxPrinterBase::sm_abortWindow = (wxWindow *) NULL;
|
wxPrinterBase::sm_abortWindow = (wxWindow *) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,10 +109,10 @@ wxWindow *wxPrinterBase::CreateAbortWindow(wxWindow *parent, wxPrintout * printo
|
|||||||
wxPrintAbortDialog *dialog = new wxPrintAbortDialog(parent, _("Printing ") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE);
|
wxPrintAbortDialog *dialog = new wxPrintAbortDialog(parent, _("Printing ") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE);
|
||||||
|
|
||||||
wxBoxSizer *button_sizer = new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer *button_sizer = new wxBoxSizer( wxVERTICAL );
|
||||||
button_sizer->Add( new wxStaticText(dialog, -1, _("Please wait while printing\n") + printout->GetTitle() ), 0, wxALL, 10 );
|
button_sizer->Add( new wxStaticText(dialog, wxID_ANY, _("Please wait while printing\n") + printout->GetTitle() ), 0, wxALL, 10 );
|
||||||
button_sizer->Add( new wxButton( dialog, wxID_CANCEL, wxT("Cancel") ), 0, wxALL | wxALIGN_CENTER, 10 );
|
button_sizer->Add( new wxButton( dialog, wxID_CANCEL, wxT("Cancel") ), 0, wxALL | wxALIGN_CENTER, 10 );
|
||||||
|
|
||||||
dialog->SetAutoLayout( TRUE );
|
dialog->SetAutoLayout( true );
|
||||||
dialog->SetSizer( button_sizer );
|
dialog->SetSizer( button_sizer );
|
||||||
|
|
||||||
button_sizer->Fit(dialog);
|
button_sizer->Fit(dialog);
|
||||||
@@ -142,7 +142,7 @@ wxPrintout::wxPrintout(const wxString& title)
|
|||||||
m_PPIScreenY = 0;
|
m_PPIScreenY = 0;
|
||||||
m_PPIPrinterX = 0;
|
m_PPIPrinterX = 0;
|
||||||
m_PPIPrinterY = 0;
|
m_PPIPrinterY = 0;
|
||||||
m_isPreview = FALSE;
|
m_isPreview = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPrintout::~wxPrintout()
|
wxPrintout::~wxPrintout()
|
||||||
@@ -190,7 +190,7 @@ void wxPrintout::GetPageInfo(int *minPage, int *maxPage, int *fromPage, int *toP
|
|||||||
// this style it simply doesn't work correctly at all...
|
// this style it simply doesn't work correctly at all...
|
||||||
wxPreviewCanvas::wxPreviewCanvas(wxPrintPreviewBase *preview, wxWindow *parent,
|
wxPreviewCanvas::wxPreviewCanvas(wxPrintPreviewBase *preview, wxWindow *parent,
|
||||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name):
|
const wxPoint& pos, const wxSize& size, long style, const wxString& name):
|
||||||
wxScrolledWindow(parent, -1, pos, size, style | wxFULL_REPAINT_ON_RESIZE, name)
|
wxScrolledWindow(parent, wxID_ANY, pos, size, style | wxFULL_REPAINT_ON_RESIZE, name)
|
||||||
{
|
{
|
||||||
m_printPreview = preview;
|
m_printPreview = preview;
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
@@ -249,7 +249,7 @@ void wxPreviewCanvas::OnChar(wxKeyEvent &event)
|
|||||||
wxPreviewControlBar* controlBar = ((wxPreviewFrame*) GetParent())->GetControlBar();
|
wxPreviewControlBar* controlBar = ((wxPreviewFrame*) GetParent())->GetControlBar();
|
||||||
if (event.GetKeyCode() == WXK_ESCAPE)
|
if (event.GetKeyCode() == WXK_ESCAPE)
|
||||||
{
|
{
|
||||||
((wxPreviewFrame*) GetParent())->Close(TRUE);
|
((wxPreviewFrame*) GetParent())->Close(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (event.GetKeyCode() == WXK_TAB)
|
else if (event.GetKeyCode() == WXK_TAB)
|
||||||
@@ -303,7 +303,7 @@ END_EVENT_TABLE()
|
|||||||
wxPreviewControlBar::wxPreviewControlBar(wxPrintPreviewBase *preview, long buttons,
|
wxPreviewControlBar::wxPreviewControlBar(wxPrintPreviewBase *preview, long buttons,
|
||||||
wxWindow *parent, const wxPoint& pos, const wxSize& size,
|
wxWindow *parent, const wxPoint& pos, const wxSize& size,
|
||||||
long style, const wxString& name):
|
long style, const wxString& name):
|
||||||
wxPanel(parent, -1, pos, size, style, name)
|
wxPanel(parent, wxID_ANY, pos, size, style, name)
|
||||||
{
|
{
|
||||||
m_printPreview = preview;
|
m_printPreview = preview;
|
||||||
m_closeButton = (wxButton *) NULL;
|
m_closeButton = (wxButton *) NULL;
|
||||||
@@ -332,13 +332,13 @@ void wxPreviewControlBar::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
void wxPreviewControlBar::OnWindowClose(wxCommandEvent& WXUNUSED(event))
|
void wxPreviewControlBar::OnWindowClose(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxPreviewFrame *frame = (wxPreviewFrame *)GetParent();
|
wxPreviewFrame *frame = (wxPreviewFrame *)GetParent();
|
||||||
frame->Close(TRUE);
|
frame->Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPreviewControlBar::OnPrint(void)
|
void wxPreviewControlBar::OnPrint(void)
|
||||||
{
|
{
|
||||||
wxPrintPreviewBase *preview = GetPrintPreview();
|
wxPrintPreviewBase *preview = GetPrintPreview();
|
||||||
preview->Print(TRUE);
|
preview->Print(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPreviewControlBar::OnNext(void)
|
void wxPreviewControlBar::OnNext(void)
|
||||||
@@ -487,7 +487,7 @@ void wxPreviewControlBar::CreateButtons()
|
|||||||
};
|
};
|
||||||
int n = WXSIZEOF(choices);
|
int n = WXSIZEOF(choices);
|
||||||
|
|
||||||
m_zoomControl = new wxChoice( this, wxID_PREVIEW_ZOOM, wxDefaultPosition, wxSize(70,-1), n, choices, 0 );
|
m_zoomControl = new wxChoice( this, wxID_PREVIEW_ZOOM, wxDefaultPosition, wxSize(70,wxDefaultCoord), n, choices, 0 );
|
||||||
item0->Add( m_zoomControl, 0, wxALIGN_CENTRE|wxALL, 5 );
|
item0->Add( m_zoomControl, 0, wxALIGN_CENTRE|wxALL, 5 );
|
||||||
SetZoomControl(m_printPreview->GetZoom());
|
SetZoomControl(m_printPreview->GetZoom());
|
||||||
}
|
}
|
||||||
@@ -511,7 +511,7 @@ void wxPreviewControlBar::SetZoomControl(int zoom)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_zoomControl->SetSelection(count-1);
|
m_zoomControl->SetSelection(count-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -524,7 +524,7 @@ int wxPreviewControlBar::GetZoomControl()
|
|||||||
if (m_zoomControl->GetStringSelection().BeforeFirst(wxT('%')).ToLong(&val))
|
if (m_zoomControl->GetStringSelection().BeforeFirst(wxT('%')).ToLong(&val))
|
||||||
return int(val);
|
return int(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -539,7 +539,7 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase *preview, wxWindow *parent, const wxString& title,
|
wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase *preview, wxWindow *parent, const wxString& title,
|
||||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name):
|
const wxPoint& pos, const wxSize& size, long style, const wxString& name):
|
||||||
wxFrame(parent, -1, title, pos, size, style, name)
|
wxFrame(parent, wxID_ANY, title, pos, size, style, name)
|
||||||
{
|
{
|
||||||
m_printPreview = preview;
|
m_printPreview = preview;
|
||||||
m_controlBar = NULL;
|
m_controlBar = NULL;
|
||||||
@@ -593,7 +593,7 @@ void wxPreviewFrame::Initialize()
|
|||||||
item0->Add( m_controlBar, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
|
item0->Add( m_controlBar, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
item0->Add( m_previewCanvas, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
|
item0->Add( m_previewCanvas, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
|
|
||||||
SetAutoLayout( TRUE );
|
SetAutoLayout( true );
|
||||||
SetSizer( item0 );
|
SetSizer( item0 );
|
||||||
|
|
||||||
m_windowDisabler = new wxWindowDisabler(this);
|
m_windowDisabler = new wxWindowDisabler(this);
|
||||||
@@ -647,10 +647,10 @@ wxPrintPreviewBase::wxPrintPreviewBase(wxPrintout *printout,
|
|||||||
void wxPrintPreviewBase::Init(wxPrintout *printout,
|
void wxPrintPreviewBase::Init(wxPrintout *printout,
|
||||||
wxPrintout *printoutForPrinting)
|
wxPrintout *printoutForPrinting)
|
||||||
{
|
{
|
||||||
m_isOk = TRUE;
|
m_isOk = true;
|
||||||
m_previewPrintout = printout;
|
m_previewPrintout = printout;
|
||||||
if (m_previewPrintout)
|
if (m_previewPrintout)
|
||||||
m_previewPrintout->SetIsPreview(TRUE);
|
m_previewPrintout->SetIsPreview(true);
|
||||||
|
|
||||||
m_printPrintout = printoutForPrinting;
|
m_printPrintout = printoutForPrinting;
|
||||||
|
|
||||||
@@ -663,7 +663,7 @@ void wxPrintPreviewBase::Init(wxPrintout *printout,
|
|||||||
m_leftMargin = 40;
|
m_leftMargin = 40;
|
||||||
m_pageWidth = 0;
|
m_pageWidth = 0;
|
||||||
m_pageHeight = 0;
|
m_pageHeight = 0;
|
||||||
m_printingPrepared = FALSE;
|
m_printingPrepared = false;
|
||||||
m_minPage = 1;
|
m_minPage = 1;
|
||||||
m_maxPage = 1;
|
m_maxPage = 1;
|
||||||
}
|
}
|
||||||
@@ -681,7 +681,7 @@ wxPrintPreviewBase::~wxPrintPreviewBase()
|
|||||||
bool wxPrintPreviewBase::SetCurrentPage(int pageNum)
|
bool wxPrintPreviewBase::SetCurrentPage(int pageNum)
|
||||||
{
|
{
|
||||||
if (m_currentPage == pageNum)
|
if (m_currentPage == pageNum)
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
m_currentPage = pageNum;
|
m_currentPage = pageNum;
|
||||||
if (m_previewBitmap)
|
if (m_previewBitmap)
|
||||||
@@ -695,11 +695,11 @@ bool wxPrintPreviewBase::SetCurrentPage(int pageNum)
|
|||||||
AdjustScrollbars(m_previewCanvas);
|
AdjustScrollbars(m_previewCanvas);
|
||||||
|
|
||||||
if (!RenderPage(pageNum))
|
if (!RenderPage(pageNum))
|
||||||
return FALSE;
|
return false;
|
||||||
m_previewCanvas->Refresh();
|
m_previewCanvas->Refresh();
|
||||||
m_previewCanvas->SetFocus();
|
m_previewCanvas->SetFocus();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxPrintPreviewBase::PaintPage(wxPreviewCanvas *canvas, wxDC& dc)
|
bool wxPrintPreviewBase::PaintPage(wxPreviewCanvas *canvas, wxDC& dc)
|
||||||
@@ -708,13 +708,13 @@ bool wxPrintPreviewBase::PaintPage(wxPreviewCanvas *canvas, wxDC& dc)
|
|||||||
|
|
||||||
if (!m_previewBitmap)
|
if (!m_previewBitmap)
|
||||||
if (!RenderPage(m_currentPage))
|
if (!RenderPage(m_currentPage))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (!m_previewBitmap)
|
if (!m_previewBitmap)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (!canvas)
|
if (!canvas)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
int canvasWidth, canvasHeight;
|
int canvasWidth, canvasHeight;
|
||||||
canvas->GetSize(&canvasWidth, &canvasHeight);
|
canvas->GetSize(&canvasWidth, &canvasHeight);
|
||||||
@@ -735,7 +735,7 @@ bool wxPrintPreviewBase::PaintPage(wxPreviewCanvas *canvas, wxDC& dc)
|
|||||||
|
|
||||||
temp_dc.SelectObject(wxNullBitmap);
|
temp_dc.SelectObject(wxNullBitmap);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adjusts the scrollbars for the current scale
|
// Adjusts the scrollbars for the current scale
|
||||||
@@ -758,7 +758,7 @@ void wxPrintPreviewBase::AdjustScrollbars(wxPreviewCanvas *canvas)
|
|||||||
int scrollUnitsY = totalHeight/10;
|
int scrollUnitsY = totalHeight/10;
|
||||||
wxSize virtualSize = canvas->GetVirtualSize();
|
wxSize virtualSize = canvas->GetVirtualSize();
|
||||||
if (virtualSize.GetWidth() != totalWidth || virtualSize.GetHeight() != totalHeight)
|
if (virtualSize.GetWidth() != totalWidth || virtualSize.GetHeight() != totalHeight)
|
||||||
canvas->SetScrollbars(10, 10, scrollUnitsX, scrollUnitsY, 0, 0, TRUE);
|
canvas->SetScrollbars(10, 10, scrollUnitsX, scrollUnitsY, 0, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxPrintPreviewBase::RenderPage(int pageNum)
|
bool wxPrintPreviewBase::RenderPage(int pageNum)
|
||||||
@@ -771,7 +771,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum)
|
|||||||
{
|
{
|
||||||
wxFAIL_MSG(_T("wxPrintPreviewBase::RenderPage: must use wxPrintPreviewBase::SetCanvas to let me know about the canvas!"));
|
wxFAIL_MSG(_T("wxPrintPreviewBase::RenderPage: must use wxPrintPreviewBase::SetCanvas to let me know about the canvas!"));
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
m_previewCanvas->GetSize(&canvasWidth, &canvasHeight);
|
m_previewCanvas->GetSize(&canvasWidth, &canvasHeight);
|
||||||
|
|
||||||
@@ -789,7 +789,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum)
|
|||||||
m_previewBitmap = NULL;
|
m_previewBitmap = NULL;
|
||||||
}
|
}
|
||||||
wxMessageBox(_("Sorry, not enough memory to create a preview."), _("Print Preview Failure"), wxOK);
|
wxMessageBox(_("Sorry, not enough memory to create a preview."), _("Print Preview Failure"), wxOK);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -807,7 +807,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum)
|
|||||||
m_previewPrintout->OnPreparePrinting();
|
m_previewPrintout->OnPreparePrinting();
|
||||||
int selFrom, selTo;
|
int selFrom, selTo;
|
||||||
m_previewPrintout->GetPageInfo(&m_minPage, &m_maxPage, &selFrom, &selTo);
|
m_previewPrintout->GetPageInfo(&m_minPage, &m_maxPage, &selFrom, &selTo);
|
||||||
m_printingPrepared = TRUE;
|
m_printingPrepared = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_previewPrintout->OnBeginPrinting();
|
m_previewPrintout->OnBeginPrinting();
|
||||||
@@ -820,7 +820,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum)
|
|||||||
|
|
||||||
delete m_previewBitmap;
|
delete m_previewBitmap;
|
||||||
m_previewBitmap = NULL;
|
m_previewBitmap = NULL;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_previewPrintout->OnPrintPage(pageNum);
|
m_previewPrintout->OnPrintPage(pageNum);
|
||||||
@@ -834,15 +834,15 @@ bool wxPrintPreviewBase::RenderPage(int pageNum)
|
|||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
wxString status;
|
wxString status;
|
||||||
if (m_maxPage != 0)
|
if (m_maxPage != 0)
|
||||||
status = wxString::Format(_("Page %d of %d"), pageNum, m_maxPage);
|
status = wxString::Format(_("Page %d of %d"), pageNum, m_maxPage);
|
||||||
else
|
else
|
||||||
status = wxString::Format(_("Page %d"), pageNum);
|
status = wxString::Format(_("Page %d"), pageNum);
|
||||||
|
|
||||||
if (m_previewFrame)
|
if (m_previewFrame)
|
||||||
m_previewFrame->SetStatusText(status);
|
m_previewFrame->SetStatusText(status);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -883,7 +883,7 @@ bool wxPrintPreviewBase::DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc)
|
|||||||
|
|
||||||
dc.DrawRectangle((int)(x-2), (int)(y-1), (int)(actualWidth+3), (int)(actualHeight+2));
|
dc.DrawRectangle((int)(x-2), (int)(y-1), (int)(actualWidth+3), (int)(actualHeight+2));
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPrintPreviewBase::SetZoom(int percent)
|
void wxPrintPreviewBase::SetZoom(int percent)
|
||||||
|
@@ -157,7 +157,7 @@ bool wxProcess::Exists(int pid)
|
|||||||
{
|
{
|
||||||
case wxKILL_OK:
|
case wxKILL_OK:
|
||||||
case wxKILL_ACCESS_DENIED:
|
case wxKILL_ACCESS_DENIED:
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case wxKILL_ERROR:
|
case wxKILL_ERROR:
|
||||||
@@ -166,7 +166,7 @@ bool wxProcess::Exists(int pid)
|
|||||||
// fall through
|
// fall through
|
||||||
|
|
||||||
case wxKILL_NO_PROCESS:
|
case wxKILL_NO_PROCESS:
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -74,16 +74,16 @@ bool wxProtocol::Reconnect()
|
|||||||
if (!GetPeer(addr))
|
if (!GetPeer(addr))
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Close())
|
if (!Close())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (!Connect(addr))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
if (!Connect(addr))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -184,17 +184,17 @@ wxProtocolError GetLine(wxSocketBase *sock, wxString& result)
|
|||||||
|
|
||||||
// Not implemented on all systems
|
// Not implemented on all systems
|
||||||
// ret = (char *)memccpy(tmp_str, tmp_buf, '\n', avail);
|
// ret = (char *)memccpy(tmp_str, tmp_buf, '\n', avail);
|
||||||
found = FALSE;
|
found = false;
|
||||||
for (ret=tmp_str;ret < (tmp_str+avail); ret++)
|
for (ret=tmp_str;ret < (tmp_str+avail); ret++)
|
||||||
if (*ret == '\n')
|
if (*ret == '\n')
|
||||||
{
|
{
|
||||||
found = TRUE;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
return wxPROTO_PROTERR;
|
return wxPROTO_PROTERR;
|
||||||
|
|
||||||
*ret = 0;
|
*ret = 0;
|
||||||
|
|
||||||
result = wxString::FromAscii( tmp_str );
|
result = wxString::FromAscii( tmp_str );
|
||||||
@@ -202,7 +202,7 @@ wxProtocolError GetLine(wxSocketBase *sock, wxString& result)
|
|||||||
|
|
||||||
size = ret-tmp_str+1;
|
size = ret-tmp_str+1;
|
||||||
sock->Unread(&tmp_buf[size], avail-size);
|
sock->Unread(&tmp_buf[size], avail-size);
|
||||||
|
|
||||||
return wxPROTO_NOERR;
|
return wxPROTO_NOERR;
|
||||||
#undef PROTO_BSIZE
|
#undef PROTO_BSIZE
|
||||||
}
|
}
|
||||||
|
@@ -1116,13 +1116,13 @@ pass2_fs_dither (j_decompress_ptr cinfo,
|
|||||||
dir = -1;
|
dir = -1;
|
||||||
dir3 = -3;
|
dir3 = -3;
|
||||||
errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */
|
errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */
|
||||||
cquantize->on_odd_row = FALSE; /* flip for next time */
|
cquantize->on_odd_row = false; /* flip for next time */
|
||||||
} else {
|
} else {
|
||||||
/* work left to right in this row */
|
/* work left to right in this row */
|
||||||
dir = 1;
|
dir = 1;
|
||||||
dir3 = 3;
|
dir3 = 3;
|
||||||
errorptr = cquantize->fserrors; /* => entry before first real column */
|
errorptr = cquantize->fserrors; /* => entry before first real column */
|
||||||
cquantize->on_odd_row = TRUE; /* flip for next time */
|
cquantize->on_odd_row = true; /* flip for next time */
|
||||||
}
|
}
|
||||||
/* Preset error values: no error propagated to first pixel from left */
|
/* Preset error values: no error propagated to first pixel from left */
|
||||||
cur0 = cur1 = cur2 = 0;
|
cur0 = cur1 = cur2 = 0;
|
||||||
@@ -1282,7 +1282,7 @@ finish_pass1 (j_decompress_ptr cinfo)
|
|||||||
cinfo->colormap = cquantize->sv_colormap;
|
cinfo->colormap = cquantize->sv_colormap;
|
||||||
select_colors(cinfo, cquantize->desired);
|
select_colors(cinfo, cquantize->desired);
|
||||||
/* Force next pass to zero the color index table */
|
/* Force next pass to zero the color index table */
|
||||||
cquantize->needs_zeroed = TRUE;
|
cquantize->needs_zeroed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1307,7 +1307,7 @@ start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan)
|
|||||||
/* Set up method pointers */
|
/* Set up method pointers */
|
||||||
cquantize->pub.color_quantize = prescan_quantize;
|
cquantize->pub.color_quantize = prescan_quantize;
|
||||||
cquantize->pub.finish_pass = finish_pass1;
|
cquantize->pub.finish_pass = finish_pass1;
|
||||||
cquantize->needs_zeroed = TRUE; /* Always zero histogram */
|
cquantize->needs_zeroed = true; /* Always zero histogram */
|
||||||
} else {
|
} else {
|
||||||
/* Set up method pointers */
|
/* Set up method pointers */
|
||||||
cquantize->pub.color_quantize = pass2_fs_dither;
|
cquantize->pub.color_quantize = pass2_fs_dither;
|
||||||
@@ -1324,7 +1324,7 @@ start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan)
|
|||||||
/* Make the error-limit table if we didn't already. */
|
/* Make the error-limit table if we didn't already. */
|
||||||
if (cquantize->error_limiter == NULL)
|
if (cquantize->error_limiter == NULL)
|
||||||
init_error_limit(cinfo);
|
init_error_limit(cinfo);
|
||||||
cquantize->on_odd_row = FALSE;
|
cquantize->on_odd_row = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1334,7 +1334,7 @@ start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan)
|
|||||||
memset((void *) histogram[i], 0,
|
memset((void *) histogram[i], 0,
|
||||||
HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));
|
HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));
|
||||||
}
|
}
|
||||||
cquantize->needs_zeroed = FALSE;
|
cquantize->needs_zeroed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1349,7 +1349,7 @@ new_color_map_2_quant (j_decompress_ptr cinfo)
|
|||||||
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
|
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
|
||||||
|
|
||||||
/* Reset the inverse color map */
|
/* Reset the inverse color map */
|
||||||
cquantize->needs_zeroed = TRUE;
|
cquantize->needs_zeroed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1376,7 +1376,7 @@ jinit_2pass_quantizer (j_decompress_ptr cinfo)
|
|||||||
for (i = 0; i < HIST_C0_ELEMS; i++) {
|
for (i = 0; i < HIST_C0_ELEMS; i++) {
|
||||||
cquantize->histogram[i] = (hist2d) malloc(HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));
|
cquantize->histogram[i] = (hist2d) malloc(HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));
|
||||||
}
|
}
|
||||||
cquantize->needs_zeroed = TRUE; /* histogram is garbage now */
|
cquantize->needs_zeroed = true; /* histogram is garbage now */
|
||||||
|
|
||||||
/* Allocate storage for the completed colormap, if required.
|
/* Allocate storage for the completed colormap, if required.
|
||||||
* We do this now since it is storage and may affect
|
* We do this now since it is storage and may affect
|
||||||
@@ -1465,11 +1465,11 @@ void wxQuantize::DoQuantize(unsigned w, unsigned h, unsigned char **in_rows, uns
|
|||||||
cquantize = (my_cquantize_ptr) dec.cquantize;
|
cquantize = (my_cquantize_ptr) dec.cquantize;
|
||||||
|
|
||||||
|
|
||||||
cquantize->pub.start_pass(&dec, TRUE);
|
cquantize->pub.start_pass(&dec, true);
|
||||||
cquantize->pub.color_quantize(&dec, in_rows, out_rows, h);
|
cquantize->pub.color_quantize(&dec, in_rows, out_rows, h);
|
||||||
cquantize->pub.finish_pass(&dec);
|
cquantize->pub.finish_pass(&dec);
|
||||||
|
|
||||||
cquantize->pub.start_pass(&dec, FALSE);
|
cquantize->pub.start_pass(&dec, false);
|
||||||
cquantize->pub.color_quantize(&dec, in_rows, out_rows, h);
|
cquantize->pub.color_quantize(&dec, in_rows, out_rows, h);
|
||||||
cquantize->pub.finish_pass(&dec);
|
cquantize->pub.finish_pass(&dec);
|
||||||
|
|
||||||
@@ -1625,7 +1625,7 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest,
|
|||||||
}
|
}
|
||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This version sets a palette in the destination image so you don't
|
// This version sets a palette in the destination image so you don't
|
||||||
@@ -1639,7 +1639,7 @@ bool wxQuantize::Quantize(const wxImage& src,
|
|||||||
{
|
{
|
||||||
wxPalette* palette = NULL;
|
wxPalette* palette = NULL;
|
||||||
if ( !Quantize(src, dest, & palette, desiredNoColours, eightBitData, flags) )
|
if ( !Quantize(src, dest, & palette, desiredNoColours, eightBitData, flags) )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
#if wxUSE_PALETTE
|
#if wxUSE_PALETTE
|
||||||
if (palette)
|
if (palette)
|
||||||
@@ -1649,7 +1649,7 @@ bool wxQuantize::Quantize(const wxImage& src,
|
|||||||
}
|
}
|
||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user