Source cleaning: whitespaces, tabs, ::, -1/wxID_ANY/wxDefaultCoord, TRUE/true, FALSE/false.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
virtual void SetThumbPosition(int viewStart);
|
||||
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
|
||||
bool refresh = TRUE);
|
||||
bool refresh = true);
|
||||
|
||||
// needed for RTTI
|
||||
void SetThumbSize( int s ) { SetScrollbar( GetThumbPosition() , s , GetRange() , GetPageSize() , true ) ; }
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
void GetPosition(int *x, int *y) const;
|
||||
|
||||
bool Show(bool show = TRUE);
|
||||
bool Show(bool show = true);
|
||||
|
||||
void SetRange(int minValue, int maxValue);
|
||||
|
||||
|
@@ -35,7 +35,7 @@ public:
|
||||
wxSpinCtrl() { }
|
||||
|
||||
wxSpinCtrl(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
@@ -72,8 +72,8 @@ public:
|
||||
virtual bool SetFont(const wxFont &font);
|
||||
virtual void SetFocus();
|
||||
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
virtual bool Show(bool show = TRUE);
|
||||
virtual bool Enable(bool enable = true);
|
||||
virtual bool Show(bool show = true);
|
||||
|
||||
// wxSpinButton doesn't accept focus, but we do
|
||||
virtual bool AcceptsFocus() const { return wxWindow::AcceptsFocus(); }
|
||||
|
@@ -82,10 +82,10 @@ protected:
|
||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||
|
||||
// ctor/dtor helpers
|
||||
void Init() { m_isIcon = TRUE; m_image = NULL; }
|
||||
void Init() { m_isIcon = true; m_image = NULL; }
|
||||
void Free();
|
||||
|
||||
// TRUE if icon/bitmap is valid
|
||||
// true if icon/bitmap is valid
|
||||
bool ImageIsOk() const;
|
||||
|
||||
void SetImage(const wxGDIImage* image);
|
||||
|
@@ -45,7 +45,7 @@ public:
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
virtual bool AcceptsFocus() const { return false; }
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
@@ -24,7 +24,7 @@ public:
|
||||
// ctors and such
|
||||
wxStatusBar95();
|
||||
wxStatusBar95(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
wxWindowID id = wxID_ANY,
|
||||
long style = wxST_SIZEGRIP,
|
||||
const wxString& name = wxEmptyString)
|
||||
{
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
wxWindowID id = wxID_ANY,
|
||||
long style = wxST_SIZEGRIP,
|
||||
const wxString& name = wxEmptyString);
|
||||
|
||||
|
@@ -43,7 +43,7 @@ public:
|
||||
const wxString &name = wxStaticTextNameStr );
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
virtual bool AcceptsFocus() const { return false; }
|
||||
|
||||
protected:
|
||||
// usually overridden base class virtuals
|
||||
|
@@ -94,7 +94,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& name)
|
||||
{
|
||||
if (!parent)
|
||||
return FALSE;
|
||||
return false;
|
||||
parent->AddChild(this);
|
||||
SetName(name);
|
||||
#if wxUSE_VALIDATORS
|
||||
@@ -108,7 +108,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
||||
SetForegroundColour(parent->GetForegroundColour()) ;
|
||||
m_windowStyle = style;
|
||||
|
||||
if ( id == -1 )
|
||||
if ( id == wxID_ANY )
|
||||
m_windowId = (int)NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
@@ -118,14 +118,14 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
||||
int width = size.x;
|
||||
int height = size.y;
|
||||
|
||||
if (width == -1)
|
||||
if (width == wxDefaultCoord)
|
||||
{
|
||||
if (style & wxHORIZONTAL)
|
||||
width = 140;
|
||||
else
|
||||
width = 14;
|
||||
}
|
||||
if (height == -1)
|
||||
if (height == wxDefaultCoord)
|
||||
{
|
||||
if (style & wxVERTICAL)
|
||||
height = 140;
|
||||
@@ -159,7 +159,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
SetSize(x, y, width, height);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxScrollBar::~wxScrollBar(void)
|
||||
@@ -286,7 +286,7 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
{
|
||||
// don't process the event if there is no displacement,
|
||||
// unless this is a thumb release or end scroll event.
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
wxScrollEvent event(scrollEvent, m_windowId);
|
||||
|
@@ -87,7 +87,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule, wxModule)
|
||||
|
||||
bool wxSystemSettingsModule::OnInit()
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxSystemSettingsModule::OnExit()
|
||||
@@ -110,7 +110,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
|
||||
// is no invalid colour value we use hasCol as the real indicator of
|
||||
// whether colSys was initialized or not
|
||||
COLORREF colSys = 0;
|
||||
bool hasCol = FALSE;
|
||||
bool hasCol = false;
|
||||
|
||||
// the default colours for the entries after BTNHIGHLIGHT
|
||||
static const COLORREF s_defaultSysColors[] =
|
||||
@@ -146,7 +146,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
|
||||
if ( verMaj < 4 )
|
||||
{
|
||||
// NT 3.5
|
||||
useDefault = TRUE;
|
||||
useDefault = true;
|
||||
}
|
||||
else if ( verMaj == 4 )
|
||||
{
|
||||
@@ -161,7 +161,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
|
||||
else // >= 5.1
|
||||
{
|
||||
// 5.1 is Windows XP
|
||||
useDefault = FALSE;
|
||||
useDefault = false;
|
||||
// Determine if we are using flat menus, only then allow wxSYS_COLOUR_MENUBAR
|
||||
if ( index == wxSYS_COLOUR_MENUBAR )
|
||||
{
|
||||
@@ -192,7 +192,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
|
||||
_T("forgot tp update the default colours array") );
|
||||
|
||||
colSys = s_defaultSysColors[n];
|
||||
hasCol = TRUE;
|
||||
hasCol = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -410,12 +410,12 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
|
||||
{
|
||||
case wxSYS_CAN_ICONIZE_FRAME:
|
||||
case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( _T("unknown system feature") );
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -69,7 +69,7 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id,
|
||||
m_lineSize = 1;
|
||||
m_windowStyle = style;
|
||||
|
||||
if ( id == -1 )
|
||||
if ( id == wxID_ANY )
|
||||
m_windowId = (int)NewControlId();
|
||||
else
|
||||
m_windowId = id;
|
||||
@@ -158,7 +158,7 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id,
|
||||
SetSize(x, y, width, height);
|
||||
SetValue(value);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSliderMSW::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
@@ -217,7 +217,7 @@ bool wxSliderMSW::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
if (nScrollInc == 0)
|
||||
{
|
||||
// no event...
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
int newPos = position + nScrollInc;
|
||||
@@ -225,7 +225,7 @@ bool wxSliderMSW::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
if ( (newPos < GetMin()) || (newPos > GetMax()) )
|
||||
{
|
||||
// out of range - but we did process it
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
SetValue(newPos);
|
||||
@@ -333,9 +333,9 @@ void wxSliderMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
|
||||
int currentX, currentY;
|
||||
GetPosition(¤tX, ¤tY);
|
||||
if (x == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||
if (x == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||
x1 = currentX;
|
||||
if (y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||
if (y == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||
y1 = currentY;
|
||||
|
||||
AdjustForParentClientOrigin(x1, y1, sizeFlags);
|
||||
@@ -373,11 +373,11 @@ void wxSliderMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
// a lot of space before the first character
|
||||
new_width += 3*cx;
|
||||
#endif
|
||||
MoveWindow((HWND) m_staticValue, x_offset, y_offset, new_width, valueHeight, TRUE);
|
||||
::MoveWindow((HWND) m_staticValue, x_offset, y_offset, new_width, valueHeight, TRUE);
|
||||
x_offset += new_width + cx;
|
||||
}
|
||||
|
||||
MoveWindow((HWND) m_staticMin, x_offset, y_offset, (int)min_len, cy, TRUE);
|
||||
::MoveWindow((HWND) m_staticMin, x_offset, y_offset, (int)min_len, cy, TRUE);
|
||||
x_offset += (int)(min_len + cx);
|
||||
|
||||
int slider_length = (int)(w1 - x_offset - max_len - cx);
|
||||
@@ -388,10 +388,10 @@ void wxSliderMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
if (slider_length < 100)
|
||||
slider_length = 100;
|
||||
|
||||
MoveWindow(GetHwnd(), x_offset, y_offset, slider_length, slider_height, TRUE);
|
||||
::MoveWindow(GetHwnd(), x_offset, y_offset, slider_length, slider_height, TRUE);
|
||||
x_offset += slider_length + cx;
|
||||
|
||||
MoveWindow((HWND) m_staticMax, x_offset, y_offset, (int)max_len, cy, TRUE);
|
||||
::MoveWindow((HWND) m_staticMax, x_offset, y_offset, (int)max_len, cy, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -400,7 +400,7 @@ void wxSliderMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
w1 = 200;
|
||||
if ( h1 < 0 )
|
||||
h1 = 20;
|
||||
MoveWindow(GetHwnd(), x1, y1, w1, h1, TRUE);
|
||||
::MoveWindow(GetHwnd(), x1, y1, w1, h1, TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -428,11 +428,11 @@ void wxSliderMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
... and replace with following line: */
|
||||
new_width += cx;
|
||||
|
||||
MoveWindow((HWND) m_staticValue, x_offset, y_offset, new_width, valueHeight, TRUE);
|
||||
::MoveWindow((HWND) m_staticValue, x_offset, y_offset, new_width, valueHeight, TRUE);
|
||||
y_offset += valueHeight;
|
||||
}
|
||||
|
||||
MoveWindow((HWND) m_staticMin, x_offset, y_offset, (int)min_len, cy, TRUE);
|
||||
::MoveWindow((HWND) m_staticMin, x_offset, y_offset, (int)min_len, cy, TRUE);
|
||||
y_offset += cy;
|
||||
|
||||
int slider_length = (int)(h1 - y_offset - cy - cy);
|
||||
@@ -444,10 +444,10 @@ void wxSliderMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
if (slider_length < 100)
|
||||
slider_length = 100;
|
||||
|
||||
MoveWindow(GetHwnd(), x_offset, y_offset, slider_width, slider_length, TRUE);
|
||||
::MoveWindow(GetHwnd(), x_offset, y_offset, slider_width, slider_length, TRUE);
|
||||
y_offset += slider_length;
|
||||
|
||||
MoveWindow((HWND) m_staticMax, x_offset, y_offset, (int)max_len, cy, TRUE);
|
||||
::MoveWindow((HWND) m_staticMax, x_offset, y_offset, (int)max_len, cy, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -456,7 +456,7 @@ void wxSliderMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
w1 = 20;
|
||||
if ( h1 < 0 )
|
||||
h1 = 200;
|
||||
MoveWindow(GetHwnd(), x1, y1, w1, h1, TRUE);
|
||||
::MoveWindow(GetHwnd(), x1, y1, w1, h1, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -549,7 +549,7 @@ bool wxSliderMSW::Show(bool show)
|
||||
ShowWindow((HWND) m_staticMin, (BOOL)cshow);
|
||||
if(m_staticMax)
|
||||
ShowWindow((HWND) m_staticMax, (BOOL)cshow);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -61,18 +61,18 @@ public:
|
||||
{
|
||||
wxLogLastError(_T("CreateMutex"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// mutex was either created or opened - see what really happened
|
||||
m_wasOpened = ::GetLastError() == ERROR_ALREADY_EXISTS;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WasOpened() const
|
||||
{
|
||||
wxCHECK_MSG( m_hMutex, FALSE,
|
||||
wxCHECK_MSG( m_hMutex, false,
|
||||
_T("can't be called if mutex creation failed") );
|
||||
|
||||
return m_wasOpened;
|
||||
@@ -119,7 +119,7 @@ bool wxSingleInstanceChecker::Create(const wxString& name,
|
||||
|
||||
bool wxSingleInstanceChecker::IsAnotherRunning() const
|
||||
{
|
||||
wxCHECK_MSG( m_impl, FALSE, _T("must call Create() first") );
|
||||
wxCHECK_MSG( m_impl, false, _T("must call Create() first") );
|
||||
|
||||
// if the mutex had been opened, another instance is running - otherwise we
|
||||
// would have created it
|
||||
|
@@ -66,7 +66,7 @@ bool wxSound::Create(const wxString& fileName, bool isResource)
|
||||
|
||||
if (isResource)
|
||||
{
|
||||
m_isResource = TRUE;
|
||||
m_isResource = true;
|
||||
|
||||
HRSRC hresInfo;
|
||||
hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, wxT("WAVE"));
|
||||
|
@@ -270,7 +270,7 @@ void wxSpinButton::SetRange(int minVal, int maxVal)
|
||||
bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
WXWORD pos, WXHWND control)
|
||||
{
|
||||
wxCHECK_MSG( control, FALSE, wxT("scrolling what?") )
|
||||
wxCHECK_MSG( control, false, wxT("scrolling what?") )
|
||||
|
||||
if ( wParam != SB_THUMBPOSITION )
|
||||
{
|
||||
|
@@ -120,7 +120,7 @@ BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton)
|
||||
|
||||
EVT_SET_FOCUS(wxSpinCtrl::OnSetFocus)
|
||||
|
||||
EVT_SPIN(-1, wxSpinCtrl::OnSpinChange)
|
||||
EVT_SPIN(wxID_ANY, wxSpinCtrl::OnSpinChange)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#define GetBuddyHwnd() (HWND)(m_hwndBuddy)
|
||||
@@ -228,7 +228,7 @@ bool wxSpinCtrl::ProcessTextCommand(WXWORD cmd, WXWORD WXUNUSED(id))
|
||||
}
|
||||
|
||||
// not processed
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::OnChar(wxKeyEvent& event)
|
||||
@@ -352,14 +352,14 @@ bool wxSpinCtrl::Create(wxWindow *parent,
|
||||
{
|
||||
wxLogLastError(wxT("CreateWindow(buddy text window)"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// create the spin button
|
||||
if ( !wxSpinButton::Create(parent, id, posBtn, sizeBtn, style, name) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
SetRange(min, max);
|
||||
@@ -401,7 +401,7 @@ bool wxSpinCtrl::Create(wxWindow *parent,
|
||||
// initial wxEVT_COMMAND_TEXT_UPDATED message
|
||||
ms_allSpins.Add(this);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxSpinCtrl::~wxSpinCtrl()
|
||||
@@ -461,37 +461,37 @@ bool wxSpinCtrl::SetFont(const wxFont& font)
|
||||
if ( !wxWindowBase::SetFont(font) )
|
||||
{
|
||||
// nothing to do
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
WXHANDLE hFont = GetFont().GetResourceHandle();
|
||||
(void)::SendMessage(GetBuddyHwnd(), WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSpinCtrl::Show(bool show)
|
||||
{
|
||||
if ( !wxControl::Show(show) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
::ShowWindow(GetBuddyHwnd(), show ? SW_SHOW : SW_HIDE);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxSpinCtrl::Enable(bool enable)
|
||||
{
|
||||
if ( !wxControl::Enable(enable) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
::EnableWindow(GetBuddyHwnd(), enable);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::SetFocus()
|
||||
|
@@ -146,7 +146,7 @@ bool wxStaticBitmap::Create(wxWindow *parent,
|
||||
const wxString& name)
|
||||
{
|
||||
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// we may have either bitmap or icon: if a bitmap with mask is passed, we
|
||||
// will transform it to an icon ourselves because otherwise the mask will
|
||||
@@ -169,7 +169,7 @@ bool wxStaticBitmap::Create(wxWindow *parent,
|
||||
// GetBestSize will work properly now, so set the best size if needed
|
||||
SetBestSize(size);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxBorder wxStaticBitmap::GetDefaultBorder() const
|
||||
@@ -259,7 +259,7 @@ void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image)
|
||||
rect.top = y;
|
||||
rect.right = x + w;
|
||||
rect.bottom = y + h;
|
||||
InvalidateRect(GetHwndOf(GetParent()), &rect, TRUE);
|
||||
::InvalidateRect(GetHwndOf(GetParent()), &rect, TRUE);
|
||||
}
|
||||
|
||||
// We need this or the control can never be moved e.g. in Dialog Editor.
|
||||
|
@@ -112,7 +112,7 @@ bool wxStaticBox::Create(wxWindow *parent,
|
||||
const wxString& name)
|
||||
{
|
||||
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// as wxStaticBox doesn't draw its own background, we make it transparent
|
||||
// to force redrawing its background which could have been overwritten by
|
||||
@@ -132,12 +132,12 @@ bool wxStaticBox::Create(wxWindow *parent,
|
||||
WS_EX_TRANSPARENT
|
||||
#endif
|
||||
) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// to be transparent we should have the same colour as the parent as well
|
||||
SetBackgroundColour(GetParent()->GetBackgroundColour());
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxSize wxStaticBox::DoGetBestSize() const
|
||||
|
@@ -70,7 +70,7 @@ bool wxStatusBar95::Create(wxWindow *parent,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
wxCHECK_MSG( parent, FALSE, wxT("status bar must have a parent") );
|
||||
wxCHECK_MSG( parent, false, wxT("status bar must have a parent") );
|
||||
|
||||
SetName(name);
|
||||
SetWindowStyleFlag(style);
|
||||
@@ -78,7 +78,7 @@ bool wxStatusBar95::Create(wxWindow *parent,
|
||||
|
||||
parent->AddChild(this);
|
||||
|
||||
m_windowId = id == -1 ? NewControlId() : id;
|
||||
m_windowId = id == wxID_ANY ? NewControlId() : id;
|
||||
|
||||
DWORD wstyle = WS_CHILD | WS_VISIBLE;
|
||||
|
||||
@@ -111,7 +111,7 @@ bool wxStatusBar95::Create(wxWindow *parent,
|
||||
{
|
||||
wxLogSysError(_("Failed to create a status bar."));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
SetFieldsCount(1);
|
||||
@@ -120,7 +120,7 @@ bool wxStatusBar95::Create(wxWindow *parent,
|
||||
|
||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxStatusBar95::~wxStatusBar95()
|
||||
@@ -247,7 +247,7 @@ void wxStatusBar95::SetMinHeight(int height)
|
||||
|
||||
bool wxStatusBar95::GetFieldRect(int i, wxRect& rect) const
|
||||
{
|
||||
wxCHECK_MSG( (i >= 0) && (i < m_nFields), FALSE,
|
||||
wxCHECK_MSG( (i >= 0) && (i < m_nFields), false,
|
||||
_T("invalid statusbar field index") );
|
||||
|
||||
RECT r;
|
||||
@@ -258,7 +258,7 @@ bool wxStatusBar95::GetFieldRect(int i, wxRect& rect) const
|
||||
|
||||
wxCopyRECTToRect(r, rect);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxStatusBar95::DoMoveWindow(int x, int y, int width, int height)
|
||||
|
@@ -116,7 +116,7 @@ bool wxStaticLine::Create(wxWindow *parent,
|
||||
wxSize size = AdjustSize(sizeOrig);
|
||||
|
||||
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return MSWCreateControl(_T("STATIC"), wxEmptyString, pos, size);
|
||||
}
|
||||
|
@@ -94,12 +94,12 @@ bool wxStaticText::Create(wxWindow *parent,
|
||||
const wxString& name)
|
||||
{
|
||||
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if ( !MSWCreateControl(wxT("STATIC"), label, pos, size) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxBorder wxStaticText::GetDefaultBorder() const
|
||||
@@ -132,7 +132,7 @@ wxSize wxStaticText::DoGetBestSize() const
|
||||
int widthTextMax = 0, widthLine,
|
||||
heightTextTotal = 0, heightLineDefault = 0, heightLine = 0;
|
||||
|
||||
bool lastWasAmpersand = FALSE;
|
||||
bool lastWasAmpersand = false;
|
||||
|
||||
wxString curLine;
|
||||
for ( const wxChar *pc = text; ; pc++ )
|
||||
@@ -179,14 +179,14 @@ wxSize wxStaticText::DoGetBestSize() const
|
||||
{
|
||||
if ( !lastWasAmpersand )
|
||||
{
|
||||
lastWasAmpersand = TRUE;
|
||||
lastWasAmpersand = true;
|
||||
|
||||
// skip the statement adding pc to curLine below
|
||||
continue;
|
||||
}
|
||||
|
||||
// it is a literal ampersand
|
||||
lastWasAmpersand = FALSE;
|
||||
lastWasAmpersand = false;
|
||||
}
|
||||
|
||||
curLine += *pc;
|
||||
@@ -216,7 +216,8 @@ void wxStaticText::SetLabel(const wxString& label)
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
{
|
||||
InvalidateBestSize();
|
||||
DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
|
||||
DoSetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, wxDefaultCoord,
|
||||
wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +231,8 @@ bool wxStaticText::SetFont(const wxFont& font)
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
{
|
||||
InvalidateBestSize();
|
||||
DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
|
||||
DoSetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, wxDefaultCoord,
|
||||
wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user