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

@@ -57,7 +57,7 @@ class WXDLLIMPEXP_ADV wxTaskBarIconEvent : public wxEvent
{
public:
wxTaskBarIconEvent(wxEventType evtType, wxTaskBarIcon *tbIcon)
: wxEvent(-1, evtType)
: wxEvent(wxID_ANY, evtType)
{
SetEventObject(tbIcon);
}
@@ -80,13 +80,13 @@ BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_RIGHT_DCLICK,1556)
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_LEFT_DOWN(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_DOWN, -1, -1, (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_RIGHT_DOWN(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_RIGHT_DOWN, -1, -1, (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_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_TASKBAR_LEFT_DCLICK, -1, -1, (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_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, wxID_ANY, wxID_ANY, (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, wxID_ANY, wxID_ANY, (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, wxID_ANY, wxID_ANY, (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
// wxHAS_TASK_BAR_ICON

View File

@@ -50,7 +50,7 @@ enum wxToolBarToolStyle
// ----------------------------------------------------------------------------
// 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
// 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
@@ -88,8 +88,8 @@ public:
m_kind = kind;
m_enabled = TRUE;
m_toggled = FALSE;
m_enabled = true;
m_toggled = false;
m_toolStyle = toolid == wxID_SEPARATOR ? wxTOOL_STYLE_SEPARATOR
: wxTOOL_STYLE_BUTTON;
@@ -103,8 +103,8 @@ public:
m_kind = wxITEM_MAX; // invalid value
m_enabled = TRUE;
m_toggled = FALSE;
m_enabled = true;
m_toggled = false;
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 Toggle(bool toggle);
bool SetToggle(bool toggle);
@@ -329,7 +329,7 @@ public:
virtual wxToolBarToolBase *AddTool (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
// its position/size)
//
@@ -375,7 +375,7 @@ public:
// returns tool pos, or wxNOT_FOUND if tool isn't found
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 GetToolEnabled(int toolid) const;
@@ -432,7 +432,7 @@ public:
// find the tool by id
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); }
@@ -443,7 +443,7 @@ public:
wxToolBarToolBase *AddTool(int toolid,
const wxBitmap& bitmap,
const wxBitmap& bmpDisabled,
bool toggle = FALSE,
bool toggle = false,
wxObject *clientData = NULL,
const wxString& shortHelpString = wxEmptyString,
const wxString& longHelpString = wxEmptyString)
@@ -469,7 +469,7 @@ public:
const wxBitmap& bmpDisabled,
bool toggle,
wxCoord xPos,
wxCoord yPos = -1,
wxCoord yPos = wxDefaultCoord,
wxObject *clientData = NULL,
const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString)
@@ -483,7 +483,7 @@ public:
int toolid,
const wxBitmap& bitmap,
const wxBitmap& bmpDisabled = wxNullBitmap,
bool toggle = FALSE,
bool toggle = false,
wxObject *clientData = NULL,
const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString)
@@ -498,14 +498,14 @@ public:
// 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);
// Call when right button down.
virtual void OnRightClick(int toolid, long x, long y);
// 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);
// more deprecated functions
@@ -523,7 +523,7 @@ public:
virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE) ;
// don't want toolbars to accept the focus
virtual bool AcceptsFocus() const { return FALSE; }
virtual bool AcceptsFocus() const { return false; }
protected:
// to implement in derived classes
@@ -541,8 +541,8 @@ protected:
const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString,
wxObject *clientData = NULL,
wxCoord xPos = -1,
wxCoord yPos = -1
wxCoord xPos = wxDefaultCoord,
wxCoord yPos = wxDefaultCoord
);
// the tool is not yet inserted into m_tools list when this function is

View File

@@ -307,7 +307,7 @@ public:
virtual void AppendText(const wxString& text) = 0;
// 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);
// text control under some platforms supports the text styles: these
@@ -466,10 +466,10 @@ public:
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_ENTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_ENTER, id, -1, (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_MAXLEN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_MAXLEN, 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, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & 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, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ),
#ifndef NO_TEXT_WINDOW_STREAM

View File

@@ -24,7 +24,7 @@ BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, 19)
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__)
#include "wx/msw/tglbtn.h"

View File

@@ -33,10 +33,10 @@
// more readable flags for Start():
// 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
#define wxTIMER_ONE_SHOT TRUE
#define wxTIMER_ONE_SHOT true
// the interface of wxTimer class
class WXDLLEXPORT wxTimerBase : public wxEvtHandler
@@ -52,11 +52,11 @@ public:
// ctor which allows to avoid having to override Notify() in the derived
// class: the owner will get timer notifications which can be handled with
// EVT_TIMER
wxTimerBase(wxEvtHandler *owner, int timerid = -1)
wxTimerBase(wxEvtHandler *owner, int timerid = wxID_ANY)
{ Init(); SetOwner(owner, timerid); }
// 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; }
wxEvtHandler* GetOwner() const { return m_owner; }
@@ -70,7 +70,7 @@ public:
//
// it is now valid to call Start() multiple times: this just restarts the
// 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
virtual void Stop() = 0;
@@ -82,13 +82,13 @@ public:
// getting info
// ------------
// return TRUE if the timer is running
// return true if the timer is running
virtual bool IsRunning() const = 0;
// get the (last) timer interval in the milliseconds
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; }
// return the timer ID
@@ -97,13 +97,13 @@ public:
protected:
// common part of all ctors
void Init() { m_oneShot = FALSE; m_milli = 0; }
void Init() { m_oneShot = false; m_milli = 0; }
wxEvtHandler *m_owner;
int m_idTimer;
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)
};
@@ -134,13 +134,13 @@ class WXDLLEXPORT wxTimerRunner
{
public:
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.Start(milli, oneShot);
}
void Start(int milli, bool oneShot = FALSE)
void Start(int milli, bool oneShot = false)
{
m_timer.Start(milli, oneShot);
}
@@ -188,7 +188,7 @@ private:
typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&);
#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

View File

@@ -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
// 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,
wxTipProvider *tipProvider,
bool showAtStartup = TRUE);
bool showAtStartup = true);
#endif // wxUSE_STARTUP_TIPS

View File

@@ -79,7 +79,7 @@ enum
const wxString& shortHelpString = 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);
}
@@ -95,7 +95,7 @@ enum
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);
}
@@ -107,7 +107,7 @@ enum
const wxBitmap& pushedBitmap,
bool toggle,
wxCoord xPos,
wxCoord yPos = -1,
wxCoord yPos = wxDefaultCoord,
wxObject *clientData = NULL,
const wxString& shortHelpString = wxEmptyString,
const wxString& longHelpString = wxEmptyString

View File

@@ -125,19 +125,19 @@ public:
// top level wnd state
// --------------------
// maximize = TRUE => maximize, otherwise - restore
virtual void Maximize(bool maximize = TRUE) = 0;
// maximize = true => maximize, otherwise - restore
virtual void Maximize(bool maximize = true) = 0;
// undo Maximize() or Iconize()
virtual void Restore() = 0;
// iconize = TRUE => iconize, otherwise - restore
virtual void Iconize(bool iconize = TRUE) = 0;
// iconize = true => iconize, otherwise - restore
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;
// return TRUE if the frame is iconized
// return true if the frame is iconized
virtual bool IsIconized() const = 0;
// get the frame icon
@@ -155,7 +155,7 @@ public:
// maximize the window to cover entire screen
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;
/*
@@ -167,9 +167,9 @@ public:
*/
// 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.)
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
// inactive (should be called when a background event occurs)
@@ -181,7 +181,7 @@ public:
// override some base class virtuals
virtual bool Destroy();
virtual bool IsTopLevel() const { return TRUE; }
virtual bool IsTopLevel() const { return true; }
virtual wxSize GetMaxSize() const;
// event handlers
@@ -204,21 +204,21 @@ protected:
// test whether this window makes part of the frame
// (menubar, toolbar and statusbar are excluded from automatic layout)
virtual bool IsOneOfBars(const wxWindow *WXUNUSED(win)) const
{ return FALSE; }
{ return false; }
// check if we should exit the program after deleting this top level
// window (this is used in common dtor and wxMSW code)
bool IsLastBeforeExit() const;
// send the iconize event, return TRUE if processed
bool SendIconizeEvent(bool iconized = TRUE);
// send the iconize event, return true if processed
bool SendIconizeEvent(bool iconized = true);
// 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
// as they are not too small for TLWs (and not larger than screen).
static wxSize GetDefaultSize();
static int WidthDefault(int w) { return w == -1 ? GetDefaultSize().x : w; }
static int HeightDefault(int h) { return h == -1 ? GetDefaultSize().y : h; }
static int WidthDefault(int w) { return w == wxDefaultCoord ? GetDefaultSize().x : w; }
static int HeightDefault(int h) { return h == wxDefaultCoord ? GetDefaultSize().y : h; }
// the frame icon
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
// 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_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_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, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
// GetItem() is the item on which the drop occured (if any) and GetPoint() the
// 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
// 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 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_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_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, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
// 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_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_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, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), (wxObject *) NULL ),
// 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_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_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_COLLAPSING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), 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, 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, 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, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
// GetOldItem() is the item which had the selection previously, GetItem() is
// 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_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TREE_SEL_CHANGING, 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, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
// GetKeyCode() returns the key code
// NB: this is the only message for which GetItem() is invalid (you may get the
// 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
// 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)
#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
#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_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_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, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTreeEventFunction, & fn ), NULL ),
// 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
#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

View File

@@ -272,17 +272,17 @@ WXDLLIMPEXP_BASE unsigned long wxGetProcessId();
WXDLLIMPEXP_BASE long wxGetFreeMemory();
// should wxApp::OnFatalException() be called?
WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = TRUE);
WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = true);
// ----------------------------------------------------------------------------
// 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)
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);
// remove the env var from environment
@@ -349,7 +349,7 @@ WXDLLEXPORT wxAcceleratorEntry *wxGetAccelFromString(const wxString& label);
// 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);
// 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
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
WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = TRUE);
WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = true);
// Check whether this window wants to process messages, e.g. Stop button
// in long calculations.
@@ -412,7 +412,7 @@ WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
// Restore cursor to normal
WXDLLEXPORT void wxEndBusyCursor();
// TRUE if we're between the above two calls
// true if we're between the above two calls
WXDLLEXPORT bool wxIsBusy();
// Convenience class so we can just create a wxBusyCursor object on the stack

View File

@@ -592,7 +592,7 @@ void wxToolBarBase::OnRightClick(int id,
}
// 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,
// and the integer parameter of wxCommandEvent is used to retrieve
// the tool id.
@@ -605,9 +605,9 @@ void wxToolBarBase::OnMouseEnter(int id)
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
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();
frame->DoGiveHelp( help, id != -1 );
frame->DoGiveHelp( help, id != wxID_ANY );
}
(void)GetEventHandler()->ProcessEvent(event);

View File

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

View File

@@ -171,14 +171,14 @@ bool wxTextCtrlBase::SetStyle(long WXUNUSED(start), long WXUNUSED(end),
const wxTextAttr& WXUNUSED(style))
{
// to be implemented in derived TextCtrl classes
return FALSE;
return false;
}
// get the styling at the given position
bool wxTextCtrlBase::GetStyle(long WXUNUSED(position), wxTextAttr& WXUNUSED(style))
{
// to be implemented in derived TextCtrl classes
return FALSE;
return false;
}
// change default text attributes
@@ -192,7 +192,7 @@ bool wxTextCtrlBase::SetDefaultStyle(const wxTextAttr& style)
else
m_defaultStyle = wxTextAttr::Combine(style, m_defaultStyle, this);
return TRUE;
return true;
}
// get default text attributes
@@ -220,14 +220,14 @@ bool wxTextCtrlBase::LoadFile(const wxString& filename)
m_filename = filename;
return TRUE;
return true;
}
}
wxLogError(_("File couldn't be loaded."));
#endif // wxUSE_FFILE
return FALSE;
return false;
}
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?
wxLogDebug(wxT("Can't save textctrl to file without filename."));
return FALSE;
return false;
}
#if wxUSE_FFILE
@@ -251,13 +251,13 @@ bool wxTextCtrlBase::SaveFile(const wxString& filename)
// if it worked, save for future calls
m_filename = filenameToUse;
return TRUE;
return true;
}
#endif // wxUSE_FFILE
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
bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& WXUNUSED(event))
{
return FALSE;
return false;
}
#else // !__WIN32__
bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
@@ -443,10 +443,10 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
{
WriteText(ch);
return TRUE;
return true;
}
return FALSE;
return false;
}
#endif // !__WIN32__

View File

@@ -109,7 +109,7 @@ bool wxTextFile::OnRead(wxMBConv& conv)
{
// read error (error message already given in wxFile::Read)
delete[] strBuf;
return FALSE;
return false;
}
for (n = 0; n < nRead; n++)
@@ -176,7 +176,7 @@ bool wxTextFile::OnRead(wxMBConv& conv)
}
delete[] strBuf;
return TRUE;
return true;
}
@@ -194,7 +194,7 @@ bool wxTextFile::OnWrite(wxTextFileType typeNew, wxMBConv& conv)
if ( !fileTmp.IsOpened() ) {
wxLogError(_("can't write buffer '%s' to disk."), m_strBufferName.c_str());
return FALSE;
return false;
}
size_t nCount = GetLineCount();

View File

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

View File

@@ -102,11 +102,11 @@ void wxStringTokenizer::Reinit(const wxString& str)
// do we have more of them?
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 )
{
// 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:
//
// a) in wxTOKEN_RET_EMPTY_ALL mode we always do it
@@ -115,13 +115,13 @@ bool wxStringTokenizer::HasMoreTokens() const
// token just before it
return (m_mode == wxTOKEN_RET_EMPTY_ALL) ||
(m_mode == wxTOKEN_RET_EMPTY && m_pos == 0)
? m_hasMore : FALSE;
? m_hasMore : false;
}
else
{
// there are non delimiter characters left, hence we do have more
// tokens
return TRUE;
return true;
}
}
@@ -181,7 +181,7 @@ wxString wxStringTokenizer::GetNextToken()
// no more tokens in this string, even in wxTOKEN_RET_EMPTY_ALL
// mode (we will return the trailing one right now in this case)
m_hasMore = FALSE;
m_hasMore = false;
}
else
{

View File

@@ -93,7 +93,7 @@ bool wxTopLevelWindowBase::Destroy()
Hide();
}
return TRUE;
return true;
}
bool wxTopLevelWindowBase::IsLastBeforeExit() const
@@ -116,10 +116,10 @@ wxSize wxTopLevelWindowBase::GetMaxSize() const
wxClientDisplayRect( 0, 0, &w, &h );
if( size.GetWidth() == -1 )
if( size.GetWidth() == wxDefaultCoord )
size.SetWidth( w );
if( size.GetHeight() == -1 )
if( size.GetHeight() == wxDefaultCoord )
size.SetHeight( h );
return size;

View File

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

View File

@@ -112,18 +112,18 @@ wxChar wxTextInputStream::NextNonSeparators()
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
{
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
return TRUE;
return true;
}
return FALSE;
return false;
}
wxUint32 wxTextInputStream::Read32(int base)

View File

@@ -152,9 +152,10 @@ extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
int iCaseSensitivity));
/*
Compare two filename (fileName1,fileName2).
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
or strcasecmp)
If iCaseSenisivity = 1, comparision is case sensitivity
(like strcmp)
If iCaseSenisivity = 2, comparision is not case sensitivity
(like strcmpi or strcasecmp)
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
(like 1 on Unix, 2 on Windows)
*/

View File

@@ -45,7 +45,7 @@ USE_PROTOCOL(wxHTTP)
USE_PROTOCOL(wxFTP)
wxHTTP *wxURL::ms_proxyDefault = NULL;
bool wxURL::ms_useDefaultProxy = FALSE;
bool wxURL::ms_useDefaultProxy = false;
#endif
// --------------------------------------------------------------
@@ -73,7 +73,7 @@ wxURL::wxURL(const wxString& url)
if ( !ms_proxyDefault )
{
// don't try again
ms_useDefaultProxy = FALSE;
ms_useDefaultProxy = false;
}
}
@@ -98,14 +98,14 @@ bool wxURL::ParseURL()
if (!PrepProto(last_url))
{
m_error = wxURL_SNTXERR;
return FALSE;
return false;
}
// Find and create the protocol object
if (!FetchProtocol())
{
m_error = wxURL_NOPROTO;
return FALSE;
return false;
}
// Do we need a host name ?
@@ -115,7 +115,7 @@ bool wxURL::ParseURL()
if (!PrepHost(last_url))
{
m_error = wxURL_SNTXERR;
return FALSE;
return false;
}
}
@@ -123,7 +123,7 @@ bool wxURL::ParseURL()
if (!PrepPath(last_url))
{
m_error = wxURL_NOPATH;
return FALSE;
return false;
}
}
// URL parse finished.
@@ -147,7 +147,7 @@ bool wxURL::ParseURL()
#endif
m_error = wxURL_NOERR;
return TRUE;
return true;
}
void wxURL::CleanData()
@@ -180,14 +180,14 @@ bool wxURL::PrepProto(wxString& url)
// Find end
pos = url.Find(wxT(':'));
if (pos == -1)
return FALSE;
if (pos == wxNOT_FOUND)
return false;
m_protoname = url(0, pos);
url = url(pos+1, url.Length());
return TRUE;
return true;
}
bool wxURL::PrepHost(wxString& url)
@@ -196,51 +196,51 @@ bool wxURL::PrepHost(wxString& url)
int pos, pos2;
if ((url.GetChar(0) != wxT('/')) || (url.GetChar(1) != wxT('/')))
return FALSE;
return false;
url = url(2, url.Length());
pos = url.Find(wxT('/'));
if (pos == -1)
if (pos == wxNOT_FOUND)
pos = url.Length();
if (pos == 0)
return FALSE;
return false;
temp_url = url(0, pos);
url = url(url.Find(wxT('/')), url.Length());
// Retrieve service number
pos2 = temp_url.Find(wxT(':'), TRUE);
if (pos2 != -1 && pos2 < pos)
pos2 = temp_url.Find(wxT(':'), true);
if (pos2 != wxNOT_FOUND && pos2 < pos)
{
m_servname = temp_url(pos2+1, pos);
if (!m_servname.IsNumber())
return FALSE;
return false;
temp_url = temp_url(0, pos2);
}
// Retrieve user and password.
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_user = wxT("");
m_password = wxT("");
if (pos2 == -1)
return TRUE;
if (pos2 == wxNOT_FOUND)
return true;
temp_url = temp_url(0, pos2);
pos2 = temp_url.Find(wxT(':'));
if (pos2 == -1)
return FALSE;
if (pos2 == wxNOT_FOUND)
return false;
m_user = temp_url(0, pos2);
m_password = temp_url(pos2+1, url.Length());
return TRUE;
return true;
}
bool wxURL::PrepPath(wxString& url)
@@ -249,7 +249,7 @@ bool wxURL::PrepPath(wxString& url)
m_path = ConvertToValidURI(url);
else
m_path = wxT("/");
return TRUE;
return true;
}
bool wxURL::FetchProtocol()
@@ -265,11 +265,11 @@ bool wxURL::FetchProtocol()
m_protoinfo = info;
m_protocol = (wxProtocol *)m_protoinfo->m_cinfo->CreateObject();
return TRUE;
return true;
}
info = info->next;
}
return FALSE;
return false;
}
// --------------------------------------------------------------
@@ -318,7 +318,7 @@ wxInputStream *wxURL::GetInputStream()
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;
return NULL;
@@ -356,7 +356,7 @@ void wxURL::SetDefaultProxy(const wxString& url_proxy)
{
wxString tmp_str = url_proxy;
int pos = tmp_str.Find(wxT(':'));
if (pos == -1)
if (pos == wxNOT_FOUND)
return;
wxString hostname = tmp_str(0, pos),
@@ -373,7 +373,7 @@ void wxURL::SetDefaultProxy(const wxString& url_proxy)
ms_proxyDefault->Close();
else
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;
}
m_useProxy = FALSE;
m_useProxy = false;
}
else
{
@@ -399,7 +399,7 @@ void wxURL::SetProxy(const wxString& url_proxy)
tmp_str = url_proxy;
pos = tmp_str.Find(wxT(':'));
// This is an invalid proxy name.
if (pos == -1)
if (pos == wxNOT_FOUND)
return;
hostname = tmp_str(0, pos);
@@ -412,11 +412,11 @@ void wxURL::SetProxy(const wxString& url_proxy)
if (m_proxy && m_proxy != ms_proxyDefault)
delete m_proxy;
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();
// Reparse url.
m_useProxy = TRUE;
m_useProxy = true;
ParseURL();
}
}
@@ -530,10 +530,10 @@ bool wxURLModule::OnInit()
if ( getenv("HTTP_PROXY") )
{
wxURL::ms_useDefaultProxy = TRUE;
wxURL::ms_useDefaultProxy = true;
}
return TRUE;
return true;
}
void wxURLModule::OnExit()

View File

@@ -322,12 +322,12 @@ bool wxGetEmailAddress(wxChar *address, int maxSize)
{
wxString email = wxGetEmailAddress();
if ( !email )
return FALSE;
return false;
wxStrncpy(address, email, maxSize - 1);
address[maxSize - 1] = wxT('\0');
return TRUE;
return true;
}
wxString wxGetEmailAddress()
@@ -335,10 +335,10 @@ wxString wxGetEmailAddress()
wxString email;
wxString host = wxGetFullHostName();
if ( !!host )
if ( !host.IsEmpty() )
{
wxString user = wxGetUserId();
if ( !!user )
if ( !user.IsEmpty() )
{
email << user << wxT('@') << host;
}
@@ -447,18 +447,18 @@ wxString wxGetCurrentDir()
// 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
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
is->Reset();
wxTextInputStream tis(*is);
bool cont = TRUE;
bool cont = true;
while ( cont )
{
wxString line = tis.ReadLine();
@@ -467,7 +467,7 @@ static bool ReadAll(wxInputStream *is, wxArrayString& output)
if ( !*is )
{
cont = FALSE;
cont = false;
}
else
{
@@ -538,7 +538,7 @@ bool wxYield()
bool wxYieldIfNeeded()
{
return wxTheApp && wxTheApp->Yield(TRUE);
return wxTheApp && wxTheApp->Yield(true);
}
#endif // wxUSE_BASE
@@ -660,7 +660,7 @@ wxFindWindowByName (const wxString& name, wxWindow * parent)
return wxWindow::FindWindowByName( name, parent );
}
// Returns menu item id or -1 if none.
// Returns menu item id or wxNOT_FOUND if none.
int
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);
#endif // wxUSE_MENUS
return -1;
return wxNOT_FOUND;
}
// 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)
{
wxColourData data;
data.SetChooseFull(TRUE);
data.SetChooseFull(true);
if ( colInit.Ok() )
{
data.SetColour((wxColour &)colInit); // const_cast
@@ -951,7 +951,7 @@ bool wxSafeYield(wxWindow *win, bool onlyIfNeeded)
#ifndef __WXGTK__
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