Source cleaning: -1/wxID_ANY/wxDefaultCoord, ::, TRUE/true. FALSE/false, tabs, whitespaces.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29036 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-09-07 06:01:01 +00:00
parent 6181913e8e
commit bfbb0b4c77
14 changed files with 221 additions and 221 deletions

View File

@@ -156,9 +156,9 @@ private:
typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&); typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&);
#define EVT_TAB_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGED, \ #define EVT_TAB_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGED, \
id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL), id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL),
#define EVT_TAB_SEL_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGING, \ #define EVT_TAB_SEL_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGING, \
id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL), id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL),
#endif #endif
// _WX_TABCTRL_H_ // _WX_TABCTRL_H_

View File

@@ -61,7 +61,7 @@ public:
const wxBitmap& pushedBitmap, const wxBitmap& pushedBitmap,
bool toggle, bool toggle,
wxCoord xPos, wxCoord xPos,
wxCoord yPos = -1, wxCoord yPos = wxDefaultCoord,
wxObject *clientData = NULL, wxObject *clientData = NULL,
const wxString& helpString1 = wxEmptyString, const wxString& helpString1 = wxEmptyString,
const wxString& helpString2 = wxEmptyString); const wxString& helpString2 = wxEmptyString);

View File

@@ -220,10 +220,10 @@ protected:
// replace the contents of the selection or of the entire control with the // replace the contents of the selection or of the entire control with the
// given text // given text
void DoWriteText(const wxString& text, bool selectionOnly = TRUE); void DoWriteText(const wxString& text, bool selectionOnly = true);
// set the selection possibly without scrolling the caret into view // set the selection possibly without scrolling the caret into view
void DoSetSelection(long from, long to, bool scrollCaret = TRUE); void DoSetSelection(long from, long to, bool scrollCaret = true);
// return true if there is a non empty selection in the control // return true if there is a non empty selection in the control
bool HasSelection() const; bool HasSelection() const;
@@ -232,7 +232,7 @@ protected:
// position // position
long GetLengthOfLineContainingPos(long pos) const; long GetLengthOfLineContainingPos(long pos) const;
// send TEXT_UPDATED event, return TRUE if it was handled, FALSE otherwise // send TEXT_UPDATED event, return true if it was handled, false otherwise
bool SendUpdateEvent(); bool SendUpdateEvent();
// override some base class virtuals // override some base class virtuals
@@ -248,7 +248,7 @@ protected:
int m_verRichEdit; int m_verRichEdit;
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT
// if TRUE, SendUpdateEvent() will eat the next event (see comments in the // if true, SendUpdateEvent() will eat the next event (see comments in the
// code as to why this is needed) // code as to why this is needed)
bool m_suppressNextUpdate; bool m_suppressNextUpdate;

View File

@@ -22,11 +22,11 @@ friend void wxProcessTimer(wxTimer& timer);
public: public:
wxTimer() { Init(); } wxTimer() { Init(); }
wxTimer(wxEvtHandler *owner, int id = -1) : wxTimerBase(owner, id) wxTimer(wxEvtHandler *owner, int id = wxID_ANY) : wxTimerBase(owner, id)
{ Init(); } { Init(); }
~wxTimer(); ~wxTimer();
virtual bool Start(int milliseconds = -1, bool oneShot = FALSE); virtual bool Start(int milliseconds = -1, bool oneShot = false);
virtual void Stop(); virtual void Stop();
virtual bool IsRunning() const { return m_id != 0; } virtual bool IsRunning() const { return m_id != 0; }

View File

@@ -50,9 +50,9 @@ public:
virtual ~wxTopLevelWindowMSW(); virtual ~wxTopLevelWindowMSW();
// implement base class pure virtuals // implement base class pure virtuals
virtual void Maximize(bool maximize = TRUE); virtual void Maximize(bool maximize = true);
virtual bool IsMaximized() const; virtual bool IsMaximized() const;
virtual void Iconize(bool iconize = TRUE); virtual void Iconize(bool iconize = true);
virtual bool IsIconized() const; virtual bool IsIconized() const;
virtual void SetIcon(const wxIcon& icon); virtual void SetIcon(const wxIcon& icon);
virtual void SetIcons(const wxIconBundle& icons ); virtual void SetIcons(const wxIconBundle& icons );
@@ -62,14 +62,14 @@ public:
virtual bool SetShape(const wxRegion& region); virtual bool SetShape(const wxRegion& region);
#endif // __WXWINCE__ #endif // __WXWINCE__
virtual bool Show(bool show = TRUE); virtual bool Show(bool show = true);
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
virtual bool IsFullScreen() const { return m_fsIsShowing; } virtual bool IsFullScreen() const { return m_fsIsShowing; }
// wxMSW only: EnableCloseButton(FALSE) may be used to remove the "Close" // wxMSW only: EnableCloseButton(false) may be used to remove the "Close"
// button from the title bar // button from the title bar
bool EnableCloseButton(bool enable = TRUE); bool EnableCloseButton(bool enable = true);
// implementation from now on // implementation from now on
// -------------------------- // --------------------------
@@ -91,13 +91,13 @@ protected:
// common part of all ctors // common part of all ctors
void Init(); void Init();
// create a new frame, return FALSE if it couldn't be created // create a new frame, return false if it couldn't be created
bool CreateFrame(const wxString& title, bool CreateFrame(const wxString& title,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size); const wxSize& size);
// create a new dialog using the given dialog template from resources, // create a new dialog using the given dialog template from resources,
// return FALSE if it couldn't be created // return false if it couldn't be created
bool CreateDialog(const void *dlgTemplate, bool CreateDialog(const void *dlgTemplate,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,

View File

@@ -118,7 +118,7 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
return TRUE; return true;
} }
wxTabCtrl::~wxTabCtrl() wxTabCtrl::~wxTabCtrl()
@@ -215,13 +215,13 @@ bool wxTabCtrl::GetItemRect(int item, wxRect& wxrect) const
{ {
RECT rect; RECT rect;
if ( !TabCtrl_GetItemRect( (HWND) GetHWND(), item, & rect) ) if ( !TabCtrl_GetItemRect( (HWND) GetHWND(), item, & rect) )
return FALSE; return false;
else else
{ {
wxrect.x = rect.left; wxrect.y = rect.top; wxrect.x = rect.left; wxrect.y = rect.top;
wxrect.width = rect.right - rect.left; wxrect.width = rect.right - rect.left;
wxrect.height = rect.bottom - rect.top; wxrect.height = rect.bottom - rect.top;
return TRUE; return true;
} }
} }

View File

@@ -81,7 +81,7 @@ class wxTaskBarIconWindow : public wxFrame
{ {
public: public:
wxTaskBarIconWindow(wxTaskBarIcon *icon) wxTaskBarIconWindow(wxTaskBarIcon *icon)
: wxFrame(NULL, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0), : wxFrame(NULL, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0),
m_icon(icon) m_icon(icon)
{ {
} }

View File

@@ -238,11 +238,11 @@ bool wxToolBar::Create(wxWindow *parent,
{ {
// common initialisation // common initialisation
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
return FALSE; return false;
// MSW-specific initialisation // MSW-specific initialisation
if ( !MSWCreateToolbar(pos, size) ) if ( !MSWCreateToolbar(pos, size) )
return FALSE; return false;
wxSetCCUnicodeFormat(GetHwnd()); wxSetCCUnicodeFormat(GetHwnd());
@@ -270,18 +270,18 @@ bool wxToolBar::Create(wxWindow *parent,
} }
#endif #endif
return TRUE; return true;
} }
bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size) bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size)
{ {
if ( !MSWCreateControl(TOOLBARCLASSNAME, wxEmptyString, pos, size) ) if ( !MSWCreateControl(TOOLBARCLASSNAME, wxEmptyString, pos, size) )
return FALSE; return false;
// toolbar-specific post initialisation // toolbar-specific post initialisation
::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); ::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
return TRUE; return true;
} }
void wxToolBar::Recreate() void wxToolBar::Recreate()
@@ -413,7 +413,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
tool->Attach(this); tool->Attach(this);
InvalidateBestSize(); InvalidateBestSize();
return TRUE; return true;
} }
bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
@@ -470,7 +470,7 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
{ {
wxLogLastError(wxT("TB_DELETEBUTTON")); wxLogLastError(wxT("TB_DELETEBUTTON"));
return FALSE; return false;
} }
} }
@@ -486,12 +486,12 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
int x; int x;
wxControl *control = tool2->GetControl(); wxControl *control = tool2->GetControl();
control->GetPosition(&x, NULL); control->GetPosition(&x, NULL);
control->Move(x - width, -1); control->Move(x - width, wxDefaultCoord);
} }
} }
InvalidateBestSize(); InvalidateBestSize();
return TRUE; return true;
} }
bool wxToolBar::Realize() bool wxToolBar::Realize()
@@ -500,7 +500,7 @@ bool wxToolBar::Realize()
if ( nTools == 0 ) if ( nTools == 0 )
{ {
// nothing to do // nothing to do
return TRUE; return true;
} }
const bool isVertical = HasFlag(wxTB_VERTICAL); const bool isVertical = HasFlag(wxTB_VERTICAL);
@@ -573,7 +573,7 @@ bool wxToolBar::Realize()
{ {
wxLogLastError(_T("CreateCompatibleBitmap")); wxLogLastError(_T("CreateCompatibleBitmap"));
return FALSE; return false;
} }
m_hBitmap = (WXHBITMAP)hBitmap; m_hBitmap = (WXHBITMAP)hBitmap;
@@ -618,7 +618,7 @@ bool wxToolBar::Realize()
int yOffset = wxMax(0, (m_defaultHeight - bmp.GetHeight())/2); int yOffset = wxMax(0, (m_defaultHeight - bmp.GetHeight())/2);
#if USE_BITMAP_MASKS #if USE_BITMAP_MASKS
// notice the last parameter: do use mask // notice the last parameter: do use mask
dcAllButtons.DrawBitmap(bmp, x+xOffset, yOffset, TRUE); dcAllButtons.DrawBitmap(bmp, x+xOffset, yOffset, true);
#else // !USE_BITMAP_MASKS #else // !USE_BITMAP_MASKS
SelectInHDC hdcSelector2(memoryDC2, GetHbitmapOf(bmp)); SelectInHDC hdcSelector2(memoryDC2, GetHbitmapOf(bmp));
if ( !BitBlt(memoryDC, if ( !BitBlt(memoryDC,
@@ -657,7 +657,7 @@ bool wxToolBar::Realize()
totalBitmapWidth, totalBitmapHeight); totalBitmapWidth, totalBitmapHeight);
} }
bool addBitmap = TRUE; bool addBitmap = true;
if ( oldToolBarBitmap ) if ( oldToolBarBitmap )
{ {
@@ -679,7 +679,7 @@ bool wxToolBar::Realize()
::DeleteObject(oldToolBarBitmap); ::DeleteObject(oldToolBarBitmap);
// already done // already done
addBitmap = FALSE; addBitmap = false;
} }
else else
#endif // TB_REPLACEBITMAP #endif // TB_REPLACEBITMAP
@@ -687,7 +687,7 @@ bool wxToolBar::Realize()
// we can't replace the old bitmap, so we will add another one // we can't replace the old bitmap, so we will add another one
// (awfully inefficient, but what else to do?) and shift the bitmap // (awfully inefficient, but what else to do?) and shift the bitmap
// indices accordingly // indices accordingly
addBitmap = TRUE; addBitmap = true;
bitmapId = m_nButtons; bitmapId = m_nButtons;
} }
@@ -722,7 +722,7 @@ bool wxToolBar::Realize()
// this array will hold the indices of all controls in the toolbar // this array will hold the indices of all controls in the toolbar
wxArrayInt controlIds; wxArrayInt controlIds;
bool lastWasRadio = FALSE; bool lastWasRadio = false;
int i = 0; int i = 0;
for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) for ( node = m_tools.GetFirst(); node; node = node->GetNext() )
{ {
@@ -741,7 +741,7 @@ bool wxToolBar::Realize()
wxZeroMemory(button); wxZeroMemory(button);
bool isRadio = FALSE; bool isRadio = false;
switch ( tool->GetStyle() ) switch ( tool->GetStyle() )
{ {
case wxTOOL_STYLE_CONTROL: case wxTOOL_STYLE_CONTROL:
@@ -785,10 +785,10 @@ bool wxToolBar::Realize()
// radio items // radio items
button.fsState |= TBSTATE_CHECKED; button.fsState |= TBSTATE_CHECKED;
tool->Toggle(TRUE); tool->Toggle(true);
} }
isRadio = TRUE; isRadio = true;
break; break;
case wxITEM_CHECK: case wxITEM_CHECK:
@@ -839,7 +839,7 @@ bool wxToolBar::Realize()
// note that we use TB_GETITEMRECT and not TB_GETRECT because the // note that we use TB_GETITEMRECT and not TB_GETRECT because the
// latter only appeared in v4.70 of comctl32.dll // latter only appeared in v4.70 of comctl32.dll
RECT r; RECT r;
if ( !SendMessage(GetHwnd(), TB_GETITEMRECT, if ( !::SendMessage(GetHwnd(), TB_GETITEMRECT,
index, (LPARAM)(LPRECT)&r) ) index, (LPARAM)(LPRECT)&r) )
{ {
wxLogLastError(wxT("TB_GETITEMRECT")); wxLogLastError(wxT("TB_GETITEMRECT"));
@@ -858,7 +858,7 @@ bool wxToolBar::Realize()
wxSize size = control->GetSize(); wxSize size = control->GetSize();
// the position of the leftmost controls corner // the position of the leftmost controls corner
int left = -1; int left = wxDefaultCoord;
// TB_SETBUTTONINFO message is only supported by comctl32.dll 4.71+ // TB_SETBUTTONINFO message is only supported by comctl32.dll 4.71+
#ifdef TB_SETBUTTONINFO #ifdef TB_SETBUTTONINFO
@@ -872,7 +872,7 @@ bool wxToolBar::Realize()
tbbi.cbSize = sizeof(tbbi); tbbi.cbSize = sizeof(tbbi);
tbbi.dwMask = TBIF_SIZE; tbbi.dwMask = TBIF_SIZE;
tbbi.cx = size.x; tbbi.cx = size.x;
if ( !SendMessage(GetHwnd(), TB_SETBUTTONINFO, if ( !::SendMessage(GetHwnd(), TB_SETBUTTONINFO,
tool->GetId(), (LPARAM)&tbbi) ) tool->GetId(), (LPARAM)&tbbi) )
{ {
// the id is probably invalid? // the id is probably invalid?
@@ -896,7 +896,7 @@ bool wxToolBar::Realize()
size_t nSeparators = size.x / widthSep; size_t nSeparators = size.x / widthSep;
for ( size_t nSep = 0; nSep < nSeparators; nSep++ ) for ( size_t nSep = 0; nSep < nSeparators; nSep++ )
{ {
if ( !SendMessage(GetHwnd(), TB_INSERTBUTTON, if ( !::SendMessage(GetHwnd(), TB_INSERTBUTTON,
index, (LPARAM)&tbb) ) index, (LPARAM)&tbb) )
{ {
wxLogLastError(wxT("TB_INSERTBUTTON")); wxLogLastError(wxT("TB_INSERTBUTTON"));
@@ -910,7 +910,7 @@ bool wxToolBar::Realize()
((wxToolBarTool *)tool)->SetSeparatorsCount(nSeparators); ((wxToolBarTool *)tool)->SetSeparatorsCount(nSeparators);
// adjust the controls width to exactly cover the separators // adjust the controls width to exactly cover the separators
control->SetSize((nSeparators + 1)*widthSep, -1); control->SetSize((nSeparators + 1)*widthSep, wxDefaultCoord);
} }
// position the control itself correctly vertically // position the control itself correctly vertically
@@ -919,7 +919,7 @@ bool wxToolBar::Realize()
if ( diff < 0 ) if ( diff < 0 )
{ {
// the control is too high, resize to fit // the control is too high, resize to fit
control->SetSize(-1, height - 2); control->SetSize(wxDefaultCoord, height - 2);
diff = 2; diff = 2;
} }
@@ -934,7 +934,7 @@ bool wxToolBar::Realize()
} }
else // horizontal toolbar else // horizontal toolbar
{ {
if ( left == -1 ) if ( left == wxDefaultCoord )
left = r.left; left = r.left;
top = r.top; top = r.top;
@@ -965,7 +965,7 @@ bool wxToolBar::Realize()
} }
InvalidateBestSize(); InvalidateBestSize();
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -976,7 +976,7 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
{ {
wxToolBarToolBase *tool = FindById((int)id); wxToolBarToolBase *tool = FindById((int)id);
if ( !tool ) if ( !tool )
return FALSE; return false;
bool toggled = false; // just to suppress warnings bool toggled = false; // just to suppress warnings
@@ -988,7 +988,7 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
// ignore the event when a radio button is released, as this doesn't seem to // ignore the event when a radio button is released, as this doesn't seem to
// happen at all, and is handled otherwise // happen at all, and is handled otherwise
if ( tool->GetKind() == wxITEM_RADIO && !toggled ) if ( tool->GetKind() == wxITEM_RADIO && !toggled )
return TRUE; return true;
tool->Toggle(toggled); tool->Toggle(toggled);
UnToggleRadioGroup(tool); UnToggleRadioGroup(tool);
@@ -1004,7 +1004,7 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
::SendMessage(GetHwnd(), TB_CHECKBUTTON, id, MAKELONG(toggled, 0)); ::SendMessage(GetHwnd(), TB_CHECKBUTTON, id, MAKELONG(toggled, 0));
} }
return TRUE; return true;
} }
bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl), bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl),
@@ -1019,22 +1019,22 @@ bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl),
// in an ANSI application - this seems to be a bug in comctl32.dll v5 // in an ANSI application - this seems to be a bug in comctl32.dll v5
UINT code = hdr->code; UINT code = hdr->code;
if ( (code != (UINT) TTN_NEEDTEXTA) && (code != (UINT) TTN_NEEDTEXTW) ) if ( (code != (UINT) TTN_NEEDTEXTA) && (code != (UINT) TTN_NEEDTEXTW) )
return FALSE; return false;
HWND toolTipWnd = (HWND)::SendMessage((HWND)GetHWND(), TB_GETTOOLTIPS, 0, 0); HWND toolTipWnd = (HWND)::SendMessage((HWND)GetHWND(), TB_GETTOOLTIPS, 0, 0);
if ( toolTipWnd != hdr->hwndFrom ) if ( toolTipWnd != hdr->hwndFrom )
return FALSE; return false;
LPTOOLTIPTEXT ttText = (LPTOOLTIPTEXT)lParam; LPTOOLTIPTEXT ttText = (LPTOOLTIPTEXT)lParam;
int id = (int)ttText->hdr.idFrom; int id = (int)ttText->hdr.idFrom;
wxToolBarToolBase *tool = FindById(id); wxToolBarToolBase *tool = FindById(id);
if ( !tool ) if ( !tool )
return FALSE; return false;
return HandleTooltipNotify(code, lParam, tool->GetShortHelp()); return HandleTooltipNotify(code, lParam, tool->GetShortHelp());
#else #else
return FALSE; return false;
#endif #endif
} }
@@ -1143,7 +1143,7 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const
void wxToolBar::UpdateSize() void wxToolBar::UpdateSize()
{ {
// the toolbar size changed // the toolbar size changed
SendMessage(GetHwnd(), TB_AUTOSIZE, 0, 0); ::SendMessage(GetHwnd(), TB_AUTOSIZE, 0, 0);
// we must also refresh the frame after the toolbar size (possibly) changed // we must also refresh the frame after the toolbar size (possibly) changed
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
@@ -1286,10 +1286,10 @@ bool wxToolBar::HandleSize(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)
} }
// message processed // message processed
return TRUE; return true;
} }
return FALSE; return false;
} }
bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam) bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
@@ -1308,7 +1308,7 @@ bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
if ( !node ) if ( !node )
{ {
// no controls, nothing to erase // no controls, nothing to erase
return FALSE; return false;
} }
// prepare the DC on which we'll be drawing // prepare the DC on which we'll be drawing
@@ -1317,10 +1317,10 @@ bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
dc.SetPen(*wxTRANSPARENT_PEN); dc.SetPen(*wxTRANSPARENT_PEN);
RECT r; RECT r;
if ( !GetUpdateRect(GetHwnd(), &r, FALSE) ) if ( !::GetUpdateRect(GetHwnd(), &r, FALSE) )
{ {
// nothing to redraw anyhow // nothing to redraw anyhow
return FALSE; return false;
} }
wxRect rectUpdate; wxRect rectUpdate;
@@ -1383,13 +1383,13 @@ bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
// Necessary in case we use a no-paint-on-size // Necessary in case we use a no-paint-on-size
// style in the parent: the controls can disappear // style in the parent: the controls can disappear
control->Refresh(FALSE); control->Refresh(false);
} }
} }
} }
} }
return TRUE; return true;
} }
void wxToolBar::HandleMouseMove(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam) void wxToolBar::HandleMouseMove(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)

View File

@@ -218,7 +218,7 @@ void wxTextCtrl::Init()
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT
m_privateContextMenu = NULL; m_privateContextMenu = NULL;
m_suppressNextUpdate = FALSE; m_suppressNextUpdate = false;
m_isNativeCaretShown = true; m_isNativeCaretShown = true;
} }
@@ -246,7 +246,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
// base initialization // base initialization
if ( !CreateControl(parent, id, pos, size, style, validator, name) ) if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return FALSE; return false;
// translate wxWin style flags to MSW ones // translate wxWin style flags to MSW ones
WXDWORD msStyle = MSWGetCreateWindowFlags(); WXDWORD msStyle = MSWGetCreateWindowFlags();
@@ -270,7 +270,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
// we need to load the richedit DLL before creating the rich edit control // we need to load the richedit DLL before creating the rich edit control
if ( m_windowStyle & wxTE_RICH ) if ( m_windowStyle & wxTE_RICH )
{ {
static bool s_errorGiven = FALSE;// MT-FIXME static bool s_errorGiven = false;// MT-FIXME
// Which version do we need? Use 1.0 by default because it is much more // Which version do we need? Use 1.0 by default because it is much more
// like the the standard EDIT or 2.0 if explicitly requested, but use // like the the standard EDIT or 2.0 if explicitly requested, but use
@@ -301,7 +301,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
{ {
wxLogError(_("Impossible to create a rich edit control, using simple text control instead. Please reinstall riched32.dll")); wxLogError(_("Impossible to create a rich edit control, using simple text control instead. Please reinstall riched32.dll"));
s_errorGiven = TRUE; s_errorGiven = true;
} }
} }
} }
@@ -344,7 +344,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
} }
if ( !MSWCreateControl(windowClass, msStyle, pos, size, valueWin) ) if ( !MSWCreateControl(windowClass, msStyle, pos, size, valueWin) )
return FALSE; return false;
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
@@ -372,7 +372,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
} }
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT
return TRUE; return true;
} }
// Make sure the window style (etc.) reflects the HWND style (roughly) // Make sure the window style (etc.) reflects the HWND style (roughly)
@@ -387,7 +387,7 @@ void wxTextCtrl::AdoptAttributesFromHWND()
#if wxUSE_RICHEDIT #if wxUSE_RICHEDIT
wxString classname = wxGetWindowClass(GetHWND()); wxString classname = wxGetWindowClass(GetHWND());
if ( classname.IsSameAs(_T("EDIT"), FALSE /* no case */) ) if ( classname.IsSameAs(_T("EDIT"), false /* no case */) )
{ {
m_verRichEdit = 0; m_verRichEdit = 0;
} }
@@ -587,7 +587,7 @@ wxString wxTextCtrl::GetRange(long from, long to) const
textRange.chrg.cpMax = to; textRange.chrg.cpMax = to;
textRange.lpstrText = p; textRange.lpstrText = p;
(void)SendMessage(GetHwnd(), EM_GETTEXTRANGE, (void)::SendMessage(GetHwnd(), EM_GETTEXTRANGE,
0, (LPARAM)&textRange); 0, (LPARAM)&textRange);
if ( m_verRichEdit > 1 ) if ( m_verRichEdit > 1 )
@@ -640,7 +640,7 @@ void wxTextCtrl::SetValue(const wxString& value)
// edit controls mostly) // edit controls mostly)
if ( (value.length() > 0x400) || (value != GetValue()) ) if ( (value.length() > 0x400) || (value != GetValue()) )
{ {
DoWriteText(value, FALSE /* not selection only */); DoWriteText(value, false /* not selection only */);
// for compatibility, don't move the cursor when doing SetValue() // for compatibility, don't move the cursor when doing SetValue()
SetInsertionPoint(0); SetInsertionPoint(0);
@@ -761,7 +761,7 @@ wxTextCtrl::StreamIn(const wxString& value,
if ( selectionOnly && HasSelection() ) if ( selectionOnly && HasSelection() )
{ {
// so suppress one of them // so suppress one of them
m_suppressNextUpdate = TRUE; m_suppressNextUpdate = true;
} }
::SendMessage(GetHwnd(), EM_STREAMIN, ::SendMessage(GetHwnd(), EM_STREAMIN,
@@ -779,7 +779,7 @@ wxTextCtrl::StreamIn(const wxString& value,
free(wchBuf); free(wchBuf);
#endif // !wxUSE_WCHAR_T #endif // !wxUSE_WCHAR_T
return TRUE; return true;
} }
#if !wxUSE_UNICODE_MSLU #if !wxUSE_UNICODE_MSLU
@@ -862,7 +862,7 @@ void wxTextCtrl::DoWriteText(const wxString& value, bool selectionOnly)
#if wxUSE_RICHEDIT #if wxUSE_RICHEDIT
// there are several complications with the rich edit controls here // there are several complications with the rich edit controls here
bool done = FALSE; bool done = false;
if ( IsRich() ) if ( IsRich() )
{ {
// first, ensure that the new text will be in the default style // first, ensure that the new text will be in the default style
@@ -923,7 +923,7 @@ void wxTextCtrl::DoWriteText(const wxString& value, bool selectionOnly)
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT
(selectionOnly && HasSelection()) ) (selectionOnly && HasSelection()) )
{ {
m_suppressNextUpdate = TRUE; m_suppressNextUpdate = true;
} }
::SendMessage(GetHwnd(), selectionOnly ? EM_REPLACESEL : WM_SETTEXT, ::SendMessage(GetHwnd(), selectionOnly ? EM_REPLACESEL : WM_SETTEXT,
@@ -1050,7 +1050,7 @@ bool wxTextCtrl::CanCut() const
bool wxTextCtrl::CanPaste() const bool wxTextCtrl::CanPaste() const
{ {
if ( !IsEditable() ) if ( !IsEditable() )
return FALSE; return false;
#if wxUSE_RICHEDIT #if wxUSE_RICHEDIT
if ( IsRich() ) if ( IsRich() )
@@ -1063,7 +1063,7 @@ bool wxTextCtrl::CanPaste() const
// Standard edit control: check for straight text on clipboard // Standard edit control: check for straight text on clipboard
if ( !::OpenClipboard(GetHwndOf(wxTheApp->GetTopWindow())) ) if ( !::OpenClipboard(GetHwndOf(wxTheApp->GetTopWindow())) )
return FALSE; return false;
bool isTextAvailable = ::IsClipboardFormatAvailable(CF_TEXT) != 0; bool isTextAvailable = ::IsClipboardFormatAvailable(CF_TEXT) != 0;
::CloseClipboard(); ::CloseClipboard();
@@ -1078,7 +1078,7 @@ bool wxTextCtrl::CanPaste() const
void wxTextCtrl::SetEditable(bool editable) void wxTextCtrl::SetEditable(bool editable)
{ {
HWND hWnd = GetHwnd(); HWND hWnd = GetHwnd();
SendMessage(hWnd, EM_SETREADONLY, (WPARAM)!editable, (LPARAM)0L); ::SendMessage(hWnd, EM_SETREADONLY, (WPARAM)!editable, (LPARAM)0L);
} }
void wxTextCtrl::SetInsertionPoint(long pos) void wxTextCtrl::SetInsertionPoint(long pos)
@@ -1121,12 +1121,12 @@ long wxTextCtrl::GetInsertionPoint() const
CHARRANGE range; CHARRANGE range;
range.cpMin = 0; range.cpMin = 0;
range.cpMax = 0; range.cpMax = 0;
SendMessage(GetHwnd(), EM_EXGETSEL, 0, (LPARAM) &range); ::SendMessage(GetHwnd(), EM_EXGETSEL, 0, (LPARAM) &range);
return range.cpMin; return range.cpMin;
} }
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT
DWORD Pos = (DWORD)SendMessage(GetHwnd(), EM_GETSEL, 0, 0L); DWORD Pos = (DWORD)::SendMessage(GetHwnd(), EM_GETSEL, 0, 0L);
return Pos & 0xFFFF; return Pos & 0xFFFF;
} }
@@ -1170,7 +1170,7 @@ bool wxTextCtrl::IsEditable() const
// own Create() calls MSWGetStyle() which calls AcceptsFocus() which calls // own Create() calls MSWGetStyle() which calls AcceptsFocus() which calls
// us // us
if ( !m_hWnd ) if ( !m_hWnd )
return TRUE; return true;
long style = ::GetWindowLong(GetHwnd(), GWL_STYLE); long style = ::GetWindowLong(GetHwnd(), GWL_STYLE);
@@ -1204,12 +1204,12 @@ void wxTextCtrl::DoSetSelection(long from, long to, bool scrollCaret)
CHARRANGE range; CHARRANGE range;
range.cpMin = from; range.cpMin = from;
range.cpMax = to; range.cpMax = to;
SendMessage(hWnd, EM_EXSETSEL, 0, (LPARAM) &range); ::SendMessage(hWnd, EM_EXSETSEL, 0, (LPARAM) &range);
} }
else else
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT
{ {
SendMessage(hWnd, EM_SETSEL, (WPARAM)from, (LPARAM)to); ::SendMessage(hWnd, EM_SETSEL, (WPARAM)from, (LPARAM)to);
} }
if ( scrollCaret ) if ( scrollCaret )
@@ -1242,7 +1242,7 @@ void wxTextCtrl::DoSetSelection(long from, long to, bool scrollCaret)
} }
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT
SendMessage(hWnd, EM_SCROLLCARET, (WPARAM)0, (LPARAM)0); ::SendMessage(hWnd, EM_SCROLLCARET, (WPARAM)0, (LPARAM)0);
#if wxUSE_RICHEDIT #if wxUSE_RICHEDIT
// restore ECO_NOHIDESEL if we changed it // restore ECO_NOHIDESEL if we changed it
@@ -1266,10 +1266,10 @@ bool wxTextCtrl::LoadFile(const wxString& file)
// update the size limit if needed // update the size limit if needed
AdjustSpaceLimit(); AdjustSpaceLimit();
return TRUE; return true;
} }
return FALSE; return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1279,9 +1279,9 @@ bool wxTextCtrl::LoadFile(const wxString& file)
void wxTextCtrl::Replace(long from, long to, const wxString& value) void wxTextCtrl::Replace(long from, long to, const wxString& value)
{ {
// Set selection and remove it // Set selection and remove it
DoSetSelection(from, to, FALSE /* don't scroll caret into view */); DoSetSelection(from, to, false /* don't scroll caret into view */);
DoWriteText(value, TRUE /* selection only */); DoWriteText(value, true /* selection only */);
} }
void wxTextCtrl::Remove(long from, long to) void wxTextCtrl::Remove(long from, long to)
@@ -1291,22 +1291,22 @@ void wxTextCtrl::Remove(long from, long to)
bool wxTextCtrl::IsModified() const bool wxTextCtrl::IsModified() const
{ {
return SendMessage(GetHwnd(), EM_GETMODIFY, 0, 0) != 0; return ::SendMessage(GetHwnd(), EM_GETMODIFY, 0, 0) != 0;
} }
void wxTextCtrl::MarkDirty() void wxTextCtrl::MarkDirty()
{ {
SendMessage(GetHwnd(), EM_SETMODIFY, TRUE, 0L); ::SendMessage(GetHwnd(), EM_SETMODIFY, TRUE, 0L);
} }
void wxTextCtrl::DiscardEdits() void wxTextCtrl::DiscardEdits()
{ {
SendMessage(GetHwnd(), EM_SETMODIFY, FALSE, 0L); ::SendMessage(GetHwnd(), EM_SETMODIFY, FALSE, 0L);
} }
int wxTextCtrl::GetNumberOfLines() const int wxTextCtrl::GetNumberOfLines() const
{ {
return (int)SendMessage(GetHwnd(), EM_GETLINECOUNT, (WPARAM)0, (LPARAM)0); return (int)::SendMessage(GetHwnd(), EM_GETLINECOUNT, (WPARAM)0, (LPARAM)0);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1316,7 +1316,7 @@ int wxTextCtrl::GetNumberOfLines() const
long wxTextCtrl::XYToPosition(long x, long y) const long wxTextCtrl::XYToPosition(long x, long y) const
{ {
// This gets the char index for the _beginning_ of this line // This gets the char index for the _beginning_ of this line
long charIndex = SendMessage(GetHwnd(), EM_LINEINDEX, (WPARAM)y, (LPARAM)0); long charIndex = ::SendMessage(GetHwnd(), EM_LINEINDEX, (WPARAM)y, (LPARAM)0);
return charIndex + x; return charIndex + x;
} }
@@ -1330,25 +1330,25 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
#if wxUSE_RICHEDIT #if wxUSE_RICHEDIT
if ( IsRich() ) if ( IsRich() )
{ {
lineNo = SendMessage(hWnd, EM_EXLINEFROMCHAR, 0, (LPARAM)pos); lineNo = ::SendMessage(hWnd, EM_EXLINEFROMCHAR, 0, (LPARAM)pos);
} }
else else
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT
{ {
lineNo = SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)pos, 0); lineNo = ::SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)pos, 0);
} }
if ( lineNo == -1 ) if ( lineNo == -1 )
{ {
// no such line // no such line
return FALSE; return false;
} }
// This gets the char index for the _beginning_ of this line // This gets the char index for the _beginning_ of this line
long charIndex = SendMessage(hWnd, EM_LINEINDEX, (WPARAM)lineNo, (LPARAM)0); long charIndex = ::SendMessage(hWnd, EM_LINEINDEX, (WPARAM)lineNo, (LPARAM)0);
if ( charIndex == -1 ) if ( charIndex == -1 )
{ {
return FALSE; return false;
} }
// The X position must therefore be the different between pos and charIndex // The X position must therefore be the different between pos and charIndex
@@ -1357,7 +1357,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
if ( y ) if ( y )
*y = lineNo; *y = lineNo;
return TRUE; return true;
} }
wxTextCtrlHitTestResult wxTextCtrlHitTestResult
@@ -1383,7 +1383,7 @@ wxTextCtrl::HitTest(const wxPoint& pt, long *posOut) const
lParam = MAKELPARAM(pt.x, pt.y); lParam = MAKELPARAM(pt.x, pt.y);
} }
LRESULT pos = SendMessage(GetHwnd(), EM_CHARFROMPOS, 0, lParam); LRESULT pos = ::SendMessage(GetHwnd(), EM_CHARFROMPOS, 0, lParam);
if ( pos == -1 ) if ( pos == -1 )
{ {
@@ -1410,12 +1410,12 @@ wxTextCtrl::HitTest(const wxPoint& pt, long *posOut) const
// we don't know how to do it // we don't know how to do it
if ( IsRich() ) if ( IsRich() )
{ {
SendMessage(GetHwnd(), EM_POSFROMCHAR, (WPARAM)&ptReal, pos); ::SendMessage(GetHwnd(), EM_POSFROMCHAR, (WPARAM)&ptReal, pos);
} }
else else
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT
{ {
LRESULT lRc = SendMessage(GetHwnd(), EM_POSFROMCHAR, pos, 0); LRESULT lRc = ::SendMessage(GetHwnd(), EM_POSFROMCHAR, pos, 0);
if ( lRc == -1 ) if ( lRc == -1 )
{ {
@@ -1463,16 +1463,16 @@ void wxTextCtrl::ShowPosition(long pos)
// Is this where scrolling is relative to - the line containing the caret? // Is this where scrolling is relative to - the line containing the caret?
// Or is the first visible line??? Try first visible line. // Or is the first visible line??? Try first visible line.
// int currentLineLineNo1 = (int)SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)-1, (LPARAM)0L); // int currentLineLineNo1 = (int)::SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)-1, (LPARAM)0L);
int currentLineLineNo = (int)SendMessage(hWnd, EM_GETFIRSTVISIBLELINE, (WPARAM)0, (LPARAM)0L); int currentLineLineNo = (int)::SendMessage(hWnd, EM_GETFIRSTVISIBLELINE, (WPARAM)0, (LPARAM)0L);
int specifiedLineLineNo = (int)SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)pos, (LPARAM)0L); int specifiedLineLineNo = (int)::SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)pos, (LPARAM)0L);
int linesToScroll = specifiedLineLineNo - currentLineLineNo; int linesToScroll = specifiedLineLineNo - currentLineLineNo;
if (linesToScroll != 0) if (linesToScroll != 0)
(void)SendMessage(hWnd, EM_LINESCROLL, (WPARAM)0, (LPARAM)linesToScroll); (void)::SendMessage(hWnd, EM_LINESCROLL, (WPARAM)0, (LPARAM)linesToScroll);
} }
long wxTextCtrl::GetLengthOfLineContainingPos(long pos) const long wxTextCtrl::GetLengthOfLineContainingPos(long pos) const
@@ -1638,7 +1638,7 @@ bool wxTextCtrl::MSWShouldPreProcessMessage(WXMSG* pMsg)
if ( (HIWORD(msg->lParam) & KF_ALTDOWN) == KF_ALTDOWN ) if ( (HIWORD(msg->lParam) & KF_ALTDOWN) == KF_ALTDOWN )
{ {
if ( vkey == VK_BACK ) if ( vkey == VK_BACK )
return FALSE; return false;
} }
else // no Alt else // no Alt
{ {
@@ -1670,13 +1670,13 @@ bool wxTextCtrl::MSWShouldPreProcessMessage(WXMSG* pMsg)
case VK_DELETE: case VK_DELETE:
case VK_HOME: case VK_HOME:
case VK_END: case VK_END:
return FALSE; return false;
} }
} }
else // Shift is pressed else // Shift is pressed
{ {
if ( vkey == VK_INSERT || vkey == VK_DELETE ) if ( vkey == VK_INSERT || vkey == VK_DELETE )
return FALSE; return false;
} }
} }
} }
@@ -1797,9 +1797,9 @@ bool wxTextCtrl::SendUpdateEvent()
if ( m_suppressNextUpdate ) if ( m_suppressNextUpdate )
{ {
// do process the next one // do process the next one
m_suppressNextUpdate = FALSE; m_suppressNextUpdate = false;
return FALSE; return false;
} }
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId()); wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId());
@@ -1841,11 +1841,11 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
// the other edit notification messages are not processed // the other edit notification messages are not processed
default: default:
return FALSE; return false;
} }
// processed // processed
return TRUE; return true;
} }
WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
@@ -1898,7 +1898,7 @@ bool wxTextCtrl::AdjustSpaceLimit()
if ( limit < 0x8000 ) if ( limit < 0x8000 )
{ {
// we've got more text than limit set by SetMaxLength() // we've got more text than limit set by SetMaxLength()
return FALSE; return false;
} }
unsigned int len = ::GetWindowTextLength(GetHwnd()); unsigned int len = ::GetWindowTextLength(GetHwnd());
@@ -1927,7 +1927,7 @@ bool wxTextCtrl::AdjustSpaceLimit()
} }
// we changed the limit // we changed the limit
return TRUE; return true;
} }
bool wxTextCtrl::AcceptsFocus() const bool wxTextCtrl::AcceptsFocus() const
@@ -2110,8 +2110,8 @@ bool wxTextCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
} }
} }
// return TRUE to process the event (and FALSE to ignore it) // return true to process the event (and false to ignore it)
return TRUE; return true;
case EN_LINK: case EN_LINK:
{ {
@@ -2166,7 +2166,7 @@ bool wxTextCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
break; break;
} }
} }
return TRUE; return true;
} }
// not processed, leave it to the base class // not processed, leave it to the base class
@@ -2182,7 +2182,7 @@ bool wxTextCtrl::SetBackgroundColour(const wxColour& colour)
if ( !wxTextCtrlBase::SetBackgroundColour(colour) ) if ( !wxTextCtrlBase::SetBackgroundColour(colour) )
{ {
// colour didn't really change // colour didn't really change
return FALSE; return false;
} }
if ( IsRich() ) if ( IsRich() )
@@ -2192,7 +2192,7 @@ bool wxTextCtrl::SetBackgroundColour(const wxColour& colour)
::SendMessage(GetHwnd(), EM_SETBKGNDCOLOR, 0, wxColourToRGB(colour)); ::SendMessage(GetHwnd(), EM_SETBKGNDCOLOR, 0, wxColourToRGB(colour));
} }
return TRUE; return true;
} }
bool wxTextCtrl::SetForegroundColour(const wxColour& colour) bool wxTextCtrl::SetForegroundColour(const wxColour& colour)
@@ -2200,7 +2200,7 @@ bool wxTextCtrl::SetForegroundColour(const wxColour& colour)
if ( !wxTextCtrlBase::SetForegroundColour(colour) ) if ( !wxTextCtrlBase::SetForegroundColour(colour) )
{ {
// colour didn't really change // colour didn't really change
return FALSE; return false;
} }
if ( IsRich() ) if ( IsRich() )
@@ -2214,7 +2214,7 @@ bool wxTextCtrl::SetForegroundColour(const wxColour& colour)
::SendMessage(GetHwnd(), EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf); ::SendMessage(GetHwnd(), EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf);
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -2228,7 +2228,7 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style)
if ( !IsRich() ) if ( !IsRich() )
{ {
// can't do it with normal text control // can't do it with normal text control
return FALSE; return false;
} }
// the richedit 1.0 doesn't handle setting background colour, so don't // the richedit 1.0 doesn't handle setting background colour, so don't
@@ -2237,8 +2237,8 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style)
!style.HasLeftIndent() && !style.HasRightIndent() && !style.HasAlignment() && !style.HasLeftIndent() && !style.HasRightIndent() && !style.HasAlignment() &&
!style.HasTabs() ) !style.HasTabs() )
{ {
// nothing to do: return TRUE if there was really nothing to do and // nothing to do: return true if there was really nothing to do and
// FALSE if we failed to set bg colour // false if we failed to set bg colour
return !style.HasBackgroundColour(); return !style.HasBackgroundColour();
} }
@@ -2260,7 +2260,7 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style)
if ( changeSel ) if ( changeSel )
{ {
DoSetSelection(start, end, FALSE /* don't scroll caret into view */); DoSetSelection(start, end, false /* don't scroll caret into view */);
} }
// initialize CHARFORMAT struct // initialize CHARFORMAT struct
@@ -2426,7 +2426,7 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style)
if ( changeSel ) if ( changeSel )
{ {
// restore the original selection // restore the original selection
DoSetSelection(startOld, endOld, FALSE); DoSetSelection(startOld, endOld, false);
} }
return ok; return ok;
@@ -2435,14 +2435,14 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style)
bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style) bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style)
{ {
if ( !wxTextCtrlBase::SetDefaultStyle(style) ) if ( !wxTextCtrlBase::SetDefaultStyle(style) )
return FALSE; return false;
// we have to do this or the style wouldn't apply for the text typed by the // we have to do this or the style wouldn't apply for the text typed by the
// user // user
long posLast = GetLastPosition(); long posLast = GetLastPosition();
SetStyle(posLast, posLast, m_defaultStyle); SetStyle(posLast, posLast, m_defaultStyle);
return TRUE; return true;
} }
bool wxTextCtrl::GetStyle(long position, wxTextAttr& style) bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
@@ -2450,7 +2450,7 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
if ( !IsRich() ) if ( !IsRich() )
{ {
// can't do it with normal text control // can't do it with normal text control
return FALSE; return false;
} }
// initialize CHARFORMAT struct // initialize CHARFORMAT struct
@@ -2486,7 +2486,7 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
if ( changeSel ) if ( changeSel )
{ {
DoSetSelection(position, position, FALSE /* don't scroll caret into view */); DoSetSelection(position, position, false /* don't scroll caret into view */);
} }
// get the selection formatting // get the selection formatting
@@ -2570,10 +2570,10 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
if ( changeSel ) if ( changeSel )
{ {
// restore the original selection // restore the original selection
DoSetSelection(startOld, endOld, FALSE); DoSetSelection(startOld, endOld, false);
} }
return TRUE; return true;
} }
#endif #endif
@@ -2585,7 +2585,7 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
bool wxRichEditModule::OnInit() bool wxRichEditModule::OnInit()
{ {
// don't do anything - we will load it when needed // don't do anything - we will load it when needed
return TRUE; return true;
} }
void wxRichEditModule::OnExit() void wxRichEditModule::OnExit()
@@ -2605,7 +2605,7 @@ bool wxRichEditModule::Load(int version)
{ {
// we don't support loading richedit 3.0 as I don't know how to distinguish // we don't support loading richedit 3.0 as I don't know how to distinguish
// it from 2.0 anyhow // it from 2.0 anyhow
wxCHECK_MSG( version == 1 || version == 2, FALSE, wxCHECK_MSG( version == 1 || version == 2, false,
_T("incorrect richedit control version requested") ); _T("incorrect richedit control version requested") );
// make it the index in the array // make it the index in the array
@@ -2614,13 +2614,13 @@ bool wxRichEditModule::Load(int version)
if ( ms_hRichEdit[version] == (HINSTANCE)-1 ) if ( ms_hRichEdit[version] == (HINSTANCE)-1 )
{ {
// we had already tried to load it and failed // we had already tried to load it and failed
return FALSE; return false;
} }
if ( ms_hRichEdit[version] ) if ( ms_hRichEdit[version] )
{ {
// we've already got this one // we've already got this one
return TRUE; return true;
} }
wxString dllname = version ? _T("riched20") : _T("riched32"); wxString dllname = version ? _T("riched20") : _T("riched32");
@@ -2634,10 +2634,10 @@ bool wxRichEditModule::Load(int version)
ms_hRichEdit[version] = (HINSTANCE)-1; ms_hRichEdit[version] = (HINSTANCE)-1;
return FALSE; return false;
} }
return TRUE; return true;
} }
#endif // wxUSE_RICHEDIT #endif // wxUSE_RICHEDIT

View File

@@ -63,7 +63,7 @@ bool wxToggleButton::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
event.SetInt(GetValue()); event.SetInt(GetValue());
event.SetEventObject(this); event.SetEventObject(this);
ProcessCommand(event); ProcessCommand(event);
return TRUE; return true;
} }
// Single check box item // Single check box item
@@ -75,12 +75,12 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
const wxString& name) const wxString& name)
{ {
if ( !CreateControl(parent, id, pos, size, style, validator, name) ) if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return FALSE; return false;
if ( !MSWCreateControl(wxT("BUTTON"), label, pos, size) ) if ( !MSWCreateControl(wxT("BUTTON"), label, pos, size) )
return FALSE; return false;
return TRUE; return true;
} }
wxBorder wxToggleButton::GetDefaultBorder() const wxBorder wxToggleButton::GetDefaultBorder() const
@@ -140,7 +140,7 @@ wxSize wxToggleButton::DoGetBestSize() const
void wxToggleButton::SetValue(bool val) void wxToggleButton::SetValue(bool val)
{ {
SendMessage(GetHwnd(), BM_SETCHECK, val, 0); ::SendMessage(GetHwnd(), BM_SETCHECK, val, 0);
} }
#ifndef BST_CHECKED #ifndef BST_CHECKED
@@ -150,9 +150,9 @@ void wxToggleButton::SetValue(bool val)
bool wxToggleButton::GetValue() const bool wxToggleButton::GetValue() const
{ {
#ifdef __WIN32__ #ifdef __WIN32__
return (SendMessage(GetHwnd(), BM_GETCHECK, 0, 0) == BST_CHECKED); return (::SendMessage(GetHwnd(), BM_GETCHECK, 0, 0) == BST_CHECKED);
#else #else
return ((0x001 & SendMessage(GetHwnd(), BM_GETCHECK, 0, 0)) == 0x001); return ((0x001 & ::SendMessage(GetHwnd(), BM_GETCHECK, 0, 0)) == 0x001);
#endif #endif
} }

View File

@@ -71,8 +71,8 @@
#ifdef __WXMICROWIN__ #ifdef __WXMICROWIN__
// static inline bool IsIconic(HWND WXUNUSED(hwnd)) { return FALSE; } // static inline bool IsIconic(HWND WXUNUSED(hwnd)) { return false; }
static inline bool IsZoomed(HWND WXUNUSED(hwnd)) { return FALSE; } static inline bool IsZoomed(HWND WXUNUSED(hwnd)) { return false; }
#endif // __WXMICROWIN__ #endif // __WXMICROWIN__
@@ -134,13 +134,13 @@ END_EVENT_TABLE()
void wxTopLevelWindowMSW::Init() void wxTopLevelWindowMSW::Init()
{ {
m_iconized = m_iconized =
m_maximizeOnShow = FALSE; m_maximizeOnShow = false;
// Data to save/restore when calling ShowFullScreen // Data to save/restore when calling ShowFullScreen
m_fsStyle = 0; m_fsStyle = 0;
m_fsOldWindowStyle = 0; m_fsOldWindowStyle = 0;
m_fsIsMaximized = FALSE; m_fsIsMaximized = false;
m_fsIsShowing = FALSE; m_fsIsShowing = false;
m_winLastFocused = (wxWindow *)NULL; m_winLastFocused = (wxWindow *)NULL;
@@ -342,7 +342,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
wxLogSysError(wxT("Can't create dialog using memory template")); wxLogSysError(wxT("Can't create dialog using memory template"));
return FALSE; return false;
} }
WXDWORD exflags; WXDWORD exflags;
@@ -406,7 +406,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
SubclassWin(m_hWnd); SubclassWin(m_hWnd);
return TRUE; return true;
#endif // __WXMICROWIN__/!__WXMICROWIN__ #endif // __WXMICROWIN__/!__WXMICROWIN__
} }
@@ -453,7 +453,7 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent,
SetName(name); SetName(name);
m_windowId = id == -1 ? NewControlId() : id; m_windowId = id == wxID_ANY ? NewControlId() : id;
wxTopLevelWindows.Append(this); wxTopLevelWindows.Append(this);
@@ -511,7 +511,7 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent,
// fix we have // fix we have
if ( ret ) if ( ret )
{ {
SendMessage ::SendMessage
( (
GetHwnd(), GetHwnd(),
WM_UPDATEUISTATE, WM_UPDATEUISTATE,
@@ -566,7 +566,7 @@ bool wxTopLevelWindowMSW::Show(bool show)
{ {
// don't use wxWindow version as we want to call DoShowWindow() ourselves // don't use wxWindow version as we want to call DoShowWindow() ourselves
if ( !wxWindowBase::Show(show) ) if ( !wxWindowBase::Show(show) )
return FALSE; return false;
int nShowCmd; int nShowCmd;
if ( show ) if ( show )
@@ -581,7 +581,7 @@ bool wxTopLevelWindowMSW::Show(bool show)
DoShowWindow(SW_SHOW); DoShowWindow(SW_SHOW);
#endif #endif
m_maximizeOnShow = FALSE; m_maximizeOnShow = false;
} }
else // just show else // just show
{ {
@@ -609,7 +609,7 @@ bool wxTopLevelWindowMSW::Show(bool show)
{ {
::BringWindowToTop(GetHwnd()); ::BringWindowToTop(GetHwnd());
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, m_windowId); wxActivateEvent event(wxEVT_ACTIVATE, true, m_windowId);
event.SetEventObject( this ); event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
} }
@@ -624,7 +624,7 @@ bool wxTopLevelWindowMSW::Show(bool show)
} }
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -649,7 +649,7 @@ void wxTopLevelWindowMSW::Maximize(bool maximize)
bool wxTopLevelWindowMSW::IsMaximized() const bool wxTopLevelWindowMSW::IsMaximized() const
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
return FALSE; return false;
#else #else
return ::IsZoomed(GetHwnd()) != 0; return ::IsZoomed(GetHwnd()) != 0;
#endif #endif
@@ -663,7 +663,7 @@ void wxTopLevelWindowMSW::Iconize(bool iconize)
bool wxTopLevelWindowMSW::IsIconized() const bool wxTopLevelWindowMSW::IsIconized() const
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
return FALSE; return false;
#else #else
// also update the current state // also update the current state
((wxTopLevelWindowMSW *)this)->m_iconized = ::IsIconic(GetHwnd()) != 0; ((wxTopLevelWindowMSW *)this)->m_iconized = ::IsIconic(GetHwnd()) != 0;
@@ -686,7 +686,7 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style)
if ( show == IsFullScreen() ) if ( show == IsFullScreen() )
{ {
// nothing to do // nothing to do
return TRUE; return true;
} }
m_fsIsShowing = show; m_fsIsShowing = show;
@@ -786,7 +786,7 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style)
m_fsOldSize.width, m_fsOldSize.height, SWP_FRAMECHANGED); m_fsOldSize.width, m_fsOldSize.height, SWP_FRAMECHANGED);
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -823,7 +823,7 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
{ {
#if !defined(__WXMICROWIN__) #if !defined(__WXMICROWIN__)
// get system (a.k.a. window) menu // get system (a.k.a. window) menu
HMENU hmenu = GetSystemMenu(GetHwnd(), FALSE /* get it */); HMENU hmenu = ::GetSystemMenu(GetHwnd(), FALSE /* get it */);
if ( !hmenu ) if ( !hmenu )
{ {
// no system menu at all -- ok if we want to remove the close button // no system menu at all -- ok if we want to remove the close button
@@ -839,7 +839,7 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
{ {
wxLogLastError(_T("EnableMenuItem(SC_CLOSE)")); wxLogLastError(_T("EnableMenuItem(SC_CLOSE)"));
return FALSE; return false;
} }
#ifndef __WXWINCE__ #ifndef __WXWINCE__
// update appearance immediately // update appearance immediately
@@ -850,14 +850,14 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
#endif #endif
#endif // !__WXMICROWIN__ #endif // !__WXMICROWIN__
return TRUE; return true;
} }
#ifndef __WXWINCE__ #ifndef __WXWINCE__
bool wxTopLevelWindowMSW::SetShape(const wxRegion& region) bool wxTopLevelWindowMSW::SetShape(const wxRegion& region)
{ {
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE, wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
_T("Shaped windows must be created with the wxFRAME_SHAPED style.")); _T("Shaped windows must be created with the wxFRAME_SHAPED style."));
// The empty region signifies that the shape should be removed from the // The empty region signifies that the shape should be removed from the
@@ -867,9 +867,9 @@ bool wxTopLevelWindowMSW::SetShape(const wxRegion& region)
if (::SetWindowRgn(GetHwnd(), NULL, TRUE) == 0) if (::SetWindowRgn(GetHwnd(), NULL, TRUE) == 0)
{ {
wxLogLastError(_T("SetWindowRgn")); wxLogLastError(_T("SetWindowRgn"));
return FALSE; return false;
} }
return TRUE; return true;
} }
// Windows takes ownership of the region, so // Windows takes ownership of the region, so
@@ -894,9 +894,9 @@ bool wxTopLevelWindowMSW::SetShape(const wxRegion& region)
if (::SetWindowRgn(GetHwnd(), hrgn, TRUE) == 0) if (::SetWindowRgn(GetHwnd(), hrgn, TRUE) == 0)
{ {
wxLogLastError(_T("SetWindowRgn")); wxLogLastError(_T("SetWindowRgn"));
return FALSE; return false;
} }
return TRUE; return true;
} }
#endif // !__WXWINCE__ #endif // !__WXWINCE__
@@ -1010,7 +1010,7 @@ bool wxTLWHiddenParentModule::OnInit()
ms_hwnd = NULL; ms_hwnd = NULL;
ms_className = NULL; ms_className = NULL;
return TRUE; return true;
} }
void wxTLWHiddenParentModule::OnExit() void wxTLWHiddenParentModule::OnExit()

View File

@@ -902,7 +902,7 @@ bool wxTreeCtrl::SetBackgroundColour(const wxColour &colour)
if ( !wxWindowBase::SetBackgroundColour(colour) ) if ( !wxWindowBase::SetBackgroundColour(colour) )
return false; return false;
SendMessage(GetHwnd(), TVM_SETBKCOLOR, 0, colour.GetPixel()); ::SendMessage(GetHwnd(), TVM_SETBKCOLOR, 0, colour.GetPixel());
#endif #endif
return true; return true;
@@ -914,7 +914,7 @@ bool wxTreeCtrl::SetForegroundColour(const wxColour &colour)
if ( !wxWindowBase::SetForegroundColour(colour) ) if ( !wxWindowBase::SetForegroundColour(colour) )
return false; return false;
SendMessage(GetHwnd(), TVM_SETTEXTCOLOR, 0, colour.GetPixel()); ::SendMessage(GetHwnd(), TVM_SETTEXTCOLOR, 0, colour.GetPixel());
#endif #endif
return true; return true;
@@ -1369,7 +1369,7 @@ void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font)
bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
if ( item == wxTreeItemId(TVI_ROOT) ) if ( item == wxTreeItemId(TVI_ROOT) )
{ {
@@ -1400,7 +1400,7 @@ bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const
bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
wxTreeViewItem tvItem(item, TVIF_CHILDREN); wxTreeViewItem tvItem(item, TVIF_CHILDREN);
DoGetItem(&tvItem); DoGetItem(&tvItem);
@@ -1410,7 +1410,7 @@ bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const
bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_EXPANDED); wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_EXPANDED);
DoGetItem(&tvItem); DoGetItem(&tvItem);
@@ -1420,7 +1420,7 @@ bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const
bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_SELECTED); wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_SELECTED);
DoGetItem(&tvItem); DoGetItem(&tvItem);
@@ -1430,7 +1430,7 @@ bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const
bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_BOLD); wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_BOLD);
DoGetItem(&tvItem); DoGetItem(&tvItem);
@@ -1588,7 +1588,7 @@ wxTreeItemId wxTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const
bool wxTreeCtrl::IsItemChecked(const wxTreeItemId& item) const bool wxTreeCtrl::IsItemChecked(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
// receive the desired information. // receive the desired information.
wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_STATEIMAGEMASK); wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_STATEIMAGEMASK);