Eeschema: converted HPGL plot dialog from Dialogblocks to wxFormBuilder

This commit is contained in:
jean-pierre charras 2010-10-26 10:22:38 +02:00
parent 387bbe2b22
commit 4f0273b09a
13 changed files with 1874 additions and 2661 deletions

View File

@ -37,6 +37,8 @@ set(EESCHEMA_SRCS
database.cpp
delete.cpp
delsheet.cpp
dialogs/dialog_plot_schematic_HPGL.cpp
dialogs/dialog_plot_schematic_HPGL_base.cpp
dialogs/dialog_plot_schematic_PS.cpp
dialogs/dialog_plot_schematic_PS_base.cpp
dialog_annotate_base.cpp
@ -118,7 +120,6 @@ set(EESCHEMA_SRCS
operations_on_items_lists.cpp
pinedit.cpp
plot.cpp
plothpgl.cpp
plotdxf.cpp
read_from_file_schematic_items_descriptions.cpp
save_schemas.cpp

View File

@ -0,0 +1,404 @@
/** @file dialog_plot_schematic_HPGL.cpp
*/
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2010 Jean-Pieere Charras <jean-pierre.charras@gipsa-lab.inpg.fr
* Copyright (C) 1992-2010 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "confirm.h"
#include "plot_common.h"
#include "worksheet.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "dialog_plot_schematic_HPGL_base.h"
enum PageFormatReq
{
PAGE_DEFAULT = 0,
PAGE_SIZE_A4,
PAGE_SIZE_A3,
PAGE_SIZE_A2,
PAGE_SIZE_A1,
PAGE_SIZE_A0,
PAGE_SIZE_A,
PAGE_SIZE_B,
PAGE_SIZE_C,
PAGE_SIZE_D,
PAGE_SIZE_E
};
static Ki_PageDescr* Plot_sheet_list[] =
{
NULL,
&g_Sheet_A4,
&g_Sheet_A3,
&g_Sheet_A2,
&g_Sheet_A1,
&g_Sheet_A0,
&g_Sheet_A,
&g_Sheet_B,
&g_Sheet_C,
&g_Sheet_D,
&g_Sheet_E,
&g_Sheet_GERBER,
&g_Sheet_user
};
class DIALOG_PLOT_SCHEMATIC_HPGL : public DIALOG_PLOT_SCHEMATIC_HPGL_BASE
{
private:
WinEDA_SchematicFrame* m_Parent;
public:
DIALOG_PLOT_SCHEMATIC_HPGL( WinEDA_SchematicFrame* parent );
private:
static PageFormatReq m_pageSizeSelect;
static bool m_plot_Sheet_Ref;
bool m_select_PlotAll;
private:
void OnPageSelected( wxCommandEvent& event );
void OnPlotCurrent( wxCommandEvent& event );
void OnPlotAll( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void AcceptPlotOffset( wxCommandEvent& event );
void initDlg();
void SetPenSpeed();
void SetPenNum();
void SetPenWidth();
void SetPageOffsetValue();
void HPGL_Plot( bool aPlotAll );
void Plot_Schematic_HPGL( bool aPlotAll, int HPGL_SheetSize );
void Plot_1_Page_HPGL( const wxString& FileName,
SCH_SCREEN* screen, Ki_PageDescr* sheet,
wxPoint& offset, double plot_scale );
void ReturnSheetDims( BASE_SCREEN* screen, wxSize& SheetSize,
wxPoint& SheetOffset );
};
/* static members (static to remember last state): */
PageFormatReq DIALOG_PLOT_SCHEMATIC_HPGL:: m_pageSizeSelect = PAGE_DEFAULT;
bool DIALOG_PLOT_SCHEMATIC_HPGL::m_plot_Sheet_Ref = true;
void WinEDA_SchematicFrame::ToPlot_HPGL( wxCommandEvent& event )
{
DIALOG_PLOT_SCHEMATIC_HPGL dlg( this );
dlg.ShowModal();
}
DIALOG_PLOT_SCHEMATIC_HPGL::DIALOG_PLOT_SCHEMATIC_HPGL( WinEDA_SchematicFrame* parent )
:DIALOG_PLOT_SCHEMATIC_HPGL_BASE(parent)
{
m_Parent = parent;
initDlg();
SetPageOffsetValue();
GetSizer()->SetSizeHints( this );
Centre();
}
void DIALOG_PLOT_SCHEMATIC_HPGL::initDlg()
{
SetFocus(); // Make ESC key working
// Set validators
m_SizeOption->SetSelection( m_pageSizeSelect );
AddUnitSymbol( *m_penWidthTitle, g_UserUnit );
PutValueInLocalUnits( *m_penWidthCtrl, g_HPGL_Pen_Descr. m_Pen_Diam, EESCHEMA_INTERNAL_UNIT );
m_penSpeedCtrl->SetValue( g_HPGL_Pen_Descr. m_Pen_Speed );
m_penNumCtrl->SetValue( g_HPGL_Pen_Descr. m_Pen_Num );
}
void DIALOG_PLOT_SCHEMATIC_HPGL::OnPlotCurrent( wxCommandEvent& event )
{
HPGL_Plot( false );
}
void DIALOG_PLOT_SCHEMATIC_HPGL::OnPlotAll( wxCommandEvent& event )
{
HPGL_Plot( true );
}
void DIALOG_PLOT_SCHEMATIC_HPGL::OnCancelClick( wxCommandEvent& event )
{
EndModal( 0 );
}
void DIALOG_PLOT_SCHEMATIC_HPGL::SetPageOffsetValue()
{
wxString msg;
m_pageSizeSelect = (PageFormatReq) m_SizeOption->GetSelection();
if( m_pageSizeSelect != PAGE_DEFAULT )
{
msg = ReturnStringFromValue( g_UserUnit,
Plot_sheet_list[m_pageSizeSelect]->m_Offset.x,
EESCHEMA_INTERNAL_UNIT );
m_PlotOrgPosition_X->SetValue( msg );
msg = ReturnStringFromValue( g_UserUnit,
Plot_sheet_list[m_pageSizeSelect]-> m_Offset.y,
EESCHEMA_INTERNAL_UNIT );
m_PlotOrgPosition_Y->SetValue( msg );
m_PlotOrgPosition_X->Enable( TRUE );
m_PlotOrgPosition_Y->Enable( TRUE );
}
else
{
m_PlotOrgPosition_X->Enable( FALSE );
m_PlotOrgPosition_Y->Enable( FALSE );
}
}
void DIALOG_PLOT_SCHEMATIC_HPGL::AcceptPlotOffset( wxCommandEvent& event )
{
m_pageSizeSelect = (PageFormatReq) m_SizeOption->GetSelection();
if( m_pageSizeSelect != PAGE_DEFAULT )
{
wxString msg = m_PlotOrgPosition_X->GetValue();
Plot_sheet_list[m_pageSizeSelect]->m_Offset.x =
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
msg = m_PlotOrgPosition_Y->GetValue();
Plot_sheet_list[m_pageSizeSelect]->m_Offset.y =
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
}
}
void DIALOG_PLOT_SCHEMATIC_HPGL::SetPenWidth( )
{
g_HPGL_Pen_Descr.m_Pen_Diam = ReturnValueFromTextCtrl( *m_penWidthCtrl,
EESCHEMA_INTERNAL_UNIT);
if( g_HPGL_Pen_Descr.m_Pen_Diam > 100 )
g_HPGL_Pen_Descr.m_Pen_Diam = 100;
if( g_HPGL_Pen_Descr.m_Pen_Diam < 1 )
g_HPGL_Pen_Descr.m_Pen_Diam = 1;
}
void DIALOG_PLOT_SCHEMATIC_HPGL::SetPenSpeed( )
{
g_HPGL_Pen_Descr.m_Pen_Speed = m_penSpeedCtrl->GetValue();
if( g_HPGL_Pen_Descr.m_Pen_Speed > 40 )
g_HPGL_Pen_Descr.m_Pen_Speed = 40;
if( g_HPGL_Pen_Descr.m_Pen_Speed < 1 )
g_HPGL_Pen_Descr.m_Pen_Speed = 1;
}
void DIALOG_PLOT_SCHEMATIC_HPGL::SetPenNum( )
{
g_HPGL_Pen_Descr.m_Pen_Num = m_penNumCtrl->GetValue();
if( g_HPGL_Pen_Descr.m_Pen_Num > 8 )
g_HPGL_Pen_Descr.m_Pen_Num = 8;
if( g_HPGL_Pen_Descr.m_Pen_Num < 1 )
g_HPGL_Pen_Descr.m_Pen_Num = 1;
}
void DIALOG_PLOT_SCHEMATIC_HPGL::HPGL_Plot( bool aPlotAll )
{
SetPenWidth( );
SetPenNum( );
SetPenSpeed( );
if( m_pageSizeSelect != PAGE_DEFAULT )
{
Ki_PageDescr* plot_sheet = Plot_sheet_list[m_pageSizeSelect];
wxString msg = m_PlotOrgPosition_X->GetValue();
plot_sheet->m_Offset.x =
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
msg = m_PlotOrgPosition_Y->GetValue();
plot_sheet->m_Offset.y =
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
}
Plot_Schematic_HPGL( aPlotAll, m_pageSizeSelect );
}
/* Function calculates the offsets and dimensions of any trace of the
* selected sheet
*/
void DIALOG_PLOT_SCHEMATIC_HPGL::ReturnSheetDims( BASE_SCREEN* screen,
wxSize& SheetSize,
wxPoint& SheetOffset )
{
Ki_PageDescr* PlotSheet;
if( screen == NULL )
screen = m_Parent->GetBaseScreen();
PlotSheet = screen->m_CurrentSheetDesc;
SheetSize = PlotSheet->m_Size;
SheetOffset = PlotSheet->m_Offset;
}
void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_Schematic_HPGL( bool aPlotAll, int HPGL_SheetSize )
{
wxString PlotFileName;
SCH_SCREEN* screen = m_Parent->GetScreen();
SCH_SCREEN* oldscreen = screen;
SCH_SHEET_PATH* sheetpath, * oldsheetpath = m_Parent->GetSheet();
Ki_PageDescr* PlotSheet;
wxSize SheetSize;
wxPoint SheetOffset, PlotOffset;
/* When printing all pages, the printed page is not the current page.
* In complex hierarchies, we must setup references and others parameters
* in the printed SCH_SCREEN
* because in complex hierarchies a SCH_SCREEN (a schematic drawings)
* is shared between many sheets
*/
SCH_SHEET_LIST SheetList( NULL );
sheetpath = SheetList.GetFirst();
SCH_SHEET_PATH list;
while( true )
{
if( aPlotAll )
{
if( sheetpath == NULL )
break;
list.Clear();
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
{
m_Parent->m_CurrentSheet = &list;
m_Parent->m_CurrentSheet->UpdateAllScreenReferences();
m_Parent->SetSheetNumberAndCount();
screen = m_Parent->m_CurrentSheet->LastScreen();
ActiveScreen = screen;
}
else // Should not happen
return;
sheetpath = SheetList.GetNext();
}
ReturnSheetDims( screen, SheetSize, SheetOffset );
/* Calculation of conversion scales. */
if( HPGL_SheetSize )
PlotSheet = Plot_sheet_list[HPGL_SheetSize];
else
PlotSheet = screen->m_CurrentSheetDesc;
/* 10x because eeschema works in mils, not decimals */
double plot_scale = 10 * (double) PlotSheet->m_Size.x /
(double) SheetSize.x;
/* Calculate offsets */
PlotOffset.x = -SheetOffset.x;
PlotOffset.y = -SheetOffset.y;
PlotFileName = m_Parent->GetUniqueFilenameForCurrentSheet() +
wxT( ".plt" );
SetLocaleTo_C_standard();
Plot_1_Page_HPGL( PlotFileName, screen, PlotSheet, PlotOffset,
plot_scale );
SetLocaleTo_Default();
if( !aPlotAll )
break;
}
ActiveScreen = oldscreen;
m_Parent->m_CurrentSheet = oldsheetpath;
m_Parent->m_CurrentSheet->UpdateAllScreenReferences();
m_Parent->SetSheetNumberAndCount();
}
void DIALOG_PLOT_SCHEMATIC_HPGL::Plot_1_Page_HPGL( const wxString& FileName,
SCH_SCREEN* screen,
Ki_PageDescr* sheet,
wxPoint& offset,
double plot_scale )
{
wxString msg;
FILE* output_file = wxFopen( FileName, wxT( "wt" ) );
if( output_file == NULL )
{
msg = wxT( "\n** " );
msg += _( "Unable to create " ) + FileName + wxT( " **\n" );
m_MsgBox->AppendText( msg );
wxBell();
return;
}
SetLocaleTo_C_standard();
msg.Printf( _( "Plot: %s " ), FileName.GetData() );
m_MsgBox->AppendText( msg );
HPGL_PLOTTER* plotter = new HPGL_PLOTTER();
plotter->set_paper_size( sheet );
plotter->set_viewport( offset, plot_scale, 0 );
plotter->set_default_line_width( g_DrawDefaultLineThickness );
/* Init : */
plotter->set_creator( wxT( "EESchema-HPGL" ) );
plotter->set_filename( FileName );
plotter->set_pen_speed( g_HPGL_Pen_Descr.m_Pen_Speed );
plotter->set_pen_number( g_HPGL_Pen_Descr.m_Pen_Num );
plotter->set_pen_diameter( g_HPGL_Pen_Descr.m_Pen_Diam );
plotter->set_pen_overlap( g_HPGL_Pen_Descr.m_Pen_Diam / 2 );
plotter->start_plot( output_file );
plotter->set_color( BLACK );
if( m_plot_Sheet_Ref )
m_Parent->PlotWorkSheet( plotter, screen );
PlotDrawlist( plotter, screen->EEDrawList );
plotter->end_plot();
delete plotter;
SetLocaleTo_Default();
m_MsgBox->AppendText( wxT( "Ok\n" ) );
}
/* Event handler for page size option
*/
void DIALOG_PLOT_SCHEMATIC_HPGL::OnPageSelected( wxCommandEvent& event )
{
m_pageSizeSelect = (PageFormatReq) m_SizeOption->GetSelection();
SetPageOffsetValue();
}

View File

@ -0,0 +1,143 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_plot_schematic_HPGL_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_PLOT_SCHEMATIC_HPGL_BASE::DIALOG_PLOT_SCHEMATIC_HPGL_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bmainSizer;
bmainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bupperSizer;
bupperSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bleftSizer;
bleftSizer = new wxBoxSizer( wxVERTICAL );
wxString m_SizeOptionChoices[] = { _("Schematic size"), _("Page size A4"), _("Page size A3"), _("Page size A2"), _("Page size A1"), _("Page size A0"), _("Page size A"), _("Page size B"), _("Page size C"), _("Page size D"), _("Page size E") };
int m_SizeOptionNChoices = sizeof( m_SizeOptionChoices ) / sizeof( wxString );
m_SizeOption = new wxRadioBox( this, wxID_ANY, _("Plot Page Size:"), wxDefaultPosition, wxDefaultSize, m_SizeOptionNChoices, m_SizeOptionChoices, 1, wxRA_SPECIFY_COLS );
m_SizeOption->SetSelection( 1 );
bleftSizer->Add( m_SizeOption, 0, wxALL|wxEXPAND, 5 );
m_Plot_Sheet_Ref_Ctrl = new wxCheckBox( this, wxID_ANY, _("Print page references"), wxDefaultPosition, wxDefaultSize, 0 );
m_Plot_Sheet_Ref_Ctrl->SetValue(true);
bleftSizer->Add( m_Plot_Sheet_Ref_Ctrl, 0, wxALL|wxEXPAND, 5 );
bupperSizer->Add( bleftSizer, 1, wxEXPAND, 5 );
wxBoxSizer* sbSizerMiddle;
sbSizerMiddle = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pen control:") ), wxVERTICAL );
m_penWidthTitle = new wxStaticText( this, wxID_ANY, _("Pen Width"), wxDefaultPosition, wxDefaultSize, 0 );
m_penWidthTitle->Wrap( -1 );
sbSizer1->Add( m_penWidthTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_penWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_penWidthCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_penSpeedTitle = new wxStaticText( this, wxID_ANY, _("Pen Speed ( cm/s )"), wxDefaultPosition, wxDefaultSize, 0 );
m_penSpeedTitle->Wrap( -1 );
sbSizer1->Add( m_penSpeedTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_penSpeedCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 50, 20 );
sbSizer1->Add( m_penSpeedCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_penNumTitle = new wxStaticText( this, wxID_ANY, _("Pen Number"), wxDefaultPosition, wxDefaultSize, 0 );
m_penNumTitle->Wrap( -1 );
sbSizer1->Add( m_penNumTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_penNumCtrl = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 8, 1 );
sbSizer1->Add( m_penNumCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizerMiddle->Add( sbSizer1, 0, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Page offset:") ), wxVERTICAL );
m_offsetXTitle = new wxStaticText( this, wxID_ANY, _("Plot Offset X"), wxDefaultPosition, wxDefaultSize, 0 );
m_offsetXTitle->Wrap( -1 );
sbSizer2->Add( m_offsetXTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_PlotOrgPosition_X = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizer2->Add( m_PlotOrgPosition_X, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_offsetYTitle = new wxStaticText( this, wxID_ANY, _("Plot Offset Y"), wxDefaultPosition, wxDefaultSize, 0 );
m_offsetYTitle->Wrap( -1 );
sbSizer2->Add( m_offsetYTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_PlotOrgPosition_Y = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizer2->Add( m_PlotOrgPosition_Y, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizerMiddle->Add( sbSizer2, 1, wxEXPAND|wxALL, 5 );
bupperSizer->Add( sbSizerMiddle, 1, wxEXPAND, 5 );
bupperSizer->Add( 10, 10, 0, 0, 5 );
wxBoxSizer* bbuttonsSizer;
bbuttonsSizer = new wxBoxSizer( wxVERTICAL );
m_buttonPlotPage = new wxButton( this, wxID_ANY, _("&Plot Page"), wxDefaultPosition, wxDefaultSize, 0 );
bbuttonsSizer->Add( m_buttonPlotPage, 0, wxALL|wxEXPAND, 5 );
m_buttonPlotAll = new wxButton( this, wxID_ANY, _("Plot A&LL"), wxDefaultPosition, wxDefaultSize, 0 );
bbuttonsSizer->Add( m_buttonPlotAll, 0, wxALL|wxEXPAND, 5 );
m_buttonClose = new wxButton( this, wxID_ANY, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bbuttonsSizer->Add( m_buttonClose, 0, wxALL|wxEXPAND, 5 );
bbuttonsSizer->Add( 10, 10, 1, wxEXPAND, 5 );
m_buttonOffset = new wxButton( this, wxID_ANY, _("&Accept Offset"), wxDefaultPosition, wxDefaultSize, 0 );
bbuttonsSizer->Add( m_buttonOffset, 0, wxALL, 5 );
bupperSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
bmainSizer->Add( bupperSizer, 0, wxEXPAND, 5 );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Messages :"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
bmainSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_MsgBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_MsgBox->SetMinSize( wxSize( -1,150 ) );
bmainSizer->Add( m_MsgBox, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bmainSizer );
this->Layout();
this->Centre( wxBOTH );
// Connect Events
m_SizeOption->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_HPGL_BASE::OnPageSelected ), NULL, this );
m_buttonPlotPage->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_HPGL_BASE::OnPlotCurrent ), NULL, this );
m_buttonPlotAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_HPGL_BASE::OnPlotAll ), NULL, this );
m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_HPGL_BASE::OnCancelClick ), NULL, this );
m_buttonOffset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_HPGL_BASE::AcceptPlotOffset ), NULL, this );
}
DIALOG_PLOT_SCHEMATIC_HPGL_BASE::~DIALOG_PLOT_SCHEMATIC_HPGL_BASE()
{
// Disconnect Events
m_SizeOption->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_HPGL_BASE::OnPageSelected ), NULL, this );
m_buttonPlotPage->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_HPGL_BASE::OnPlotCurrent ), NULL, this );
m_buttonPlotAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_HPGL_BASE::OnPlotAll ), NULL, this );
m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_HPGL_BASE::OnCancelClick ), NULL, this );
m_buttonOffset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_HPGL_BASE::AcceptPlotOffset ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,75 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_plot_schematic_HPGL_base__
#define __dialog_plot_schematic_HPGL_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/spinctrl.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PLOT_SCHEMATIC_HPGL_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_PLOT_SCHEMATIC_HPGL_BASE : public wxDialog
{
private:
protected:
wxRadioBox* m_SizeOption;
wxCheckBox* m_Plot_Sheet_Ref_Ctrl;
wxStaticText* m_penWidthTitle;
wxTextCtrl* m_penWidthCtrl;
wxStaticText* m_penSpeedTitle;
wxSpinCtrl* m_penSpeedCtrl;
wxStaticText* m_penNumTitle;
wxSpinCtrl* m_penNumCtrl;
wxStaticText* m_offsetXTitle;
wxTextCtrl* m_PlotOrgPosition_X;
wxStaticText* m_offsetYTitle;
wxTextCtrl* m_PlotOrgPosition_Y;
wxButton* m_buttonPlotPage;
wxButton* m_buttonPlotAll;
wxButton* m_buttonClose;
wxButton* m_buttonOffset;
wxStaticText* m_staticText1;
wxTextCtrl* m_MsgBox;
// Virtual event handlers, overide them in your derived class
virtual void OnPageSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPlotCurrent( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPlotAll( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void AcceptPlotOffset( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_PLOT_SCHEMATIC_HPGL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EESchema Plot HPGL"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 387,408 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PLOT_SCHEMATIC_HPGL_BASE();
};
#endif //__dialog_plot_schematic_HPGL_base__

View File

@ -1,4 +1,4 @@
/** @file dialog_plot_schematic_ps.cpp
/** @file dialog_plot_schematic_PS.cpp
*/
/*
@ -60,8 +60,8 @@ private:
static bool m_plot_Sheet_Ref;
bool m_select_PlotAll;
private:
void OnPlotPsCurrentExecuteClick( wxCommandEvent& event );
void OnPlotPsAllExecuteClick( wxCommandEvent& event );
void OnPlotCurrent( wxCommandEvent& event );
void OnPlotAll( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void initDlg();
@ -71,7 +71,7 @@ private:
SCH_SCREEN* screen, Ki_PageDescr* sheet,
wxPoint plot_offset, double scale );
};
/* static variables (staic to remember last state: */
/* static members (static to remember last state): */
bool DIALOG_PLOT_SCHEMATIC_PS::m_plotColorOpt = false;
int DIALOG_PLOT_SCHEMATIC_PS:: m_pageSizeSelect = PAGE_SIZE_AUTO;
bool DIALOG_PLOT_SCHEMATIC_PS::m_plot_Sheet_Ref = true;
@ -120,7 +120,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::initDlg()
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON
*/
void DIALOG_PLOT_SCHEMATIC_PS::OnPlotPsCurrentExecuteClick( wxCommandEvent& event )
void DIALOG_PLOT_SCHEMATIC_PS::OnPlotCurrent( wxCommandEvent& event )
{
m_select_PlotAll = false;
@ -134,7 +134,7 @@ void DIALOG_PLOT_SCHEMATIC_PS::OnPlotPsCurrentExecuteClick( wxCommandEvent& even
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON1
*/
void DIALOG_PLOT_SCHEMATIC_PS::OnPlotPsAllExecuteClick( wxCommandEvent& event )
void DIALOG_PLOT_SCHEMATIC_PS::OnPlotAll( wxCommandEvent& event )
{
m_select_PlotAll = TRUE;

View File

@ -19,9 +19,9 @@ DIALOG_PLOT_SCHEMATIC_PS_BASE::DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent,
wxBoxSizer* bupperSizer;
bupperSizer = new wxBoxSizer( wxHORIZONTAL );
wxString m_SizeOptionChoices[] = { wxT("Schematic size"), wxT("Force size A4"), wxT("Force size A") };
wxString m_SizeOptionChoices[] = { _("Schematic size"), _("Force size A4"), _("Force size A") };
int m_SizeOptionNChoices = sizeof( m_SizeOptionChoices ) / sizeof( wxString );
m_SizeOption = new wxRadioBox( this, wxID_ANY, wxT("Plot Page Size:"), wxDefaultPosition, wxDefaultSize, m_SizeOptionNChoices, m_SizeOptionChoices, 1, wxRA_SPECIFY_COLS );
m_SizeOption = new wxRadioBox( this, wxID_ANY, _("Plot Page Size:"), wxDefaultPosition, wxDefaultSize, m_SizeOptionNChoices, m_SizeOptionChoices, 1, wxRA_SPECIFY_COLS );
m_SizeOption->SetSelection( 0 );
bupperSizer->Add( m_SizeOption, 1, wxALL, 5 );
@ -31,13 +31,13 @@ DIALOG_PLOT_SCHEMATIC_PS_BASE::DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent,
wxBoxSizer* sbSizerMiddle;
sbSizerMiddle = new wxBoxSizer( wxVERTICAL );
wxString m_PlotPSColorOptionChoices[] = { wxT("B/W"), wxT("Color") };
wxString m_PlotPSColorOptionChoices[] = { _("B/W"), _("Color") };
int m_PlotPSColorOptionNChoices = sizeof( m_PlotPSColorOptionChoices ) / sizeof( wxString );
m_PlotPSColorOption = new wxRadioBox( this, wxID_ANY, wxT("Plot Mode:"), wxDefaultPosition, wxDefaultSize, m_PlotPSColorOptionNChoices, m_PlotPSColorOptionChoices, 1, wxRA_SPECIFY_COLS );
m_PlotPSColorOption = new wxRadioBox( this, wxID_ANY, _("Plot Mode:"), wxDefaultPosition, wxDefaultSize, m_PlotPSColorOptionNChoices, m_PlotPSColorOptionChoices, 1, wxRA_SPECIFY_COLS );
m_PlotPSColorOption->SetSelection( 0 );
sbSizerMiddle->Add( m_PlotPSColorOption, 0, wxALL|wxEXPAND, 5 );
m_Plot_Sheet_Ref_Ctrl = new wxCheckBox( this, wxID_ANY, wxT("Print page references"), wxDefaultPosition, wxDefaultSize, 0 );
m_Plot_Sheet_Ref_Ctrl = new wxCheckBox( this, wxID_ANY, _("Print page references"), wxDefaultPosition, wxDefaultSize, 0 );
m_Plot_Sheet_Ref_Ctrl->SetValue(true);
sbSizerMiddle->Add( m_Plot_Sheet_Ref_Ctrl, 0, wxALL|wxEXPAND, 5 );
@ -49,13 +49,13 @@ DIALOG_PLOT_SCHEMATIC_PS_BASE::DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent,
wxBoxSizer* bbuttonsSizer;
bbuttonsSizer = new wxBoxSizer( wxVERTICAL );
m_buttonPlotPage = new wxButton( this, wxID_ANY, wxT("&Plot Page"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonPlotPage = new wxButton( this, wxID_ANY, _("&Plot Page"), wxDefaultPosition, wxDefaultSize, 0 );
bbuttonsSizer->Add( m_buttonPlotPage, 0, wxALL|wxEXPAND, 5 );
m_buttonPlotAll = new wxButton( this, wxID_ANY, wxT("Plot A&LL"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonPlotAll = new wxButton( this, wxID_ANY, _("Plot A&LL"), wxDefaultPosition, wxDefaultSize, 0 );
bbuttonsSizer->Add( m_buttonPlotAll, 0, wxALL|wxEXPAND, 5 );
m_buttonClose = new wxButton( this, wxID_ANY, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonClose = new wxButton( this, wxID_ANY, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bbuttonsSizer->Add( m_buttonClose, 0, wxALL|wxEXPAND, 5 );
bupperSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
@ -65,7 +65,7 @@ DIALOG_PLOT_SCHEMATIC_PS_BASE::DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent,
wxBoxSizer* bSizerLineWidth;
bSizerLineWidth = new wxBoxSizer( wxHORIZONTAL );
m_defaultLineWidthTitle = new wxStaticText( this, wxID_ANY, wxT("Default line width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_defaultLineWidthTitle = new wxStaticText( this, wxID_ANY, _("Default line width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_defaultLineWidthTitle->Wrap( -1 );
bSizerLineWidth->Add( m_defaultLineWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
@ -74,7 +74,7 @@ DIALOG_PLOT_SCHEMATIC_PS_BASE::DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent,
bmainSizer->Add( bSizerLineWidth, 0, wxEXPAND, 5 );
m_staticText1 = new wxStaticText( this, wxID_ANY, wxT("Messages :"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Messages :"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
bmainSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
@ -89,16 +89,16 @@ DIALOG_PLOT_SCHEMATIC_PS_BASE::DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent,
this->Centre( wxBOTH );
// Connect Events
m_buttonPlotPage->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PS_BASE::OnPlotPsCurrentExecuteClick ), NULL, this );
m_buttonPlotAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PS_BASE::OnPlotPsAllExecuteClick ), NULL, this );
m_buttonPlotPage->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PS_BASE::OnPlotCurrent ), NULL, this );
m_buttonPlotAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PS_BASE::OnPlotAll ), NULL, this );
m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PS_BASE::OnCancelClick ), NULL, this );
}
DIALOG_PLOT_SCHEMATIC_PS_BASE::~DIALOG_PLOT_SCHEMATIC_PS_BASE()
{
// Disconnect Events
m_buttonPlotPage->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PS_BASE::OnPlotPsCurrentExecuteClick ), NULL, this );
m_buttonPlotAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PS_BASE::OnPlotPsAllExecuteClick ), NULL, this );
m_buttonPlotPage->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PS_BASE::OnPlotCurrent ), NULL, this );
m_buttonPlotAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PS_BASE::OnPlotAll ), NULL, this );
m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_SCHEMATIC_PS_BASE::OnCancelClick ), NULL, this );
}

View File

@ -12,7 +12,7 @@
<property name="file">dialog_plot_schematic_PS_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">0</property>
<property name="internationalize">1</property>
<property name="name">dialog_plot_schematic_PS</property>
<property name="namespace"></property>
<property name="path">.</property>
@ -339,7 +339,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnPlotPsCurrentExecuteClick</event>
<event name="OnButtonClick">OnPlotCurrent</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
@ -396,7 +396,7 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnPlotPsAllExecuteClick</event>
<event name="OnButtonClick">OnPlotAll</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>

View File

@ -8,6 +8,8 @@
#ifndef __dialog_plot_schematic_PS_base__
#define __dialog_plot_schematic_PS_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
@ -46,14 +48,14 @@ class DIALOG_PLOT_SCHEMATIC_PS_BASE : public wxDialog
wxTextCtrl* m_MsgBox;
// Virtual event handlers, overide them in your derived class
virtual void OnPlotPsCurrentExecuteClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPlotPsAllExecuteClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPlotCurrent( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPlotAll( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("EESchema Plot PS"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 387,365 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("EESchema Plot PS"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 387,365 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PLOT_SCHEMATIC_PS_BASE();
};

View File

@ -1,768 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: plothpgl.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 04/02/2006 16:54:19
// RCS-ID:
// Copyright: License GNU
// License:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 04/02/2006 16:54:19
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "plothpgl.h"
#endif
////@begin includes
////@end includes
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "confirm.h"
#include "plot_common.h"
#include "worksheet.h"
#include "program.h"
#include "general.h"
#include "protos.h"
#include "plothpgl.h"
////@begin XPM images
////@end XPM images
FILE* PlotOutput;
int HPGL_SizeSelect;
enum PageFormatReq
{
PAGE_DEFAULT = 0,
PAGE_SIZE_A4,
PAGE_SIZE_A3,
PAGE_SIZE_A2,
PAGE_SIZE_A1,
PAGE_SIZE_A0,
PAGE_SIZE_A,
PAGE_SIZE_B,
PAGE_SIZE_C,
PAGE_SIZE_D,
PAGE_SIZE_E
};
static Ki_PageDescr* Plot_sheet_list[] =
{
NULL,
&g_Sheet_A4,
&g_Sheet_A3,
&g_Sheet_A2,
&g_Sheet_A1,
&g_Sheet_A0,
&g_Sheet_A,
&g_Sheet_B,
&g_Sheet_C,
&g_Sheet_D,
&g_Sheet_E,
&g_Sheet_GERBER,
&g_Sheet_user
};
void WinEDA_SchematicFrame::ToPlot_HPGL( wxCommandEvent& event )
{
WinEDA_PlotHPGLFrame* HPGL_frame = new WinEDA_PlotHPGLFrame( this );
HPGL_frame->ShowModal();
HPGL_frame->Destroy();
}
/*!
* WinEDA_PlotHPGLFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WinEDA_PlotHPGLFrame, wxDialog )
/*!
* WinEDA_PlotHPGLFrame event table definition
*/
BEGIN_EVENT_TABLE( WinEDA_PlotHPGLFrame, wxDialog )
////@begin WinEDA_PlotHPGLFrame event table entries
EVT_RADIOBOX( ID_RADIOBOX, WinEDA_PlotHPGLFrame::OnRadioboxSelected )
EVT_SPINCTRL( ID_PEN_WIDTH_UPDATED,
WinEDA_PlotHPGLFrame::OnPenWidthUpdatedUpdated )
EVT_SPINCTRL( ID_PEN_SPEED_UPDATED,
WinEDA_PlotHPGLFrame::OnPenSpeedUpdatedUpdated )
EVT_SPINCTRL( ID_PEN_NUMBER_UPDATED,
WinEDA_PlotHPGLFrame::OnPenNumberUpdatedUpdated )
EVT_BUTTON( ID_PLOT_HPGL_CURRENT_EXECUTE,
WinEDA_PlotHPGLFrame::OnPlotHpglCurrentExecuteClick )
EVT_BUTTON( ID_PLOT_HPGL_ALL_EXECUTE,
WinEDA_PlotHPGLFrame::OnPlotHpglAllExecuteClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_PlotHPGLFrame::OnCancelClick )
EVT_BUTTON( ID_PLOT_ACCEPT_OFFSET,
WinEDA_PlotHPGLFrame::OnPlotAcceptOffsetClick )
////@end WinEDA_PlotHPGLFrame event table entries
END_EVENT_TABLE()
/*!
* WinEDA_PlotHPGLFrame constructors
*/
WinEDA_PlotHPGLFrame::WinEDA_PlotHPGLFrame()
{
}
WinEDA_PlotHPGLFrame::WinEDA_PlotHPGLFrame( WinEDA_DrawFrame* parent,
wxWindowID id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
{
m_Parent = parent;
Create( parent, id, caption, pos, size, style );
SetPageOffsetValue();
}
/*!
* WinEDA_PlotHPGLFrame creator
*/
bool WinEDA_PlotHPGLFrame::Create( wxWindow* parent,
wxWindowID id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
{
////@begin WinEDA_PlotHPGLFrame member initialization
m_SizeOption = NULL;
m_ButtPenWidth = NULL;
m_ButtPenSpeed = NULL;
m_ButtPenNum = NULL;
m_PlotOrgPosition_X = NULL;
m_PlotOrgPosition_Y = NULL;
m_btClose = NULL;
m_MsgBox = NULL;
////@end WinEDA_PlotHPGLFrame member initialization
////@begin WinEDA_PlotHPGLFrame creation
SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if( GetSizer() )
{
GetSizer()->SetSizeHints( this );
}
Centre();
////@end WinEDA_PlotHPGLFrame creation
return true;
}
/*!
* Control creation for WinEDA_PlotHPGLFrame
*/
void WinEDA_PlotHPGLFrame::CreateControls()
{
////@begin WinEDA_PlotHPGLFrame content construction
// Generated by DialogBlocks, 24/04/2009 14:24:58 (unregistered)
WinEDA_PlotHPGLFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxVERTICAL );
itemDialog1->SetSizer( itemBoxSizer2 );
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer( wxHORIZONTAL );
itemBoxSizer2->Add( itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
wxBoxSizer* itemBoxSizer4 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer3->Add( itemBoxSizer4, 0, wxGROW | wxALL, 5 );
wxArrayString m_SizeOptionStrings;
m_SizeOptionStrings.Add( _( "Sheet Size" ) );
m_SizeOptionStrings.Add( _( "Page Size A4" ) );
m_SizeOptionStrings.Add( _( "Page Size A3" ) );
m_SizeOptionStrings.Add( _( "Page Size A2" ) );
m_SizeOptionStrings.Add( _( "Page Size A1" ) );
m_SizeOptionStrings.Add( _( "Page Size A0" ) );
m_SizeOptionStrings.Add( _( "Page Size A" ) );
m_SizeOptionStrings.Add( _( "Page Size B" ) );
m_SizeOptionStrings.Add( _( "Page Size C" ) );
m_SizeOptionStrings.Add( _( "Page Size D" ) );
m_SizeOptionStrings.Add( _( "Page Size E" ) );
m_SizeOption =
new wxRadioBox( itemDialog1, ID_RADIOBOX, _( "Plot page size:" ),
wxDefaultPosition, wxDefaultSize, m_SizeOptionStrings,
1, wxRA_SPECIFY_COLS );
m_SizeOption->SetSelection( 0 );
itemBoxSizer4->Add( m_SizeOption, 0, wxALIGN_LEFT | wxALL, 5 );
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer3->Add( itemBoxSizer6, 0, wxALIGN_TOP | wxALL, 5 );
wxStaticBox* itemStaticBoxSizer7Static =
new wxStaticBox( itemDialog1, wxID_ANY, _( "Pen control:" ) );
wxStaticBoxSizer* itemStaticBoxSizer7 =
new wxStaticBoxSizer( itemStaticBoxSizer7Static, wxVERTICAL );
itemBoxSizer6->Add( itemStaticBoxSizer7,
0,
wxALIGN_CENTER_HORIZONTAL | wxALL,
5 );
wxStaticText* itemStaticText8 = new wxStaticText( itemDialog1,
wxID_STATIC,
_( "Pen Width ( mils )" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemStaticBoxSizer7->Add(
itemStaticText8,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP |
wxADJUST_MINSIZE,
5 );
m_ButtPenWidth =
new wxSpinCtrl( itemDialog1, ID_PEN_WIDTH_UPDATED, _T( "1" ),
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS | wxSP_WRAP, 1, 100, 1 );
itemStaticBoxSizer7->Add( m_ButtPenWidth,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM,
5 );
wxStaticText* itemStaticText10 = new wxStaticText( itemDialog1,
wxID_STATIC,
_( "Pen Speed ( cm/s )" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemStaticBoxSizer7->Add( itemStaticText10,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP |
wxADJUST_MINSIZE,
5 );
m_ButtPenSpeed =
new wxSpinCtrl( itemDialog1, ID_PEN_SPEED_UPDATED, _T( "1" ),
wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS,
1, 100, 1 );
itemStaticBoxSizer7->Add( m_ButtPenSpeed,
0,
wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT |
wxBOTTOM,
5 );
wxStaticText* itemStaticText12 = new wxStaticText( itemDialog1,
wxID_STATIC,
_( "Pen Number" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemStaticBoxSizer7->Add( itemStaticText12,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP |
wxADJUST_MINSIZE,
5 );
m_ButtPenNum = new wxSpinCtrl( itemDialog1, ID_PEN_NUMBER_UPDATED,
_T( "1" ), wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS, 1, 8, 1 );
itemStaticBoxSizer7->Add( m_ButtPenNum,
0,
wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT |
wxBOTTOM,
5 );
wxStaticBox* itemStaticBoxSizer14Static =
new wxStaticBox( itemDialog1, wxID_ANY, _( "Page offset:" ) );
wxStaticBoxSizer* itemStaticBoxSizer14 =
new wxStaticBoxSizer( itemStaticBoxSizer14Static, wxVERTICAL );
itemBoxSizer6->Add( itemStaticBoxSizer14, 0, wxALIGN_LEFT | wxALL, 5 );
wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1,
wxID_STATIC,
_( "Plot Offset X" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemStaticBoxSizer14->Add( itemStaticText15,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP |
wxADJUST_MINSIZE,
5 );
m_PlotOrgPosition_X = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1,
_T( "" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer14->Add( m_PlotOrgPosition_X,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM,
5 );
wxStaticText* itemStaticText17 = new wxStaticText( itemDialog1,
wxID_STATIC,
_( "Plot Offset Y" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemStaticBoxSizer14->Add( itemStaticText17,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP |
wxADJUST_MINSIZE,
5 );
m_PlotOrgPosition_Y = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T( "" ),
wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer14->Add( m_PlotOrgPosition_Y,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxBOTTOM,
5 );
itemBoxSizer3->Add( 5, 5, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
wxBoxSizer* itemBoxSizer20 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer3->Add( itemBoxSizer20,
0,
wxALIGN_TOP | wxLEFT | wxTOP | wxBOTTOM,
5 );
wxButton* itemButton21 = new wxButton( itemDialog1,
ID_PLOT_HPGL_CURRENT_EXECUTE,
_( "&Plot Page" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemButton21->SetDefault();
itemBoxSizer20->Add( itemButton21, 0, wxGROW | wxALL, 5 );
wxButton* itemButton22 = new wxButton( itemDialog1,
ID_PLOT_HPGL_ALL_EXECUTE,
_( "Plot A&LL" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemBoxSizer20->Add( itemButton22, 0, wxGROW | wxALL, 5 );
m_btClose = new wxButton( itemDialog1, wxID_CANCEL, _( "&Close" ),
wxDefaultPosition, wxDefaultSize,
0 );
itemBoxSizer20->Add( m_btClose, 0, wxGROW | wxALL, 5 );
itemBoxSizer20->Add( 5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
wxButton* itemButton25 = new wxButton( itemDialog1,
ID_PLOT_ACCEPT_OFFSET,
_( "&Accept Offset" ),
wxDefaultPosition,
wxDefaultSize,
0 );
itemBoxSizer20->Add( itemButton25, 0, wxGROW | wxALL, 5 );
m_MsgBox = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( "" ),
wxDefaultPosition, wxSize( -1, 110 ),
wxTE_MULTILINE );
itemBoxSizer2->Add( m_MsgBox, 0, wxGROW | wxALL, 5 );
// Set validators
m_SizeOption->SetValidator( wxGenericValidator( &HPGL_SizeSelect ) );
m_ButtPenWidth->SetValidator( wxGenericValidator( &g_HPGL_Pen_Descr.
m_Pen_Diam ) );
m_ButtPenSpeed->SetValidator( wxGenericValidator( &g_HPGL_Pen_Descr.
m_Pen_Speed ) );
m_ButtPenNum->SetValidator( wxGenericValidator( &g_HPGL_Pen_Descr.
m_Pen_Num ) );
////@end WinEDA_PlotHPGLFrame content construction
SetFocus(); // Make ESC key working
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_HPGL_CURRENT_EXECUTE
*/
void WinEDA_PlotHPGLFrame::OnPlotHpglCurrentExecuteClick(
wxCommandEvent& event )
{
HPGL_Plot( event );
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_HPGL_ALL_EXECUTE
*/
void WinEDA_PlotHPGLFrame::OnPlotHpglAllExecuteClick( wxCommandEvent& event )
{
HPGL_Plot( event );
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/
void WinEDA_PlotHPGLFrame::OnCancelClick( wxCommandEvent& event )
{
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in
// WinEDA_PlotHPGLFrame.
// Before editing this code, remove the block markers.
event.Skip();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in
// WinEDA_PlotHPGLFrame.
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_ACCEPT_OFFSET
*/
void WinEDA_PlotHPGLFrame::OnPlotAcceptOffsetClick( wxCommandEvent& event )
{
AcceptPlotOffset( event );
}
/*!
* Should we show tooltips?
*/
bool WinEDA_PlotHPGLFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_PlotHPGLFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_PlotHPGLFrame bitmap retrieval
wxUnusedVar( name );
return wxNullBitmap;
////@end WinEDA_PlotHPGLFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WinEDA_PlotHPGLFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_PlotHPGLFrame icon retrieval
wxUnusedVar( name );
return wxNullIcon;
////@end WinEDA_PlotHPGLFrame icon retrieval
}
void WinEDA_PlotHPGLFrame::SetPageOffsetValue()
{
wxString msg;
if( HPGL_SizeSelect != PAGE_DEFAULT )
{
msg = ReturnStringFromValue( g_UserUnit,
Plot_sheet_list[HPGL_SizeSelect]->m_Offset.x,
EESCHEMA_INTERNAL_UNIT );
m_PlotOrgPosition_X->SetValue( msg );
msg = ReturnStringFromValue( g_UserUnit,
Plot_sheet_list[HPGL_SizeSelect]-> m_Offset.y,
EESCHEMA_INTERNAL_UNIT );
m_PlotOrgPosition_Y->SetValue( msg );
m_PlotOrgPosition_X->Enable( TRUE );
m_PlotOrgPosition_Y->Enable( TRUE );
}
else
{
m_PlotOrgPosition_X->Enable( FALSE );
m_PlotOrgPosition_Y->Enable( FALSE );
}
}
void WinEDA_PlotHPGLFrame::AcceptPlotOffset( wxCommandEvent& event )
{
int ii = m_SizeOption->GetSelection();
if( ii <= 0 )
HPGL_SizeSelect = 0;
else
HPGL_SizeSelect = ii;
if( HPGL_SizeSelect != PAGE_DEFAULT )
{
wxString msg = m_PlotOrgPosition_X->GetValue();
Plot_sheet_list[HPGL_SizeSelect]->m_Offset.x =
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
msg = m_PlotOrgPosition_Y->GetValue();
Plot_sheet_list[HPGL_SizeSelect]->m_Offset.y =
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
}
}
void WinEDA_PlotHPGLFrame::SetPenWidth( wxSpinEvent& event )
{
g_HPGL_Pen_Descr.m_Pen_Diam = m_ButtPenWidth->GetValue();
if( g_HPGL_Pen_Descr.m_Pen_Diam > 100 )
g_HPGL_Pen_Descr.m_Pen_Diam = 100;
if( g_HPGL_Pen_Descr.m_Pen_Diam < 1 )
g_HPGL_Pen_Descr.m_Pen_Diam = 1;
}
void WinEDA_PlotHPGLFrame::SetPenSpeed( wxSpinEvent& event )
{
g_HPGL_Pen_Descr.m_Pen_Speed = m_ButtPenSpeed->GetValue();
if( g_HPGL_Pen_Descr.m_Pen_Speed > 40 )
g_HPGL_Pen_Descr.m_Pen_Speed = 40;
if( g_HPGL_Pen_Descr.m_Pen_Speed < 1 )
g_HPGL_Pen_Descr.m_Pen_Speed = 1;
}
void WinEDA_PlotHPGLFrame::SetPenNum( wxSpinEvent& event )
{
g_HPGL_Pen_Descr.m_Pen_Num = m_ButtPenNum->GetValue();
if( g_HPGL_Pen_Descr.m_Pen_Num > 8 )
g_HPGL_Pen_Descr.m_Pen_Num = 8;
if( g_HPGL_Pen_Descr.m_Pen_Num < 1 )
g_HPGL_Pen_Descr.m_Pen_Num = 1;
}
void WinEDA_PlotHPGLFrame::HPGL_Plot( wxCommandEvent& event )
{
int Select_PlotAll = FALSE;
if( event.GetId() == ID_PLOT_HPGL_ALL_EXECUTE )
Select_PlotAll = TRUE;
if( HPGL_SizeSelect )
{
wxString msg = m_PlotOrgPosition_X->GetValue();
Plot_sheet_list[HPGL_SizeSelect]->m_Offset.x =
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
msg = m_PlotOrgPosition_Y->GetValue();
Plot_sheet_list[HPGL_SizeSelect]->m_Offset.y =
ReturnValueFromString( g_UserUnit, msg, EESCHEMA_INTERNAL_UNIT );
}
Plot_Schematic_HPGL( Select_PlotAll, HPGL_SizeSelect );
}
/* Function calculates the offsets and dimensions of any trace of the
* selected sheet
*/
void WinEDA_PlotHPGLFrame::ReturnSheetDims( BASE_SCREEN* screen,
wxSize& SheetSize,
wxPoint& SheetOffset )
{
Ki_PageDescr* PlotSheet;
if( screen == NULL )
screen = m_Parent->GetBaseScreen();
PlotSheet = screen->m_CurrentSheetDesc;
SheetSize = PlotSheet->m_Size;
SheetOffset = PlotSheet->m_Offset;
}
void WinEDA_PlotHPGLFrame::Plot_Schematic_HPGL( int Select_PlotAll,
int HPGL_SheetSize )
{
WinEDA_SchematicFrame* schframe = (WinEDA_SchematicFrame*) m_Parent;
wxString PlotFileName;
SCH_SCREEN* screen = schframe->GetScreen();
SCH_SCREEN* oldscreen = screen;
SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet();
Ki_PageDescr* PlotSheet;
wxSize SheetSize;
wxPoint SheetOffset, PlotOffset;
/* When printing all pages, the printed page is not the current page.
* In complex hierarchies, we must setup references and others parameters
* in the printed SCH_SCREEN
* because in complex hierarchies a SCH_SCREEN (a schematic drawings)
* is shared between many sheets
*/
SCH_SHEET_LIST SheetList( NULL );
sheetpath = SheetList.GetFirst();
SCH_SHEET_PATH list;
while( true )
{
if( Select_PlotAll )
{
if( sheetpath == NULL )
break;
list.Clear();
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
{
schframe->m_CurrentSheet = &list;
schframe->m_CurrentSheet->UpdateAllScreenReferences();
schframe->SetSheetNumberAndCount();
screen = schframe->m_CurrentSheet->LastScreen();
ActiveScreen = screen;
}
else // Should not happen
return;
sheetpath = SheetList.GetNext();
}
ReturnSheetDims( screen, SheetSize, SheetOffset );
/* Calculation of conversion scales. */
if( HPGL_SheetSize )
PlotSheet = Plot_sheet_list[HPGL_SheetSize];
else
PlotSheet = screen->m_CurrentSheetDesc;
/* 10x because eeschema works in mils, not decimals */
double plot_scale = 10 * (double) PlotSheet->m_Size.x /
(double) SheetSize.x;
/* Calculate offsets */
PlotOffset.x = -SheetOffset.x;
PlotOffset.y = -SheetOffset.y;
PlotFileName = schframe->GetUniqueFilenameForCurrentSheet() +
wxT( ".plt" );
SetLocaleTo_C_standard();
Plot_1_Page_HPGL( PlotFileName, screen, PlotSheet, PlotOffset,
plot_scale );
SetLocaleTo_Default();
if( !Select_PlotAll )
break;
}
ActiveScreen = oldscreen;
schframe->m_CurrentSheet = oldsheetpath;
schframe->m_CurrentSheet->UpdateAllScreenReferences();
schframe->SetSheetNumberAndCount();
}
void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL( const wxString& FileName,
SCH_SCREEN* screen,
Ki_PageDescr* sheet,
wxPoint& offset,
double plot_scale )
{
wxString msg;
FILE* output_file = wxFopen( FileName, wxT( "wt" ) );
if( output_file == NULL )
{
msg = wxT( "\n** " );
msg += _( "Unable to create " ) + FileName + wxT( " **\n\n" );
m_MsgBox->AppendText( msg );
wxBell();
return;
}
SetLocaleTo_C_standard();
msg.Printf( _( "Plot: %s\n" ), FileName.GetData() );
m_MsgBox->AppendText( msg );
HPGL_PLOTTER* plotter = new HPGL_PLOTTER();
plotter->set_paper_size( sheet );
plotter->set_viewport( offset, plot_scale, 0 );
plotter->set_default_line_width( g_DrawDefaultLineThickness );
/* Init : */
plotter->set_creator( wxT( "EESchema-HPGL" ) );
plotter->set_filename( FileName );
plotter->set_pen_speed( g_HPGL_Pen_Descr.m_Pen_Speed );
plotter->set_pen_number( g_HPGL_Pen_Descr.m_Pen_Num );
plotter->set_pen_diameter( g_HPGL_Pen_Descr.m_Pen_Diam );
plotter->set_pen_overlap( g_HPGL_Pen_Descr.m_Pen_Diam / 2 );
plotter->start_plot( output_file );
plotter->set_color( BLACK );
m_Parent->PlotWorkSheet( plotter, screen );
PlotDrawlist( plotter, screen->EEDrawList );
plotter->end_plot();
delete plotter;
SetLocaleTo_Default();
m_MsgBox->AppendText( wxT( "Ok\n" ) );
}
/*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX
*/
void WinEDA_PlotHPGLFrame::OnRadioboxSelected( wxCommandEvent& event )
{
HPGL_SizeSelect = m_SizeOption->GetSelection();
SetPageOffsetValue();
}
/*!
* wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_PEN_WIDTH_UPDATED
*/
void WinEDA_PlotHPGLFrame::OnPenWidthUpdatedUpdated( wxSpinEvent& event )
{
SetPenWidth( event );
}
/*!
* wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_PEN_SPEED_UPDATED
*/
void WinEDA_PlotHPGLFrame::OnPenSpeedUpdatedUpdated( wxSpinEvent& event )
{
SetPenSpeed( event );
}
/*!
* wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_PEN_NUMBER_UPDATED
*/
void WinEDA_PlotHPGLFrame::OnPenNumberUpdatedUpdated( wxSpinEvent& event )
{
SetPenNum( event );
}

View File

@ -1,155 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: plothpgl.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 04/02/2006 16:54:19
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 04/02/2006 16:54:19
#ifndef _PLOTHPGL_H_
#define _PLOTHPGL_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "plothpgl.h"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/valgen.h"
#include "wx/spinctrl.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxSpinCtrl;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define ID_RADIOBOX 10001
#define ID_PEN_WIDTH_UPDATED 10002
#define ID_PEN_SPEED_UPDATED 10003
#define ID_PEN_NUMBER_UPDATED 10004
#define ID_TEXTCTRL1 10010
#define ID_TEXTCTRL2 10009
#define ID_PLOT_HPGL_CURRENT_EXECUTE 10005
#define ID_PLOT_HPGL_ALL_EXECUTE 10006
#define ID_PLOT_ACCEPT_OFFSET 10008
#define ID_TEXTCTRL 10007
#define SYMBOL_WINEDA_PLOTHPGLFRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_PLOTHPGLFRAME_TITLE _("EESchema Plot HPGL")
#define SYMBOL_WINEDA_PLOTHPGLFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PLOTHPGLFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_PLOTHPGLFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_PlotHPGLFrame class declaration
*/
class WinEDA_PlotHPGLFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_PlotHPGLFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_PlotHPGLFrame( );
WinEDA_PlotHPGLFrame( WinEDA_DrawFrame* parent, wxWindowID id = SYMBOL_WINEDA_PLOTHPGLFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PLOTHPGLFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PLOTHPGLFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PLOTHPGLFRAME_SIZE, long style = SYMBOL_WINEDA_PLOTHPGLFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PLOTHPGLFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PLOTHPGLFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PLOTHPGLFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PLOTHPGLFRAME_SIZE, long style = SYMBOL_WINEDA_PLOTHPGLFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_PlotHPGLFrame event handler declarations
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX
void OnRadioboxSelected( wxCommandEvent& event );
/// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_PEN_WIDTH_UPDATED
void OnPenWidthUpdatedUpdated( wxSpinEvent& event );
/// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_PEN_SPEED_UPDATED
void OnPenSpeedUpdatedUpdated( wxSpinEvent& event );
/// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_PEN_NUMBER_UPDATED
void OnPenNumberUpdatedUpdated( wxSpinEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_HPGL_CURRENT_EXECUTE
void OnPlotHpglCurrentExecuteClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_HPGL_ALL_EXECUTE
void OnPlotHpglAllExecuteClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_ACCEPT_OFFSET
void OnPlotAcceptOffsetClick( wxCommandEvent& event );
////@end WinEDA_PlotHPGLFrame event handler declarations
////@begin WinEDA_PlotHPGLFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_PlotHPGLFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void HPGL_Plot(wxCommandEvent& event);
void SetSizeOption(wxCommandEvent& event);
void AcceptPlotOffset(wxCommandEvent& event);
void SetPenWidth(wxSpinEvent& event);
void SetPenSpeed(wxSpinEvent& event);
void SetPenNum(wxSpinEvent& event);
void Plot_1_Page_HPGL(const wxString &FileName, SCH_SCREEN * screen,
Ki_PageDescr* paper, wxPoint& offset, double scale);
void Plot_Schematic_HPGL(int Select_PlotAll, int HPGL_SheetSize);
void ReturnSheetDims( BASE_SCREEN * screen, wxSize & SheetSize, wxPoint & SheetOffset);
void SetPageOffsetValue();
////@begin WinEDA_PlotHPGLFrame member variables
wxRadioBox* m_SizeOption;
wxSpinCtrl* m_ButtPenWidth;
wxSpinCtrl* m_ButtPenSpeed;
wxSpinCtrl* m_ButtPenNum;
wxTextCtrl* m_PlotOrgPosition_X;
wxTextCtrl* m_PlotOrgPosition_Y;
wxButton* m_btClose;
wxTextCtrl* m_MsgBox;
////@end WinEDA_PlotHPGLFrame member variables
WinEDA_DrawFrame * m_Parent;
};
#endif
// _PLOTHPGL_H_

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
#include "wx/msw/wx.rc"