Gerbview: code cleanup and a minoe enhancement. Kicad: minor code cleanup
This commit is contained in:
commit
81509a1160
|
@ -278,6 +278,37 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function OnSelectPreferredEditor
|
||||||
|
* Open a dialog to select the preferred editor that will be used in Kicad
|
||||||
|
* to edit or display files (reports ... )
|
||||||
|
* The full filename editor is saved in configuration (global params)
|
||||||
|
*/
|
||||||
|
void EDA_BASE_FRAME::OnSelectPreferredEditor( wxCommandEvent& event )
|
||||||
|
{
|
||||||
|
wxFileName fn = wxGetApp().m_EditorName;
|
||||||
|
wxString wildcard( wxT( "*" ) );
|
||||||
|
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
wildcard += wxT( ".exe" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
wildcard = _( "Executable file (" ) + wildcard + wxT( ")|" ) + wildcard;
|
||||||
|
|
||||||
|
wxFileDialog dlg( this, _( "Select Prefered Editor" ), fn.GetPath(),
|
||||||
|
fn.GetFullName(), wildcard,
|
||||||
|
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||||
|
|
||||||
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wxASSERT( wxGetApp().m_EDA_CommonConfig );
|
||||||
|
|
||||||
|
wxConfig* cfg = wxGetApp().m_EDA_CommonConfig;
|
||||||
|
wxGetApp().m_EditorName = dlg.GetPath();
|
||||||
|
cfg->Write( wxT( "Editor" ), wxGetApp().m_EditorName );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef KICAD_BUILD_VERSION
|
#ifndef KICAD_BUILD_VERSION
|
||||||
#define KICAD_BUILD_VERSION "(2011-03-11 BZR 2884)"
|
#define KICAD_BUILD_VERSION "(2011-03-12)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define VERSION_STABILITY "stable"
|
//#define VERSION_STABILITY "stable"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
update=01/04/2010 16:21:47
|
update=12/03/2011 18:54:54
|
||||||
version=1
|
version=1
|
||||||
last_client=eeschema
|
last_client=pcbnew
|
||||||
[cvpcb]
|
[cvpcb]
|
||||||
version=1
|
version=1
|
||||||
NetITyp=0
|
NetITyp=0
|
||||||
|
@ -11,72 +11,6 @@ LibDir=
|
||||||
NetType=0
|
NetType=0
|
||||||
[cvpcb/libraries]
|
[cvpcb/libraries]
|
||||||
EquName1=devcms
|
EquName1=devcms
|
||||||
[pcbnew]
|
|
||||||
version=1
|
|
||||||
PadDrlX=320
|
|
||||||
PadDimH=600
|
|
||||||
PadDimV=600
|
|
||||||
PadForm=1
|
|
||||||
PadMask=14745599
|
|
||||||
ViaDiam=450
|
|
||||||
ViaDril=250
|
|
||||||
Isol=60
|
|
||||||
Countlayer=2
|
|
||||||
Lpiste=170
|
|
||||||
RouteTo=15
|
|
||||||
RouteBo=0
|
|
||||||
TypeVia=3
|
|
||||||
Segm45=1
|
|
||||||
Racc45=1
|
|
||||||
Unite=0
|
|
||||||
SegFill=1
|
|
||||||
SegAffG=0
|
|
||||||
NewAffG=1
|
|
||||||
PadFill=1
|
|
||||||
PadAffG=1
|
|
||||||
PadSNum=1
|
|
||||||
ModAffC=0
|
|
||||||
ModAffT=0
|
|
||||||
PcbAffT=0
|
|
||||||
SgPcb45=1
|
|
||||||
TxtPcbV=800
|
|
||||||
TxtPcbH=600
|
|
||||||
TxtModV=600
|
|
||||||
TxtModH=600
|
|
||||||
TxtModW=120
|
|
||||||
HPGLnum=1
|
|
||||||
HPGdiam=15
|
|
||||||
HPGLSpd=20
|
|
||||||
HPGLrec=2
|
|
||||||
HPGLorg=0
|
|
||||||
GERBmin=15
|
|
||||||
VEgarde=100
|
|
||||||
DrawLar=150
|
|
||||||
EdgeLar=150
|
|
||||||
TxtLar=120
|
|
||||||
MSegLar=150
|
|
||||||
ForPlot=1
|
|
||||||
WpenSer=10
|
|
||||||
UserGrX=0,01
|
|
||||||
UserGrY=0,01
|
|
||||||
UserGrU=1
|
|
||||||
DivGrPc=1
|
|
||||||
TimeOut=600
|
|
||||||
MaxLnkS=3
|
|
||||||
ShowRat=0
|
|
||||||
ShowMRa=1
|
|
||||||
[pcbnew/libraries]
|
|
||||||
LibDir=
|
|
||||||
LibName1=sockets
|
|
||||||
LibName2=connect
|
|
||||||
LibName3=discret
|
|
||||||
LibName4=pin_array
|
|
||||||
LibName5=divers
|
|
||||||
LibName6=libcms
|
|
||||||
LibName7=display
|
|
||||||
LibName8=valves
|
|
||||||
LibName9=led
|
|
||||||
LibName10=dip_sockets
|
|
||||||
[general]
|
[general]
|
||||||
version=1
|
version=1
|
||||||
[eeschema]
|
[eeschema]
|
||||||
|
@ -123,3 +57,32 @@ LibName5=linear
|
||||||
LibName6=regul
|
LibName6=regul
|
||||||
LibName7=interface
|
LibName7=interface
|
||||||
LibName8=special
|
LibName8=special
|
||||||
|
[pcbnew]
|
||||||
|
version=1
|
||||||
|
PadDrlX=320
|
||||||
|
PadDimH=600
|
||||||
|
PadDimV=600
|
||||||
|
BoardThickness=630
|
||||||
|
TxtPcbV=800
|
||||||
|
TxtPcbH=600
|
||||||
|
TxtModV=600
|
||||||
|
TxtModH=600
|
||||||
|
TxtModW=120
|
||||||
|
VEgarde=100
|
||||||
|
DrawLar=150
|
||||||
|
EdgeLar=150
|
||||||
|
TxtLar=120
|
||||||
|
MSegLar=150
|
||||||
|
LastNetListRead=
|
||||||
|
[pcbnew/libraries]
|
||||||
|
LibDir=
|
||||||
|
LibName1=sockets
|
||||||
|
LibName2=connect
|
||||||
|
LibName3=discret
|
||||||
|
LibName4=pin_array
|
||||||
|
LibName5=divers
|
||||||
|
LibName6=libcms
|
||||||
|
LibName7=display
|
||||||
|
LibName8=valves
|
||||||
|
LibName9=led
|
||||||
|
LibName10=dip_sockets
|
||||||
|
|
|
@ -13,6 +13,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
###
|
###
|
||||||
# Sources
|
# Sources
|
||||||
###
|
###
|
||||||
|
|
||||||
set(DIALOGS_SRCS
|
set(DIALOGS_SRCS
|
||||||
dialogs/gerbview_dialog_display_options_frame_base.cpp
|
dialogs/gerbview_dialog_display_options_frame_base.cpp
|
||||||
dialogs/gerbview_dialog_display_options_frame.cpp
|
dialogs/gerbview_dialog_display_options_frame.cpp
|
||||||
|
@ -35,9 +36,9 @@ set(GERBVIEW_SRCS
|
||||||
edit.cpp
|
edit.cpp
|
||||||
export_to_pcbnew.cpp
|
export_to_pcbnew.cpp
|
||||||
files.cpp
|
files.cpp
|
||||||
gerberframe.cpp
|
|
||||||
gerbview_config.cpp
|
|
||||||
gerbview.cpp
|
gerbview.cpp
|
||||||
|
gerbview_config.cpp
|
||||||
|
gerbview_frame.cpp
|
||||||
hotkeys.cpp
|
hotkeys.cpp
|
||||||
initpcb.cpp
|
initpcb.cpp
|
||||||
locate.cpp
|
locate.cpp
|
||||||
|
@ -50,7 +51,8 @@ set(GERBVIEW_SRCS
|
||||||
rs274d.cpp
|
rs274d.cpp
|
||||||
rs274x.cpp
|
rs274x.cpp
|
||||||
select_layers_to_pcb.cpp
|
select_layers_to_pcb.cpp
|
||||||
toolbars_gerber.cpp )
|
toolbars_gerber.cpp
|
||||||
|
)
|
||||||
|
|
||||||
###
|
###
|
||||||
# We need some extra sources from pcbnew
|
# We need some extra sources from pcbnew
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**********************************************************/
|
/**********************************/
|
||||||
/* Block operations: displacement, rotation, deletion ... */
|
/* Block operations: displacement */
|
||||||
/**********************************************************/
|
/**********************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
|
@ -28,15 +28,14 @@
|
||||||
|
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "gr_basic.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "class_drawpanel.h"
|
#include "class_drawpanel.h"
|
||||||
#include "trigo.h"
|
|
||||||
#include "confirm.h"
|
#include "confirm.h"
|
||||||
|
|
||||||
#include "gerbview.h"
|
#include "gerbview.h"
|
||||||
#include "class_gerber_draw_item.h"
|
#include "class_gerber_draw_item.h"
|
||||||
|
|
||||||
|
#include "wx/debug.h"
|
||||||
|
|
||||||
#define BLOCK_COLOR BROWN
|
#define BLOCK_COLOR BROWN
|
||||||
|
|
||||||
|
@ -46,6 +45,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
|
||||||
|
|
||||||
/* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
|
/* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
|
||||||
* the key (ALT, SHIFT ALT ..)
|
* the key (ALT, SHIFT ALT ..)
|
||||||
|
* Currently, only block move and block zoom is supported
|
||||||
*/
|
*/
|
||||||
int GERBVIEW_FRAME::ReturnBlockCommand( int key )
|
int GERBVIEW_FRAME::ReturnBlockCommand( int key )
|
||||||
{
|
{
|
||||||
|
@ -62,17 +62,9 @@ int GERBVIEW_FRAME::ReturnBlockCommand( int key )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GR_KB_SHIFT:
|
case GR_KB_SHIFT:
|
||||||
break;
|
|
||||||
|
|
||||||
case GR_KB_CTRL:
|
case GR_KB_CTRL:
|
||||||
break;
|
|
||||||
|
|
||||||
case GR_KB_SHIFTCTRL:
|
case GR_KB_SHIFTCTRL:
|
||||||
cmd = BLOCK_DELETE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GR_KB_ALT:
|
case GR_KB_ALT:
|
||||||
cmd = BLOCK_COPY;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MOUSE_MIDDLE:
|
case MOUSE_MIDDLE:
|
||||||
|
@ -87,25 +79,13 @@ int GERBVIEW_FRAME::ReturnBlockCommand( int key )
|
||||||
/* Routine to handle the BLOCK PLACE command */
|
/* Routine to handle the BLOCK PLACE command */
|
||||||
void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
|
void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
{
|
{
|
||||||
bool err = false;
|
wxASSERT( DrawPanel->IsMouseCaptured() );
|
||||||
|
|
||||||
if( !DrawPanel->IsMouseCaptured() )
|
|
||||||
{
|
|
||||||
err = true;
|
|
||||||
DisplayError( this,
|
|
||||||
wxT( "Error in HandleBlockPLace : m_mouseCaptureCallback = NULL" ) );
|
|
||||||
}
|
|
||||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
|
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP;
|
||||||
|
|
||||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||||
{
|
{
|
||||||
case BLOCK_IDLE:
|
|
||||||
err = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BLOCK_DRAG: /* Drag */
|
|
||||||
case BLOCK_MOVE: /* Move */
|
case BLOCK_MOVE: /* Move */
|
||||||
case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/
|
|
||||||
if( DrawPanel->IsMouseCaptured() )
|
if( DrawPanel->IsMouseCaptured() )
|
||||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||||
|
|
||||||
|
@ -122,9 +102,9 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_PASTE:
|
case BLOCK_PASTE:
|
||||||
break;
|
case BLOCK_DRAG:
|
||||||
|
case BLOCK_PRESELECT_MOVE:
|
||||||
case BLOCK_ZOOM: // Handle by HandleBlockEnd()
|
case BLOCK_ZOOM:
|
||||||
case BLOCK_ROTATE:
|
case BLOCK_ROTATE:
|
||||||
case BLOCK_FLIP:
|
case BLOCK_FLIP:
|
||||||
case BLOCK_DELETE:
|
case BLOCK_DELETE:
|
||||||
|
@ -133,6 +113,8 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
case BLOCK_SELECT_ITEMS_ONLY:
|
case BLOCK_SELECT_ITEMS_ONLY:
|
||||||
case BLOCK_MIRROR_X:
|
case BLOCK_MIRROR_X:
|
||||||
case BLOCK_MIRROR_Y:
|
case BLOCK_MIRROR_Y:
|
||||||
|
case BLOCK_IDLE:
|
||||||
|
wxFAIL_MSG( wxT("HandleBlockPlace: Unexpected block command") );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,11 +124,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
GetScreen()->SetModify();
|
GetScreen()->SetModify();
|
||||||
GetScreen()->ClearBlockCommand();
|
GetScreen()->ClearBlockCommand();
|
||||||
|
|
||||||
if( GetScreen()->m_BlockLocate.GetCount() )
|
wxASSERT( GetScreen()->m_BlockLocate.GetCount() == 0 );
|
||||||
{
|
|
||||||
DisplayError( this, wxT( "HandleBlockPLace error: some items left" ) );
|
|
||||||
GetScreen()->m_BlockLocate.ClearItemsList();
|
|
||||||
}
|
|
||||||
|
|
||||||
DisplayToolMsg( wxEmptyString );
|
DisplayToolMsg( wxEmptyString );
|
||||||
}
|
}
|
||||||
|
@ -171,15 +149,8 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
|
|
||||||
switch( GetScreen()->m_BlockLocate.m_Command )
|
switch( GetScreen()->m_BlockLocate.m_Command )
|
||||||
{
|
{
|
||||||
case BLOCK_IDLE:
|
|
||||||
DisplayError( this, wxT( "Error in HandleBlockPLace" ) );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BLOCK_DRAG: /* Drag (not used, for future
|
|
||||||
* enhancements) */
|
|
||||||
case BLOCK_MOVE: /* Move */
|
case BLOCK_MOVE: /* Move */
|
||||||
case BLOCK_COPY: /* Copy */
|
case BLOCK_COPY: /* Copy */
|
||||||
case BLOCK_PRESELECT_MOVE: /* Move with preselection list */
|
|
||||||
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
|
GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE;
|
||||||
nextcmd = true;
|
nextcmd = true;
|
||||||
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
|
||||||
|
@ -193,20 +164,22 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
|
||||||
Block_Delete( DC );
|
Block_Delete( DC );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case BLOCK_ZOOM: /* Window Zoom */
|
||||||
|
zoom_command = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BLOCK_PRESELECT_MOVE: /* Move with preselection list */
|
||||||
|
case BLOCK_DRAG:
|
||||||
|
case BLOCK_IDLE:
|
||||||
case BLOCK_MIRROR_X: /* Mirror, unused*/
|
case BLOCK_MIRROR_X: /* Mirror, unused*/
|
||||||
case BLOCK_ROTATE: /* Unused */
|
case BLOCK_ROTATE: /* Unused */
|
||||||
case BLOCK_FLIP: /* Flip, unused */
|
case BLOCK_FLIP: /* Flip, unused */
|
||||||
case BLOCK_SAVE: /* Save (not used)*/
|
case BLOCK_SAVE: /* Save (not used)*/
|
||||||
case BLOCK_PASTE:
|
case BLOCK_PASTE:
|
||||||
break;
|
|
||||||
|
|
||||||
case BLOCK_ZOOM: /* Window Zoom */
|
|
||||||
zoom_command = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BLOCK_ABORT:
|
case BLOCK_ABORT:
|
||||||
case BLOCK_SELECT_ITEMS_ONLY:
|
case BLOCK_SELECT_ITEMS_ONLY:
|
||||||
case BLOCK_MIRROR_Y:
|
case BLOCK_MIRROR_Y:
|
||||||
|
wxFAIL_MSG( wxT("HandleBlockEnd: Unexpected block command") );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include "class_drawpanel.h"
|
#include "class_drawpanel.h"
|
||||||
#include "pcbstruct.h"
|
#include "pcbstruct.h"
|
||||||
#include "gerbview.h"
|
#include "gerbview.h"
|
||||||
#include "wxGerberFrame.h"
|
|
||||||
#include "layer_widget.h"
|
#include "layer_widget.h"
|
||||||
#include "class_gerbview_layer_widget.h"
|
#include "class_gerbview_layer_widget.h"
|
||||||
|
|
||||||
|
|
|
@ -137,17 +137,17 @@ int D_CODE::GetShapeDim( GERBER_DRAW_ITEM* aParent )
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function Read_D_Code_File
|
* Function ReadDCodeDefinitionFile
|
||||||
* Can be useful only with old RS274D Gerber file format.
|
* Can be useful only with old RS274D Gerber file format.
|
||||||
* Is not needed with RS274X files format.
|
* Is not needed with RS274X files format.
|
||||||
* These files need an auxiliary DCode file description. There is no defined file format for this.
|
* These files need an auxiliary DCode file description. There is no defined file format for this.
|
||||||
* This function read a file format I needed a long time ago.
|
* This function read a file format I needed a long time ago.
|
||||||
* reads in a dcode file assuming ALSPCB file format with ';' indicating comments.
|
* reads in a dcode file assuming ALSPCB file format with ';' indicating comments.
|
||||||
* Format is like CSV but with optional ';' delineated comments:
|
* Format is like CSV but with optional ';' delineated comments:
|
||||||
* tool, Horiz, Vert, drill, vitesse, acc. ,Type ; [DCODE (commentaire)]
|
* tool, Horiz, Vert, drill, speed, accel. ,Type ; [DCODE (commentaire)]
|
||||||
* ex: 1, 12, 12, 0, 0, 0, 3 ; D10
|
* ex: 1, 12, 12, 0, 0, 0, 3 ; D10
|
||||||
*/
|
*/
|
||||||
int GERBVIEW_FRAME::Read_D_Code_File( const wxString& D_Code_FullFileName )
|
int GERBVIEW_FRAME::ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName )
|
||||||
{
|
{
|
||||||
int current_Dcode, ii, dcode_scale;
|
int current_Dcode, ii, dcode_scale;
|
||||||
char* ptcar;
|
char* ptcar;
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include "printout_controler.h"
|
#include "printout_controler.h"
|
||||||
|
|
||||||
#include "gerbview.h"
|
#include "gerbview.h"
|
||||||
#include "wxGerberFrame.h"
|
|
||||||
#include "pcbplot.h"
|
#include "pcbplot.h"
|
||||||
#include "class_board_design_settings.h"
|
#include "class_board_design_settings.h"
|
||||||
|
|
||||||
|
|
|
@ -118,11 +118,11 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
switch( id )
|
switch( id )
|
||||||
{
|
{
|
||||||
case ID_EXIT:
|
case ID_EXIT:
|
||||||
Close( TRUE );
|
Close( true );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_GERBVIEW_GLOBAL_DELETE:
|
case ID_GERBVIEW_GLOBAL_DELETE:
|
||||||
Erase_Current_Layer( TRUE );
|
Erase_Current_Layer( true );
|
||||||
ClearMsgPanel();
|
ClearMsgPanel();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -171,6 +171,10 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
wxFileName fn( gerber_layer->m_FileName );
|
wxFileName fn( gerber_layer->m_FileName );
|
||||||
ExecuteFile( this, editorname, QuoteFullPath( fn ) );
|
ExecuteFile( this, editorname, QuoteFullPath( fn ) );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxMessageBox(_("No editor defined. Please select one") );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
|
|
||||||
#include "gerbview.h"
|
#include "gerbview.h"
|
||||||
|
|
||||||
static void LoadDCodeFile( GERBVIEW_FRAME* frame,
|
|
||||||
const wxString& FullFileName );
|
|
||||||
|
|
||||||
|
|
||||||
/* Load a Gerber file selected from history list on current layer
|
/* Load a Gerber file selected from history list on current layer
|
||||||
* Previous data is deleted
|
* Previous data is deleted
|
||||||
|
@ -79,11 +76,12 @@ clear an existing layer to load any new layers." ), NB_LAYERS );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_GERBVIEW_LOAD_DCODE_FILE:
|
case ID_GERBVIEW_LOAD_DCODE_FILE:
|
||||||
LoadDCodeFile( this, wxEmptyString );
|
LoadDCodeFile( wxEmptyString );
|
||||||
|
DrawPanel->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DisplayError( this, wxT( "File_io Internal Error" ) );
|
wxFAIL_MSG( wxT( "File_io: unexpected command id" ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,33 +197,33 @@ bool GERBVIEW_FRAME::LoadGerberFiles( const wxString& aFullFileName )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read a DCode file (not used with RX274X files , just with RS274D old files).
|
* Read a DCode file (not used with RX274X files , just with RS274D old files).
|
||||||
* Note: there is no standard for DCode file.
|
* Note: there is no standard for DCode files.
|
||||||
* Just read a file format created by early versions of Pcbnew.
|
* Just read a file format created by early versions of Pcbnew.
|
||||||
* Returns:
|
* Returns:
|
||||||
* 0 if file not read (cancellation of order ...)
|
* false if file not read (cancellation of order ...)
|
||||||
* 1 if OK
|
* true if OK
|
||||||
*/
|
*/
|
||||||
static void LoadDCodeFile( GERBVIEW_FRAME* frame, const wxString& FullFileName )
|
bool GERBVIEW_FRAME::LoadDCodeFile( const wxString& aFullFileName )
|
||||||
{
|
{
|
||||||
wxString wildcard;
|
wxString wildcard;
|
||||||
wxFileName fn = FullFileName;
|
wxFileName fn = aFullFileName;
|
||||||
|
|
||||||
if( !fn.IsOk() )
|
if( !fn.IsOk() )
|
||||||
{
|
{
|
||||||
wildcard = _( "Gerber DCODE files" );
|
wildcard = _( "Gerber DCODE files" );
|
||||||
wildcard += AllFilesWildcard;
|
wildcard += wxT(" ") + AllFilesWildcard;
|
||||||
fn = frame->GetScreen()->GetFileName();
|
fn = GetScreen()->GetFileName();
|
||||||
wxFileDialog dlg( (wxWindow*) frame, _( "Load GERBER DCODE File" ),
|
wxFileDialog dlg( this, _( "Load GERBER DCODE File" ),
|
||||||
fn.GetPath(), fn.GetFullName(), wildcard,
|
fn.GetPath(), fn.GetFullName(), wildcard,
|
||||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
fn = dlg.GetPath();
|
fn = dlg.GetPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
frame->Read_D_Code_File( fn.GetFullPath() );
|
ReadDCodeDefinitionFile( fn.GetFullPath() );
|
||||||
frame->CopyDCodesSizeToItems();
|
CopyDCodesSizeToItems();
|
||||||
frame->Refresh();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
#include "gerbview.h"
|
#include "gerbview.h"
|
||||||
#include "gerbview_id.h"
|
#include "gerbview_id.h"
|
||||||
#include "wxGerberFrame.h"
|
|
||||||
#include "pcbplot.h"
|
#include "pcbplot.h"
|
||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
#include "zones.h"
|
#include "zones.h"
|
||||||
|
|
|
@ -108,6 +108,6 @@ bool GetEndOfBlock( char buff[GERBER_BUFZ], char*& text, FILE* gerber_file );
|
||||||
extern GERBER_IMAGE* g_GERBER_List[32];
|
extern GERBER_IMAGE* g_GERBER_List[32];
|
||||||
|
|
||||||
#include "pcbcommon.h"
|
#include "pcbcommon.h"
|
||||||
#include "wxGerberFrame.h"
|
#include "gerbview_frame.h"
|
||||||
|
|
||||||
#endif // ifndef GERBVIEW_H
|
#endif // ifndef GERBVIEW_H
|
||||||
|
|
|
@ -64,6 +64,8 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, PCB_BASE_FRAME )
|
||||||
EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, GERBVIEW_FRAME::Process_Special_Functions )
|
EVT_MENU( ID_GERBVIEW_SHOW_LIST_DCODES, GERBVIEW_FRAME::Process_Special_Functions )
|
||||||
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, GERBVIEW_FRAME::Process_Special_Functions )
|
EVT_MENU( ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, GERBVIEW_FRAME::Process_Special_Functions )
|
||||||
EVT_MENU( ID_GERBVIEW_SHOW_SOURCE, GERBVIEW_FRAME::Process_Special_Functions )
|
EVT_MENU( ID_GERBVIEW_SHOW_SOURCE, GERBVIEW_FRAME::Process_Special_Functions )
|
||||||
|
EVT_MENU( ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
|
||||||
|
EDA_BASE_FRAME::OnSelectPreferredEditor )
|
||||||
|
|
||||||
// menu Miscellaneous
|
// menu Miscellaneous
|
||||||
EVT_MENU( ID_GERBVIEW_GLOBAL_DELETE, GERBVIEW_FRAME::Process_Special_Functions )
|
EVT_MENU( ID_GERBVIEW_GLOBAL_DELETE, GERBVIEW_FRAME::Process_Special_Functions )
|
|
@ -406,7 +406,18 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
|
||||||
void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
|
void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Read_D_Code_File
|
* Read a DCode file (not used with RX274X files , just with RS274D old files).
|
||||||
|
* Note: there is no standard for DCode file.
|
||||||
|
* Just read a file format created by early versions of Pcbnew.
|
||||||
|
* @return false if file not read (cancellation)
|
||||||
|
* true if OK
|
||||||
|
* @ aparm aFullFileName = name of file to load.
|
||||||
|
* if empty, or if the file does not exist, a file dialog is opened
|
||||||
|
*/
|
||||||
|
bool LoadDCodeFile( const wxString& aFullFileName );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function ReadDCodeDefinitionFile
|
||||||
* reads in a dcode file assuming ALSPCB file format with ';' indicating
|
* reads in a dcode file assuming ALSPCB file format with ';' indicating
|
||||||
* comments.
|
* comments.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -418,7 +429,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
|
||||||
* Ver, Hor, Type, Tool [,Drill]<br>
|
* Ver, Hor, Type, Tool [,Drill]<br>
|
||||||
* example: 0.012, 0.012, L , D10<br>
|
* example: 0.012, 0.012, L , D10<br>
|
||||||
*
|
*
|
||||||
* Categorize all found dcodes into a table of D_CODE instantiations.
|
* Load all found dcodes into a table of D_CODE instantiations.
|
||||||
* @param D_Code_FullFileName The name of the file to read from.
|
* @param D_Code_FullFileName The name of the file to read from.
|
||||||
* @return int - <br>
|
* @return int - <br>
|
||||||
* -1 = file not found<br>
|
* -1 = file not found<br>
|
||||||
|
@ -428,7 +439,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
|
||||||
* g_GERBER_List[]<br>
|
* g_GERBER_List[]<br>
|
||||||
* 1 = read OK<br>
|
* 1 = read OK<br>
|
||||||
*/
|
*/
|
||||||
int Read_D_Code_File( const wxString& D_Code_FullFileName );
|
int ReadDCodeDefinitionFile( const wxString& D_Code_FullFileName );
|
||||||
void CopyDCodesSizeToItems();
|
void CopyDCodesSizeToItems();
|
||||||
void Liste_D_Codes();
|
void Liste_D_Codes();
|
||||||
|
|
|
@ -16,6 +16,7 @@ enum gerbview_ids
|
||||||
ID_MAIN_MENUBAR = ID_END_LIST,
|
ID_MAIN_MENUBAR = ID_END_LIST,
|
||||||
|
|
||||||
ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
|
ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
|
||||||
|
ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
|
||||||
|
|
||||||
ID_TOOLBARH_GERBVIEW_SELECT_LAYER,
|
ID_TOOLBARH_GERBVIEW_SELECT_LAYER,
|
||||||
ID_GERBVIEW_GLOBAL_DELETE,
|
ID_GERBVIEW_GLOBAL_DELETE,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "appl_wxstruct.h"
|
#include "appl_wxstruct.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "macros.h"
|
//#include "macros.h"
|
||||||
#include "gerbview.h"
|
#include "gerbview.h"
|
||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
#include "gerbview_id.h"
|
#include "gerbview_id.h"
|
||||||
|
@ -91,6 +91,13 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
|
||||||
_( "&Clear Layer" ),
|
_( "&Clear Layer" ),
|
||||||
_( "Clear current layer" ), general_deletions_xpm );
|
_( "Clear current layer" ), general_deletions_xpm );
|
||||||
|
|
||||||
|
miscellaneous_menu->AppendSeparator();
|
||||||
|
ADD_MENUITEM_WITH_HELP( miscellaneous_menu, ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR,
|
||||||
|
_( "&Text Editor" ),
|
||||||
|
_( "Select your preferred text editor" ),
|
||||||
|
editor_xpm );
|
||||||
|
|
||||||
|
|
||||||
// Menu Help:
|
// Menu Help:
|
||||||
wxMenu* helpMenu = new wxMenu;
|
wxMenu* helpMenu = new wxMenu;
|
||||||
AddHelpVersionInfoMenuEntry( helpMenu );
|
AddHelpVersionInfoMenuEntry( helpMenu );
|
||||||
|
|
|
@ -88,3 +88,4 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,31 +165,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName,
|
||||||
*/
|
*/
|
||||||
if( !gerber->m_Has_DCode )
|
if( !gerber->m_Has_DCode )
|
||||||
{
|
{
|
||||||
wxFileName fn;
|
return LoadDCodeFile( D_Code_FullFileName );
|
||||||
|
|
||||||
if( D_Code_FullFileName.IsEmpty() )
|
|
||||||
{
|
|
||||||
wxString wildcard;
|
|
||||||
|
|
||||||
fn = GERBER_FullFileName;
|
|
||||||
fn.SetExt( wxEmptyString );
|
|
||||||
wildcard = _( "Gerber DCODE files" );
|
|
||||||
wildcard += AllFilesWildcard;
|
|
||||||
|
|
||||||
wxFileDialog dlg( this, _( "Load GERBER DCODE File" ),
|
|
||||||
wxEmptyString, fn.GetFullName(), wildcard,
|
|
||||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
fn = D_Code_FullFileName;
|
|
||||||
|
|
||||||
if( fn.IsOk() )
|
|
||||||
{
|
|
||||||
Read_D_Code_File( fn.GetFullPath() );
|
|
||||||
CopyDCodesSizeToItems();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -127,6 +127,14 @@ public:
|
||||||
virtual void LoadSettings();
|
virtual void LoadSettings();
|
||||||
virtual void SaveSettings();
|
virtual void SaveSettings();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function OnSelectPreferredEditor
|
||||||
|
* Open a dialog to select the editor that will used in Kicad
|
||||||
|
* to edit or display files (reports ... )
|
||||||
|
* The full filename editor is saved in configuration (global params)
|
||||||
|
*/
|
||||||
|
virtual void OnSelectPreferredEditor( wxCommandEvent& event );
|
||||||
|
|
||||||
// Read/Save and Import/export hotkeys config
|
// Read/Save and Import/export hotkeys config
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -109,7 +109,6 @@ public:
|
||||||
void OnRefresh( wxCommandEvent& event );
|
void OnRefresh( wxCommandEvent& event );
|
||||||
void OnSelectDefaultPdfBrowser( wxCommandEvent& event );
|
void OnSelectDefaultPdfBrowser( wxCommandEvent& event );
|
||||||
void OnSelectPreferredPdfBrowser( wxCommandEvent& event );
|
void OnSelectPreferredPdfBrowser( wxCommandEvent& event );
|
||||||
void OnSelectPreferredEditor( wxCommandEvent& event );
|
|
||||||
|
|
||||||
void OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event );
|
void OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event );
|
||||||
void OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event );
|
void OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event );
|
||||||
|
|
|
@ -31,7 +31,7 @@ BEGIN_EVENT_TABLE( WinEDA_MainFrame, EDA_BASE_FRAME )
|
||||||
EVT_MENU( ID_BROWSE_AN_SELECT_FILE,
|
EVT_MENU( ID_BROWSE_AN_SELECT_FILE,
|
||||||
WinEDA_MainFrame::OnOpenFileInTextEditor )
|
WinEDA_MainFrame::OnOpenFileInTextEditor )
|
||||||
EVT_MENU( ID_SELECT_PREFERED_EDITOR,
|
EVT_MENU( ID_SELECT_PREFERED_EDITOR,
|
||||||
WinEDA_MainFrame::OnSelectPreferredEditor )
|
EDA_BASE_FRAME::OnSelectPreferredEditor )
|
||||||
EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER,
|
EVT_MENU( ID_SELECT_DEFAULT_PDF_BROWSER,
|
||||||
WinEDA_MainFrame::OnSelectDefaultPdfBrowser )
|
WinEDA_MainFrame::OnSelectDefaultPdfBrowser )
|
||||||
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER,
|
EVT_MENU( ID_SELECT_PREFERED_PDF_BROWSER,
|
||||||
|
@ -88,113 +88,75 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
wxMenu* filesMenu = new wxMenu;
|
wxMenu* filesMenu = new wxMenu;
|
||||||
|
|
||||||
// Open
|
// Open
|
||||||
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
|
ADD_MENUITEM_WITH_HELP( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
|
||||||
_( "Open an existing project" ) );
|
_( "Open an existing project" ),
|
||||||
|
open_project_xpm );
|
||||||
#if !defined( __WXMAC__ )
|
|
||||||
item->SetBitmap( open_project_xpm );
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
|
||||||
|
|
||||||
filesMenu->Append( item );
|
|
||||||
|
|
||||||
// Open Recent submenu
|
// Open Recent submenu
|
||||||
wxMenu* openRecentMenu = new wxMenu();
|
wxMenu* openRecentMenu = new wxMenu();
|
||||||
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
|
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
|
||||||
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
|
||||||
-1, _( "Open &Recent" ),
|
wxID_ANY, _( "Open &Recent" ),
|
||||||
_( "Open a recent opened schematic project" ),
|
_( "Open a recent opened schematic project" ),
|
||||||
open_project_xpm );
|
open_project_xpm );
|
||||||
|
|
||||||
// New
|
// New
|
||||||
item = new wxMenuItem( filesMenu, ID_NEW_PROJECT, _( "&New\tCtrl+N" ),
|
ADD_MENUITEM_WITH_HELP( filesMenu, ID_NEW_PROJECT,
|
||||||
_( "Start a new project" ) );
|
_( "&New\tCtrl+N" ),
|
||||||
|
_( "Start a new project" ),
|
||||||
#if !defined( __WXMAC__ )
|
new_project_xpm );
|
||||||
item->SetBitmap( new_project_xpm );
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
|
||||||
|
|
||||||
filesMenu->Append( item );
|
|
||||||
|
|
||||||
/* Save */
|
/* Save */
|
||||||
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT, _( "&Save\tCtrl+S" ),
|
ADD_MENUITEM_WITH_HELP( filesMenu, ID_SAVE_PROJECT, _( "&Save\tCtrl+S" ),
|
||||||
_( "Save current project" ) );
|
_( "Save current project" ),
|
||||||
|
save_project_xpm );
|
||||||
#if !defined( __WXMAC__ )
|
|
||||||
item->SetBitmap( save_project_xpm );
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
|
||||||
|
|
||||||
filesMenu->Append( item );
|
|
||||||
|
|
||||||
// Archive
|
// Archive
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
item = new wxMenuItem( filesMenu, ID_SAVE_AND_ZIP_FILES, _( "&Archive" ),
|
ADD_MENUITEM_WITH_HELP( filesMenu, ID_SAVE_AND_ZIP_FILES, _( "&Archive" ),
|
||||||
_( "Archive project files in zip archive" ) );
|
_( "Archive project files in zip archive" ),
|
||||||
|
zip_xpm );
|
||||||
#if !defined( __WXMAC__ )
|
|
||||||
item->SetBitmap( zip_xpm );
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
|
||||||
|
|
||||||
filesMenu->Append( item );
|
|
||||||
|
|
||||||
// Unarchive
|
// Unarchive
|
||||||
item = new wxMenuItem( filesMenu, ID_READ_ZIP_ARCHIVE, _( "&Unarchive" ),
|
ADD_MENUITEM_WITH_HELP( filesMenu, ID_READ_ZIP_ARCHIVE, _( "&Unarchive" ),
|
||||||
_( "Unarchive project files from zip file" ) );
|
_( "Unarchive project files from zip file" ),
|
||||||
|
unzip_xpm );
|
||||||
#if !defined( __WXMAC__ )
|
|
||||||
item->SetBitmap( unzip_xpm );
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
|
||||||
|
|
||||||
filesMenu->Append( item );
|
|
||||||
|
|
||||||
/* Quit on all platforms except WXMAC */
|
/* Quit on all platforms except WXMAC */
|
||||||
#if !defined( __WXMAC__ )
|
#if !defined( __WXMAC__ )
|
||||||
|
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
|
ADD_MENUITEM_WITH_HELP( filesMenu, wxID_EXIT, _( "&Quit" ),
|
||||||
_( "Quit KiCad" ) );
|
_( "Quit KiCad" ),
|
||||||
item->SetBitmap( exit_xpm );
|
exit_xpm );
|
||||||
filesMenu->Append( item );
|
|
||||||
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
#endif /* !defined( __WXMAC__ ) */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Browse menu
|
// Browse menu
|
||||||
wxMenu* browseMenu = new wxMenu();
|
wxMenu* browseMenu = new wxMenu();
|
||||||
|
|
||||||
// Text editor
|
// Text editor
|
||||||
item = new wxMenuItem( browseMenu, ID_TO_EDITOR, _( "Text E&ditor" ),
|
ADD_MENUITEM_WITH_HELP( browseMenu, ID_TO_EDITOR,
|
||||||
_( "Open preferred text editor" ) );
|
_( "Text E&ditor" ),
|
||||||
#if !defined( __WXMAC__ )
|
_( "Launch preferred text editor" ),
|
||||||
item->SetBitmap( editor_xpm );
|
editor_xpm );
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
|
||||||
|
|
||||||
browseMenu->Append( item );
|
|
||||||
|
|
||||||
/* Browse files */
|
/* Browse files */
|
||||||
item = new wxMenuItem( browseMenu, ID_BROWSE_AN_SELECT_FILE,
|
ADD_MENUITEM_WITH_HELP( browseMenu, ID_BROWSE_AN_SELECT_FILE,
|
||||||
_( "&View File" ),
|
_( "&View File" ),
|
||||||
_( "View, read or edit file with a text editor" ) );
|
_( "View, read or edit file with a text editor" ),
|
||||||
#if !defined( __WXMAC__ )
|
browse_files_xpm );
|
||||||
item->SetBitmap( browse_files_xpm );
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
|
||||||
|
|
||||||
browseMenu->Append( item );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Preferences menu
|
// Preferences menu
|
||||||
wxMenu* PreferencesMenu = new wxMenu;
|
wxMenu* PreferencesMenu = new wxMenu;
|
||||||
|
|
||||||
// Text editor
|
// Text editor
|
||||||
item = new wxMenuItem( PreferencesMenu, ID_SELECT_PREFERED_EDITOR,
|
ADD_MENUITEM_WITH_HELP( PreferencesMenu, ID_SELECT_PREFERED_EDITOR,
|
||||||
_( "&Text Editor" ),
|
_( "&Text Editor" ),
|
||||||
_( "Select your preferred text editor" ) );
|
_( "Select your preferred text editor" ),
|
||||||
#if !defined( __WXMAC__ )
|
editor_xpm );
|
||||||
item->SetBitmap( editor_xpm );
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
|
||||||
|
|
||||||
PreferencesMenu->Append( item );
|
|
||||||
|
|
||||||
// PDF Viewer submenu:System browser or user defined checkbox
|
// PDF Viewer submenu:System browser or user defined checkbox
|
||||||
wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
|
wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
|
||||||
|
@ -230,15 +192,11 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
!wxGetApp().m_PdfBrowserIsDefault );
|
!wxGetApp().m_PdfBrowserIsDefault );
|
||||||
|
|
||||||
// Append PDF Viewer submenu to preferences
|
// Append PDF Viewer submenu to preferences
|
||||||
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
ADD_MENUITEM_WITH_HELP( SubMenuPdfBrowserChoice,
|
||||||
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
||||||
_( "PDF Viewer" ),
|
_( "PDF Viewer" ),
|
||||||
_( "Select your favourite PDF viewer used to browse datasheets" ) );
|
_( "Select your favourite PDF viewer used to browse datasheets" ),
|
||||||
#if !defined( __WXMAC__ )
|
datasheet_xpm );
|
||||||
item->SetBitmap( datasheet_xpm );
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
|
||||||
|
|
||||||
SubMenuPdfBrowserChoice->Append( item );
|
|
||||||
|
|
||||||
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( PreferencesMenu,
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( PreferencesMenu,
|
||||||
SubMenuPdfBrowserChoice,
|
SubMenuPdfBrowserChoice,
|
||||||
|
@ -256,21 +214,15 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
AddHelpVersionInfoMenuEntry( helpMenu );
|
AddHelpVersionInfoMenuEntry( helpMenu );
|
||||||
|
|
||||||
/* Contents */
|
/* Contents */
|
||||||
item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
|
ADD_MENUITEM_WITH_HELP( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
|
||||||
_( "Open the kicad manual" ) );
|
_( "Open the kicad manual" ),
|
||||||
|
online_help_xpm );
|
||||||
#if !defined( __WXMAC__ )
|
|
||||||
item->SetBitmap( online_help_xpm );
|
|
||||||
#endif /* !defined( __WXMAC__ ) */
|
|
||||||
|
|
||||||
helpMenu->Append( item );
|
|
||||||
|
|
||||||
// About
|
// About
|
||||||
helpMenu->AppendSeparator();
|
helpMenu->AppendSeparator();
|
||||||
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
ADD_MENUITEM_WITH_HELP( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
||||||
_( "About kicad project manager" ) );
|
_( "About kicad project manager" ),
|
||||||
item->SetBitmap( info_xpm );
|
info_xpm );
|
||||||
helpMenu->Append( item );
|
|
||||||
|
|
||||||
// Create the menubar and append all submenus
|
// Create the menubar and append all submenus
|
||||||
menuBar->Append( filesMenu, _( "&File" ) );
|
menuBar->Append( filesMenu, _( "&File" ) );
|
||||||
|
|
|
@ -69,33 +69,6 @@ void WinEDA_MainFrame::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
|
||||||
wxGetApp().WritePdfBrowserInfos();
|
wxGetApp().WritePdfBrowserInfos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_MainFrame::OnSelectPreferredEditor( wxCommandEvent& event )
|
|
||||||
{
|
|
||||||
wxFileName fn = wxGetApp().m_EditorName;
|
|
||||||
wxString wildcard( wxT( "*" ) );
|
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
|
||||||
wildcard += wxT( ".exe" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wildcard = _( "Executable file (" ) + wildcard + wxT( ")|" ) + wildcard;
|
|
||||||
|
|
||||||
wxFileDialog dlg( this, _( "Select Prefered Editor" ), fn.GetPath(),
|
|
||||||
fn.GetFullName(), wildcard,
|
|
||||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
|
||||||
return;
|
|
||||||
|
|
||||||
wxASSERT( wxGetApp().m_EDA_CommonConfig );
|
|
||||||
|
|
||||||
wxConfig* cfg = wxGetApp().m_EDA_CommonConfig;
|
|
||||||
wxGetApp().m_EditorName = dlg.GetPath();
|
|
||||||
cfg->Write( wxT( "Editor" ), wxGetApp().m_EditorName );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_MainFrame::SetLanguage( wxCommandEvent& event )
|
void WinEDA_MainFrame::SetLanguage( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
EDA_BASE_FRAME::SetLanguage( event );
|
EDA_BASE_FRAME::SetLanguage( event );
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
; General Product Description Definitions
|
; General Product Description Definitions
|
||||||
!define PRODUCT_NAME "KiCad"
|
!define PRODUCT_NAME "KiCad"
|
||||||
!define PRODUCT_VERSION "2011.03.11"
|
!define PRODUCT_VERSION "2011.03.12"
|
||||||
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
|
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
|
||||||
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
|
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
|
||||||
!define COMPANY_NAME ""
|
!define COMPANY_NAME ""
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
release version:
|
release version:
|
||||||
2011 mar 11
|
2011 mar 12
|
||||||
files (.zip,.tgz):
|
files (.zip,.tgz):
|
||||||
kicad-2011-03-11
|
kicad-2011-03-12
|
||||||
|
|
Loading…
Reference in New Issue