+//-----------------------------------------------------------------------------
+// wxPlotOnOffCurve
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_CLASS(wxPlotOnOffCurve, wxObject)
+
+#include "wx/arrimpl.cpp"
+WX_DEFINE_OBJARRAY(wxArrayPlotOnOff);
+
+wxPlotOnOffCurve::wxPlotOnOffCurve( int offsetY )
+{
+ m_offsetY = offsetY;
+ m_minX = -1;
+ m_maxX = -1;
+}
+
+void wxPlotOnOffCurve::Add( wxInt32 on, wxInt32 off, void *clientData )
+{
+ wxASSERT_MSG( on > 0, wxT("plot index < 0") );
+ wxASSERT( on <= off );
+
+ if (m_minX == -1)
+ m_minX = on;
+ if (off > m_maxX)
+ m_maxX = off;
+
+ wxPlotOnOff *v = new wxPlotOnOff;
+ v->m_on = on;
+ v->m_off = off;
+ v->m_clientData = clientData;
+ m_marks.Add( v );
+}
+
+size_t wxPlotOnOffCurve::GetCount()
+{
+ return m_marks.GetCount();
+}
+
+wxInt32 wxPlotOnOffCurve::GetOn( size_t index )
+{
+ wxPlotOnOff *v = &m_marks.Item( index );
+ return v->m_on;
+}
+
+wxInt32 wxPlotOnOffCurve::GetOff( size_t index )
+{
+ wxPlotOnOff *v = &m_marks.Item( index );
+ return v->m_off;
+}
+
+void* wxPlotOnOffCurve::GetClientData( size_t index )
+{
+ wxPlotOnOff *v = &m_marks.Item( index );
+ return v->m_clientData;
+}
+
+wxPlotOnOff *wxPlotOnOffCurve::GetAt( size_t index )
+{
+ return &m_marks.Item( index );
+}
+
+void wxPlotOnOffCurve::DrawOnLine( wxDC &dc, wxCoord y, wxCoord start, wxCoord end, void *WXUNUSED(clientData) )
+{
+ dc.DrawLine( start, y, start, y-30 );
+ dc.DrawLine( start, y-30, end, y-30 );
+ dc.DrawLine( end, y-30, end, y );
+}
+
+void wxPlotOnOffCurve::DrawOffLine( wxDC &dc, wxCoord y, wxCoord start, wxCoord end )
+{
+ dc.DrawLine( start, y, end, y );
+}
+