... #include ... BEGIN_EVENT_TABLE(wxkitFrame,wxFrame) ... EVT_PAINT(wxkitFrame::OnPaint) END_EVENT_TABLE() ... void wxkitFrame::draw(wxDC & dc) { dc.Clear(); // Befoglaló téglalap dc.SetPen(*wxBLACK_PEN); dc.SetBrush(*wxWHITE_BRUSH); dc.DrawRectangle(400, 40, 300, 300); // Megfigyellő helye (referenciapont) dc.SetPen(*wxRED_PEN); dc.DrawLine(395 + relX->GetValue(), 35 + relY->GetValue(), 405 + relX->GetValue(), 45 + relY->GetValue()); dc.DrawLine(405 + relX->GetValue(), 35 + relY->GetValue(), 395 + relX->GetValue(), 45 + relY->GetValue()); // Pontok dc.SetPen(*wxBLUE_PEN); int px, py; for (int i = 0; i < AbsoluteList->GetItemCount(); i++) { int x = convert(GetContent(AbsoluteList,i,0)); int y = convert(GetContent(AbsoluteList,i,1)); if (i) dc.DrawLine(400 + px, 40 + py, 400 + x, 40 + y); dc.DrawCircle(400 + x, 40 + y,5); px = x; py = y; } } void wxkitFrame::Refresh() { wxClientDC dc(Panel1); draw(dc); } void wxkitFrame::OnPaint(wxPaintEvent & event) { wxPaintDC dc(Panel1); draw(dc); event.Skip(); }