1
/////////////////////////////////////////////////////////////////////////////
7
// Copyright: (C) 2006, Paolo Gava
8
// RCS-ID: $Id: xaxis.cpp 4016 2007-05-30 23:08:39Z byo $
9
// Licence: wxWindows licence
10
/////////////////////////////////////////////////////////////////////////////
12
//----------------------------------------------------------------------------
14
//----------------------------------------------------------------------------
21
// For compilers that support precompilation, includes "wx.h".
22
#include <wx/wxprec.h>
34
//+++-S-cf-------------------------------------------------------------------
37
// PARAMETERS: CHART_HPAINT hp,
40
//----------------------------------------------------------------------E-+++
47
if ( GetVirtualMax() > 0 )
49
wxFont font(8, wxROMAN, wxNORMAL, wxNORMAL);
51
hp->SetPen( *wxBLACK_PEN );
53
int iNodes = static_cast<int>(ceil( GetVirtualMax() ));
54
ChartSizes sizes = GetSizes();
58
//-------------------------------------------------------------------
59
// If hr->x != 0 means we are drawing the axis on file. So the
60
// following condition prevent from drawing only part of the axis ie
61
// ignor any scroll position
62
// TODO: any better idea?!
63
//-------------------------------------------------------------------
66
hr->xscroll *= sizes.scroll;
72
for ( int iNode = 0; iNode <= iNodes; ++ iNode )
78
hp->DrawLine( static_cast<int>(ceil(x)) + hr->x, 5 + hr->y,
79
static_cast<int>(ceil(x)) + hr->x, 15 + hr->y );
81
label.Printf( wxT("%d"), iNode );
82
hp->DrawText( label, static_cast<int>(ceil(x)) +
85
x += GetZoom() * ( sizes.wbar * sizes.nbar +
86
sizes.wbar3d * sizes.nbar3d +
90
hp->DrawLine( hr->x, hr->y + 1, hr->x + static_cast<int>(ceil(x)),