Files
wxWidgets/src/univ/gauge.cpp
Vadim Zeitlin 3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00

126 lines
3.2 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: src/gauge/gauge.cpp
// Purpose: wxGauge for wxUniversal
// Author: Vadim Zeitlin
// Modified by:
// Created: 20.02.01
// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if wxUSE_GAUGE
#include "wx/gauge.h"
#ifndef WX_PRECOMP
#endif //WX_PRECOMP
#include "wx/univ/renderer.h"
// ============================================================================
// implementation
// ============================================================================
// ----------------------------------------------------------------------------
// wxGauge creation
// ----------------------------------------------------------------------------
void wxGauge::Init()
{
m_gaugePos =
m_rangeMax = 0;
}
bool wxGauge::Create(wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name)
{
if ( !wxGaugeBase::Create(parent, id, range, pos, size, style,
validator, name) )
{
return false;
}
SetInitialSize(size);
return true;
}
// ----------------------------------------------------------------------------
// wxGauge range/position
// ----------------------------------------------------------------------------
void wxGauge::SetRange(int range)
{
wxGaugeBase::SetRange(range);
Refresh();
}
void wxGauge::SetValue(int pos)
{
wxGaugeBase::SetValue(pos);
Refresh();
}
// ----------------------------------------------------------------------------
// wxGauge geometry
// ----------------------------------------------------------------------------
wxSize wxGauge::DoGetBestClientSize() const
{
wxSize size = GetRenderer()->GetProgressBarStep();
// these adjustments are really ridiculous - they are just done to find the
// "correct" result under Windows (FIXME)
if ( IsVertical() )
{
size.x = (3*size.y) / 2 + 2;
size.y = wxDefaultCoord;
}
else
{
size.y = (3*size.x) / 2 + 2;
size.x = wxDefaultCoord;
}
return size;
}
// ----------------------------------------------------------------------------
// wxGauge drawing
// ----------------------------------------------------------------------------
wxBorder wxGauge::GetDefaultBorder() const
{
return wxBORDER_STATIC;
}
void wxGauge::DoDraw(wxControlRenderer *renderer)
{
renderer->DrawProgressBar(this);
}
#endif // wxUSE_GAUGE