Source cleaning: whitespaces, tabs, -1/wxID_ANY/wxNOT_FOUND/wxDefaultCoord, TRUE/true, FALSE/false, !!/!IsEmpty().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-09-23 18:20:56 +00:00
parent 957f865c97
commit cb719f2e29
29 changed files with 694 additions and 693 deletions

View File

@@ -17,7 +17,7 @@ class WXDLLIMPEXP_ADV wxTaskBarIconBase : public wxEvtHandler
{ {
public: public:
wxTaskBarIconBase() { } wxTaskBarIconBase() { }
// Operations: // Operations:
virtual bool SetIcon(const wxIcon& icon, virtual bool SetIcon(const wxIcon& icon,
const wxString& tooltip = wxEmptyString) = 0; const wxString& tooltip = wxEmptyString) = 0;
@@ -27,11 +27,11 @@ public:
protected: protected:
// creates menu to be displayed when user clicks on the icon // creates menu to be displayed when user clicks on the icon
virtual wxMenu *CreatePopupMenu() { return NULL; } virtual wxMenu *CreatePopupMenu() { return NULL; }
private: private:
// default events handling, calls CreatePopupMenu: // default events handling, calls CreatePopupMenu:
void OnRightButtonDown(wxTaskBarIconEvent& event); void OnRightButtonDown(wxTaskBarIconEvent& event);
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_NO_COPY_CLASS(wxTaskBarIconBase) DECLARE_NO_COPY_CLASS(wxTaskBarIconBase)
}; };
@@ -57,7 +57,7 @@ class WXDLLIMPEXP_ADV wxTaskBarIconEvent : public wxEvent
{ {
public: public:
wxTaskBarIconEvent(wxEventType evtType, wxTaskBarIcon *tbIcon) wxTaskBarIconEvent(wxEventType evtType, wxTaskBarIcon *tbIcon)
: wxEvent(-1, evtType) : wxEvent(wxID_ANY, evtType)
{ {
SetEventObject(tbIcon); SetEventObject(tbIcon);
} }
@@ -80,13 +80,13 @@ BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_RIGHT_DCLICK,1556) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_RIGHT_DCLICK,1556)
END_DECLARE_EVENT_TYPES() END_DECLARE_EVENT_TYPES()
#define EVT_TASKBAR_MOVE(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), #define EVT_TASKBAR_MOVE(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_MOVE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL),
#define EVT_TASKBAR_LEFT_DOWN(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), #define EVT_TASKBAR_LEFT_DOWN(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_DOWN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL),
#define EVT_TASKBAR_LEFT_UP(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), #define EVT_TASKBAR_LEFT_UP(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_UP, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL),
#define EVT_TASKBAR_RIGHT_DOWN(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), #define EVT_TASKBAR_RIGHT_DOWN(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_RIGHT_DOWN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL),
#define EVT_TASKBAR_RIGHT_UP(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), #define EVT_TASKBAR_RIGHT_UP(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_RIGHT_UP, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL),
#define EVT_TASKBAR_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), #define EVT_TASKBAR_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_DCLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL),
#define EVT_TASKBAR_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL), #define EVT_TASKBAR_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_RIGHT_DCLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTaskBarIconEventFunction, &fn ), NULL),
#endif #endif
// wxHAS_TASK_BAR_ICON // wxHAS_TASK_BAR_ICON

View File

@@ -50,7 +50,7 @@ enum wxToolBarToolStyle
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxToolBarTool is a toolbar element. // wxToolBarTool is a toolbar element.
// //
// It has a unique id (except for the separators which always have id -1), the // It has a unique id (except for the separators which always have id wxID_ANY), the
// style (telling whether it is a normal button, separator or a control), the // style (telling whether it is a normal button, separator or a control), the
// state (toggled or not, enabled or not) and short and long help strings. The // state (toggled or not, enabled or not) and short and long help strings. The
// default implementations use the short help string for the tooltip text which // default implementations use the short help string for the tooltip text which
@@ -88,8 +88,8 @@ public:
m_kind = kind; m_kind = kind;
m_enabled = TRUE; m_enabled = true;
m_toggled = FALSE; m_toggled = false;
m_toolStyle = toolid == wxID_SEPARATOR ? wxTOOL_STYLE_SEPARATOR m_toolStyle = toolid == wxID_SEPARATOR ? wxTOOL_STYLE_SEPARATOR
: wxTOOL_STYLE_BUTTON; : wxTOOL_STYLE_BUTTON;
@@ -103,8 +103,8 @@ public:
m_kind = wxITEM_MAX; // invalid value m_kind = wxITEM_MAX; // invalid value
m_enabled = TRUE; m_enabled = true;
m_toggled = FALSE; m_toggled = false;
m_toolStyle = wxTOOL_STYLE_CONTROL; m_toolStyle = wxTOOL_STYLE_CONTROL;
} }
@@ -168,7 +168,7 @@ public:
} }
} }
// modifiers: return TRUE if the state really changed // modifiers: return true if the state really changed
bool Enable(bool enable); bool Enable(bool enable);
bool Toggle(bool toggle); bool Toggle(bool toggle);
bool SetToggle(bool toggle); bool SetToggle(bool toggle);
@@ -329,14 +329,14 @@ public:
virtual wxToolBarToolBase *AddTool (wxToolBarToolBase *tool); virtual wxToolBarToolBase *AddTool (wxToolBarToolBase *tool);
virtual wxToolBarToolBase *InsertTool (size_t pos, wxToolBarToolBase *tool); virtual wxToolBarToolBase *InsertTool (size_t pos, wxToolBarToolBase *tool);
// add an arbitrary control to the toolbar, return TRUE if ok (notice that // add an arbitrary control to the toolbar (notice that
// the control will be deleted by the toolbar and that it will also adjust // the control will be deleted by the toolbar and that it will also adjust
// its position/size) // its position/size)
// //
// NB: the control should have toolbar as its parent // NB: the control should have toolbar as its parent
virtual wxToolBarToolBase *AddControl(wxControl *control); virtual wxToolBarToolBase *AddControl(wxControl *control);
virtual wxToolBarToolBase *InsertControl(size_t pos, wxControl *control); virtual wxToolBarToolBase *InsertControl(size_t pos, wxControl *control);
// get the control with the given id or return NULL // get the control with the given id or return NULL
virtual wxControl *FindControl( int toolid ); virtual wxControl *FindControl( int toolid );
@@ -375,7 +375,7 @@ public:
// returns tool pos, or wxNOT_FOUND if tool isn't found // returns tool pos, or wxNOT_FOUND if tool isn't found
virtual int GetToolPos(int id) const; virtual int GetToolPos(int id) const;
// return TRUE if the tool is toggled // return true if the tool is toggled
virtual bool GetToolState(int toolid) const; virtual bool GetToolState(int toolid) const;
virtual bool GetToolEnabled(int toolid) const; virtual bool GetToolEnabled(int toolid) const;
@@ -432,7 +432,7 @@ public:
// find the tool by id // find the tool by id
wxToolBarToolBase *FindById(int toolid) const; wxToolBarToolBase *FindById(int toolid) const;
// return TRUE if this is a vertical toolbar, otherwise FALSE // return true if this is a vertical toolbar, otherwise false
bool IsVertical() const { return HasFlag(wxTB_VERTICAL); } bool IsVertical() const { return HasFlag(wxTB_VERTICAL); }
@@ -443,7 +443,7 @@ public:
wxToolBarToolBase *AddTool(int toolid, wxToolBarToolBase *AddTool(int toolid,
const wxBitmap& bitmap, const wxBitmap& bitmap,
const wxBitmap& bmpDisabled, const wxBitmap& bmpDisabled,
bool toggle = FALSE, bool toggle = false,
wxObject *clientData = NULL, wxObject *clientData = NULL,
const wxString& shortHelpString = wxEmptyString, const wxString& shortHelpString = wxEmptyString,
const wxString& longHelpString = wxEmptyString) const wxString& longHelpString = wxEmptyString)
@@ -469,7 +469,7 @@ public:
const wxBitmap& bmpDisabled, const wxBitmap& bmpDisabled,
bool toggle, bool toggle,
wxCoord xPos, wxCoord xPos,
wxCoord yPos = -1, wxCoord yPos = wxDefaultCoord,
wxObject *clientData = NULL, wxObject *clientData = NULL,
const wxString& shortHelp = wxEmptyString, const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString) const wxString& longHelp = wxEmptyString)
@@ -483,7 +483,7 @@ public:
int toolid, int toolid,
const wxBitmap& bitmap, const wxBitmap& bitmap,
const wxBitmap& bmpDisabled = wxNullBitmap, const wxBitmap& bmpDisabled = wxNullBitmap,
bool toggle = FALSE, bool toggle = false,
wxObject *clientData = NULL, wxObject *clientData = NULL,
const wxString& shortHelp = wxEmptyString, const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString) const wxString& longHelp = wxEmptyString)
@@ -498,14 +498,14 @@ public:
// NB: these functions are deprecated, use EVT_TOOL_XXX() instead! // NB: these functions are deprecated, use EVT_TOOL_XXX() instead!
// Only allow toggle if returns TRUE. Call when left button up. // Only allow toggle if returns true. Call when left button up.
virtual bool OnLeftClick(int toolid, bool toggleDown); virtual bool OnLeftClick(int toolid, bool toggleDown);
// Call when right button down. // Call when right button down.
virtual void OnRightClick(int toolid, long x, long y); virtual void OnRightClick(int toolid, long x, long y);
// Called when the mouse cursor enters a tool bitmap. // Called when the mouse cursor enters a tool bitmap.
// Argument is -1 if mouse is exiting the toolbar. // Argument is wxID_ANY if mouse is exiting the toolbar.
virtual void OnMouseEnter(int toolid); virtual void OnMouseEnter(int toolid);
// more deprecated functions // more deprecated functions
@@ -523,7 +523,7 @@ public:
virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE) ; virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE) ;
// don't want toolbars to accept the focus // don't want toolbars to accept the focus
virtual bool AcceptsFocus() const { return FALSE; } virtual bool AcceptsFocus() const { return false; }
protected: protected:
// to implement in derived classes // to implement in derived classes
@@ -541,8 +541,8 @@ protected:
const wxString& shortHelp = wxEmptyString, const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString, const wxString& longHelp = wxEmptyString,
wxObject *clientData = NULL, wxObject *clientData = NULL,
wxCoord xPos = -1, wxCoord xPos = wxDefaultCoord,
wxCoord yPos = -1 wxCoord yPos = wxDefaultCoord
); );
// the tool is not yet inserted into m_tools list when this function is // the tool is not yet inserted into m_tools list when this function is

View File

@@ -145,15 +145,15 @@ public:
size_t n, size_t n,
wxTextFileType type = typeDefault) wxTextFileType type = typeDefault)
{ {
m_aLines.insert(m_aLines.begin() + n, str); m_aLines.insert(m_aLines.begin() + n, str);
m_aTypes.insert(m_aTypes.begin()+n, type); m_aTypes.insert(m_aTypes.begin()+n, type);
} }
// delete one line // delete one line
void RemoveLine(size_t n) void RemoveLine(size_t n)
{ {
m_aLines.erase(m_aLines.begin() + n); m_aLines.erase(m_aLines.begin() + n);
m_aTypes.erase(m_aTypes.begin() + n); m_aTypes.erase(m_aTypes.begin() + n);
} }
// remove all lines // remove all lines

View File

@@ -233,7 +233,7 @@ private:
wxTextAttrAlignment m_textAlignment; wxTextAttrAlignment m_textAlignment;
wxArrayInt m_tabs; // array of int: tab stops in 1/10 mm wxArrayInt m_tabs; // array of int: tab stops in 1/10 mm
int m_leftIndent; // left indent in 1/10 mm int m_leftIndent; // left indent in 1/10 mm
int m_leftSubIndent; // left indent for all but the first int m_leftSubIndent; // left indent for all but the first
// line in a paragraph relative to the // line in a paragraph relative to the
// first line, in 1/10 mm // first line, in 1/10 mm
int m_rightIndent; // right indent in 1/10 mm int m_rightIndent; // right indent in 1/10 mm
@@ -307,7 +307,7 @@ public:
virtual void AppendText(const wxString& text) = 0; virtual void AppendText(const wxString& text) = 0;
// insert the character which would have resulted from this key event, // insert the character which would have resulted from this key event,
// return TRUE if anything has been inserted // return true if anything has been inserted
virtual bool EmulateKeyPress(const wxKeyEvent& event); virtual bool EmulateKeyPress(const wxKeyEvent& event);
// text control under some platforms supports the text styles: these // text control under some platforms supports the text styles: these
@@ -466,10 +466,10 @@ public:
typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&); typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&);
#define EVT_TEXT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TEXT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_UPDATED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ),
#define EVT_TEXT_ENTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TEXT_ENTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_ENTER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ),
#define EVT_TEXT_URL(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_URL, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxTextUrlEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TEXT_URL(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_URL, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxTextUrlEventFunction, & fn ), (wxObject *) NULL ),
#define EVT_TEXT_MAXLEN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_MAXLEN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TEXT_MAXLEN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_MAXLEN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ),
#ifndef NO_TEXT_WINDOW_STREAM #ifndef NO_TEXT_WINDOW_STREAM

View File

@@ -24,7 +24,7 @@ BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, 19) DECLARE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, 19)
END_DECLARE_EVENT_TYPES() END_DECLARE_EVENT_TYPES()
#define EVT_TOGGLEBUTTON(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TOGGLEBUTTON(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ),
#if defined(__WXMSW__) #if defined(__WXMSW__)
#include "wx/msw/tglbtn.h" #include "wx/msw/tglbtn.h"

View File

@@ -321,7 +321,7 @@ public:
bool IsOk() const; bool IsOk() const;
// NB: the associated mutex MUST be locked beforehand by the calling thread // NB: the associated mutex MUST be locked beforehand by the calling thread
// //
// it atomically releases the lock on the associated mutex // it atomically releases the lock on the associated mutex
// and starts waiting to be woken up by a Signal()/Broadcast() // and starts waiting to be woken up by a Signal()/Broadcast()
// once its signaled, then it will wait until it can reacquire // once its signaled, then it will wait until it can reacquire
@@ -332,7 +332,7 @@ public:
// timeout ellapses even if the condition hasn't been signalled: in this // timeout ellapses even if the condition hasn't been signalled: in this
// case, the return value is false, otherwise (i.e. in case of a normal // case, the return value is false, otherwise (i.e. in case of a normal
// return) it is true // return) it is true
// //
// the timeeout parameter specifies a interval that needs to be waited in // the timeeout parameter specifies a interval that needs to be waited in
// milliseconds // milliseconds
wxCondError WaitTimeout(unsigned long milliseconds); wxCondError WaitTimeout(unsigned long milliseconds);

View File

@@ -33,10 +33,10 @@
// more readable flags for Start(): // more readable flags for Start():
// generate notifications periodically until the timer is stopped (default) // generate notifications periodically until the timer is stopped (default)
#define wxTIMER_CONTINUOUS FALSE #define wxTIMER_CONTINUOUS false
// only send the notification once and then stop the timer // only send the notification once and then stop the timer
#define wxTIMER_ONE_SHOT TRUE #define wxTIMER_ONE_SHOT true
// the interface of wxTimer class // the interface of wxTimer class
class WXDLLEXPORT wxTimerBase : public wxEvtHandler class WXDLLEXPORT wxTimerBase : public wxEvtHandler
@@ -52,11 +52,11 @@ public:
// ctor which allows to avoid having to override Notify() in the derived // ctor which allows to avoid having to override Notify() in the derived
// class: the owner will get timer notifications which can be handled with // class: the owner will get timer notifications which can be handled with
// EVT_TIMER // EVT_TIMER
wxTimerBase(wxEvtHandler *owner, int timerid = -1) wxTimerBase(wxEvtHandler *owner, int timerid = wxID_ANY)
{ Init(); SetOwner(owner, timerid); } { Init(); SetOwner(owner, timerid); }
// same as ctor above // same as ctor above
void SetOwner(wxEvtHandler *owner, int timerid = -1) void SetOwner(wxEvtHandler *owner, int timerid = wxID_ANY)
{ m_owner = owner; m_idTimer = timerid; } { m_owner = owner; m_idTimer = timerid; }
wxEvtHandler* GetOwner() const { return m_owner; } wxEvtHandler* GetOwner() const { return m_owner; }
@@ -70,7 +70,7 @@ public:
// //
// it is now valid to call Start() multiple times: this just restarts the // it is now valid to call Start() multiple times: this just restarts the
// timer if it is already running // timer if it is already running
virtual bool Start(int milliseconds = -1, bool oneShot = FALSE); virtual bool Start(int milliseconds = -1, bool oneShot = false);
// stop the timer // stop the timer
virtual void Stop() = 0; virtual void Stop() = 0;
@@ -82,28 +82,28 @@ public:
// getting info // getting info
// ------------ // ------------
// return TRUE if the timer is running // return true if the timer is running
virtual bool IsRunning() const = 0; virtual bool IsRunning() const = 0;
// get the (last) timer interval in the milliseconds // get the (last) timer interval in the milliseconds
int GetInterval() const { return m_milli; } int GetInterval() const { return m_milli; }
// return TRUE if the timer is one shot // return true if the timer is one shot
bool IsOneShot() const { return m_oneShot; } bool IsOneShot() const { return m_oneShot; }
// return the timer ID // return the timer ID
int GetId() const { return m_idTimer; } int GetId() const { return m_idTimer; }
protected: protected:
// common part of all ctors // common part of all ctors
void Init() { m_oneShot = FALSE; m_milli = 0; } void Init() { m_oneShot = false; m_milli = 0; }
wxEvtHandler *m_owner; wxEvtHandler *m_owner;
int m_idTimer; int m_idTimer;
int m_milli; // the timer interval int m_milli; // the timer interval
bool m_oneShot; // TRUE if one shot bool m_oneShot; // true if one shot
DECLARE_NO_COPY_CLASS(wxTimerBase) DECLARE_NO_COPY_CLASS(wxTimerBase)
}; };
@@ -134,13 +134,13 @@ class WXDLLEXPORT wxTimerRunner
{ {
public: public:
wxTimerRunner(wxTimer& timer) : m_timer(timer) { } wxTimerRunner(wxTimer& timer) : m_timer(timer) { }
wxTimerRunner(wxTimer& timer, int milli, bool oneShot = FALSE) wxTimerRunner(wxTimer& timer, int milli, bool oneShot = false)
: m_timer(timer) : m_timer(timer)
{ {
m_timer.Start(milli, oneShot); m_timer.Start(milli, oneShot);
} }
void Start(int milli, bool oneShot = FALSE) void Start(int milli, bool oneShot = false)
{ {
m_timer.Start(milli, oneShot); m_timer.Start(milli, oneShot);
} }
@@ -188,7 +188,7 @@ private:
typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&); typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&);
#define EVT_TIMER(timerid, func) \ #define EVT_TIMER(timerid, func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_TIMER, timerid, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTimerEventFunction, & func ), NULL), DECLARE_EVENT_TABLE_ENTRY( wxEVT_TIMER, timerid, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTimerEventFunction, & func ), NULL),
#endif // wxUSE_GUI && wxUSE_TIMER #endif // wxUSE_GUI && wxUSE_TIMER

View File

@@ -43,14 +43,14 @@ public:
// get the current tip and update the internal state to return the next tip // get the current tip and update the internal state to return the next tip
// when called for the next time // when called for the next time
virtual wxString GetTip() = 0; virtual wxString GetTip() = 0;
// get the current tip "index" (or whatever allows the tip provider to know // get the current tip "index" (or whatever allows the tip provider to know
// from where to start the next time) // from where to start the next time)
size_t GetCurrentTip() const { return m_currentTip; } size_t GetCurrentTip() const { return m_currentTip; }
// Allows any user-derived class to optionally override this function to // Allows any user-derived class to optionally override this function to
// modify the tip as soon as it is read. If return wxEmptyString, then // modify the tip as soon as it is read. If return wxEmptyString, then
// the tip is skipped, and the next one is read. // the tip is skipped, and the next one is read.
virtual wxString PreprocessTip(const wxString& tip) { return tip; } virtual wxString PreprocessTip(const wxString& tip) { return tip; }
@@ -78,10 +78,10 @@ WXDLLIMPEXP_ADV wxTipProvider *wxCreateFileTipProvider(const wxString& filename,
// the user to disable this (however, it's the program which should show, or // the user to disable this (however, it's the program which should show, or
// not, the dialog on startup depending on its value, not this class). // not, the dialog on startup depending on its value, not this class).
// //
// The function returns TRUE if this checkbox is checked, FALSE otherwise. // The function returns true if this checkbox is checked, false otherwise.
WXDLLIMPEXP_ADV bool wxShowTip(wxWindow *parent, WXDLLIMPEXP_ADV bool wxShowTip(wxWindow *parent,
wxTipProvider *tipProvider, wxTipProvider *tipProvider,
bool showAtStartup = TRUE); bool showAtStartup = true);
#endif // wxUSE_STARTUP_TIPS #endif // wxUSE_STARTUP_TIPS

View File

@@ -79,7 +79,7 @@ enum
const wxString& shortHelpString = wxEmptyString, const wxString& shortHelpString = wxEmptyString,
const wxString& longHelpString = wxEmptyString) const wxString& longHelpString = wxEmptyString)
{ {
return wxToolBarSimple::AddTool(toolid, bitmap, wxNullBitmap, FALSE, -1, -1, NULL, return wxToolBarSimple::AddTool(toolid, bitmap, wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, NULL,
shortHelpString, longHelpString); shortHelpString, longHelpString);
} }
@@ -95,7 +95,7 @@ enum
const wxString& longHelpString = wxEmptyString const wxString& longHelpString = wxEmptyString
) )
{ {
return wxToolBarSimple::AddTool(toolid, bitmap, pushedBitmap, toggle, -1, -1, clientData, return wxToolBarSimple::AddTool(toolid, bitmap, pushedBitmap, toggle, wxDefaultCoord, wxDefaultCoord, clientData,
shortHelpString, longHelpString); shortHelpString, longHelpString);
} }
@@ -107,7 +107,7 @@ enum
const wxBitmap& pushedBitmap, const wxBitmap& pushedBitmap,
bool toggle, bool toggle,
wxCoord xPos, wxCoord xPos,
wxCoord yPos = -1, wxCoord yPos = wxDefaultCoord,
wxObject *clientData = NULL, wxObject *clientData = NULL,
const wxString& shortHelpString = wxEmptyString, const wxString& shortHelpString = wxEmptyString,
const wxString& longHelpString = wxEmptyString const wxString& longHelpString = wxEmptyString

View File

@@ -66,13 +66,13 @@ class WXDLLEXPORT wxTopLevelWindowBase;
// "close" but round instead of squared and just hides the applications // "close" but round instead of squared and just hides the applications
// instead of closing it) in the title bar // instead of closing it) in the title bar
#if defined(__WXWINCE__) #if defined(__WXWINCE__)
#if defined(__SMARTPHONE__) #if defined(__SMARTPHONE__)
#define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE) #define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE)
#elif defined(__WINCE_STANDARDSDK__) #elif defined(__WINCE_STANDARDSDK__)
#define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE|wxCLOSE_BOX) #define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE|wxCLOSE_BOX)
#else #else
#define wxDEFAULT_FRAME_STYLE (0) #define wxDEFAULT_FRAME_STYLE (0)
#endif #endif
#else // !__WXWINCE__ #else // !__WXWINCE__
#define wxDEFAULT_FRAME_STYLE \ #define wxDEFAULT_FRAME_STYLE \
(wxSYSTEM_MENU | \ (wxSYSTEM_MENU | \
@@ -125,19 +125,19 @@ public:
// top level wnd state // top level wnd state
// -------------------- // --------------------
// maximize = TRUE => maximize, otherwise - restore // maximize = true => maximize, otherwise - restore
virtual void Maximize(bool maximize = TRUE) = 0; virtual void Maximize(bool maximize = true) = 0;
// undo Maximize() or Iconize() // undo Maximize() or Iconize()
virtual void Restore() = 0; virtual void Restore() = 0;
// iconize = TRUE => iconize, otherwise - restore // iconize = true => iconize, otherwise - restore
virtual void Iconize(bool iconize = TRUE) = 0; virtual void Iconize(bool iconize = true) = 0;
// return TRUE if the frame is maximized // return true if the frame is maximized
virtual bool IsMaximized() const = 0; virtual bool IsMaximized() const = 0;
// return TRUE if the frame is iconized // return true if the frame is iconized
virtual bool IsIconized() const = 0; virtual bool IsIconized() const = 0;
// get the frame icon // get the frame icon
@@ -155,7 +155,7 @@ public:
// maximize the window to cover entire screen // maximize the window to cover entire screen
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) = 0; virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) = 0;
// return TRUE if the frame is in fullscreen mode // return true if the frame is in fullscreen mode
virtual bool IsFullScreen() const = 0; virtual bool IsFullScreen() const = 0;
/* /*
@@ -167,9 +167,9 @@ public:
*/ */
// Set the shape of the window to the given region. // Set the shape of the window to the given region.
// Returns TRUE if the platform supports this feature (and the // Returns true if the platform supports this feature (and the
// operation is successful.) // operation is successful.)
virtual bool SetShape(const wxRegion& WXUNUSED(region)) { return FALSE; } virtual bool SetShape(const wxRegion& WXUNUSED(region)) { return false; }
// Attracts the users attention to this window if the application is // Attracts the users attention to this window if the application is
// inactive (should be called when a background event occurs) // inactive (should be called when a background event occurs)
@@ -181,7 +181,7 @@ public:
// override some base class virtuals // override some base class virtuals
virtual bool Destroy(); virtual bool Destroy();
virtual bool IsTopLevel() const { return TRUE; } virtual bool IsTopLevel() const { return true; }
virtual wxSize GetMaxSize() const; virtual wxSize GetMaxSize() const;
// event handlers // event handlers
@@ -204,21 +204,21 @@ protected:
// test whether this window makes part of the frame // test whether this window makes part of the frame
// (menubar, toolbar and statusbar are excluded from automatic layout) // (menubar, toolbar and statusbar are excluded from automatic layout)
virtual bool IsOneOfBars(const wxWindow *WXUNUSED(win)) const virtual bool IsOneOfBars(const wxWindow *WXUNUSED(win)) const
{ return FALSE; } { return false; }
// check if we should exit the program after deleting this top level // check if we should exit the program after deleting this top level
// window (this is used in common dtor and wxMSW code) // window (this is used in common dtor and wxMSW code)
bool IsLastBeforeExit() const; bool IsLastBeforeExit() const;
// send the iconize event, return TRUE if processed // send the iconize event, return true if processed
bool SendIconizeEvent(bool iconized = TRUE); bool SendIconizeEvent(bool iconized = true);
// Get the default size for the new window if no explicit size given. If // Get the default size for the new window if no explicit size given. If
// there are better default sizes then these can be changed, just as long // there are better default sizes then these can be changed, just as long
// as they are not too small for TLWs (and not larger than screen). // as they are not too small for TLWs (and not larger than screen).
static wxSize GetDefaultSize(); static wxSize GetDefaultSize();
static int WidthDefault(int w) { return w == -1 ? GetDefaultSize().x : w; } static int WidthDefault(int w) { return w == wxDefaultCoord ? GetDefaultSize().x : w; }
static int HeightDefault(int h) { return h == -1 ? GetDefaultSize().y : h; } static int HeightDefault(int h) { return h == wxDefaultCoord ? GetDefaultSize().y : h; }
// the frame icon // the frame icon
wxIconBundle m_icons; wxIconBundle m_icons;

View File

@@ -330,57 +330,57 @@ END_DECLARE_EVENT_TYPES()
// //
// if you call event.Allow(), the drag operation will start and a // if you call event.Allow(), the drag operation will start and a
// EVT_TREE_END_DRAG event will be sent when the drag is over. // EVT_TREE_END_DRAG event will be sent when the drag is over.
#define EVT_TREE_BEGIN_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_BEGIN_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_BEGIN_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
#define EVT_TREE_BEGIN_RDRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_BEGIN_RDRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
// GetItem() is the item on which the drop occured (if any) and GetPoint() the // GetItem() is the item on which the drop occured (if any) and GetPoint() the
// current mouse coords // current mouse coords
#define EVT_TREE_END_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_END_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_END_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_END_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
// GetItem() returns the itme whose label is being edited, GetLabel() returns // GetItem() returns the itme whose label is being edited, GetLabel() returns
// the current item label for BEGIN and the would be new one for END. // the current item label for BEGIN and the would be new one for END.
// //
// Vetoing BEGIN event means that label editing won't happen at all, // Vetoing BEGIN event means that label editing won't happen at all,
// vetoing END means that the new value is discarded and the old one kept // vetoing END means that the new value is discarded and the old one kept
#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
#define EVT_TREE_END_LABEL_EDIT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_END_LABEL_EDIT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
// provide/update information about GetItem() item // provide/update information about GetItem() item
#define EVT_TREE_GET_INFO(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_GET_INFO(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_GET_INFO, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
#define EVT_TREE_SET_INFO(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_SET_INFO(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_SET_INFO, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
// GetItem() is the item being expanded/collapsed, the "ING" versions can use // GetItem() is the item being expanded/collapsed, the "ING" versions can use
#define EVT_TREE_ITEM_EXPANDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_ITEM_EXPANDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
#define EVT_TREE_ITEM_EXPANDING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_ITEM_EXPANDING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
#define EVT_TREE_ITEM_COLLAPSED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_ITEM_COLLAPSED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
#define EVT_TREE_ITEM_COLLAPSING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ), #define EVT_TREE_ITEM_COLLAPSING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
// GetOldItem() is the item which had the selection previously, GetItem() is // GetOldItem() is the item which had the selection previously, GetItem() is
// the item which acquires selection // the item which acquires selection
#define EVT_TREE_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ), #define EVT_TREE_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_SEL_CHANGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
#define EVT_TREE_SEL_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ), #define EVT_TREE_SEL_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_SEL_CHANGING, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
// GetKeyCode() returns the key code // GetKeyCode() returns the key code
// NB: this is the only message for which GetItem() is invalid (you may get the // NB: this is the only message for which GetItem() is invalid (you may get the
// item from GetSelection()) // item from GetSelection())
#define EVT_TREE_KEY_DOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ), #define EVT_TREE_KEY_DOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_KEY_DOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
// GetItem() returns the item being deleted, the associated data (if any) will // GetItem() returns the item being deleted, the associated data (if any) will
// be deleted just after the return of this event handler (if any) // be deleted just after the return of this event handler (if any)
#define EVT_TREE_DELETE_ITEM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_DELETE_ITEM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_DELETE_ITEM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
// GetItem() returns the item that was activated (double click, enter, space) // GetItem() returns the item that was activated (double click, enter, space)
#define EVT_TREE_ITEM_ACTIVATED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ), #define EVT_TREE_ITEM_ACTIVATED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
// GetItem() returns the item that was clicked on // GetItem() returns the item that was clicked on
#define EVT_TREE_ITEM_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ), #define EVT_TREE_ITEM_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
#define EVT_TREE_ITEM_MIDDLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ), #define EVT_TREE_ITEM_MIDDLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
// GetItem() returns the item whose state image was clicked on // GetItem() returns the item whose state image was clicked on
#define EVT_TREE_STATE_IMAGE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ), #define EVT_TREE_STATE_IMAGE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
// GetItem() is the item for which the tooltip is being requested // GetItem() is the item for which the tooltip is being requested
#define EVT_TREE_ITEM_GETTOOLTIP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ), #define EVT_TREE_ITEM_GETTOOLTIP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
#endif // wxUSE_TREECTRL #endif // wxUSE_TREECTRL

View File

@@ -6,7 +6,7 @@
// Created: 28/06/1998 // Created: 28/06/1998
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Guilhem Lavaux // Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TXTSTREAM_H_ #ifndef _WX_TXTSTREAM_H_
@@ -32,7 +32,7 @@ WXDLLIMPEXP_BASE wxTextOutputStream &endl( wxTextOutputStream &stream );
#define wxEOT wxT('\4') // the End-Of-Text control code (used only inside wxTextInputStream) #define wxEOT wxT('\4') // the End-Of-Text control code (used only inside wxTextInputStream)
// If you're scanning through a file using wxTextInputStream, you should check for EOF _before_ // If you're scanning through a file using wxTextInputStream, you should check for EOF _before_
// reading the next item (word / number), because otherwise the last item may get lost. // reading the next item (word / number), because otherwise the last item may get lost.
// You should however be prepared to receive an empty item (empty string / zero number) at the // You should however be prepared to receive an empty item (empty string / zero number) at the
// end of file, especially on Windows systems. This is unavoidable because most (but not all) files end // end of file, especially on Windows systems. This is unavoidable because most (but not all) files end
// with whitespace (i.e. usually a newline). // with whitespace (i.e. usually a newline).
@@ -77,7 +77,7 @@ protected:
wxInputStream &m_input; wxInputStream &m_input;
wxString m_separators; wxString m_separators;
char m_lastBytes[10]; // stores the bytes that were read for the last character char m_lastBytes[10]; // stores the bytes that were read for the last character
#if wxUSE_UNICODE #if wxUSE_UNICODE
wxMBConv &m_conv; wxMBConv &m_conv;
#endif #endif
@@ -136,7 +136,7 @@ public:
protected: protected:
wxOutputStream &m_output; wxOutputStream &m_output;
wxEOL m_mode; wxEOL m_mode;
#if wxUSE_UNICODE #if wxUSE_UNICODE
wxMBConv &m_conv; wxMBConv &m_conv;
#endif #endif

View File

@@ -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_TYPESH__ #ifndef _WX_TYPESH__

View File

@@ -87,7 +87,7 @@ protected:
friend class wxURLNativeImp; friend class wxURLNativeImp;
// pointer to a native URL implementation object // pointer to a native URL implementation object
wxURLNativeImp *m_nativeImp; wxURLNativeImp *m_nativeImp;
// Creates on the heap and returns a native // Creates on the heap and returns a native
// implementation object for the current platform. // implementation object for the current platform.
static wxURLNativeImp *CreateNativeImpObject(); static wxURLNativeImp *CreateNativeImpObject();
#endif #endif

View File

@@ -18,7 +18,7 @@
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__) #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__)
// Some older compilers (such as EMX) cannot handle // Some older compilers (such as EMX) cannot handle
// #pragma interface/implementation correctly, iff // #pragma interface/implementation correctly, iff
// #pragma implementation is used in _two_ translation // #pragma implementation is used in _two_ translation
// units (as created by e.g. event.cpp compiled for // units (as created by e.g. event.cpp compiled for
// libwx_base and event.cpp compiled for libwx_gui_core). // libwx_base and event.cpp compiled for libwx_gui_core).
@@ -272,17 +272,17 @@ WXDLLIMPEXP_BASE unsigned long wxGetProcessId();
WXDLLIMPEXP_BASE long wxGetFreeMemory(); WXDLLIMPEXP_BASE long wxGetFreeMemory();
// should wxApp::OnFatalException() be called? // should wxApp::OnFatalException() be called?
WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = TRUE); WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = true);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Environment variables // Environment variables
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// returns TRUE if variable exists (value may be NULL if you just want to check // returns true if variable exists (value may be NULL if you just want to check
// for this) // for this)
WXDLLIMPEXP_BASE bool wxGetEnv(const wxString& var, wxString *value); WXDLLIMPEXP_BASE bool wxGetEnv(const wxString& var, wxString *value);
// set the env var name to the given value, return TRUE on success // set the env var name to the given value, return true on success
WXDLLIMPEXP_BASE bool wxSetEnv(const wxString& var, const wxChar *value); WXDLLIMPEXP_BASE bool wxSetEnv(const wxString& var, const wxChar *value);
// remove the env var from environment // remove the env var from environment
@@ -349,7 +349,7 @@ WXDLLEXPORT wxAcceleratorEntry *wxGetAccelFromString(const wxString& label);
// Window search // Window search
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Returns menu item id or -1 if none. // Returns menu item id or wxNOT_FOUND if none.
WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString); WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString);
// Find the wxWindow at the given point. wxGenericFindWindowAtPoint // Find the wxWindow at the given point. wxGenericFindWindowAtPoint
@@ -374,10 +374,10 @@ WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Yield to other apps/messages and disable user input // Yield to other apps/messages and disable user input
WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL, bool onlyIfNeeded = FALSE); WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL, bool onlyIfNeeded = false);
// Enable or disable input to all top level windows // Enable or disable input to all top level windows
WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = TRUE); WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = true);
// Check whether this window wants to process messages, e.g. Stop button // Check whether this window wants to process messages, e.g. Stop button
// in long calculations. // in long calculations.
@@ -412,7 +412,7 @@ WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
// Restore cursor to normal // Restore cursor to normal
WXDLLEXPORT void wxEndBusyCursor(); WXDLLEXPORT void wxEndBusyCursor();
// TRUE if we're between the above two calls // true if we're between the above two calls
WXDLLEXPORT bool wxIsBusy(); WXDLLEXPORT bool wxIsBusy();
// Convenience class so we can just create a wxBusyCursor object on the stack // Convenience class so we can just create a wxBusyCursor object on the stack

View File

@@ -50,5 +50,5 @@ void wxTaskBarIconBase::OnRightButtonDown(wxTaskBarIconEvent& WXUNUSED(event))
delete menu; delete menu;
} }
} }
#endif // defined(wxHAS_TASK_BAR_ICON) #endif // defined(wxHAS_TASK_BAR_ICON)

View File

@@ -59,7 +59,7 @@ WX_DEFINE_LIST(wxToolBarToolsList);
// wxToolBarToolBase // wxToolBarToolBase
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxToolBarToolBase, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxToolBarToolBase, wxObject)
bool wxToolBarToolBase::Enable(bool enable) bool wxToolBarToolBase::Enable(bool enable)
{ {
@@ -592,7 +592,7 @@ void wxToolBarBase::OnRightClick(int id,
} }
// Called when the mouse cursor enters a tool bitmap (no button pressed). // Called when the mouse cursor enters a tool bitmap (no button pressed).
// Argument is -1 if mouse is exiting the toolbar. // Argument is wxID_ANY if mouse is exiting the toolbar.
// Note that for this event, the id of the window is used, // Note that for this event, the id of the window is used,
// and the integer parameter of wxCommandEvent is used to retrieve // and the integer parameter of wxCommandEvent is used to retrieve
// the tool id. // the tool id.
@@ -605,9 +605,9 @@ void wxToolBarBase::OnMouseEnter(int id)
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
if( frame ) if( frame )
{ {
wxToolBarToolBase* tool = id == -1 ? (wxToolBarToolBase*)0 : FindById(id); wxToolBarToolBase* tool = id == wxID_ANY ? (wxToolBarToolBase*)0 : FindById(id);
wxString help = tool ? tool->GetLongHelp() : wxString(); wxString help = tool ? tool->GetLongHelp() : wxString();
frame->DoGiveHelp( help, id != -1 ); frame->DoGiveHelp( help, id != wxID_ANY );
} }
(void)GetEventHandler()->ProcessEvent(event); (void)GetEventHandler()->ProcessEvent(event);

View File

@@ -143,7 +143,7 @@ wxTextBuffer::wxTextBuffer(const wxString& strBufferName)
: m_strBufferName(strBufferName) : m_strBufferName(strBufferName)
{ {
m_nCurLine = 0; m_nCurLine = 0;
m_isOpened = FALSE; m_isOpened = false;
} }
wxTextBuffer::~wxTextBuffer() wxTextBuffer::~wxTextBuffer()
@@ -172,13 +172,13 @@ bool wxTextBuffer::Create()
wxASSERT( !m_strBufferName.IsEmpty() ); wxASSERT( !m_strBufferName.IsEmpty() );
// if the buffer already exists do nothing // if the buffer already exists do nothing
if ( Exists() ) return FALSE; if ( Exists() ) return false;
if ( !OnOpen(m_strBufferName, WriteAccess) ) if ( !OnOpen(m_strBufferName, WriteAccess) )
return FALSE; return false;
OnClose(); OnClose();
return TRUE; return true;
} }
bool wxTextBuffer::Open(const wxString& strBufferName, wxMBConv& conv) bool wxTextBuffer::Open(const wxString& strBufferName, wxMBConv& conv)
@@ -195,7 +195,7 @@ bool wxTextBuffer::Open(wxMBConv& conv)
// open buffer in read-only mode // open buffer in read-only mode
if ( !OnOpen(m_strBufferName, ReadAccess) ) if ( !OnOpen(m_strBufferName, ReadAccess) )
return FALSE; return false;
// read buffer into memory // read buffer into memory
m_isOpened = OnRead(conv); m_isOpened = OnRead(conv);
@@ -275,9 +275,9 @@ bool wxTextBuffer::Close()
m_aTypes.Clear(); m_aTypes.Clear();
m_aLines.Clear(); m_aLines.Clear();
m_nCurLine = 0; m_nCurLine = 0;
m_isOpened = FALSE; m_isOpened = false;
return TRUE; return true;
} }
bool wxTextBuffer::Write(wxTextFileType typeNew, wxMBConv& conv) bool wxTextBuffer::Write(wxTextFileType typeNew, wxMBConv& conv)

View File

@@ -128,27 +128,27 @@ wxTextAttr wxTextAttr::Combine(const wxTextAttr& attr,
} }
wxTextAttr newAttr(colFg, colBg, font); wxTextAttr newAttr(colFg, colBg, font);
if (attr.HasAlignment()) if (attr.HasAlignment())
newAttr.SetAlignment(attr.GetAlignment()); newAttr.SetAlignment(attr.GetAlignment());
else if (attrDef.HasAlignment()) else if (attrDef.HasAlignment())
newAttr.SetAlignment(attrDef.GetAlignment()); newAttr.SetAlignment(attrDef.GetAlignment());
if (attr.HasTabs()) if (attr.HasTabs())
newAttr.SetTabs(attr.GetTabs()); newAttr.SetTabs(attr.GetTabs());
else if (attrDef.HasTabs()) else if (attrDef.HasTabs())
newAttr.SetTabs(attrDef.GetTabs()); newAttr.SetTabs(attrDef.GetTabs());
if (attr.HasLeftIndent()) if (attr.HasLeftIndent())
newAttr.SetLeftIndent(attr.GetLeftIndent(), attr.GetLeftSubIndent()); newAttr.SetLeftIndent(attr.GetLeftIndent(), attr.GetLeftSubIndent());
else if (attrDef.HasLeftIndent()) else if (attrDef.HasLeftIndent())
newAttr.SetLeftIndent(attrDef.GetLeftIndent(), attr.GetLeftSubIndent()); newAttr.SetLeftIndent(attrDef.GetLeftIndent(), attr.GetLeftSubIndent());
if (attr.HasRightIndent()) if (attr.HasRightIndent())
newAttr.SetRightIndent(attr.GetRightIndent()); newAttr.SetRightIndent(attr.GetRightIndent());
else if (attrDef.HasRightIndent()) else if (attrDef.HasRightIndent())
newAttr.SetRightIndent(attrDef.GetRightIndent()); newAttr.SetRightIndent(attrDef.GetRightIndent());
return newAttr; return newAttr;
} }
@@ -171,14 +171,14 @@ bool wxTextCtrlBase::SetStyle(long WXUNUSED(start), long WXUNUSED(end),
const wxTextAttr& WXUNUSED(style)) const wxTextAttr& WXUNUSED(style))
{ {
// to be implemented in derived TextCtrl classes // to be implemented in derived TextCtrl classes
return FALSE; return false;
} }
// get the styling at the given position // get the styling at the given position
bool wxTextCtrlBase::GetStyle(long WXUNUSED(position), wxTextAttr& WXUNUSED(style)) bool wxTextCtrlBase::GetStyle(long WXUNUSED(position), wxTextAttr& WXUNUSED(style))
{ {
// to be implemented in derived TextCtrl classes // to be implemented in derived TextCtrl classes
return FALSE; return false;
} }
// change default text attributes // change default text attributes
@@ -192,7 +192,7 @@ bool wxTextCtrlBase::SetDefaultStyle(const wxTextAttr& style)
else else
m_defaultStyle = wxTextAttr::Combine(style, m_defaultStyle, this); m_defaultStyle = wxTextAttr::Combine(style, m_defaultStyle, this);
return TRUE; return true;
} }
// get default text attributes // get default text attributes
@@ -220,14 +220,14 @@ bool wxTextCtrlBase::LoadFile(const wxString& filename)
m_filename = filename; m_filename = filename;
return TRUE; return true;
} }
} }
wxLogError(_("File couldn't be loaded.")); wxLogError(_("File couldn't be loaded."));
#endif // wxUSE_FFILE #endif // wxUSE_FFILE
return FALSE; return false;
} }
bool wxTextCtrlBase::SaveFile(const wxString& filename) bool wxTextCtrlBase::SaveFile(const wxString& filename)
@@ -238,7 +238,7 @@ bool wxTextCtrlBase::SaveFile(const wxString& filename)
// what kind of message to give? is it an error or a program bug? // what kind of message to give? is it an error or a program bug?
wxLogDebug(wxT("Can't save textctrl to file without filename.")); wxLogDebug(wxT("Can't save textctrl to file without filename."));
return FALSE; return false;
} }
#if wxUSE_FFILE #if wxUSE_FFILE
@@ -251,13 +251,13 @@ bool wxTextCtrlBase::SaveFile(const wxString& filename)
// if it worked, save for future calls // if it worked, save for future calls
m_filename = filenameToUse; m_filename = filenameToUse;
return TRUE; return true;
} }
#endif // wxUSE_FFILE #endif // wxUSE_FFILE
wxLogError(_("The text couldn't be saved.")); wxLogError(_("The text couldn't be saved."));
return FALSE; return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -355,7 +355,7 @@ bool wxTextCtrlBase::CanPaste() const
// the generic version is unused in wxMSW // the generic version is unused in wxMSW
bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& WXUNUSED(event)) bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& WXUNUSED(event))
{ {
return FALSE; return false;
} }
#else // !__WIN32__ #else // !__WIN32__
bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event) bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
@@ -443,10 +443,10 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
{ {
WriteText(ch); WriteText(ch);
return TRUE; return true;
} }
return FALSE; return false;
} }
#endif // !__WIN32__ #endif // !__WIN32__
@@ -483,12 +483,12 @@ void wxTextCtrlBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
{ {
if ( event.GetSetEnabled() ) if ( event.GetSetEnabled() )
Enable(event.GetEnabled()); Enable(event.GetEnabled());
if ( event.GetSetText() ) if ( event.GetSetText() )
{ {
if ( event.GetText() != GetValue() ) if ( event.GetText() != GetValue() )
SetValue(event.GetText()); SetValue(event.GetText());
} }
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -102,25 +102,25 @@ bool wxTextFile::OnRead(wxMBConv& conv)
strPtr = strBuf = new char[1024]; strPtr = strBuf = new char[1024];
strEnd = strBuf + 1024; strEnd = strBuf + 1024;
do do
{ {
nRead = m_file.Read(buf, WXSIZEOF(buf)); nRead = m_file.Read(buf, WXSIZEOF(buf));
if ( nRead == wxInvalidOffset ) if ( nRead == wxInvalidOffset )
{ {
// read error (error message already given in wxFile::Read) // read error (error message already given in wxFile::Read)
delete[] strBuf; delete[] strBuf;
return FALSE; return false;
} }
for (n = 0; n < nRead; n++) for (n = 0; n < nRead; n++)
{ {
ch = buf[n]; ch = buf[n];
switch ( ch ) switch ( ch )
{ {
case '\n': case '\n':
// Dos/Unix line termination // Dos/Unix line termination
*strPtr = '\0'; *strPtr = '\0';
AddLine(wxString(strBuf, conv), AddLine(wxString(strBuf, conv),
chLast == '\r' ? wxTextFileType_Dos chLast == '\r' ? wxTextFileType_Dos
: wxTextFileType_Unix); : wxTextFileType_Unix);
strPtr = strBuf; strPtr = strBuf;
@@ -128,7 +128,7 @@ bool wxTextFile::OnRead(wxMBConv& conv)
break; break;
case '\r': case '\r':
if ( chLast == '\r' ) if ( chLast == '\r' )
{ {
// Mac empty line // Mac empty line
AddLine(wxEmptyString, wxTextFileType_Mac); AddLine(wxEmptyString, wxTextFileType_Mac);
@@ -147,7 +147,7 @@ bool wxTextFile::OnRead(wxMBConv& conv)
strPtr = strBuf; strPtr = strBuf;
*(strPtr++) = ch; *(strPtr++) = ch;
} }
else else
{ {
// add to the current line // add to the current line
*(strPtr++) = ch; *(strPtr++) = ch;
@@ -168,15 +168,15 @@ bool wxTextFile::OnRead(wxMBConv& conv)
} while ( nRead == WXSIZEOF(buf) ); } while ( nRead == WXSIZEOF(buf) );
// anything in the last line? // anything in the last line?
if ( strPtr != strBuf ) if ( strPtr != strBuf )
{ {
*strPtr = '\0'; *strPtr = '\0';
AddLine(wxString(strBuf, conv), AddLine(wxString(strBuf, conv),
wxTextFileType_None); // no line terminator wxTextFileType_None); // no line terminator
} }
delete[] strBuf; delete[] strBuf;
return TRUE; return true;
} }
@@ -194,7 +194,7 @@ bool wxTextFile::OnWrite(wxTextFileType typeNew, wxMBConv& conv)
if ( !fileTmp.IsOpened() ) { if ( !fileTmp.IsOpened() ) {
wxLogError(_("can't write buffer '%s' to disk."), m_strBufferName.c_str()); wxLogError(_("can't write buffer '%s' to disk."), m_strBufferName.c_str());
return FALSE; return false;
} }
size_t nCount = GetLineCount(); size_t nCount = GetLineCount();

View File

@@ -85,7 +85,7 @@ bool wxTimerBase::Start(int milliseconds, bool oneShot)
m_oneShot = oneShot; m_oneShot = oneShot;
return TRUE; return true;
} }
#endif // wxUSE_TIMER #endif // wxUSE_TIMER

View File

@@ -102,11 +102,11 @@ void wxStringTokenizer::Reinit(const wxString& str)
// do we have more of them? // do we have more of them?
bool wxStringTokenizer::HasMoreTokens() const bool wxStringTokenizer::HasMoreTokens() const
{ {
wxCHECK_MSG( IsOk(), FALSE, _T("you should call SetString() first") ); wxCHECK_MSG( IsOk(), false, _T("you should call SetString() first") );
if ( m_string.find_first_not_of(m_delims) == wxString::npos ) if ( m_string.find_first_not_of(m_delims) == wxString::npos )
{ {
// no non empty tokens left, but in 2 cases we still may return TRUE if // no non empty tokens left, but in 2 cases we still may return true if
// GetNextToken() wasn't called yet for this empty token: // GetNextToken() wasn't called yet for this empty token:
// //
// a) in wxTOKEN_RET_EMPTY_ALL mode we always do it // a) in wxTOKEN_RET_EMPTY_ALL mode we always do it
@@ -115,13 +115,13 @@ bool wxStringTokenizer::HasMoreTokens() const
// token just before it // token just before it
return (m_mode == wxTOKEN_RET_EMPTY_ALL) || return (m_mode == wxTOKEN_RET_EMPTY_ALL) ||
(m_mode == wxTOKEN_RET_EMPTY && m_pos == 0) (m_mode == wxTOKEN_RET_EMPTY && m_pos == 0)
? m_hasMore : FALSE; ? m_hasMore : false;
} }
else else
{ {
// there are non delimiter characters left, hence we do have more // there are non delimiter characters left, hence we do have more
// tokens // tokens
return TRUE; return true;
} }
} }
@@ -181,7 +181,7 @@ wxString wxStringTokenizer::GetNextToken()
// no more tokens in this string, even in wxTOKEN_RET_EMPTY_ALL // no more tokens in this string, even in wxTOKEN_RET_EMPTY_ALL
// mode (we will return the trailing one right now in this case) // mode (we will return the trailing one right now in this case)
m_hasMore = FALSE; m_hasMore = false;
} }
else else
{ {

View File

@@ -67,7 +67,7 @@ wxTopLevelWindowBase::~wxTopLevelWindowBase()
bool shouldExit = IsLastBeforeExit(); bool shouldExit = IsLastBeforeExit();
wxTopLevelWindows.DeleteObject(this); wxTopLevelWindows.DeleteObject(this);
if ( shouldExit ) if ( shouldExit )
{ {
// then do it // then do it
@@ -88,12 +88,12 @@ bool wxTopLevelWindowBase::Destroy()
// not be done if this TLW is the // not be done if this TLW is the
// only one left since we then would // only one left since we then would
// risk not to get any idle events // risk not to get any idle events
// at all anymore during which we // at all anymore during which we
// could delete any pending events. // could delete any pending events.
Hide(); Hide();
} }
return TRUE; return true;
} }
bool wxTopLevelWindowBase::IsLastBeforeExit() const bool wxTopLevelWindowBase::IsLastBeforeExit() const
@@ -116,10 +116,10 @@ wxSize wxTopLevelWindowBase::GetMaxSize() const
wxClientDisplayRect( 0, 0, &w, &h ); wxClientDisplayRect( 0, 0, &w, &h );
if( size.GetWidth() == -1 ) if( size.GetWidth() == wxDefaultCoord )
size.SetWidth( w ); size.SetWidth( w );
if( size.GetHeight() == -1 ) if( size.GetHeight() == wxDefaultCoord )
size.SetHeight( h ); size.SetHeight( h );
return size; return size;
@@ -257,7 +257,7 @@ void wxTopLevelWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
{ {
if ( event.GetSetEnabled() ) if ( event.GetSetEnabled() )
Enable(event.GetEnabled()); Enable(event.GetEnabled());
if ( event.GetSetText() ) if ( event.GetSetText() )
{ {
if ( event.GetText() != GetTitle() ) if ( event.GetText() != GetTitle() )

View File

@@ -75,7 +75,7 @@ wxTreeEvent::wxTreeEvent(wxEventType commandType, int id)
: wxNotifyEvent(commandType, id) : wxNotifyEvent(commandType, id)
{ {
m_itemOld = 0l; m_itemOld = 0l;
m_editCancelled = FALSE; m_editCancelled = false;
} }
#endif // wxUSE_TREECTRL #endif // wxUSE_TREECTRL

View File

@@ -70,14 +70,14 @@ wxChar wxTextInputStream::NextChar()
#if wxUSE_UNICODE #if wxUSE_UNICODE
wxChar wbuf[2]; wxChar wbuf[2];
memset((void*)m_lastBytes, 0, 10); memset((void*)m_lastBytes, 0, 10);
for(size_t inlen = 0; inlen < 9; inlen++) for(size_t inlen = 0; inlen < 9; inlen++)
{ {
// actually read the next character // actually read the next character
m_lastBytes[inlen] = m_input.GetC(); m_lastBytes[inlen] = m_input.GetC();
if(m_input.LastRead() <= 0) if(m_input.LastRead() <= 0)
return wxEOT; return wxEOT;
int retlen = (int) m_conv.MB2WC(wbuf, m_lastBytes, 2); // returns -1 for failure int retlen = (int) m_conv.MB2WC(wbuf, m_lastBytes, 2); // returns -1 for failure
if(retlen >= 0) // res == 0 could happen for '\0' char if(retlen >= 0) // res == 0 could happen for '\0' char
return wbuf[0]; return wbuf[0];
@@ -86,13 +86,13 @@ wxChar wxTextInputStream::NextChar()
return wxEOT; return wxEOT;
#else #else
m_lastBytes[0] = m_input.GetC(); m_lastBytes[0] = m_input.GetC();
if(m_input.LastRead() <= 0) if(m_input.LastRead() <= 0)
return wxEOT; return wxEOT;
return m_lastBytes[0]; return m_lastBytes[0];
#endif #endif
} }
wxChar wxTextInputStream::NextNonSeparators() wxChar wxTextInputStream::NextNonSeparators()
@@ -112,18 +112,18 @@ wxChar wxTextInputStream::NextNonSeparators()
bool wxTextInputStream::EatEOL(const wxChar &c) bool wxTextInputStream::EatEOL(const wxChar &c)
{ {
if (c == wxT('\n')) return TRUE; // eat on UNIX if (c == wxT('\n')) return true; // eat on UNIX
if (c == wxT('\r')) // eat on both Mac and DOS if (c == wxT('\r')) // eat on both Mac and DOS
{ {
wxChar c2 = NextChar(); wxChar c2 = NextChar();
if(c2 == wxEOT) return TRUE; // end of stream reached, had enough :-) if(c2 == wxEOT) return true; // end of stream reached, had enough :-)
if (c2 != wxT('\n')) UngetLast(); // Don't eat on Mac if (c2 != wxT('\n')) UngetLast(); // Don't eat on Mac
return TRUE; return true;
} }
return FALSE; return false;
} }
wxUint32 wxTextInputStream::Read32(int base) wxUint32 wxTextInputStream::Read32(int base)
@@ -191,7 +191,7 @@ wxString wxTextInputStream::ReadLine()
wxChar c = NextChar(); wxChar c = NextChar();
if(c == wxEOT) if(c == wxEOT)
break; break;
if ( !m_input ) if ( !m_input )
break; break;
@@ -216,13 +216,13 @@ wxString wxTextInputStream::ReadWord()
return word; return word;
word += c; word += c;
while ( !m_input.Eof() ) while ( !m_input.Eof() )
{ {
c = NextChar(); c = NextChar();
if(c == wxEOT) if(c == wxEOT)
break; break;
if (m_separators.Contains(c)) if (m_separators.Contains(c))
break; break;
@@ -421,7 +421,7 @@ wxTextOutputStream& wxTextOutputStream::operator<<(const wxString& string)
wxTextOutputStream& wxTextOutputStream::operator<<(char c) wxTextOutputStream& wxTextOutputStream::operator<<(char c)
{ {
WriteString( wxString::FromAscii(c) ); WriteString( wxString::FromAscii(c) );
return *this; return *this;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -107,21 +107,21 @@ typedef voidp unzFile;
/* tm_unz contain date/time info */ /* tm_unz contain date/time info */
typedef struct tm_unz_s typedef struct tm_unz_s
{ {
uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_sec; /* seconds after the minute - [0,59] */
uInt tm_min; /* minutes after the hour - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */
uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_hour; /* hours since midnight - [0,23] */
uInt tm_mday; /* day of the month - [1,31] */ uInt tm_mday; /* day of the month - [1,31] */
uInt tm_mon; /* months since January - [0,11] */ uInt tm_mon; /* months since January - [0,11] */
uInt tm_year; /* years - [1980..2044] */ uInt tm_year; /* years - [1980..2044] */
} tm_unz; } tm_unz;
/* unz_global_info structure contain global data about the ZIPfile /* unz_global_info structure contain global data about the ZIPfile
These data comes from the end of central dir */ These data comes from the end of central dir */
typedef struct unz_global_info_s typedef struct unz_global_info_s
{ {
uLong number_entry; /* total number of entries in uLong number_entry; /* total number of entries in
the central dir on this disk */ the central dir on this disk */
uLong size_comment; /* size of the global comment of the zipfile */ uLong size_comment; /* size of the global comment of the zipfile */
} unz_global_info; } unz_global_info;
@@ -148,15 +148,16 @@ typedef struct unz_file_info_s
} unz_file_info; } unz_file_info;
extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
const char* fileName2, const char* fileName2,
int iCaseSensitivity)); int iCaseSensitivity));
/* /*
Compare two filename (fileName1,fileName2). Compare two filename (fileName1,fileName2).
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) If iCaseSenisivity = 1, comparision is case sensitivity
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi (like strcmp)
or strcasecmp) If iCaseSenisivity = 2, comparision is not case sensitivity
(like strcmpi or strcasecmp)
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
(like 1 on Unix, 2 on Windows) (like 1 on Unix, 2 on Windows)
*/ */
@@ -164,11 +165,11 @@ extern unzFile ZEXPORT unzOpen OF((const char *path));
/* /*
Open a Zip file. path contain the full pathname (by example, Open a Zip file. path contain the full pathname (by example,
on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
"zlib/zlib111.zip". "zlib/zlib111.zip".
If the zipfile cannot be opened (file don't exist or in not valid), the If the zipfile cannot be opened (file don't exist or in not valid), the
return value is NULL. return value is NULL.
Else, the return value is a unzFile Handle, usable with other function Else, the return value is a unzFile Handle, usable with other function
of this unzip package. of this unzip package.
*/ */
extern int ZEXPORT unzClose OF((unzFile file)); extern int ZEXPORT unzClose OF((unzFile file));
@@ -179,7 +180,7 @@ extern int ZEXPORT unzClose OF((unzFile file));
return UNZ_OK if there is no problem. */ return UNZ_OK if there is no problem. */
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
unz_global_info *pglobal_info)); unz_global_info *pglobal_info));
/* /*
Write info about the ZipFile in the *pglobal_info structure. Write info about the ZipFile in the *pglobal_info structure.
No preparation of the structure is needed No preparation of the structure is needed
@@ -187,8 +188,8 @@ extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
extern int ZEXPORT unzGetGlobalComment OF((unzFile file, extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
char *szComment, char *szComment,
uLong uSizeBuf)); uLong uSizeBuf));
/* /*
Get the global comment string of the ZipFile, in the szComment buffer. Get the global comment string of the ZipFile, in the szComment buffer.
uSizeBuf is the size of the szComment buffer. uSizeBuf is the size of the szComment buffer.
@@ -213,8 +214,8 @@ extern int ZEXPORT unzGoToNextFile OF((unzFile file));
*/ */
extern int ZEXPORT unzLocateFile OF((unzFile file, extern int ZEXPORT unzLocateFile OF((unzFile file,
const char *szFileName, const char *szFileName,
int iCaseSensitivity)); int iCaseSensitivity));
/* /*
Try locate the file szFileName in the zipfile. Try locate the file szFileName in the zipfile.
For the iCaseSensitivity signification, see unzStringFileNameCompare For the iCaseSensitivity signification, see unzStringFileNameCompare
@@ -226,24 +227,24 @@ extern int ZEXPORT unzLocateFile OF((unzFile file,
extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
unz_file_info *pfile_info, unz_file_info *pfile_info,
char *szFileName, char *szFileName,
uLong fileNameBufferSize, uLong fileNameBufferSize,
void *extraField, void *extraField,
uLong extraFieldBufferSize, uLong extraFieldBufferSize,
char *szComment, char *szComment,
uLong commentBufferSize)); uLong commentBufferSize));
/* /*
Get Info about the current file Get Info about the current file
if pfile_info!=NULL, the *pfile_info structure will contain somes info about if pfile_info!=NULL, the *pfile_info structure will contain somes info about
the current file the current file
if szFileName!=NULL, the filemane string will be copied in szFileName if szFileName!=NULL, the filemane string will be copied in szFileName
(fileNameBufferSize is the size of the buffer) (fileNameBufferSize is the size of the buffer)
if extraField!=NULL, the extra field information will be copied in extraField if extraField!=NULL, the extra field information will be copied in extraField
(extraFieldBufferSize is the size of the buffer). (extraFieldBufferSize is the size of the buffer).
This is the Central-header version of the extra field This is the Central-header version of the extra field
if szComment!=NULL, the comment string of the file will be copied in szComment if szComment!=NULL, the comment string of the file will be copied in szComment
(commentBufferSize is the size of the buffer) (commentBufferSize is the size of the buffer)
*/ */
/***************************************************************************/ /***************************************************************************/
@@ -263,10 +264,10 @@ extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
Return UNZ_CRCERROR if all the file was read but the CRC is not good Return UNZ_CRCERROR if all the file was read but the CRC is not good
*/ */
extern int ZEXPORT unzReadCurrentFile OF((unzFile file, extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
voidp buf, voidp buf,
unsigned len)); unsigned len));
/* /*
Read bytes from the current file (opened by unzOpenCurrentFile) Read bytes from the current file (opened by unzOpenCurrentFile)
buf contain buffer where data must be copied buf contain buffer where data must be copied
@@ -289,8 +290,8 @@ extern int ZEXPORT unzeof OF((unzFile file));
*/ */
extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
voidp buf, voidp buf,
unsigned len)); unsigned len));
/* /*
Read extra field from the current file (opened by unzOpenCurrentFile) Read extra field from the current file (opened by unzOpenCurrentFile)
This is the local-header version of the extra field (sometimes, there is This is the local-header version of the extra field (sometimes, there is
@@ -299,9 +300,9 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
if buf==NULL, it return the size of the local extra field if buf==NULL, it return the size of the local extra field
if buf!=NULL, len is the size of the buffer, the extra header is copied in if buf!=NULL, len is the size of the buffer, the extra header is copied in
buf. buf.
the return value is the number of bytes copied in buf, or (if <0) the return value is the number of bytes copied in buf, or (if <0)
the error code the error code
*/ */
#if defined(__VISAGECPP__) || defined(__BORLANDC__) #if defined(__VISAGECPP__) || defined(__BORLANDC__)

View File

@@ -45,7 +45,7 @@ USE_PROTOCOL(wxHTTP)
USE_PROTOCOL(wxFTP) USE_PROTOCOL(wxFTP)
wxHTTP *wxURL::ms_proxyDefault = NULL; wxHTTP *wxURL::ms_proxyDefault = NULL;
bool wxURL::ms_useDefaultProxy = FALSE; bool wxURL::ms_useDefaultProxy = false;
#endif #endif
// -------------------------------------------------------------- // --------------------------------------------------------------
@@ -73,7 +73,7 @@ wxURL::wxURL(const wxString& url)
if ( !ms_proxyDefault ) if ( !ms_proxyDefault )
{ {
// don't try again // don't try again
ms_useDefaultProxy = FALSE; ms_useDefaultProxy = false;
} }
} }
@@ -98,14 +98,14 @@ bool wxURL::ParseURL()
if (!PrepProto(last_url)) if (!PrepProto(last_url))
{ {
m_error = wxURL_SNTXERR; m_error = wxURL_SNTXERR;
return FALSE; return false;
} }
// Find and create the protocol object // Find and create the protocol object
if (!FetchProtocol()) if (!FetchProtocol())
{ {
m_error = wxURL_NOPROTO; m_error = wxURL_NOPROTO;
return FALSE; return false;
} }
// Do we need a host name ? // Do we need a host name ?
@@ -115,7 +115,7 @@ bool wxURL::ParseURL()
if (!PrepHost(last_url)) if (!PrepHost(last_url))
{ {
m_error = wxURL_SNTXERR; m_error = wxURL_SNTXERR;
return FALSE; return false;
} }
} }
@@ -123,7 +123,7 @@ bool wxURL::ParseURL()
if (!PrepPath(last_url)) if (!PrepPath(last_url))
{ {
m_error = wxURL_NOPATH; m_error = wxURL_NOPATH;
return FALSE; return false;
} }
} }
// URL parse finished. // URL parse finished.
@@ -147,7 +147,7 @@ bool wxURL::ParseURL()
#endif #endif
m_error = wxURL_NOERR; m_error = wxURL_NOERR;
return TRUE; return true;
} }
void wxURL::CleanData() void wxURL::CleanData()
@@ -180,14 +180,14 @@ bool wxURL::PrepProto(wxString& url)
// Find end // Find end
pos = url.Find(wxT(':')); pos = url.Find(wxT(':'));
if (pos == -1) if (pos == wxNOT_FOUND)
return FALSE; return false;
m_protoname = url(0, pos); m_protoname = url(0, pos);
url = url(pos+1, url.Length()); url = url(pos+1, url.Length());
return TRUE; return true;
} }
bool wxURL::PrepHost(wxString& url) bool wxURL::PrepHost(wxString& url)
@@ -196,51 +196,51 @@ bool wxURL::PrepHost(wxString& url)
int pos, pos2; int pos, pos2;
if ((url.GetChar(0) != wxT('/')) || (url.GetChar(1) != wxT('/'))) if ((url.GetChar(0) != wxT('/')) || (url.GetChar(1) != wxT('/')))
return FALSE; return false;
url = url(2, url.Length()); url = url(2, url.Length());
pos = url.Find(wxT('/')); pos = url.Find(wxT('/'));
if (pos == -1) if (pos == wxNOT_FOUND)
pos = url.Length(); pos = url.Length();
if (pos == 0) if (pos == 0)
return FALSE; return false;
temp_url = url(0, pos); temp_url = url(0, pos);
url = url(url.Find(wxT('/')), url.Length()); url = url(url.Find(wxT('/')), url.Length());
// Retrieve service number // Retrieve service number
pos2 = temp_url.Find(wxT(':'), TRUE); pos2 = temp_url.Find(wxT(':'), true);
if (pos2 != -1 && pos2 < pos) if (pos2 != wxNOT_FOUND && pos2 < pos)
{ {
m_servname = temp_url(pos2+1, pos); m_servname = temp_url(pos2+1, pos);
if (!m_servname.IsNumber()) if (!m_servname.IsNumber())
return FALSE; return false;
temp_url = temp_url(0, pos2); temp_url = temp_url(0, pos2);
} }
// Retrieve user and password. // Retrieve user and password.
pos2 = temp_url.Find(wxT('@')); pos2 = temp_url.Find(wxT('@'));
// Even if pos2 equals -1, this code is right. // Even if pos2 equals wxNOT_FOUND, this code is right.
m_hostname = temp_url(pos2+1, temp_url.Length()); m_hostname = temp_url(pos2+1, temp_url.Length());
m_user = wxT(""); m_user = wxT("");
m_password = wxT(""); m_password = wxT("");
if (pos2 == -1) if (pos2 == wxNOT_FOUND)
return TRUE; return true;
temp_url = temp_url(0, pos2); temp_url = temp_url(0, pos2);
pos2 = temp_url.Find(wxT(':')); pos2 = temp_url.Find(wxT(':'));
if (pos2 == -1) if (pos2 == wxNOT_FOUND)
return FALSE; return false;
m_user = temp_url(0, pos2); m_user = temp_url(0, pos2);
m_password = temp_url(pos2+1, url.Length()); m_password = temp_url(pos2+1, url.Length());
return TRUE; return true;
} }
bool wxURL::PrepPath(wxString& url) bool wxURL::PrepPath(wxString& url)
@@ -249,7 +249,7 @@ bool wxURL::PrepPath(wxString& url)
m_path = ConvertToValidURI(url); m_path = ConvertToValidURI(url);
else else
m_path = wxT("/"); m_path = wxT("/");
return TRUE; return true;
} }
bool wxURL::FetchProtocol() bool wxURL::FetchProtocol()
@@ -265,11 +265,11 @@ bool wxURL::FetchProtocol()
m_protoinfo = info; m_protoinfo = info;
m_protocol = (wxProtocol *)m_protoinfo->m_cinfo->CreateObject(); m_protocol = (wxProtocol *)m_protoinfo->m_cinfo->CreateObject();
return TRUE; return true;
} }
info = info->next; info = info->next;
} }
return FALSE; return false;
} }
// -------------------------------------------------------------- // --------------------------------------------------------------
@@ -318,7 +318,7 @@ wxInputStream *wxURL::GetInputStream()
addr.Service(m_servname); addr.Service(m_servname);
if (!m_protocol->Connect(addr, TRUE)) // Watcom needs the 2nd arg for some reason if (!m_protocol->Connect(addr, true)) // Watcom needs the 2nd arg for some reason
{ {
m_error = wxURL_CONNERR; m_error = wxURL_CONNERR;
return NULL; return NULL;
@@ -327,7 +327,7 @@ wxInputStream *wxURL::GetInputStream()
#endif #endif
// When we use a proxy, we have to pass the whole URL to it. // When we use a proxy, we have to pass the whole URL to it.
wxInputStream *the_i_stream = wxInputStream *the_i_stream =
(m_useProxy) ? m_protocol->GetInputStream(m_url) : (m_useProxy) ? m_protocol->GetInputStream(m_url) :
m_protocol->GetInputStream(m_path); m_protocol->GetInputStream(m_path);
@@ -356,7 +356,7 @@ void wxURL::SetDefaultProxy(const wxString& url_proxy)
{ {
wxString tmp_str = url_proxy; wxString tmp_str = url_proxy;
int pos = tmp_str.Find(wxT(':')); int pos = tmp_str.Find(wxT(':'));
if (pos == -1) if (pos == wxNOT_FOUND)
return; return;
wxString hostname = tmp_str(0, pos), wxString hostname = tmp_str(0, pos),
@@ -373,7 +373,7 @@ void wxURL::SetDefaultProxy(const wxString& url_proxy)
ms_proxyDefault->Close(); ms_proxyDefault->Close();
else else
ms_proxyDefault = new wxHTTP(); ms_proxyDefault = new wxHTTP();
ms_proxyDefault->Connect(addr, TRUE); // Watcom needs the 2nd arg for some reason ms_proxyDefault->Connect(addr, true); // Watcom needs the 2nd arg for some reason
} }
} }
@@ -387,7 +387,7 @@ void wxURL::SetProxy(const wxString& url_proxy)
delete m_proxy; delete m_proxy;
} }
m_useProxy = FALSE; m_useProxy = false;
} }
else else
{ {
@@ -399,7 +399,7 @@ void wxURL::SetProxy(const wxString& url_proxy)
tmp_str = url_proxy; tmp_str = url_proxy;
pos = tmp_str.Find(wxT(':')); pos = tmp_str.Find(wxT(':'));
// This is an invalid proxy name. // This is an invalid proxy name.
if (pos == -1) if (pos == wxNOT_FOUND)
return; return;
hostname = tmp_str(0, pos); hostname = tmp_str(0, pos);
@@ -412,11 +412,11 @@ void wxURL::SetProxy(const wxString& url_proxy)
if (m_proxy && m_proxy != ms_proxyDefault) if (m_proxy && m_proxy != ms_proxyDefault)
delete m_proxy; delete m_proxy;
m_proxy = new wxHTTP(); m_proxy = new wxHTTP();
m_proxy->Connect(addr, TRUE); // Watcom needs the 2nd arg for some reason m_proxy->Connect(addr, true); // Watcom needs the 2nd arg for some reason
CleanData(); CleanData();
// Reparse url. // Reparse url.
m_useProxy = TRUE; m_useProxy = true;
ParseURL(); ParseURL();
} }
} }
@@ -441,7 +441,7 @@ wxString wxURL::ConvertToValidURI(const wxString& uri, const wxChar* delims)
else else
{ {
// GRG, Apr/2000: modified according to the URI definition (RFC 2396) // GRG, Apr/2000: modified according to the URI definition (RFC 2396)
// //
// - Alphanumeric characters are never escaped // - Alphanumeric characters are never escaped
// - Unreserved marks are never escaped // - Unreserved marks are never escaped
// - Delimiters must be escaped if they appear within a component // - Delimiters must be escaped if they appear within a component
@@ -530,10 +530,10 @@ bool wxURLModule::OnInit()
if ( getenv("HTTP_PROXY") ) if ( getenv("HTTP_PROXY") )
{ {
wxURL::ms_useDefaultProxy = TRUE; wxURL::ms_useDefaultProxy = true;
} }
return TRUE; return true;
} }
void wxURLModule::OnExit() void wxURLModule::OnExit()

View File

@@ -322,12 +322,12 @@ bool wxGetEmailAddress(wxChar *address, int maxSize)
{ {
wxString email = wxGetEmailAddress(); wxString email = wxGetEmailAddress();
if ( !email ) if ( !email )
return FALSE; return false;
wxStrncpy(address, email, maxSize - 1); wxStrncpy(address, email, maxSize - 1);
address[maxSize - 1] = wxT('\0'); address[maxSize - 1] = wxT('\0');
return TRUE; return true;
} }
wxString wxGetEmailAddress() wxString wxGetEmailAddress()
@@ -335,10 +335,10 @@ wxString wxGetEmailAddress()
wxString email; wxString email;
wxString host = wxGetFullHostName(); wxString host = wxGetFullHostName();
if ( !!host ) if ( !host.IsEmpty() )
{ {
wxString user = wxGetUserId(); wxString user = wxGetUserId();
if ( !!user ) if ( !user.IsEmpty() )
{ {
email << user << wxT('@') << host; email << user << wxT('@') << host;
} }
@@ -447,18 +447,18 @@ wxString wxGetCurrentDir()
// wxDoExecuteWithCapture() helper: reads an entire stream into one array // wxDoExecuteWithCapture() helper: reads an entire stream into one array
// //
// returns TRUE if ok, FALSE if error // returns true if ok, false if error
#if wxUSE_STREAMS #if wxUSE_STREAMS
static bool ReadAll(wxInputStream *is, wxArrayString& output) static bool ReadAll(wxInputStream *is, wxArrayString& output)
{ {
wxCHECK_MSG( is, FALSE, _T("NULL stream in wxExecute()?") ); wxCHECK_MSG( is, false, _T("NULL stream in wxExecute()?") );
// the stream could be already at EOF or in wxSTREAM_BROKEN_PIPE state // the stream could be already at EOF or in wxSTREAM_BROKEN_PIPE state
is->Reset(); is->Reset();
wxTextInputStream tis(*is); wxTextInputStream tis(*is);
bool cont = TRUE; bool cont = true;
while ( cont ) while ( cont )
{ {
wxString line = tis.ReadLine(); wxString line = tis.ReadLine();
@@ -467,7 +467,7 @@ static bool ReadAll(wxInputStream *is, wxArrayString& output)
if ( !*is ) if ( !*is )
{ {
cont = FALSE; cont = false;
} }
else else
{ {
@@ -538,7 +538,7 @@ bool wxYield()
bool wxYieldIfNeeded() bool wxYieldIfNeeded()
{ {
return wxTheApp && wxTheApp->Yield(TRUE); return wxTheApp && wxTheApp->Yield(true);
} }
#endif // wxUSE_BASE #endif // wxUSE_BASE
@@ -660,7 +660,7 @@ wxFindWindowByName (const wxString& name, wxWindow * parent)
return wxWindow::FindWindowByName( name, parent ); return wxWindow::FindWindowByName( name, parent );
} }
// Returns menu item id or -1 if none. // Returns menu item id or wxNOT_FOUND if none.
int int
wxFindMenuItemId (wxFrame * frame, const wxString& menuString, const wxString& itemString) wxFindMenuItemId (wxFrame * frame, const wxString& menuString, const wxString& itemString)
{ {
@@ -670,7 +670,7 @@ wxFindMenuItemId (wxFrame * frame, const wxString& menuString, const wxString& i
return menuBar->FindMenuItem (menuString, itemString); return menuBar->FindMenuItem (menuString, itemString);
#endif // wxUSE_MENUS #endif // wxUSE_MENUS
return -1; return wxNOT_FOUND;
} }
// Try to find the deepest child that contains 'pt'. // Try to find the deepest child that contains 'pt'.
@@ -831,7 +831,7 @@ wxString wxGetPasswordFromUser(const wxString& message,
wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit) wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit)
{ {
wxColourData data; wxColourData data;
data.SetChooseFull(TRUE); data.SetChooseFull(true);
if ( colInit.Ok() ) if ( colInit.Ok() )
{ {
data.SetColour((wxColour &)colInit); // const_cast data.SetColour((wxColour &)colInit); // const_cast
@@ -951,7 +951,7 @@ bool wxSafeYield(wxWindow *win, bool onlyIfNeeded)
#ifndef __WXGTK__ #ifndef __WXGTK__
bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) ) bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) )
{ {
return TRUE; // detectable auto-repeat is the only mode MSW supports return true; // detectable auto-repeat is the only mode MSW supports
} }
#endif // !wxGTK #endif // !wxGTK