mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-29 10:25:27 +08:00
Source cleaning: -1/wxID_ANY/wxDefaultCoord, !!/!IsEmpty(), TRUE/true, FALSE/false, whitespaces, tabs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -85,14 +85,14 @@ public:
|
||||
virtual int GetCount() const;
|
||||
virtual wxString GetString(int n) const;
|
||||
virtual void SetString(int n, const wxString& label);
|
||||
virtual void Enable(int n, bool enable = TRUE);
|
||||
virtual void Show(int n, bool show = TRUE);
|
||||
virtual void Enable(int n, bool enable = true);
|
||||
virtual void Show(int n, bool show = true);
|
||||
virtual int GetColumnCount() const;
|
||||
virtual int GetRowCount() const;
|
||||
|
||||
virtual bool Show(bool show = TRUE);
|
||||
virtual bool Show(bool show = true);
|
||||
void SetFocus();
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
virtual bool Enable(bool enable = true);
|
||||
void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||
void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||
|
||||
|
||||
@@ -62,17 +62,17 @@ public:
|
||||
|
||||
// get number of entries/subgroups in the current group, with or without
|
||||
// it's subgroups
|
||||
virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const;
|
||||
virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const;
|
||||
virtual size_t GetNumberOfEntries(bool bRecursive = false) const;
|
||||
virtual size_t GetNumberOfGroups(bool bRecursive = false) const;
|
||||
|
||||
virtual bool Flush(bool WXUNUSED(bCurrentOnly) = FALSE) { return TRUE; }
|
||||
virtual bool Flush(bool WXUNUSED(bCurrentOnly) = false) { return true; }
|
||||
|
||||
// rename
|
||||
virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
|
||||
virtual bool RenameGroup(const wxString& oldName, const wxString& newName);
|
||||
|
||||
// delete
|
||||
virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = TRUE);
|
||||
virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = true);
|
||||
virtual bool DeleteGroup(const wxString& key);
|
||||
virtual bool DeleteAll();
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ typedef unsigned long ulong;
|
||||
// ----------------------------------------------------------------------------
|
||||
// class wxRegKey encapsulates window HKEY handle
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLIMPEXP_BASE wxRegKey
|
||||
class WXDLLIMPEXP_BASE wxRegKey
|
||||
{
|
||||
public:
|
||||
// NB: do _not_ change the values of elements in these enumerations!
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
|
||||
// get infomation about the key
|
||||
// get the (full) key name. Abbreviate std root keys if bShortPrefix.
|
||||
wxString GetName(bool bShortPrefix = TRUE) const;
|
||||
wxString GetName(bool bShortPrefix = true) const;
|
||||
// return true if the key exists
|
||||
bool Exists() const;
|
||||
// get the info about key (any number of these pointers may be NULL)
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
// which need the key to be opened if the key is not opened yet)
|
||||
bool Open(AccessMode mode = Write);
|
||||
// create the key: will fail if the key already exists and !bOkIfExists
|
||||
bool Create(bool bOkIfExists = TRUE);
|
||||
bool Create(bool bOkIfExists = true);
|
||||
// rename a value from old name to new one
|
||||
bool RenameValue(const wxChar *szValueOld, const wxChar *szValueNew);
|
||||
// rename the key
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
// access to values and subkeys
|
||||
// get value type
|
||||
ValueType GetValueType(const wxChar *szValue) const;
|
||||
// returns TRUE if the value contains a number (else it's some string)
|
||||
// returns true if the value contains a number (else it's some string)
|
||||
bool IsNumericValue(const wxChar *szValue) const;
|
||||
|
||||
// assignment operators set the default value of the key
|
||||
@@ -185,10 +185,10 @@ public:
|
||||
bool SetValue(const wxChar *szValue, const wxString& strValue);
|
||||
// retrieve the string value
|
||||
bool QueryValue(const wxChar *szValue, wxString& strValue) const
|
||||
{ return QueryValue(szValue, strValue, FALSE); }
|
||||
{ return QueryValue(szValue, strValue, false); }
|
||||
// retrieve raw string value
|
||||
bool QueryRawValue(const wxChar *szValue, wxString& strValue) const
|
||||
{ return QueryValue(szValue, strValue, TRUE); }
|
||||
{ return QueryValue(szValue, strValue, true); }
|
||||
// retrieve either raw or expanded string value
|
||||
bool QueryValue(const wxChar *szValue, wxString& strValue, bool raw) const;
|
||||
|
||||
|
||||
+40
-41
File diff suppressed because it is too large
Load Diff
@@ -59,7 +59,7 @@ wxBEGIN_FLAGS( wxRadioButtonStyle )
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
@@ -95,7 +95,7 @@ wxEND_PROPERTIES_TABLE()
|
||||
wxBEGIN_HANDLERS_TABLE(wxRadioButton)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxRadioButton , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
wxCONSTRUCTOR_6( wxRadioButton , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
|
||||
|
||||
+27
-27
@@ -220,9 +220,9 @@ void wxRegConfig::SetPath(const wxString& strPath)
|
||||
strFullPath.reserve(2*m_strPath.length());
|
||||
|
||||
strFullPath << m_strPath;
|
||||
if ( strFullPath.Len() == 0 ||
|
||||
if ( strFullPath.Len() == 0 ||
|
||||
strFullPath.Last() != wxCONFIG_PATH_SEPARATOR )
|
||||
strFullPath << wxCONFIG_PATH_SEPARATOR;
|
||||
strFullPath << wxCONFIG_PATH_SEPARATOR;
|
||||
strFullPath << strPath;
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ bool wxRegConfig::GetNextGroup(wxString& str, long& lIndex) const
|
||||
while ( m_keyGlobal.GetNextKey(str, lIndex) ) {
|
||||
if ( !m_keyLocal.Exists() || !LocalKey().HasSubKey(str) ) {
|
||||
// ok, found one - return it
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ bool wxRegConfig::GetNextGroup(wxString& str, long& lIndex) const
|
||||
|
||||
// if we don't have the key at all, don't try to enumerate anything under it
|
||||
if ( !m_keyLocal.Exists() )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// much easier with local entries: get the next one we find
|
||||
// (don't forget to clear our flag bit and set it again later)
|
||||
@@ -458,7 +458,7 @@ bool wxRegConfig::GetNextEntry(wxString& str, long& lIndex) const
|
||||
while ( m_keyGlobal.GetNextValue(str, lIndex) ) {
|
||||
if ( !m_keyLocal.Exists() || !LocalKey().HasValue(str) ) {
|
||||
// ok, found one - return it
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ bool wxRegConfig::GetNextEntry(wxString& str, long& lIndex) const
|
||||
|
||||
// if we don't have the key at all, don't try to enumerate anything under it
|
||||
if ( !m_keyLocal.Exists() )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// much easier with local entries: get the next one we find
|
||||
// (don't forget to clear our flag bit and set it again later)
|
||||
@@ -560,11 +560,11 @@ wxConfigBase::EntryType wxRegConfig::GetEntryType(const wxString& key) const
|
||||
|
||||
bool wxRegConfig::DoReadString(const wxString& key, wxString *pStr) const
|
||||
{
|
||||
wxCHECK_MSG( pStr, FALSE, _T("wxRegConfig::Read(): NULL param") );
|
||||
wxCHECK_MSG( pStr, false, _T("wxRegConfig::Read(): NULL param") );
|
||||
|
||||
wxConfigPathChanger path(this, key);
|
||||
|
||||
bool bQueryGlobal = TRUE;
|
||||
bool bQueryGlobal = true;
|
||||
|
||||
// if immutable key exists in global key we must check that it's not
|
||||
// overriden by the local key with the same name
|
||||
@@ -575,21 +575,21 @@ bool wxRegConfig::DoReadString(const wxString& key, wxString *pStr) const
|
||||
path.Name().c_str());
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
// don't waste time - it's not there anyhow
|
||||
bQueryGlobal = FALSE;
|
||||
bQueryGlobal = false;
|
||||
}
|
||||
}
|
||||
|
||||
// first try local key
|
||||
if ( (m_keyLocal.Exists() && TryGetValue(LocalKey(), path.Name(), *pStr)) ||
|
||||
(bQueryGlobal && TryGetValue(m_keyGlobal, path.Name(), *pStr)) ) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// this exactly reproduces the string version above except for ExpandEnvVars(),
|
||||
@@ -597,11 +597,11 @@ bool wxRegConfig::DoReadString(const wxString& key, wxString *pStr) const
|
||||
|
||||
bool wxRegConfig::DoReadLong(const wxString& key, long *plResult) const
|
||||
{
|
||||
wxCHECK_MSG( plResult, FALSE, _T("wxRegConfig::Read(): NULL param") );
|
||||
wxCHECK_MSG( plResult, false, _T("wxRegConfig::Read(): NULL param") );
|
||||
|
||||
wxConfigPathChanger path(this, key);
|
||||
|
||||
bool bQueryGlobal = TRUE;
|
||||
bool bQueryGlobal = true;
|
||||
|
||||
// if immutable key exists in global key we must check that it's not
|
||||
// overriden by the local key with the same name
|
||||
@@ -612,21 +612,21 @@ bool wxRegConfig::DoReadLong(const wxString& key, long *plResult) const
|
||||
path.Name().c_str());
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
// don't waste time - it's not there anyhow
|
||||
bQueryGlobal = FALSE;
|
||||
bQueryGlobal = false;
|
||||
}
|
||||
}
|
||||
|
||||
// first try local key
|
||||
if ( (m_keyLocal.Exists() && TryGetValue(LocalKey(), path.Name(), plResult)) ||
|
||||
(bQueryGlobal && TryGetValue(m_keyGlobal, path.Name(), plResult)) ) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRegConfig::DoWriteString(const wxString& key, const wxString& szValue)
|
||||
@@ -635,7 +635,7 @@ bool wxRegConfig::DoWriteString(const wxString& key, const wxString& szValue)
|
||||
|
||||
if ( IsImmutable(path.Name()) ) {
|
||||
wxLogError(wxT("Can't change immutable entry '%s'."), path.Name().c_str());
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return LocalKey().SetValue(path.Name(), szValue);
|
||||
@@ -647,7 +647,7 @@ bool wxRegConfig::DoWriteLong(const wxString& key, long lValue)
|
||||
|
||||
if ( IsImmutable(path.Name()) ) {
|
||||
wxLogError(wxT("Can't change immutable entry '%s'."), path.Name().c_str());
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return LocalKey().SetValue(path.Name(), lValue);
|
||||
@@ -661,11 +661,11 @@ bool wxRegConfig::RenameEntry(const wxString& oldName, const wxString& newName)
|
||||
{
|
||||
// check that the old entry exists...
|
||||
if ( !HasEntry(oldName) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// and that the new one doesn't
|
||||
if ( HasEntry(newName) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return m_keyLocal.RenameValue(oldName, newName);
|
||||
}
|
||||
@@ -674,11 +674,11 @@ bool wxRegConfig::RenameGroup(const wxString& oldName, const wxString& newName)
|
||||
{
|
||||
// check that the old group exists...
|
||||
if ( !HasGroup(oldName) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// and that the new one doesn't
|
||||
if ( HasGroup(newName) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return wxRegKey(m_keyLocal, oldName).Rename(newName);
|
||||
}
|
||||
@@ -693,7 +693,7 @@ bool wxRegConfig::DeleteEntry(const wxString& value, bool bGroupIfEmptyAlso)
|
||||
|
||||
if ( m_keyLocal.Exists() ) {
|
||||
if ( !m_keyLocal.DeleteValue(path.Name()) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if ( bGroupIfEmptyAlso && m_keyLocal.IsEmpty() ) {
|
||||
wxString strKey = GetPath().AfterLast(wxCONFIG_PATH_SEPARATOR);
|
||||
@@ -702,14 +702,14 @@ bool wxRegConfig::DeleteEntry(const wxString& value, bool bGroupIfEmptyAlso)
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxRegConfig::DeleteGroup(const wxString& key)
|
||||
{
|
||||
wxConfigPathChanger path(this, key);
|
||||
|
||||
return m_keyLocal.Exists() ? LocalKey().DeleteKey(path.Name()) : TRUE;
|
||||
return m_keyLocal.Exists() ? LocalKey().DeleteKey(path.Name()) : true;
|
||||
}
|
||||
|
||||
bool wxRegConfig::DeleteAll()
|
||||
|
||||
+7
-7
@@ -166,12 +166,12 @@ void wxRegion::Clear()
|
||||
|
||||
bool wxRegion::Offset(wxCoord x, wxCoord y)
|
||||
{
|
||||
wxCHECK_MSG( M_REGION, FALSE, _T("invalid wxRegion") );
|
||||
wxCHECK_MSG( M_REGION, false, _T("invalid wxRegion") );
|
||||
|
||||
if ( !x && !y )
|
||||
{
|
||||
// nothing to do
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
AllocExclusive();
|
||||
@@ -180,10 +180,10 @@ bool wxRegion::Offset(wxCoord x, wxCoord y)
|
||||
{
|
||||
wxLogLastError(_T("OffsetRgn"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// combine another region with this one
|
||||
@@ -209,7 +209,7 @@ bool wxRegion::Combine(const wxRegion& rgn, wxRegionOp op)
|
||||
case wxRGN_AND:
|
||||
case wxRGN_DIFF:
|
||||
// leave empty/invalid
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else // we have a valid region
|
||||
@@ -248,11 +248,11 @@ bool wxRegion::Combine(const wxRegion& rgn, wxRegionOp op)
|
||||
{
|
||||
wxLogLastError(_T("CombineRgn"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Combine rectangle (x, y, w, h) with this.
|
||||
|
||||
+86
-86
File diff suppressed because it is too large
Load Diff
@@ -150,7 +150,7 @@ wxRendererXP::DrawSplitterSash(wxWindow *win,
|
||||
win, dc, size, position, orient, flags);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// I don't know if it is correct to use the rebar background for the
|
||||
// splitter but it least this works ok in the default theme
|
||||
wxUxThemeHandle hTheme(win, L"REBAR");
|
||||
@@ -160,7 +160,7 @@ wxRendererXP::DrawSplitterSash(wxWindow *win,
|
||||
if ( orient == wxVERTICAL )
|
||||
{
|
||||
rect.left = position;
|
||||
rect.right = position + SASH_WIDTH;
|
||||
rect.right = position + SASH_WIDTH;
|
||||
rect.top = 0;
|
||||
rect.bottom = size.y;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ wxRendererXP::DrawSplitterSash(wxWindow *win,
|
||||
0 /* no state */ ,
|
||||
&rect,
|
||||
NULL
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user