From 598ddd96f45745188c96f16757f7ceeaa0c8d70d Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Mon, 30 Aug 2004 10:18:55 +0000 Subject: [PATCH] Source cleaning: -1/wxID_ANY/wxDefaultCoord, ::, !!, TRUE/true, FALSE/false, whitespaces, tabs. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/joystick.h | 2 +- include/wx/msw/listbox.h | 2 +- include/wx/msw/listctrl.h | 12 ++-- include/wx/msw/mdi.h | 8 +-- include/wx/msw/menu.h | 6 +- include/wx/msw/menuitem.h | 6 +- include/wx/msw/metafile.h | 4 +- include/wx/msw/microwin.h | 8 +-- include/wx/msw/mimetype.h | 12 ++-- include/wx/msw/missing.h | 28 ++++---- include/wx/msw/msgdlg.h | 2 +- include/wx/msw/mslu.h | 8 +-- src/msw/joystick.cpp | 124 +++++++++++++++++------------------ src/msw/listbox.cpp | 20 +++--- src/msw/listctrl.cpp | 132 +++++++++++++++++++------------------- src/msw/main.cpp | 4 +- src/msw/mdi.cpp | 12 ++-- src/msw/menu.cpp | 64 +++++++++--------- src/msw/menuitem.cpp | 30 ++++----- src/msw/metafile.cpp | 30 ++++----- src/msw/mimetype.cpp | 66 +++++++++---------- 21 files changed, 290 insertions(+), 290 deletions(-) diff --git a/include/wx/msw/joystick.h b/include/wx/msw/joystick.h index f158816b3f..13a462b463 100644 --- a/include/wx/msw/joystick.h +++ b/include/wx/msw/joystick.h @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_JOYSTICK_H_ diff --git a/include/wx/msw/listbox.h b/include/wx/msw/listbox.h index f17e4a394c..d0acdcb949 100644 --- a/include/wx/msw/listbox.h +++ b/include/wx/msw/listbox.h @@ -91,7 +91,7 @@ public: virtual int FindString(const wxString& s) const; virtual bool IsSelected(int n) const; - virtual void SetSelection(int n, bool select = TRUE); + virtual void SetSelection(int n, bool select = true); virtual int GetSelection() const; virtual int GetSelections(wxArrayInt& aSelections) const; diff --git a/include/wx/msw/listctrl.h b/include/wx/msw/listctrl.h index e0d25d8730..6ba1bea220 100644 --- a/include/wx/msw/listctrl.h +++ b/include/wx/msw/listctrl.h @@ -90,7 +90,7 @@ public: wxListCtrl() { Init(); } wxListCtrl(wxWindow *parent, - wxWindowID id = -1, + wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_ICON, @@ -105,7 +105,7 @@ public: virtual ~wxListCtrl(); bool Create(wxWindow *parent, - wxWindowID id = -1, + wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_ICON, @@ -214,7 +214,7 @@ public: long GetTopItem() const ; // Add or remove a single window style - void SetSingleStyle(long style, bool add = TRUE) ; + void SetSingleStyle(long style, bool add = true) ; // Set the whole window style void SetWindowStyleFlag(long style) ; @@ -280,7 +280,7 @@ public: // Find an item whose label matches this string, starting from the item after 'start' // or the beginning if 'start' is -1. - long FindItem(long start, const wxString& str, bool partial = FALSE); + long FindItem(long start, const wxString& str, bool partial = false); // Find an item whose data matches this data, starting from the item after 'start' // or the beginning if 'start' is -1. @@ -390,10 +390,10 @@ protected: // ListView_GetItemCount bool m_ignoreChangeMessages; - // TRUE if we have any internal data (user data & attributes) + // true if we have any internal data (user data & attributes) bool m_AnyInternalData; - // TRUE if we have any items with custom attributes + // true if we have any items with custom attributes bool m_hasAnyAttr; // these functions are only used for virtual list view controls, i.e. the diff --git a/include/wx/msw/mdi.h b/include/wx/msw/mdi.h index 1d5e440809..714c097592 100644 --- a/include/wx/msw/mdi.h +++ b/include/wx/msw/mdi.h @@ -106,7 +106,7 @@ protected: wxMDIChildFrame * m_currentChild; wxMenu* m_windowMenu; - // TRUE if MDI Frame is intercepting commands, not child + // true if MDI Frame is intercepting commands, not child bool m_parentFrameActive; private: @@ -148,10 +148,10 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); - virtual bool IsTopLevel() const { return FALSE; } + virtual bool IsTopLevel() const { return false; } // MDI operations - virtual void Maximize(bool maximize = TRUE); + virtual void Maximize(bool maximize = true); virtual void Restore(); virtual void Activate(); @@ -178,7 +178,7 @@ protected: virtual void DoGetPosition(int *x, int *y) const; virtual void DoSetClientSize(int width, int height); virtual void InternalSetMenuBar(); - virtual bool IsMDIChild() const { return TRUE; } + virtual bool IsMDIChild() const { return true; } virtual WXHICON GetDefaultIcon() const; diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index ec5d4aba07..21853e4728 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -116,7 +116,7 @@ private: // terminate the current radio group, if any void EndRadioGroup(); - // if TRUE, insert a breal before appending the next item + // if true, insert a breal before appending the next item bool m_doBreak; // the position of the first item in the current radio group or -1 @@ -143,7 +143,7 @@ public : wxMenuInfo() { m_menu = NULL ; } virtual ~wxMenuInfo() { } - void Create( wxMenu *menu , const wxString &title ) + void Create( wxMenu *menu , const wxString &title ) { m_menu = menu ; m_title = title ; } wxMenu* GetMenu() const { return m_menu ; } wxString GetTitle() const { return m_title ; } @@ -159,7 +159,7 @@ WX_DECLARE_EXPORTED_LIST(wxMenuInfo, wxMenuInfoList ); class WXDLLEXPORT wxMenuBar : public wxMenuBarBase { public: - // ctors & dtor + // ctors & dtor // default constructor wxMenuBar(); // unused under MSW diff --git a/include/wx/msw/menuitem.h b/include/wx/msw/menuitem.h index 6cd72cb989..1fdaa5686a 100644 --- a/include/wx/msw/menuitem.h +++ b/include/wx/msw/menuitem.h @@ -47,8 +47,8 @@ public: virtual void SetText(const wxString& strName); virtual void SetCheckable(bool checkable); - virtual void Enable(bool bDoEnable = TRUE); - virtual void Check(bool bDoCheck = TRUE); + virtual void Enable(bool bDoEnable = true); + virtual void Check(bool bDoCheck = true); virtual bool IsChecked() const; // unfortunately needed to resolve ambiguity between @@ -79,7 +79,7 @@ private: // the positions of the first and last items of the radio group this item // belongs to or -1: start is the radio group start and is valid for all - // but first radio group items (m_isRadioGroupStart == FALSE), end is valid + // but first radio group items (m_isRadioGroupStart == false), end is valid // only for the first one union { diff --git a/include/wx/msw/metafile.h b/include/wx/msw/metafile.h index 8b8afe2bd3..97ade18838 100644 --- a/include/wx/msw/metafile.h +++ b/include/wx/msw/metafile.h @@ -106,7 +106,7 @@ public: virtual void SetMapMode(int mode); virtual void GetTextExtent(const wxString& string, long *x, long *y, long *descent = NULL, long *externalLeading = NULL, - wxFont *theFont = NULL, bool use16bit = FALSE) const; + wxFont *theFont = NULL, bool use16bit = false) const; // Implementation wxMetafile *GetMetaFile() const { return m_metaFile; } @@ -133,7 +133,7 @@ private: bool WXDLLEXPORT wxMakeMetafilePlaceable(const wxString& filename, float scale = 1.0); // Optional origin and extent -bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE); +bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = true); // ---------------------------------------------------------------------------- // wxMetafileDataObject is a specialization of wxDataObject for metafile data diff --git a/include/wx/msw/microwin.h b/include/wx/msw/microwin.h index 69bb4e1385..35b83275ed 100644 --- a/include/wx/msw/microwin.h +++ b/include/wx/msw/microwin.h @@ -33,7 +33,7 @@ HCURSOR SetCursor(HCURSOR hCursor); int GetScrollPosWX (HWND hWnd, int iSBar); BOOL ScrollWindow(HWND, int xAmount, int yAmount, - CONST RECT* lpRect, CONST RECT* lpClipRect); + CONST RECT* lpRect, CONST RECT* lpClipRect); HWND WindowFromPoint(POINT pt); SHORT GetKeyState(int nVirtKey); @@ -51,7 +51,7 @@ COLORREF GetTextColor(HDC hdc); COLORREF GetBkColor(HDC hdc); HPALETTE SelectPalette(HDC hdc, HPALETTE hPalette, BOOL b); BOOL IntersectClipRect(HDC hdc, int x, int y, - int w, int h); + int w, int h); BOOL GetClipBox(HDC hdc, RECT* rect); BOOL DrawIconEx(HDC hdc, int x, int y, HICON hIcon, int w, int h, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags); BOOL SetViewportExtEx(HDC hdc, int x, int y, LPSIZE lpSize); @@ -73,8 +73,8 @@ BOOL GetScrollPos (HWND hWnd, int iSBar, int* pPos); BOOL GetScrollRange (HWND hWnd, int iSBar, int* pMinPos, int* pMaxPos); BOOL SetScrollPos (HWND hWnd, int iSBar, int iNewPos); BOOL SetScrollRange (HWND hWnd, int iSBar, int iMinPos, int iMaxPos); -BOOL SetScrollInfo (HWND hWnd, int iSBar, - LPCSCROLLINFO lpsi, BOOL fRedraw); +BOOL SetScrollInfo (HWND hWnd, int iSBar, + LPCSCROLLINFO lpsi, BOOL fRedraw); BOOL GetScrollInfo(HWND hWnd, int iSBar, LPSCROLLINFO lpsi); BOOL ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow); HBITMAP WINAPI diff --git a/include/wx/msw/mimetype.h b/include/wx/msw/mimetype.h index 041ddcfd58..80406d9e43 100644 --- a/include/wx/msw/mimetype.h +++ b/include/wx/msw/mimetype.h @@ -57,10 +57,10 @@ public: bool Unassociate(); // 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); @@ -76,7 +76,7 @@ private: wxString GetVerbPath(const wxString& verb) const; // check that the registry key for our extension exists, create it if it - // doesn't, return FALSE if this failed + // doesn't, return false if this failed bool EnsureExtKeyExists(); wxString m_strFileType, // may be empty @@ -107,10 +107,10 @@ public: size_t EnumAllFileTypes(wxArrayString& mimetypes); // this are NOPs under Windows - bool ReadMailcap(const wxString& WXUNUSED(filename), bool WXUNUSED(fallback) = TRUE) - { return TRUE; } + bool ReadMailcap(const wxString& WXUNUSED(filename), bool WXUNUSED(fallback) = true) + { return true; } bool ReadMimeTypes(const wxString& WXUNUSED(filename)) - { return TRUE; } + { return true; } // create a new filetype association wxFileType *Associate(const wxFileTypeInfo& ftInfo); diff --git a/include/wx/msw/missing.h b/include/wx/msw/missing.h index f92d8075df..d4532496ae 100644 --- a/include/wx/msw/missing.h +++ b/include/wx/msw/missing.h @@ -185,7 +185,7 @@ typedef struct { #endif // ---------------------------------------------------------------------------- -// Toolbar define value missing +// Toolbar define value missing // ---------------------------------------------------------------------------- #if !defined(CCS_VERT) #define CCS_VERT 0x00000080L @@ -430,13 +430,13 @@ typedef struct { #define TVM_SETTEXTCOLOR (TV_FIRST + 30) #endif -#ifndef TVS_INFOTIP +#ifndef TVS_INFOTIP #define TVS_INFOTIP 2048 #endif #ifndef TVN_GETINFOTIPA - #define TVN_GETINFOTIPA (TVN_FIRST-13) - #define TVN_GETINFOTIPW (TVN_FIRST-14) + #define TVN_GETINFOTIPA (TVN_FIRST-13) + #define TVN_GETINFOTIPW (TVN_FIRST-14) #endif #ifndef TVN_GETINFOTIP @@ -497,24 +497,24 @@ typedef struct { #define HANGUL_CHARSET 129 #endif -#ifndef TME_HOVER - #define TME_HOVER 1 +#ifndef TME_HOVER + #define TME_HOVER 1 #endif -#ifndef TME_LEAVE - #define TME_LEAVE 2 +#ifndef TME_LEAVE + #define TME_LEAVE 2 #endif -#ifndef TME_QUERY - #define TME_QUERY 0x40000000 +#ifndef TME_QUERY + #define TME_QUERY 0x40000000 #endif -#ifndef TME_CANCEL - #define TME_CANCEL 0x80000000 +#ifndef TME_CANCEL + #define TME_CANCEL 0x80000000 #endif -#ifndef HOVER_DEFAULT - #define HOVER_DEFAULT 0xFFFFFFFF +#ifndef HOVER_DEFAULT + #define HOVER_DEFAULT 0xFFFFFFFF #endif #ifdef __DMC__ diff --git a/include/wx/msw/msgdlg.h b/include/wx/msw/msgdlg.h index a82784cff6..6732bf7add 100644 --- a/include/wx/msw/msgdlg.h +++ b/include/wx/msw/msgdlg.h @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_MSGBOXDLG_H_ diff --git a/include/wx/msw/mslu.h b/include/wx/msw/mslu.h index 50d33b92bc..4a54e7cee5 100644 --- a/include/wx/msw/mslu.h +++ b/include/wx/msw/mslu.h @@ -17,7 +17,7 @@ #include "wx/wxchar.h" #if !wxUSE_UNICODE_MSLU -inline bool wxUsingUnicowsDll() { return FALSE; } +inline bool wxUsingUnicowsDll() { return false; } #else // Returns true if we are running under Unicode emulation in Win9x environment. @@ -33,9 +33,9 @@ inline bool wxUsingUnicowsDll() #if wxUSE_GUI -WXDLLEXPORT int wxMSLU_DrawStateW(WXHDC dc, WXHBRUSH br, WXFARPROC outputFunc, - WXLPARAM lData, WXWPARAM wData, - int x, int y, int cx, int cy, +WXDLLEXPORT int wxMSLU_DrawStateW(WXHDC dc, WXHBRUSH br, WXFARPROC outputFunc, + WXLPARAM lData, WXWPARAM wData, + int x, int y, int cx, int cy, unsigned int flags); #define DrawStateW(dc, br, func, ld, wd, x, y, cx, cy, flags) \ wxMSLU_DrawStateW((WXHDC)dc,(WXHBRUSH)br,(WXFARPROC)func, \ diff --git a/src/msw/joystick.cpp b/src/msw/joystick.cpp index ac154cde1b..5ffab12251 100644 --- a/src/msw/joystick.cpp +++ b/src/msw/joystick.cpp @@ -50,34 +50,34 @@ IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) //////////////////////////////////////////////////////////////////////////// /** - johan@linkdata.se 2002-08-20: - Now returns only valid, functioning - joysticks, counting from the first - available and upwards. + johan@linkdata.se 2002-08-20: + Now returns only valid, functioning + joysticks, counting from the first + available and upwards. */ wxJoystick::wxJoystick(int joystick) { JOYINFO joyInfo; - int i, maxsticks; - - maxsticks = joyGetNumDevs(); - for( i=0; i= 0 && N < m_noItems, FALSE, + wxCHECK_MSG( N >= 0 && N < m_noItems, false, wxT("invalid index in wxListBox::Selected") ); - return SendMessage(GetHwnd(), LB_GETSEL, N, 0) == 0 ? FALSE : TRUE; + return SendMessage(GetHwnd(), LB_GETSEL, N, 0) == 0 ? false : true; } wxClientData* wxListBox::DoGetItemClientObject(int n) const @@ -716,7 +716,7 @@ bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) else { // some event we're not interested in - return FALSE; + return false; } wxCommandEvent event(evtType, m_windowId); @@ -732,7 +732,7 @@ bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) event.SetClientData( GetClientData(n) ); event.SetString( GetString(n) ); - event.SetExtraLong( HasMultipleSelection() ? IsSelected(n) : TRUE ); + event.SetExtraLong( HasMultipleSelection() ? IsSelected(n) : true ); } event.m_commandInt = n; @@ -761,7 +761,7 @@ bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) bool wxListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item) { // only owner-drawn control should receive this message - wxCHECK( ((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), FALSE ); + wxCHECK( ((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), false ); MEASUREITEMSTRUCT *pStruct = (MEASUREITEMSTRUCT *)item; @@ -782,25 +782,25 @@ bool wxListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item) DeleteDC(hdc); - return TRUE; + return true; } // forward the message to the appropriate item bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) { // only owner-drawn control should receive this message - wxCHECK( ((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), FALSE ); + wxCHECK( ((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), false ); DRAWITEMSTRUCT *pStruct = (DRAWITEMSTRUCT *)item; UINT itemID = pStruct->itemID; // the item may be -1 for an empty listbox if ( itemID == (UINT)-1 ) - return FALSE; + return false; long data = ListBox_GetItemData(GetHwnd(), pStruct->itemID); - wxCHECK( data && (data != LB_ERR), FALSE ); + wxCHECK( data && (data != LB_ERR), false ); wxListBoxItem *pItem = (wxListBoxItem *)data; diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index dfbc42e004..9f16e8d09d 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -250,7 +250,7 @@ wxBEGIN_FLAGS( wxListCtrlStyle ) wxFLAGS_MEMBER(wxBORDER_RAISED) wxFLAGS_MEMBER(wxBORDER_STATIC) wxFLAGS_MEMBER(wxBORDER_NONE) - + // old style border flags wxFLAGS_MEMBER(wxSIMPLE_BORDER) wxFLAGS_MEMBER(wxSUNKEN_BORDER) @@ -289,7 +289,7 @@ wxEND_FLAGS( wxListCtrlStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxListCtrl, wxControl,"wx/listctrl.h") wxBEGIN_PROPERTIES_TABLE(wxListCtrl) - wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent ) + wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent ) wxPROPERTY_FLAGS( WindowStyle , wxListCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style wxEND_PROPERTIES_TABLE() @@ -297,7 +297,7 @@ wxEND_PROPERTIES_TABLE() wxBEGIN_HANDLERS_TABLE(wxListCtrl) wxEND_HANDLERS_TABLE() -wxCONSTRUCTOR_5( wxListCtrl , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) +wxCONSTRUCTOR_5( wxListCtrl , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) /* TODO : Expose more information of a list's layout etc. via appropriate objects (à la NotebookPageInfo) @@ -328,13 +328,13 @@ void wxListCtrl::Init() m_imageListNormal = NULL; m_imageListSmall = NULL; m_imageListState = NULL; - m_ownsImageListNormal = m_ownsImageListSmall = m_ownsImageListState = FALSE; + m_ownsImageListNormal = m_ownsImageListSmall = m_ownsImageListState = false; m_colCount = 0; m_count = 0; - m_ignoreChangeMessages = FALSE; + m_ignoreChangeMessages = false; m_textCtrl = NULL; - m_AnyInternalData = FALSE; - m_hasAnyAttr = FALSE; + m_AnyInternalData = false; + m_hasAnyAttr = false; } bool wxListCtrl::Create(wxWindow *parent, @@ -346,10 +346,10 @@ bool wxListCtrl::Create(wxWindow *parent, const wxString& name) { if ( !CreateControl(parent, id, pos, size, style, validator, name) ) - return FALSE; + return false; if ( !MSWCreateControl(WC_LISTVIEW, _T(""), pos, size) ) - return FALSE; + return false; // explicitly say that we want to use Unicode because otherwise we get ANSI // versions of _some_ messages (notably LVN_GETDISPINFOA) in MSLU build @@ -363,7 +363,7 @@ bool wxListCtrl::Create(wxWindow *parent, 0, LVS_EX_FULLROWSELECT); } - return TRUE; + return true; } WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const @@ -464,12 +464,12 @@ void wxListCtrl::FreeAllInternalData() { int n = GetItemCount(); - m_ignoreChangeMessages = TRUE; + m_ignoreChangeMessages = true; for (int i = 0; i < n; i++) wxDeleteInternalData(this, i); - m_ignoreChangeMessages = FALSE; + m_ignoreChangeMessages = false; - m_AnyInternalData = FALSE; + m_AnyInternalData = false; } } @@ -555,18 +555,18 @@ wxListCtrl::GetClassDefaultAttributes(wxWindowVariant variant) bool wxListCtrl::SetForegroundColour(const wxColour& col) { if ( !wxWindow::SetForegroundColour(col) ) - return FALSE; + return false; ListView_SetTextColor(GetHwnd(), wxColourToRGB(col)); - return TRUE; + return true; } // Sets the background colour bool wxListCtrl::SetBackgroundColour(const wxColour& col) { if ( !wxWindow::SetBackgroundColour(col) ) - return FALSE; + return false; // we set the same colour for both the "empty" background and the items // background @@ -574,7 +574,7 @@ bool wxListCtrl::SetBackgroundColour(const wxColour& col) ListView_SetBkColor(GetHwnd(), color); ListView_SetTextBkColor(GetHwnd(), color); - return TRUE; + return true; } // Gets information about this column @@ -762,7 +762,7 @@ bool wxListCtrl::SetItem(wxListItem& info) if (! data) { // need to set it - m_AnyInternalData = TRUE; + m_AnyInternalData = true; data = new wxListItemInternalData(); item.lParam = (LPARAM) data; item.mask |= LVIF_PARAM; @@ -793,7 +793,7 @@ bool wxListCtrl::SetItem(wxListItem& info) { wxLogDebug(_T("ListView_SetItem() failed")); - return FALSE; + return false; } } @@ -803,10 +803,10 @@ bool wxListCtrl::SetItem(wxListItem& info) // check whether it has any custom attributes if ( info.HasAttributes() ) { - m_hasAnyAttr = TRUE; + m_hasAnyAttr = true; // if the colour has changed, we must redraw the item - updateNow = TRUE; + updateNow = true; } if ( updateNow ) @@ -815,7 +815,7 @@ bool wxListCtrl::SetItem(wxListItem& info) RefreshItem(item.iItem); } - return TRUE; + return true; } long wxListCtrl::SetItem(long index, int col, const wxString& label, int imageId) @@ -880,7 +880,7 @@ bool wxListCtrl::SetItemState(long item, long state, long stateMask) { wxLogLastError(_T("ListView_SetItemState")); - return FALSE; + return false; } if ( focusOld != -1 ) @@ -894,7 +894,7 @@ bool wxListCtrl::SetItemState(long item, long state, long stateMask) } } - return TRUE; + return true; } // Sets the item image @@ -1166,21 +1166,21 @@ void wxListCtrl::SetImageList(wxImageList *imageList, int which) flags = LVSIL_NORMAL; if (m_ownsImageListNormal) delete m_imageListNormal; m_imageListNormal = imageList; - m_ownsImageListNormal = FALSE; + m_ownsImageListNormal = false; } else if ( which == wxIMAGE_LIST_SMALL ) { flags = LVSIL_SMALL; if (m_ownsImageListSmall) delete m_imageListSmall; m_imageListSmall = imageList; - m_ownsImageListSmall = FALSE; + m_ownsImageListSmall = false; } else if ( which == wxIMAGE_LIST_STATE ) { flags = LVSIL_STATE; if (m_ownsImageListState) delete m_imageListState; m_imageListState = imageList; - m_ownsImageListState = FALSE; + m_ownsImageListState = false; } ListView_SetImageList(GetHwnd(), (HIMAGELIST) imageList ? imageList->GetHIMAGELIST() : 0, flags); } @@ -1189,11 +1189,11 @@ void wxListCtrl::AssignImageList(wxImageList *imageList, int which) { SetImageList(imageList, which); if ( which == wxIMAGE_LIST_NORMAL ) - m_ownsImageListNormal = TRUE; + m_ownsImageListNormal = true; else if ( which == wxIMAGE_LIST_SMALL ) - m_ownsImageListSmall = TRUE; + m_ownsImageListSmall = true; else if ( which == wxIMAGE_LIST_STATE ) - m_ownsImageListState = TRUE; + m_ownsImageListState = true; } // ---------------------------------------------------------------------------- @@ -1222,7 +1222,7 @@ bool wxListCtrl::DeleteItem(long item) if ( !ListView_DeleteItem(GetHwnd(), (int) item) ) { wxLogLastError(_T("ListView_DeleteItem")); - return FALSE; + return false; } m_count -= 1; @@ -1251,7 +1251,7 @@ bool wxListCtrl::DeleteItem(long item) RefreshRect(rectWin); } - return TRUE; + return true; } // Deletes all items @@ -1270,7 +1270,7 @@ bool wxListCtrl::DeleteAllColumns() { wxLogLastError(wxT("ListView_DeleteColumn")); - return FALSE; + return false; } m_colCount--; @@ -1278,7 +1278,7 @@ bool wxListCtrl::DeleteAllColumns() wxASSERT_MSG( m_colCount == 0, wxT("no columns should be left") ); - return TRUE; + return true; } // Deletes a column @@ -1340,13 +1340,13 @@ bool wxListCtrl::EndEditLabel(bool WXUNUSED(cancel)) { wxFAIL_MSG( _T("not implemented") ); - return FALSE; + return false; } // Ensures this item is visible bool wxListCtrl::EnsureVisible(long item) { - return ListView_EnsureVisible(GetHwnd(), (int) item, FALSE) != 0; + return ListView_EnsureVisible(GetHwnd(), (int) item, FALSE) != FALSE; } // Find an item whose label matches this string, starting from the item after 'start' @@ -1456,7 +1456,7 @@ long wxListCtrl::InsertItem(wxListItem& info) bool needInternalData = ((info.m_mask & wxLIST_MASK_DATA) || info.HasAttributes()); if (needInternalData) { - m_AnyInternalData = TRUE; + m_AnyInternalData = true; item.mask |= LVIF_PARAM; // internal stucture that manages data @@ -1473,7 +1473,7 @@ long wxListCtrl::InsertItem(wxListItem& info) data->attr = new wxListItemAttr(*info.GetAttributes()); // and remember that we have some now... - m_hasAnyAttr = TRUE; + m_hasAnyAttr = true; } }; @@ -1570,10 +1570,10 @@ bool wxListCtrl::ScrollList(int dx, int dy) { wxLogDebug(_T("ListView_Scroll(%d, %d) failed"), dx, dy); - return FALSE; + return false; } - return TRUE; + return true; } // Sort items. @@ -1625,10 +1625,10 @@ bool wxListCtrl::SortItems(wxListCtrlCompare fn, long data) { wxLogDebug(_T("ListView_SortItems() failed")); - return FALSE; + return false; } - return TRUE; + return true; } @@ -1644,17 +1644,17 @@ bool wxListCtrl::MSWCommand(WXUINT cmd, WXWORD id) wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, id); event.SetEventObject( this ); ProcessCommand(event); - return TRUE; + return true; } else if (cmd == EN_KILLFOCUS) { wxCommandEvent event(wxEVT_KILL_FOCUS, id); event.SetEventObject( this ); ProcessCommand(event); - return TRUE; + return true; } else - return FALSE; + return false; } bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) @@ -1736,7 +1736,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) #if defined(__WXWINCE__) && !defined(__HANDHELDPC__) && _WIN32_WCE < 400 if(nmhdr->code == GN_CONTEXTMENU) { ptClick = ((NMRGINFO*)nmhdr)->ptAction; - } else + } else #endif //__WXWINCE__ if ( !::GetCursorPos(&ptClick) ) { @@ -1774,13 +1774,13 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // This is a fix for a strange bug under XP. // Normally, info->iItem is a valid index, but // sometimes this is a silly (large) number - // and when we return FALSE via wxControl::MSWOnNotify + // and when we return false via wxControl::MSWOnNotify // to indicate that it hasn't yet been processed, // there's a GPF in Windows. - // By returning TRUE here, we avoid further processing + // By returning true here, we avoid further processing // of this strange message. if ( (unsigned)info->iItem >= (unsigned)GetColumnCount() ) - return TRUE; + return true; } // fall through @@ -1804,7 +1804,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) if ( m_ignoreChangeMessages && ( (nmLV->hdr.code == LVN_ITEMCHANGED) || (nmLV->hdr.code == LVN_ITEMCHANGING))) { - return TRUE; + return true; } @@ -1912,7 +1912,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) if (m_count == 0) // this should be prevented by the post-processing code below, // but "just in case" - return FALSE; + return false; eventType = wxEVT_COMMAND_LIST_DELETE_ITEM; event.m_itemIndex = iItem; @@ -1985,7 +1985,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) if ( eventType == wxEVT_NULL ) { // not an interesting event for us - return FALSE; + return false; } break; @@ -2036,7 +2036,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // anything else if ( wxControl::MSWOnNotify(idCtrl, lParam, result) ) { - return TRUE; + return true; } // else translate it into wxEVT_COMMAND_LIST_ITEM_ACTIVATED event @@ -2044,7 +2044,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) if ( iItem == -1 ) { // not on item - return FALSE; + return false; } eventType = wxEVT_COMMAND_LIST_ITEM_ACTIVATED; @@ -2061,7 +2061,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // don't do anything else if ( wxControl::MSWOnNotify(idCtrl, lParam, result) ) { - return TRUE; + return true; } // else translate it into wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK event @@ -2071,7 +2071,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) #if defined(__WXWINCE__) && !defined(__HANDHELDPC__) && _WIN32_WCE < 400 if(nmhdr->code == GN_CONTEXTMENU) { lvhti.pt = ((NMRGINFO*)nmhdr)->ptAction; - } else + } else #endif //__WXWINCE__ ::GetCursorPos(&(lvhti.pt)); ::ScreenToClient(GetHwnd(),&(lvhti.pt)); @@ -2091,7 +2091,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) case NM_CUSTOMDRAW: *result = OnCustomDraw(lParam); - return TRUE; + return true; #endif // _WIN32_IE >= 0x300 case LVN_ODCACHEHINT: @@ -2105,7 +2105,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // deleting an item, for items in invalid range -- filter // this garbage out if ( cacheHint->iFrom > cacheHint->iTo ) - return FALSE; + return false; event.m_oldItemIndex = cacheHint->iFrom; @@ -2142,7 +2142,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) wxASSERT_MSG( !(lvi.mask & LVIF_STATE), _T("we don't support state callbacks yet!") ); - return TRUE; + return true; } // fall through @@ -2153,7 +2153,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) else { // where did this one come from? - return FALSE; + return false; } // process the event @@ -2168,11 +2168,11 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) switch ( nmhdr->code ) { case LVN_DELETEALLITEMS: - // always return TRUE to suppress all additional LVN_DELETEITEM + // always return true to suppress all additional LVN_DELETEITEM // notifications - this makes deleting all items from a list ctrl // much faster *result = TRUE; - return TRUE; + return true; case LVN_ENDLABELEDITA: case LVN_ENDLABELEDITW: @@ -2190,7 +2190,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) m_textCtrl = NULL; } - return TRUE; + return true; } if ( processed ) @@ -2493,13 +2493,13 @@ static void wxConvertFromMSWListItem(HWND hwndListCtrl, long oldMask = lvItem.mask; - bool needText = FALSE; + bool needText = false; if (hwndListCtrl != 0) { if ( lvItem.mask & LVIF_TEXT ) - needText = FALSE; + needText = false; else - needText = TRUE; + needText = true; if ( needText ) { diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 8f842b4b0f..7568e9878f 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -131,8 +131,8 @@ DllMain(HANDLE hModule, DWORD fdwReason, LPVOID WXUNUSED(lpReserved)) break; } #else - (void)hModule; - (void)fdwReason; + (void)hModule; + (void)fdwReason; #endif // !WXMAKINGDLL return TRUE; diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 6b7b5d50a8..b1d924d27d 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -203,7 +203,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent, if ( parent ) parent->AddChild(this); - if ( id > -1 ) + if ( id != wxID_ANY ) m_windowId = id; else m_windowId = NewControlId(); @@ -655,7 +655,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, SetName(name); wxWindowBase::Show(true); // MDI child frame starts off shown - if ( id > -1 ) + if ( id != wxID_ANY ) m_windowId = id; else m_windowId = (int)NewControlId(); @@ -677,22 +677,22 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, : wxMDIChildFrameClassNameNoRedraw; mcs.szTitle = title; mcs.hOwner = wxGetInstance(); - if (x > -1) + if (x != wxDefaultCoord) mcs.x = x; else mcs.x = CW_USEDEFAULT; - if (y > -1) + if (y != wxDefaultCoord) mcs.y = y; else mcs.y = CW_USEDEFAULT; - if (width > -1) + if (width != wxDefaultCoord) mcs.cx = width; else mcs.cx = CW_USEDEFAULT; - if (height > -1) + if (height != wxDefaultCoord) mcs.cy = height; else mcs.cy = CW_USEDEFAULT; diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 1923ba92f2..d9f510cb85 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -106,7 +106,7 @@ UINT GetMenuState(HMENU hMenu, UINT id, UINT flags) wxZeroMemory(info); info.cbSize = sizeof(info); info.fMask = MIIM_STATE; - if ( !GetMenuItemInfo(hMenu, id, flags & MF_BYCOMMAND ? FALSE : TRUE, & info) ) + if ( !::GetMenuItemInfo(hMenu, id, flags & MF_BYCOMMAND ? FALSE : TRUE, & info) ) wxLogLastError(wxT("GetMenuItemInfo")); return info.fState; } @@ -173,7 +173,7 @@ wxEND_PROPERTIES_TABLE() wxBEGIN_HANDLERS_TABLE(wxMenuInfo) wxEND_HANDLERS_TABLE() -wxCONSTRUCTOR_2( wxMenuInfo , wxMenu* , Menu , wxString , Title ) +wxCONSTRUCTOR_2( wxMenuInfo , wxMenu* , Menu , wxString , Title ) wxCOLLECTION_TYPE_INFO( wxMenuInfo * , wxMenuInfoList ) ; @@ -217,7 +217,7 @@ const wxMenuInfoList& wxMenuBar::GetMenuInfos() const // Construct a menu with optional title (then use append) void wxMenu::Init() { - m_doBreak = FALSE; + m_doBreak = false; m_startRadioGroup = -1; // create the menu @@ -228,7 +228,7 @@ void wxMenu::Init() } // if we have a title, insert it in the beginning of the menu - if ( !!m_title ) + if ( !m_title.IsEmpty() ) { Append(idMenuTitle, m_title); AppendSeparator(); @@ -258,7 +258,7 @@ wxMenu::~wxMenu() void wxMenu::Break() { // this will take effect during the next call to Append() - m_doBreak = TRUE; + m_doBreak = true; } void wxMenu::Attach(wxMenuBarBase *menubar) @@ -345,7 +345,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) // (and don't forget to reset the flag) if ( m_doBreak ) { flags |= MF_MENUBREAK; - m_doBreak = FALSE; + m_doBreak = false; } if ( pItem->IsSeparator() ) { @@ -409,7 +409,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) { wxLogLastError(wxT("Insert or AppendMenu")); - return FALSE; + return false; } // if we just appended the title, highlight it @@ -427,7 +427,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) GetMenuBar()->Refresh(); } - return TRUE; + return true; } void wxMenu::EndRadioGroup() @@ -440,7 +440,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) { wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") ); - bool check = FALSE; + bool check = false; if ( item->GetKind() == wxITEM_RADIO ) { @@ -456,7 +456,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) item->SetRadioGroupEnd(m_startRadioGroup); // ensure that we have a checked item in the radio group - check = TRUE; + check = true; } else // extend the current radio group { @@ -487,7 +487,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) if ( check ) { // check the item initially - item->Check(TRUE); + item->Check(true); } return item; @@ -654,7 +654,7 @@ bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id) SendEvent(id, menuState & MF_CHECKED); } - return TRUE; + return true; } // --------------------------------------------------------------------------- @@ -733,7 +733,7 @@ wxMenuBar::~wxMenuBar() m_commandBar = (WXHWND) NULL; #else ::DestroyMenu((HMENU)m_hMenu); -#endif +#endif m_hMenu = (WXHMENU)NULL; } #endif @@ -777,12 +777,12 @@ WXHMENU wxMenuBar::Create() HMENU hMenu = (HMENU)::SendMessage(hCommandBar, SHCMBM_GETMENU, (WPARAM)0, (LPARAM)0); if (hMenu) { - TBBUTTON tbButton; + TBBUTTON tbButton; memset(&tbButton, 0, sizeof(TBBUTTON)); tbButton.iBitmap = I_IMAGENONE; tbButton.fsState = TBSTATE_ENABLED; tbButton.fsStyle = TBSTYLE_DROPDOWN | TBSTYLE_NO_DROPDOWN_ARROW | TBSTYLE_AUTOSIZE; - + size_t i; for (i = 0; i < GetMenuCount(); i++) { @@ -792,7 +792,7 @@ WXHMENU wxMenuBar::Create() tbButton.iString = (int) label.c_str(); int position = i; - + tbButton.idCommand = NewControlId(); if (!::SendMessage(hCommandBar, TB_INSERTBUTTON, position, (LPARAM)&tbButton)) { @@ -923,7 +923,7 @@ void wxMenuBar::SetLabelTop(size_t pos, const wxString& label) { wxLogLastError(wxT("SetMenuItemInfo")); } - + #else if ( ::ModifyMenu(GetHmenu(), mswpos, MF_BYPOSITION | MF_STRING | flagsOld, id, label) == (int)0xFFFFFFFF ) @@ -996,7 +996,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) : MSWPositionForWxMenu(GetMenu(pos),pos); if ( !wxMenuBarBase::Insert(pos, menu, title) ) - return FALSE; + return false; m_titles.Insert(title, pos); @@ -1004,23 +1004,23 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) { #if defined(WINCE_WITHOUT_COMMANDAR) if (!GetToolBar()) - return FALSE; - TBBUTTON tbButton; + return false; + TBBUTTON tbButton; memset(&tbButton, 0, sizeof(TBBUTTON)); tbButton.iBitmap = I_IMAGENONE; tbButton.fsState = TBSTATE_ENABLED; tbButton.fsStyle = TBSTYLE_DROPDOWN | TBSTYLE_NO_DROPDOWN_ARROW | TBSTYLE_AUTOSIZE; - + HMENU hPopupMenu = (HMENU) menu->GetHMenu() ; tbButton.dwData = (DWORD)hPopupMenu; wxString label = wxStripMenuCodes(title); tbButton.iString = (int) label.c_str(); - + tbButton.idCommand = NewControlId(); if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_INSERTBUTTON, pos, (LPARAM)&tbButton)) { wxLogLastError(wxT("TB_INSERTBUTTON")); - return FALSE; + return false; } #else if ( !::InsertMenu(GetHmenu(), mswpos, @@ -1041,16 +1041,16 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) Refresh(); } - return TRUE; + return true; } bool wxMenuBar::Append(wxMenu *menu, const wxString& title) { WXHMENU submenu = menu ? menu->GetHMenu() : 0; - wxCHECK_MSG( submenu, FALSE, wxT("can't append invalid menu to menubar") ); + wxCHECK_MSG( submenu, false, wxT("can't append invalid menu to menubar") ); if ( !wxMenuBarBase::Append(menu, title) ) - return FALSE; + return false; m_titles.Add(title); @@ -1058,24 +1058,24 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title) { #if defined(WINCE_WITHOUT_COMMANDAR) if (!GetToolBar()) - return FALSE; - TBBUTTON tbButton; + return false; + TBBUTTON tbButton; memset(&tbButton, 0, sizeof(TBBUTTON)); tbButton.iBitmap = I_IMAGENONE; tbButton.fsState = TBSTATE_ENABLED; tbButton.fsStyle = TBSTYLE_DROPDOWN | TBSTYLE_NO_DROPDOWN_ARROW | TBSTYLE_AUTOSIZE; - + size_t pos = GetMenuCount(); HMENU hPopupMenu = (HMENU) menu->GetHMenu() ; tbButton.dwData = (DWORD)hPopupMenu; wxString label = wxStripMenuCodes(title); tbButton.iString = (int) label.c_str(); - + tbButton.idCommand = NewControlId(); if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_INSERTBUTTON, pos, (LPARAM)&tbButton)) { wxLogLastError(wxT("TB_INSERTBUTTON")); - return FALSE; + return false; } #else if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING, @@ -1096,7 +1096,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title) Refresh(); } - return TRUE; + return true; } wxMenu *wxMenuBar::Remove(size_t pos) diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index 2acfe24a1b..8b9127fe3f 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -92,24 +92,24 @@ bool wxMenuItemStreamingCallback( const wxObject *object, wxWriter * , wxPersist } wxBEGIN_ENUM( wxItemKind ) - wxENUM_MEMBER( wxITEM_SEPARATOR ) - wxENUM_MEMBER( wxITEM_NORMAL ) - wxENUM_MEMBER( wxITEM_CHECK ) - wxENUM_MEMBER( wxITEM_RADIO ) + wxENUM_MEMBER( wxITEM_SEPARATOR ) + wxENUM_MEMBER( wxITEM_NORMAL ) + wxENUM_MEMBER( wxITEM_CHECK ) + wxENUM_MEMBER( wxITEM_RADIO ) wxEND_ENUM( wxItemKind ) IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxMenuItem, wxObject,"wx/menuitem.h",wxMenuItemStreamingCallback) wxBEGIN_PROPERTIES_TABLE(wxMenuItem) - wxPROPERTY( Parent,wxMenu*, SetMenu, GetMenu, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) - wxPROPERTY( Id,int, SetId, GetId, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) + wxPROPERTY( Parent,wxMenu*, SetMenu, GetMenu, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) + wxPROPERTY( Id,int, SetId, GetId, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) wxPROPERTY( Text, wxString , SetText, GetText, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) wxPROPERTY( Help, wxString , SetHelp, GetHelp, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) wxREADONLY_PROPERTY( Kind, wxItemKind , GetKind , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) - wxPROPERTY( SubMenu,wxMenu*, SetSubMenu, GetSubMenu, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) - wxPROPERTY( Enabled , bool , Enable , IsEnabled , wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY( Checked , bool , Check , IsChecked , wxxVariant((bool)false) , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY( Checkable , bool , SetCheckable , IsCheckable , wxxVariant((bool)false) , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + wxPROPERTY( SubMenu,wxMenu*, SetSubMenu, GetSubMenu, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) + wxPROPERTY( Enabled , bool , Enable , IsEnabled , wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + wxPROPERTY( Checked , bool , Check , IsChecked , wxxVariant((bool)false) , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + wxPROPERTY( Checkable , bool , SetCheckable , IsCheckable , wxxVariant((bool)false) , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) wxEND_PROPERTIES_TABLE() wxBEGIN_HANDLERS_TABLE(wxMenuItem) @@ -159,7 +159,7 @@ wxMenuItem::wxMenuItem(wxMenu *parentMenu, void wxMenuItem::Init() { m_radioGroup.start = -1; - m_isRadioGroupStart = FALSE; + m_isRadioGroupStart = false; #if wxUSE_OWNER_DRAWN // set default menu colors @@ -196,7 +196,7 @@ int wxMenuItem::GetRealId() const bool wxMenuItem::IsChecked() const { - // fix that RTTI is always getting the correct state (separators cannot be checked, but the call below + // fix that RTTI is always getting the correct state (separators cannot be checked, but the call below // returns true if ( GetId() == wxID_SEPARATOR ) return false ; @@ -217,7 +217,7 @@ wxString wxMenuItemBase::GetLabelFromText(const wxString& text) void wxMenuItem::SetAsRadioGroupStart() { - m_isRadioGroupStart = TRUE; + m_isRadioGroupStart = true; } void wxMenuItem::SetRadioGroupStart(int start) @@ -318,7 +318,7 @@ void wxMenuItem::Check(bool check) { if ( n != pos ) { - node->GetData()->m_isChecked = FALSE; + node->GetData()->m_isChecked = false; } node = node->GetNext(); @@ -401,7 +401,7 @@ void wxMenuItem::SetText(const wxString& text) info.fType = MFT_STRING; info.cch = text.Length(); info.dwTypeData = (LPTSTR) data ; - if ( !SetMenuItemInfo(hMenu, id, FALSE, & info) ) + if ( !::SetMenuItemInfo(hMenu, id, FALSE, & info) ) { wxLogLastError(wxT("SetMenuItemInfo")); } diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index f39c90d320..ec6f66f44f 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -105,17 +105,17 @@ wxMetafile::~wxMetafile() bool wxMetafile::SetClipboard(int width, int height) { #if !wxUSE_CLIPBOARD - return FALSE; + return false; #else if (!m_refData) - return FALSE; + return false; bool alreadyOpen = wxClipboardOpen(); if (!alreadyOpen) { wxOpenClipboard(); if (!wxEmptyClipboard()) - return FALSE; + return false; } bool success = wxSetClipboardData(wxDF_METAFILE, this, width,height); if (!alreadyOpen) @@ -128,7 +128,7 @@ bool wxMetafile::SetClipboard(int width, int height) bool wxMetafile::Play(wxDC *dc) { if (!m_refData) - return FALSE; + return false; dc->BeginDrawing(); @@ -143,7 +143,7 @@ bool wxMetafile::Play(wxDC *dc) dc->EndDrawing(); - return TRUE; + return true; } void wxMetafile::SetHMETAFILE(WXHANDLE mf) @@ -201,11 +201,11 @@ wxMetafileDC::wxMetafileDC(const wxString& file, int xext, int yext, int xorg, i m_minY = 10000; m_maxX = -10000; m_maxY = -10000; - if ( !!file && wxFileExists(file)) + if ( !file.IsEmpty() && wxFileExists(file)) wxRemoveFile(file); m_hDC = (WXHDC) CreateMetaFile(file); - m_ok = TRUE; + m_ok = true; ::SetWindowOrgEx((HDC) m_hDC,xorg,yorg, NULL); ::SetWindowExtEx((HDC) m_hDC,xext,yext, NULL); @@ -351,7 +351,7 @@ struct mfPLACEABLEHEADER { bool wxMakeMetafilePlaceable(const wxString& filename, float scale) { - return wxMakeMetafilePlaceable(filename, 0, 0, 0, 0, scale, FALSE); + return wxMakeMetafilePlaceable(filename, 0, 0, 0, 0, scale, false); } bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale, bool useOriginAndExtent) @@ -378,13 +378,13 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i pMFHead ->checksum ^= *p; FILE *fd = wxFopen(filename.fn_str(), _T("rb")); - if (!fd) return FALSE; + if (!fd) return false; wxChar tempFileBuf[256]; wxGetTempFileName(wxT("mf"), tempFileBuf); FILE *fHandle = wxFopen(wxFNCONV(tempFileBuf), _T("wb")); if (!fHandle) - return FALSE; + return false; fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle); // Calculate origin and extent @@ -449,7 +449,7 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i wxRemoveFile(filename); wxCopyFile(tempFileBuf, filename); wxRemoveFile(tempFileBuf); - return TRUE; + return true; } @@ -469,7 +469,7 @@ bool wxMetafileDataObject::GetDataHere(void *buf) const METAFILEPICT *mfpict = (METAFILEPICT *)buf; const wxMetafile& mf = GetMetafile(); - wxCHECK_MSG( mf.GetHMETAFILE(), FALSE, _T("copying invalid metafile") ); + wxCHECK_MSG( mf.GetHMETAFILE(), false, _T("copying invalid metafile") ); // doesn't seem to work with any other mapping mode... mfpict->mm = MM_ANISOTROPIC; //mf.GetWindowsMappingMode(); @@ -482,7 +482,7 @@ bool wxMetafileDataObject::GetDataHere(void *buf) const mfpict->hMF = CopyMetaFile((HMETAFILE)mf.GetHMETAFILE(), NULL); - return TRUE; + return true; } bool wxMetafileDataObject::SetData(size_t WXUNUSED(len), const void *buf) @@ -505,11 +505,11 @@ bool wxMetafileDataObject::SetData(size_t WXUNUSED(len), const void *buf) mf.SetHeight(h); mf.SetHMETAFILE((WXHANDLE)mfpict->hMF); - wxCHECK_MSG( mfpict->hMF, FALSE, _T("pasting invalid metafile") ); + wxCHECK_MSG( mfpict->hMF, false, _T("pasting invalid metafile") ); SetMetafile(mf); - return TRUE; + return true; } #endif // wxUSE_DRAG_AND_DROP diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index c4e8974a98..0e27060a7e 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -192,11 +192,11 @@ bool wxFileTypeImpl::EnsureExtKeyExists() { wxLogError(_("Failed to create registry entry for '%s' files."), m_ext.c_str()); - return FALSE; + return false; } } - return TRUE; + return true; } // ---------------------------------------------------------------------------- @@ -306,14 +306,14 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) if ( m_ext.IsEmpty() ) { // the only way to get the list of extensions from the file type is to // scan through all extensions in the registry - too slow... - return FALSE; + return false; } else { extensions.Empty(); extensions.Add(m_ext); // it's a lie too, we don't return _all_ extensions... - return TRUE; + return true; } } @@ -333,12 +333,12 @@ bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const if ( !GetMimeType(&s) ) { - return FALSE; + return false; } mimeTypes.Clear(); mimeTypes.Add(s); - return TRUE; + return true; } @@ -375,12 +375,12 @@ bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const iconLoc->SetIndex(wxAtoi(strIndex)); } - return TRUE; + return true; } } // no such file type or no value or incorrect icon entry - return FALSE; + return false; } bool wxFileTypeImpl::GetDescription(wxString *desc) const @@ -392,11 +392,11 @@ bool wxFileTypeImpl::GetDescription(wxString *desc) const if ( key.Open(wxRegKey::Read) ) { // it's the default value of the key if ( key.QueryValue(wxEmptyString, *desc) ) { - return TRUE; + return true; } } - return FALSE; + return false; } // helper function @@ -422,7 +422,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext) // suppress possible error messages wxLogNull nolog; - bool knownExtension = FALSE; + bool knownExtension = false; wxString strFileType; wxRegKey key(wxRegKey::HKCR, str); @@ -436,7 +436,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext) // this extension doesn't have a filetype, but it's known to the // system and may be has some other useful keys (open command or // content-type), so still return a file type object for it - knownExtension = TRUE; + knownExtension = true; } } @@ -651,11 +651,11 @@ bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool WXUNUSED(overwriteprompt)) { - wxCHECK_MSG( !m_ext.IsEmpty() && !verb.IsEmpty(), FALSE, + wxCHECK_MSG( !m_ext.IsEmpty() && !verb.IsEmpty(), false, _T("SetCommand() needs an extension and a verb") ); if ( !EnsureExtKeyExists() ) - return FALSE; + return false; wxRegKey rkey(wxRegKey::HKCR, GetVerbPath(verb)); #if 0 @@ -680,7 +680,7 @@ bool wxFileTypeImpl::SetCommand(const wxString& cmd, #endif // wxUSE_GUI { // cancelled by user - return FALSE; + return false; } } #endif @@ -693,10 +693,10 @@ bool wxFileTypeImpl::SetCommand(const wxString& cmd, /* // no longer used bool wxFileTypeImpl::SetMimeType(const wxString& mimeTypeOrig) { - wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, _T("SetMimeType() needs extension") ); + wxCHECK_MSG( !m_ext.IsEmpty(), false, _T("SetMimeType() needs extension") ); if ( !EnsureExtKeyExists() ) - return FALSE; + return false; // VZ: is this really useful? (FIXME) wxString mimeType; @@ -719,13 +719,13 @@ bool wxFileTypeImpl::SetMimeType(const wxString& mimeTypeOrig) bool wxFileTypeImpl::SetDefaultIcon(const wxString& cmd, int index) { - wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, _T("SetDefaultIcon() needs extension") ); - wxCHECK_MSG( !m_strFileType.IsEmpty(), FALSE, _T("File key not found") ); + wxCHECK_MSG( !m_ext.IsEmpty(), false, _T("SetDefaultIcon() needs extension") ); + wxCHECK_MSG( !m_strFileType.IsEmpty(), false, _T("File key not found") ); // the next line fails on a SMBshare, I think because it is case mangled -// wxCHECK_MSG( !wxFileExists(cmd), FALSE, _T("Icon file not found.") ); +// wxCHECK_MSG( !wxFileExists(cmd), false, _T("Icon file not found.") ); if ( !EnsureExtKeyExists() ) - return FALSE; + return false; wxRegKey rkey(wxRegKey::HKCR, m_strFileType + _T("\\DefaultIcon")); @@ -736,11 +736,11 @@ bool wxFileTypeImpl::SetDefaultIcon(const wxString& cmd, int index) bool wxFileTypeImpl::SetDescription (const wxString& desc) { - wxCHECK_MSG( !m_strFileType.IsEmpty(), FALSE, _T("File key not found") ); - wxCHECK_MSG( !desc.IsEmpty(), FALSE, _T("No file description supplied") ); + wxCHECK_MSG( !m_strFileType.IsEmpty(), false, _T("File key not found") ); + wxCHECK_MSG( !desc.IsEmpty(), false, _T("No file description supplied") ); if ( !EnsureExtKeyExists() ) - return FALSE; + return false; wxRegKey rkey(wxRegKey::HKCR, m_strFileType ); @@ -754,15 +754,15 @@ bool wxFileTypeImpl::SetDescription (const wxString& desc) bool wxFileTypeImpl::Unassociate() { - bool result = TRUE; + bool result = true; if ( !RemoveOpenCommand() ) - result = FALSE; + result = false; if ( !RemoveDefaultIcon() ) - result = FALSE; + result = false; if ( !RemoveMimeType() ) - result = FALSE; + result = false; if ( !RemoveDescription() ) - result = FALSE; + result = false; /* //this might hold other keys, eg some have CSLID keys @@ -784,7 +784,7 @@ bool wxFileTypeImpl::RemoveOpenCommand() bool wxFileTypeImpl::RemoveCommand(const wxString& verb) { - wxCHECK_MSG( !m_ext.IsEmpty() && !verb.IsEmpty(), FALSE, + wxCHECK_MSG( !m_ext.IsEmpty() && !verb.IsEmpty(), false, _T("RemoveCommand() needs an extension and a verb") ); wxString sKey = m_strFileType; @@ -796,7 +796,7 @@ bool wxFileTypeImpl::RemoveCommand(const wxString& verb) bool wxFileTypeImpl::RemoveMimeType() { - wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, _T("RemoveMimeType() needs extension") ); + wxCHECK_MSG( !m_ext.IsEmpty(), false, _T("RemoveMimeType() needs extension") ); wxRegKey rkey(wxRegKey::HKCR, m_ext); return !rkey.Exists() || rkey.DeleteSelf(); @@ -804,7 +804,7 @@ bool wxFileTypeImpl::RemoveMimeType() bool wxFileTypeImpl::RemoveDefaultIcon() { - wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, + wxCHECK_MSG( !m_ext.IsEmpty(), false, _T("RemoveDefaultIcon() needs extension") ); wxRegKey rkey (wxRegKey::HKCR, m_strFileType + _T("\\DefaultIcon")); @@ -813,7 +813,7 @@ bool wxFileTypeImpl::RemoveDefaultIcon() bool wxFileTypeImpl::RemoveDescription() { - wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, + wxCHECK_MSG( !m_ext.IsEmpty(), false, _T("RemoveDescription() needs extension") ); wxRegKey rkey (wxRegKey::HKCR, m_strFileType ); -- 2.45.2