Source cleaning: whitespaces, tabs, -1/wxDefaultCoord/wxID_ANY/wxNOT_FOUND, TRUE/true, FALSE/false.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
600902562d
commit
4e32eea148
@ -122,7 +122,7 @@ public:
|
||||
//!code: | -1 0 0 |
|
||||
//!code: matrix' = | 0 -1 0 | x matrix
|
||||
//!code: | 0 0 1 |
|
||||
wxTransformMatrix& Mirror(bool x=TRUE, bool y=FALSE);
|
||||
wxTransformMatrix& Mirror(bool x=true, bool y=false);
|
||||
// Translate by dx, dy:
|
||||
//!ex:
|
||||
//!code: | 1 0 dx |
|
||||
|
@ -31,8 +31,8 @@
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
|
||||
WXDLLIMPEXP_BASE void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool isVect = FALSE);
|
||||
WXDLLIMPEXP_BASE void wxDebugFree(void * buf, bool isVect = FALSE);
|
||||
WXDLLIMPEXP_BASE void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool isVect = false);
|
||||
WXDLLIMPEXP_BASE void wxDebugFree(void * buf, bool isVect = false);
|
||||
|
||||
//**********************************************************************************
|
||||
/*
|
||||
@ -72,33 +72,33 @@ WXDLLIMPEXP_BASE void wxDebugFree(void * buf, bool isVect = FALSE);
|
||||
|
||||
inline void * operator new (size_t size, wxChar * fileName, int lineNum)
|
||||
{
|
||||
return wxDebugAlloc(size, fileName, lineNum, FALSE, FALSE);
|
||||
return wxDebugAlloc(size, fileName, lineNum, false, false);
|
||||
}
|
||||
|
||||
inline void * operator new (size_t size)
|
||||
{
|
||||
return wxDebugAlloc(size, NULL, 0, FALSE);
|
||||
return wxDebugAlloc(size, NULL, 0, false);
|
||||
}
|
||||
|
||||
inline void operator delete (void * buf)
|
||||
{
|
||||
wxDebugFree(buf, FALSE);
|
||||
wxDebugFree(buf, false);
|
||||
}
|
||||
|
||||
#if wxUSE_ARRAY_MEMORY_OPERATORS
|
||||
inline void * operator new[] (size_t size)
|
||||
{
|
||||
return wxDebugAlloc(size, NULL, 0, FALSE, TRUE);
|
||||
return wxDebugAlloc(size, NULL, 0, false, true);
|
||||
}
|
||||
|
||||
inline void * operator new[] (size_t size, wxChar * fileName, int lineNum)
|
||||
{
|
||||
return wxDebugAlloc(size, fileName, lineNum, FALSE, TRUE);
|
||||
return wxDebugAlloc(size, fileName, lineNum, false, true);
|
||||
}
|
||||
|
||||
inline void operator delete[] (void * buf)
|
||||
{
|
||||
wxDebugFree(buf, TRUE);
|
||||
wxDebugFree(buf, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -106,11 +106,11 @@ inline void operator delete[] (void * buf)
|
||||
#if ( defined(__VISUALC__) && (__VISUALC__ >= 1200) ) || defined(__MWERKS__)
|
||||
inline void operator delete(void* pData, wxChar* /* fileName */, int /* lineNum */)
|
||||
{
|
||||
wxDebugFree(pData, FALSE);
|
||||
wxDebugFree(pData, false);
|
||||
}
|
||||
inline void operator delete[](void* pData, wxChar* /* fileName */, int /* lineNum */)
|
||||
{
|
||||
wxDebugFree(pData, TRUE);
|
||||
wxDebugFree(pData, true);
|
||||
}
|
||||
#endif // __VISUALC__>=1200
|
||||
#endif // wxUSE_GLOBAL_MEMORY_OPERATORS
|
||||
@ -236,7 +236,7 @@ public:
|
||||
static bool GetDebugMode(void) { return debugOn; }
|
||||
static void SetDebugMode(bool flag) { debugOn = flag; }
|
||||
|
||||
static void SetCheckpoint(bool all = FALSE);
|
||||
static void SetCheckpoint(bool all = false);
|
||||
static wxMemStruct *GetCheckpoint(void) { return checkPoint; }
|
||||
|
||||
// Calculated from the request size and any padding needed
|
||||
@ -270,8 +270,8 @@ public:
|
||||
static bool GetCheckPrevious () { return m_checkPrevious; }
|
||||
static void SetCheckPrevious (bool value) { m_checkPrevious = value; }
|
||||
|
||||
// Checks all nodes, or all nodes if checkAll is TRUE
|
||||
static int Check(bool checkAll = FALSE);
|
||||
// Checks all nodes, or all nodes if checkAll is true
|
||||
static int Check(bool checkAll = false);
|
||||
|
||||
// Print out the list of wxMemStruct nodes.
|
||||
static bool PrintList(void);
|
||||
@ -280,14 +280,14 @@ public:
|
||||
static bool Dump(void);
|
||||
|
||||
// Print statistics
|
||||
static bool PrintStatistics(bool detailed = TRUE);
|
||||
static bool PrintStatistics(bool detailed = true);
|
||||
|
||||
// Print out the classes in the application.
|
||||
static bool PrintClasses(void);
|
||||
|
||||
// Count the number of non-wxDebugContext-related objects
|
||||
// that are outstanding
|
||||
static int CountObjectsLeft(bool sinceCheckpoint = FALSE);
|
||||
static int CountObjectsLeft(bool sinceCheckpoint = false);
|
||||
|
||||
// This function is used to output the dump
|
||||
static void OutputDumpLine(const wxChar *szFormat, ...);
|
||||
@ -298,8 +298,8 @@ private:
|
||||
static wxMemStruct* m_head;
|
||||
static wxMemStruct* m_tail;
|
||||
|
||||
// Set to FALSE if we're not checking all previous nodes when
|
||||
// we do a new. Set to TRUE when we are.
|
||||
// Set to false if we're not checking all previous nodes when
|
||||
// we do a new. Set to true when we are.
|
||||
static bool m_checkPrevious;
|
||||
};
|
||||
|
||||
@ -349,8 +349,8 @@ void WXDLLIMPEXP_BASE wxTraceLevel(int level, const wxChar *fmt ...) ATTRIBUTE_P
|
||||
#define wxTraceLevel(l, fmt)
|
||||
#endif
|
||||
|
||||
#define WXTRACE TRUE ? (void)0 : wxTrace
|
||||
#define WXTRACELEVEL TRUE ? (void)0 : wxTraceLevel
|
||||
#define WXTRACE true ? (void)0 : wxTrace
|
||||
#define WXTRACELEVEL true ? (void)0 : wxTraceLevel
|
||||
|
||||
#endif // (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
|
||||
|
||||
|
@ -28,21 +28,21 @@ public:
|
||||
|
||||
protected:
|
||||
virtual bool OnExists() const
|
||||
{ return FALSE; }
|
||||
{ return false; }
|
||||
|
||||
virtual bool OnOpen(const wxString & WXUNUSED(strBufferName),
|
||||
wxTextBufferOpenMode WXUNUSED(OpenMode))
|
||||
{ return TRUE; }
|
||||
{ return true; }
|
||||
|
||||
virtual bool OnClose()
|
||||
{ return TRUE; }
|
||||
{ return true; }
|
||||
|
||||
virtual bool OnRead(wxMBConv& WXUNUSED(conv))
|
||||
{ return TRUE; }
|
||||
{ return true; }
|
||||
|
||||
virtual bool OnWrite(wxTextFileType WXUNUSED(typeNew),
|
||||
wxMBConv& WXUNUSED(conv) = wxConvUTF8)
|
||||
{ return TRUE; }
|
||||
{ return true; }
|
||||
|
||||
private:
|
||||
DECLARE_NO_COPY_CLASS(wxMemoryText)
|
||||
|
@ -294,8 +294,8 @@ public:
|
||||
// pos != NULL
|
||||
wxMenuItem *FindChildItem(int itemid, size_t *pos = NULL) const;
|
||||
|
||||
// called to generate a wxCommandEvent, return TRUE if it was processed,
|
||||
// FALSE otherwise
|
||||
// called to generate a wxCommandEvent, return true if it was processed,
|
||||
// false otherwise
|
||||
//
|
||||
// the checked parameter may have boolean value or -1 for uncheckable items
|
||||
bool SendEvent(int itemid, int checked = -1);
|
||||
@ -388,10 +388,10 @@ public:
|
||||
// menu bar construction
|
||||
// ---------------------
|
||||
|
||||
// append a menu to the end of menubar, return TRUE if ok
|
||||
// append a menu to the end of menubar, return true if ok
|
||||
virtual bool Append(wxMenu *menu, const wxString& title);
|
||||
|
||||
// insert a menu before the given position into the menubar, return TRUE
|
||||
// insert a menu before the given position into the menubar, return true
|
||||
// if inserted ok
|
||||
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
|
||||
|
||||
@ -416,7 +416,7 @@ public:
|
||||
virtual void EnableTop(size_t pos, bool enable) = 0;
|
||||
|
||||
// is the menu enabled?
|
||||
virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return TRUE; }
|
||||
virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return true; }
|
||||
|
||||
// get or change the label of the menu at given position
|
||||
virtual void SetLabelTop(size_t pos, const wxString& label) = 0;
|
||||
@ -462,7 +462,7 @@ public:
|
||||
// get the frame we are attached to (may return NULL)
|
||||
wxFrame *GetFrame() const { return m_menuBarFrame; }
|
||||
|
||||
// returns TRUE if we're attached to a frame
|
||||
// returns true if we're attached to a frame
|
||||
bool IsAttached() const { return GetFrame() != NULL; }
|
||||
|
||||
// associate the menubar with the frame
|
||||
@ -472,12 +472,12 @@ public:
|
||||
virtual void Detach();
|
||||
|
||||
// need to override these ones to avoid virtual function hiding
|
||||
virtual bool Enable(bool enable = TRUE) { return wxWindow::Enable(enable); }
|
||||
virtual bool Enable(bool enable = true) { return wxWindow::Enable(enable); }
|
||||
virtual void SetLabel(const wxString& s) { wxWindow::SetLabel(s); }
|
||||
virtual wxString GetLabel() const { return wxWindow::GetLabel(); }
|
||||
|
||||
// don't want menu bars to accept the focus by tabbing to them
|
||||
virtual bool AcceptsFocusFromKeyboard() const { return FALSE; }
|
||||
virtual bool AcceptsFocusFromKeyboard() const { return false; }
|
||||
|
||||
protected:
|
||||
// the list of all our menus
|
||||
|
@ -82,10 +82,10 @@ public:
|
||||
wxMenu *GetSubMenu() const { return m_subMenu; }
|
||||
|
||||
// state
|
||||
virtual void Enable(bool enable = TRUE) { m_isEnabled = enable; }
|
||||
virtual void Enable(bool enable = true) { m_isEnabled = enable; }
|
||||
virtual bool IsEnabled() const { return m_isEnabled; }
|
||||
|
||||
virtual void Check(bool check = TRUE) { m_isChecked = check; }
|
||||
virtual void Check(bool check = true) { m_isChecked = check; }
|
||||
virtual bool IsChecked() const { return m_isChecked; }
|
||||
void Toggle() { Check(!m_isChecked); }
|
||||
|
||||
@ -122,7 +122,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
int m_id; // numeric id of the item >= 0 or -1
|
||||
int m_id; // numeric id of the item >= 0 or wxID_ANY or wxID_SEPARATOR
|
||||
wxMenu *m_parentMenu, // the menu we belong to
|
||||
*m_subMenu; // our sub menu or NULL
|
||||
wxString m_text, // label of the item
|
||||
|
@ -234,9 +234,9 @@ public:
|
||||
const wxFileType::MessageParameters& params) const;
|
||||
|
||||
// set an arbitrary command, ask confirmation if it already exists and
|
||||
// overwriteprompt is TRUE
|
||||
// overwriteprompt is true
|
||||
bool SetCommand(const wxString& cmd, const wxString& verb,
|
||||
bool overwriteprompt = TRUE);
|
||||
bool overwriteprompt = true);
|
||||
|
||||
bool SetDefaultIcon(const wxString& cmd = wxEmptyString, int index = 0);
|
||||
|
||||
@ -290,7 +290,7 @@ public:
|
||||
// check if the given MIME type is the same as the other one: the
|
||||
// second argument may contain wildcards ('*'), but not the first. If
|
||||
// the types are equal or if the mimeType matches wildcard the function
|
||||
// returns TRUE, otherwise it returns FALSE
|
||||
// returns true, otherwise it returns false
|
||||
static bool IsOfType(const wxString& mimeType, const wxString& wildcard);
|
||||
|
||||
// ctor
|
||||
@ -319,7 +319,7 @@ public:
|
||||
// get file type from MIME type (in format <category>/<format>)
|
||||
wxFileType *GetFileTypeFromMimeType(const wxString& mimeType);
|
||||
|
||||
// other operations: return TRUE if there were no errors or FALSE if there
|
||||
// other operations: return true if there were no errors or false if there
|
||||
// were some unreckognized entries (the good entries are always read anyhow)
|
||||
//
|
||||
// FIXME: These ought to be private ??
|
||||
@ -327,12 +327,12 @@ public:
|
||||
// read in additional file (the standard ones are read automatically)
|
||||
// in mailcap format (see mimetype.cpp for description)
|
||||
//
|
||||
// 'fallback' parameter may be set to TRUE to avoid overriding the
|
||||
// 'fallback' parameter may be set to true to avoid overriding the
|
||||
// settings from other, previously parsed, files by this one: normally,
|
||||
// the files read most recently would override the older files, but with
|
||||
// fallback == TRUE this won't happen
|
||||
// fallback == true this won't happen
|
||||
|
||||
bool ReadMailcap(const wxString& filename, bool fallback = FALSE);
|
||||
bool ReadMailcap(const wxString& filename, bool fallback = false);
|
||||
// read in additional file in mime.types format
|
||||
bool ReadMimeTypes(const wxString& filename);
|
||||
|
||||
@ -343,7 +343,7 @@ public:
|
||||
|
||||
// these functions can be used to provide default values for some of the
|
||||
// MIME types inside the program itself (you may also use
|
||||
// ReadMailcap(filenameWithDefaultTypes, TRUE /* use as fallback */) to
|
||||
// ReadMailcap(filenameWithDefaultTypes, true /* use as fallback */) to
|
||||
// achieve the same goal, but this requires having this info in a file).
|
||||
//
|
||||
// The filetypes array should be terminated by either NULL entry or an
|
||||
|
@ -31,7 +31,7 @@ int WXDLLEXPORT wxMessageBox(const wxString& message,
|
||||
const wxString& caption = wxMessageBoxCaptionStr,
|
||||
long style = wxOK | wxCENTRE,
|
||||
wxWindow *parent = NULL,
|
||||
int x = -1, int y = -1);
|
||||
int x = wxDefaultCoord, int y = wxDefaultCoord);
|
||||
|
||||
#endif // wxUSE_MSGDLG
|
||||
|
||||
|
@ -33,7 +33,7 @@ static const double pi = 3.1415926535;
|
||||
|
||||
wxTransformMatrix::wxTransformMatrix(void)
|
||||
{
|
||||
m_isIdentity = FALSE;
|
||||
m_isIdentity = false;
|
||||
|
||||
Identity();
|
||||
}
|
||||
@ -76,8 +76,8 @@ void wxTransformMatrix::operator = (const wxTransformMatrix& mat)
|
||||
|
||||
bool wxTransformMatrix::operator == (const wxTransformMatrix& mat)
|
||||
{
|
||||
if (m_isIdentity==TRUE && mat.m_isIdentity==TRUE)
|
||||
return TRUE;
|
||||
if (m_isIdentity==true && mat.m_isIdentity==true)
|
||||
return true;
|
||||
|
||||
int i, j;
|
||||
for (i = 0; i < 3; i++)
|
||||
@ -85,10 +85,10 @@ bool wxTransformMatrix::operator == (const wxTransformMatrix& mat)
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
if (m_matrix[i][j] != mat.m_matrix[i][j])
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTransformMatrix::operator != (const wxTransformMatrix& mat)
|
||||
@ -147,11 +147,11 @@ bool wxTransformMatrix::Invert(void)
|
||||
}
|
||||
}
|
||||
m_isIdentity = IsIdentity1();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,9 +160,9 @@ bool wxTransformMatrix::Identity(void)
|
||||
{
|
||||
m_matrix[0][0] = m_matrix[1][1] = m_matrix[2][2] = 1.0;
|
||||
m_matrix[1][0] = m_matrix[2][0] = m_matrix[0][1] = m_matrix[2][1] = m_matrix[0][2] = m_matrix[1][2] = 0.0;
|
||||
m_isIdentity = TRUE;
|
||||
m_isIdentity = true;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Scale by scale (isotropic scaling i.e. the same in x and y):
|
||||
@ -182,7 +182,7 @@ bool wxTransformMatrix::Scale(double scale)
|
||||
}
|
||||
m_isIdentity = IsIdentity1();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -268,12 +268,12 @@ wxTransformMatrix& wxTransformMatrix::Mirror(bool x, bool y)
|
||||
if (x)
|
||||
{
|
||||
temp.m_matrix[1][1] = -1;
|
||||
temp.m_isIdentity=FALSE;
|
||||
temp.m_isIdentity=false;
|
||||
}
|
||||
if (y)
|
||||
{
|
||||
temp.m_matrix[0][0] = -1;
|
||||
temp.m_isIdentity=FALSE;
|
||||
temp.m_isIdentity=false;
|
||||
}
|
||||
|
||||
*this = temp * (*this);
|
||||
@ -296,7 +296,7 @@ bool wxTransformMatrix::Translate(double dx, double dy)
|
||||
|
||||
m_isIdentity = IsIdentity1();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Rotate clockwise by the given number of degrees:
|
||||
@ -306,7 +306,7 @@ bool wxTransformMatrix::Translate(double dx, double dy)
|
||||
bool wxTransformMatrix::Rotate(double degrees)
|
||||
{
|
||||
Rotate(-degrees,0,0);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// counter clockwise rotate around a point
|
||||
@ -384,13 +384,13 @@ bool wxTransformMatrix::TransformPoint(double x, double y, double& tx, double& t
|
||||
{
|
||||
if (IsIdentity())
|
||||
{
|
||||
tx = x; ty = y; return TRUE;
|
||||
tx = x; ty = y; return true;
|
||||
}
|
||||
|
||||
tx = x * m_matrix[0][0] + y * m_matrix[1][0] + m_matrix[2][0];
|
||||
ty = x * m_matrix[0][1] + y * m_matrix[1][1] + m_matrix[2][1];
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Transform a point from device to logical coordinates.
|
||||
@ -407,18 +407,18 @@ bool wxTransformMatrix::InverseTransformPoint(double x, double y, double& tx, do
|
||||
{
|
||||
if (IsIdentity())
|
||||
{
|
||||
tx = x; ty = y; return TRUE;
|
||||
tx = x; ty = y; return true;
|
||||
}
|
||||
|
||||
double z = (1.0 - m_matrix[0][2] * x - m_matrix[1][2] * y) / m_matrix[2][2];
|
||||
if (z == 0.0)
|
||||
{
|
||||
// z = 0.0000001;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
tx = x * m_matrix[0][0] + y * m_matrix[1][0] + z * m_matrix[2][0];
|
||||
ty = x * m_matrix[0][1] + y * m_matrix[1][1] + z * m_matrix[2][1];
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxTransformMatrix& wxTransformMatrix::operator*=(const double& t)
|
||||
|
@ -68,8 +68,8 @@ wxMenuItemBase::wxMenuItemBase(wxMenu *parentMenu,
|
||||
|
||||
m_parentMenu = parentMenu;
|
||||
m_subMenu = subMenu;
|
||||
m_isEnabled = TRUE;
|
||||
m_isChecked = FALSE;
|
||||
m_isEnabled = true;
|
||||
m_isChecked = false;
|
||||
m_id = id;
|
||||
m_kind = kind;
|
||||
if (m_id == wxID_ANY)
|
||||
@ -337,7 +337,7 @@ wxMenuItem* wxMenuBase::Insert(size_t pos, wxMenuItem *item)
|
||||
}
|
||||
else
|
||||
{
|
||||
wxCHECK_MSG( pos < GetMenuItemCount(), FALSE,
|
||||
wxCHECK_MSG( pos < GetMenuItemCount(), NULL,
|
||||
wxT("invalid index in wxMenu::Insert") );
|
||||
|
||||
return DoInsert(pos, item);
|
||||
@ -349,7 +349,7 @@ wxMenuItem* wxMenuBase::DoInsert(size_t pos, wxMenuItem *item)
|
||||
wxCHECK_MSG( item, NULL, wxT("invalid item in wxMenu::Insert()") );
|
||||
|
||||
wxMenuItemList::compatibility_iterator node = m_items.Item(pos);
|
||||
wxCHECK_MSG( node, FALSE, wxT("invalid index in wxMenu::Insert()") );
|
||||
wxCHECK_MSG( node, NULL, wxT("invalid index in wxMenu::Insert()") );
|
||||
|
||||
m_items.Insert(node, item);
|
||||
item->SetMenu((wxMenu*)this);
|
||||
@ -394,7 +394,7 @@ wxMenuItem *wxMenuBase::DoRemove(wxMenuItem *item)
|
||||
|
||||
bool wxMenuBase::Delete(wxMenuItem *item)
|
||||
{
|
||||
wxCHECK_MSG( item, FALSE, wxT("invalid item in wxMenu::Delete") );
|
||||
wxCHECK_MSG( item, false, wxT("invalid item in wxMenu::Delete") );
|
||||
|
||||
return DoDelete(item);
|
||||
}
|
||||
@ -402,19 +402,19 @@ bool wxMenuBase::Delete(wxMenuItem *item)
|
||||
bool wxMenuBase::DoDelete(wxMenuItem *item)
|
||||
{
|
||||
wxMenuItem *item2 = DoRemove(item);
|
||||
wxCHECK_MSG( item2, FALSE, wxT("failed to delete menu item") );
|
||||
wxCHECK_MSG( item2, false, wxT("failed to delete menu item") );
|
||||
|
||||
// don't delete the submenu
|
||||
item2->SetSubMenu((wxMenu *)NULL);
|
||||
|
||||
delete item2;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxMenuBase::Destroy(wxMenuItem *item)
|
||||
{
|
||||
wxCHECK_MSG( item, FALSE, wxT("invalid item in wxMenu::Destroy") );
|
||||
wxCHECK_MSG( item, false, wxT("invalid item in wxMenu::Destroy") );
|
||||
|
||||
return DoDestroy(item);
|
||||
}
|
||||
@ -422,18 +422,18 @@ bool wxMenuBase::Destroy(wxMenuItem *item)
|
||||
bool wxMenuBase::DoDestroy(wxMenuItem *item)
|
||||
{
|
||||
wxMenuItem *item2 = DoRemove(item);
|
||||
wxCHECK_MSG( item2, FALSE, wxT("failed to delete menu item") );
|
||||
wxCHECK_MSG( item2, false, wxT("failed to delete menu item") );
|
||||
|
||||
delete item2;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMenu searching for items
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Finds the item id matching the given string, -1 if not found.
|
||||
// Finds the item id matching the given string, wxNOT_FOUND if not found.
|
||||
int wxMenuBase::FindItem(const wxString& text) const
|
||||
{
|
||||
wxString label = wxMenuItem::GetLabelFromText(text);
|
||||
@ -591,7 +591,7 @@ bool wxMenuBase::SendEvent(int id, int checked)
|
||||
event.SetEventObject(this);
|
||||
event.SetInt(checked);
|
||||
|
||||
bool processed = FALSE;
|
||||
bool processed = false;
|
||||
|
||||
// Try the menu's event handler
|
||||
if ( !processed )
|
||||
@ -669,7 +669,7 @@ bool wxMenuBase::IsEnabled( int id ) const
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_MSG( item, FALSE, wxT("wxMenu::IsEnabled: no such item") );
|
||||
wxCHECK_MSG( item, false, wxT("wxMenu::IsEnabled: no such item") );
|
||||
|
||||
return item->IsEnabled();
|
||||
}
|
||||
@ -687,7 +687,7 @@ bool wxMenuBase::IsChecked( int id ) const
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_MSG( item, FALSE, wxT("wxMenu::IsChecked: no such item") );
|
||||
wxCHECK_MSG( item, false, wxT("wxMenu::IsChecked: no such item") );
|
||||
|
||||
return item->IsChecked();
|
||||
}
|
||||
@ -758,12 +758,12 @@ wxMenu *wxMenuBarBase::GetMenu(size_t pos) const
|
||||
|
||||
bool wxMenuBarBase::Append(wxMenu *menu, const wxString& WXUNUSED(title))
|
||||
{
|
||||
wxCHECK_MSG( menu, FALSE, wxT("can't append NULL menu") );
|
||||
wxCHECK_MSG( menu, false, wxT("can't append NULL menu") );
|
||||
|
||||
m_menus.Append(menu);
|
||||
menu->Attach(this);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxMenuBarBase::Insert(size_t pos, wxMenu *menu,
|
||||
@ -775,15 +775,15 @@ bool wxMenuBarBase::Insert(size_t pos, wxMenu *menu,
|
||||
}
|
||||
else // not at the end
|
||||
{
|
||||
wxCHECK_MSG( menu, FALSE, wxT("can't insert NULL menu") );
|
||||
wxCHECK_MSG( menu, false, wxT("can't insert NULL menu") );
|
||||
|
||||
wxMenuList::compatibility_iterator node = m_menus.Item(pos);
|
||||
wxCHECK_MSG( node, FALSE, wxT("bad index in wxMenuBar::Insert()") );
|
||||
wxCHECK_MSG( node, false, wxT("bad index in wxMenuBar::Insert()") );
|
||||
|
||||
m_menus.Insert(node, menu);
|
||||
menu->Attach(this);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -916,7 +916,7 @@ bool wxMenuBarBase::IsChecked(int id) const
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_MSG( item, FALSE, wxT("wxMenuBar::IsChecked(): no such item") );
|
||||
wxCHECK_MSG( item, false, wxT("wxMenuBar::IsChecked(): no such item") );
|
||||
|
||||
return item->IsChecked();
|
||||
}
|
||||
@ -925,7 +925,7 @@ bool wxMenuBarBase::IsEnabled(int id) const
|
||||
{
|
||||
wxMenuItem *item = FindItem(id);
|
||||
|
||||
wxCHECK_MSG( item, FALSE, wxT("wxMenuBar::IsEnabled(): no such item") );
|
||||
wxCHECK_MSG( item, false, wxT("wxMenuBar::IsEnabled(): no such item") );
|
||||
|
||||
return item->IsEnabled();
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ WX_DEFINE_OBJARRAY(wxArrayFileTypeInfo);
|
||||
wxString wxFileType::ExpandCommand(const wxString& command,
|
||||
const wxFileType::MessageParameters& params)
|
||||
{
|
||||
bool hasFilename = FALSE;
|
||||
bool hasFilename = false;
|
||||
|
||||
wxString str;
|
||||
for ( const wxChar *pc = command.c_str(); *pc != wxT('\0'); pc++ ) {
|
||||
@ -144,7 +144,7 @@ wxString wxFileType::ExpandCommand(const wxString& command,
|
||||
str << wxT('"') << params.GetFileName() << wxT('"');
|
||||
#endif
|
||||
str << params.GetFileName();
|
||||
hasFilename = TRUE;
|
||||
hasFilename = true;
|
||||
break;
|
||||
|
||||
case wxT('t'):
|
||||
@ -230,7 +230,7 @@ bool wxFileType::GetExtensions(wxArrayString& extensions)
|
||||
if ( m_info )
|
||||
{
|
||||
extensions = m_info->GetExtensions();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_impl->GetExtensions(extensions);
|
||||
@ -238,13 +238,13 @@ bool wxFileType::GetExtensions(wxArrayString& extensions)
|
||||
|
||||
bool wxFileType::GetMimeType(wxString *mimeType) const
|
||||
{
|
||||
wxCHECK_MSG( mimeType, FALSE, _T("invalid parameter in GetMimeType") );
|
||||
wxCHECK_MSG( mimeType, false, _T("invalid parameter in GetMimeType") );
|
||||
|
||||
if ( m_info )
|
||||
{
|
||||
*mimeType = m_info->GetMimeType();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_impl->GetMimeType(mimeType);
|
||||
@ -257,7 +257,7 @@ bool wxFileType::GetMimeTypes(wxArrayString& mimeTypes) const
|
||||
mimeTypes.Clear();
|
||||
mimeTypes.Add(m_info->GetMimeType());
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_impl->GetMimeTypes(mimeTypes);
|
||||
@ -275,7 +275,7 @@ bool wxFileType::GetIcon(wxIconLocation *iconLoc) const
|
||||
#endif // __WXMSW__
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_impl->GetIcon(iconLoc);
|
||||
@ -302,13 +302,13 @@ wxFileType::GetIcon(wxIconLocation *iconloc,
|
||||
|
||||
bool wxFileType::GetDescription(wxString *desc) const
|
||||
{
|
||||
wxCHECK_MSG( desc, FALSE, _T("invalid parameter in GetDescription") );
|
||||
wxCHECK_MSG( desc, false, _T("invalid parameter in GetDescription") );
|
||||
|
||||
if ( m_info )
|
||||
{
|
||||
*desc = m_info->GetDescription();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_impl->GetDescription(desc);
|
||||
@ -318,13 +318,13 @@ bool
|
||||
wxFileType::GetOpenCommand(wxString *openCmd,
|
||||
const wxFileType::MessageParameters& params) const
|
||||
{
|
||||
wxCHECK_MSG( openCmd, FALSE, _T("invalid parameter in GetOpenCommand") );
|
||||
wxCHECK_MSG( openCmd, false, _T("invalid parameter in GetOpenCommand") );
|
||||
|
||||
if ( m_info )
|
||||
{
|
||||
*openCmd = ExpandCommand(m_info->GetOpenCommand(), params);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_impl->GetOpenCommand(openCmd, params);
|
||||
@ -346,13 +346,13 @@ bool
|
||||
wxFileType::GetPrintCommand(wxString *printCmd,
|
||||
const wxFileType::MessageParameters& params) const
|
||||
{
|
||||
wxCHECK_MSG( printCmd, FALSE, _T("invalid parameter in GetPrintCommand") );
|
||||
wxCHECK_MSG( printCmd, false, _T("invalid parameter in GetPrintCommand") );
|
||||
|
||||
if ( m_info )
|
||||
{
|
||||
*printCmd = ExpandCommand(m_info->GetPrintCommand(), params);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_impl->GetPrintCommand(printCmd, params);
|
||||
@ -406,7 +406,7 @@ bool wxFileType::Unassociate()
|
||||
return m_impl->Unassociate(this);
|
||||
#else
|
||||
wxFAIL_MSG( _T("not implemented") ); // TODO
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -417,7 +417,7 @@ bool overwriteprompt)
|
||||
return m_impl->SetCommand(cmd, verb, overwriteprompt);
|
||||
#else
|
||||
wxFAIL_MSG(_T("not implemented"));
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -430,14 +430,14 @@ bool wxFileType::SetDefaultIcon(const wxString& cmd, int index)
|
||||
if ( sTmp.empty() )
|
||||
GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxT(""), wxT("")));
|
||||
#endif
|
||||
wxCHECK_MSG( !sTmp.empty(), FALSE, _T("need the icon file") );
|
||||
wxCHECK_MSG( !sTmp.empty(), false, _T("need the icon file") );
|
||||
|
||||
#if defined (__WXMSW__) || defined(__UNIX__)
|
||||
return m_impl->SetDefaultIcon (cmd, index);
|
||||
#else
|
||||
wxFAIL_MSG(_T("not implemented"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -458,21 +458,21 @@ bool wxMimeTypesManager::IsOfType(const wxString& mimeType,
|
||||
wxASSERT_MSG( mimeType.Find(wxT('*')) == wxNOT_FOUND,
|
||||
wxT("first MIME type can't contain wildcards") );
|
||||
|
||||
// all comparaisons are case insensitive (2nd arg of IsSameAs() is FALSE)
|
||||
// all comparaisons are case insensitive (2nd arg of IsSameAs() is false)
|
||||
if ( wildcard.BeforeFirst(wxT('/')).
|
||||
IsSameAs(mimeType.BeforeFirst(wxT('/')), FALSE) )
|
||||
IsSameAs(mimeType.BeforeFirst(wxT('/')), false) )
|
||||
{
|
||||
wxString strSubtype = wildcard.AfterFirst(wxT('/'));
|
||||
|
||||
if ( strSubtype == wxT("*") ||
|
||||
strSubtype.IsSameAs(mimeType.AfterFirst(wxT('/')), FALSE) )
|
||||
strSubtype.IsSameAs(mimeType.AfterFirst(wxT('/')), false) )
|
||||
{
|
||||
// matches (either exactly or it's a wildcard)
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
wxMimeTypesManager::wxMimeTypesManager()
|
||||
@ -632,7 +632,7 @@ class wxMimeTypeCmnModule: public wxModule
|
||||
{
|
||||
public:
|
||||
wxMimeTypeCmnModule() : wxModule() { }
|
||||
virtual bool OnInit() { return TRUE; }
|
||||
virtual bool OnInit() { return true; }
|
||||
virtual void OnExit()
|
||||
{
|
||||
// this avoids false memory leak allerts:
|
||||
|
@ -78,11 +78,11 @@ bool wxModule::InitializeModules()
|
||||
n->GetData()->OnExit();
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxModule::CleanUpModules()
|
||||
|
@ -47,7 +47,7 @@ wxMemoryInputStream::wxMemoryInputStream(const void *data, size_t len)
|
||||
m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read);
|
||||
m_i_streambuf->SetBufferIO((void *)data, len); // const_cast
|
||||
m_i_streambuf->SetIntPosition(0); // seek to start pos
|
||||
m_i_streambuf->Fixed(TRUE);
|
||||
m_i_streambuf->Fixed(true);
|
||||
|
||||
m_length = len;
|
||||
}
|
||||
@ -104,8 +104,8 @@ wxMemoryOutputStream::wxMemoryOutputStream(void *data, size_t len)
|
||||
m_o_streambuf = new wxStreamBuffer(wxStreamBuffer::write);
|
||||
if ( data )
|
||||
m_o_streambuf->SetBufferIO(data, len);
|
||||
m_o_streambuf->Fixed(FALSE);
|
||||
m_o_streambuf->Flushable(FALSE);
|
||||
m_o_streambuf->Fixed(false);
|
||||
m_o_streambuf->Flushable(false);
|
||||
}
|
||||
|
||||
wxMemoryOutputStream::~wxMemoryOutputStream()
|
||||
|
Loading…
Reference in New Issue
Block a user