Commit e3b4eeb1 authored by Wayne Stambaugh's avatar Wayne Stambaugh

More EESchema dialog file housekeeping

parent fdb18547
......@@ -4,6 +4,18 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
email address.
2010-nov-17 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++EESchema
* Move library text edit, library draw item edit, SVG print, and BOM dialogs
to dialogs folder.
* Rename library text edit dialog file and object names to comply with
coding policy.
* Set default button in library text edit, library draw item edit, SVG print,
and BOM dialogs.
* Move BOM dialog code into BOM dialog object source file.
2010-nov-11 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++EESchema
......
......@@ -35,9 +35,10 @@ set(EESCHEMA_SRCS
dialogs/dialog_plot_schematic_PS_base.cpp
dialogs/annotate_dialog.cpp
dialogs/dialog_annotate_base.cpp
dialog_bodygraphictext_properties_base.cpp
dialog_build_BOM.cpp
dialog_build_BOM_base.cpp
dialogs/dialog_lib_edit_text.cpp
dialogs/dialog_lib_edit_text_base.cpp
dialogs/dialog_build_BOM.cpp
dialogs/dialog_build_BOM_base.cpp
dialog_edit_component_in_lib.cpp
dialog_edit_component_in_lib_base.cpp
dialog_edit_component_in_schematic_fbp.cpp
......@@ -54,8 +55,8 @@ set(EESCHEMA_SRCS
dialogs/dialog_erc_base.cpp
dialog_libedit_dimensions.cpp
dialog_libedit_dimensions_base.cpp
dialog_lib_edit_draw_item.cpp
dialog_lib_edit_draw_item_base.cpp
dialogs/dialog_lib_edit_draw_item.cpp
dialogs/dialog_lib_edit_draw_item_base.cpp
dialogs/dialog_lib_edit_pin.cpp
dialogs/dialog_lib_edit_pin_base.cpp
dialog_lib_new_component.cpp
......@@ -66,8 +67,8 @@ set(EESCHEMA_SRCS
dialog_sch_sheet_props_base.cpp
dialogs/dialog_schematic_find.cpp
dialogs/dialog_schematic_find_base.cpp
dialog_SVG_print.cpp
dialog_SVG_print_base.cpp
dialogs/dialog_SVG_print.cpp
dialogs/dialog_SVG_print_base.cpp
edit_component_in_lib.cpp
edit_component_in_schematic.cpp
edit_label.cpp
......@@ -130,7 +131,6 @@ set(EESCHEMA_SRCS
sheetlab.cpp
symbdraw.cpp
symbedit.cpp
edit_graphic_bodyitem_text.cpp
template_fieldnames_keywords.cpp
template_fieldnames.cpp
tool_lib.cpp
......
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_build_BOM.cpp
// Author: jean-pierre Charras
// Modified by:
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "wxstruct.h"
#include "general.h"
#include "netlist.h"
#include "wx/valgen.h"
#include "dialog_build_BOM.h"
#include "protos.h"
/* Local variables */
static bool s_ListByRef = TRUE;
static bool s_ListByValue = TRUE;
static bool s_ListWithSubCmponents;
static bool s_ListHierarchicalPinByName;
static bool s_ListBySheet;
static bool s_BrowseCreatedList;
static int s_OutputFormOpt;
static int s_OutputSeparatorOpt;
static bool s_Add_FpField_state;
static bool s_Add_F1_state;
static bool s_Add_F2_state;
static bool s_Add_F3_state;
static bool s_Add_F4_state;
static bool s_Add_F5_state;
static bool s_Add_F6_state;
static bool s_Add_F7_state;
static bool s_Add_F8_state;
static bool s_Add_Alls_state;
static bool* s_AddFieldList[] = {
&s_Add_FpField_state,
&s_Add_F1_state,
&s_Add_F2_state,
&s_Add_F3_state,
&s_Add_F4_state,
&s_Add_F5_state,
&s_Add_F6_state,
&s_Add_F7_state,
&s_Add_F8_state,
&s_Add_Alls_state,
NULL
};
#define OPTION_BOM_FORMAT wxT( "BomFormat" )
#define OPTION_BOM_LAUNCH_BROWSER wxT( "BomLaunchBrowser" )
#define OPTION_BOM_SEPARATOR wxT( "BomExportSeparator" )
#define OPTION_BOM_ADD_FIELD wxT( "BomAddField" )
/* list of separators used in bom export to spreadsheet
* (selected by s_OutputSeparatorOpt, and s_OutputSeparatorOpt radiobox)
*/
static char s_ExportSeparator[] = ("\t;,.");
/*!
* DIALOG_BUILD_BOM dialog type definition
*/
DIALOG_BUILD_BOM::DIALOG_BUILD_BOM( WinEDA_DrawFrame* parent ):
DIALOG_BUILD_BOM_BASE(parent)
{
m_Config = wxGetApp().m_EDA_Config;
wxASSERT( m_Config != NULL );
m_Parent = parent;
Init( );
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
}
/*!
* Init Controls for DIALOG_BUILD_BOM
*/
void DIALOG_BUILD_BOM::Init()
{
SetFocus();
/* Get options */
s_OutputFormOpt = m_Config->Read( OPTION_BOM_FORMAT, (long) 0 );
s_BrowseCreatedList = m_Config->Read( OPTION_BOM_LAUNCH_BROWSER, (long) 0 );
s_OutputSeparatorOpt = m_Config->Read( OPTION_BOM_SEPARATOR, (long) 0 );
long addfields = m_Config->Read( OPTION_BOM_ADD_FIELD, (long) 0 );
for( int ii = 0, bitmask = 1; s_AddFieldList[ii] != NULL; ii++ )
{
if( (addfields & bitmask) )
*s_AddFieldList[ii] = true;
else
*s_AddFieldList[ii] = false;
bitmask <<= 1;
}
// Set validators
m_ListCmpbyRefItems->SetValidator( wxGenericValidator(& s_ListByRef) );
m_ListSubCmpItems->SetValidator( wxGenericValidator(& s_ListWithSubCmponents) );
m_ListCmpbyValItems->SetValidator( wxGenericValidator(& s_ListByValue) );
m_GenListLabelsbyVal->SetValidator( wxGenericValidator(& s_ListHierarchicalPinByName) );
m_GenListLabelsbySheet->SetValidator( wxGenericValidator(& s_ListBySheet) );
m_OutputFormCtrl->SetValidator( wxGenericValidator(& s_OutputFormOpt) );
m_OutputSeparatorCtrl->SetValidator( wxGenericValidator(& s_OutputSeparatorOpt) );
m_GetListBrowser->SetValidator( wxGenericValidator(& s_BrowseCreatedList) );
m_AddFootprintField->SetValidator( wxGenericValidator(& s_Add_FpField_state) );
m_AddField1->SetValidator( wxGenericValidator(& s_Add_F1_state) );
m_AddField2->SetValidator( wxGenericValidator(& s_Add_F2_state) );
m_AddField3->SetValidator( wxGenericValidator(& s_Add_F3_state) );
m_AddField4->SetValidator( wxGenericValidator(& s_Add_F4_state) );
m_AddField5->SetValidator( wxGenericValidator(& s_Add_F5_state) );
m_AddField6->SetValidator( wxGenericValidator(& s_Add_F6_state) );
m_AddField7->SetValidator( wxGenericValidator(& s_Add_F7_state) );
m_AddField8->SetValidator( wxGenericValidator(& s_Add_F8_state) );
m_AddAllFields->SetValidator( wxGenericValidator(& s_Add_Alls_state) );
m_OutputFormCtrl->SetSelection( s_OutputFormOpt );
m_OutputSeparatorCtrl->SetSelection( s_OutputSeparatorOpt );
// Enable/disable options:
wxCommandEvent dummy;
OnRadioboxSelectFormatSelected( dummy );
}
/*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX_SELECT_FORMAT
*/
void DIALOG_BUILD_BOM::OnRadioboxSelectFormatSelected( wxCommandEvent& event )
{
if( m_OutputFormCtrl->GetSelection() == 0 )
{
m_OutputSeparatorCtrl->Enable( false );
m_ListCmpbyValItems->Enable( true );
m_GenListLabelsbyVal->Enable( true );
m_GenListLabelsbySheet->Enable( true );
} else {
m_OutputSeparatorCtrl->Enable( true );
m_ListCmpbyValItems->Enable( false );
m_GenListLabelsbyVal->Enable( false );
m_GenListLabelsbySheet->Enable( false );
}
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/
void DIALOG_BUILD_BOM::OnOkClick( wxCommandEvent& event )
{
char ExportSeparatorSymbol = s_ExportSeparator[0];
if( m_OutputSeparatorCtrl->GetSelection() > 0 )
ExportSeparatorSymbol = s_ExportSeparator[m_OutputSeparatorCtrl->GetSelection()];
int ExportFileType = m_OutputFormCtrl->GetSelection();
SavePreferences();
Create_BOM_Lists( ExportFileType, m_ListSubCmpItems->GetValue(),
ExportSeparatorSymbol, m_GetListBrowser->GetValue());
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/
void DIALOG_BUILD_BOM::OnCancelClick( wxCommandEvent& event )
{
EndModal( -1 );
}
/**************************************************/
void DIALOG_BUILD_BOM::SavePreferences()
/**************************************************/
{
wxASSERT( m_Config != NULL );
// Determine current settings of "List items" and "Options" checkboxes
// (NOTE: These 6 settings are restored when the dialog box is next
// invoked, but are *not* still saved after EESchema is next shut down.)
s_ListByRef = m_ListCmpbyRefItems->GetValue();
s_ListWithSubCmponents = m_ListSubCmpItems->GetValue();
s_ListByValue = m_ListCmpbyValItems->GetValue();
s_ListHierarchicalPinByName = m_GenListLabelsbyVal->GetValue();
s_ListBySheet = m_GenListLabelsbySheet->GetValue();
s_BrowseCreatedList = m_GetListBrowser->GetValue();
// (aved in config ):
// Determine current settings of both radiobutton groups
s_OutputFormOpt = m_OutputFormCtrl->GetSelection();
s_OutputSeparatorOpt = m_OutputSeparatorCtrl->GetSelection();
if( s_OutputSeparatorOpt < 0 )
s_OutputSeparatorOpt = 0;
// Determine current settings of all "Fields to add" checkboxes
s_Add_FpField_state = m_AddFootprintField->GetValue();
s_Add_F1_state = m_AddField1->GetValue();
s_Add_F2_state = m_AddField2->GetValue();
s_Add_F3_state = m_AddField3->GetValue();
s_Add_F4_state = m_AddField4->GetValue();
s_Add_F5_state = m_AddField5->GetValue();
s_Add_F6_state = m_AddField6->GetValue();
s_Add_F7_state = m_AddField7->GetValue();
s_Add_F8_state = m_AddField8->GetValue();
s_Add_Alls_state = m_AddAllFields->GetValue();
// Now save current settings of both radiobutton groups
m_Config->Write( OPTION_BOM_FORMAT, (long) s_OutputFormOpt );
m_Config->Write( OPTION_BOM_SEPARATOR, (long) s_OutputSeparatorOpt );
m_Config->Write( OPTION_BOM_LAUNCH_BROWSER, (long) s_BrowseCreatedList );
// Now save current settings of all "Fields to add" checkboxes
long addfields = 0;
for( int ii = 0, bitmask = 1; s_AddFieldList[ii] != NULL; ii++ )
{
if( *s_AddFieldList[ii] )
addfields |= bitmask;
bitmask <<= 1;
}
m_Config->Write( OPTION_BOM_ADD_FIELD, addfields );
}
......@@ -15,13 +15,14 @@
#include "class_sch_screen.h"
#include "wxEeschemaStruct.h"
#include "dialog_SVG_print_base.h"
#include "dcsvg.h"
#include "general.h"
#include "libeditframe.h"
#include "sch_sheet_path.h"
#include "dialog_SVG_print.h"
// Keys for configuration
#define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" )
......@@ -34,58 +35,12 @@ extern BASE_SCREEN* ActiveScreen;
static bool s_Print_Frame_Ref = true;
static int s_PlotBlackAndWhite = 0;
class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base
{
private:
WinEDA_DrawFrame * m_Parent;
wxConfig* m_Config;
public:
DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent );
~DIALOG_SVG_PRINT( ) {}
private:
void OnCloseWindow( wxCloseEvent& event );
void OnInitDialog( wxInitDialogEvent& event );
void OnButtonPlotCurrentClick( wxCommandEvent& event );
void OnButtonPlotAllClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event );
void OnSetColorModeSelected( wxCommandEvent& event );
void SetPenWidth();
void PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref );
public:
static bool DrawSVGPage( WinEDA_DrawFrame * frame,
const wxString& FullFileName, BASE_SCREEN* screen,
bool aPrintBlackAndWhite = false,
bool aPrint_Sheet_Ref = false);
};
/* Prepare the data structures of print management and display the dialog
* window for printing sheets.
*/
void WinEDA_DrawFrame::SVG_Print( wxCommandEvent& event )
{
DIALOG_SVG_PRINT frame( this );
frame.ShowModal();
}
/* Creates the SVG print file for the current edited component.
*/
void WinEDA_LibeditFrame::SVG_Print_Component( const wxString& FullFileName )
{
DIALOG_SVG_PRINT::DrawSVGPage( this, FullFileName, GetScreen() );
}
/*!
* DIALOG_SVG_PRINT functions
*/
DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent )
: DIALOG_SVG_PRINT_base( parent )
DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent ) :
DIALOG_SVG_PRINT_base( parent )
{
m_Parent = parent;
m_Config = wxGetApp().m_EDA_Config;
......@@ -101,16 +56,17 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event )
m_Config->Read( PLOTSVGMODECOLOR_KEY, &s_PlotBlackAndWhite );
}
m_ModeColorOption->SetSelection(s_PlotBlackAndWhite);
m_ModeColorOption->SetSelection( s_PlotBlackAndWhite );
AddUnitSymbol(* m_TextPenWidth, g_UserUnit );
AddUnitSymbol( *m_TextPenWidth, g_UserUnit );
m_DialogPenWidth->SetValue(
ReturnStringFromValue(g_UserUnit, g_DrawDefaultLineThickness,
ReturnStringFromValue( g_UserUnit, g_DrawDefaultLineThickness,
m_Parent->m_InternalUnits ) );
m_Print_Sheet_Ref->SetValue( s_Print_Frame_Ref );
if (GetSizer())
if( GetSizer() )
{
GetSizer()->SetSizeHints(this);
GetSizer()->SetSizeHints( this );
}
}
......@@ -152,7 +108,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
if( aPrintAll && m_Parent->m_Ident == SCHEMATIC_FRAME )
{
WinEDA_SchematicFrame* schframe = (WinEDA_SchematicFrame*) m_Parent;
SCH_SHEET_PATH* sheetpath, *oldsheetpath = schframe->GetSheet();
SCH_SHEET_PATH* sheetpath, * oldsheetpath = schframe->GetSheet();
SCH_SCREEN* schscreen = schframe->GetScreen();
oldscreen = schscreen;
SCH_SHEET_LIST SheetList( NULL );
......@@ -164,6 +120,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
if( sheetpath == NULL )
break;
list.Clear();
if( list.BuildSheetPathInfoFromSheetPathValue( sheetpath->Path() ) )
{
schframe->m_CurrentSheet = &list;
......@@ -174,9 +131,10 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
}
else // Should not happen
return;
sheetpath = SheetList.GetNext();
fn = schframe->GetUniqueFilenameForCurrentSheet( ) + wxT( ".svg" );
fn = schframe->GetUniqueFilenameForCurrentSheet() + wxT( ".svg" );
bool success = DrawSVGPage( m_Parent, fn.GetFullPath(), schscreen,
m_ModeColorOption->GetSelection() == 0 ? false : true,
......@@ -187,6 +145,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
msg += wxT( "\n" );
m_MessagesBox->AppendText( msg );
}
schframe->m_CurrentSheet = oldsheetpath;
schframe->m_CurrentSheet->UpdateAllScreenReferences();
schframe->SetSheetNumberAndCount();
......@@ -199,7 +158,7 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
fn = screen->m_FileName;
fn.SetExt( wxT( "svg" ) );
fn.MakeAbsolute( );
fn.MakeAbsolute();
bool success = DrawSVGPage( m_Parent, fn.GetFullPath(), screen,
m_ModeColorOption->GetSelection() == 0 ? false : true,
......@@ -216,11 +175,12 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
ActiveScreen = oldscreen;
}
bool DIALOG_SVG_PRINT::DrawSVGPage( WinEDA_DrawFrame * frame,
bool DIALOG_SVG_PRINT::DrawSVGPage( WinEDA_DrawFrame* frame,
const wxString& FullFileName,
BASE_SCREEN* screen,
bool aPrintBlackAndWhite,
bool aPrint_Sheet_Ref)
bool aPrint_Sheet_Ref )
{
int tmpzoom;
wxPoint tmp_startvisu;
......@@ -233,15 +193,16 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( WinEDA_DrawFrame * frame,
old_org = screen->m_DrawOrg;
screen->m_DrawOrg.x = screen->m_DrawOrg.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->ReturnPageSize(); // page size in 1/1000 inch, ie in internal units
screen->SetScalingFactor( 1.0 );
WinEDA_DrawPanel* panel = frame->DrawPanel;
SetLocaleTo_C_standard( ); // Switch the locale to standard C (needed
SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
// to print floating point numbers like 1.3)
float dpi = (float)frame->m_InternalUnits;
float dpi = (float) frame->m_InternalUnits;
wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi );
EDA_Rect tmp = panel->m_ClipBox;
......@@ -256,7 +217,7 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( WinEDA_DrawFrame * frame,
screen->m_IsPrinting = true;
frame->PrintPage( &dc, aPrint_Sheet_Ref, 1, false );
SetLocaleTo_Default( ); // revert to the current locale
SetLocaleTo_Default(); // revert to the current locale
screen->m_IsPrinting = false;
panel->m_ClipBox = tmp;
......@@ -276,6 +237,7 @@ void DIALOG_SVG_PRINT::OnButtonPlotAllClick( wxCommandEvent& event )
PrintSVGDoc( true, m_Print_Sheet_Ref->GetValue() );
}
void DIALOG_SVG_PRINT::OnButtonPlotCurrentClick( wxCommandEvent& event )
{
PrintSVGDoc( false, m_Print_Sheet_Ref->GetValue() );
......@@ -284,7 +246,7 @@ void DIALOG_SVG_PRINT::OnButtonPlotCurrentClick( wxCommandEvent& event )
void DIALOG_SVG_PRINT::OnButtonCancelClick( wxCommandEvent& event )
{
Close( );
Close();
}
......@@ -300,7 +262,7 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
/* called on radiobox color/black and white selection
*/
*/
void DIALOG_SVG_PRINT::OnSetColorModeSelected( wxCommandEvent& event )
{
s_PlotBlackAndWhite = m_ModeColorOption->GetSelection();
......
#ifndef _DIALOG_SVG_PRINT_H_
#define _DIALOG_SVG_PRINT_H_
class WinEDA_DrawFrame;
class BASE_SCREEN;
#include "dialog_SVG_print_base.h"
class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base
{
private:
WinEDA_DrawFrame* m_Parent;
wxConfig* m_Config;
public:
DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent );
~DIALOG_SVG_PRINT() {}
private:
void OnCloseWindow( wxCloseEvent& event );
void OnInitDialog( wxInitDialogEvent& event );
void OnButtonPlotCurrentClick( wxCommandEvent& event );
void OnButtonPlotAllClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event );
void OnSetColorModeSelected( wxCommandEvent& event );
void SetPenWidth();
void PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref );
public:
static bool DrawSVGPage( WinEDA_DrawFrame* frame,
const wxString& FullFileName, BASE_SCREEN* screen,
bool aPrintBlackAndWhite = false,
bool aPrint_Sheet_Ref = false );
};
#endif // _DIALOG_SVG_PRINT_H_
This diff is collapsed.
......@@ -18,7 +18,7 @@ class wxConfig;
class DIALOG_BUILD_BOM : public DIALOG_BUILD_BOM_BASE
{
private:
WinEDA_DrawFrame * m_Parent;
WinEDA_DrawFrame* m_Parent;
wxConfig* m_Config;
wxString m_ListFileName;
......@@ -29,13 +29,13 @@ private:
void SavePreferences();
void Init();
void Create_BOM_Lists(int aTypeFile,
void Create_BOM_Lists( int aTypeFile,
bool aIncludeSubComponents,
char aExportSeparatorSymbol,
bool aRunBrowser);
bool aRunBrowser );
void GenereListeOfItems(const wxString & FullFileName, bool aIncludeSubComponents );
void CreateExportList(const wxString & FullFileName, bool aIncludeSubComponents);
void GenereListeOfItems( const wxString& FullFileName, bool aIncludeSubComponents );
void CreateExportList( const wxString& FullFileName, bool aIncludeSubComponents );
/**
* Function CreateParstList
......@@ -46,23 +46,23 @@ private:
*/
void CreatePartsList( const wxString& aFullFileName, bool aIncludeSubComponents );
int PrintComponentsListByRef( FILE * f, std::vector <OBJ_CMP_TO_LIST>& aList,
int PrintComponentsListByRef( FILE* f, std::vector <OBJ_CMP_TO_LIST>& aList,
bool CompactForm, bool aIncludeSubComponents );
int PrintComponentsListByVal( FILE *f, std::vector <OBJ_CMP_TO_LIST>& aList,
bool aIncludeSubComponents);
int PrintComponentsListByVal( FILE* f, std::vector <OBJ_CMP_TO_LIST>& aList,
bool aIncludeSubComponents );
int PrintComponentsListByPart( FILE *f, std::vector <OBJ_CMP_TO_LIST>& aList,
bool aIncludeSubComponents);
int PrintComponentsListByPart( FILE* f, std::vector <OBJ_CMP_TO_LIST>& aList,
bool aIncludeSubComponents );
void PrintFieldData(FILE * f, SCH_COMPONENT * DrawLibItem, bool CompactForm = FALSE);
void PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem, bool CompactForm = FALSE );
bool IsFieldChecked(int aFieldId);
bool IsFieldChecked( int aFieldId );
public:
DIALOG_BUILD_BOM( WinEDA_DrawFrame* parent );
// ~DIALOG_BUILD_BOM() {};
};
#endif // _DIALOG_BUILD_BOM_H_
......@@ -7,8 +7,9 @@ DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM( wxWindow* parent,
{
SetTitle( itemName + wxT( " " ) + GetTitle() );
// Required under wxGTK if we want to demiss the dialog with the ESC key
// Required under wxGTK if we want to dismiss the dialog with the ESC key
SetFocus();
m_sdbSizer1OK->SetDefault();
}
......
......@@ -10,45 +10,23 @@
#include "class_drawpanel.h"
#include "general.h"
#include "protos.h"
#include "libeditframe.h"
#include "class_libentry.h"
#include "lib_text.h"
#include "dialog_bodygraphictext_properties_base.h"
#include "dialog_lib_edit_text.h"
class Dialog_BodyGraphicText_Properties : public Dialog_BodyGraphicText_Properties_base
{
private:
WinEDA_LibeditFrame * m_Parent;
LIB_TEXT* m_GraphicText;
public:
Dialog_BodyGraphicText_Properties( WinEDA_LibeditFrame* aParent,
LIB_TEXT* aGraphicText );
~Dialog_BodyGraphicText_Properties() {};
private:
void InitDialog( );
void OnOkClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
};
Dialog_BodyGraphicText_Properties::Dialog_BodyGraphicText_Properties( WinEDA_LibeditFrame* aParent,
LIB_TEXT* aGraphicText ) :
Dialog_BodyGraphicText_Properties_base( aParent )
DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT( WinEDA_LibeditFrame* aParent, LIB_TEXT* aText ) :
DIALOG_LIB_EDIT_TEXT_BASE( aParent )
{
m_Parent = aParent;
m_GraphicText = aGraphicText;
InitDialog( );
m_GraphicText = aText;
InitDialog();
}
/*****************************************************/
void Dialog_BodyGraphicText_Properties::InitDialog( )
/*****************************************************/
void DIALOG_LIB_EDIT_TEXT::InitDialog( )
{
wxString msg;
......@@ -79,15 +57,15 @@ void Dialog_BodyGraphicText_Properties::InitDialog( )
switch ( m_GraphicText->m_HJustify )
{
case GR_TEXT_HJUSTIFY_LEFT:
m_TextHJustificationOpt->SetSelection(0);
m_TextHJustificationOpt->SetSelection( 0 );
break;
case GR_TEXT_HJUSTIFY_CENTER:
m_TextHJustificationOpt->SetSelection(1);
m_TextHJustificationOpt->SetSelection( 1 );
break;
case GR_TEXT_HJUSTIFY_RIGHT:
m_TextHJustificationOpt->SetSelection(2);
m_TextHJustificationOpt->SetSelection( 2 );
break;
}
......@@ -95,15 +73,15 @@ void Dialog_BodyGraphicText_Properties::InitDialog( )
switch ( m_GraphicText->m_VJustify )
{
case GR_TEXT_VJUSTIFY_BOTTOM:
m_TextVJustificationOpt->SetSelection(0);
m_TextVJustificationOpt->SetSelection( 0 );
break;
case GR_TEXT_VJUSTIFY_CENTER:
m_TextVJustificationOpt->SetSelection(1);
m_TextVJustificationOpt->SetSelection( 1 );
break;
case GR_TEXT_VJUSTIFY_TOP:
m_TextVJustificationOpt->SetSelection(2);
m_TextVJustificationOpt->SetSelection( 2 );
break;
}
}
......@@ -128,19 +106,19 @@ void Dialog_BodyGraphicText_Properties::InitDialog( )
{
GetSizer()->SetSizeHints(this);
}
m_sdbSizer1OK->SetDefault();
}
void Dialog_BodyGraphicText_Properties::OnCancelClick( wxCommandEvent& event )
void DIALOG_LIB_EDIT_TEXT::OnCancelClick( wxCommandEvent& event )
{
event.Skip();
}
/***************************************************************************/
void Dialog_BodyGraphicText_Properties::OnOkClick( wxCommandEvent& event )
/***************************************************************************/
/* Updates the different parameters for the component being edited */
void DIALOG_LIB_EDIT_TEXT::OnOkClick( wxCommandEvent& event )
{
wxString Line;
......@@ -151,9 +129,9 @@ void Dialog_BodyGraphicText_Properties::OnOkClick( wxCommandEvent& event )
m_Parent->m_drawSpecificConvert = m_CommonConvert->GetValue() ? false : true;
m_Parent->m_drawSpecificUnit = m_CommonUnit->GetValue() ? false : true;
if ( m_GraphicText )
if( m_GraphicText )
{
if ( ! Line.IsEmpty() )
if( ! Line.IsEmpty() )
m_GraphicText->SetText( Line );
else
m_GraphicText->SetText( wxT( "[null]" ) );
......@@ -171,17 +149,17 @@ void Dialog_BodyGraphicText_Properties::OnOkClick( wxCommandEvent& event )
else
m_GraphicText->SetConvert( 0 );
if ( (m_TextShapeOpt->GetSelection() & 1 ) != 0 )
if( ( m_TextShapeOpt->GetSelection() & 1 ) != 0 )
m_GraphicText->m_Italic = true;
else
m_GraphicText->m_Italic = false;
if ( (m_TextShapeOpt->GetSelection() & 2 ) != 0 )
if( ( m_TextShapeOpt->GetSelection() & 2 ) != 0 )
m_GraphicText->m_Bold = true;
else
m_GraphicText->m_Bold = false;
switch ( m_TextHJustificationOpt->GetSelection() )
switch( m_TextHJustificationOpt->GetSelection() )
{
case 0:
m_GraphicText->m_HJustify = GR_TEXT_HJUSTIFY_LEFT;
......@@ -196,7 +174,7 @@ void Dialog_BodyGraphicText_Properties::OnOkClick( wxCommandEvent& event )
break;
}
switch ( m_TextVJustificationOpt->GetSelection() )
switch( m_TextVJustificationOpt->GetSelection() )
{
case 0:
m_GraphicText->m_VJustify = GR_TEXT_VJUSTIFY_BOTTOM;
......@@ -211,33 +189,9 @@ void Dialog_BodyGraphicText_Properties::OnOkClick( wxCommandEvent& event )
break;
}
}
Close();
if ( m_Parent->GetDrawItem() )
if( m_Parent->GetDrawItem() )
m_Parent->GetDrawItem()->DisplayInfo( m_Parent );
Close();
}
void WinEDA_LibeditFrame::EditSymbolText( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
{
if ( ( DrawItem == NULL ) || ( DrawItem->Type() != COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ) )
return;
/* Deleting old text. */
if( DC && !DrawItem->InEditMode() )
DrawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, NULL, DefaultTransform );
Dialog_BodyGraphicText_Properties * frame =
new Dialog_BodyGraphicText_Properties( this, (LIB_TEXT*) DrawItem );
frame->ShowModal();
frame->Destroy();
OnModify();
/* Display new text. */
if( DC && !DrawItem->InEditMode() )
DrawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, NULL,
DefaultTransform );
Close();
}
#ifndef _DIALOG_LIB_EDIT_TEXT_H_
#define _DIALOG_LIB_EDIT_TEXT_H_
#include "dialog_lib_edit_text_base.h"
class WinEDA_LibeditFrame;
class LIB_TEXT;
class DIALOG_LIB_EDIT_TEXT : public DIALOG_LIB_EDIT_TEXT_BASE
{
private:
WinEDA_LibeditFrame* m_Parent;
LIB_TEXT* m_GraphicText;
public:
DIALOG_LIB_EDIT_TEXT( WinEDA_LibeditFrame* aParent, LIB_TEXT* aText );
~DIALOG_LIB_EDIT_TEXT() {};
private:
void InitDialog( );
void OnOkClick( wxCommandEvent& aEvent );
void OnCancelClick( wxCommandEvent& aEvent );
};
#endif // _DIALOG_LIB_EDIT_TEXT_H_
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_bodygraphictext_properties_base.h"
#include "dialog_lib_edit_text_base.h"
///////////////////////////////////////////////////////////////////////////
Dialog_BodyGraphicText_Properties_base::Dialog_BodyGraphicText_Properties_base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
DIALOG_LIB_EDIT_TEXT_BASE::DIALOG_LIB_EDIT_TEXT_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( wxHORIZONTAL );
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bPropertiesSizer;
bPropertiesSizer = new wxBoxSizer( wxVERTICAL );
......@@ -57,21 +57,18 @@ Dialog_BodyGraphicText_Properties_base::Dialog_BodyGraphicText_Properties_base(
sOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _(" Text Options : ") ), wxVERTICAL );
m_Orient = new wxCheckBox( this, wxID_ANY, _("Vertical"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_Orient, 0, wxALL, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
sOptionsSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_CommonUnit = new wxCheckBox( this, wxID_ANY, _("Common to Units"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_CommonUnit, 0, wxALL, 5 );
m_CommonConvert = new wxCheckBox( this, wxID_ANY, _("Common to convert"), wxDefaultPosition, wxDefaultSize, 0 );
sOptionsSizer->Add( m_CommonConvert, 0, wxALL|wxEXPAND, 5 );
bBottomtBoxSizer->Add( sOptionsSizer, 0, 0, 5 );
bBottomtBoxSizer->Add( sOptionsSizer, 0, wxALL|wxEXPAND, 5 );
wxString m_TextShapeOptChoices[] = { _("Normal"), _("Italic"), _("Bold"), _("Bold Italic") };
int m_TextShapeOptNChoices = sizeof( m_TextShapeOptChoices ) / sizeof( wxString );
......@@ -98,30 +95,21 @@ Dialog_BodyGraphicText_Properties_base::Dialog_BodyGraphicText_Properties_base(
bPropertiesSizer->Add( bRightSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bPropertiesSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bButtonsBoxSizer;
bButtonsBoxSizer = new wxBoxSizer( wxVERTICAL );
bMainSizer->Add( bPropertiesSizer, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 6 );
m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsBoxSizer->Add( m_buttonOK, 0, wxALL, 5 );
m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsBoxSizer->Add( m_buttonCANCEL, 0, wxALL, 5 );
bMainSizer->Add( bButtonsBoxSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 12 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnOkClick ), NULL, this );
m_buttonCANCEL->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnCancelClick ), NULL, this );
bMainSizer->Fit( this );
}
Dialog_BodyGraphicText_Properties_base::~Dialog_BodyGraphicText_Properties_base()
DIALOG_LIB_EDIT_TEXT_BASE::~DIALOG_LIB_EDIT_TEXT_BASE()
{
// Disconnect Events
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnOkClick ), NULL, this );
m_buttonCANCEL->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Dialog_BodyGraphicText_Properties_base::OnCancelClick ), NULL, this );
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_bodygraphictext_properties_base__
#define __dialog_bodygraphictext_properties_base__
#ifndef __dialog_lib_edit_text_base__
#define __dialog_lib_edit_text_base__
#include <wx/intl.h>
......@@ -28,9 +28,9 @@
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class Dialog_BodyGraphicText_Properties_base
/// Class DIALOG_LIB_EDIT_TEXT_BASE
///////////////////////////////////////////////////////////////////////////////
class Dialog_BodyGraphicText_Properties_base : public wxDialog
class DIALOG_LIB_EDIT_TEXT_BASE : public wxDialog
{
private:
......@@ -46,18 +46,15 @@ class Dialog_BodyGraphicText_Properties_base : public wxDialog
wxRadioBox* m_TextShapeOpt;
wxRadioBox* m_TextHJustificationOpt;
wxRadioBox* m_TextVJustificationOpt;
wxButton* m_buttonOK;
wxButton* m_buttonCANCEL;
// Virtual event handlers, overide them in your derived class
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
public:
Dialog_BodyGraphicText_Properties_base( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Graphic text properties:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 511,193 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~Dialog_BodyGraphicText_Properties_base();
DIALOG_LIB_EDIT_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Library Text Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_LIB_EDIT_TEXT_BASE();
};
#endif //__dialog_bodygraphictext_properties_base__
#endif //__dialog_lib_edit_text_base__
......@@ -26,6 +26,9 @@
#include "kicad_device_context.h"
#include "hotkeys.h"
#include "dialogs/dialog_lib_edit_text.h"
#include "dialogs/dialog_SVG_print.h"
#include <boost/foreach.hpp>
......@@ -990,3 +993,33 @@ void WinEDA_LibeditFrame::ClearTempCopyComponent()
delete m_tempCopyComponent;
m_tempCopyComponent = NULL;
}
/* Creates the SVG print file for the current edited component.
*/
void WinEDA_LibeditFrame::SVG_Print_Component( const wxString& FullFileName )
{
DIALOG_SVG_PRINT::DrawSVGPage( this, FullFileName, GetScreen() );
}
void WinEDA_LibeditFrame::EditSymbolText( wxDC* DC, LIB_DRAW_ITEM* DrawItem )
{
if ( ( DrawItem == NULL ) || ( DrawItem->Type() != COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ) )
return;
/* Deleting old text. */
if( DC && !DrawItem->InEditMode() )
DrawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, g_XorMode, NULL, DefaultTransform );
DIALOG_LIB_EDIT_TEXT* frame = new DIALOG_LIB_EDIT_TEXT( this, (LIB_TEXT*) DrawItem );
frame->ShowModal();
frame->Destroy();
OnModify();
/* Display new text. */
if( DC && !DrawItem->InEditMode() )
DrawItem->Draw( DrawPanel, DC, wxPoint( 0, 0 ), -1, GR_DEFAULT_DRAWMODE, NULL,
DefaultTransform );
}
......@@ -16,8 +16,7 @@ class CMP_LIBRARY;
class LIB_COMPONENT;
class LIB_ALIAS;
class LIB_FIELD;
class WinEDA_bodygraphics_PropertiesFrame;
class Dialog_BodyGraphicText_Properties;
class DIALOG_LIB_EDIT_TEXT;
/**
......@@ -317,7 +316,7 @@ protected:
static wxSize m_clientSize;
friend class Dialog_BodyGraphicText_Properties;
friend class DIALOG_LIB_EDIT_TEXT;
/**
* Function CreatePNGorJPEGFile
......@@ -342,7 +341,7 @@ protected:
bool aPrintMirrorMode, void* aData = NULL );
/**
* Function SVG_Print_component
* Function SVG_Print_Component
* Creates the SVG print file for the current edited component.
* @param aFullFileName = the full filename of the file
*/
......
......@@ -4,6 +4,7 @@
#include "block_commande.h"
#include "colors.h"
#include "sch_sheet_path.h"
#include <wx/wx.h>
......@@ -24,6 +25,8 @@ class SCH_SHEET_PIN;
class PLOTTER;
class SCH_SHEET;
class LIB_PIN;
class LABEL_OBJECT;
class OBJ_CMP_TO_LIST;
wxString ReturnDefaultFieldName( int aFieldNdx );
......@@ -62,6 +65,40 @@ bool LibItemInBox( int x1, int y1, int x2, int y2, SCH_COMPONENT* Draw
/************/
void DeleteStruct( WinEDA_DrawPanel* panel, wxDC* DC, SCH_ITEM* DrawStruct );
// build_BOM.cpp
/**
* Class LABEL_OBJECT
* is used in build BOM to handle the list of labels in schematic
* because in a complex hierarchy, a label is used more than once,
* and had more than one sheet path, so we must create a flat list of labels
*/
class LABEL_OBJECT
{
public:
int m_LabelType;
SCH_ITEM* m_Label;
//have to store it here since the object references will be duplicated.
SCH_SHEET_PATH m_SheetPath; //composed of UIDs
public: LABEL_OBJECT()
{
m_Label = NULL;
m_LabelType = 0;
}
};
void BuildComponentsListFromSchematic( std::vector <OBJ_CMP_TO_LIST>& aList );
void GenListeGLabels( std::vector <LABEL_OBJECT>& aList );
bool SortComponentsByReference( const OBJ_CMP_TO_LIST& obj1, const OBJ_CMP_TO_LIST& obj2 );
bool SortComponentsByValue( const OBJ_CMP_TO_LIST& obj1, const OBJ_CMP_TO_LIST& obj2 );
bool SortLabelsByValue( const LABEL_OBJECT& obj1, const LABEL_OBJECT& obj2 );
bool SortLabelsBySheet( const LABEL_OBJECT& obj1, const LABEL_OBJECT& obj2 );
void DeleteSubCmp( std::vector <OBJ_CMP_TO_LIST>& aList );
int PrintListeGLabel( FILE* f, std::vector <LABEL_OBJECT>& aList );
// operations_on_item_lists.cpp
/**
* Function DuplicateStruct
......
......@@ -22,7 +22,6 @@
#include "wxEeschemaStruct.h"
#include "class_sch_screen.h"
#include "dialog_build_BOM.h"
#include "netlist_control.h"
#include "libeditframe.h"
#include "viewlib_frame.h"
......@@ -31,9 +30,11 @@
#include "sch_sheet.h"
#include "dialogs/annotate_dialog.h"
#include "dialogs/dialog_build_BOM.h"
#include "dialogs/dialog_erc.h"
#include "dialogs/dialog_print_using_printer.h"
#include "dialogs/dialog_schematic_find.h"
#include "dialogs/dialog_SVG_print.h"
BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
......@@ -58,7 +59,7 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
EVT_MENU( wxID_PRINT, WinEDA_SchematicFrame::OnPrint )
EVT_MENU( ID_GEN_PLOT_PS, WinEDA_SchematicFrame::ToPlot_PS )
EVT_MENU( ID_GEN_PLOT_HPGL, WinEDA_SchematicFrame::ToPlot_HPGL )
EVT_MENU( ID_GEN_PLOT_SVG, WinEDA_DrawFrame::SVG_Print )
EVT_MENU( ID_GEN_PLOT_SVG, WinEDA_SchematicFrame::SVG_Print )
EVT_MENU( ID_GEN_PLOT_DXF, WinEDA_SchematicFrame::ToPlot_DXF )
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
EVT_MENU( ID_GEN_COPY_BLOCK_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
......@@ -782,3 +783,13 @@ void WinEDA_SchematicFrame::OnPrint( wxCommandEvent& event )
wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() );
}
}
/* Creates the SVG print file for the current edited component.
*/
void WinEDA_SchematicFrame::SVG_Print( wxCommandEvent& event )
{
DIALOG_SVG_PRINT frame( this );
frame.ShowModal();
}
......@@ -14,13 +14,14 @@
#include "general.h"
#include "libeditframe.h"
#include "class_libentry.h"
#include "dialog_lib_edit_draw_item.h"
#include "lib_arc.h"
#include "lib_circle.h"
#include "lib_polyline.h"
#include "lib_rectangle.h"
#include "lib_text.h"
#include "dialogs/dialog_lib_edit_draw_item.h"
static void SymbolDisplayDraw( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
static void RedrawWhileMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase );
......
......@@ -345,6 +345,7 @@ public:
void SetPrintMonochrome( bool aMonochrome ) { m_printMonochrome = aMonochrome; }
bool GetShowSheetReference() { return m_showSheetReference; }
void SetShowSheetReference( bool aShow ) { m_showSheetReference = aShow; }
void SVG_Print( wxCommandEvent& event );
// Plot functions:
void ToPlot_PS( wxCommandEvent& event );
......
......@@ -154,7 +154,10 @@ public:
*/
void ToPrinter( wxCommandEvent& event );
/** Virtual function PrintPage
void SVG_Print( wxCommandEvent& event );
/**
* Function PrintPage , virtual
* used to print a page
* Print the page pointed by ActiveScreen, set by the calling print function
* @param aDC = wxDC given by the calling print function
......
......@@ -392,8 +392,6 @@ public:
/* Return the current zoom level */
int GetZoom( void );
void SVG_Print( wxCommandEvent& event );
void TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_width );
void PlotWorkSheet( PLOTTER *plotter, BASE_SCREEN* screen );
......
......@@ -12,14 +12,15 @@
#include "confirm.h"
#include "gestfich.h"
#include "dialog_SVG_print_base.h"
#include "dcsvg.h"
#include "pcbnew.h"
#include "pcbplot.h"
#include "printout_controler.h"
#include "dialog_SVG_print.h"
// Keys for configuration
#define PLOTSVGMODECOLOR_KEY wxT( "PlotSVGModeColor" )
......@@ -34,42 +35,6 @@ static PRINT_PARAMETERS s_Parameters;
static long s_SelectedLayers = LAYER_BACK | LAYER_FRONT |
SILKSCREEN_LAYER_FRONT | SILKSCREEN_LAYER_BACK;
class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base
{
private:
WinEDA_BasePcbFrame* m_Parent;
wxConfig* m_Config;
long m_PrintMaskLayer;
wxCheckBox* m_BoxSelectLayer[32];
public:
DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent );
~DIALOG_SVG_PRINT() {}
private:
void OnCloseWindow( wxCloseEvent& event );
void initDialog( );
void OnButtonPrintSelectedClick( wxCommandEvent& event );
void OnButtonPrintBoardClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event );
void OnSetColorModeSelected( wxCommandEvent& event );
void SetPenWidth();
void PrintSVGDoc( bool aPrintAll, bool aPrint_Frame_Ref );
bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen,
bool aPrint_Frame_Ref );
};
/* Prepare the data structures of print management
* And displays the dialog window management of printing sheets
*/
void WinEDA_DrawFrame::SVG_Print( wxCommandEvent& event )
{
DIALOG_SVG_PRINT frame( this );
frame.ShowModal();
}
/*!
* DIALOG_SVG_PRINT functions
......
#ifndef _DIALOG_SVG_PRINT_H_
#define _DIALOG_SVG_PRINT_H_
#include "dialog_SVG_print_base.h"
class BASE_SCREEN;
class WinEDA_BasePcbFrame;
class wxConfig;
class DIALOG_SVG_PRINT : public DIALOG_SVG_PRINT_base
{
private:
WinEDA_BasePcbFrame* m_Parent;
wxConfig* m_Config;
long m_PrintMaskLayer;
wxCheckBox* m_BoxSelectLayer[32];
public:
DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent );
~DIALOG_SVG_PRINT() {}
private:
void OnCloseWindow( wxCloseEvent& event );
void initDialog( );
void OnButtonPrintSelectedClick( wxCommandEvent& event );
void OnButtonPrintBoardClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event );
void OnSetColorModeSelected( wxCommandEvent& event );
void SetPenWidth();
void PrintSVGDoc( bool aPrintAll, bool aPrint_Frame_Ref );
bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Frame_Ref );
};
#endif // _DIALOG_SVG_PRINT_H_
......@@ -49,6 +49,7 @@
#include "hotkeys.h"
#include "pcbnew_config.h"
#include "module_editor_frame.h"
#include "dialog_SVG_print.h"
extern int g_DrawDefaultLineThickness;
......@@ -168,7 +169,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_TOOL( wxID_UNDO, WinEDA_PcbFrame::GetBoardFromUndoList )
EVT_TOOL( wxID_REDO, WinEDA_PcbFrame::GetBoardFromRedoList )
EVT_TOOL( wxID_PRINT, WinEDA_PcbFrame::ToPrinter )
EVT_TOOL( ID_GEN_PLOT_SVG, WinEDA_DrawFrame::SVG_Print )
EVT_TOOL( ID_GEN_PLOT_SVG, WinEDA_PcbFrame::SVG_Print )
EVT_TOOL( ID_GEN_PLOT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_FIND_ITEMS, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_GET_NETLIST, WinEDA_PcbFrame::Process_Special_Functions )
......@@ -721,3 +722,13 @@ void WinEDA_PcbFrame::OnModify( )
m_Draw3DFrame->ReloadRequest( );
}
/* Prepare the data structures of print management
* And displays the dialog window management of printing sheets
*/
void WinEDA_PcbFrame::SVG_Print( wxCommandEvent& event )
{
DIALOG_SVG_PRINT frame( this );
frame.ShowModal();
}
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