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 ) ; }
void GetPosition(int *x, int *y) const;
- bool Show(bool show = TRUE);
+ bool Show(bool show = true);
void SetRange(int minValue, int maxValue);
int sizeFlags = wxSIZE_AUTO);
virtual wxSize DoGetBestSize() const;
-
+
DECLARE_DYNAMIC_CLASS_NO_COPY(wxSlider95)
};
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SOUND_H_
bool Create(int size, const wxByte* data);
bool IsOk() const { return (m_waveData ? true : false); };
-
+
static void Stop();
protected:
bool Free();
-
+
bool DoPlay(unsigned flags) const;
private:
wxSpinCtrl() { }
wxSpinCtrl(wxWindow *parent,
- wxWindowID id = -1,
+ wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
}
bool Create(wxWindow *parent,
- wxWindowID id = -1,
+ wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
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(); }
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);
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;
// ctors and such
wxStatusBar95();
wxStatusBar95(wxWindow *parent,
- wxWindowID id = -1,
+ wxWindowID id = wxID_ANY,
long style = wxST_SIZEGRIP,
const wxString& name = wxEmptyString)
{
}
bool Create(wxWindow *parent,
- wxWindowID id = -1,
+ wxWindowID id = wxID_ANY,
long style = wxST_SIZEGRIP,
const wxString& name = wxEmptyString);
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
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
wxEVENT_RANGE_PROPERTY( Scroll , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxScrollEvent )
wxPROPERTY( ThumbPosition , int , SetThumbPosition, GetThumbPosition, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
- wxPROPERTY( Range , int , SetRange, GetRange, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
- wxPROPERTY( ThumbSize , int , SetThumbSize, GetThumbSize, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
- wxPROPERTY( PageSize , int , SetPageSize, GetPageSize, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( Range , int , SetRange, GetRange, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( ThumbSize , int , SetThumbSize, GetThumbSize, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( PageSize , int , SetPageSize, GetPageSize, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_FLAGS( WindowStyle , wxScrollBarStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE()
const wxString& name)
{
if (!parent)
- return FALSE;
+ return false;
parent->AddChild(this);
SetName(name);
#if wxUSE_VALIDATORS
SetForegroundColour(parent->GetForegroundColour()) ;
m_windowStyle = style;
- if ( id == -1 )
- m_windowId = (int)NewControlId();
- else
- m_windowId = id;
+ if ( id == wxID_ANY )
+ m_windowId = (int)NewControlId();
+ else
+ m_windowId = id;
- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
+ int x = pos.x;
+ int y = pos.y;
+ 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;
SetSize(x, y, width, height);
- return TRUE;
+ return true;
}
wxScrollBar::~wxScrollBar(void)
{
// 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);
bool wxSystemSettingsModule::OnInit()
{
- return TRUE;
+ return true;
}
void wxSystemSettingsModule::OnExit()
// 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[] =
if ( verMaj < 4 )
{
// NT 3.5
- useDefault = TRUE;
+ useDefault = true;
}
else if ( verMaj == 4 )
{
else // >= 5.1
{
// 5.1 is Windows XP
- useDefault = FALSE;
- // Determine if we are using flat menus, only then allow wxSYS_COLOUR_MENUBAR
- if ( index == wxSYS_COLOUR_MENUBAR )
- {
- BOOL isFlat ;
- if ( SystemParametersInfo( SPI_GETFLATMENU , 0 ,&isFlat, 0 ) )
- {
- if ( !isFlat )
- index = wxSYS_COLOUR_MENU ;
- }
- }
+ useDefault = false;
+ // Determine if we are using flat menus, only then allow wxSYS_COLOUR_MENUBAR
+ if ( index == wxSYS_COLOUR_MENUBAR )
+ {
+ BOOL isFlat ;
+ if ( SystemParametersInfo( SPI_GETFLATMENU , 0 ,&isFlat, 0 ) )
+ {
+ if ( !isFlat )
+ index = wxSYS_COLOUR_MENU ;
+ }
+ }
}
if ( useDefault )
_T("forgot tp update the default colours array") );
colSys = s_defaultSysColors[n];
- hasCol = TRUE;
+ hasCol = true;
}
}
}
{
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;
}
}
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
(int) min_len, cy, TRUE);
y_offset += cy;
- // slider_length = (total height available) - (height used so far)
+ // slider_length = (total height available) - (height used so far)
// - (height of max label) - (border)
int slider_length = (int)(h1 - (y_offset-y) - cy - cy);
{
wxSize rv;
wxChar buf[300];
- int cx;
+ int cx;
int cy;
int cyf;
int min_len = 0;
int max_len = 0;
-
+
wxGetCharSize(GetHWND(), &cx, &cy, this->GetFont());
-
+
if ( !HasFlag(wxSL_VERTICAL))
{
rv = wxSize(100, 20); // default size for the slider itself
-
+
if (HasFlag(wxSL_LABELS)) // do we need to add more for the labels?
{
::GetWindowText((HWND) m_staticMin, buf, 300);
{
int new_width = (int)(wxMax(min_len, max_len));
int valueHeight = (int)cyf;
-
+
#ifdef __WIN32__
// For some reason, under Win95, the text edit control has
// a lot of space before the first character
::GetWindowText((HWND) m_staticMax, buf, 300);
GetTextExtent(buf, &max_len, &cyf);
rv.y += cy;
-
+
if (m_staticValue)
{
int new_width = (int)(wxMax(min_len, max_len));
valueHeight = (int) (valueHeight * 1.5) ;
rv.y += valueHeight;
rv.x = wxMax(new_width, rv.x);
- }
+ }
}
}
return rv;
m_lineSize = 1;
m_windowStyle = style;
- if ( id == -1 )
+ if ( id == wxID_ANY )
m_windowId = (int)NewControlId();
else
m_windowId = id;
SetSize(x, y, width, height);
SetValue(value);
- return TRUE;
+ return true;
}
bool wxSliderMSW::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
if (nScrollInc == 0)
{
// no event...
- return FALSE;
+ return false;
}
int newPos = position + nScrollInc;
if ( (newPos < GetMin()) || (newPos > GetMax()) )
{
// out of range - but we did process it
- return TRUE;
+ return true;
}
SetValue(newPos);
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);
// 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);
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
{
w1 = 200;
if ( h1 < 0 )
h1 = 20;
- MoveWindow(GetHwnd(), x1, y1, w1, h1, TRUE);
+ ::MoveWindow(GetHwnd(), x1, y1, w1, h1, TRUE);
}
}
else
... 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);
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
{
w1 = 20;
if ( h1 < 0 )
h1 = 200;
- MoveWindow(GetHwnd(), x1, y1, w1, h1, TRUE);
+ ::MoveWindow(GetHwnd(), x1, y1, w1, h1, TRUE);
}
}
}
ShowWindow((HWND) m_staticMin, (BOOL)cshow);
if(m_staticMax)
ShowWindow((HWND) m_staticMax, (BOOL)cshow);
- return TRUE;
+ return true;
}
{
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;
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
if (isResource)
{
- m_isResource = TRUE;
+ m_isResource = true;
HRSRC hresInfo;
hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, wxT("WAVE"));
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
wxBEGIN_HANDLERS_TABLE(wxSpinButton)
wxEND_HANDLERS_TABLE()
-wxCONSTRUCTOR_5( wxSpinButton , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
+wxCONSTRUCTOR_5( wxSpinButton , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
#else
IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
#endif
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 )
{
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
wxBEGIN_PROPERTIES_TABLE(wxSpinCtrl)
wxEVENT_RANGE_PROPERTY( Spin , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxSpinEvent )
wxEVENT_PROPERTY( Updated , wxEVT_COMMAND_SPINCTRL_UPDATED , wxCommandEvent )
- wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent )
+ wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent )
wxEVENT_PROPERTY( TextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent )
wxPROPERTY( ValueString , wxString , SetValue , GetValue , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) ;
- wxPROPERTY( Value , int , SetValue, GetValue, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
- wxPROPERTY( Min , int , SetMin, GetMin, 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
- wxPROPERTY( Max , int , SetMax, GetMax, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( Value , int , SetValue, GetValue, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( Min , int , SetMin, GetMin, 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
+ wxPROPERTY( Max , int , SetMax, GetMax, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_FLAGS( WindowStyle , wxSpinCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
/*
- TODO PROPERTIES
- style wxSP_ARROW_KEYS
+ TODO PROPERTIES
+ style wxSP_ARROW_KEYS
*/
wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxSpinCtrl)
wxEND_HANDLERS_TABLE()
-wxCONSTRUCTOR_6( wxSpinCtrl , wxWindow* , Parent , wxWindowID , Id , wxString , ValueString , wxPoint , Position , wxSize , Size , long , WindowStyle )
+wxCONSTRUCTOR_6( wxSpinCtrl , wxWindow* , Parent , wxWindowID , Id , wxString , ValueString , wxPoint , Position , wxSize , Size , long , WindowStyle )
#else
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
#endif
EVT_SET_FOCUS(wxSpinCtrl::OnSetFocus)
- EVT_SPIN(-1, wxSpinCtrl::OnSpinChange)
+ EVT_SPIN(wxID_ANY, wxSpinCtrl::OnSpinChange)
END_EVENT_TABLE()
#define GetBuddyHwnd() (HWND)(m_hwndBuddy)
}
// not processed
- return FALSE;
+ return false;
}
void wxSpinCtrl::OnChar(wxKeyEvent& event)
{
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);
// initial wxEVT_COMMAND_TEXT_UPDATED message
ms_allSpins.Add(this);
- return TRUE;
+ return true;
}
wxSpinCtrl::~wxSpinCtrl()
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()
// from above, because otherwise we'll get a spin control
// that's too big. So never use the height calculated
// from wxSpinButton::DoGetBestSize().
-
+
// if ( sizeBtn.y < y )
{
// make the text tall enough
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
#endif
/*
- TODO PROPERTIES :
- bitmap
+ TODO PROPERTIES :
+ bitmap
*/
// ===========================================================================
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
// GetBestSize will work properly now, so set the best size if needed
SetBestSize(size);
-
- return TRUE;
+
+ return true;
}
wxBorder wxStaticBitmap::GetDefaultBorder() const
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.
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticBox, wxControl,"wx/statbox.h")
wxBEGIN_PROPERTIES_TABLE(wxStaticBox)
- wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_FLAGS( WindowStyle , wxStaticBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
/*
- TODO PROPERTIES :
- label
+ TODO PROPERTIES :
+ label
*/
wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxStaticBox)
wxEND_HANDLERS_TABLE()
-wxCONSTRUCTOR_6( wxStaticBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
+wxCONSTRUCTOR_6( wxStaticBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
#else
IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
#endif
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
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
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);
parent->AddChild(this);
- m_windowId = id == -1 ? NewControlId() : id;
+ m_windowId = id == wxID_ANY ? NewControlId() : id;
DWORD wstyle = WS_CHILD | WS_VISIBLE;
{
wxLogSysError(_("Failed to create a status bar."));
- return FALSE;
+ return false;
}
SetFieldsCount(1);
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
- return TRUE;
+ return true;
}
wxStatusBar95::~wxStatusBar95()
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;
wxCopyRECTToRect(r, rect);
- return TRUE;
+ return true;
}
void wxStatusBar95::DoMoveWindow(int x, int y, int width, int height)
// adjust fields widths to the new size
SetFieldsWidth();
- // we have to trigger wxSizeEvent if there are children window in status
+ // we have to trigger wxSizeEvent if there are children window in status
// bar because GetFieldRect returned incorrect (not updated) values up to
// here, which almost certainly resulted in incorrectly redrawn statusbar
if ( m_children.GetCount() > 0 )
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
#endif
/*
- TODO PROPERTIES :
- style (wxLI_HORIZONTAL)
+ TODO PROPERTIES :
+ style (wxLI_HORIZONTAL)
*/
// ----------------------------------------------------------------------------
wxSize size = AdjustSize(sizeOrig);
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
- return FALSE;
+ return false;
return MSWCreateControl(_T("STATIC"), wxEmptyString, pos, size);
}
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticText, wxControl,"wx/stattext.h")
wxBEGIN_PROPERTIES_TABLE(wxStaticText)
- wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_FLAGS( WindowStyle , wxStaticTextStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxStaticText)
wxEND_HANDLERS_TABLE()
-wxCONSTRUCTOR_6( wxStaticText , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
+wxCONSTRUCTOR_6( wxStaticText , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
#else
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
#endif
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
int widthTextMax = 0, widthLine,
heightTextTotal = 0, heightLineDefault = 0, heightLine = 0;
- bool lastWasAmpersand = FALSE;
+ bool lastWasAmpersand = false;
wxString curLine;
for ( const wxChar *pc = text; ; pc++ )
{
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;
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);
}
}
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;