Commit 5813a12e authored by charras's avatar charras
Browse files

Print functions and display zoom level modified to use the new zoom implementation

Comments added in some functions.
parent ee3b9500
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -5,6 +5,12 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.


2009-jan-31 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++All:
    Print functions and display zoom level modified to use the new zoom implementation
    Comments adde in some functions.

2009-Jan-29 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
2009-Jan-29 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
================================================================================
++All
++All
+4 −4
Original line number Original line Diff line number Diff line
@@ -105,13 +105,13 @@ wxSize BASE_SCREEN::ReturnPageSize( void )
/******************************************************************/
/******************************************************************/
wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos )
wxPoint BASE_SCREEN::CursorRealPosition( const wxPoint& ScreenPos )
/******************************************************************/
/******************************************************************/
/** Function CursorRealPosition
 * @return the position in user units of location ScreenPos
 * @param ScreenPos = the screen (in pixel) position co convert
*/
{
{
    wxPoint curpos = ScreenPos;
    wxPoint curpos = ScreenPos;
    Unscale( curpos );
    Unscale( curpos );
//    D(printf("curpos=%d,%d GetZoom=%d, mDrawOrg=%d,%d\n", curpos.x, curpos.y, GetZoom(), m_DrawOrg.x, m_DrawOrg.y );)

//    curpos.x = Unscale( ScreenPos.x );
//    curpos.y = Unscale( ScreenPos.y );


    curpos += m_DrawOrg;
    curpos += m_DrawOrg;


+8 −4
Original line number Original line Diff line number Diff line
@@ -335,7 +335,7 @@ void WinEDA_DrawFrame::SetToolbars()




/********************************************************/
/********************************************************/
void WinEDA_DrawFrame::DisplayToolMsg( const wxString msg )
void WinEDA_DrawFrame::DisplayToolMsg( const wxString& msg )
/********************************************************/
/********************************************************/
{
{
    SetStatusText( msg, 5 );
    SetStatusText( msg, 5 );
@@ -695,10 +695,14 @@ void WinEDA_DrawFrame::Affiche_Status_Box()
    if( !screen )
    if( !screen )
        return;
        return;


    /* affichage Zoom et coordonnees absolues */
    /* Display Zoom level: zoom = zoom_coeff/ZoomScalar */
    Line.Printf( wxT( "Z %d" ), screen->GetZoom() );
    if ( (screen->GetZoom() % screen->m_ZoomScalar) == 0 )
        Line.Printf( wxT( "Z %d" ),screen->GetZoom() / screen->m_ZoomScalar );
    else
        Line.Printf( wxT( "Z %.1f" ), (float)screen->GetZoom() / screen->m_ZoomScalar );
    SetStatusText( Line, 1 );
    SetStatusText( Line, 1 );


    /* Display absolute coordinates:  */
    Line.Printf( g_UnitMetric ? wxT( "X %.3f  Y %.3f" ) : wxT( "X %.4f  Y %.4f" ),
    Line.Printf( g_UnitMetric ? wxT( "X %.3f  Y %.3f" ) : wxT( "X %.4f  Y %.4f" ),
                 To_User_Unit( g_UnitMetric, screen->m_Curseur.x,
                 To_User_Unit( g_UnitMetric, screen->m_Curseur.x,
                               m_InternalUnits ),
                               m_InternalUnits ),
@@ -706,7 +710,7 @@ void WinEDA_DrawFrame::Affiche_Status_Box()
                               m_InternalUnits ) );
                               m_InternalUnits ) );
    SetStatusText( Line, 2 );
    SetStatusText( Line, 2 );


    /* affichage des coordonnees relatives  */
    /* Display relative coordinates:  */
    dx = screen->m_Curseur.x - screen->m_O_Curseur.x;
    dx = screen->m_Curseur.x - screen->m_O_Curseur.x;
    dy = screen->m_Curseur.y - screen->m_O_Curseur.y;
    dy = screen->m_Curseur.y - screen->m_O_Curseur.y;


+4 −4
Original line number Original line Diff line number Diff line
@@ -184,7 +184,7 @@ void WinEDA_DrawPanel::PrepareGraphicContext( wxDC* DC )
    GRResetPenAndBrush( DC );
    GRResetPenAndBrush( DC );
    DC->SetBackgroundMode( wxTRANSPARENT );
    DC->SetBackgroundMode( wxTRANSPARENT );
#ifdef WX_ZOOM
#ifdef WX_ZOOM
    double scale = 1.0 / (double) GetZoom();
    double scale = GetScreen()->GetScalingFactor( );
    DC->SetUserScale( scale, scale );
    DC->SetUserScale( scale, scale );
    DoPrepareDC( *DC );
    DoPrepareDC( *DC );
#endif
#endif
@@ -306,8 +306,8 @@ void WinEDA_DrawPanel::ConvertPcbUnitsToPixelsUnits( wxPoint* aPosition )
wxPoint WinEDA_DrawPanel::CursorScreenPosition()
wxPoint WinEDA_DrawPanel::CursorScreenPosition()
/********************************************************/
/********************************************************/


/** CursorScreenPosition
/** Function CursorScreenPosition
 * @return the curseur position in pixels in the panel draw area on screen )
 * @return the curseur current position in pixels in the screen draw area
 */
 */
{
{
    wxPoint pos = GetScreen()->m_Curseur;
    wxPoint pos = GetScreen()->m_Curseur;
@@ -609,7 +609,7 @@ void WinEDA_DrawPanel::ReDraw( wxDC* DC, bool erasebg )
    }
    }


#ifdef WX_ZOOM
#ifdef WX_ZOOM
    double scale = 1.0 / (double) GetZoom();
    double scale = Screen->GetScalingFactor( );
    DC->SetUserScale( scale, scale );
    DC->SetUserScale( scale, scale );
#endif
#endif


+0 −1
Original line number Original line Diff line number Diff line
@@ -32,7 +32,6 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
/****************************************************************************************************/
/****************************************************************************************************/


/** Function DrawGraphicText
/** Function DrawGraphicText
 * Draw a graphic text (like module texts)
 * Draw a graphic text (like module texts)
 * Draw a graphic text (like module texts)
 *  @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas
 *  @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas
 *  @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas
 *  @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas
Loading