Commit 689579bd authored by stambaughw's avatar stambaughw

Global variable unobfuscation, new library path search, and lots of other...

Global variable unobfuscation, new library path search, and lots of other changes.  See CHANGELOG.txt.
parent 7a351249
......@@ -21,7 +21,6 @@
#include "wx/dataobj.h"
#include "wx/clipbrd.h"
#include "fctsys.h"
#include "id.h"
#include "gestfich.h"
......@@ -620,6 +619,7 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
* Output file format is png or jpeg, or image is copied on clipboard
*/
{
wxFileName fn( m_Parent->m_Parent->GetScreen()->m_FileName );
wxString FullFileName;
wxString file_ext, mask;
bool fmt_is_jpeg = FALSE;
......@@ -628,15 +628,15 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
fmt_is_jpeg = TRUE;
if( event.GetId() != ID_TOOL_SCREENCOPY_TOCLIBBOARD )
{
file_ext = fmt_is_jpeg ? wxT( ".jpg" ) : wxT( ".png"; )
mask = wxT( "*" ) + file_ext;
file_ext = fmt_is_jpeg ? wxT( "jpg" ) : wxT( "png"; )
mask = wxT( "*." ) + file_ext;
FullFileName = m_Parent->m_Parent->GetScreen()->m_FileName;
ChangeFileNameExt( FullFileName, file_ext );
fn.SetExt( file_ext );
FullFileName =
EDA_FileSelector( _( "3D Image filename:" ),
wxEmptyString, /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */
fn.GetFullName(), /* nom fichier par defaut */
file_ext, /* extension par defaut */
mask, /* Masque d'affichage */
this,
......
......@@ -20,12 +20,24 @@
#include "bitmaps.h"
#include "id.h"
#define VIEWER_MAIN
#include "3d_viewer.h"
#include "trackball.h"
#include <wx/colordlg.h>
Info_3D_Visu g_Parm_3D_Visu;
double g_Draw3d_dx;
double g_Draw3d_dy;
double ZBottom;
double ZTop;
double DataScale3D; // coeff de conversion unites utilsateut -> unites 3D
int gl_attrib[] =
{
WX_GL_RGBA, WX_GL_MIN_RED, 8, WX_GL_MIN_GREEN, 8, WX_GL_MIN_BLUE, 8,
WX_GL_DEPTH_SIZE, 16, WX_GL_DOUBLEBUFFER, GL_NONE
};
BEGIN_EVENT_TABLE( WinEDA3D_DrawFrame, wxFrame )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA3D_DrawFrame::Process_Zoom )
......@@ -358,9 +370,9 @@ void WinEDA3D_DrawFrame::Set3DBgColor()
S3D_Color color;
wxColour newcolor, oldcolor;
oldcolor.Set( (int) round( g_Parm_3D_Visu.m_BgColor.m_Red * 255 ),
(int) round( g_Parm_3D_Visu.m_BgColor.m_Green * 255 ),
(int) round( g_Parm_3D_Visu.m_BgColor.m_Blue * 255 ) );
oldcolor.Set( wxRound( g_Parm_3D_Visu.m_BgColor.m_Red * 255 ),
wxRound( g_Parm_3D_Visu.m_BgColor.m_Green * 255 ),
wxRound( g_Parm_3D_Visu.m_BgColor.m_Blue * 255 ) );
newcolor = wxGetColourFromUser( this, oldcolor );
if( newcolor != oldcolor )
......
......@@ -13,6 +13,7 @@
#include "common.h"
#include "macros.h"
#include "kicad_string.h"
#include "appl_wxstruct.h"
#include "3d_struct.h"
#include "3d_viewer.h"
......@@ -22,30 +23,35 @@
int S3D_MASTER:: ReadData()
/************************************/
{
char line[1024], * text;
wxString fullfilename;
FILE* file;
int LineNum = 0;
char line[1024], * text;
wxFileName fn;
wxString tmp;
FILE* file;
int LineNum = 0;
if( m_Shape3DName.IsEmpty() )
{
return 1;
}
if( wxIsAbsolutePath( m_Shape3DName ) )
fullfilename.Empty();
else
fullfilename = g_RealLibDirBuffer + LIB3D_PATH;
fullfilename += m_Shape3DName;
#if defined (__WINDOWS__)
fullfilename.Replace( UNIX_STRING_DIR_SEP, WIN_STRING_DIR_SEP );
#else
#if defined (__UNIX__)
fullfilename.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP );
#endif
#endif
fn = m_Shape3DName;
if( !fn.FileExists() )
{
tmp = wxGetApp().GetLibraryPathList().FindValidPath( fn.GetFullPath() );
if( !tmp )
{
wxLogDebug( _( "3D part library <%s> could not be found." ),
fn.GetFullPath().c_str() );
return -1;
}
fn = tmp;
}
file = wxFopen( fn.GetFullPath(), wxT( "rt" ) );
file = wxFopen( fullfilename, wxT( "rt" ) );
if( file == NULL )
{
return -1;
......
......@@ -9,7 +9,6 @@
#include "id.h"
#define BITMAP wxBitmap
#include "3d_viewer.h"
......@@ -29,62 +28,70 @@ void WinEDA3D_DrawFrame::ReCreateHToolbar()
SetToolBar( m_HToolBar );
// Set up toolbar
m_HToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString, BITMAP( import3d_xpm ),
_( "Reload board" ) );
m_HToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
wxBitmap( import3d_xpm ),
_( "Reload board" ) );
#ifdef __WINDOWS__ // do not work properly under linux
m_HToolBar-> AddSeparator();
m_HToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString, BITMAP( copy_button ),
m_HToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
wxBitmap( copy_button ),
_( "Copy 3D Image to Clipboard" ) );
#endif
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, BITMAP( zoom_in_xpm ),
_( "Zoom in" ) );
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, wxBitmap( zoom_in_xpm ),
_( "Zoom in" ) );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, BITMAP( zoom_out_xpm ),
_( "Zoom out" ) );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, wxBitmap( zoom_out_xpm ),
_( "Zoom out" ) );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, BITMAP( zoom_redraw_xpm ),
_( "Redraw view" ) );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
wxBitmap( zoom_redraw_xpm ),
_( "Redraw view" ) );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, BITMAP( zoom_auto_xpm ),
_( "Zoom auto" ) );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, wxBitmap( zoom_auto_xpm ),
_( "Zoom auto" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_ROTATE3D_X_NEG, wxEmptyString, BITMAP( rotate_neg_X_xpm ),
_( "Rotate X <-" ) );
m_HToolBar->AddTool( ID_ROTATE3D_X_NEG, wxEmptyString,
wxBitmap( rotate_neg_X_xpm ),
_( "Rotate X <-" ) );
m_HToolBar->AddTool( ID_ROTATE3D_X_POS, wxEmptyString, BITMAP( rotate_pos_X_xpm ),
_( "Rotate X ->" ) );
m_HToolBar->AddTool( ID_ROTATE3D_X_POS, wxEmptyString,
wxBitmap( rotate_pos_X_xpm ),
_( "Rotate X ->" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_ROTATE3D_Y_NEG, wxEmptyString, BITMAP( rotate_neg_Y_xpm ),
_( "Rotate Y <-" ) );
m_HToolBar->AddTool( ID_ROTATE3D_Y_NEG, wxEmptyString,
wxBitmap( rotate_neg_Y_xpm ),
_( "Rotate Y <-" ) );
m_HToolBar->AddTool( ID_ROTATE3D_Y_POS, wxEmptyString, BITMAP( rotate_pos_Y_xpm ),
_( "Rotate Y ->" ) );
m_HToolBar->AddTool( ID_ROTATE3D_Y_POS, wxEmptyString,
wxBitmap( rotate_pos_Y_xpm ),
_( "Rotate Y ->" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_ROTATE3D_Z_NEG, wxEmptyString, BITMAP( rotate_neg_Z_xpm ),
_( "Rotate Z <-" ) );
m_HToolBar->AddTool( ID_ROTATE3D_Z_NEG, wxEmptyString,
wxBitmap( rotate_neg_Z_xpm ),
_( "Rotate Z <-" ) );
m_HToolBar->AddTool( ID_ROTATE3D_Z_POS, wxEmptyString, BITMAP( rotate_pos_Z_xpm ),
_( "Rotate Z ->" ) );
m_HToolBar->AddTool( ID_ROTATE3D_Z_POS, wxEmptyString,
wxBitmap( rotate_pos_Z_xpm ),
_( "Rotate Z ->" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString, BITMAP( left_xpm ),
_( "Move left <-" ) );
m_HToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString, wxBitmap( left_xpm ),
_( "Move left <-" ) );
m_HToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString, BITMAP( right_xpm ),
_( "Move right ->" ) );
m_HToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString, wxBitmap( right_xpm ),
_( "Move right ->" ) );
m_HToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString, BITMAP( up_xpm ),
_( "Move Up ^" ) );
m_HToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, BITMAP( down_xpm ),
_( "Move Down" ) );
m_HToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString, wxBitmap( up_xpm ),
_( "Move Up ^" ) );
m_HToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, wxBitmap( down_xpm ),
_( "Move Down" ) );
m_HToolBar->Realize();
......
......@@ -20,12 +20,6 @@
# include <GL/glu.h>
#endif
#ifdef VIEWER_MAIN
#define global_3d
#else
#define global_3d extern
#endif
#include "pcbstruct.h"
#include "3d_struct.h"
......@@ -49,73 +43,73 @@ class SEGVIA;
class Info_3D_Visu
{
public:
double m_Beginx, m_Beginy; /* position of mouse */
double m_Quat[4]; /* orientation of object */
double m_Rot[4]; /* man rotation of object */
double m_Zoom; /* field of view in degrees */
S3D_Color m_BgColor;
bool m_Draw3DAxis;
bool m_Draw3DModule;
bool m_Draw3DZone;
bool m_Draw3DComments;
bool m_Draw3DDrawings;
bool m_Draw3DEco1;
bool m_Draw3DEco2;
wxPoint m_BoardPos;
wxSize m_BoardSize;
int m_Layers;
EDA_BoardDesignSettings * m_BoardSettings; // Link to current board design settings
double m_Epoxy_Width; /* Epoxy tickness (normalized) */
double m_BoardScale; /* Normalisation scale for coordinates:
when scaled tey are between -1.0 and +1.0 */
double m_LayerZcoord[32];
double m_Beginx, m_Beginy; /* position of mouse */
double m_Quat[4]; /* orientation of object */
double m_Rot[4]; /* man rotation of object */
double m_Zoom; /* field of view in degrees */
S3D_Color m_BgColor;
bool m_Draw3DAxis;
bool m_Draw3DModule;
bool m_Draw3DZone;
bool m_Draw3DComments;
bool m_Draw3DDrawings;
bool m_Draw3DEco1;
bool m_Draw3DEco2;
wxPoint m_BoardPos;
wxSize m_BoardSize;
int m_Layers;
EDA_BoardDesignSettings * m_BoardSettings; // Link to current board design settings
double m_Epoxy_Width; /* Epoxy tickness (normalized) */
double m_BoardScale; /* Normalisation scale for coordinates:
when scaled tey are between -1.0 and +1.0 */
double m_LayerZcoord[32];
public:
Info_3D_Visu();
~Info_3D_Visu();
Info_3D_Visu();
~Info_3D_Visu();
};
class Pcb3D_GLCanvas: public wxGLCanvas
{
public:
WinEDA3D_DrawFrame * m_Parent;
WinEDA3D_DrawFrame * m_Parent;
private:
bool m_init;
GLuint m_gllist;
bool m_init;
GLuint m_gllist;
public:
Pcb3D_GLCanvas(WinEDA3D_DrawFrame *parent, const wxWindowID id = -1,
int* gl_attrib = NULL);
~Pcb3D_GLCanvas();
void ClearLists();
void OnPaint(wxPaintEvent& event);
void OnSize(wxSizeEvent& event);
void OnEraseBackground(wxEraseEvent& event);
void OnChar(wxKeyEvent& event);
void OnMouseEvent(wxMouseEvent& event);
void OnRightClick(wxMouseEvent& event);
void OnPopUpMenu(wxCommandEvent & event);
void TakeScreenshot(wxCommandEvent & event);
void SetView3D(int keycode);
void DisplayStatus();
void Redraw(bool finish = false);
GLuint DisplayCubeforTest();
void OnEnterWindow( wxMouseEvent& event );
void Render();
GLuint CreateDrawGL_List();
void InitGL();
void SetLights();
void Draw3D_Track(TRACK * track);
void Draw3D_Via(SEGVIA * via);
void Draw3D_DrawSegment(DRAWSEGMENT * segment);
void Draw3D_DrawText(TEXTE_PCB * text);
//int Get3DLayerEnable(int act_layer);
Pcb3D_GLCanvas( WinEDA3D_DrawFrame *parent, const wxWindowID id = -1,
int* gl_attrib = NULL);
~Pcb3D_GLCanvas();
void ClearLists();
void OnPaint(wxPaintEvent& event);
void OnSize(wxSizeEvent& event);
void OnEraseBackground(wxEraseEvent& event);
void OnChar(wxKeyEvent& event);
void OnMouseEvent(wxMouseEvent& event);
void OnRightClick(wxMouseEvent& event);
void OnPopUpMenu(wxCommandEvent & event);
void TakeScreenshot(wxCommandEvent & event);
void SetView3D(int keycode);
void DisplayStatus();
void Redraw(bool finish = false);
GLuint DisplayCubeforTest();
void OnEnterWindow( wxMouseEvent& event );
void Render();
GLuint CreateDrawGL_List();
void InitGL();
void SetLights();
void Draw3D_Track(TRACK * track);
void Draw3D_Via(SEGVIA * via);
void Draw3D_DrawSegment(DRAWSEGMENT * segment);
void Draw3D_DrawText(TEXTE_PCB * text);
//int Get3DLayerEnable(int act_layer);
DECLARE_EVENT_TABLE()
};
......@@ -124,50 +118,50 @@ DECLARE_EVENT_TABLE()
class WinEDA3D_DrawFrame: public wxFrame
{
public:
WinEDA_BasePcbFrame * m_Parent;
WinEDA_BasePcbFrame * m_Parent;
Pcb3D_GLCanvas * m_Canvas;
wxToolBar * m_HToolBar;
wxToolBar * m_VToolBar;
int m_InternalUnits;
wxPoint m_FramePos;
wxSize m_FrameSize;
wxToolBar * m_HToolBar;
wxToolBar * m_VToolBar;
int m_InternalUnits;
wxPoint m_FramePos;
wxSize m_FrameSize;
private:
wxString m_FrameName; // name used for writting and reading setup
// It is "Frame3D"
wxString m_FrameName; // name used for writting and reading setup
// It is "Frame3D"
public:
WinEDA3D_DrawFrame(WinEDA_BasePcbFrame * parent,
const wxString& title,
long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
WinEDA3D_DrawFrame( WinEDA_BasePcbFrame * parent,
const wxString& title,
long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
void Exit3DFrame(wxCommandEvent& event);
void OnCloseWindow(wxCloseEvent & Event);
void ReCreateMenuBar();
void ReCreateHToolbar();
void ReCreateVToolbar();
void SetToolbars();
void GetSettings();
void SaveSettings();
void OnLeftClick(wxDC * DC, const wxPoint& MousePos);
void OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu);
void OnKeyEvent(wxKeyEvent& event);
int BestZoom(); // Retourne le meilleur zoom
void RedrawActiveWindow(wxDC * DC, bool EraseBg);
void Process_Special_Functions(wxCommandEvent& event);
void Process_Zoom(wxCommandEvent& event);
void NewDisplay();
void Set3DBgColor();
void Set3DAxisOnOff();
void Set3DModuleOnOff();
void Set3DPlaceOnOff();
void Set3DZoneOnOff();
void Set3DCommentsOnOff();
void Set3DDrawingsOnOff();
void Set3DEco1OnOff();
void Set3DEco2OnOff();
void OnCloseWindow(wxCloseEvent & Event);
void ReCreateMenuBar();
void ReCreateHToolbar();
void ReCreateVToolbar();
void SetToolbars();
void GetSettings();
void SaveSettings();
void OnLeftClick(wxDC * DC, const wxPoint& MousePos);
void OnRightClick(const wxPoint& MousePos, wxMenu * PopMenu);
void OnKeyEvent(wxKeyEvent& event);
int BestZoom(); // Retourne le meilleur zoom
void RedrawActiveWindow(wxDC * DC, bool EraseBg);
void Process_Special_Functions(wxCommandEvent& event);
void Process_Zoom(wxCommandEvent& event);
void NewDisplay();
void Set3DBgColor();
void Set3DAxisOnOff();
void Set3DModuleOnOff();
void Set3DPlaceOnOff();
void Set3DZoneOnOff();
void Set3DCommentsOnOff();
void Set3DDrawingsOnOff();
void Set3DEco1OnOff();
void Set3DEco2OnOff();
DECLARE_EVENT_TABLE()
};
......@@ -175,17 +169,8 @@ public:
void SetGLColor(int color);
void Set_Object_Data(const S3D_Vertex * coord, int nbcoord );
global_3d Info_3D_Visu g_Parm_3D_Visu;
global_3d double g_Draw3d_dx, g_Draw3d_dy;
global_3d double ZBottom, ZTop;
global_3d double DataScale3D; // coeff de conversion unites utilsateut -> unites 3D
global_3d int gl_attrib[]
#ifdef VIEWER_MAIN
= { WX_GL_RGBA, WX_GL_MIN_RED, 8, WX_GL_MIN_GREEN, 8,
WX_GL_MIN_BLUE, 8, WX_GL_DEPTH_SIZE, 16,
WX_GL_DOUBLEBUFFER,
GL_NONE }
#endif
;
extern Info_3D_Visu g_Parm_3D_Visu;
extern double g_Draw3d_dx, g_Draw3d_dy;
extern double ZBottom, ZTop;
extern double DataScale3D; // coeff de conversion unites utilsateut -> unites 3D
extern int gl_attrib[];
......@@ -4,11 +4,56 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
email address.
2009-xxx-xx UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++All
* Removed all instances #ifdef eda_global, COMMON_GLOBL, and MAIN in order
to unobfuscate global variables.
* Moved global variables common to all applications into common.cpp.
* Moved global variables common to Pcbnew, Gerbview, and Cvpcb into
pcbcommon.cpp.
* Create pcbcommon library to prevent compiling shared PCB drawing object
files multiple times.
* Replaced round() with wxRound and eliminate MSVC specific implementation.
* Moved project configuration files into the application class.
* Moved editor name global variable into the application class.
* Created load and save settings methods for basic frame class and begin
putting global variables in the class where they are used.
* Start replacing obsolete wxWidgets file functions and redundant Kicad
file name manipulation code with wxFileName.
* Initial library search path implementation using wxPathList.
* Define correct wxFileDialog wild cards.
* Apply patch Fix typo in about box to keep MAC folks happy.
* Lots of general code clean up, spelling error fixes, and uncrustification.
* Renamed Affiche_Status_Box to UpdateStatusBar.
++EESchema
* Defined Load() method so library file drawing objects can load themselves.
* Defined GetBoundingBox() method so library file drawing objects can
calculate their own bounding box.
* Fix arc library drawing object bounding box calculation.
* Remember last import and export library path in library editor.
* Add new library search path support.
++Kicad
* Eliminate the one giant case statement to rule them all command event
handler and create per command event handlers.
++CvPcb
* Add new library search path support.
* Add message dialogs to prompt user of library file load errors instead of
failing silently.
* Fix NULL pointer bug were display frame would crash CvPcb when
WinEDA_DisplayFrame::Get_Module() could not find foot print module.
++PcbNew
* Add new library search path support.
* Add message dialogs to prompt user of library file load errors instead of
failing silently.
2009-mar-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew:
added BOM generator (in postprocess menu)
2009-mar-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++All
......@@ -24,7 +69,6 @@ email address.
================================================================================
++pcbnew:
in DRC: added test pads to holes.
++Al:
minor changes.
......@@ -66,7 +110,6 @@ email address.
print,plot: error message displayed when no layer selected.
2009-Mar-5 UPDATE Vesa Solonen <vesa.solonen@hut.fi>
================================================================================
++pcbnew:
......
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${Boost_INCLUDE_DIR}
../3d-viewer
../pcbnew
../polygon
)
......@@ -41,23 +42,36 @@ set(COMMON_SRCS
worksheet.cpp
wxwineda.cpp
zoom.cpp
)
add_library(common ${COMMON_SRCS})
set(PCB_COMMON_SRCS
pcbcommon.cpp
../pcbnew/basepcbframe.cpp
../pcbnew/class_board.cpp
../pcbnew/class_board_connected_item.cpp
../pcbnew/class_board_item.cpp
../pcbnew/class_cotation.cpp
../pcbnew/class_drawsegment.cpp
../pcbnew/class_drc_item.cpp
../pcbnew/class_edge_mod.cpp
../pcbnew/class_equipot.cpp
../pcbnew/class_marker.cpp
../pcbnew/class_mire.cpp
../pcbnew/class_module.cpp
../pcbnew/class_pad.cpp
../pcbnew/class_pad_draw_functions.cpp
../pcbnew/class_pcb_text.cpp
../pcbnew/class_text_mod.cpp
../pcbnew/class_track.cpp
../pcbnew/class_zone.cpp
../pcbnew/class_zone_setting.cpp
../pcbnew/classpcb.cpp
../pcbnew/collectors.cpp
../pcbnew/sel_layer.cpp
../pcbnew/tracemod.cpp
../pcbnew/dialog_print_using_printer_base.cpp
)
add_library(common ${COMMON_SRCS})
add_library(pcbcommon ${PCB_COMMON_SRCS})
......@@ -5,8 +5,30 @@
#include "fctsys.h"
#include "common.h"
#include "appl_wxstruct.h"
#define BUILD_VERSION wxT("(20090325-unstable)")
wxString g_BuildVersion
#ifdef HAVE_SVN_VERSION
#include "config.h"
( wxT( KICAD_SVN_VERSION ) )
#else
( BUILD_VERSION )
#endif
;
wxString g_BuildAboutVersion
#if defined(HAVE_SVN_VERSION) || defined(HAVE_SVN_REVISION)
# include "config.h"
( wxT( KICAD_ABOUT_VERSION ) )
#else
( BUILD_VERSION )
#endif
;
extern wxString g_Main_Title; // Import program title
/**********************************/
wxString SetMsg( const wxString& msg )
......@@ -33,7 +55,7 @@ void InitKiCadAbout( wxAboutDialogInfo& info )
/**************************************************/
{
/* Set name and title */
info.SetName( g_Main_Title );
info.SetName( wxGetApp().GetTitle() );
/* Set description */
wxString description;
......@@ -65,7 +87,7 @@ void InitKiCadAbout( wxAboutDialogInfo& info )
/* Check for wxMAC */
# elif defined __WXMAC__
description << ( wxT( "on Macintosch" ) );
description << ( wxT( "on Macintosh" ) );
/* Linux 64 bits */
# elif defined _LP64 && __LINUX__
......
......@@ -17,6 +17,7 @@
#include <wx/arrimpl.cpp>
WX_DEFINE_OBJARRAY( GridArray );
BASE_SCREEN* ActiveScreen = NULL;
/* defines locaux */
#define CURSOR_SIZE 12 /* taille de la croix du curseur PCB */
......@@ -39,6 +40,7 @@ BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : EDA_BaseStruct( aType )
m_UserGridIsON = FALSE;
m_Center = true;
m_CurrentSheetDesc = &g_Sheet_A4;
m_IsPrinting = false;
InitDatas();
}
......@@ -165,6 +167,20 @@ int BASE_SCREEN::Scale( int coord )
#endif
}
double BASE_SCREEN::Scale( double coord )
{
#ifdef WX_ZOOM
return coord;
#else
if( !m_Zoom )
return 0;
if( !m_ZoomScalar || !m_Zoom )
return 0;
return ( coord * (double) m_ZoomScalar ) / (double) m_Zoom;
#endif
}
void BASE_SCREEN::Scale( wxPoint& pt )
{
......
......@@ -77,18 +77,21 @@ WinEDA_BasicFrame::~WinEDA_BasicFrame()
* Virtual function
*/
/***********************************/
void
WinEDA_BasicFrame::ReCreateMenuBar()
void WinEDA_BasicFrame::ReCreateMenuBar()
/***********************************/
{
}
/*******************************/
void
WinEDA_BasicFrame::GetSettings()
/*******************************/
/**
* Load common frame parameters from configuration.
*
* The method is virtual so you can override it to load frame specific
* parameters. Don't forget to call the base method or your frames won't
* remember their positions and sizes.
*/
void WinEDA_BasicFrame::LoadSettings()
{
wxString text;
int Ypos_min;
......@@ -121,10 +124,14 @@ WinEDA_BasicFrame::GetSettings()
}
/********************************/
void
WinEDA_BasicFrame::SaveSettings()
/********************************/
/**
* Save common frame parameters from configuration.
*
* The method is virtual so you can override it to save frame specific
* parameters. Don't forget to call the base method or your frames won't
* remember their positions and sizes.
*/
void WinEDA_BasicFrame::SaveSettings()
{
wxString text;
wxConfig* config;
......@@ -149,8 +156,7 @@ WinEDA_BasicFrame::SaveSettings()
/******************************************************/
void
WinEDA_BasicFrame::PrintMsg( const wxString& text )
void WinEDA_BasicFrame::PrintMsg( const wxString& text )
/******************************************************/
{
SetStatusText( text );
......@@ -161,9 +167,7 @@ WinEDA_BasicFrame::PrintMsg( const wxString& text )
* Display a bargraph (0 to 50 point length) for a PerCent value from 0 to 100
*/
/*************************************************************************/
void
WinEDA_BasicFrame::DisplayActivity( int PerCent,
const wxString& Text )
void WinEDA_BasicFrame::DisplayActivity( int PerCent, const wxString& Text )
/*************************************************************************/
{
wxString Line;
......@@ -184,8 +188,7 @@ WinEDA_BasicFrame::DisplayActivity( int PerCent,
* Met a jour la liste des anciens projets
*/
/*******************************************************************/
void
WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName )
void WinEDA_BasicFrame::SetLastProject( const wxString& FullFileName )
/*******************************************************************/
{
wxGetApp().m_fileHistory.AddFileToHistory( FullFileName );
......@@ -231,8 +234,7 @@ wxString WinEDA_BasicFrame::GetFileFromHistory( int cmdId,
*
*/
/**************************************************************/
void
WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
void WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
/**************************************************************/
{
wxString msg;
......@@ -286,8 +288,7 @@ WinEDA_BasicFrame::GetKicadHelp( wxCommandEvent& event )
*
*/
/***********************************************************************/
void
WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) )
void WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) )
/***********************************************************************/
{
wxAboutDialogInfo info;
......@@ -300,8 +301,7 @@ WinEDA_BasicFrame::GetKicadAbout( wxCommandEvent& WXUNUSED(event) )
*
*/
/********************************************************************/
void
WinEDA_BasicFrame::ProcessFontPreferences( int id )
void WinEDA_BasicFrame::ProcessFontPreferences( int id )
/********************************************************************/
{
wxFont font;
......
......@@ -11,7 +11,7 @@
#include "common.h"
#include "macros.h"
#include "base_struct.h"
#include "sch_item_struct.h"
#include "class_drawpickedstruct.h"
#include "class_base_screen.h"
#include "class_drawpanel.h"
#include "confirm.h"
......
......@@ -4,29 +4,9 @@
#include "fctsys.h"
#include "common.h"
#include "base_struct.h"
#include "sch_item_struct.h"
#include "class_drawpickedstruct.h"
/* Constructor and destructor for SCH_ITEM */
/* They are not inline because this creates problems with gcc at linking time
* in debug mode
*/
SCH_ITEM::SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType ) :
EDA_BaseStruct( aParent, aType )
{
m_Layer = 0;
}
SCH_ITEM::~SCH_ITEM()
{
}
/**************************/
/* class DrawPickedStruct */
/**************************/
/* This class has only one useful member: .m_PickedStruct, used as a link.
* It does not describe really an item.
* It is used to create a linked list of selected items (in block selection).
......@@ -35,8 +15,8 @@ SCH_ITEM::~SCH_ITEM()
*/
/*******************************************************************/
DrawPickedStruct::DrawPickedStruct( SCH_ITEM * pickedstruct ) :
SCH_ITEM( NULL, DRAW_PICK_ITEM_STRUCT_TYPE )
DrawPickedStruct::DrawPickedStruct( EDA_BaseStruct* pickedstruct ) :
EDA_BaseStruct( NULL, DRAW_PICK_ITEM_STRUCT_TYPE )
/*******************************************************************/
{
m_PickedStruct = pickedstruct;
......@@ -68,10 +48,10 @@ EDA_Rect DrawPickedStruct::GetBoundingBox()
EDA_Rect DrawPickedStruct::GetBoundingBoxUnion()
{
EDA_Rect ret;
EDA_Rect ret;
EDA_BaseStruct* item;
DrawPickedStruct* cur = this;
DrawPickedStruct* cur = this;
SCH_ITEM* item;
while( cur && (item = cur->m_PickedStruct) != NULL )
{
ret.Merge( item->GetBoundingBox() );
......
This diff is collapsed.
......@@ -69,6 +69,7 @@ bool DrawPage( WinEDA_DrawPanel* panel )
int ClipboardSizeX, ClipboardSizeY;
bool DrawBlock = FALSE;
wxRect DrawArea;
BASE_SCREEN* screen = panel->GetScreen();
/* scale is the ratio resolution/internal units */
float scale = 82.0 / panel->m_Parent->m_InternalUnits;
......@@ -103,7 +104,7 @@ bool DrawPage( WinEDA_DrawPanel* panel )
EDA_Rect tmp = panel->m_ClipBox;
GRResetPenAndBrush( &dc );
GRForceBlackPen( s_PlotBlackAndWhite );
g_IsPrinting = TRUE;
screen->m_IsPrinting = true;
dc.SetUserScale( scale, scale );
ClipboardSizeX = dc.MaxX() + 10;
ClipboardSizeY = dc.MaxY() + 10;
......@@ -115,7 +116,7 @@ bool DrawPage( WinEDA_DrawPanel* panel )
dc.SetClippingRegion( DrawArea );
}
panel->PrintPage( &dc, Print_Sheet_Ref, -1, false );
g_IsPrinting = FALSE;
screen->m_IsPrinting = false;
panel->m_ClipBox = tmp;
wxMetafile* mf = dc.Close();
if( mf )
......
......@@ -29,7 +29,6 @@
#define newline wxString( wxT( "\n" ) )
#define space wxString( wxT( " " ) )
#define semicolon wxString( wxT( ";" ) )
#define wx_round( a ) (int) ( (a) + .5 )
#ifdef __BORLANDC__
#pragma warn -rch
......
......@@ -21,6 +21,11 @@
#include <wx/fontdlg.h>
/* Configuration entry names. */
static const wxString CursorShapeEntry( wxT( "CuShape" ) );
static const wxString ShowGridEntry( wxT( "ShGrid" ) );
BEGIN_EVENT_TABLE( WinEDA_DrawFrame, WinEDA_BasicFrame )
EVT_MOUSEWHEEL( WinEDA_DrawFrame::OnMouseEvent )
EVT_MENU_OPEN( WinEDA_DrawFrame::OnMenuOpen )
......@@ -60,6 +65,7 @@ WinEDA_DrawFrame::WinEDA_DrawFrame( wxWindow* father, int idtype,
m_Print_Sheet_Ref = TRUE; // TRUE pour avoir le cartouche imprim�
m_Draw_Auxiliary_Axis = FALSE; // TRUE pour avoir les axes auxiliares dessines
m_UnitType = INTERNAL_UNIT_TYPE; // Internal unit = inch
m_CursorShape = 0;
// Internal units per inch: = 1000 for schema, = 10000 for PCB
m_InternalUnits = EESCHEMA_INTERNAL_UNIT;
......@@ -105,7 +111,7 @@ WinEDA_DrawFrame::~WinEDA_DrawFrame()
{
if( DrawPanel ) // Required: in WinEDA3D_DrawFrame, DrawPanel == NULL !
wxGetApp().m_EDA_Config->Write( wxT( "AutoPAN" ),
DrawPanel->m_AutoPAN_Enable );
DrawPanel->m_AutoPAN_Enable );
}
......@@ -113,7 +119,7 @@ WinEDA_DrawFrame::~WinEDA_DrawFrame()
void WinEDA_DrawFrame::AddFontSelectionMenu( wxMenu* main_menu )
/*****************************************************************/
/* create the submenu for fonte selection and setup font size
/* create the submenu for font selection and setup font size
*/
{
wxMenu* fontmenu = new wxMenu();
......@@ -180,7 +186,7 @@ void WinEDA_DrawFrame::Affiche_Message( const wxString& message )
/**************************************************************/
/*
* Dispaly the meesage on yhe bottomon the frame
* Display the message on the bottom the frame
*/
{
SetStatusText( message );
......@@ -532,7 +538,7 @@ void WinEDA_DrawFrame::SetToolID( int id, int new_cursor_id,
/*****************************/
/* default virtual fonctions */
/* default virtual functions */
/*****************************/
void WinEDA_DrawFrame::OnGrid( int grid_type )
......@@ -577,11 +583,11 @@ void WinEDA_DrawFrame::AdjustScrollBars()
if( screen == NULL || DrawPanel == NULL )
return;
// La zone d'affichage est reglee a une taille double de la feuille de travail:
// The drawing size is twice the current page size.
draw_size = screen->ReturnPageSize() * 2;
// On utilise le centre de l'ecran comme position de reference, donc
// la surface de trace doit etre augmentee
// Calculate the portion of the drawing that can be displayed in the
// client area at the current zoom level.
panel_size = DrawPanel->GetClientSize();
screen->Unscale( panel_size );
......@@ -603,8 +609,14 @@ void WinEDA_DrawFrame::AdjustScrollBars()
screen->m_DrawOrg.y = -panel_size.y / 2;
}
// Calcul du nombre de scrolls (en unites de scrool )
scrollbar_number = draw_size / screen->Unscale( screen->m_ZoomScalar );
// Calculate the number of scroll bar units for the given zoom level. */
scrollbar_number.x =
wxRound( (double) draw_size.x /
(double) screen->Unscale( screen->m_ZoomScalar ) );
scrollbar_number.y =
wxRound( (double) draw_size.y /
(double) screen->Unscale( screen->m_ZoomScalar ) );
xUnit = yUnit = screen->m_ZoomScalar;
if( xUnit <= 1 )
......@@ -620,16 +632,21 @@ void WinEDA_DrawFrame::AdjustScrollBars()
scrollbar_pos.x -= panel_size.x / 2;
scrollbar_pos.y -= panel_size.y / 2;
if( scrollbar_pos.x < 0 )
if( scrollbar_pos.x <= 0 )
scrollbar_pos.x = 0;
if( scrollbar_pos.y < 0 )
if( scrollbar_pos.y <= 0 )
scrollbar_pos.y = 0;
scrollbar_pos.x /= xUnit;
scrollbar_pos.y /= yUnit;
scrollbar_pos.x = wxRound( (double) scrollbar_pos.x / (double) xUnit );
scrollbar_pos.y = wxRound( (double) scrollbar_pos.y / (double) yUnit );
screen->m_ScrollbarPos = scrollbar_pos;
screen->m_ScrollbarNumber = scrollbar_number;
wxLogDebug( wxT( "SetScrollbars(%d, %d, %d, %d, %d, %d)" ),
screen->m_ZoomScalar, screen->m_ZoomScalar,
screen->m_ScrollbarNumber.x, screen->m_ScrollbarNumber.y,
screen->m_ScrollbarPos.x, screen->m_ScrollbarPos.y );
DrawPanel->SetScrollbars( screen->m_ZoomScalar,
screen->m_ZoomScalar,
screen->m_ScrollbarNumber.x,
......@@ -648,7 +665,7 @@ void WinEDA_DrawFrame::SetDrawBgColor( int color_num )
* le parametre XorMode est mis a jour selon la couleur du fond
*/
{
if( (color_num != WHITE) && (color_num != BLACK) )
if( ( color_num != WHITE ) && ( color_num != BLACK ) )
color_num = BLACK;
g_DrawBgColor = color_num;
if( color_num == WHITE )
......@@ -688,11 +705,11 @@ void WinEDA_DrawFrame::SetLanguage( wxCommandEvent& event )
/*
* Update the status bar information.
*
* The base method updates the absolute and relative cooridinates and the
* The base method updates the absolute and relative coordinates and the
* zoom information. If you override this virtual method, make sure to call
* this subclassed method.
*/
void WinEDA_DrawFrame::Affiche_Status_Box()
void WinEDA_DrawFrame::UpdateStatusBar()
{
wxString Line;
int dx, dy;
......@@ -703,7 +720,7 @@ void WinEDA_DrawFrame::Affiche_Status_Box()
/* Display Zoom level: zoom = zoom_coeff/ZoomScalar */
if ( (screen->GetZoom() % screen->m_ZoomScalar) == 0 )
Line.Printf( wxT( "Z %d" ),screen->GetZoom() / screen->m_ZoomScalar );
Line.Printf( wxT( "Z %d" ), screen->GetZoom() / screen->m_ZoomScalar );
else
Line.Printf( wxT( "Z %.1f" ), (float)screen->GetZoom() / screen->m_ZoomScalar );
SetStatusText( Line, 1 );
......@@ -726,3 +743,38 @@ void WinEDA_DrawFrame::Affiche_Status_Box()
SetStatusText( Line, 3 );
}
/**
* Load draw frame specific configuration settings.
*
* Don't forget to call this base method from any derived classes or the
* settings will not get loaded.
*/
void WinEDA_DrawFrame::LoadSettings()
{
wxASSERT( wxGetApp().m_EDA_Config != NULL );
wxConfig* cfg = wxGetApp().m_EDA_Config;
WinEDA_BasicFrame::LoadSettings();
cfg->Read( m_FrameName + CursorShapeEntry, &m_CursorShape, ( long )0 );
cfg->Read( m_FrameName + ShowGridEntry, &m_Draw_Grid, true );
}
/**
* Save draw frame specific configuration settings.
*
* Don't forget to call this base method from any derived classes or the
* settings will not get saved.
*/
void WinEDA_DrawFrame::SaveSettings()
{
wxASSERT( wxGetApp().m_EDA_Config != NULL );
wxConfig* cfg = wxGetApp().m_EDA_Config;
WinEDA_BasicFrame::SaveSettings();
cfg->Write( m_FrameName + CursorShapeEntry, m_CursorShape );
cfg->Write( m_FrameName + ShowGridEntry, m_Draw_Grid );
}
This diff is collapsed.
......@@ -20,13 +20,15 @@ void WinEDA_App::ReadPdfBrowserInfos()
/* Read from Common config the Pdf browser choice
*/
{
if( m_EDA_CommonConfig )
{
m_PdfBrowserIsDefault = m_EDA_CommonConfig->Read( wxT( "PdfBrowserIsDefault" ), TRUE );
m_PdfBrowser = m_EDA_CommonConfig->Read( wxT( "PdfBrowserName" ), wxEmptyString );
}
wxASSERT( m_EDA_CommonConfig != NULL );
m_PdfBrowserIsDefault = m_EDA_CommonConfig->Read( wxT( "PdfBrowserIsDefault" ),
true );
m_PdfBrowser = m_EDA_CommonConfig->Read( wxT( "PdfBrowserName" ),
wxEmptyString );
if( m_PdfBrowser.IsEmpty() )
m_PdfBrowserIsDefault = TRUE;
m_PdfBrowserIsDefault = true;
}
......@@ -37,11 +39,13 @@ void WinEDA_App::WritePdfBrowserInfos()
/* Write into Common config the Pdf browser choice
*/
{
if( !m_EDA_CommonConfig )
return;
wxASSERT( m_EDA_CommonConfig != NULL );
if( m_PdfBrowser.IsEmpty() )
m_PdfBrowserIsDefault = TRUE;
m_EDA_CommonConfig->Write( wxT( "PdfBrowserIsDefault" ), m_PdfBrowserIsDefault );
m_PdfBrowserIsDefault = true;
m_EDA_CommonConfig->Write( wxT( "PdfBrowserIsDefault" ),
m_PdfBrowserIsDefault );
m_EDA_CommonConfig->Write( wxT( "PdfBrowserName" ), m_PdfBrowser );
}
......
This diff is collapsed.
......@@ -175,88 +175,6 @@ wxString MakeReducedFileName( const wxString& fullfilename,
}
/***************************************************************************/
wxString MakeFileName( const wxString& dir,
const wxString& shortname, const wxString& ext )
/***************************************************************************/
/** Function MakeFileName
* Calculate the full file name from dir, shortname and ext
* @param dir = path (can be empty)
* @param shortname = filename with or without path and/or extension
* @param ext = extension (can be empty)
* If shortname has an absolute path, or a path starts by ./ or ../,
* the path will not be modified
* If shortname has an extension, it will not be modified
* @return full filename
*/
{
wxString fullfilename;
int ii;
if( !dir.IsEmpty() )
{
if( !wxIsAbsolutePath( shortname ) )
{
if( !shortname.StartsWith( wxT( "./" ) ) && !shortname.StartsWith( wxT( "../" ) ) // under unix
&& !shortname.StartsWith( wxT( ".\\" ) ) && !shortname.StartsWith( wxT( "..\\" ) )) // under Windows
{ /* no absolute path in shortname, add dir to shortname */
fullfilename = dir;
}
}
}
fullfilename += shortname; // Add shortname to dir or use shortname only
fullfilename.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP );
/* Add an extension if shortname has no extension */
if( ext.IsEmpty() )
return fullfilename;
/* search for an extension */
ii = fullfilename.Length(); /* Get the end of name */
for( ; ii >= 0; ii-- )
{
if( fullfilename.GetChar( ii ) == '/' )
{
/* not extension: add ext */
fullfilename += ext;
break;
}
if( fullfilename.GetChar( ii ) == '.' ) /* extension exists, do nothing */
break;
}
return fullfilename;
}
/*************************************************************************/
void ChangeFileNameExt( wxString& FullFileName, const wxString& NewExt )
/**************************************************************************/
/** Function ChangeFileNameExt
* change the extension of FullFileName to NewExt.
* @param FullFileName = filename to modify
* @param NewExt = new extension for FullFileName
*/
{
wxString FileName;
FileName = FullFileName.BeforeLast( '.' );
if( !FileName.IsEmpty() )
FileName += NewExt;
else
FileName = FullFileName + NewExt;
if( FileName.StartsWith( wxT( "\"" ) ) && ( FileName.Last() != '"' ) )
FileName += wxT( "\"" );
FullFileName = FileName;
}
/*******************************************/
void AddDelimiterString( wxString& string )
/*******************************************/
......@@ -504,12 +422,10 @@ wxString FindKicadFile( const wxString& shortname )
}
/***********************************************************************************/
int ExecuteFile( wxWindow* frame, const wxString& ExecFile, const wxString& param )
/***********************************************************************************/
/* Call the executable file "ExecFile", with params "param"
*/
int ExecuteFile( wxWindow* frame, const wxString& ExecFile,
const wxString& param )
{
wxString FullFileName;
......@@ -525,7 +441,7 @@ int ExecuteFile( wxWindow* frame, const wxString& ExecFile, const wxString& para
}
wxString msg;
msg.Printf( wxT( "Command file <%s> not found" ), FullFileName.GetData() );
msg.Printf( _( "Command <%s> could not found" ), ExecFile.c_str() );
DisplayError( frame, msg, 20 );
return -1;
}
......@@ -653,16 +569,15 @@ wxString ReturnKicadDatasPath()
}
/***************************/
wxString GetEditorName()
/***************************/
/* Return the prefered editor name
/*
* Return the prefered editor name
*/
wxString& WinEDA_App::GetEditorName()
{
wxString editorname = g_EditorName;
wxString editorname = m_EditorName;
if( editorname.IsEmpty() ) // We get the prefered editor name from environment variable
// We get the prefered editor name from environment variable first.
if( editorname.IsEmpty() )
{
wxGetEnv( wxT( "EDITOR" ), &editorname );
}
......@@ -674,23 +589,18 @@ wxString GetEditorName()
#ifdef __WINDOWS__
mask += wxT( ".exe" );
#endif
editorname = EDA_FileSelector( _( "Prefered Editor:" ),
wxEmptyString, /* Default path */
wxEmptyString, /* default filename */
wxEmptyString, /* default filename extension */
mask, /* filter for filename list */
NULL, /* parent frame */
wxFD_OPEN, /* wxFD_SAVE, wxFD_OPEN ..*/
TRUE /* true = keep the current path */
);
editorname = EDA_FileSelector( _( "Prefered Editor:" ), wxEmptyString,
wxEmptyString, wxEmptyString, mask,
NULL, wxFD_OPEN, true );
}
if( ( !editorname.IsEmpty() ) && wxGetApp().m_EDA_CommonConfig )
if( !editorname.IsEmpty() )
{
g_EditorName = editorname;
wxGetApp().m_EDA_CommonConfig->Write( wxT( "Editor" ), g_EditorName );
m_EditorName = editorname;
m_EDA_CommonConfig->Write( wxT( "Editor" ), m_EditorName );
}
return g_EditorName;
return m_EditorName;
}
......@@ -815,3 +725,9 @@ void OpenFile( const wxString& file )
if( success && !command.IsEmpty() )
ProcessExecute( command );
}
wxString QuoteFullPath( wxFileName& fn, wxPathFormat format )
{
return wxT( "\"" ) + fn.GetFullPath() + wxT( "\"" );
}
This diff is collapsed.
......@@ -31,6 +31,14 @@
* and remember users can have old versions with bugs
*/
/* variables generales */
// pour les tracs en mode XOR = GR_XOR ou GR_NXOR selon couleur de fond
int g_XorMode = GR_NXOR;
// couleur de fond de la frame de dessin
int g_DrawBgColor = WHITE;
#define USE_CLIP_FILLED_POLYGONS
#ifdef USE_CLIP_FILLED_POLYGONS
......@@ -1480,21 +1488,17 @@ void GRSetTextFgColor( wxDC* DC, int Color )
/*********************************************************/
/* Set the foreground color used to draw texts */
{
DC->SetTextForeground( wxColour(
ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue )
);
DC->SetTextForeground( wxColour( ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue ) );
}
void GRSetTextFgColor( wxDC* DC, wxFont*, int Color )
{
DC->SetTextForeground( wxColour(
ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue )
);
DC->SetTextForeground( wxColour( ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue ) );
}
......@@ -1533,22 +1537,18 @@ void GRSetTextBgColor( wxDC* DC, int Color )
/* Set the background color used to draw texts */
{
Color &= MASKCOLOR; // keep only the bits used to select the color
DC->SetTextBackground( wxColour(
ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue )
);
DC->SetTextBackground( wxColour( ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue ) );
}
void GRSetTextBgColor( wxDC* DC, wxFont*, int Color )
{
Color &= MASKCOLOR; // keep only the bits used to select the color
DC->SetTextBackground( wxColour(
ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue )
);
DC->SetTextBackground( wxColour( ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue ) );
}
#ifdef USE_CLIP_FILLED_POLYGONS
......
......@@ -18,6 +18,19 @@
#include "wxstruct.h"
wxString g_CommonSectionTag( wxT( "[common]" ) );
wxString g_SchematicSectionTag( wxT( "[eeschema]" ) );
wxString g_LibEditSectionTag( wxT( "[libedit]" ) );
wxString g_BoardEditorSectionTag( wxT( "[pcbnew]" ) );
wxString g_ModuleEditSectionTag( wxT( "[footprinteditor]" ) );
/* 0 = files are in Home directory (usefull under unix)
* 1 = kicad/template ( usefull only under windows )
* 2 ... = unused
*/
int g_ConfigFileLocationChoice;
/* Class to handle hotkey commnands. hotkeys have a default value
* This class allows the real key code changed by user from a key code list file
*/
......@@ -618,8 +631,7 @@ void AddHotkeyConfigMenu( wxMenu* menu )
item = new wxMenuItem( menu, ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
_( "Show Current Hotkey List" ),
_( "Show the current hotkey config" )
);
_( "Show the current hotkey config" ) );
item->SetBitmap( info_xpm );
menu->Append( item );
......@@ -631,8 +643,8 @@ void AddHotkeyConfigMenu( wxMenu* menu )
menu->Append( item );
item = new wxMenuItem( menu, ID_PREFERENCES_READ_CONFIG_HOTKEYS,
_( "Reread Hotkey config file" ),
_( "Reread the hotkey config file" ) );
_( "Reread Hotkey config file" ),
_( "Reread the hotkey config file" ) );
item->SetBitmap( reload_xpm );
menu->Append( item );
item = new wxMenuItem( menu, ID_PREFERENCES_EDIT_CONFIG_HOTKEYS,
......@@ -654,12 +666,11 @@ void AddHotkeyConfigMenu( wxMenu* menu )
wxITEM_CHECK );
submenu_hkcfg->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( menu, submenu_hkcfg,
-1,
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( menu, submenu_hkcfg, -1,
_( "Hotkey config location" ),
_(
"Hotkey config file location selection (home directory or kicad tree)" ),
right_xpm );
_( "Hotkey config file location " \
"selection (home directory or " \
"kicad tree)" ), right_xpm );
submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_HOME,
g_ConfigFileLocationChoice == 0 );
submenu_hkcfg->Check( ID_PREFERENCES_HOTKEY_PATH_IS_KICAD,
......@@ -678,8 +689,8 @@ void HandleHotkeyConfigMenuSelection( WinEDA_DrawFrame* frame, int id )
*/
{
wxMenuBar* menu = frame->GetMenuBar();
wxConfig * config = wxGetApp().m_EDA_CommonConfig;
wxASSERT( config != NULL );
wxConfig* config = wxGetApp().m_EDA_CommonConfig;
switch( id )
{
......
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2008 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* This file contains the global constants and variables used in the PCB
* applications PCBNEW, CvPcb, and GervView. The goal of this was to
* unobfuscate the original header file design that made it very difficult
* to figure out where these variables lived. Ideally, they should be pushed
* back into the application layer.
*/
#include "fctsys.h"
#include "pcbcommon.h"
#include "plot_common.h"
#include "class_zone_setting.h"
/* Look up Table for conversion one layer number -> one bit layer mask: */
int g_TabOneLayerMask[LAYER_COUNT] = {
0x00000001, 0x00000002, 0x00000004, 0x00000008,
0x00000010, 0x00000020, 0x00000040, 0x00000080,
0x00000100, 0x00000200, 0x00000400, 0x00000800,
0x00001000, 0x00002000, 0x00004000, 0x00008000,
0x00010000, 0x00020000, 0x00040000, 0x00080000,
0x00100000, 0x00200000, 0x00400000, 0x00800000,
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000
};
/* Look up Table for conversion copper layer count -> general copper layer
* mask: */
int g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = {
0x0001, 0x8001, 0x8003, 0x8007,
0x800F, 0x801F, 0x803F, 0x807F,
0x80FF, 0x81FF, 0x83FF, 0x87FF,
0x8FFF, 0x9FFF, 0xCFFF, 0xFFFF
};
wxString g_ViaType_Name[4] = {
_( "??? Via" ), // Not used yet
_( "Micro Via" ), // from external layer (TOP or BOTTOM) from the near neightbour inner layer only
_( "Blind/Buried Via" ), // from inner or external to inner or external layer (no restriction)
_( "Through Via" ) // Usual via (from TOP to BOTTOM layer only )
};
wxArrayString g_LibName_List; // library list to load
BOARD_ITEM* g_UnDeleteStack[UNDELETE_STACK_SIZE]; // Linked list of deleted items
int g_UnDeleteStackPtr;
bool g_ShowGrid = true;
DISPLAY_OPTIONS DisplayOpt; /* Display options for board items */
/* PCB file name extension definitions. */
wxString PcbExtBuffer( wxT( "brd" ) );
wxString g_SaveFileName( wxT( "$savepcb" ) );
wxString NetExtBuffer( wxT( "net" ) );
wxString NetCmpExtBuffer( wxT( "cmp" ) );
wxString g_Shapes3DExtBuffer( wxT( "wrl" ) );
const wxString ModuleFileExtension( wxT( "mod" ) );
/* PCB file name wild card definitions. */
const wxString ModuleFileWildcard( _( "Kicad footprint library files " \
"(*.mod)|*.mod") );
int g_CurrentVersionPCB = 1;
/* variables generales */
int g_TimeOut; // Timer for automatic saving
int g_SaveTime; // Time for next saving
int g_AnchorColor = BLUE;
int g_ModuleTextCMPColor = LIGHTGRAY;
int g_ModuleTextCUColor = MAGENTA;
int g_ModuleTextNOVColor = DARKGRAY;
int g_PadCUColor = GREEN;
int g_PadCMPColor = RED;
// Current designe settings:
class EDA_BoardDesignSettings g_DesignSettings;
/**
* Used in track creation, a list of track segments currently being created,
* with the newest track at the end of the list, sorted by new-ness. e.g. use
* TRACK->Back() to get the next older track, TRACK->Next() to get the next
* newer track.
*/
DLIST<TRACK> g_CurrentTrackList;
PCB_SCREEN* ScreenPcb = NULL;
BOARD* g_ModuleEditor_Pcb = NULL;
int g_GridRoutingSize = 250;
bool g_Zone_45_Only = FALSE;
/* HPGL plot settings. */
int g_HPGL_Pen_Num = 1; /* num de plume a charger */
int g_HPGL_Pen_Speed = 40; /* vitesse en cm/s */
int g_HPGL_Pen_Diam; /* diametre en mils */
int g_HPGL_Pen_Recouvrement; /* recouvrement en mils ( pour remplissages */
float Scale_X;
float Scale_Y; /* coeff d'agrandissement en X et Y demandes */
int PlotMarge;
int g_PlotLine_Width;
int g_PlotFormat = PLOT_FORMAT_GERBER;
int g_PlotOrient;
wxPoint g_PlotOffset;
FILE* dest = NULL;
/* id for plot format (see enum PlotFormat in plot_common.h) */
int g_PlotScaleOpt;
int g_DrillShapeOpt;
// Default setting used when creating a new zone
ZONE_SETTING g_Zone_Default_Setting;
D_PAD g_Pad_Master( (MODULE*) NULL );
This diff is collapsed.
/****************************************************/
/* class_drawpickedstruct.cpp */
/****************************************************/
#include "fctsys.h"
#include "common.h"
#include "gr_basic.h"
#include "base_struct.h"
#include "sch_item_struct.h"
#include "class_sch_screen.h"
#include "class_drawpanel.h"
#include "wxEeschemaStruct.h"
#include "program.h"
#include "general.h"
#include "libcmp.h"
#include "protos.h"
/* Constructor and destructor for SCH_ITEM */
/* They are not inline because this creates problems with gcc at linking time
* in debug mode
*/
SCH_ITEM::SCH_ITEM( EDA_BaseStruct* aParent, KICAD_T aType ) :
EDA_BaseStruct( aParent, aType )
{
m_Layer = 0;
}
SCH_ITEM::~SCH_ITEM()
{
}
/**
* place the struct in EEDrawList.
* if it is a new item, it it also put in undo list
* for an "old" item, saving it in undo list must be done before editiing,
* and not here!
*/
void SCH_ITEM::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
{
if( m_Flags & IS_NEW )
{
SCH_SCREEN* screen = frame->GetScreen();
if( !screen->CheckIfOnDrawList( this ) ) //don't want a loop!
screen->AddToDrawList( this );
g_ItemToRepeat = this;
frame->SaveCopyInUndoList( this, IS_NEW );
}
m_Flags = 0;
frame->GetScreen()->SetModify();
frame->GetScreen()->SetCurItem( NULL );
frame->DrawPanel->ManageCurseur = NULL;
frame->DrawPanel->ForceCloseManageCurseur = NULL;
if( DC )
{
frame->DrawPanel->CursorOff( DC ); // Erase schematic cursor
RedrawOneStruct( frame->DrawPanel, DC, this, GR_DEFAULT_DRAWMODE );
frame->DrawPanel->CursorOn( DC ); // Display schematic cursor
}
}
......@@ -213,7 +213,7 @@ int ArcTangente( int dy, int dx )
}
fangle = atan2( (double) dy, (double) dx ) / M_PI * 1800;
return (int) round( fangle );
return wxRound( fangle );
}
......@@ -265,8 +265,8 @@ void RotatePoint( int* pX, int* pY, int angle )
fpx = (*pY * fsinus[angle]) + (*pX * fcosinus[angle]);
fpy = (*pY * fcosinus[angle]) - (*pX * fsinus[angle]);
*pX = (int) round( fpx );
*pY = (int) round( fpy );
*pX = wxRound( fpx );
*pY = wxRound( fpy );
}
}
......
This diff is collapsed.
......@@ -51,11 +51,11 @@ void WinEDA_DrawFrame::PutOnGrid( wxPoint* coord )
if( !GetBaseScreen()->m_UserGridIsON )
{
int tmp = (int) round( coord->x / grid_size.x );
coord->x = (int) round( tmp * grid_size.x );
int tmp = wxRound( coord->x / grid_size.x );
coord->x = wxRound( tmp * grid_size.x );
tmp = (int) round( coord->y / grid_size.y );
coord->y = (int) round ( tmp * grid_size.y );
tmp = wxRound( coord->y / grid_size.y );
coord->y = wxRound ( tmp * grid_size.y );
}
}
......@@ -180,7 +180,7 @@ void WinEDA_DrawFrame::OnZoom( wxCommandEvent& event )
Recadre_Trace( true );
}
Affiche_Status_Box();
UpdateStatusBar();
}
void WinEDA_DrawPanel::OnPopupGridSelect( wxCommandEvent& event )
......
......@@ -29,15 +29,15 @@ set(CVPCB_SRCS
writenetlistpcbnew.cpp)
set(CVPCB_EXTRA_SRCS
../pcbnew/class_board_item.cpp
../pcbnew/class_drawsegment.cpp
../pcbnew/class_edge_mod.cpp
../pcbnew/class_equipot.cpp
../pcbnew/class_module.cpp
../pcbnew/class_text_mod.cpp
../pcbnew/class_track.cpp
# ../pcbnew/class_board_item.cpp
# ../pcbnew/class_drawsegment.cpp
# ../pcbnew/class_edge_mod.cpp
# ../pcbnew/class_equipot.cpp
# ../pcbnew/class_module.cpp
# ../pcbnew/class_text_mod.cpp
../pcbnew/ioascii.cpp
../pcbnew/tracemod.cpp)
# ../pcbnew/tracemod.cpp
)
if(WIN32)
if(MINGW)
......@@ -59,7 +59,7 @@ endif(APPLE)
add_executable(cvpcb WIN32 MACOSX_BUNDLE ${CVPCB_SRCS} ${CVPCB_EXTRA_SRCS} ${CVPCB_RESOURCES})
target_link_libraries(cvpcb 3d-viewer common polygon bitmaps kbool ${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES})
target_link_libraries(cvpcb 3d-viewer common pcbcommon polygon bitmaps kbool ${OPENGL_LIBRARIES} ${wxWidgets_LIBRARIES})
install(TARGETS cvpcb
DESTINATION ${KICAD_BIN}
......
/**********************/
/* CVPCB: autosel.cpp */
/**********************/
/**********************/
/* CVPCB: autosel.cpp */
/**********************/
/* Routines de selection automatique des modules */
......@@ -8,6 +8,7 @@
#include "common.h"
#include "confirm.h"
#include "gestfich.h"
#include "appl_wxstruct.h"
#include "cvpcb.h"
#include "protos.h"
......@@ -18,155 +19,184 @@
class AUTOMODULE
{
public:
int m_Type;
AUTOMODULE * Pnext;
wxString m_Name;
wxString m_LibName;
wxString m_Library;
int m_Type;
AUTOMODULE* Pnext;
wxString m_Name;
wxString m_LibName;
wxString m_Library;
AUTOMODULE() { m_Type = 0; Pnext = NULL; }
} ;
AUTOMODULE() { m_Type = 0; Pnext = NULL; }
};
/* routines locales : */
static int auto_select(WinEDA_CvpcbFrame * frame, STORECMP * Cmp, AUTOMODULE * BaseListeMod);
static void auto_associe(WinEDA_CvpcbFrame * frame);
static int auto_select( WinEDA_CvpcbFrame* frame,
STORECMP* Cmp,
AUTOMODULE* BaseListeMod );
static void auto_associe( WinEDA_CvpcbFrame* frame );
/*************************************************************/
void WinEDA_CvpcbFrame::AssocieModule(wxCommandEvent& event)
/*************************************************************/
void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event )
/*************************************************************/
/* Fonction liee au boutton "Auto"
Lance l'association automatique modules/composants
*/
* Lance l'association automatique modules/composants
*/
{
auto_associe(this);
auto_associe( this );
}
/**************************************************/
static void auto_associe(WinEDA_CvpcbFrame * frame)
static void auto_associe( WinEDA_CvpcbFrame* frame )
/**************************************************/
{
unsigned ii, j, k;
wxString EquivFileName, msg;
char Line[1024];
FILE *fichierstf ; /* sert en lecture des differents fichiers *.STF */
AUTOMODULE * ItemModule,* NextMod;
AUTOMODULE * BaseListeMod = NULL;
STORECMP * Component;
int nb_correspondances = 0;
if( nbcomp <= 0 ) return;
/* recherche des equivalences a travers les fichiers possibles */
for( ii= 0 ; ii < g_ListName_Equ.GetCount(); ii++)
{
/* Calcul du nom complet avec son chemin */
EquivFileName = MakeFileName(g_RealLibDirBuffer,g_ListName_Equ[ii],g_EquivExtBuffer);
if ( (fichierstf = wxFopen(EquivFileName, wxT("rt"))) == 0)
{
msg.Printf( _("Library: <%s> not found"),EquivFileName.GetData());
DisplayError(frame, msg,10);
continue ;
}
/* lecture fichier n */
while ( fgets(Line,79,fichierstf) != 0 )
{
/* elimination des lignes vides */
for (j = 0 ; j < 40 ; j++ )
{
if (Line[j] == 0 ) goto fin_de_while ;
if (Line[j] == QUOTE ) break ;
}
ItemModule = new AUTOMODULE();
ItemModule->Pnext = BaseListeMod;
BaseListeMod = ItemModule;
/* stockage du composant ( 'namecmp' 'namelib')
name et namelib */
for ( j++ ; j < 40 ; j++, k++)
{
if ( Line[j] == QUOTE) break ;
ItemModule->m_Name.Append(Line[j]);
}
j++ ;
for ( ; j < 80 ; ) if (Line[j++] == QUOTE) break ;
for (; ; j++)
{
if (Line[j] == QUOTE) break ;
ItemModule->m_LibName.Append(Line[j]);
}
nb_correspondances++ ;
fin_de_while:;
}
fclose(fichierstf) ;
/* Affichage Statistiques */
msg.Printf(_("%d equivalences"),nb_correspondances);
frame->SetStatusText(msg, 0);
}
Component = g_BaseListeCmp;
for ( ii = 0; Component != NULL; Component = Component->Pnext, ii++ )
{
frame->m_ListCmp->SetSelection(ii,TRUE);
if( Component->m_Module.IsEmpty() )
auto_select(frame, Component, BaseListeMod);
}
/* Liberation memoire */
for( ItemModule = BaseListeMod; ItemModule != NULL; ItemModule = NextMod)
{
NextMod = ItemModule->Pnext; delete ItemModule;
}
BaseListeMod = NULL;
wxFileName fn;
unsigned ii, j, k;
wxString msg, tmp;
char Line[1024];
FILE* file;
AUTOMODULE* ItemModule, * NextMod;
AUTOMODULE* BaseListeMod = NULL;
STORECMP* Component;
int nb_correspondances = 0;
if( nbcomp <= 0 )
return;
/* recherche des equivalences a travers les fichiers possibles */
for( ii = 0; ii < g_ListName_Equ.GetCount(); ii++ )
{
fn = g_ListName_Equ[ii];
fn.SetExt( EquivFileExtension );
tmp = wxGetApp().GetLibraryPathList().FindValidPath( fn.GetFullName() );
if( !tmp )
{
msg.Printf( _( "Footprint alias library file <%s> could not be " \
"found in the default search paths." ),
fn.GetFullName().c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
continue;
}
file = wxFopen( tmp, wxT( "rt" ) );
if( file == NULL )
{
msg.Printf( _( "Error opening alias library <%s>." ), tmp.c_str() );
wxMessageBox( msg, titleLibLoadError, wxOK | wxICON_ERROR );
continue;
}
/* lecture fichier n */
while( fgets( Line, 79, file ) != 0 )
{
/* elimination des lignes vides */
for( j = 0; j < 40; j++ )
{
if( Line[j] == 0 )
goto fin_de_while;
if( Line[j] == QUOTE )
break;
}
ItemModule = new AUTOMODULE();
ItemModule->Pnext = BaseListeMod;
BaseListeMod = ItemModule;
/* stockage du composant ( 'namecmp' 'namelib')
* name et namelib */
for( j++; j < 40; j++, k++ )
{
if( Line[j] == QUOTE )
break;
ItemModule->m_Name.Append( Line[j] );
}
j++;
for( ; j < 80; )
if( Line[j++] == QUOTE )
break;
for( ; ; j++ )
{
if( Line[j] == QUOTE )
break;
ItemModule->m_LibName.Append( Line[j] );
}
nb_correspondances++;
fin_de_while:;
}
fclose( file );
/* Affichage Statistiques */
msg.Printf( _( "%d equivalences" ), nb_correspondances );
frame->SetStatusText( msg, 0 );
}
Component = g_BaseListeCmp;
for( ii = 0; Component != NULL; Component = Component->Pnext, ii++ )
{
frame->m_ListCmp->SetSelection( ii, TRUE );
if( Component->m_Module.IsEmpty() )
auto_select( frame, Component, BaseListeMod );
}
/* Liberation memoire */
for( ItemModule = BaseListeMod; ItemModule != NULL; ItemModule = NextMod )
{
NextMod = ItemModule->Pnext; delete ItemModule;
}
BaseListeMod = NULL;
}
/****************************************************************/
static int auto_select(WinEDA_CvpcbFrame * frame, STORECMP * Cmp,
AUTOMODULE * BaseListeMod)
static int auto_select( WinEDA_CvpcbFrame* frame, STORECMP* Cmp,
AUTOMODULE* BaseListeMod )
/****************************************************************/
/* associe automatiquement composant et Module
Retourne;
0 si OK
1 si module specifie non trouve en liste librairie
2 si pas de module specifie dans la liste des equivalences
*/
* Retourne;
* 0 si OK
* 1 si module specifie non trouve en liste librairie
* 2 si pas de module specifie dans la liste des equivalences
*/
{
AUTOMODULE * ItemModule;
STOREMOD * Module;
wxString msg;
/* examen de la liste des correspondances */
ItemModule = BaseListeMod;
for ( ; ItemModule != NULL; ItemModule = ItemModule->Pnext )
{
if ( ItemModule->m_Name.CmpNoCase(Cmp->m_Valeur) != 0) continue;
/* Correspondance trouvee, recherche nom module dans la liste des
modules disponibles en librairie */
Module= g_BaseListePkg;
for ( ;Module != NULL; Module = Module->Pnext )
{
if( ItemModule->m_LibName.CmpNoCase(Module->m_Module) == 0 )
{ /* empreinte trouve */
frame->SetNewPkg(Module->m_Module);
return(0);
}
}
msg.Printf(
_("Component %s: Footprint %s not found in libraries"),
Cmp->m_Valeur.GetData(), ItemModule->m_LibName.GetData());
DisplayError(frame, msg, 10);
return( 2 );
}
return(1);
AUTOMODULE* ItemModule;
STOREMOD* Module;
wxString msg;
/* examen de la liste des correspondances */
ItemModule = BaseListeMod;
for( ; ItemModule != NULL; ItemModule = ItemModule->Pnext )
{
if( ItemModule->m_Name.CmpNoCase( Cmp->m_Valeur ) != 0 )
continue;
/* Correspondance trouvee, recherche nom module dans la liste des
* modules disponibles en librairie */
Module = g_BaseListePkg;
for( ; Module != NULL; Module = Module->Pnext )
{
if( ItemModule->m_LibName.CmpNoCase( Module->m_Module ) == 0 )
{
frame->SetNewPkg( Module->m_Module );
return 0;
}
}
msg.Printf( _( "Component %s: Footprint %s not found in libraries" ),
Cmp->m_Valeur.GetData(), ItemModule->m_LibName.GetData() );
DisplayError( frame, msg, 10 );
return 2;
}
return 1;
}
......@@ -30,20 +30,35 @@ void Read_Config( const wxString& FileName )
* le chemin de l'executable cvpcb.exe doit etre dans BinDir
*/
{
wxString FullFileName = FileName;
wxFileName fn = FileName;
/* Init des valeurs par defaut */
g_LibName_List.Clear();
g_ListName_Equ.Clear();
wxGetApp().ReadProjectConfig( FullFileName,
if( fn.GetExt() != ProjectFileExtension )
fn.SetExt( ProjectFileExtension );
if( wxGetApp().GetLibraryPathList().Index( g_UserLibDirBuffer ) != wxNOT_FOUND )
{
wxLogDebug( wxT( "Removing path <%s> to library path search list." ),
g_UserLibDirBuffer.c_str() );
wxGetApp().GetLibraryPathList().Remove( g_UserLibDirBuffer );
}
wxGetApp().ReadProjectConfig( fn.GetFullPath(),
GROUP, ParamCfgList, FALSE );
if( NetInExtBuffer.IsEmpty() )
NetInExtBuffer = wxT( ".net" );
if( g_NetlistFileExtension.IsEmpty() )
g_NetlistFileExtension = wxT( "net" );
/* Inits autres variables */
SetRealLibraryPath( wxT( "modules" ) );
if( wxFileName::DirExists( g_UserLibDirBuffer )
&& wxGetApp().GetLibraryPathList().Index( g_UserLibDirBuffer ) == wxNOT_FOUND )
{
wxLogDebug( wxT( "Adding path <%s> to library path search list." ),
g_UserLibDirBuffer.c_str() );
wxGetApp().GetLibraryPathList().Add( g_UserLibDirBuffer );
}
}
......@@ -55,36 +70,22 @@ void WinEDA_CvpcbFrame::Update_Config( wxCommandEvent& event )
* la vraie fonction de sauvegarde de la config
*/
{
Save_Config( this );
Save_Config( this, m_NetlistFileName.GetFullPath() );
}
/************************************/
void Save_Config( wxWindow* parent )
/************************************/
/* enregistrement de la config */
void Save_Config( wxWindow* parent, const wxString& fileName )
{
wxString path, FullFileName;
wxString mask( wxT( "*" ) );
wxFileName fn = fileName;
FullFileName = FFileName;
ChangeFileNameExt( FullFileName, g_Prj_Config_Filename_ext );
fn.SetExt( ProjectFileExtension );
path = wxGetCwd();
FullFileName = EDA_FileSelector( _( "Save preferences" ),
path, /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */
g_Prj_Config_Filename_ext, /* extension par defaut */
mask, /* Masque d'affichage */
parent,
wxFD_SAVE,
TRUE
);
wxFileDialog dlg( parent, _( "Save Project File" ), fn.GetPath(),
fn.GetFullName(), ProjectFileWildcard, wxFD_SAVE );
if( FullFileName.IsEmpty() )
if( dlg.ShowModal() == wxID_CANCEL )
return;
/* ecriture de la configuration */
wxGetApp().WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
wxGetApp().WriteProjectConfig( dlg.GetPath(), GROUP, ParamCfgList );
}
......@@ -2,10 +2,6 @@
/** cfg.h : configuration: definition des structures **/
/*******************************************************/
#ifndef eda_global
#define eda_global extern
#endif
#include "param_config.h"
#define INSETUP TRUE
......@@ -40,7 +36,7 @@ static PARAM_CFG_LIBNAME_LIST EquivNameBufCfg
static PARAM_CFG_WXSTRING NetInExtBufCfg
(
wxT("NetIExt"), /* identification */
&NetInExtBuffer
&g_NetlistFileExtension
);
static PARAM_CFG_WXSTRING NetDirBufCfg
......
This diff is collapsed.
/*******************/
/* File: cvpcb.cpp */
/*******************/
#define MAIN
#define eda_global
#include "fctsys.h"
#include "appl_wxstruct.h"
......@@ -19,7 +17,36 @@
#include <wx/snglinst.h>
wxString g_Main_Title = wxT( "CVpcb" );
/* Constant string definitions for CvPcb */
const wxString ComponentFileExtension( wxT( "cmp" ) );
const wxString RetroFileExtension( wxT( "stf" ) );
const wxString EquivFileExtension( wxT( "equ" ) );
/* TODO: What is a stuff file??? Please fix this wild card in English if
* you know. */
const wxString RetroFileWildcard( _( "Kicad component list files (*.stf)|*.stf" ) );
const wxString EquivFileWildcard( _( "Kicad footprint alias files (*.equ)|*.equ" ) );
const wxString titleLibLoadError( _( "Library Load Error" ) );
/* Global variables used in CVPcb. */
int g_FlagEESchema;
int Rjustify;
int modified;
int nbcomp;
int nblib;
int composants_non_affectes;
STOREMOD* g_BaseListePkg = NULL;
STORECMP* g_BaseListeCmp = NULL;
wxString g_UserNetDirBuffer; // Netlist path (void = current working directory)
wxString g_NetlistFileExtension;
wxArrayString g_ListName_Equ; // list of .equ files to load
// Create a new application object
IMPLEMENT_APP( WinEDA_App )
......@@ -32,11 +59,12 @@ IMPLEMENT_APP( WinEDA_App )
bool WinEDA_App::OnInit()
{
wxFileName fn;
wxString msg;
wxString currCWD = wxGetCwd();
WinEDA_CvpcbFrame* frame = NULL;
InitEDA_Appl( wxT( "cvpcb" ) );
InitEDA_Appl( wxT( "CVpcb" ) );
if( m_Checker && m_Checker->IsAnotherRunning() )
{
......@@ -51,17 +79,14 @@ bool WinEDA_App::OnInit()
if( argc > 1 )
{
NetInNameBuffer = argv[1];
NetNameBuffer = argv[1];
wxLogDebug( wxT( "CvPcb opening file <%s>" ), argv[1] );
fn = argv[1];
wxSetWorkingDirectory( fn.GetPath() );
}
if( !NetInNameBuffer.IsEmpty() )
wxSetWorkingDirectory( wxPathOnly( NetInNameBuffer ) );
g_DrawBgColor = BLACK;
Read_Config( NetInNameBuffer );
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
wxString Title = GetTitle() + wxT( " " ) + GetBuildVersion();
frame = new WinEDA_CvpcbFrame( Title );
msg.Printf( wxT( "Modules: %d" ), nblib );
......@@ -70,25 +95,28 @@ bool WinEDA_App::OnInit()
// Show the frame
SetTopWindow( frame );
frame->Show( TRUE );
Read_Config( fn.GetFullPath() );
listlib();
frame->Show( TRUE );
frame->BuildFootprintListBox();
if( !NetInNameBuffer.IsEmpty() ) /* nom de fichier passe a la commande */
if( fn.IsOk() && fn.FileExists() )
{
FFileName = MakeFileName( NetDirBuffer,
NetInNameBuffer, NetInExtBuffer );
frame->m_NetlistFileName = fn;
frame->ReadNetListe();
}
else /* Mise a jour du titre de la fenetre principale */
{
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
msg.Printf( wxT( "%s {%s%c} [no file]" ),
Title.GetData(), wxGetCwd().GetData(), DIR_SEP );
frame->SetTitle( msg );
if( frame->ReadNetList() )
{
g_NetlistFileExtension = fn.GetExt();
return true;
}
}
return TRUE;
listlib();
g_NetlistFileExtension = wxT( "net" );
frame->m_NetlistFileName.Clear();
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() +
wxGetCwd() + wxFileName::GetPathSeparator() +
_( " [no file]" ) );
return true;
}
......@@ -2,23 +2,28 @@
/* CVPCB : declaration des variables globales */
/**********************************************/
#ifndef __CVPCB_H__
#define __CVPCB_H__
#ifndef eda_global
#define eda_global extern
#endif
#include "pcbnew.h"
#include "pcbcommon.h"
// config for footprints doc file acces
#define DOC_FOOTPRINTS_LIST_KEY wxT("footprints_doc_file")
#define DEFAULT_FOOTPRINTS_LIST_FILENAME wxT("footprints_doc/footprints.pdf")
// Define print format to display a schematic component line
#define CMP_FORMAT wxT( "%3d %8s - %16s : %-.32s" )
#define FILTERFOOTPRINTKEY "FilterFootprint"
/* Types de netliste: */
#define TYPE_NON_SPECIFIE 0
#define TYPE_ORCADPCB2 1
#define TYPE_PCAD 2
#define TYPE_VIEWLOGIC_WIR 3
#define TYPE_VIEWLOGIC_NET 4
enum TypeOfStruct {
STRUCT_NOT_INIT,
STRUCT_COMPONENT,
......@@ -79,75 +84,36 @@ public:
};
eda_global STOREMOD* g_BaseListePkg;
eda_global STORECMP* g_BaseListeCmp;
/* Gestion des noms des librairies */
extern const wxString EquivFileExtension;
extern const wxString RetroFileExtension;
extern const wxString ComponentFileExtension;
eda_global FILE* source;
eda_global FILE* dest;
eda_global FILE* libcmp;
eda_global FILE* lib_module;
extern const wxString RetroFileWildcard;
extern const wxString EquivFileWildcard;
/* nom des fichiers a traiter */
eda_global wxString FFileName;
eda_global wxString NetNameBuffer;
extern const wxString titleLibLoadError;
/* Types de netliste: */
#define TYPE_NON_SPECIFIE 0
#define TYPE_ORCADPCB2 1
#define TYPE_PCAD 2
#define TYPE_VIEWLOGIC_WIR 3
#define TYPE_VIEWLOGIC_NET 4
/* CvPcb global variable definition references. */
extern STOREMOD* g_BaseListePkg;
extern STORECMP* g_BaseListeCmp;
extern wxString g_NetlistFileExtension;
extern wxString g_UserNetDirBuffer;
extern wxArrayString g_ListName_Equ; // list of .equ files to load
extern int g_FlagEESchema;
extern int Rjustify; /* flag pout troncature des noms de Net:
* = 0: debut de chaine conservee (->ORCADPCB2)
* = 1: fin de chaine conservee (->VIEWLOGIC) */
extern int modified; /* Flag != 0 si modif attribution des module. */
extern int nbcomp; /* nombre de composants trouves */
extern int nblib; /* nombre d'empreintes trouvees */
extern int composants_non_affectes; /* nbre de composants non affectes */
/* Gestion des noms des librairies */
eda_global wxString g_EquivExtBuffer
#ifdef MAIN
( wxT( ".equ" ) )
#endif
;
eda_global wxString g_ExtCmpBuffer
#ifdef MAIN
( wxT( ".cmp" ) )
#endif
;
eda_global wxString g_UserNetDirBuffer; // Netlist path (void = current working directory)
eda_global wxArrayString g_ListName_Equ; // list of .equ files to load
eda_global int g_FlagEESchema;
eda_global int Rjustify; /* flag pout troncature des noms de Net:
* = 0: debut de chaine conservee (->ORCADPCB2)
* = 1: fin de chaine conservee (->VIEWLOGIC) */
eda_global int selection_type; /* 0 pour sel par U??, 1 pour sel par ref ORCADPCB */
eda_global int modified; /* Flag != 0 si modif attribution des modules */
eda_global int ListModIsModified; /* Flag != 0 si modif liste des lib modules */
eda_global char alim[1024];
eda_global int nbcomp; /* nombre de composants trouves */
eda_global int nblib; /* nombre d'empreintes trouvees */
eda_global int composants_non_affectes; /* nbre de composants non affectes */
eda_global wxString NameBuffer;
eda_global wxString NetInNameBuffer;
eda_global wxString NetInExtBuffer;
eda_global wxString NetDirBuffer;
eda_global wxString ExtRetroBuffer
#ifdef MAIN
( wxT( ".stf" ) )
#endif
;
// Variables generales */
// Unused, for pcbnew compatibility:
eda_global Ki_PageDescr* SheetList[]
#ifdef MAIN
= { NULL }
#endif
;
// Unused, for pcbnew compatibility:
void Plume( int state );
#endif /* __CVPCB_H__ */
......@@ -6,12 +6,8 @@
#ifndef CVSTRUCT_H
#define CVSTRUCT_H
#ifndef eda_global
#define eda_global extern
#endif
#include "wx/listctrl.h"
#include <wx/filename.h>
/* Forward declarations of all top-level window classes. */
class FootprintListBox;
......@@ -33,6 +29,7 @@ public:
ListBoxCmp* m_ListCmp;
WinEDA_DisplayFrame* DrawFrame;
WinEDA_Toolbar* m_HToolBar; // Toolbar horizontal haut d'ecran
wxFileName m_NetlistFileName;
// Constructor and destructor
public:
......@@ -73,8 +70,7 @@ public:
void CreateConfigWindow();
int SaveNetList( const wxString& FullFileName );
int SaveComponentList( const wxString& FullFileName );
bool ReadInputNetList( const wxString& FullFileName );
void ReadNetListe();
bool ReadNetList();
int rdpcad();
int ReadSchematicNetlist();
int ReadFootprintFilterList( FILE* f );
......@@ -177,7 +173,7 @@ class WinEDA_DisplayFrame : public WinEDA_BasePcbFrame
public:
public:
WinEDA_DisplayFrame( wxWindow * father,
WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
const wxString &title,
const wxPoint &pos, const wxSize &size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
......
......@@ -262,7 +262,9 @@ void WinEDA_FootprintDisplayOptionsFrame::UpdateObjectSettings(void)
void WinEDA_FootprintDisplayOptionsFrame::OnSaveConfigClick( wxCommandEvent& event )
{
Save_Config(this);
WinEDA_CvpcbFrame* parent = ( WinEDA_CvpcbFrame* )GetParent();
wxASSERT( parent && parent->IsKindOf( CLASSINFO( WinEDA_CvpcbFrame ) ) );
Save_Config( this, parent->m_NetlistFileName.GetFullPath() );
}
/*!
......
......@@ -8,6 +8,7 @@
#include "class_drawpanel.h"
#include "id.h"
#include "confirm.h"
#include "macros.h"
#include "3d_viewer.h"
......@@ -34,17 +35,14 @@ END_EVENT_TABLE()
/* WinEDA_DisplayFrame: the frame to display the current focused footprint */
/***************************************************************************/
WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father,
WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
const wxString& title,
const wxPoint& pos,
const wxSize& size, long style ) :
WinEDA_BasePcbFrame( father, CVPCB_DISPLAY_FRAME, title, pos,
size, style )
{
m_FrameName = wxT( "CmpFrame" );
m_Draw_Axis = TRUE; // TRUE if we want the axis
m_Draw_Grid = TRUE; // TRUE if we want the grid
m_Draw_Sheet_Ref = FALSE; // TRUE if we want the sheet references
m_FrameName = wxT( "CmpFrame" );
// Give an icon
#ifdef __WINDOWS__
......@@ -55,10 +53,9 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father,
SetTitle( title );
SetBoard( new BOARD( NULL, this ) );
SetBaseScreen( new PCB_SCREEN() );
GetSettings();
LoadSettings();
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
ReCreateHToolbar();
ReCreateVToolbar();
......@@ -234,25 +231,25 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
case WXK_NUMPAD8: /* cursor moved up */
case WXK_UP:
Mouse.y -= (int) round(delta.y);
Mouse.y -= wxRound(delta.y);
DrawPanel->MouseTo( Mouse );
break;
case WXK_NUMPAD2: /* cursor moved down */
case WXK_DOWN:
Mouse.y += (int) round(delta.y);
Mouse.y += wxRound(delta.y);
DrawPanel->MouseTo( Mouse );
break;
case WXK_NUMPAD4: /* cursor moved left */
case WXK_LEFT:
Mouse.x -= (int) round(delta.x);
Mouse.x -= wxRound(delta.x);
DrawPanel->MouseTo( Mouse );
break;
case WXK_NUMPAD6: /* cursor moved right */
case WXK_RIGHT:
Mouse.x += (int) round(delta.x);
Mouse.x += wxRound(delta.x);
DrawPanel->MouseTo( Mouse );
break;
}
......@@ -285,7 +282,7 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
}
}
Affiche_Status_Box(); /* Display new cursor coordinates */
UpdateStatusBar(); /* Display new cursor coordinates */
}
......
......@@ -8,6 +8,7 @@
#include "wxstruct.h"
#include "confirm.h"
#include "gestfich.h"
#include "macros.h"
#include "cvpcb.h"
#include "protos.h"
......@@ -18,31 +19,27 @@ void WinEDA_CvpcbFrame::WriteStuffList( wxCommandEvent& event )
{
FILE* FileEquiv;
STORECMP* Cmp;
wxString Line, FullFileName, Mask;
wxString Line;
wxFileName fn = m_NetlistFileName;
if( nbcomp <= 0 )
return;
/* calcul du nom du fichier */
Mask = wxT( "*" ) + ExtRetroBuffer;
FullFileName = FFileName;
ChangeFileNameExt( FullFileName, ExtRetroBuffer );
FullFileName = EDA_FileSelector( wxT( "Create Stuff File" ),
wxGetCwd(), /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */
ExtRetroBuffer, /* extension par defaut */
Mask, /* Masque d'affichage */
this,
wxFD_SAVE,
TRUE );
if( FullFileName.IsEmpty() )
fn.SetExt( RetroFileExtension );
wxFileDialog dlg( this, wxT( "Save Stuff File" ), fn.GetPath(),
fn.GetFullName(), RetroFileWildcard,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if( dlg.ShowModal() == wxID_CANCEL )
return;
FileEquiv = wxFopen( FullFileName, wxT( "wt" ) );
FileEquiv = wxFopen( dlg.GetPath(), wxT( "wt" ) );
if( FileEquiv == 0 )
{
Line = _( "Unable to create " ) + FullFileName;
Line = _( "Unable to create " ) + dlg.GetPath();
DisplayError( this, Line, 30 );
return;
}
......
......@@ -27,14 +27,14 @@ int NetNumCode; /* Nombre utilise pour cree des NetNames lors de
int genorcad()
{
char Line[1024];
STOREPIN * Pin;
STORECMP * CurrentCmp;
wxString Title = g_Main_Title + wxT(" ") + GetBuildVersion();
char Line[1024];
STOREPIN * Pin;
STORECMP * CurrentCmp;
wxString Title = wxGetApp().GetAppName() + wxT(" ") + GetBuildVersion();
NetNumCode = 1; DateAndTime(Line);
fprintf(dest,"( { Netlist by %s, date = %s }\n",
CONV_TO_UTF8(Title), Line ) ;
CONV_TO_UTF8(Title), Line ) ;
/***********************/
/* Lecture de la liste */
......
......@@ -9,6 +9,7 @@
#include "gr_basic.h"
#include "gestfich.h"
#include "id.h"
#include "appl_wxstruct.h"
#include "cvpcb.h"
#include "protos.h"
......@@ -77,7 +78,7 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
/********************************************/
void WinEDA_CvpcbFrame::ReadNetListe()
bool WinEDA_CvpcbFrame::ReadNetList()
/*******************************************/
/* Lecture de la netliste selon format, ainsi que du fichier des composants
......@@ -91,18 +92,21 @@ void WinEDA_CvpcbFrame::ReadNetListe()
error_level = ReadSchematicNetlist();
if( error_level < 0 )
return;
{
msg.Printf( _( "File <%s> does not appear to be a valid Kicad " \
"net list file." ),
m_NetlistFileName.GetFullPath().c_str() );
::wxMessageBox( msg, _( "File Error" ), wxOK | wxICON_ERROR, this );
return false;
}
/* lecture des correspondances */
loadcmp();
loadcmp( m_NetlistFileName.GetFullPath() );
if( m_ListCmp == NULL )
return;
return false;
if( !NetInNameBuffer.IsEmpty() )
wxSetWorkingDirectory( wxPathOnly( NetInNameBuffer ) );
Read_Config( NetInNameBuffer ); // relecture de la config (elle peut etre modifie)
Read_Config( m_NetlistFileName.GetFullPath() );
listlib();
BuildFootprintListBox();
......@@ -130,14 +134,14 @@ void WinEDA_CvpcbFrame::ReadNetListe()
SetStatusText( msg, 1 );
/* Mise a jour du titre de la fenetre principale */
wxString Title = g_Main_Title + wxT( " " ) + GetBuildVersion();
msg.Printf( wxT( "%s [%s]" ), Title.GetData(), FFileName.GetData() );
SetTitle( msg );
SetTitle( wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
wxT( " " ) + m_NetlistFileName.GetFullPath() );
return true;
}
/*****************************************************************/
int WinEDA_CvpcbFrame::SaveNetList( const wxString& FullFilename )
int WinEDA_CvpcbFrame::SaveNetList( const wxString& fileName )
/*****************************************************************/
/* Sauvegarde des fichiers netliste et cmp
......@@ -145,93 +149,35 @@ int WinEDA_CvpcbFrame::SaveNetList( const wxString& FullFilename )
* Le nom du fichier cmp en est deduit
*/
{
wxString NetlistFullFileName = FullFilename;
wxFileName fn;
if( NetlistFullFileName.IsEmpty() )
{
wxString Mask = wxT( "*" ) + NetExtBuffer;
if( !NetNameBuffer.IsEmpty() )
{
NetlistFullFileName = NetNameBuffer;
ChangeFileNameExt( NetlistFullFileName, NetExtBuffer );
}
NetlistFullFileName =
EDA_FileSelector( _( "Save NetList and Components List files" ),
NetDirBuffer, /* Chemin par defaut */
NetlistFullFileName, /* nom fichier par defaut */
NetExtBuffer, /* extension par defaut */
Mask, /* Masque d'affichage */
this,
wxFD_SAVE,
TRUE
);
}
if( NetlistFullFileName.IsEmpty() )
if( !fileName && m_NetlistFileName.IsOk() )
fn = m_NetlistFileName;
else
fn = wxFileName( wxGetCwd(), _( "unamed" ), NetExtBuffer );
wxFileDialog dlg( this, _( "Save Net and Component List" ), fn.GetPath(),
fn.GetFullName(), NetlistFileWildcard,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if( dlg.ShowModal() == wxID_CANCEL )
return -1;
FFileName = NetlistFullFileName;
NetNameBuffer = NetlistFullFileName;
if( SaveComponentList( NetlistFullFileName ) == 0 )
if( SaveComponentList( dlg.GetPath() ) == 0 )
{
DisplayError( this, _( "Unable to create component file (.cmp)" ) );
return 0;
}
dest = wxFopen( NetlistFullFileName, wxT( "wt" ) );
if( dest == 0 )
FILE* netlist = wxFopen( dlg.GetPath(), wxT( "wt" ) );
if( netlist == 0 )
{
DisplayError( this, _( "Unable to create netlist file" ) );
return 0;
}
GenNetlistPcbnew();
GenNetlistPcbnew( netlist );
return 1;
}
/**********************************************************************/
bool WinEDA_CvpcbFrame::ReadInputNetList( const wxString& FullFileName )
/**********************************************************************/
/* Routine de selection du nom de la netliste d'entree, et de lecure de
* celle-ci
*/
{
wxString Mask, Line;
if( FullFileName.IsEmpty() )
{
if( !NetInExtBuffer.IsEmpty() )
Mask = wxT( "*" ) + NetInExtBuffer;
else
Mask = wxT( "*.net" );
Line = EDA_FileSelector( _( "Open NetList File:" ),
NetDirBuffer, /* Chemin par defaut */
NetInNameBuffer, /* nom fichier par defaut */
NetInExtBuffer, /* extension par defaut */
Mask, /* Masque d'affichage */
this,
0,
FALSE
);
if( Line.IsEmpty() )
return FALSE;
}
else
Line = FullFileName;
NetInNameBuffer = Line;
NetNameBuffer = Line;
FFileName = NetInNameBuffer;
/* Mise a jour du titre de la fenetre principale */
Line = g_Main_Title + wxT( " " ) + GetBuildVersion();
Line += wxT( " " ) + NetInNameBuffer;
SetTitle( Line );
ReadNetListe();
return TRUE;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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