From cbe874bd32f35beb3ed8d019c5a24df21a219f8f Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 25 Aug 2004 12:17:55 +0000 Subject: [PATCH] Code cleaning: whitespaces, -1/wxID_ANY/wxDefaultCoord, TRUE/true, FALSE/false, ::. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/fdrepdlg.h | 2 +- include/wx/msw/fontenum.h | 2 +- include/wx/msw/frame.h | 6 +-- src/msw/enhmeta.cpp | 36 +++++++------- src/msw/fdrepdlg.cpp | 28 +++++------ src/msw/filedlg.cpp | 4 +- src/msw/font.cpp | 102 +++++++++++++++++++------------------- src/msw/fontenum.cpp | 26 +++++----- src/msw/fontutil.cpp | 14 +++--- src/msw/frame.cpp | 90 ++++++++++++++++----------------- 10 files changed, 155 insertions(+), 155 deletions(-) diff --git a/include/wx/msw/fdrepdlg.h b/include/wx/msw/fdrepdlg.h index 1a8c1ee357..bfe47d1834 100644 --- a/include/wx/msw/fdrepdlg.h +++ b/include/wx/msw/fdrepdlg.h @@ -39,7 +39,7 @@ public: wxFindReplaceDialogImpl *GetImpl() const { return m_impl; } // override some base class virtuals - virtual bool Show(bool show = TRUE); + virtual bool Show(bool show = true); virtual void SetTitle( const wxString& title); virtual wxString GetTitle() const; diff --git a/include/wx/msw/fontenum.h b/include/wx/msw/fontenum.h index 38b7e08eca..d8e1612279 100644 --- a/include/wx/msw/fontenum.h +++ b/include/wx/msw/fontenum.h @@ -29,7 +29,7 @@ public: // Enumerate the fonts. bool Enumerate(); - // Stop enumeration if FALSE is returned. + // Stop enumeration if false is returned. // By default, the enumerator stores the facenames in a list for // retrieval via GetFacenames(). virtual bool OnFont(const wxFont& font); diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index b858afcd54..17fae5715a 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -57,7 +57,7 @@ public: // Toolbar #if wxUSE_TOOLBAR virtual wxToolBar* CreateToolBar(long style = -1, - wxWindowID id = -1, + wxWindowID id = wxID_ANY, const wxString& name = wxToolBarNameStr); virtual void PositionToolBar(); @@ -103,7 +103,7 @@ public: virtual void SendSizeEvent(); virtual wxPoint GetClientAreaOrigin() const; - + protected: // common part of all ctors void Init(); @@ -133,7 +133,7 @@ protected: // handle WM_INITMENUPOPUP message bool HandleInitMenuPopup(WXHMENU hMenu); - virtual bool IsMDIChild() const { return FALSE; } + virtual bool IsMDIChild() const { return false; } // get default (wxWidgets) icon for the frame virtual WXHICON GetDefaultIcon() const; diff --git a/src/msw/enhmeta.cpp b/src/msw/enhmeta.cpp index 73c04b84db..1767d356f2 100644 --- a/src/msw/enhmeta.cpp +++ b/src/msw/enhmeta.cpp @@ -103,7 +103,7 @@ void wxEnhMetaFile::Free() bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound) { - wxCHECK_MSG( Ok(), FALSE, _T("can't play invalid enhanced metafile") ); + wxCHECK_MSG( Ok(), false, _T("can't play invalid enhanced metafile") ); wxCHECK_MSG( dc, FALSE, _T("invalid wxDC in wxEnhMetaFile::Play") ); RECT rect; @@ -128,10 +128,10 @@ bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound) { wxLogLastError(_T("PlayEnhMetaFile")); - return FALSE; + return false; } - return TRUE; + return true; } wxSize wxEnhMetaFile::GetSize() const @@ -170,7 +170,7 @@ bool wxEnhMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height)) return wxTheClipboard->AddData(new wxEnhMetaFileDataObject(*this)); #else // !wxUSE_DRAG_AND_DROP wxFAIL_MSG(_T("not implemented")); - return FALSE; + return false; #endif // wxUSE_DRAG_AND_DROP/!wxUSE_DRAG_AND_DROP } @@ -184,7 +184,7 @@ wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename, { ScreenHDC hdcRef; RECT rect; - RECT *pRect; + RECT *pRect; if ( width && height ) { rect.top = @@ -194,7 +194,7 @@ wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename, // CreateEnhMetaFile() wants them in HIMETRIC PixelToHIMETRIC(&rect.right, &rect.bottom); - + pRect = ▭ } else @@ -276,7 +276,7 @@ size_t wxEnhMetaFileDataObject::GetDataSize(const wxDataFormat& format) const bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) const { - wxCHECK_MSG( m_metafile.Ok(), FALSE, _T("copying invalid enh metafile") ); + wxCHECK_MSG( m_metafile.Ok(), false, _T("copying invalid enh metafile") ); HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE(); @@ -287,7 +287,7 @@ bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) { wxLogLastError(_T("CopyEnhMetaFile")); - return FALSE; + return false; } *(HENHMETAFILE *)buf = hEMFCopy; @@ -313,7 +313,7 @@ bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) free(bits); - return FALSE; + return false; } // and finally convert them to the WMF @@ -323,7 +323,7 @@ bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) { wxLogLastError(_T("SetMetaFileBitsEx")); - return FALSE; + return false; } METAFILEPICT *mfpict = (METAFILEPICT *)buf; @@ -337,7 +337,7 @@ bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) PixelToHIMETRIC(&mfpict->xExt, &mfpict->yExt); } - return TRUE; + return true; } bool wxEnhMetaFileDataObject::SetData(const wxDataFormat& format, @@ -371,7 +371,7 @@ bool wxEnhMetaFileDataObject::SetData(const wxDataFormat& format, free(bits); - return FALSE; + return false; } ScreenHDC hdcRef; @@ -383,13 +383,13 @@ bool wxEnhMetaFileDataObject::SetData(const wxDataFormat& format, { wxLogLastError(_T("SetWinMetaFileBits")); - return FALSE; + return false; } } m_metafile.SetHENHMETAFILE((WXHANDLE)hEMF); - return TRUE; + return true; } // ---------------------------------------------------------------------------- @@ -404,7 +404,7 @@ size_t wxEnhMetaFileSimpleDataObject::GetDataSize() const bool wxEnhMetaFileSimpleDataObject::GetDataHere(void *buf) const { - wxCHECK_MSG( m_metafile.Ok(), FALSE, _T("copying invalid enh metafile") ); + wxCHECK_MSG( m_metafile.Ok(), false, _T("copying invalid enh metafile") ); HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE(); @@ -413,11 +413,11 @@ bool wxEnhMetaFileSimpleDataObject::GetDataHere(void *buf) const { wxLogLastError(_T("CopyEnhMetaFile")); - return FALSE; + return false; } *(HENHMETAFILE *)buf = hEMFCopy; - return TRUE; + return true; } bool wxEnhMetaFileSimpleDataObject::SetData(size_t WXUNUSED(len), @@ -428,7 +428,7 @@ bool wxEnhMetaFileSimpleDataObject::SetData(size_t WXUNUSED(len), wxCHECK_MSG( hEMF, FALSE, _T("pasting invalid enh metafile") ); m_metafile.SetHENHMETAFILE((WXHANDLE)hEMF); - return TRUE; + return true; } diff --git a/src/msw/fdrepdlg.cpp b/src/msw/fdrepdlg.cpp index b6acec5dab..c839d458af 100644 --- a/src/msw/fdrepdlg.cpp +++ b/src/msw/fdrepdlg.cpp @@ -82,7 +82,7 @@ public: FINDREPLACE *GetPtrFindReplace() { return &m_findReplace; } // set/query the "closed by user" flag - void SetClosedByUser() { m_wasClosedByUser = TRUE; } + void SetClosedByUser() { m_wasClosedByUser = true; } bool WasClosedByUser() const { return m_wasClosedByUser; } private: @@ -97,7 +97,7 @@ private: // the find replace data used by the dialog FINDREPLACE m_findReplace; - // TRUE if the user closed us, FALSE otherwise + // true if the user closed us, false otherwise bool m_wasClosedByUser; // registered Message for Dialog @@ -133,7 +133,7 @@ wxFindReplaceDialogImpl::wxFindReplaceDialogImpl(wxFindReplaceDialog *dialog, m_hwndOwner = NULL; m_oldParentWndProc = NULL; - m_wasClosedByUser = FALSE; + m_wasClosedByUser = false; wxZeroMemory(m_findReplace); @@ -260,7 +260,7 @@ LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, // map flags from Windows wxEventType evtType; - bool replace = FALSE; + bool replace = false; if ( pFR->Flags & FR_DIALOGTERM ) { // we have to notify the dialog that it's being closed by user and @@ -278,13 +278,13 @@ LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg, { evtType = wxEVT_COMMAND_FIND_REPLACE; - replace = TRUE; + replace = true; } else if ( pFR->Flags & FR_REPLACEALL ) { evtType = wxEVT_COMMAND_FIND_REPLACE_ALL; - replace = TRUE; + replace = true; } else { @@ -372,7 +372,7 @@ void wxFindReplaceDialog::Init() m_FindReplaceData = NULL; // as we're created in the hidden state, bring the internal flag in sync - m_isShown = FALSE; + m_isShown = false; } wxFindReplaceDialog::wxFindReplaceDialog(wxWindow *parent, @@ -404,7 +404,7 @@ wxFindReplaceDialog::~wxFindReplaceDialog() delete m_impl; // prevent the base class dtor from trying to hide us! - m_isShown = FALSE; + m_isShown = false; // and from destroying our window [again] m_hWnd = (WXHWND)NULL; @@ -434,7 +434,7 @@ bool wxFindReplaceDialog::Show(bool show) if ( !wxWindowBase::Show(show) ) { // visibility status didn't change - return FALSE; + return false; } // do we already have the dialog window? @@ -443,16 +443,16 @@ bool wxFindReplaceDialog::Show(bool show) // yes, just use it (void)::ShowWindow(GetHwnd(), show ? SW_SHOW : SW_HIDE); - return TRUE; + return true; } if ( !show ) { // well, it doesn't exist which is as good as being hidden - return TRUE; + return true; } - wxCHECK_MSG( m_FindReplaceData, FALSE, _T("call Create() first!") ); + wxCHECK_MSG( m_FindReplaceData, false, _T("call Create() first!") ); wxASSERT_MSG( !m_impl, _T("why don't we have the window then?") ); @@ -482,7 +482,7 @@ bool wxFindReplaceDialog::Show(bool show) delete m_impl; m_impl = NULL; - return FALSE; + return false; } // subclass parent window in order to get FINDMSGSTRING message @@ -495,7 +495,7 @@ bool wxFindReplaceDialog::Show(bool show) m_hWnd = (WXHWND)hwnd; - return TRUE; + return true; } // ---------------------------------------------------------------------------- diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 7e59525d7b..05fd4e89ca 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -299,8 +299,8 @@ int wxFileDialog::ShowModal() // forward slashes) and also squeeze multiple consecutive slashes into one // as it doesn't like two backslashes in a row neither - wxString dir; - size_t i, len = m_dir.length(); + wxString dir; + size_t i, len = m_dir.length(); dir.reserve(len); for ( i = 0; i < len; i++ ) { diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 14b78ac9e6..ba360fa3d4 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -48,46 +48,46 @@ #if wxUSE_EXTENDED_RTTI wxBEGIN_ENUM( wxFontFamily ) - wxENUM_MEMBER( wxDEFAULT ) - wxENUM_MEMBER( wxDECORATIVE ) - wxENUM_MEMBER( wxROMAN ) - wxENUM_MEMBER( wxSCRIPT ) - wxENUM_MEMBER( wxSWISS ) - wxENUM_MEMBER( wxMODERN ) - wxENUM_MEMBER( wxTELETYPE ) + wxENUM_MEMBER( wxDEFAULT ) + wxENUM_MEMBER( wxDECORATIVE ) + wxENUM_MEMBER( wxROMAN ) + wxENUM_MEMBER( wxSCRIPT ) + wxENUM_MEMBER( wxSWISS ) + wxENUM_MEMBER( wxMODERN ) + wxENUM_MEMBER( wxTELETYPE ) wxEND_ENUM( wxFontFamily ) wxBEGIN_ENUM( wxFontStyle ) - wxENUM_MEMBER( wxNORMAL ) - wxENUM_MEMBER( wxITALIC ) - wxENUM_MEMBER( wxSLANT ) + wxENUM_MEMBER( wxNORMAL ) + wxENUM_MEMBER( wxITALIC ) + wxENUM_MEMBER( wxSLANT ) wxEND_ENUM( wxFontStyle ) wxBEGIN_ENUM( wxFontWeight ) - wxENUM_MEMBER( wxNORMAL ) - wxENUM_MEMBER( wxLIGHT ) - wxENUM_MEMBER( wxBOLD ) + wxENUM_MEMBER( wxNORMAL ) + wxENUM_MEMBER( wxLIGHT ) + wxENUM_MEMBER( wxBOLD ) wxEND_ENUM( wxFontWeight ) IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI(wxFont, wxGDIObject,"wx/font.h") wxBEGIN_PROPERTIES_TABLE(wxFont) - wxPROPERTY( Size,int, SetPointSize, GetPointSize, 12 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY( Family, int , SetFamily, GetFamily, (int)wxDEFAULT , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontFamily - wxPROPERTY( Style, int , SetStyle, GetStyle, (int)wxNORMAL , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontStyle - wxPROPERTY( Weight, int , SetWeight, GetWeight, (int)wxNORMAL , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontWeight - wxPROPERTY( Underlined, bool , SetUnderlined, GetUnderlined, false , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY( Face, wxString , SetFaceName, GetFaceName, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY( Encoding, wxFontEncoding , SetEncoding, GetEncoding, wxFONTENCODING_DEFAULT , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + wxPROPERTY( Size,int, SetPointSize, GetPointSize, 12 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + wxPROPERTY( Family, int , SetFamily, GetFamily, (int)wxDEFAULT , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontFamily + wxPROPERTY( Style, int , SetStyle, GetStyle, (int)wxNORMAL , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontStyle + wxPROPERTY( Weight, int , SetWeight, GetWeight, (int)wxNORMAL , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontWeight + wxPROPERTY( Underlined, bool , SetUnderlined, GetUnderlined, false , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + wxPROPERTY( Face, wxString , SetFaceName, GetFaceName, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + wxPROPERTY( Encoding, wxFontEncoding , SetEncoding, GetEncoding, wxFONTENCODING_DEFAULT , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) wxEND_PROPERTIES_TABLE() -wxCONSTRUCTOR_6( wxFont , int , Size , int , Family , int , Style , int , Weight , bool , Underlined , wxString , Face ) +wxCONSTRUCTOR_6( wxFont , int , Size , int , Family , int , Style , int , Weight , bool , Underlined , wxString , Face ) wxBEGIN_HANDLERS_TABLE(wxFont) wxEND_HANDLERS_TABLE() #else - IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) + IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) #endif @@ -109,7 +109,7 @@ public: wxFontRefData() { Init(-1, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, - FALSE, wxEmptyString, wxFONTENCODING_DEFAULT); + false, wxEmptyString, wxFONTENCODING_DEFAULT); } wxFontRefData(int size, @@ -313,7 +313,7 @@ void wxFontRefData::Init(int pointSize, m_hFont = 0; - m_nativeFontInfoOk = FALSE; + m_nativeFontInfoOk = false; } void wxFontRefData::Init(const wxNativeFontInfo& info, WXHFONT hFont) @@ -324,7 +324,7 @@ void wxFontRefData::Init(const wxNativeFontInfo& info, WXHFONT hFont) // to LOGFONT back to HFONT) m_hFont = hFont; - m_nativeFontInfoOk = TRUE; + m_nativeFontInfoOk = true; m_nativeFontInfo = info; // This is the best we can do since we don't have the // correct information at this point. @@ -341,7 +341,7 @@ bool wxFontRefData::Alloc(wxFont *font) if ( !m_nativeFontInfoOk ) { wxFillLogFont(&m_nativeFontInfo.lf, font); - m_nativeFontInfoOk = TRUE; + m_nativeFontInfoOk = true; } HFONT hfont = ::CreateFontIndirect(&m_nativeFontInfo.lf); @@ -349,12 +349,12 @@ bool wxFontRefData::Alloc(wxFont *font) { wxLogLastError(wxT("CreateFont")); - return FALSE; + return false; } m_hFont = (WXHFONT)hfont; - return TRUE; + return true; } void wxFontRefData::Free() @@ -602,79 +602,79 @@ bool wxNativeFontInfo::FromString(const wxString& s) // first the version wxString token = tokenizer.GetNextToken(); if ( token != _T('0') ) - return FALSE; + return false; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfHeight = l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfWidth = l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfEscapement = l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfOrientation = l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfWeight = l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfItalic = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfUnderline = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfStrikeOut = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfCharSet = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfOutPrecision = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfClipPrecision = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfQuality = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) - return FALSE; + return false; lf.lfPitchAndFamily = (BYTE)l; token = tokenizer.GetNextToken(); if(!token) - return FALSE; + return false; wxStrcpy(lf.lfFaceName, token.c_str()); - return TRUE; + return true; } wxString wxNativeFontInfo::ToString() const @@ -717,7 +717,7 @@ bool wxFont::Create(const wxNativeFontInfo& info, WXHFONT hFont) RealizeResource(); - return TRUE; + return true; } wxFont::wxFont(const wxString& fontdesc) @@ -752,7 +752,7 @@ bool wxFont::Create(int pointSize, RealizeResource(); - return TRUE; + return true; } wxFont::~wxFont() @@ -767,9 +767,9 @@ bool wxFont::RealizeResource() { if ( GetResourceHandle() ) { - // VZ: the old code returned FALSE in this case, but it doesn't seem + // VZ: the old code returned false in this case, but it doesn't seem // to make sense because the font _was_ created - return TRUE; + return true; } return M_FONTDATA->Alloc(this); @@ -781,10 +781,10 @@ bool wxFont::FreeResource(bool WXUNUSED(force)) { M_FONTDATA->Free(); - return TRUE; + return true; } - return FALSE; + return false; } WXHANDLE wxFont::GetResourceHandle() const @@ -929,7 +929,7 @@ int wxFont::GetWeight() const bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") ); + wxCHECK_MSG( Ok(), false, wxT("invalid font") ); return M_FONTDATA->GetUnderlined(); } diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp index 7ee7852e02..a571fa95c2 100644 --- a/src/msw/fontenum.cpp +++ b/src/msw/fontenum.cpp @@ -80,10 +80,10 @@ private: // if not empty, enum only the fonts in this family wxString m_family; - // if TRUE, enum only fixed fonts + // if true, enum only fixed fonts bool m_fixedOnly; - // if TRUE, we enumerate the encodings, not fonts + // if true, we enumerate the encodings, not fonts bool m_enumEncodings; // the list of charsets we already found while enumerating charsets @@ -116,13 +116,13 @@ wxFontEnumeratorHelper::wxFontEnumeratorHelper(wxFontEnumerator *fontEnum) { m_fontEnum = fontEnum; m_charset = DEFAULT_CHARSET; - m_fixedOnly = FALSE; - m_enumEncodings = FALSE; + m_fixedOnly = false; + m_enumEncodings = false; } void wxFontEnumeratorHelper::SetFamily(const wxString& family) { - m_enumEncodings = TRUE; + m_enumEncodings = true; m_family = family; } @@ -138,7 +138,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) #endif // wxUSE_FONTMAP { // no such encodings at all - return FALSE; + return false; } } @@ -146,7 +146,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) m_facename = info.facename; } - return TRUE; + return true; } #if defined(__GNUWIN32__) && !defined(__CYGWIN10__) && !wxCHECK_W32API_VERSION( 1, 1 ) && !wxUSE_NORLANDER_HEADERS @@ -194,7 +194,7 @@ bool wxFontEnumeratorHelper::OnFont(const LPLOGFONT lf, else { // continue enumeration - return TRUE; + return true; } } @@ -205,7 +205,7 @@ bool wxFontEnumeratorHelper::OnFont(const LPLOGFONT lf, if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH ) { // not a fixed pitch font - return TRUE; + return true; } } @@ -214,7 +214,7 @@ bool wxFontEnumeratorHelper::OnFont(const LPLOGFONT lf, // check that we have the right encoding if ( lf->lfCharSet != m_charset ) { - return TRUE; + return true; } } else // enumerating fonts in all charsets @@ -225,7 +225,7 @@ bool wxFontEnumeratorHelper::OnFont(const LPLOGFONT lf, if ( m_facenames.Index(lf->lfFaceName) != wxNOT_FOUND ) { // continue enumeration - return TRUE; + return true; } wxConstCast(this, wxFontEnumeratorHelper)-> @@ -251,7 +251,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, } // else: no such fonts, unknown encoding - return TRUE; + return true; } bool wxFontEnumerator::EnumerateEncodings(const wxString& family) @@ -260,7 +260,7 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family) fe.SetFamily(family); fe.DoEnumerate(); - return TRUE; + return true; } // ---------------------------------------------------------------------------- diff --git a/src/msw/fontutil.cpp b/src/msw/fontutil.cpp index 6ab9f34d8f..41d7adc1c2 100644 --- a/src/msw/fontutil.cpp +++ b/src/msw/fontutil.cpp @@ -102,11 +102,11 @@ bool wxNativeEncodingInfo::FromString(const wxString& s) if ( wxSscanf(tmp, _T("%u"), &charset) != 1 ) { // should be a number! - return FALSE; + return false; } } - return TRUE; + return true; } wxString wxNativeEncodingInfo::ToString() const @@ -141,7 +141,7 @@ wxString wxNativeEncodingInfo::ToString() const bool wxGetNativeFontEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info) { - wxCHECK_MSG( info, FALSE, _T("bad pointer in wxGetNativeFontEncoding") ); + wxCHECK_MSG( info, NULL, _T("bad pointer in wxGetNativeFontEncoding") ); if ( encoding == wxFONTENCODING_DEFAULT ) { @@ -151,11 +151,11 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding, extern WXDLLIMPEXP_BASE long wxEncodingToCharset(wxFontEncoding encoding); info->charset = wxEncodingToCharset(encoding); if ( info->charset == -1 ) - return FALSE; + return false; info->encoding = encoding; - return TRUE; + return true; } bool wxTestFontEncoding(const wxNativeEncodingInfo& info) @@ -171,12 +171,12 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& info) if ( !hfont ) { // no such font - return FALSE; + return false; } ::DeleteObject((HGDIOBJ)hfont); - return TRUE; + return true; } // ---------------------------------------------------------------------------- diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index efc6a5c630..0fd73e50bc 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -91,7 +91,7 @@ wxBEGIN_FLAGS( wxFrameStyle ) wxFLAGS_MEMBER(wxBORDER_RAISED) wxFLAGS_MEMBER(wxBORDER_STATIC) wxFLAGS_MEMBER(wxBORDER_NONE) - + // old style border flags wxFLAGS_MEMBER(wxSIMPLE_BORDER) wxFLAGS_MEMBER(wxSUNKEN_BORDER) @@ -141,7 +141,7 @@ wxEND_PROPERTIES_TABLE() wxBEGIN_HANDLERS_TABLE(wxFrame) wxEND_HANDLERS_TABLE() -wxCONSTRUCTOR_6( wxFrame , wxWindow* , Parent , wxWindowID , Id , wxString , Title , wxPoint , Position , wxSize , Size , long , WindowStyle) +wxCONSTRUCTOR_6( wxFrame , wxWindow* , Parent , wxWindowID , Id , wxString , Title , wxPoint , Position , wxSize , Size , long , WindowStyle) #else IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow) @@ -157,9 +157,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow) #if wxUSE_STATUSBAR #if wxUSE_NATIVE_STATUSBAR - bool wxFrame::m_useNativeStatusBar = TRUE; + bool wxFrame::m_useNativeStatusBar = true; #else - bool wxFrame::m_useNativeStatusBar = FALSE; + bool wxFrame::m_useNativeStatusBar = false; #endif #endif // wxUSE_NATIVE_STATUSBAR @@ -178,7 +178,7 @@ void wxFrame::Init() m_fsStatusBarHeight = 0; m_fsToolBarHeight = 0; - m_wasMinimized = FALSE; + m_wasMinimized = false; } bool wxFrame::Create(wxWindow *parent, @@ -203,7 +203,7 @@ bool wxFrame::Create(wxWindow *parent, wxFrame::~wxFrame() { - m_isBeingDeleted = TRUE; + m_isBeingDeleted = true; DeleteAllBars(); } @@ -349,7 +349,7 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar) #elif defined(WINCE_WITHOUT_COMMANDBAR) if (!GetToolBar()) { - wxToolBar* toolBar = new wxToolBar(this, -1, + wxToolBar* toolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxTB_HORIZONTAL, wxToolBarNameStr, menubar); @@ -368,7 +368,7 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar) // adjust for menu / titlebar height rc.bottom -= (2*menuHeight-1); - MoveWindow((HWND) GetHWND(), rc.left, rc.top, rc.right, rc.bottom, FALSE); + ::MoveWindow((HWND) GetHWND(), rc.left, rc.top, rc.right, rc.bottom, FALSE); } #endif @@ -436,11 +436,11 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) wxWindow::OnSysColourChanged(event); } -// Pass TRUE to show full screen, FALSE to restore. +// Pass true to show full screen, false to restore. bool wxFrame::ShowFullScreen(bool show, long style) { if ( IsFullScreen() == show ) - return FALSE; + return false; if (show) { @@ -457,8 +457,8 @@ bool wxFrame::ShowFullScreen(bool show, long style) if ((style & wxFULLSCREEN_NOTOOLBAR) && theToolBar) { - theToolBar->SetSize(-1,0); - theToolBar->Show(FALSE); + theToolBar->SetSize(wxDefaultCoord,0); + theToolBar->Show(false); } #endif // __WXWINCE__ #endif // wxUSE_TOOLBAR @@ -482,7 +482,7 @@ bool wxFrame::ShowFullScreen(bool show, long style) //m_fsStatusBarFields = theStatusBar->GetFieldsCount(); //SetStatusBar((wxStatusBar*) NULL); //delete theStatusBar; - theStatusBar->Show(FALSE); + theStatusBar->Show(false); } else m_fsStatusBarFields = 0; @@ -491,7 +491,7 @@ bool wxFrame::ShowFullScreen(bool show, long style) else { #if wxUSE_TOOLBAR -#if defined(WINCE_WITHOUT_COMMANDBAR) +#if defined(WINCE_WITHOUT_COMMANDBAR) // TODO: show commandbar #else wxToolBar *theToolBar = GetToolBar(); @@ -499,8 +499,8 @@ bool wxFrame::ShowFullScreen(bool show, long style) // restore the toolbar, menubar, and statusbar if (theToolBar && (m_fsStyle & wxFULLSCREEN_NOTOOLBAR)) { - theToolBar->SetSize(-1, m_fsToolBarHeight); - theToolBar->Show(TRUE); + theToolBar->SetSize(wxDefaultCoord, m_fsToolBarHeight); + theToolBar->Show(true); } #endif // __WXWINCE__ #endif // wxUSE_TOOLBAR @@ -511,7 +511,7 @@ bool wxFrame::ShowFullScreen(bool show, long style) //CreateStatusBar(m_fsStatusBarFields); if (GetStatusBar()) { - GetStatusBar()->Show(TRUE); + GetStatusBar()->Show(true); PositionStatusBar(); } } @@ -590,13 +590,13 @@ void wxFrame::PositionToolBar() int tw, th; toolbar->GetPosition(&tx, &ty); toolbar->GetSize(&tw, &th); - + // Adjust if (ty < 0 && (-ty == th)) ty = 0; if (tx < 0 && (-tx == tw)) - tx = 0; - + tx = 0; + int desiredW = tw; int desiredH = th; @@ -609,23 +609,23 @@ void wxFrame::PositionToolBar() desiredW = width; // if ( toolbar->GetWindowStyleFlag() & wxTB_FLAT ) // desiredW -= 3; - } + } // use the 'real' MSW position here, don't offset relativly to the // client area origin // Optimise such that we don't have to always resize the toolbar - // when the frame changes, otherwise we'll get a lot of flicker. + // when the frame changes, otherwise we'll get a lot of flicker. bool heightChanging wxDUMMY_INITIALIZE(true); bool widthChanging wxDUMMY_INITIALIZE(true); - + if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL ) { // It's OK if the current height is greater than what can be shown. heightChanging = (desiredH > th) ; widthChanging = (desiredW != tw) ; - - // The next time around, we may not have to set the size + + // The next time around, we may not have to set the size if (heightChanging) desiredH = desiredH + 200; } @@ -635,14 +635,14 @@ void wxFrame::PositionToolBar() widthChanging = (desiredW > tw) ; heightChanging = (desiredH != th) ; - // The next time around, we may not have to set the size + // The next time around, we may not have to set the size if (widthChanging) desiredW = desiredW + 200; } - + if (tx != 0 || ty != 0 || widthChanging || heightChanging) toolbar->SetSize(x, y, desiredW, desiredH, wxSIZE_NO_ADJUSTMENTS); - + #endif // __WXWINCE__ } } @@ -717,18 +717,18 @@ WXHICON wxFrame::GetDefaultIcon() const bool wxFrame::MSWTranslateMessage(WXMSG* pMsg) { if ( wxWindow::MSWTranslateMessage(pMsg) ) - return TRUE; + return true; #if wxUSE_MENUS && wxUSE_ACCEL && !defined(__WXUNIVERSAL__) // try the menu bar accels wxMenuBar *menuBar = GetMenuBar(); if ( !menuBar ) - return FALSE; + return false; const wxAcceleratorTable& acceleratorTable = menuBar->GetAccelTable(); return acceleratorTable.Translate(this, pMsg); #else - return FALSE; + return false; #endif // wxUSE_MENUS && wxUSE_ACCEL } @@ -739,7 +739,7 @@ bool wxFrame::MSWTranslateMessage(WXMSG* pMsg) bool wxFrame::HandlePaint() { RECT rect; - if ( GetUpdateRect(GetHwnd(), &rect, FALSE) ) + if ( ::GetUpdateRect(GetHwnd(), &rect, FALSE) ) { #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) if ( m_iconized ) @@ -773,7 +773,7 @@ bool wxFrame::HandlePaint() ::EndPaint(GetHwnd(), &ps); - return TRUE; + return true; } else #endif @@ -784,13 +784,13 @@ bool wxFrame::HandlePaint() else { // nothing to paint - processed - return TRUE; + return true; } } bool wxFrame::HandleSize(int x, int y, WXUINT id) { - bool processed = FALSE; + bool processed = false; #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) switch ( id ) @@ -803,9 +803,9 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id) break; // restore all child frames too - IconizeChildFrames(FALSE); + IconizeChildFrames(false); - (void)SendIconizeEvent(FALSE); + (void)SendIconizeEvent(false); // fall through @@ -815,11 +815,11 @@ bool wxFrame::HandleSize(int x, int y, WXUINT id) case SIZEICONIC: // iconize all child frames too - IconizeChildFrames(TRUE); + IconizeChildFrames(true); (void)SendIconizeEvent(); - m_iconized = TRUE; + m_iconized = true; break; } #endif @@ -890,11 +890,11 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) if ( ProcessCommand(id) ) { - return TRUE; + return true; } } - return FALSE; + return false; } bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) @@ -917,9 +917,9 @@ bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) // items opening popup menus (they don't have them anyhow) but do clear // the status line - otherwise, we would be left with the help message // for the previous item which doesn't apply any more - DoGiveHelp(wxEmptyString, FALSE); + DoGiveHelp(wxEmptyString, false); - return FALSE; + return false; } wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item); @@ -945,7 +945,7 @@ bool wxFrame::HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup) WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) { WXLRESULT rc = 0; - bool processed = FALSE; + bool processed = false; switch ( message ) { @@ -1027,7 +1027,7 @@ bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu) } } } - + wxMenuEvent event(wxEVT_MENU_OPEN, 0, menu); event.SetEventObject(this); -- 2.45.2