/////////////////////////////////////////////////////////////////////////////
-// Name: spinbutt.cpp
+// Name: src/mac/classic/spinbutt.cpp
// Purpose: wxSpinCtrl
// Author: Robert
// Modified by: Mark Newsam (Based on GTK file)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "spinctlg.h"
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
#endif
-#include "wx/defs.h"
+#if wxUSE_SPINCTRL
+
+#include "wx/spinctrl.h"
#ifndef WX_PRECOMP
#include "wx/textctrl.h"
#endif //WX_PRECOMP
-#if wxUSE_SPINCTRL
-
#include "wx/spinbutt.h"
-#include "wx/spinctrl.h"
-
-
-#include "wx/spinctrl.h"
// ----------------------------------------------------------------------------
// constants
{
// Hand button down events to wxSpinCtrl. Doesn't work.
if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event ))
- return TRUE;
+ return true;
return wxTextCtrl::ProcessEvent( event );
}
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
-
+
// ============================================================================
// implementation
// ============================================================================
if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style,
wxDefaultValidator, name) )
{
- return FALSE;
+ return false;
}
// the string value overrides the numeric one (for backwards compatibility
}
DoSetSize(pos.x , pos.y , csize.x, csize.y);
- return TRUE;
+ return true;
}
wxSpinCtrl::~wxSpinCtrl()
bool wxSpinCtrl::Enable(bool enable)
{
if ( !wxControl::Enable(enable) )
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
bool wxSpinCtrl::Show(bool show)
{
if ( !wxControl::Show(show) )
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
// ----------------------------------------------------------------------------
if ( !m_text->GetValue().ToLong(&l) )
{
// not a number at all
- return FALSE;
+ return false;
}
if ( l < GetMin() || l > GetMax() )
{
// out of range
- return FALSE;
+ return false;
}
*val = l;
- return TRUE;
+ return true;
}
int wxSpinCtrl::GetValue() const
// be selected
if ( (from == -1) && (to == -1) )
{
- from = 0;
+ from = 0;
}
m_text->SetSelection(from, to);
-}
+}
#endif // wxUSE_SPINCTRL