Commit 5813a12e authored by charras's avatar charras

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

Comments added in some functions.
parent ee3b9500
...@@ -5,6 +5,12 @@ Started 2007-June-11 ...@@ -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
......
...@@ -105,13 +105,13 @@ wxSize BASE_SCREEN::ReturnPageSize( void ) ...@@ -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;
......
...@@ -335,7 +335,7 @@ void WinEDA_DrawFrame::SetToolbars() ...@@ -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() ...@@ -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() ...@@ -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;
......
...@@ -184,7 +184,7 @@ void WinEDA_DrawPanel::PrepareGraphicContext( wxDC* DC ) ...@@ -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 ) ...@@ -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 ) ...@@ -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
......
...@@ -32,7 +32,6 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* aDC, ...@@ -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
......
...@@ -226,7 +226,11 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu ) ...@@ -226,7 +226,11 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
/* Populate zoom submenu. */ /* Populate zoom submenu. */
for( i = 0; i < (size_t) maxZoomIds; i++ ) for( i = 0; i < (size_t) maxZoomIds; i++ )
{ {
msg.Printf( wxT( "%u" ), GetScreen()->m_ZoomList[i] ); if ( (GetScreen()->m_ZoomList[i] % GetScreen()->m_ZoomScalar) == 0 )
msg.Printf( wxT( "%u" ), GetScreen()->m_ZoomList[i] / GetScreen()->m_ZoomScalar);
else
msg.Printf(wxT("%.1f"),(float)GetScreen()->m_ZoomList[i] / GetScreen()->m_ZoomScalar );
zoom_choice->Append( ID_POPUP_ZOOM_LEVEL_START + i, _( "Zoom: " ) + msg, zoom_choice->Append( ID_POPUP_ZOOM_LEVEL_START + i, _( "Zoom: " ) + msg,
wxEmptyString, wxITEM_CHECK ); wxEmptyString, wxITEM_CHECK );
if( zoom == GetScreen()->m_ZoomList[i] ) if( zoom == GetScreen()->m_ZoomList[i] )
......
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
WX_DEFINE_OBJARRAY( ArrayOfSheetLists ); WX_DEFINE_OBJARRAY( ArrayOfSheetLists );
/***************************/
/* class SCH_COMPONENT */
/***************************/
/*******************************************************************/ /*******************************************************************/
SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos, SCH_ITEM* aParent ) : SCH_COMPONENT::SCH_COMPONENT( const wxPoint& aPos, SCH_ITEM* aParent ) :
......
...@@ -17,22 +17,25 @@ ...@@ -17,22 +17,25 @@
#include "protos.h" #include "protos.h"
/**************************************************************/ /**************************************************************************************/
SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool IncludePin ) SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool IncludePin )
/**************************************************************/ /**************************************************************************************/
/* Routine de localisation et d'affichage des caract (si utile ) /** Function SchematicGeneralLocateAndDisplay
* de l'element pointe par la souris ou par le curseur pcb * Overlayed function
* - marqueur * Find the schematic item at cursor position
* the priority order is:
* - marker
* - noconnect * - noconnect
* - jonction * - junction
* - wire/bus/entry * - wire/bus/entry
* - label * - label
* - composant
* - pin * - pin
* retourne * - component
* un pointeur sur le composant * @return an EDA_BaseStruct pointer on the item or NULL if no item found
* Null sinon * @param IncludePin = true to search for pins, fase to ignore them
*
* For some items, caracteristics are displayed on the screen.
*/ */
{ {
SCH_ITEM* DrawStruct; SCH_ITEM* DrawStruct;
...@@ -55,7 +58,7 @@ SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Includ ...@@ -55,7 +58,7 @@ SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Includ
case DRAW_PART_TEXT_STRUCT_TYPE: case DRAW_PART_TEXT_STRUCT_TYPE:
case COMPONENT_FIELD_DRAW_TYPE: case COMPONENT_FIELD_DRAW_TYPE:
LibItem = (SCH_COMPONENT*) DrawStruct->GetParent(); LibItem = (SCH_COMPONENT*) DrawStruct->GetParent();
SendMessageToPCBNEW( DrawStruct,LibItem ); SendMessageToPCBNEW( DrawStruct, LibItem );
break; break;
case TYPE_SCH_COMPONENT: case TYPE_SCH_COMPONENT:
...@@ -81,8 +84,8 @@ SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Includ ...@@ -81,8 +84,8 @@ SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Includ
Pin->Display_Infos( this ); Pin->Display_Infos( this );
if( LibItem ) if( LibItem )
Affiche_1_Parametre( this, 1, Affiche_1_Parametre( this, 1,
LibItem->GetRef(GetSheet()), LibItem->GetRef( GetSheet() ),
LibItem->GetField(VALUE)->m_Text, LibItem->GetField( VALUE )->m_Text,
CYAN ); CYAN );
// Cross probing:2 - pin found, and send a locate pin command to pcbnew (hightlight net) // Cross probing:2 - pin found, and send a locate pin command to pcbnew (hightlight net)
...@@ -92,11 +95,14 @@ SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Includ ...@@ -92,11 +95,14 @@ SCH_ITEM * WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( bool Includ
} }
/************************************************************************************/ /********************************************************************************************/
SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoint& refpoint, bool IncludePin ) SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoint& refpoint,
/************************************************************************************/ bool IncludePin )
/********************************************************************************************/
/* Find the schematic item at position "refpoint" /** Function SchematicGeneralLocateAndDisplay
* Overlayed function
* Find the schematic item at a given position
* the priority order is: * the priority order is:
* - marker * - marker
* - noconnect * - noconnect
...@@ -105,9 +111,9 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -105,9 +111,9 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
* - label * - label
* - pin * - pin
* - component * - component
* return: * @return an EDA_BaseStruct pointer on the item or NULL if no item found
* an EDA_BaseStruct pointer on the item * @param refpoint = the wxPoint loaction where to search
* a Null pointer if no item found * @param IncludePin = true to search for pins, fase to ignore them
* *
* For some items, caracteristics are displayed on the screen. * For some items, caracteristics are displayed on the screen.
*/ */
...@@ -147,7 +153,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -147,7 +153,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
} }
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), WIREITEM | BUSITEM | RACCORDITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), WIREITEM | BUSITEM | RACCORDITEM );
if( DrawStruct ) // Search for a pin if( DrawStruct ) // We have found a wire: Search for a connected pin at the same location
{ {
Pin = LocateAnyPin( (SCH_ITEM*) m_CurrentSheet->LastDrawList(), refpoint, &LibItem ); Pin = LocateAnyPin( (SCH_ITEM*) m_CurrentSheet->LastDrawList(), refpoint, &LibItem );
if( Pin ) if( Pin )
...@@ -155,8 +161,8 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -155,8 +161,8 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
Pin->Display_Infos( this ); Pin->Display_Infos( this );
if( LibItem ) if( LibItem )
Affiche_1_Parametre( this, 1, Affiche_1_Parametre( this, 1,
LibItem->GetRef(GetSheet()), LibItem->GetRef( GetSheet() ),
LibItem->GetField(VALUE)->m_Text, LibItem->GetField( VALUE )->m_Text,
CYAN ); CYAN );
} }
else else
...@@ -181,8 +187,8 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -181,8 +187,8 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
Pin->Display_Infos( this ); Pin->Display_Infos( this );
if( LibItem ) if( LibItem )
Affiche_1_Parametre( this, 1, Affiche_1_Parametre( this, 1,
LibItem->GetRef(GetSheet()), LibItem->GetRef( GetSheet() ),
LibItem->GetField(VALUE)->m_Text, LibItem->GetField( VALUE )->m_Text,
CYAN ); CYAN );
if( IncludePin == TRUE ) if( IncludePin == TRUE )
return LibItem; return LibItem;
...@@ -191,13 +197,13 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -191,13 +197,13 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), LIBITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), LIBITEM );
if( DrawStruct ) if( DrawStruct )
{ {
DrawStruct = LocateSmallestComponent( (SCH_SCREEN*)GetScreen() ); DrawStruct = LocateSmallestComponent( (SCH_SCREEN*) GetScreen() );
LibItem = (SCH_COMPONENT*) DrawStruct; LibItem = (SCH_COMPONENT*) DrawStruct;
LibItem->Display_Infos( this ); LibItem->Display_Infos( this );
return DrawStruct; return DrawStruct;
} }
DrawStruct = (SCH_ITEM*)PickStruct( refpoint, GetScreen(), SHEETITEM ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), SHEETITEM );
if( DrawStruct ) if( DrawStruct )
{ {
( (DrawSheetStruct*) DrawStruct )->Display_Infos( this ); ( (DrawSheetStruct*) DrawStruct )->Display_Infos( this );
...@@ -205,7 +211,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin ...@@ -205,7 +211,7 @@ SCH_ITEM* WinEDA_SchematicFrame:: SchematicGeneralLocateAndDisplay( const wxPoin
} }
// Recherche des autres elements // Recherche des autres elements
DrawStruct = (SCH_ITEM*)PickStruct( refpoint, GetScreen(), SEARCHALL ); DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), SEARCHALL );
if( DrawStruct ) if( DrawStruct )
{ {
return DrawStruct; return DrawStruct;
...@@ -305,7 +311,7 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi ...@@ -305,7 +311,7 @@ void WinEDA_SchematicFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPi
OnHotKey( DC, hotkey, NULL ); OnHotKey( DC, hotkey, NULL );
} }
Affiche_Status_Box(); /* Affichage des coord curseur */ Affiche_Status_Box(); /* Display cursor coordintes info */
SetToolbars(); SetToolbars();
} }
...@@ -403,6 +409,7 @@ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixe ...@@ -403,6 +409,7 @@ void WinEDA_LibeditFrame::GeneralControle( wxDC* DC, wxPoint MousePositionInPixe
SetToolbars(); SetToolbars();
} }
/*****************************************************************************/ /*****************************************************************************/
void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC, void WinEDA_ViewlibFrame::GeneralControle( wxDC* DC,
wxPoint MousePositionInPixels ) wxPoint MousePositionInPixels )
......
...@@ -219,7 +219,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre ...@@ -219,7 +219,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre
SheetSize.x *= m_Parent->m_InternalUnits / 1000; SheetSize.x *= m_Parent->m_InternalUnits / 1000;
SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels
screen->SetZoom( 1 ); screen->SetScalingFactor( 1.0 );
dpi = (float) SheetSize.x * 25.4 / m_ImageXSize_mm; dpi = (float) SheetSize.x * 25.4 / m_ImageXSize_mm;
WinEDA_DrawPanel* panel = m_Parent->DrawPanel; WinEDA_DrawPanel* panel = m_Parent->DrawPanel;
......
...@@ -404,7 +404,7 @@ void EDA_Printout::DrawPage() ...@@ -404,7 +404,7 @@ void EDA_Printout::DrawPage()
double scaleX, scaleY, scale; double scaleX, scaleY, scale;
wxPoint old_org; wxPoint old_org;
wxPoint DrawOffset; // Offset de trace wxPoint DrawOffset; // Offset de trace
int DrawZoom = 1; double DrawZoom = 1;
wxDC* dc = GetDC(); wxDC* dc = GetDC();
wxBusyCursor dummy; wxBusyCursor dummy;
...@@ -416,7 +416,7 @@ void EDA_Printout::DrawPage() ...@@ -416,7 +416,7 @@ void EDA_Printout::DrawPage()
tmpzoom = ActiveScreen->GetZoom(); tmpzoom = ActiveScreen->GetZoom();
old_org = ActiveScreen->m_DrawOrg; old_org = ActiveScreen->m_DrawOrg;
/* Change draw scale and offset to draw the whole page */ /* Change draw scale and offset to draw the whole page */
ActiveScreen->SetZoom( DrawZoom ); ActiveScreen->SetScalingFactor( DrawZoom );
ActiveScreen->m_DrawOrg.x = ActiveScreen->m_DrawOrg.y = 0; ActiveScreen->m_DrawOrg.x = ActiveScreen->m_DrawOrg.y = 0;
ActiveScreen->m_StartVisu.x = ActiveScreen->m_StartVisu.y = 0; ActiveScreen->m_StartVisu.x = ActiveScreen->m_StartVisu.y = 0;
......
...@@ -115,7 +115,16 @@ public: ...@@ -115,7 +115,16 @@ public:
bool OnRightClick( wxMouseEvent& event ); bool OnRightClick( wxMouseEvent& event );
void OnPopupGridSelect( wxCommandEvent& event ); void OnPopupGridSelect( wxCommandEvent& event );
void Process_Special_Functions( wxCommandEvent& event ); void Process_Special_Functions( wxCommandEvent& event );
/** Function CursorRealPosition
* @return the position in user units of location ScreenPos
* @param ScreenPos = the screen (in pixel) position co convert
*/
wxPoint CursorRealPosition( const wxPoint& ScreenPos ); wxPoint CursorRealPosition( const wxPoint& ScreenPos );
/** Function CursorScreenPosition
* @return the curseur current position in pixels in the screen draw area
*/
wxPoint CursorScreenPosition(); wxPoint CursorScreenPosition();
/** /**
...@@ -303,6 +312,10 @@ public: ...@@ -303,6 +312,10 @@ public:
wxSize ReturnPageSize( void ); wxSize ReturnPageSize( void );
virtual int GetInternalUnits( void ); virtual int GetInternalUnits( void );
/** Function CursorRealPosition
* @return the position in user units of location ScreenPos
* @param ScreenPos = the screen (in pixel) position co convert
*/
wxPoint CursorRealPosition( const wxPoint& ScreenPos ); wxPoint CursorRealPosition( const wxPoint& ScreenPos );
/* general Undo/Redo command control */ /* general Undo/Redo command control */
...@@ -326,9 +339,27 @@ public: ...@@ -326,9 +339,27 @@ public:
//----<zoom stuff>---------------------------------------------------------- //----<zoom stuff>----------------------------------------------------------
/** /** Function GetScalingFactor
* Function GetZoom * @return the the current scale used to draw items on screen
* returns the current zoom factor * draw coordinates are user coordinates * GetScalingFactor( )
*/
double GetScalingFactor( )
{
return (double) m_ZoomScalar / GetZoom();
}
/** Function SetScalingFactor
* @param the the current scale used to draw items on screen
* draw coordinates are user coordinates * GetScalingFactor( )
*/
void SetScalingFactor(double aScale )
{
SetZoom( (int) round(aScale * m_ZoomScalar) );
}
/** Function GetZoom
* @return the current zoom factor
* Note: the zoom factor is NOT the scaling factor
* the scaling factor is m_ZoomScalar * GetZoom()
*/ */
int GetZoom() const; int GetZoom() const;
......
...@@ -286,7 +286,7 @@ public: ...@@ -286,7 +286,7 @@ public:
*/ */
wxString GetXYSheetReferences( BASE_SCREEN* aScreen, const wxPoint& aPosition ); wxString GetXYSheetReferences( BASE_SCREEN* aScreen, const wxPoint& aPosition );
void DisplayToolMsg( const wxString msg ); void DisplayToolMsg( const wxString& msg );
void Process_Zoom( wxCommandEvent& event ); void Process_Zoom( wxCommandEvent& event );
void Process_Grid( wxCommandEvent& event ); void Process_Grid( wxCommandEvent& event );
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0; virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;
......
...@@ -363,6 +363,9 @@ void WinEDA_BasePcbFrame::SetToolID( int id, int new_cursor_id, ...@@ -363,6 +363,9 @@ void WinEDA_BasePcbFrame::SetToolID( int id, int new_cursor_id,
} }
void WinEDA_BasePcbFrame::Affiche_Status_Box() void WinEDA_BasePcbFrame::Affiche_Status_Box()
/*
* Update the status bar information.
*/
{ {
wxString Line; wxString Line;
int dx, dy; int dx, dy;
......
...@@ -238,7 +238,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre ...@@ -238,7 +238,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre
SheetSize.x *= m_Parent->m_InternalUnits / 1000; SheetSize.x *= m_Parent->m_InternalUnits / 1000;
SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels
screen->SetZoom( 1 ); screen->SetScalingFactor( 1.0 );
dpi = (float) SheetSize.x * 25.4 / m_ImageXSize_mm; dpi = (float) SheetSize.x * 25.4 / m_ImageXSize_mm;
WinEDA_DrawPanel* panel = m_Parent->DrawPanel; WinEDA_DrawPanel* panel = m_Parent->DrawPanel;
......
...@@ -564,7 +564,7 @@ void EDA_Printout::DrawPage() ...@@ -564,7 +564,7 @@ void EDA_Printout::DrawPage()
wxPoint old_org; wxPoint old_org;
wxPoint DrawOffset; // Offset de trace wxPoint DrawOffset; // Offset de trace
double userscale; double userscale;
int DrawZoom = 1; double DrawZoom = 1;
wxDC* dc = GetDC(); wxDC* dc = GetDC();
s_PrintMirror = m_PrintFrame->IsMirrored(); s_PrintMirror = m_PrintFrame->IsMirrored();
...@@ -578,7 +578,7 @@ void EDA_Printout::DrawPage() ...@@ -578,7 +578,7 @@ void EDA_Printout::DrawPage()
tmpzoom = ActiveScreen->GetZoom(); tmpzoom = ActiveScreen->GetZoom();
old_org = ActiveScreen->m_DrawOrg; old_org = ActiveScreen->m_DrawOrg;
/* Change draw scale and offset to draw the whole page */ /* Change draw scale and offset to draw the whole page */
ActiveScreen->SetZoom( DrawZoom ); ActiveScreen->SetScalingFactor( DrawZoom );
ActiveScreen->m_DrawOrg.x = ActiveScreen->m_DrawOrg.y = 0; ActiveScreen->m_DrawOrg.x = ActiveScreen->m_DrawOrg.y = 0;
ActiveScreen->m_StartVisu.x = ActiveScreen->m_StartVisu.y = 0; ActiveScreen->m_StartVisu.x = ActiveScreen->m_StartVisu.y = 0;
......
...@@ -592,7 +592,14 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() ...@@ -592,7 +592,14 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
for( int i = 0; i < (int)GetScreen()->m_ZoomList.GetCount(); i++ ) for( int i = 0; i < (int)GetScreen()->m_ZoomList.GetCount(); i++ )
{ {
msg = _( "Zoom " ); msg = _( "Zoom " );
msg << GetScreen()->m_ZoomList[i]; if ( (GetScreen()->m_ZoomList[i] % GetScreen()->m_ZoomScalar) == 0 )
msg << GetScreen()->m_ZoomList[i] / GetScreen()->m_ZoomScalar;
else
{
wxString value;
value.Printf(wxT("%.1f"),(float)GetScreen()->m_ZoomList[i] / GetScreen()->m_ZoomScalar );
msg += value;
}
m_SelZoomBox->Append( msg ); m_SelZoomBox->Append( msg );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment