Commit 001723e0 authored by jean-pierre charras's avatar jean-pierre charras

Worksheet code: cleanup and remove useless parameters.

parent 568ae2ec
...@@ -66,11 +66,16 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, ...@@ -66,11 +66,16 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
plotter->SetCurrentLineWidth( PLOTTER::DEFAULT_LINE_WIDTH ); plotter->SetCurrentLineWidth( PLOTTER::DEFAULT_LINE_WIDTH );
WS_DRAW_ITEM_LIST drawList; WS_DRAW_ITEM_LIST drawList;
drawList.BuildWorkSheetGraphicList( pageSize, LTmargin, RBmargin, // Initialize plot parameters
drawList.SetMargins( LTmargin, RBmargin);
drawList.SetPenSize(PLOTTER::DEFAULT_LINE_WIDTH );
drawList.SetMilsToIUfactor( iusPerMil );
drawList.SetPageSize( pageSize );
drawList.BuildWorkSheetGraphicList(
aPageInfo.GetType(), aFilename, aPageInfo.GetType(), aFilename,
aSheetDesc, aSheetDesc,
aTitleBlock, aNumberOfSheets, aSheetNumber, aTitleBlock, aNumberOfSheets, aSheetNumber,
PLOTTER::DEFAULT_LINE_WIDTH, iusPerMil,
plotColor, plotColor ); plotColor, plotColor );
// Draw item list // Draw item list
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <general.h> #include <general.h>
#endif #endif
#include <worksheet.h>
#include <dialog_page_settings.h> #include <dialog_page_settings.h>
...@@ -577,10 +578,6 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() ...@@ -577,10 +578,6 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
if( m_page_bitmap->IsOk() ) if( m_page_bitmap->IsOk() )
{ {
// Save current clip box and temporary expand it.
EDA_RECT save_clip_box = *m_Parent->GetCanvas()->GetClipBox();
m_Parent->GetCanvas()->SetClipBox( EDA_RECT( wxPoint( 0, 0 ),
wxSize( INT_MAX / 2, INT_MAX / 2 ) ) );
// Calculate layout preview scale. // Calculate layout preview scale.
int appScale = m_Screen->MilsToIuScalar(); int appScale = m_Screen->MilsToIuScalar();
...@@ -601,10 +598,6 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() ...@@ -601,10 +598,6 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
pageDUMMY.SetWidthMils( clamped_layout_size.x ); pageDUMMY.SetWidthMils( clamped_layout_size.x );
pageDUMMY.SetHeightMils( clamped_layout_size.y ); pageDUMMY.SetHeightMils( clamped_layout_size.y );
wxSize dummySize = pageDUMMY.GetSizeMils();
wxPoint pointLeftTop( pageDUMMY.GetLeftMarginMils(), pageDUMMY.GetTopMarginMils() );
wxPoint pointRightBottom( pageDUMMY.GetRightMarginMils(), pageDUMMY.GetBottomMarginMils() );
// Get page type // Get page type
int idx = m_paperSizeComboBox->GetSelection(); int idx = m_paperSizeComboBox->GetSelection();
...@@ -615,18 +608,16 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() ...@@ -615,18 +608,16 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
// Draw layout preview. // Draw layout preview.
wxString emptyString; wxString emptyString;
GRResetPenAndBrush( ( wxDC* ) &memDC ); GRResetPenAndBrush( &memDC );
m_Parent->TraceWorkSheet( (wxDC*) &memDC, dummySize, pointLeftTop, pointRightBottom, DrawPageLayout( &memDC, NULL, pageDUMMY,
paperType, emptyString, m_tb, m_Screen->m_NumberOfScreens, paperType, emptyString, emptyString,
m_Screen->m_ScreenNumber, 1, appScale, LIGHTGRAY, RED ); m_tb, m_Screen->m_NumberOfScreens,
m_Screen->m_ScreenNumber, 1, appScale, DARKGRAY, RED );
memDC.SelectObject( wxNullBitmap ); memDC.SelectObject( wxNullBitmap );
m_PageLayoutExampleBitmap->SetBitmap( *m_page_bitmap ); m_PageLayoutExampleBitmap->SetBitmap( *m_page_bitmap );
// Restore current clip box.
m_Parent->GetCanvas()->SetClipBox( save_clip_box );
// Refresh the dialog. // Refresh the dialog.
Layout(); Layout();
Refresh(); Refresh();
......
This diff is collapsed.
This diff is collapsed.
...@@ -55,8 +55,84 @@ ...@@ -55,8 +55,84 @@
#include "title_block_shapes.h" #include "title_block_shapes.h"
#endif #endif
void DrawPageLayout( wxDC* aDC, EDA_DRAW_PANEL * aCanvas,
const PAGE_INFO& aPageInfo,
const wxString& aPaperFormat,
const wxString &aFullSheetName,
const wxString& aFileName,
TITLE_BLOCK& aTitleBlock,
int aSheetCount, int aSheetNumber,
int aPenWidth, double aScalar,
EDA_COLOR_T aLineColor, EDA_COLOR_T aTextColor )
{
GRSetDrawMode( aDC, GR_COPY );
WS_DRAW_ITEM_LIST drawList;
wxPoint LTmargin( aPageInfo.GetLeftMarginMils(), aPageInfo.GetTopMarginMils() );
wxPoint RBmargin( aPageInfo.GetRightMarginMils(), aPageInfo.GetBottomMarginMils() );
wxSize pagesize = aPageInfo.GetSizeMils();
drawList.SetMargins( LTmargin, RBmargin );
drawList.SetPenSize( aPenWidth );
drawList.SetMilsToIUfactor( aScalar );
drawList.SetPageSize( pagesize );
drawList.BuildWorkSheetGraphicList(
aPaperFormat, aFullSheetName, aFileName,
aTitleBlock, aSheetCount, aSheetNumber,
aLineColor, aTextColor );
// Draw item list
for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item;
item = drawList.GetNext() )
{
switch( item->GetType() )
{
case WS_DRAW_ITEM_BASE::wsg_line:
{
WS_DRAW_ITEM_LINE* line = (WS_DRAW_ITEM_LINE*) item;
GRLine( aCanvas ? aCanvas->GetClipBox() : NULL, aDC,
line->GetStart(), line->GetEnd(),
line->GetPenWidth(), line->GetColor() );
}
break;
case WS_DRAW_ITEM_BASE::wsg_rect:
{
WS_DRAW_ITEM_RECT* rect = (WS_DRAW_ITEM_RECT*) item;
GRRect( aCanvas ? aCanvas->GetClipBox() : NULL, aDC,
rect->GetStart().x, rect->GetStart().y,
rect->GetEnd().x, rect->GetEnd().y,
rect->GetPenWidth(), rect->GetColor() );
}
break;
case WS_DRAW_ITEM_BASE::wsg_text:
{
WS_DRAW_ITEM_TEXT* text = (WS_DRAW_ITEM_TEXT*) item;
DrawGraphicText( aCanvas, aDC, text->GetTextPosition(),
text->GetColor(), text->GetText(),
text->GetOrientation(), text->GetSize(),
text->GetHorizJustify(), text->GetVertJustify(),
text->GetPenWidth(), text->IsItalic(), text->IsBold() );
}
break;
case WS_DRAW_ITEM_BASE::wsg_poly:
{
WS_DRAW_ITEM_POLYGON* poly = (WS_DRAW_ITEM_POLYGON*) item;
GRPoly( aCanvas ? aCanvas->GetClipBox() : NULL, aDC,
poly->m_Corners.size(), &poly->m_Corners[0],
true, poly->GetPenWidth(),
poly->GetColor(), poly->GetColor() );
}
break;
}
}
}
void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth, void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
double aScalar, const wxString &aFilename ) double aScalar, const wxString &aFilename )
{ {
if( !m_showBorderAndTitleBlock ) if( !m_showBorderAndTitleBlock )
...@@ -74,17 +150,14 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineW ...@@ -74,17 +150,14 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineW
g_DrawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY ); g_DrawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY );
} }
wxPoint margin_left_top( pageInfo.GetLeftMarginMils(), pageInfo.GetTopMarginMils() );
wxPoint margin_right_bottom( pageInfo.GetRightMarginMils(), pageInfo.GetBottomMarginMils() );
wxString paper = pageInfo.GetType(); wxString paper = pageInfo.GetType();
wxString file = aFilename;
TITLE_BLOCK t_block = GetTitleBlock(); TITLE_BLOCK t_block = GetTitleBlock();
int number_of_screens = aScreen->m_NumberOfScreens; EDA_COLOR_T color = RED;
int screen_to_draw = aScreen->m_ScreenNumber;
TraceWorkSheet( aDC, pageSize, margin_left_top, margin_right_bottom, DrawPageLayout( aDC, m_canvas, pageInfo,
paper, file, t_block, number_of_screens, screen_to_draw, paper, aFilename, GetScreenDesc(), t_block,
aLineWidth, aScalar ); aScreen->m_NumberOfScreens, aScreen->m_ScreenNumber,
aLineWidth, aScalar, color, color );
} }
...@@ -191,72 +264,3 @@ void TITLE_BLOCK::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aCont ...@@ -191,72 +264,3 @@ void TITLE_BLOCK::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aCont
aFormatter->Print( aNestLevel, ")\n\n" ); aFormatter->Print( aNestLevel, ")\n\n" );
} }
} }
void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* aDC, wxSize& aPageSize,
wxPoint& aLTmargin, wxPoint& aRBmargin,
wxString& aPaperFormat,
wxString& aFileName,
TITLE_BLOCK& aTitleBlock,
int aSheetCount, int aSheetNumber,
int aPenWidth, double aScalar,
EDA_COLOR_T aLineColor, EDA_COLOR_T aTextColor )
{
GRSetDrawMode( aDC, GR_COPY );
WS_DRAW_ITEM_LIST drawList;
drawList.BuildWorkSheetGraphicList( aPageSize, aLTmargin, aRBmargin,
aPaperFormat, aFileName,
GetScreenDesc(),
aTitleBlock, aSheetCount, aSheetNumber,
aPenWidth, aScalar, aLineColor, aTextColor );
// Draw item list
for( WS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item;
item = drawList.GetNext() )
{
switch( item->GetType() )
{
case WS_DRAW_ITEM_BASE::wsg_line:
{
WS_DRAW_ITEM_LINE* line = (WS_DRAW_ITEM_LINE*) item;
GRLine( m_canvas->GetClipBox(), aDC,
line->GetStart(), line->GetEnd(),
line->GetPenWidth(), line->GetColor() );
}
break;
case WS_DRAW_ITEM_BASE::wsg_rect:
{
WS_DRAW_ITEM_RECT* rect = (WS_DRAW_ITEM_RECT*) item;
GRRect( m_canvas->GetClipBox(), aDC,
rect->GetStart().x, rect->GetStart().y,
rect->GetEnd().x, rect->GetEnd().y,
rect->GetPenWidth(), rect->GetColor() );
}
break;
case WS_DRAW_ITEM_BASE::wsg_text:
{
WS_DRAW_ITEM_TEXT* text = (WS_DRAW_ITEM_TEXT*) item;
DrawGraphicText( m_canvas, aDC, text->GetTextPosition(),
text->GetColor(),
text->GetText(),
text->GetOrientation(), text->GetSize(),
text->GetHorizJustify(), text->GetVertJustify(),
text->GetPenWidth(), text->IsItalic(), text->IsBold() );
}
break;
case WS_DRAW_ITEM_BASE::wsg_poly:
{
WS_DRAW_ITEM_POLYGON* poly = (WS_DRAW_ITEM_POLYGON*) item;
GRPoly( m_canvas->GetClipBox(), aDC,
poly->m_Corners.size(), &poly->m_Corners[0],
true, poly->GetPenWidth(),
poly->GetColor(), poly->GetColor() );
}
break;
}
}
}
This diff is collapsed.
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2006-2011 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2006-2013 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <wxEeschemaStruct.h> #include <wxEeschemaStruct.h>
#include <general.h> #include <general.h>
#include <protos.h> //#include <protos.h>
#include <netlist.h> #include <netlist.h>
#include <libeditframe.h> #include <libeditframe.h>
#include <viewlib_frame.h> #include <viewlib_frame.h>
......
...@@ -49,6 +49,16 @@ void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select ) ...@@ -49,6 +49,16 @@ void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select )
m_choiceUnits->SetSelection( select ); m_choiceUnits->SetSelection( select );
} }
void DIALOG_EESCHEMA_OPTIONS::SetRefIdSeparator( wxChar aSep, wxChar aFirstId)
{
if( aSep == 0 )
m_textCtrlSeparatorRefId->SetValue( _("None") );
else
m_textCtrlSeparatorRefId->SetValue( aSep );
m_textCtrlPartFirstId->SetValue( aFirstId );
}
void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& grid_sizes, int grid_id ) void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& grid_sizes, int grid_id )
{ {
......
...@@ -75,6 +75,8 @@ public: ...@@ -75,6 +75,8 @@ public:
void SetAutoSaveInterval( int aInterval ) { m_spinAutoSaveInterval->SetValue( aInterval ); } void SetAutoSaveInterval( int aInterval ) { m_spinAutoSaveInterval->SetValue( aInterval ); }
int GetAutoSaveInterval() const { return m_spinAutoSaveInterval->GetValue(); } int GetAutoSaveInterval() const { return m_spinAutoSaveInterval->GetValue(); }
void SetRefIdSeparator( wxChar aSep, wxChar aFirstId);
void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); } void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); }
bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); } bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); }
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Oct 8 2012) // C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_EESCHEMA_OPTIONS_BASE_H__ #ifndef __DIALOG_EESCHEMA_OPTIONS_BASE_H__
#define __DIALOG_EESCHEMA_OPTIONS_BASE_H__ #define __DIALOG_EESCHEMA_OPTIONS_BASE_H__
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
class DIALOG_SHIM; class DIALOG_SHIM;
#include "dialog_shim.h" #include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/choice.h> #include <wx/choice.h>
#include <wx/spinctrl.h> #include <wx/spinctrl.h>
#include <wx/sizer.h> #include <wx/textctrl.h>
#include <wx/checkbox.h> #include <wx/sizer.h>
#include <wx/panel.h> #include <wx/statline.h>
#include <wx/bitmap.h> #include <wx/checkbox.h>
#include <wx/image.h> #include <wx/panel.h>
#include <wx/icon.h> #include <wx/bitmap.h>
#include <wx/textctrl.h> #include <wx/image.h>
#include <wx/notebook.h> #include <wx/icon.h>
#include <wx/button.h> #include <wx/notebook.h>
#include <wx/dialog.h> #include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_EESCHEMA_OPTIONS_BASE ///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_EESCHEMA_OPTIONS_BASE
class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM ///////////////////////////////////////////////////////////////////////////////
{ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM
DECLARE_EVENT_TABLE() {
private: DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); } // Private event handlers
void _wxFB_OnMiddleBtnPanEnbl( wxCommandEvent& event ){ OnMiddleBtnPanEnbl( event ); } void _wxFB_OnChooseUnits( wxCommandEvent& event ){ OnChooseUnits( event ); }
void _wxFB_OnMiddleBtnPanEnbl( wxCommandEvent& event ){ OnMiddleBtnPanEnbl( event ); }
protected:
enum protected:
{ enum
ID_M_SPINAUTOSAVEINTERVAL = 1000, {
xwID_ANY ID_M_SPINAUTOSAVEINTERVAL = 1000,
}; xwID_ANY
};
wxNotebook* m_notebook1;
wxPanel* m_panel1; wxNotebook* m_notebook1;
wxStaticText* m_staticText2; wxPanel* m_panel1;
wxChoice* m_choiceUnits; wxStaticText* m_staticText2;
wxStaticText* m_staticText3; wxChoice* m_choiceUnits;
wxChoice* m_choiceGridSize; wxStaticText* m_staticText3;
wxStaticText* m_staticGridUnits; wxChoice* m_choiceGridSize;
wxStaticText* m_staticText51; wxStaticText* m_staticGridUnits;
wxSpinCtrl* m_spinBusWidth; wxStaticText* m_staticText51;
wxStaticText* m_staticBusWidthUnits; wxSpinCtrl* m_spinBusWidth;
wxStaticText* m_staticText5; wxStaticText* m_staticBusWidthUnits;
wxSpinCtrl* m_spinLineWidth; wxStaticText* m_staticText5;
wxStaticText* m_staticLineWidthUnits; wxSpinCtrl* m_spinLineWidth;
wxStaticText* m_staticText7; wxStaticText* m_staticLineWidthUnits;
wxSpinCtrl* m_spinTextSize; wxStaticText* m_staticText7;
wxStaticText* m_staticTextSizeUnits; wxSpinCtrl* m_spinTextSize;
wxStaticText* m_staticText9; wxStaticText* m_staticTextSizeUnits;
wxSpinCtrl* m_spinRepeatHorizontal; wxStaticText* m_staticText9;
wxStaticText* m_staticRepeatXUnits; wxSpinCtrl* m_spinRepeatHorizontal;
wxStaticText* m_staticText12; wxStaticText* m_staticRepeatXUnits;
wxSpinCtrl* m_spinRepeatVertical; wxStaticText* m_staticText12;
wxStaticText* m_staticRepeatYUnits; wxSpinCtrl* m_spinRepeatVertical;
wxStaticText* m_staticText16; wxStaticText* m_staticRepeatYUnits;
wxSpinCtrl* m_spinRepeatLabel; wxStaticText* m_staticText16;
wxStaticText* m_staticText221; wxSpinCtrl* m_spinRepeatLabel;
wxSpinCtrl* m_spinAutoSaveInterval; wxStaticText* m_staticText221;
wxStaticText* m_staticText23; wxSpinCtrl* m_spinAutoSaveInterval;
wxCheckBox* m_checkShowGrid; wxStaticText* m_staticText23;
wxCheckBox* m_checkShowHiddenPins; wxStaticText* m_staticText26;
wxCheckBox* m_checkEnableZoomNoCenter; wxTextCtrl* m_textCtrlSeparatorRefId;
wxCheckBox* m_checkEnableMiddleButtonPan; wxStaticText* m_staticText27;
wxCheckBox* m_checkMiddleButtonPanLimited; wxTextCtrl* m_textCtrlPartFirstId;
wxCheckBox* m_checkAutoPan; wxStaticLine* m_staticline1;
wxCheckBox* m_checkHVOrientation; wxCheckBox* m_checkShowGrid;
wxCheckBox* m_checkPageLimits; wxCheckBox* m_checkShowHiddenPins;
wxPanel* m_panel2; wxCheckBox* m_checkEnableZoomNoCenter;
wxStaticText* m_staticText211; wxCheckBox* m_checkEnableMiddleButtonPan;
wxStaticText* m_staticText15; wxCheckBox* m_checkMiddleButtonPanLimited;
wxTextCtrl* m_fieldName1; wxCheckBox* m_checkAutoPan;
wxStaticText* m_staticText161; wxCheckBox* m_checkHVOrientation;
wxTextCtrl* m_fieldName2; wxCheckBox* m_checkPageLimits;
wxStaticText* m_staticText17; wxPanel* m_panel2;
wxTextCtrl* m_fieldName3; wxStaticText* m_staticText211;
wxStaticText* m_staticText18; wxStaticText* m_staticText15;
wxTextCtrl* m_fieldName4; wxTextCtrl* m_fieldName1;
wxStaticText* m_staticText19; wxStaticText* m_staticText161;
wxTextCtrl* m_fieldName5; wxTextCtrl* m_fieldName2;
wxStaticText* m_staticText20; wxStaticText* m_staticText17;
wxTextCtrl* m_fieldName6; wxTextCtrl* m_fieldName3;
wxStaticText* m_staticText21; wxStaticText* m_staticText18;
wxTextCtrl* m_fieldName7; wxTextCtrl* m_fieldName4;
wxStaticText* m_staticText22; wxStaticText* m_staticText19;
wxTextCtrl* m_fieldName8; wxTextCtrl* m_fieldName5;
wxStdDialogButtonSizer* m_sdbSizer1; wxStaticText* m_staticText20;
wxButton* m_sdbSizer1OK; wxTextCtrl* m_fieldName6;
wxButton* m_sdbSizer1Cancel; wxStaticText* m_staticText21;
wxTextCtrl* m_fieldName7;
// Virtual event handlers, overide them in your derived class wxStaticText* m_staticText22;
virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); } wxTextCtrl* m_fieldName8;
virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); } wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
public:
// Virtual event handlers, overide them in your derived class
DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); virtual void OnChooseUnits( wxCommandEvent& event ) { event.Skip(); }
~DIALOG_EESCHEMA_OPTIONS_BASE(); virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); }
};
public:
#endif //__DIALOG_EESCHEMA_OPTIONS_BASE_H__
DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Schematic Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 432,560 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EESCHEMA_OPTIONS_BASE();
};
#endif //__DIALOG_EESCHEMA_OPTIONS_BASE_H__
...@@ -402,7 +402,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen ) ...@@ -402,7 +402,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
aScreen->Draw( panel, dc, GR_DEFAULT_DRAWMODE ); aScreen->Draw( panel, dc, GR_DEFAULT_DRAWMODE );
if( printReference ) if( printReference )
parent->TraceWorkSheet( dc, aScreen, GetDefaultLineThickness(), parent->DrawWorkSheet( dc, aScreen, GetDefaultLineThickness(),
IU_PER_MILS, parent->GetScreenDesc() ); IU_PER_MILS, parent->GetScreenDesc() );
g_DrawBgColor = bg_color; g_DrawBgColor = bg_color;
......
...@@ -60,7 +60,7 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -60,7 +60,7 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
GetScreen()->Draw( m_canvas, DC, GR_DEFAULT_DRAWMODE ); GetScreen()->Draw( m_canvas, DC, GR_DEFAULT_DRAWMODE );
TraceWorkSheet( DC, GetScreen(), GetDefaultLineThickness(), IU_PER_MILS, DrawWorkSheet( DC, GetScreen(), GetDefaultLineThickness(), IU_PER_MILS,
GetScreen()->GetFileName() ); GetScreen()->GetFileName() );
#ifdef USE_WX_OVERLAY #ifdef USE_WX_OVERLAY
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <eeschema_config.h> #include <eeschema_config.h>
#include <hotkeys.h> #include <hotkeys.h>
#include <sch_sheet.h> #include <sch_sheet.h>
#include <class_libentry.h>
#include <dialog_hotkeys_editor.h> #include <dialog_hotkeys_editor.h>
...@@ -271,6 +272,9 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event ) ...@@ -271,6 +272,9 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
dlg.SetRepeatVertical( g_RepeatStep.y ); dlg.SetRepeatVertical( g_RepeatStep.y );
dlg.SetRepeatLabel( g_RepeatDeltaLabel ); dlg.SetRepeatLabel( g_RepeatDeltaLabel );
dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 ); dlg.SetAutoSaveInterval( GetAutoSaveInterval() / 60 );
dlg.SetRefIdSeparator( LIB_COMPONENT::GetSubpartIdSeparator( ),
LIB_COMPONENT::GetSubpartFirstId() );
dlg.SetShowGrid( IsGridVisible() ); dlg.SetShowGrid( IsGridVisible() );
dlg.SetShowHiddenPins( m_showAllPins ); dlg.SetShowHiddenPins( m_showAllPins );
dlg.SetEnableMiddleButtonPan( m_canvas->GetEnableMiddleButtonPan() ); dlg.SetEnableMiddleButtonPan( m_canvas->GetEnableMiddleButtonPan() );
......
...@@ -862,8 +862,8 @@ void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, LAYER_MSK aPrintMask, bool aPrintMirr ...@@ -862,8 +862,8 @@ void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, LAYER_MSK aPrintMask, bool aPrintMirr
void* aData ) void* aData )
{ {
GetScreen()->Draw( m_canvas, aDC, GR_DEFAULT_DRAWMODE ); GetScreen()->Draw( m_canvas, aDC, GR_DEFAULT_DRAWMODE );
TraceWorkSheet( aDC, GetScreen(), GetDefaultLineThickness(), IU_PER_MILS, DrawWorkSheet( aDC, GetScreen(), GetDefaultLineThickness(), IU_PER_MILS,
GetScreen()->GetFileName() ); GetScreen()->GetFileName() );
} }
......
...@@ -106,7 +106,7 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -106,7 +106,7 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( IsElementVisible( DCODES_VISIBLE ) ) if( IsElementVisible( DCODES_VISIBLE ) )
DrawItemsDCodeID( DC, GR_COPY ); DrawItemsDCodeID( DC, GR_COPY );
TraceWorkSheet( DC, screen, 0, IU_PER_MILS, wxEmptyString ); DrawWorkSheet( DC, screen, 0, IU_PER_MILS, wxEmptyString );
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
...@@ -160,7 +160,7 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode, ...@@ -160,7 +160,7 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
if( (aDrawMode == GR_COPY) || ( aDrawMode == GR_OR ) ) if( (aDrawMode == GR_COPY) || ( aDrawMode == GR_OR ) )
useBufferBitmap = true; useBufferBitmap = true;
#endif #endif
// these parameters are saved here, because they are modified // these parameters are saved here, because they are modified
// and restored later // and restored later
EDA_RECT drawBox = *aPanel->GetClipBox(); EDA_RECT drawBox = *aPanel->GetClipBox();
......
...@@ -2,11 +2,17 @@ ...@@ -2,11 +2,17 @@
/* worksheet.h */ /* worksheet.h */
/***************/ /***************/
// Values are in 1/1000 inch // For page and paper size, values are in 1/1000 inch
#ifndef WORKSHEET_H_ #ifndef WORKSHEET_H_
#define WORKSHEET_H_ #define WORKSHEET_H_
// Forwadr declarations:
class EDA_DRAW_PANEL;
class TITLE_BLOCK;
class PAGE_INFO;
struct Ki_WorkSheetData struct Ki_WorkSheetData
{ {
public: public:
...@@ -18,4 +24,37 @@ public: ...@@ -18,4 +24,37 @@ public:
const wxChar* m_Text; const wxChar* m_Text;
}; };
/**
* Function DrawPageLayout is a core function to draw the page layout with
* the frame and the basic inscriptions.
* @param aDC The device context.
* @param aCanvas The EDA_DRAW_PANEL to draw into, or NULL if the page
* layout is not drawn into the main panel.
* @param aPageInfo for margins and page siez (in mils).
* @param aPaperFormat The paper size type, for basic inscriptions.
* @param aFullSheetName The sheetpath (full sheet name), for basic inscriptions.
* @param aFileName The file name, for basic inscriptions.
* @param aTitleBlock The sheet title block, for basic inscriptions.
* @param aSheetCount The number of sheets (for basic inscriptions).
* @param aSheetNumber The sheet number (for basic inscriptions).
* @param aPenWidth the pen size The line width for drawing.
* @param aScalar the scale factor to convert from mils to internal units.
* @param aLineColor The color for drawing.
* @param aTextColor The color for inscriptions.
*
* Parameters used in aPageInfo
* - the size of the page layout.
* - the LTmargin The left top margin of the page layout.
* - the RBmargin The right bottom margin of the page layout.
*/
void DrawPageLayout( wxDC* aDC, EDA_DRAW_PANEL * aCanvas,
const PAGE_INFO& aPageInfo,
const wxString& aPaperFormat,
const wxString &aFullSheetName,
const wxString& aFileName,
TITLE_BLOCK& aTitleBlock,
int aSheetCount, int aSheetNumber,
int aPenWidth, double aScalar,
EDA_COLOR_T aLineColor, EDA_COLOR_T aTextColor );
#endif // WORKSHEET_H_ #endif // WORKSHEET_H_
...@@ -696,33 +696,17 @@ public: ...@@ -696,33 +696,17 @@ public:
*/ */
double GetZoom(); double GetZoom();
void TraceWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
double aScale, const wxString &aFilename );
/** /**
* Function TraceWorkSheet is a core function for drawing of the page layout with * Function DrawWorkSheet
* the frame and the basic inscriptions. * Draws on screen the page layout with the frame and the basic inscriptions.
* @param aDC The device context. * @param aDC The device context.
* @param aPageSize The size of the page layout. * @param aScreen screen to draw
* @param aLTmargin The left top margin of the page layout. * @param aLineWidth The pen width to use to draw the layout.
* @param aRBmargin The right bottom margin of the page layout. * @param aScale The mils to Iu conversion factor.
* @param aPaperFormat The paper size type, for basic inscriptions. * @param aFilename The filename to display in basic inscriptions.
* @param aFileName The file name, for basic inscriptions. */
* @param aTitleBlock The sheet title block, for basic inscriptions. void DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
* @param aSheetCount The number of sheets (for basic inscriptions). double aScale, const wxString &aFilename );
* @param aSheetNumber The sheet number (for basic inscriptions).
* @param aPenWidth The line width for drawing.
* @param aScalar Scalar to convert from mils to internal units.
* @param aLineColor The color for drawing.
* @param aTextColor The color for inscriptions.
*/
void TraceWorkSheet( wxDC* aDC, wxSize& aPageSize,
wxPoint& aLTmargin, wxPoint& aRBmargin,
wxString& aPaperFormat, wxString& aFileName,
TITLE_BLOCK& aTitleBlock,
int aSheetCount, int aSheetNumber,
int aPenWidth, double aScalar,
EDA_COLOR_T aLineColor = RED, EDA_COLOR_T aTextColor = RED );
/** /**
* Function GetXYSheetReferences * Function GetXYSheetReferences
......
...@@ -358,7 +358,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage() ...@@ -358,7 +358,7 @@ void BOARD_PRINTOUT_CONTROLLER::DrawPage()
} }
if( m_PrintParams.PrintBorderAndTitleBlock() ) if( m_PrintParams.PrintBorderAndTitleBlock() )
m_Parent->TraceWorkSheet( dc, screen, m_PrintParams.m_PenDefaultSize, m_Parent->DrawWorkSheet( dc, screen, m_PrintParams.m_PenDefaultSize,
IU_PER_MILS, m_Parent->GetScreenDesc() ); IU_PER_MILS, m_Parent->GetScreenDesc() );
m_Parent->PrintPage( dc, m_PrintParams.m_PrintMaskLayer, printMirror, &m_PrintParams ); m_Parent->PrintPage( dc, m_PrintParams.m_PrintMaskLayer, printMirror, &m_PrintParams );
......
...@@ -68,7 +68,7 @@ void FOOTPRINT_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -68,7 +68,7 @@ void FOOTPRINT_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
GRSetDrawMode( DC, GR_COPY ); GRSetDrawMode( DC, GR_COPY );
m_canvas->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
TraceWorkSheet( DC, screen, 0, IU_PER_MILS, wxEmptyString ); DrawWorkSheet( DC, screen, 0, IU_PER_MILS, wxEmptyString );
// Redraw the footprints // Redraw the footprints
for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() ) for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
...@@ -108,7 +108,7 @@ void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -108,7 +108,7 @@ void PCB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
m_canvas->DrawBackGround( DC ); m_canvas->DrawBackGround( DC );
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness, DrawWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness,
IU_PER_MILS, GetBoard()->GetFileName() ); IU_PER_MILS, GetBoard()->GetFileName() );
GetBoard()->Draw( m_canvas, DC, GR_OR | GR_ALLOW_HIGHCONTRAST ); GetBoard()->Draw( m_canvas, DC, GR_OR | GR_ALLOW_HIGHCONTRAST );
......
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