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=acaa3bc3e713898cad44e2a3a40dcd4269bcc3a2;hp=1f95b6bb930621ed71dcced809d89da61c9f451f;hpb=c5feadbb145eecf6d73f793535b7e23eb18db2cb;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 1f95b6b..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(); @@ -50,14 +52,23 @@ void pPlotterScaleX::Plot(wxDC& dc, mpWindow& w) int offsetX=w.getOffsetX(); //setting origins - const int orgy = w.GetScrY()-40; - const int extend = w.GetScrX()-100; + + //EED 14Mai2009 + //const int orgy = w.GetScrY()-40; +// dc.SetDeviceOrigin(70,orgy); +// dc.SetAxisOrientation(true,true); //EED MacOx ??? + + const int orgy = 40; + //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 - dc.SetDeviceOrigin(70,orgy); - dc.SetAxisOrientation(true,true); //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; @@ -77,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) { @@ -89,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)); }