]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleX.cxx
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / pPlotterScaleX.cxx
index 28ce942f508b5d6aff296d4b6207c2737081553c..45d0abe3b71b5b970551bccee8611be282e3839b 100644 (file)
@@ -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));
 
 }