x += view_x;
y += view_y;
- wxNode *node = m_owner->m_curves.First();
+ wxList::compatibility_iterator node = m_owner->m_curves.GetFirst();
while (node)
{
- wxPlotCurve *curve = (wxPlotCurve*)node->Data();
+ wxPlotCurve *curve = (wxPlotCurve*)node->GetData();
double double_client_height = (double)client_height;
double range = curve->GetEndY() - curve->GetStartY();
event1.SetPosition( (int)floor(x/m_owner->GetZoom()) );
m_owner->GetEventHandler()->ProcessEvent( event1 );
- if (curve != m_owner->GetCurrent())
+ if (curve != m_owner->GetCurrentCurve())
{
wxPlotEvent event2( wxEVT_PLOT_SEL_CHANGING, m_owner->GetId() );
event2.SetEventObject( m_owner );
event2.SetCurve( curve );
if (!m_owner->GetEventHandler()->ProcessEvent( event2 ) || event2.IsAllowed())
{
- m_owner->SetCurrent( curve );
+ m_owner->SetCurrentCurve( curve );
}
}
return;
}
- node = node->Next();
+ node = node->GetNext();
}
}
double end = curve->GetEndY();
wxCoord offset_y = curve->GetOffsetY();
- wxCoord y=0,last_y=0;
+ wxCoord last_y=0;
for (int x = start_x; x < end_x; x++)
{
double dy = (end - curve->GetY( (wxInt32)(x/zoom) )) / range;
- y = (wxCoord)(dy * double_client_height) - offset_y - 1;
+ wxCoord y = (wxCoord)(dy * double_client_height) - offset_y - 1;
if (x != start_x)
dc->DrawLine( x-1, last_y, x, y );
while (upd)
{
- int update_x = upd.GetX();
- int update_y = upd.GetY();
+ int update_x = upd.GetX() + view_x;
+#if 0
+ // unused var
+ int update_y = upd.GetY() + view_y;
+#endif
int update_width = upd.GetWidth();
- update_x += view_x;
- update_y += view_y;
-
/*
if (m_owner->m_current)
{
}
*/
- wxNode *node = m_owner->m_curves.First();
+ wxList::compatibility_iterator node = m_owner->m_curves.GetFirst();
while (node)
{
- wxPlotCurve *curve = (wxPlotCurve*) node->Data();
+ wxPlotCurve *curve = (wxPlotCurve*) node->GetData();
- if (curve == m_owner->GetCurrent())
+ if (curve == m_owner->GetCurrentCurve())
dc.SetPen( *wxBLACK_PEN );
else
dc.SetPen( *wxGREY_PEN );
DrawCurve( &dc, curve, update_x-1, update_x+update_width+2 );
- node = node->Next();
+ node = node->GetNext();
}
dc.SetPen( *wxRED_PEN );
- node = m_owner->m_onOffCurves.First();
+ node = m_owner->m_onOffCurves.GetFirst();
while (node)
{
- wxPlotOnOffCurve *curve = (wxPlotOnOffCurve*) node->Data();
+ wxPlotOnOffCurve *curve = (wxPlotOnOffCurve*) node->GetData();
DrawOnOffCurve( &dc, curve, update_x-1, update_x+update_width+2 );
- node = node->Next();
+ node = node->GetNext();
}
upd ++;
view_x *= wxPLOT_SCROLL_STEP;
view_y *= wxPLOT_SCROLL_STEP;
- wxCoord x = event.GetX();
- wxCoord y = event.GetY();
- x += view_x;
- y += view_y;
+ wxCoord x = event.GetX() + view_x;
+ wxCoord y = event.GetY() + view_y;
- /* do something here */
+ /* TO DO: do something here */
+ wxUnusedVar(x);
+ wxUnusedVar(y);
}
void wxPlotXAxisArea::OnPaint( wxPaintEvent &WXUNUSED(event) )
}
dc.SetBrush( *wxWHITE_BRUSH );
- dc.SetPen( *_TRANSPARENT_PEN );
+ dc.SetPen( *wxTRANSPARENT_PEN );
dc.DrawRectangle( 4, 5, client_width-14, 10 );
dc.DrawRectangle( 0, 20, client_width, 20 );
dc.SetPen( *wxBLACK_PEN );
{
wxPaintDC dc( this );
- wxPlotCurve *curve = m_owner->GetCurrent();
+ wxPlotCurve *curve = m_owner->GetCurrentCurve();
if (!curve) return;
wxPlotCurve *wxPlotWindow::GetAt( size_t n )
{
- wxNode *node = m_curves.Nth( n );
+ wxList::compatibility_iterator node = m_curves.Item( n );
if (!node)
return (wxPlotCurve*) NULL;
- return (wxPlotCurve*) node->Data();
+ return (wxPlotCurve*) node->GetData();
}
-void wxPlotWindow::SetCurrent( wxPlotCurve* current )
+void wxPlotWindow::SetCurrentCurve( wxPlotCurve* current )
{
m_current = current;
m_area->Refresh( FALSE );
void wxPlotWindow::Delete( wxPlotCurve* curve )
{
- wxNode *node = m_curves.Find( curve );
+ wxList::compatibility_iterator node = m_curves.Find( curve );
if (!node) return;
m_curves.DeleteObject( curve );
if (curve == m_current) m_current = (wxPlotCurve *) NULL;
}
-wxPlotCurve *wxPlotWindow::GetCurrent()
+wxPlotCurve *wxPlotWindow::GetCurrentCurve()
{
return m_current;
}
void wxPlotWindow::Delete( wxPlotOnOffCurve* curve )
{
- wxNode *node = m_onOffCurves.Find( curve );
+ wxList::compatibility_iterator node = m_onOffCurves.Find( curve );
if (!node) return;
m_onOffCurves.DeleteObject( curve );
wxPlotOnOffCurve *wxPlotWindow::GetOnOffCurveAt( size_t n )
{
- wxNode *node = m_onOffCurves.Nth( n );
+ wxList::compatibility_iterator node = m_onOffCurves.Item( n );
if (!node)
return (wxPlotOnOffCurve*) NULL;
- return (wxPlotOnOffCurve*) node->Data();
+ return (wxPlotOnOffCurve*) node->GetData();
}
void wxPlotWindow::Move( wxPlotCurve* curve, int pixels_up )
GetViewStart( &view_x, &view_y );
wxInt32 max = 0;
- wxNode *node = m_curves.First();
+ wxList::compatibility_iterator node = m_curves.GetFirst();
while (node)
{
- wxPlotCurve *curve = (wxPlotCurve*) node->Data();
+ wxPlotCurve *curve = (wxPlotCurve*) node->GetData();
if (curve->GetEndX() > max)
max = curve->GetEndX();
- node = node->Next();
+ node = node->GetNext();
}
SetScrollbars( wxPLOT_SCROLL_STEP, wxPLOT_SCROLL_STEP,
(int)((max*m_xZoom)/wxPLOT_SCROLL_STEP)+1, 0,
void wxPlotWindow::ResetScrollbar()
{
wxInt32 max = 0;
- wxNode *node = m_curves.First();
+ wxList::compatibility_iterator node = m_curves.GetFirst();
while (node)
{
- wxPlotCurve *curve = (wxPlotCurve*) node->Data();
+ wxPlotCurve *curve = (wxPlotCurve*) node->GetData();
if (curve->GetEndX() > max)
max = curve->GetEndX();
- node = node->Next();
+ node = node->GetNext();
}
SetScrollbars( wxPLOT_SCROLL_STEP, wxPLOT_SCROLL_STEP,