Commit d3afe95c authored by Dick Hollenbeck's avatar Dick Hollenbeck

remove page size globals from eeschema

parent 697f9123
...@@ -22,8 +22,8 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules) ...@@ -22,8 +22,8 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
option(USE_PNG_BITMAPS "use PNG bitmaps instead of XPM (default ON)" ON) option(USE_PNG_BITMAPS "use PNG bitmaps instead of XPM (default ON)" ON)
option(USE_NEW_PCBNEW_LOAD "use new plugin support for legacy file format (default OFF)" OFF) option(USE_NEW_PCBNEW_LOAD "use new plugin support for legacy file format (default ON)" ON)
option(USE_NEW_PCBNEW_SAVE "use new plugin support for legacy file format (default OFF)" OFF) option(USE_NEW_PCBNEW_SAVE "use new plugin support for legacy file format (default ON)" ON)
# Russian GOST patch # Russian GOST patch
option(wxUSE_UNICODE "enable/disable building unicode (default OFF)") option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
...@@ -265,6 +265,11 @@ add_subdirectory(bitmap2component) ...@@ -265,6 +265,11 @@ add_subdirectory(bitmap2component)
add_subdirectory(pcb_calculator) add_subdirectory(pcb_calculator)
#add_subdirectory(new) #add_subdirectory(new)
add_executable( container_test EXCLUDE_FROM_ALL container_test.cpp )
target_link_libraries( container_test common polygon bitmaps ${wxWidgets_LIBRARIES} )
############# #############
# Resources # # Resources #
############# #############
......
...@@ -178,24 +178,24 @@ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString ) ...@@ -178,24 +178,24 @@ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString )
// Standard page sizes in 1/1000 inch // Standard page sizes in 1/1000 inch
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
static const PAGE_INFO pageA4( wxSize( 8283, 11700 ), wxPoint( 0, 0 ), wxT( "A4" ) ); static const PAGE_INFO pageA4( wxSize( 8283, 11700 ), wxT( "A4" ) );
#else #else
static const PAGE_INFO pageA4( wxSize( 11700, 8267 ), wxPoint( 0, 0 ), wxT( "A4" ) ); static const PAGE_INFO pageA4( wxSize( 11700, 8267 ), wxT( "A4" ) );
#endif #endif
static const PAGE_INFO pageA3( wxSize( 16535, 11700 ), wxPoint( 0, 0 ), wxT( "A3" ) ); static const PAGE_INFO pageA3( wxSize( 16535, 11700 ), wxT( "A3" ) );
static const PAGE_INFO pageA2( wxSize( 23400, 16535 ), wxPoint( 0, 0 ), wxT( "A2" ) ); static const PAGE_INFO pageA2( wxSize( 23400, 16535 ), wxT( "A2" ) );
static const PAGE_INFO pageA1( wxSize( 33070, 23400 ), wxPoint( 0, 0 ), wxT( "A1" ) ); static const PAGE_INFO pageA1( wxSize( 33070, 23400 ), wxT( "A1" ) );
static const PAGE_INFO pageA0( wxSize( 46800, 33070 ), wxPoint( 0, 0 ), wxT( "A0" ) ); static const PAGE_INFO pageA0( wxSize( 46800, 33070 ), wxT( "A0" ) );
static const PAGE_INFO pageA( wxSize( 11000, 8500 ), wxPoint( 0, 0 ), wxT( "A" ) ); static const PAGE_INFO pageA( wxSize( 11000, 8500 ), wxT( "A" ) );
static const PAGE_INFO pageB( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "B" ) ); static const PAGE_INFO pageB( wxSize( 17000, 11000 ), wxT( "B" ) );
static const PAGE_INFO pageC( wxSize( 22000, 17000 ), wxPoint( 0, 0 ), wxT( "C" ) ); static const PAGE_INFO pageC( wxSize( 22000, 17000 ), wxT( "C" ) );
static const PAGE_INFO pageD( wxSize( 34000, 22000 ), wxPoint( 0, 0 ), wxT( "D" ) ); static const PAGE_INFO pageD( wxSize( 34000, 22000 ), wxT( "D" ) );
static const PAGE_INFO pageE( wxSize( 44000, 34000 ), wxPoint( 0, 0 ), wxT( "E" ) ); static const PAGE_INFO pageE( wxSize( 44000, 34000 ), wxT( "E" ) );
static const PAGE_INFO pageGERBER(wxSize( 32000, 32000 ), wxPoint( 0, 0 ), wxT( "GERBER" ) ); static const PAGE_INFO pageGERBER(wxSize( 32000, 32000 ), wxT( "GERBER" ) );
double PAGE_INFO::s_user_width = 17.0; double PAGE_INFO::s_user_width = 17.0;
double PAGE_INFO::s_user_height = 11.0; double PAGE_INFO::s_user_height = 11.0;
static const PAGE_INFO pageUser( wxSize( 17000, 11000 ), wxPoint( 0, 0 ), wxT( "User" ) ); static const PAGE_INFO pageUser( wxSize( 17000, 11000 ), wxT( "User" ) );
static const PAGE_INFO* stdPageSizes[] = { static const PAGE_INFO* stdPageSizes[] = {
&pageA4, &pageA4,
...@@ -263,13 +263,12 @@ bool PAGE_INFO::SetType( const wxString& aType ) ...@@ -263,13 +263,12 @@ bool PAGE_INFO::SetType( const wxString& aType )
} }
PAGE_INFO::PAGE_INFO( const wxSize& aSizeMils, const wxPoint& aOffsetMils, const wxString& aType ) PAGE_INFO::PAGE_INFO( const wxSize& aSizeMils, const wxString& aType )
{ {
// aSizeMils is in 1/1000th of an inch // aSizeMils is in 1/1000th of an inch
SetWidthInches( aSizeMils.x / 1000.0 ); SetWidthInches( aSizeMils.x / 1000.0 );
SetHeightInches( aSizeMils.y / 1000.0 ); SetHeightInches( aSizeMils.y / 1000.0 );
m_Offset = aOffsetMils;
m_Type = aType; m_Type = aType;
// Adjust the default value for margins to 400 mils (0,4 inch or 10 mm) // Adjust the default value for margins to 400 mils (0,4 inch or 10 mm)
......
...@@ -87,7 +87,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, ...@@ -87,7 +87,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
SetIcon( icon ); SetIcon( icon );
SetBoard( new BOARD() ); SetBoard( new BOARD() );
SetScreen( new PCB_SCREEN( GetPageSettings().GetSizeIU() ) ); SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
LoadSettings(); LoadSettings();
......
...@@ -119,7 +119,7 @@ void FOOTPRINTS_LISTBOX::SetFootprintFullList( FOOTPRINT_LIST& list ) ...@@ -119,7 +119,7 @@ void FOOTPRINTS_LISTBOX::SetFootprintFullList( FOOTPRINT_LIST& list )
for( unsigned ii = 0; ii < list.GetCount(); ii++ ) for( unsigned ii = 0; ii < list.GetCount(); ii++ )
{ {
FOOTPRINT_INFO & footprint = list.GetItem(ii); FOOTPRINT_INFO & footprint = list.GetItem(ii);
msg.Printf( wxT( "%3d %s" ), m_FullFootprintList.GetCount() + 1, msg.Printf( wxT( "%3d %s" ), (int) m_FullFootprintList.GetCount() + 1,
GetChars(footprint.m_Module) ); GetChars(footprint.m_Module) );
m_FullFootprintList.Add( msg ); m_FullFootprintList.Add( msg );
} }
......
...@@ -605,7 +605,7 @@ void CVPCB_MAINFRAME::DisplayStatus() ...@@ -605,7 +605,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
{ {
wxString msg; wxString msg;
msg.Printf( _( "Components: %d (free: %d)" ), m_components.size(), m_undefinedComponentCnt ); msg.Printf( _( "Components: %d (free: %d)" ), (int) m_components.size(), m_undefinedComponentCnt );
SetStatusText( msg, 0 ); SetStatusText( msg, 0 );
SetStatusText( wxEmptyString, 1 ); SetStatusText( wxEmptyString, 1 );
...@@ -614,10 +614,10 @@ void CVPCB_MAINFRAME::DisplayStatus() ...@@ -614,10 +614,10 @@ void CVPCB_MAINFRAME::DisplayStatus()
{ {
if( m_FootprintList->m_UseFootprintFullList ) if( m_FootprintList->m_UseFootprintFullList )
msg.Printf( _( "Footprints (All): %d" ), msg.Printf( _( "Footprints (All): %d" ),
m_FootprintList->m_ActiveFootprintList->GetCount() ); (int) m_FootprintList->m_ActiveFootprintList->GetCount() );
else else
msg.Printf( _( "Footprints (filtered): %d" ), msg.Printf( _( "Footprints (filtered): %d" ),
m_FootprintList->m_ActiveFootprintList->GetCount() ); (int) m_FootprintList->m_ActiveFootprintList->GetCount() );
} }
else else
{ {
......
...@@ -199,7 +199,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame, ...@@ -199,7 +199,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
{ {
int tmpzoom; int tmpzoom;
wxPoint tmp_startvisu; wxPoint tmp_startvisu;
wxSize SheetSize; // Sheet size in internal units wxSize sheetSize; // Sheet size in internal units
wxPoint old_org; wxPoint old_org;
bool success = true; bool success = true;
...@@ -209,16 +209,15 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame, ...@@ -209,16 +209,15 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
screen->m_DrawOrg.x = screen->m_DrawOrg.y = 0; screen->m_DrawOrg.x = screen->m_DrawOrg.y = 0;
screen->m_StartVisu.x = screen->m_StartVisu.y = 0; screen->m_StartVisu.x = screen->m_StartVisu.y = 0;
SheetSize = screen->ReturnPageSize(); // page size in 1/1000 inch, ie in internal units sheetSize = screen->GetPageSettings().GetSizeIU(); // page size in 1/1000 inch, ie in internal units
screen->SetScalingFactor( 1.0 ); screen->SetScalingFactor( 1.0 );
EDA_DRAW_PANEL* panel = frame->GetCanvas(); EDA_DRAW_PANEL* panel = frame->GetCanvas();
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed LOCALE_IO toggle;
// to print floating point numbers like 1.3)
float dpi = (float) frame->GetInternalUnits(); float dpi = (float) frame->GetInternalUnits();
wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi ); wxSVGFileDC dc( FullFileName, sheetSize.x, sheetSize.y, dpi );
EDA_RECT tmp = panel->m_ClipBox; EDA_RECT tmp = panel->m_ClipBox;
GRResetPenAndBrush( &dc ); GRResetPenAndBrush( &dc );
...@@ -236,7 +235,6 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame, ...@@ -236,7 +235,6 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
if( aPrint_Sheet_Ref ) if( aPrint_Sheet_Ref )
frame->TraceWorkSheet( &dc, screen, g_DrawDefaultLineThickness ); frame->TraceWorkSheet( &dc, screen, g_DrawDefaultLineThickness );
SetLocaleTo_Default(); // revert to the current locale
screen->m_IsPrinting = false; screen->m_IsPrinting = false;
panel->m_ClipBox = tmp; panel->m_ClipBox = tmp;
......
...@@ -63,11 +63,11 @@ private: ...@@ -63,11 +63,11 @@ private:
void initDlg(); void initDlg();
void initOptVars(); void initOptVars();
void CreateDXFFile(); void CreateDXFFile();
void PlotOneSheetDXF( const wxString& FileName, void PlotOneSheetDXF( const wxString& FileName, SCH_SCREEN* screen,
SCH_SCREEN* screen, PAGE_INFO* sheet,
wxPoint plot_offset, double scale ); wxPoint plot_offset, double scale );
}; };
/* static members (static to remember last state): */
// static members (static to remember last state):
bool DIALOG_PLOT_SCHEMATIC_DXF::m_plotColorOpt = false; bool DIALOG_PLOT_SCHEMATIC_DXF::m_plotColorOpt = false;
bool DIALOG_PLOT_SCHEMATIC_DXF::m_plot_Sheet_Ref = true; bool DIALOG_PLOT_SCHEMATIC_DXF::m_plot_Sheet_Ref = true;
...@@ -147,8 +147,7 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( ) ...@@ -147,8 +147,7 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
SCH_SCREEN* screen = schframe->GetScreen(); SCH_SCREEN* screen = schframe->GetScreen();
SCH_SHEET_PATH* sheetpath; SCH_SHEET_PATH* sheetpath;
SCH_SHEET_PATH oldsheetpath = schframe->GetCurrentSheet(); SCH_SHEET_PATH oldsheetpath = schframe->GetCurrentSheet();
wxString PlotFileName; wxString plotFileName;
PAGE_INFO* PlotSheet;
wxPoint plot_offset; wxPoint plot_offset;
/* When printing all pages, the printed page is not the current page. /* When printing all pages, the printed page is not the current page.
...@@ -186,15 +185,14 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( ) ...@@ -186,15 +185,14 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
sheetpath = SheetList.GetNext(); sheetpath = SheetList.GetNext();
} }
PlotSheet = screen->m_CurrentSheetDesc;
double scale = 10; double scale = 10;
plot_offset.x = 0; plot_offset.x = 0;
plot_offset.y = 0; plot_offset.y = 0;
PlotFileName = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".dxf" ); plotFileName = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".dxf" );
PlotOneSheetDXF( PlotFileName, screen, PlotSheet, plot_offset, scale ); PlotOneSheetDXF( plotFileName, screen, plot_offset, scale );
if( !m_select_PlotAll ) if( !m_select_PlotAll )
break; break;
...@@ -208,12 +206,12 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( ) ...@@ -208,12 +206,12 @@ void DIALOG_PLOT_SCHEMATIC_DXF::CreateDXFFile( )
void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName, void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName,
SCH_SCREEN* screen, SCH_SCREEN* screen,
PAGE_INFO* sheet,
wxPoint plot_offset, wxPoint plot_offset,
double scale ) double scale )
{ {
wxString msg;
wxString msg;
FILE* output_file = wxFopen( FileName, wxT( "wt" ) ); FILE* output_file = wxFopen( FileName, wxT( "wt" ) );
if( output_file == NULL ) if( output_file == NULL )
...@@ -227,13 +225,17 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName, ...@@ -227,13 +225,17 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName,
msg.Printf( _( "Plot: %s " ), GetChars( FileName ) ); msg.Printf( _( "Plot: %s " ), GetChars( FileName ) );
m_MsgBox->AppendText( msg ); m_MsgBox->AppendText( msg );
SetLocaleTo_C_standard(); LOCALE_IO toggle;
DXF_PLOTTER* plotter = new DXF_PLOTTER(); DXF_PLOTTER* plotter = new DXF_PLOTTER();
plotter->set_paper_size( sheet );
const PAGE_INFO& pageInfo = screen->GetPageSettings();
plotter->SetPageSettings( pageInfo );
plotter->set_viewport( plot_offset, scale, 0 ); plotter->set_viewport( plot_offset, scale, 0 );
plotter->set_color_mode( m_plotColorOpt ); plotter->set_color_mode( m_plotColorOpt );
/* Init : */ // Init :
plotter->set_creator( wxT( "Eeschema-DXF" ) ); plotter->set_creator( wxT( "Eeschema-DXF" ) );
plotter->set_filename( FileName ); plotter->set_filename( FileName );
plotter->start_plot( output_file ); plotter->start_plot( output_file );
...@@ -246,10 +248,9 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName, ...@@ -246,10 +248,9 @@ void DIALOG_PLOT_SCHEMATIC_DXF::PlotOneSheetDXF( const wxString& FileName,
screen->Plot( plotter ); screen->Plot( plotter );
/* fin */ // finish
plotter->end_plot(); plotter->end_plot();
delete plotter; delete plotter;
SetLocaleTo_Default();
m_MsgBox->AppendText( wxT( "Ok\n" ) ); m_MsgBox->AppendText( wxT( "Ok\n" ) );
} }
...@@ -70,12 +70,13 @@ private: ...@@ -70,12 +70,13 @@ private:
void initOptVars(); void initOptVars();
void createPSFile(); void createPSFile();
void plotOneSheetPS( const wxString& FileName, void plotOneSheetPS( const wxString& FileName,
SCH_SCREEN* screen, PAGE_INFO* sheet, SCH_SCREEN* screen, const PAGE_INFO& pageInfo,
wxPoint plot_offset, double scale ); wxPoint plot_offset, double scale );
}; };
/* static members (static to remember last state): */
// static members (static to remember last state):
bool DIALOG_PLOT_SCHEMATIC_PS::m_plotColorOpt = false; bool DIALOG_PLOT_SCHEMATIC_PS::m_plotColorOpt = false;
int DIALOG_PLOT_SCHEMATIC_PS:: m_pageSizeSelect = PAGE_SIZE_AUTO; int DIALOG_PLOT_SCHEMATIC_PS::m_pageSizeSelect = PAGE_SIZE_AUTO;
bool DIALOG_PLOT_SCHEMATIC_PS::m_plot_Sheet_Ref = true; bool DIALOG_PLOT_SCHEMATIC_PS::m_plot_Sheet_Ref = true;
...@@ -176,8 +177,8 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile() ...@@ -176,8 +177,8 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
SCH_SHEET_PATH* sheetpath; SCH_SHEET_PATH* sheetpath;
SCH_SHEET_PATH oldsheetpath = m_Parent->GetCurrentSheet(); // sheetpath is saved here SCH_SHEET_PATH oldsheetpath = m_Parent->GetCurrentSheet(); // sheetpath is saved here
wxString plotFileName; wxString plotFileName;
PAGE_INFO* actualPage; // page size selected in schematic PAGE_INFO actualPage; // page size selected in schematic
PAGE_INFO* plotPage; // page size selected to plot PAGE_INFO plotPage; // page size selected to plot
wxPoint plot_offset; wxPoint plot_offset;
/* When printing all pages, the printed page is not the current page. /* When printing all pages, the printed page is not the current page.
...@@ -213,16 +214,16 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile() ...@@ -213,16 +214,16 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
sheetpath = SheetList.GetNext(); sheetpath = SheetList.GetNext();
} }
actualPage = screen->m_CurrentSheetDesc; actualPage = screen->GetPageSettings();
switch( m_pageSizeSelect ) switch( m_pageSizeSelect )
{ {
case PAGE_SIZE_A: case PAGE_SIZE_A:
plotPage = &g_Sheet_A; plotPage.SetType( wxT( "A" ) );
break; break;
case PAGE_SIZE_A4: case PAGE_SIZE_A4:
plotPage = &g_Sheet_A4; plotPage.SetType( wxT( "A4" ) );
break; break;
case PAGE_SIZE_AUTO: case PAGE_SIZE_AUTO:
...@@ -231,8 +232,9 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile() ...@@ -231,8 +232,9 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
break; break;
} }
double scalex = (double) plotPage->m_Size.x / actualPage->m_Size.x; double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils();
double scaley = (double) plotPage->m_Size.y / actualPage->m_Size.y; double scaley = (double) plotPage.GetHeightMils() / actualPage.GetHeightMils();
double scale = 10 * MIN( scalex, scaley ); double scale = 10 * MIN( scalex, scaley );
plot_offset.x = 0; plot_offset.x = 0;
...@@ -254,7 +256,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile() ...@@ -254,7 +256,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::createPSFile()
void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName, void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName,
SCH_SCREEN* screen, SCH_SCREEN* screen,
PAGE_INFO* sheet, const PAGE_INFO& pageInfo,
wxPoint plot_offset, wxPoint plot_offset,
double scale ) double scale )
{ {
...@@ -276,12 +278,12 @@ void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName, ...@@ -276,12 +278,12 @@ void DIALOG_PLOT_SCHEMATIC_PS::plotOneSheetPS( const wxString& FileName,
m_MsgBox->AppendText( msg ); m_MsgBox->AppendText( msg );
PS_PLOTTER* plotter = new PS_PLOTTER(); PS_PLOTTER* plotter = new PS_PLOTTER();
plotter->set_paper_size( sheet ); plotter->SetPageSettings( pageInfo );
plotter->set_viewport( plot_offset, scale, 0 ); plotter->set_viewport( plot_offset, scale, 0 );
plotter->set_default_line_width( g_DrawDefaultLineThickness ); plotter->set_default_line_width( g_DrawDefaultLineThickness );
plotter->set_color_mode( m_plotColorOpt ); plotter->set_color_mode( m_plotColorOpt );
/* Init : */ // Init :
plotter->set_creator( wxT( "Eeschema-PS" ) ); plotter->set_creator( wxT( "Eeschema-PS" ) );
plotter->set_filename( FileName ); plotter->set_filename( FileName );
plotter->start_plot( output_file ); plotter->start_plot( output_file );
......
...@@ -620,7 +620,7 @@ void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, int aDrawMode, int aC ...@@ -620,7 +620,7 @@ void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, int aDrawMode, int aC
void SCH_SCREEN::Plot( PLOTTER* aPlotter ) void SCH_SCREEN::Plot( PLOTTER* aPlotter )
{ {
for( SCH_ITEM* item = GetDrawItems(); item != NULL; item = item->Next() ) for( SCH_ITEM* item = GetDrawItems(); item; item = item->Next() )
{ {
aPlotter->set_current_line_width( item->GetPenSize() ); aPlotter->set_current_line_width( item->GetPenSize() );
item->Plot( aPlotter ); item->Plot( aPlotter );
......
...@@ -65,7 +65,7 @@ class SCH_SCREEN : public BASE_SCREEN ...@@ -65,7 +65,7 @@ class SCH_SCREEN : public BASE_SCREEN
///< Delete when it goes to zero. ///< Delete when it goes to zero.
/// The size of the paper to print or plot on /// The size of the paper to print or plot on
PAGE_INFO m_paper; // keep with the MVC model as this class gets split PAGE_INFO m_paper; // keep with the MVC 'model' as this class gets split
SCH_ITEM* m_drawList; ///< Object list for the screen. SCH_ITEM* m_drawList; ///< Object list for the screen.
/// @todo use DLIST<SCH_ITEM> or superior container /// @todo use DLIST<SCH_ITEM> or superior container
......
...@@ -44,13 +44,13 @@ class BASE_SCREEN; ...@@ -44,13 +44,13 @@ class BASE_SCREEN;
class EDA_DRAW_FRAME; class EDA_DRAW_FRAME;
class EDA_DRAW_PANEL; class EDA_DRAW_PANEL;
/* Flag for special keys */ // Flag for special keys
#define GR_KB_RIGHTSHIFT 0x10000000 /* Keybd states: right #define GR_KB_RIGHTSHIFT 0x10000000 /* Keybd states: right
* shift key depressed */ * shift key depressed */
#define GR_KB_LEFTSHIFT 0x20000000 /* left shift key depressed #define GR_KB_LEFTSHIFT 0x20000000 /* left shift key depressed
*/ */
#define GR_KB_CTRL 0x40000000 /* CTRL depressed */ #define GR_KB_CTRL 0x40000000 // CTRL depressed
#define GR_KB_ALT 0x80000000 /* ALT depressed */ #define GR_KB_ALT 0x80000000 // ALT depressed
#define GR_KB_SHIFT (GR_KB_LEFTSHIFT | GR_KB_RIGHTSHIFT) #define GR_KB_SHIFT (GR_KB_LEFTSHIFT | GR_KB_RIGHTSHIFT)
#define GR_KB_SHIFTCTRL (GR_KB_SHIFT | GR_KB_CTRL) #define GR_KB_SHIFTCTRL (GR_KB_SHIFT | GR_KB_CTRL)
#define MOUSE_MIDDLE 0x08000000 /* Middle button mouse #define MOUSE_MIDDLE 0x08000000 /* Middle button mouse
...@@ -74,7 +74,7 @@ enum pseudokeys { ...@@ -74,7 +74,7 @@ enum pseudokeys {
#define ESC 27 #define ESC 27
/* TODO Executable names TODO*/ // TODO Executable names TODO
#ifdef __WINDOWS__ #ifdef __WINDOWS__
#define CVPCB_EXE wxT( "cvpcb.exe" ) #define CVPCB_EXE wxT( "cvpcb.exe" )
#define PCBNEW_EXE wxT( "pcbnew.exe" ) #define PCBNEW_EXE wxT( "pcbnew.exe" )
...@@ -101,7 +101,7 @@ enum pseudokeys { ...@@ -101,7 +101,7 @@ enum pseudokeys {
#endif #endif
/* Graphic Texts Orientation in 0.1 degree*/ // Graphic Texts Orientation in 0.1 degree
#define TEXT_ORIENT_HORIZ 0 #define TEXT_ORIENT_HORIZ 0
#define TEXT_ORIENT_VERT 900 #define TEXT_ORIENT_VERT 900
...@@ -116,13 +116,13 @@ enum EDA_UNITS_T { ...@@ -116,13 +116,13 @@ enum EDA_UNITS_T {
}; };
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
#define GOST_LEFTMARGIN 800 /* 20mm */ #define GOST_LEFTMARGIN 800 // 20mm
#define GOST_RIGHTMARGIN 200 /* 5mm */ #define GOST_RIGHTMARGIN 200 // 5mm
#define GOST_TOPMARGIN 200 /* 5mm */ #define GOST_TOPMARGIN 200 // 5mm
#define GOST_BOTTOMMARGIN 200 /* 5mm */ #define GOST_BOTTOMMARGIN 200 // 5mm
#endif #endif
/* forward declarations: */ // forward declarations:
class LibNameList; class LibNameList;
...@@ -131,9 +131,8 @@ class PAGE_INFO; ...@@ -131,9 +131,8 @@ class PAGE_INFO;
/** /**
* Class PAGE_INFO * Class PAGE_INFO
* describes the page size and margins of a paper page on which to * describes the page size and margins of a paper page on which to
* eventually print or plot. Since paper is often described in inches, * eventually print or plot. Here paper is described in inches, but
* (and due to legacy code), inches, mils, and internal units (IU) are supported * accessors for mils, and internal units (IU) are supported.
* in the accessors. Again, we are describing paper in this class.
* *
* @author Dick Hollenbeck * @author Dick Hollenbeck
*/ */
...@@ -141,7 +140,7 @@ class PAGE_INFO ...@@ -141,7 +140,7 @@ class PAGE_INFO
{ {
public: public:
PAGE_INFO( const wxString& aType = wxT( "A3" ) ); PAGE_INFO( const wxString& aType = wxT( "A3" ) );
PAGE_INFO( const wxSize& aSizeMils, const wxPoint& aOffsetMils, const wxString& aName ); PAGE_INFO( const wxSize& aSizeMils, const wxString& aName );
const wxString& GetType() const { return m_Type; } const wxString& GetType() const { return m_Type; }
...@@ -187,7 +186,7 @@ public: ...@@ -187,7 +186,7 @@ public:
const wxSize GetSizeIU() const { return wxSize( GetWidthIU(), GetHeightIU() ); } const wxSize GetSizeIU() const { return wxSize( GetWidthIU(), GetHeightIU() ); }
#endif #endif
wxPoint GetOffsetMils() const { return m_Offset; } // wxPoint GetOffsetMils() const { return m_Offset; }
int GetLeftMarginMils() const { return m_LeftMargin; } int GetLeftMarginMils() const { return m_LeftMargin; }
int GetRightMarginMils() const { return m_RightMargin; } int GetRightMarginMils() const { return m_RightMargin; }
...@@ -218,7 +217,7 @@ private: ...@@ -218,7 +217,7 @@ private:
double m_widthInches; double m_widthInches;
double m_heightInches; double m_heightInches;
wxPoint m_Offset; ///< plot offset in 1/1000 inches // wxPoint m_Offset; ///< plot offset in 1/1000 inches
int m_LeftMargin; int m_LeftMargin;
int m_RightMargin; int m_RightMargin;
...@@ -232,10 +231,10 @@ private: ...@@ -232,10 +231,10 @@ private:
extern wxString g_ProductName; extern wxString g_ProductName;
/* Default user lib path can be left void, if the standard lib path is used */ /// Default user lib path can be left void, if the standard lib path is used
extern wxString g_UserLibDirBuffer; extern wxString g_UserLibDirBuffer;
extern bool g_ShowPageLimits; // true to display the page limits extern bool g_ShowPageLimits; ///< true to display the page limits
/** /**
* File extension definitions. Please do not changes these. If a different * File extension definitions. Please do not changes these. If a different
...@@ -263,10 +262,10 @@ extern const wxString MacrosFileWildcard; ...@@ -263,10 +262,10 @@ extern const wxString MacrosFileWildcard;
extern const wxString AllFilesWildcard; extern const wxString AllFilesWildcard;
// Name of default configuration file. (kicad.pro) /// Name of default configuration file. (kicad.pro)
extern wxString g_Prj_Default_Config_FullFilename; extern wxString g_Prj_Default_Config_FullFilename;
// Name of local configuration file. (<curr projet>.pro) /// Name of local configuration file. (<curr projet>.pro)
extern wxString g_Prj_Config_LocalFilename; extern wxString g_Prj_Config_LocalFilename;
extern EDA_UNITS_T g_UserUnit; ///< display units extern EDA_UNITS_T g_UserUnit; ///< display units
...@@ -275,7 +274,7 @@ extern EDA_UNITS_T g_UserUnit; ///< display units ...@@ -275,7 +274,7 @@ extern EDA_UNITS_T g_UserUnit; ///< display units
extern int g_GhostColor; extern int g_GhostColor;
/* COMMON.CPP */ // COMMON.CPP
/** /**
* Function SetLocaleTo_C_standard * Function SetLocaleTo_C_standard
......
...@@ -343,7 +343,7 @@ void DIALOG_PAD_PROPERTIES::initValues() ...@@ -343,7 +343,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
break; break;
} }
msg.Printf( wxT( "%d" ), m_dummyPad->m_Orient ); msg.Printf( wxT( "%g" ), m_dummyPad->GetOrientation() );
m_PadOrientCtrl->SetValue( msg ); m_PadOrientCtrl->SetValue( msg );
// Type of pad selection // Type of pad selection
...@@ -493,7 +493,7 @@ void DIALOG_PAD_PROPERTIES::PadOrientEvent( wxCommandEvent& event ) ...@@ -493,7 +493,7 @@ void DIALOG_PAD_PROPERTIES::PadOrientEvent( wxCommandEvent& event )
} }
wxString msg; wxString msg;
msg.Printf( wxT( "%d" ), m_dummyPad->m_Orient ); msg.Printf( wxT( "%g" ), m_dummyPad->GetOrientation() );
m_PadOrientCtrl->SetValue( msg ); m_PadOrientCtrl->SetValue( msg );
TransfertDataToPad( m_dummyPad ); TransfertDataToPad( m_dummyPad );
...@@ -775,10 +775,11 @@ bool DIALOG_PAD_PROPERTIES::TransfertDataToPad( D_PAD* aPad, bool aPromptOnError ...@@ -775,10 +775,11 @@ bool DIALOG_PAD_PROPERTIES::TransfertDataToPad( D_PAD* aPad, bool aPromptOnError
aPad->m_Offset.x = ReturnValueFromTextCtrl( *m_ShapeOffset_X_Ctrl, internalUnits ); aPad->m_Offset.x = ReturnValueFromTextCtrl( *m_ShapeOffset_X_Ctrl, internalUnits );
aPad->m_Offset.y = ReturnValueFromTextCtrl( *m_ShapeOffset_Y_Ctrl, internalUnits ); aPad->m_Offset.y = ReturnValueFromTextCtrl( *m_ShapeOffset_Y_Ctrl, internalUnits );
long orient_value = 0; double orient_value = 0;
msg = m_PadOrientCtrl->GetValue(); msg = m_PadOrientCtrl->GetValue();
msg.ToLong( &orient_value ); msg.ToDouble( &orient_value );
aPad->m_Orient = orient_value;
aPad->SetOrientation( orient_value );
msg = m_PadNumCtrl->GetValue().Left( 4 ); msg = m_PadNumCtrl->GetValue().Left( 4 );
aPad->SetPadName( msg ); aPad->SetPadName( msg );
......
...@@ -299,9 +299,10 @@ this file again." ) ); ...@@ -299,9 +299,10 @@ this file again." ) );
} }
} }
catch( IO_ERROR ioe ) catch( IO_ERROR ioe )
{wxMessageBox("catch"); {
wxString msg = wxString::Format( _( "Error loading board.\n%s" ), wxString msg = wxString::Format( _( "Error loading board.\n%s" ),
ioe.errorText.GetData() ); ioe.errorText.GetData() );
wxMessageBox( msg, _( "Open Board File" ), wxOK | wxICON_ERROR ); wxMessageBox( msg, _( "Open Board File" ), wxOK | wxICON_ERROR );
} }
......
...@@ -367,7 +367,7 @@ wxString PCB_BASE_FRAME::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow, ...@@ -367,7 +367,7 @@ wxString PCB_BASE_FRAME::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow,
if( footprint_names_list.GetCount() ) if( footprint_names_list.GetCount() )
{ {
msg.Printf( _( "Modules [%d items]" ), footprint_names_list.GetCount() ); msg.Printf( _( "Modules [%d items]" ), (int) footprint_names_list.GetCount() );
EDA_LIST_DIALOG dlg( aWindow, msg, footprint_names_list, OldName, EDA_LIST_DIALOG dlg( aWindow, msg, footprint_names_list, OldName,
DisplayCmpDoc, GetComponentDialogPosition() ); DisplayCmpDoc, GetComponentDialogPosition() );
......
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