void GUI::NetworkMonitor::DrawLine(wxBufferedPaintDC &dc, int x1, int y1, int x2, int y2) { if ((x1 == x2 && y1 == y2) || (x1 == x2 && x1 == 0) || (y1 == y2 && y1 == 0)) return; else dc.DrawLine(x1, y1, x2, y2); }
void FenetrePrincipale::DrawLignes(wxBufferedPaintDC &hdc) { wxBrush wt=*wxTRANSPARENT_BRUSH; hdc.SetBrush(wt); wxPen pActif(*wxBLACK, 3); wxPen pInactif(*wxBLACK, 1); for (int i=0;i<10;i++) if (feuille->Coupe(i)->GetWidth()!=0 || feuille->Coupe(i)->GetHeight()!=0) { wxPoint pTmp1(feuille->Coupe(i)->GetTopLeft()); wxPoint pTmp2(feuille->Coupe(i)->GetBottomRight()); if (i==feuille->IndiceCoupeSelec()) hdc.SetPen(pActif); else hdc.SetPen(pInactif); hdc.DrawLine(RepereImageEcran(pTmp1), RepereImageEcran(pTmp2)); } }
void FenetrePrincipale::DrawRectangles(wxBufferedPaintDC &hdc) { wxBrush wt=*wxTRANSPARENT_BRUSH; hdc.SetBrush(wt); hdc.SetLogicalFunction(wxXOR); hdc.SetPen(wxPen(*wxWHITE, 3)); for (int i=0;i<10;i++) if (feuille->Rectangle(i)->GetWidth()!=0 || feuille->Rectangle(i)->GetHeight()!=0) { hdc.DrawRectangle(RepereImageEcran(*feuille->Rectangle(i))); if (i==feuille->IndiceRectangleSelec()) { int fZoomNume,fZoomDeno; CalculZoom(fZoomNume,fZoomDeno); wxPoint pTmp(feuille->Rectangle(i)->GetTopLeft()); wxPoint p1(RepereImageEcran(pTmp)); wxRect rTrace(p1.x,p1.y,feuille->Rectangle(i)->width*fZoomNume/fZoomDeno,feuille->Rectangle(i)->height*fZoomNume/fZoomDeno); hdc.DrawLine(rTrace.GetBottomLeft(),rTrace.GetTopRight()); hdc.DrawLine(rTrace.GetTopLeft(),rTrace.GetBottomRight()); } } }