Commit 72357970 authored by charras's avatar charras

Netlist dialog redesigned, netlist.cpp code modified

parent 154be142
...@@ -5,6 +5,14 @@ Started 2007-June-11 ...@@ -5,6 +5,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-Mar-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew
Netlist dialog redesigned, netlist.cpp code modified
and added an option to remove not locked footprints
when not found in netlist
2008-Mar-21 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Mar-21 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+pcbnew +pcbnew
......
...@@ -298,7 +298,9 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component ) ...@@ -298,7 +298,9 @@ void AddMenusForComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
if( !Component->m_Flags ) if( !Component->m_Flags )
{ {
msg = AddHotkeyName( _( "Move Component" ), s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT ); msg = _( "Move Component" );
msg << wxT(" ") << Component->GetFieldValue( REFERENCE );
msg = AddHotkeyName( msg, s_Schematic_Hokeys_Descr, HK_MOVE_COMPONENT );
ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_CMP_REQUEST, ADD_MENUITEM( PopMenu, ID_POPUP_SCH_MOVE_CMP_REQUEST,
msg, move_xpm ); msg, move_xpm );
msg = AddHotkeyName( _( "Drag Component" ), s_Schematic_Hokeys_Descr, HK_DRAG_COMPONENT ); msg = AddHotkeyName( _( "Drag Component" ), s_Schematic_Hokeys_Descr, HK_DRAG_COMPONENT );
......
...@@ -441,7 +441,7 @@ public: ...@@ -441,7 +441,7 @@ public:
// Footprint edition (see also WinEDA_BasePcbFrame) // Footprint edition (see also WinEDA_BasePcbFrame)
void StartMove_Module( MODULE* module, wxDC* DC ); void StartMove_Module( MODULE* module, wxDC* DC );
bool Delete_Module( MODULE* module, wxDC* DC ); bool Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDeleting );
// loading modules: see WinEDA_BasePcbFrame // loading modules: see WinEDA_BasePcbFrame
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_netlist.h // Name: dialog_netlist.h
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
...@@ -14,7 +15,6 @@ ...@@ -14,7 +15,6 @@
#ifndef _DIALOG_NETLIST_H_ #ifndef _DIALOG_NETLIST_H_
#define _DIALOG_NETLIST_H_ #define _DIALOG_NETLIST_H_
/*! /*!
* Includes * Includes
*/ */
...@@ -38,18 +38,20 @@ class wxStdDialogButtonSizer; ...@@ -38,18 +38,20 @@ class wxStdDialogButtonSizer;
////@begin control identifiers ////@begin control identifiers
#define ID_DIALOG 10000 #define ID_DIALOG 10000
#define ID_RADIOBOX 10005 #define ID_SELECTION_FOOTPRINT_MODE 10005
#define ID_RADIOBOX1 10006 #define ID_KEEP_OR_CHANGE_FOOTPRINTS 10007
#define ID_RADIOBOX2 10007 #define ID_DELETE_TRACKS_OPTION 10006
#define ID_CHECKBOX 10008 #define ID_DISPLAY_WARNINGS_OPT 10008
#define ID_REMOVE_EXTRA_FOOTPRINTS_OPT 10011
#define ID_OPEN_NELIST 10001 #define ID_OPEN_NELIST 10001
#define ID_READ_NETLIST_FILE 10002 #define ID_READ_NETLIST_FILE 10002
#define ID_TEST_NETLIST 10003 #define ID_TEST_NETLIST 10003
#define ID_COMPILE_RATSNEST 10004 #define ID_COMPILE_RATSNEST 10004
#define ID_TEXT_NETLIST_FILENAME 10012
#define ID_TEXTCTRL 10009 #define ID_TEXTCTRL 10009
#define ID_STATICLINE 10010 #define ID_STATICLINE 10010
#define SYMBOL_WINEDA_NETLISTFRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER #define SYMBOL_WINEDA_NETLISTFRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
#define SYMBOL_WINEDA_NETLISTFRAME_TITLE _("Netlist: ") #define SYMBOL_WINEDA_NETLISTFRAME_TITLE _("Netlist Dialog")
#define SYMBOL_WINEDA_NETLISTFRAME_IDNAME ID_DIALOG #define SYMBOL_WINEDA_NETLISTFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_NETLISTFRAME_SIZE wxSize(400, 300) #define SYMBOL_WINEDA_NETLISTFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_NETLISTFRAME_POSITION wxDefaultPosition #define SYMBOL_WINEDA_NETLISTFRAME_POSITION wxDefaultPosition
...@@ -63,6 +65,7 @@ class wxStdDialogButtonSizer; ...@@ -63,6 +65,7 @@ class wxStdDialogButtonSizer;
#define wxCLOSE_BOX 0x1000 #define wxCLOSE_BOX 0x1000
#endif #endif
/*! /*!
* WinEDA_NetlistFrame class declaration * WinEDA_NetlistFrame class declaration
*/ */
...@@ -74,13 +77,21 @@ class WinEDA_NetlistFrame: public wxDialog ...@@ -74,13 +77,21 @@ class WinEDA_NetlistFrame: public wxDialog
public: public:
/// Constructors /// Constructors
WinEDA_NetlistFrame( ); WinEDA_NetlistFrame();
WinEDA_NetlistFrame( WinEDA_PcbFrame* parent,wxDC * DC, WinEDA_NetlistFrame(WinEDA_PcbFrame* parent,
wxDC* DC,
const wxString& aNetlistFilename,
wxWindowID id = SYMBOL_WINEDA_NETLISTFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_NETLISTFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_NETLISTFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_NETLISTFRAME_SIZE, long style = SYMBOL_WINEDA_NETLISTFRAME_STYLE ); wxWindowID id = SYMBOL_WINEDA_NETLISTFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_NETLISTFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_NETLISTFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_NETLISTFRAME_SIZE, long style = SYMBOL_WINEDA_NETLISTFRAME_STYLE );
/// Creation /// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_NETLISTFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_NETLISTFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_NETLISTFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_NETLISTFRAME_SIZE, long style = SYMBOL_WINEDA_NETLISTFRAME_STYLE ); bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_NETLISTFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_NETLISTFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_NETLISTFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_NETLISTFRAME_SIZE, long style = SYMBOL_WINEDA_NETLISTFRAME_STYLE );
/// Destructor
~WinEDA_NetlistFrame();
/// Initialises member variables
void Init();
/// Creates the controls and sizers /// Creates the controls and sizers
void CreateControls(); void CreateControls();
...@@ -115,31 +126,20 @@ public: ...@@ -115,31 +126,20 @@ public:
/// Should we show tooltips? /// Should we show tooltips?
static bool ShowToolTips(); static bool ShowToolTips();
void ReadPcbNetlist(wxCommandEvent& event);
void Set_NetlisteName(wxCommandEvent& event);
bool OpenNetlistFile(wxCommandEvent& event);
int BuildListeNetModules(wxCommandEvent& event, wxArrayString & BufName);
void ModulesControle(wxCommandEvent& event);
int ReadListeModules(const wxString * RefCmp, long TimeStamp, wxString & NameModule);
int SetPadNetName( char * Line, MODULE * Module);
MODULE * ReadNetModule( char * Text, int * UseFichCmp, int TstOnly);
void AddToList(const wxString & NameLibCmp,
const wxString & NameCmp,
int TimeStamp,
const wxString& path);
void LoadListeModules(wxDC *DC);
////@begin WinEDA_NetlistFrame member variables ////@begin WinEDA_NetlistFrame member variables
wxRadioBox* m_Select_By_Timestamp; wxRadioBox* m_Select_By_Timestamp;
wxRadioBox* m_ChangeExistingFootprintCtrl;
wxRadioBox* m_DeleteBadTracks; wxRadioBox* m_DeleteBadTracks;
wxRadioBox* m_ChangeExistantModuleCtrl;
wxCheckBox* m_DisplayWarningCtrl; wxCheckBox* m_DisplayWarningCtrl;
wxCheckBox* m_RemoveExtraFootprintsCtrl;
wxTextCtrl* m_NetlistFilenameCtrl;
wxTextCtrl* m_MessageWindow; wxTextCtrl* m_MessageWindow;
wxStdDialogButtonSizer* StdDialogButtonSizer; wxStdDialogButtonSizer* StdDialogButtonSizer;
////@end WinEDA_NetlistFrame member variables ////@end WinEDA_NetlistFrame member variables
WinEDA_PcbFrame * m_Parent; WinEDA_PcbFrame* m_Parent;
wxDC * m_DC; wxDC* m_DC;
}; };
#endif #endif
// _DIALOG_NETLIST_H_
// _DIALOG_NETLIST_H_
This diff is collapsed.
...@@ -592,7 +592,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -592,7 +592,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
if( !GetCurItem() || GetCurItem()->Type() != TYPEMODULE ) if( !GetCurItem() || GetCurItem()->Type() != TYPEMODULE )
break; break;
if( Delete_Module( (MODULE*) GetCurItem(), &dc ) ) if( Delete_Module( (MODULE*) GetCurItem(), &dc, true ) )
{ {
SetCurItem( NULL ); SetCurItem( NULL );
} }
...@@ -1023,7 +1023,7 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC ) ...@@ -1023,7 +1023,7 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
switch( Item->Type() ) switch( Item->Type() )
{ {
case TYPEMODULE: case TYPEMODULE:
Delete_Module( (MODULE*) Item, DC ); Delete_Module( (MODULE*) Item, DC, true );
break; break;
case TYPECOTATION: case TYPECOTATION:
......
...@@ -263,9 +263,9 @@ void Montre_Position_Empreinte( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ) ...@@ -263,9 +263,9 @@ void Montre_Position_Empreinte( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
} }
/**************************************************************/ /*****************************************************************************************/
bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC ) bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDeleting )
/**************************************************************/ /******************************************************************************************/
/** /**
* Function Delete Module * Function Delete Module
...@@ -273,6 +273,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC ) ...@@ -273,6 +273,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC )
* The net rastenes and pad list are recalcualed * The net rastenes and pad list are recalcualed
* @param module = footprint to delete * @param module = footprint to delete
* @param DC = currentDevice Context. if NULL: do not redraw new ratsnets and dirty rectange * @param DC = currentDevice Context. if NULL: do not redraw new ratsnets and dirty rectange
* @param aPromptBeforeDeleting : if true: ask for confirmation before deleting
*/ */
{ {
EDA_BaseStruct* PtBack, * PtNext; EDA_BaseStruct* PtBack, * PtNext;
...@@ -285,6 +286,8 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC ) ...@@ -285,6 +286,8 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC )
/* Confirmation de l'effacement */ /* Confirmation de l'effacement */
module->Display_Infos( this ); module->Display_Infos( this );
if ( aAskBeforeDeleting )
{
msg << _( "Delete Module" ) << wxT( " " ) << module->m_Reference->m_Text msg << _( "Delete Module" ) << wxT( " " ) << module->m_Reference->m_Text
<< wxT( " (" ) << _( "Value " ) << module->m_Value->m_Text << wxT( " (" ) << _( "Value " ) << module->m_Value->m_Text
<< wxT( ") ?" ); << wxT( ") ?" );
...@@ -292,6 +295,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC ) ...@@ -292,6 +295,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC )
{ {
return FALSE; return FALSE;
} }
}
m_CurrentScreen->SetModify(); m_CurrentScreen->SetModify();
......
This diff is collapsed.
...@@ -169,8 +169,7 @@ eda_global wxString g_SaveFileName // File Name for periodic saving ...@@ -169,8 +169,7 @@ eda_global wxString g_SaveFileName // File Name for periodic saving
( wxT( "$savepcb" ) ) ( wxT( "$savepcb" ) )
#endif #endif
; ;
eda_global wxString NetNameBuffer; // Netlist file extension eda_global wxString NetExtBuffer // Netlist file extension
eda_global wxString NetExtBuffer
#ifdef MAIN #ifdef MAIN
( wxT( ".net" ) ) ( wxT( ".net" ) )
#endif #endif
......
...@@ -389,7 +389,7 @@ static int gen_rats_pad_to_pad( WinEDA_DrawPanel* DrawPanel, wxDC* DC, ...@@ -389,7 +389,7 @@ static int gen_rats_pad_to_pad( WinEDA_DrawPanel* DrawPanel, wxDC* DC,
g_pt_chevelu->pad_start = ref_pad; g_pt_chevelu->pad_start = ref_pad;
g_pt_chevelu->pad_end = pad; g_pt_chevelu->pad_end = pad;
if( DisplayRastnestInProgress ) if( DisplayRastnestInProgress && DC )
{ {
GRLine( &DrawPanel->m_ClipBox, DC, g_pt_chevelu->pad_start->m_Pos.x, GRLine( &DrawPanel->m_ClipBox, DC, g_pt_chevelu->pad_start->m_Pos.x,
g_pt_chevelu->pad_start->m_Pos.y, g_pt_chevelu->pad_start->m_Pos.y,
...@@ -566,7 +566,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC ) ...@@ -566,7 +566,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
// erase the ratsnest displayed on screen if needed // erase the ratsnest displayed on screen if needed
CHEVELU* Chevelu = (CHEVELU*) m_Pcb->m_Ratsnest; CHEVELU* Chevelu = (CHEVELU*) m_Pcb->m_Ratsnest;
GRSetDrawMode( DC, GR_XOR ); if ( DC ) GRSetDrawMode( DC, GR_XOR );
for( ii = m_Pcb->GetNumRatsnests(); ii > 0; ii--, Chevelu++ ) for( ii = m_Pcb->GetNumRatsnests(); ii > 0; ii--, Chevelu++ )
{ {
...@@ -1302,6 +1302,8 @@ void WinEDA_BasePcbFrame::trace_ratsnest_module( wxDC* DC ) ...@@ -1302,6 +1302,8 @@ void WinEDA_BasePcbFrame::trace_ratsnest_module( wxDC* DC )
CHEVELU* local_chevelu; CHEVELU* local_chevelu;
int ii; int ii;
if ( DC == NULL )
return;
if( (m_Pcb->m_Status_Pcb & CHEVELU_LOCAL_OK) == 0 ) if( (m_Pcb->m_Status_Pcb & CHEVELU_LOCAL_OK) == 0 )
return; return;
...@@ -1479,6 +1481,9 @@ void WinEDA_BasePcbFrame::trace_ratsnest_pad( wxDC* DC ) ...@@ -1479,6 +1481,9 @@ void WinEDA_BasePcbFrame::trace_ratsnest_pad( wxDC* DC )
int ii; int ii;
int refX, refY; int refX, refY;
if ( DC == NULL )
return;
if( (m_Pcb->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 ) if( (m_Pcb->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 )
return; return;
......
...@@ -211,10 +211,7 @@ int WinEDA_ExchangeModuleFrame::Maj_ListeCmp( ...@@ -211,10 +211,7 @@ int WinEDA_ExchangeModuleFrame::Maj_ListeCmp(
return 0; /* pas de changement de nom */ return 0; /* pas de changement de nom */
/* Calcul nom fichier CMP par changement de l'extension du nom netliste */ /* Calcul nom fichier CMP par changement de l'extension du nom netliste */
if( NetNameBuffer == wxEmptyString )
FileNameCmp = m_Parent->m_CurrentScreen->m_FileName; FileNameCmp = m_Parent->m_CurrentScreen->m_FileName;
else
FileNameCmp = NetNameBuffer;
ChangeFileNameExt( FileNameCmp, NetCmpExtBuffer ); ChangeFileNameExt( FileNameCmp, NetCmpExtBuffer );
// Modification du fichier .cmp correcpondant // Modification du fichier .cmp correcpondant
...@@ -617,10 +614,7 @@ bool WinEDA_PcbFrame::RecreateCmpFileFromBoard() ...@@ -617,10 +614,7 @@ bool WinEDA_PcbFrame::RecreateCmpFileFromBoard()
} }
/* Calcul nom fichier CMP par changement de l'extension du nom netliste */ /* Calcul nom fichier CMP par changement de l'extension du nom netliste */
if( NetNameBuffer == wxEmptyString )
FullFileNameCmp = m_CurrentScreen->m_FileName; FullFileNameCmp = m_CurrentScreen->m_FileName;
else
FullFileNameCmp = NetNameBuffer;
ChangeFileNameExt( FullFileNameCmp, NetCmpExtBuffer ); ChangeFileNameExt( FullFileNameCmp, NetCmpExtBuffer );
mask = wxT( "*" ) + NetCmpExtBuffer; mask = wxT( "*" ) + NetCmpExtBuffer;
......
...@@ -42,7 +42,7 @@ BEGIN_EVENT_TABLE( WinEDA_PrintFrame, wxDialog ) ...@@ -42,7 +42,7 @@ BEGIN_EVENT_TABLE( WinEDA_PrintFrame, wxDialog )
EVT_BUTTON( ID_PRINT_EXECUTE, WinEDA_PrintFrame::OnPrintExecuteClick ) EVT_BUTTON( ID_PRINT_EXECUTE, WinEDA_PrintFrame::OnPrintExecuteClick )
EVT_BUTTON( wxID_CLOSE, WinEDA_PrintFrame::OnCloseClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_PrintFrame::OnCancelClick )
////@end WinEDA_PrintFrame event table entries ////@end WinEDA_PrintFrame event table entries
...@@ -91,10 +91,11 @@ bool WinEDA_PrintFrame::Create( wxWindow* parent, wxWindowID id, const wxString& ...@@ -91,10 +91,11 @@ bool WinEDA_PrintFrame::Create( wxWindow* parent, wxWindowID id, const wxString&
m_ColorOption = NULL; m_ColorOption = NULL;
m_PagesOptionPcb = NULL; m_PagesOptionPcb = NULL;
m_PagesOptionEeschema = NULL; m_PagesOptionEeschema = NULL;
m_CloseButton = NULL;
////@end WinEDA_PrintFrame member initialisation ////@end WinEDA_PrintFrame member initialisation
////@begin WinEDA_PrintFrame creation ////@begin WinEDA_PrintFrame creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style ); wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls(); CreateControls();
...@@ -116,7 +117,7 @@ void WinEDA_PrintFrame::CreateControls() ...@@ -116,7 +117,7 @@ void WinEDA_PrintFrame::CreateControls()
SetFont(*g_DialogFont); SetFont(*g_DialogFont);
////@begin WinEDA_PrintFrame content construction ////@begin WinEDA_PrintFrame content construction
// Generated by DialogBlocks, 24/01/2007 16:36:31 (unregistered) // Generated by DialogBlocks, 22/03/2008 08:33:38 (unregistered)
WinEDA_PrintFrame* itemDialog1 = this; WinEDA_PrintFrame* itemDialog1 = this;
...@@ -132,18 +133,17 @@ void WinEDA_PrintFrame::CreateControls() ...@@ -132,18 +133,17 @@ void WinEDA_PrintFrame::CreateControls()
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer5, 0, wxGROW|wxALL, 5); itemBoxSizer2->Add(itemBoxSizer5, 0, wxGROW|wxALL, 5);
wxString m_ScaleOptionStrings[] = { wxArrayString m_ScaleOptionStrings;
_("fit in page"), m_ScaleOptionStrings.Add(_("fit in page"));
_("Scale 0.5"), m_ScaleOptionStrings.Add(_("Scale 0.5"));
_("Scale 0.7"), m_ScaleOptionStrings.Add(_("Scale 0.7"));
_("Approx. Scale 1"), m_ScaleOptionStrings.Add(_("Approx. Scale 1"));
_("Accurate Scale 1"), m_ScaleOptionStrings.Add(_("Accurate Scale 1"));
_("Scale 1.4"), m_ScaleOptionStrings.Add(_("Scale 1.4"));
_("Scale 2"), m_ScaleOptionStrings.Add(_("Scale 2"));
_("Scale 3"), m_ScaleOptionStrings.Add(_("Scale 3"));
_("Scale 4") m_ScaleOptionStrings.Add(_("Scale 4"));
}; m_ScaleOption = new wxRadioBox( itemDialog1, ID_SET_PRINT_SCALE, _("Approx. Scale:"), wxDefaultPosition, wxDefaultSize, m_ScaleOptionStrings, 1, wxRA_SPECIFY_COLS );
m_ScaleOption = new wxRadioBox( itemDialog1, ID_SET_PRINT_SCALE, _("Approx. Scale:"), wxDefaultPosition, wxDefaultSize, 9, m_ScaleOptionStrings, 1, wxRA_SPECIFY_COLS );
m_ScaleOption->SetSelection(0); m_ScaleOption->SetSelection(0);
itemBoxSizer5->Add(m_ScaleOption, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); itemBoxSizer5->Add(m_ScaleOption, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
...@@ -179,27 +179,24 @@ void WinEDA_PrintFrame::CreateControls() ...@@ -179,27 +179,24 @@ void WinEDA_PrintFrame::CreateControls()
m_Print_Mirror->SetValue(false); m_Print_Mirror->SetValue(false);
itemStaticBoxSizer13->Add(m_Print_Mirror, 0, wxGROW|wxALL, 5); itemStaticBoxSizer13->Add(m_Print_Mirror, 0, wxGROW|wxALL, 5);
wxString m_ColorOptionStrings[] = { wxArrayString m_ColorOptionStrings;
_("Color"), m_ColorOptionStrings.Add(_("Color"));
_("Black") m_ColorOptionStrings.Add(_("Black"));
}; m_ColorOption = new wxRadioBox( itemDialog1, ID_SET_BW, _("Color Print:"), wxDefaultPosition, wxDefaultSize, m_ColorOptionStrings, 1, wxRA_SPECIFY_COLS );
m_ColorOption = new wxRadioBox( itemDialog1, ID_SET_BW, _("Color Print:"), wxDefaultPosition, wxDefaultSize, 2, m_ColorOptionStrings, 1, wxRA_SPECIFY_COLS );
m_ColorOption->SetSelection(0); m_ColorOption->SetSelection(0);
itemBoxSizer12->Add(m_ColorOption, 0, wxGROW|wxALL, 5); itemBoxSizer12->Add(m_ColorOption, 0, wxGROW|wxALL, 5);
wxString m_PagesOptionPcbStrings[] = { wxArrayString m_PagesOptionPcbStrings;
_("1 page per layer"), m_PagesOptionPcbStrings.Add(_("1 Page per Layer"));
_("Single Page") m_PagesOptionPcbStrings.Add(_("Single Page"));
}; m_PagesOptionPcb = new wxRadioBox( itemDialog1, ID_PRINT_ALL_IN_ONE, _("Page Print:"), wxDefaultPosition, wxDefaultSize, m_PagesOptionPcbStrings, 1, wxRA_SPECIFY_COLS );
m_PagesOptionPcb = new wxRadioBox( itemDialog1, ID_PRINT_ALL_IN_ONE, _("Page Print:"), wxDefaultPosition, wxDefaultSize, 2, m_PagesOptionPcbStrings, 1, wxRA_SPECIFY_COLS );
m_PagesOptionPcb->SetSelection(0); m_PagesOptionPcb->SetSelection(0);
itemBoxSizer12->Add(m_PagesOptionPcb, 0, wxGROW|wxALL, 5); itemBoxSizer12->Add(m_PagesOptionPcb, 0, wxGROW|wxALL, 5);
wxString m_PagesOptionEeschemaStrings[] = { wxArrayString m_PagesOptionEeschemaStrings;
_("Current"), m_PagesOptionEeschemaStrings.Add(_("Current"));
_("All") m_PagesOptionEeschemaStrings.Add(_("All"));
}; m_PagesOptionEeschema = new wxRadioBox( itemDialog1, ID_PRINT_ALL, _("Page Print:"), wxDefaultPosition, wxDefaultSize, m_PagesOptionEeschemaStrings, 1, wxRA_SPECIFY_COLS );
m_PagesOptionEeschema = new wxRadioBox( itemDialog1, ID_PRINT_ALL, _("Page Print:"), wxDefaultPosition, wxDefaultSize, 2, m_PagesOptionEeschemaStrings, 1, wxRA_SPECIFY_COLS );
m_PagesOptionEeschema->SetSelection(0); m_PagesOptionEeschema->SetSelection(0);
itemBoxSizer12->Add(m_PagesOptionEeschema, 0, wxGROW|wxALL, 5); itemBoxSizer12->Add(m_PagesOptionEeschema, 0, wxGROW|wxALL, 5);
...@@ -222,8 +219,9 @@ void WinEDA_PrintFrame::CreateControls() ...@@ -222,8 +219,9 @@ void WinEDA_PrintFrame::CreateControls()
itemButton25->SetForegroundColour(wxColour(0, 128, 64)); itemButton25->SetForegroundColour(wxColour(0, 128, 64));
itemBoxSizer21->Add(itemButton25, 0, wxGROW|wxALL, 5); itemBoxSizer21->Add(itemButton25, 0, wxGROW|wxALL, 5);
wxButton* itemButton26 = new wxButton( itemDialog1, wxID_CLOSE, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); m_CloseButton = new wxButton( itemDialog1, wxID_CANCEL, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer21->Add(itemButton26, 0, wxGROW|wxALL, 5); m_CloseButton->SetDefault();
itemBoxSizer21->Add(m_CloseButton, 0, wxGROW|wxALL, 5);
// Set validators // Set validators
m_ScaleOption->SetValidator( wxGenericValidator(& s_Scale_Select) ); m_ScaleOption->SetValidator( wxGenericValidator(& s_Scale_Select) );
...@@ -233,6 +231,7 @@ void WinEDA_PrintFrame::CreateControls() ...@@ -233,6 +231,7 @@ void WinEDA_PrintFrame::CreateControls()
m_PagesOptionEeschema->SetValidator( wxGenericValidator(& s_OptionPrintPage) ); m_PagesOptionEeschema->SetValidator( wxGenericValidator(& s_OptionPrintPage) );
////@end WinEDA_PrintFrame content construction ////@end WinEDA_PrintFrame content construction
m_CloseButton->SetFocus( ); // add this line to close dialog by the escape key
m_DialogPenWidth = new WinEDA_ValueCtrl(this, _("Pen width mini"), s_PrintPenMinWidth, m_DialogPenWidth = new WinEDA_ValueCtrl(this, _("Pen width mini"), s_PrintPenMinWidth,
g_UnitMetric, m_DialogPenWidthSizer, m_Parent->m_InternalUnits); g_UnitMetric, m_DialogPenWidthSizer, m_Parent->m_InternalUnits);
...@@ -304,7 +303,7 @@ void WinEDA_PrintFrame::OnPrintExecuteClick( wxCommandEvent& event ) ...@@ -304,7 +303,7 @@ void WinEDA_PrintFrame::OnPrintExecuteClick( wxCommandEvent& event )
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
*/ */
void WinEDA_PrintFrame::OnCloseClick( wxCommandEvent& event ) void WinEDA_PrintFrame::OnCancelClick( wxCommandEvent& event )
{ {
OnClosePrintDialog(); OnClosePrintDialog();
} }
......
...@@ -99,8 +99,8 @@ public: ...@@ -99,8 +99,8 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PRINT_EXECUTE /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PRINT_EXECUTE
void OnPrintExecuteClick( wxCommandEvent& event ); void OnPrintExecuteClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCloseClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
////@end WinEDA_PrintFrame event handler declarations ////@end WinEDA_PrintFrame event handler declarations
...@@ -142,6 +142,7 @@ public: ...@@ -142,6 +142,7 @@ public:
wxRadioBox* m_ColorOption; wxRadioBox* m_ColorOption;
wxRadioBox* m_PagesOptionPcb; wxRadioBox* m_PagesOptionPcb;
wxRadioBox* m_PagesOptionEeschema; wxRadioBox* m_PagesOptionEeschema;
wxButton* m_CloseButton;
////@end WinEDA_PrintFrame member variables ////@end WinEDA_PrintFrame member variables
WinEDA_DrawFrame * m_Parent; WinEDA_DrawFrame * m_Parent;
......
This diff is collapsed.
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