X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FpPlotter%2FpPlotterScaleX.cxx;h=45d0abe3b71b5b970551bccee8611be282e3839b;hb=1aed85ffcc87973f62db4e3e535b4b7ca9cec950;hp=28ce942f508b5d6aff296d4b6207c2737081553c;hpb=8b75d0d7ee7c2aed68f1663282127c8e9932e705;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleX.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleX.cxx index 28ce942..45d0abe 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleX.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleX.cxx @@ -40,6 +40,8 @@ void pPlotterScaleX::Plot(wxDC& dc, mpWindow& w) dc.SetPen( m_pen); dc.SetFont( m_font); + + //data float min=(float)w.getMinScrX(); @@ -57,14 +59,16 @@ void pPlotterScaleX::Plot(wxDC& dc, mpWindow& w) // dc.SetAxisOrientation(true,true); //EED MacOx ??? const int orgy = 40; - dc.SetDeviceOrigin(70,orgy); - dc.SetAxisOrientation(true,false); - + //dc.SetDeviceOrigin(70,orgy); + dc.SetDeviceOrigin(70,0); + //dc.SetAxisOrientation(true,false); + double sizedc = dc.GetSize().GetY()-orgy; + //const int extend = w.GetScrX()-100; //JPRx //draw the axe - dc.DrawLine(0,0,(max-min)*scaleX,0); + dc.DrawLine(0,GetYTranslated(sizedc, 0),(max-min)*scaleX,GetYTranslated(sizedc, 0)); //maximum value in x int d=max-min; @@ -84,9 +88,9 @@ void pPlotterScaleX::Plot(wxDC& dc, mpWindow& w) //drawing the first line - dc.DrawLine(0,0,0,-10); + dc.DrawLine(0,GetYTranslated(sizedc, 0),0,GetYTranslated(sizedc, -10)); s.Printf(_T("%d"),(int)(min)); - dc.DrawText(s,(wxCoord)0,(wxCoord)-20); + dc.DrawText(s,(wxCoord)0,GetYTranslated(sizedc, (wxCoord)-20)); for(float i=0;i<=(max);i+=step) { @@ -96,14 +100,14 @@ void pPlotterScaleX::Plot(wxDC& dc, mpWindow& w) { dc.DrawLine(p,0,p,-10); s.Printf(_T("%d"),(int)(i)); - dc.DrawText(s,(wxCoord)p,(wxCoord)-20); + dc.DrawText(s,(wxCoord)p,GetYTranslated(sizedc, (wxCoord)-20)); } } //drawing the last line int p=(max-min-offsetX)*scaleX+offsetpx; - dc.DrawLine(p,0,p,-10); + dc.DrawLine(p,GetYTranslated(sizedc, 0),p,GetYTranslated(sizedc, -10)); s.Printf(_T("%d"),(int)(max)); - dc.DrawText(s,(wxCoord)p,(wxCoord)-20); + dc.DrawText(s,(wxCoord)p,GetYTranslated(sizedc, (wxCoord)-20)); }