7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 08:31:48 +00:00

Add class_marker.cpp and class_marker.h. Some other minor changes

This commit is contained in:
CHARRAS 2007-10-26 06:08:19 +00:00
parent 2728aa5900
commit 2a5676b2e2
44 changed files with 328 additions and 294 deletions

View File

@ -4,6 +4,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Oct-26 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ pcbnew:
Add class_marker.cpp and class_marker.h and move MARQUEUR functions in class_marker.cpp
Change MARQUEUR::HitTest to take in account the zoom level.
change global var EDA_Appl to g_EDA_Appl
2007-Oct-25 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
+ cvpcb

View File

@ -147,8 +147,8 @@ bool success = FALSE;
}
/* Try to launch some browser (usefull under linux) */
EDA_Appl->ReadPdfBrowserInfos();
if ( EDA_Appl->m_PdfBrowserIsDefault )
g_EDA_Appl->ReadPdfBrowserInfos();
if ( g_EDA_Appl->m_PdfBrowserIsDefault )
{
wxFileType * filetype;
wxFileName CurrentFileName(fullfilename);
@ -205,7 +205,7 @@ bool success = FALSE;
else
{
command = EDA_Appl->m_PdfBrowser;
command = g_EDA_Appl->m_PdfBrowser;
if ( wxFileExists(command) )
{
success = TRUE;

View File

@ -76,7 +76,7 @@ static wxString s_KicadBinaryPathList[] = {
#endif
wxT( "end_list" ) // End of list symbol, do not change
};
extern WinEDA_App* EDA_Appl;
extern WinEDA_App* g_EDA_Appl;
/***************************************************************************/
@ -339,12 +339,12 @@ wxString FindKicadHelpPath()
bool PathFound = FALSE;
/* find kicad/help/ */
tmp = EDA_Appl->m_BinDir;
tmp = g_EDA_Appl->m_BinDir;
if( tmp.Last() == '/' )
tmp.RemoveLast();
FullPath = tmp.BeforeLast( '/' ); // Idem cd ..
FullPath += wxT( "/help/" );
LocaleString = EDA_Appl->m_Locale->GetCanonicalName();
LocaleString = g_EDA_Appl->m_Locale->GetCanonicalName();
wxString path_tmp = FullPath;
#ifdef __WINDOWS__
@ -357,9 +357,9 @@ wxString FindKicadHelpPath()
}
/* find kicad/help/ from environment variable KICAD */
if( !PathFound && EDA_Appl->m_Env_Defined )
if( !PathFound && g_EDA_Appl->m_Env_Defined )
{
FullPath = EDA_Appl->m_KicadEnv + wxT( "/help/" );
FullPath = g_EDA_Appl->m_KicadEnv + wxT( "/help/" );
if( wxDirExists( FullPath ) )
PathFound = TRUE;
}
@ -424,15 +424,15 @@ wxString FindKicadFile( const wxString& shortname )
/* test de la presence du fichier shortname dans le repertoire de
* des binaires de kicad */
FullFileName = EDA_Appl->m_BinDir + shortname;
FullFileName = g_EDA_Appl->m_BinDir + shortname;
if( wxFileExists( FullFileName ) )
return FullFileName;
/* test de la presence du fichier shortname dans le repertoire
* defini par la variable d'environnement KICAD */
if( EDA_Appl->m_Env_Defined )
if( g_EDA_Appl->m_Env_Defined )
{
FullFileName = EDA_Appl->m_KicadEnv + shortname;
FullFileName = g_EDA_Appl->m_KicadEnv + shortname;
if( wxFileExists( FullFileName ) )
return FullFileName;
}
@ -519,7 +519,7 @@ void SetRealLibraryPath( const wxString& shortlibname )
else
{
g_RealLibDirBuffer = ReturnKicadDatasPath();
if( EDA_Appl->m_Env_Defined ) // Chemin impose par la variable d'environnement
if( g_EDA_Appl->m_Env_Defined ) // Chemin impose par la variable d'environnement
{
PathFound = TRUE;
}
@ -552,22 +552,22 @@ wxString ReturnKicadDatasPath()
bool PathFound = FALSE;
wxString data_path;
if( EDA_Appl->m_Env_Defined ) // Chemin impose par la variable d'environnement
if( g_EDA_Appl->m_Env_Defined ) // Chemin impose par la variable d'environnement
{
data_path = EDA_Appl->m_KicadEnv;
data_path = g_EDA_Appl->m_KicadEnv;
PathFound = TRUE;
}
else // Chemin cherche par le chemin des executables
{
// le chemin est bindir../
wxString tmp = EDA_Appl->m_BinDir;
wxString tmp = g_EDA_Appl->m_BinDir;
#ifdef __WINDOWS__
tmp.MakeLower();
#endif
if( tmp.Contains( wxT( "kicad" ) ) )
{
#ifdef __WINDOWS__
tmp = EDA_Appl->m_BinDir;
tmp = g_EDA_Appl->m_BinDir;
#endif
if( tmp.Last() == '/' )
tmp.RemoveLast();
@ -636,10 +636,10 @@ wxString GetEditorName()
);
}
if( ( !editorname.IsEmpty() ) && EDA_Appl->m_EDA_CommonConfig )
if( ( !editorname.IsEmpty() ) && g_EDA_Appl->m_EDA_CommonConfig )
{
g_EditorName = editorname;
EDA_Appl->m_EDA_CommonConfig->Write( wxT( "Editor" ), g_EditorName );
g_EDA_Appl->m_EDA_CommonConfig->Write( wxT( "Editor" ), g_EditorName );
}
return g_EditorName;
}
@ -651,11 +651,11 @@ void OpenPDF( const wxString& file )
wxString filename = file;
wxString type;
EDA_Appl->ReadPdfBrowserInfos();
if( !EDA_Appl->m_PdfBrowserIsDefault )
g_EDA_Appl->ReadPdfBrowserInfos();
if( !g_EDA_Appl->m_PdfBrowserIsDefault )
{
AddDelimiterString( filename );
command = EDA_Appl->m_PdfBrowser + filename;
command = g_EDA_Appl->m_PdfBrowser + filename;
}
else
{

View File

@ -207,8 +207,8 @@ bool WinEDA_App::ReadProjectConfig(const wxString & local_config_filename,
return:
TRUE si lue.
Met a jour en plus:
EDA_Appl->m_CurrentOptionFileDateAndTime
EDA_Appl->m_CurrentOptionFile
g_EDA_Appl->m_CurrentOptionFileDateAndTime
g_EDA_Appl->m_CurrentOptionFile
*/
{
const PARAM_CFG_BASE * pt_cfg;
@ -221,22 +221,22 @@ wxString timestamp;
g_Prj_Config->SetPath(UNIX_STRING_DIR_SEP);
timestamp = g_Prj_Config->Read( wxT("update") );
if ( Load_Only_if_New && ( !timestamp.IsEmpty() ) &&
(timestamp == EDA_Appl->m_CurrentOptionFileDateAndTime) )
(timestamp == g_EDA_Appl->m_CurrentOptionFileDateAndTime) )
{
return FALSE;
}
EDA_Appl->m_CurrentOptionFileDateAndTime = timestamp;
g_EDA_Appl->m_CurrentOptionFileDateAndTime = timestamp;
if ( ! g_Prj_Default_Config_FullFilename.IsEmpty() )
EDA_Appl->m_CurrentOptionFile = g_Prj_Default_Config_FullFilename;
g_EDA_Appl->m_CurrentOptionFile = g_Prj_Default_Config_FullFilename;
else
{
if ( wxPathOnly(g_Prj_Config_LocalFilename).IsEmpty() )
EDA_Appl->m_CurrentOptionFile =
g_EDA_Appl->m_CurrentOptionFile =
wxGetCwd() + STRING_DIR_SEP + g_Prj_Config_LocalFilename;
else
EDA_Appl->m_CurrentOptionFile = g_Prj_Config_LocalFilename;
g_EDA_Appl->m_CurrentOptionFile = g_Prj_Config_LocalFilename;
}
for( ; *List != NULL ; List++)

View File

@ -35,7 +35,7 @@ wxString FullFileName = FileName ;
g_LibName_List.Clear();
g_ListName_Equ.Clear();
EDA_Appl->ReadProjectConfig(FullFileName,
g_EDA_Appl->ReadProjectConfig(FullFileName,
GROUP, ParamCfgList, FALSE);
if ( PkgInExtBuffer.IsEmpty() ) PkgInExtBuffer = wxT(".pkg");
@ -80,6 +80,6 @@ wxString mask( wxT("*"));
if ( FullFileName.IsEmpty()) return;
/* ecriture de la configuration */
EDA_Appl->WriteProjectConfig(FullFileName, GROUP, ParamCfgList);
g_EDA_Appl->WriteProjectConfig(FullFileName, GROUP, ParamCfgList);
}

View File

@ -33,7 +33,7 @@ bool WinEDA_App::OnInit()
wxString msg;
wxString currCWD = wxGetCwd();
EDA_Appl = this;
g_EDA_Appl = this;
InitEDA_Appl( wxT("cvpcb") );
if ( m_Checker && m_Checker->IsAnotherRunning() )

View File

@ -73,7 +73,7 @@ wxString title;
m_Parent = parent;
m_DoUpdate = TRUE;
title = _("from ") + EDA_Appl->m_CurrentOptionFile;
title = _("from ") + g_EDA_Appl->m_CurrentOptionFile;
SetTitle(title);
Create(parent, id, caption, pos, size, style);
}

View File

@ -86,7 +86,7 @@ void KiConfigCvpcbFrame::SetDialogDatas()
m_PkgExtBoxSizer, wxDefaultSize);
wxString DocModuleFileName =
EDA_Appl->m_EDA_CommonConfig->Read( wxT("module_doc_file"), wxT("pcbnew/footprints.pdf"));
g_EDA_Appl->m_EDA_CommonConfig->Read( wxT("module_doc_file"), wxT("pcbnew/footprints.pdf"));
m_TextHelpModulesFileName = new WinEDA_EnterText(this,
_("Module Doc File:"), DocModuleFileName,
m_RightBoxSizer, wxDefaultSize);
@ -132,7 +132,7 @@ wxString msg;
if ( ! m_DoUpdate ) return;
NetInExtBuffer = m_NetInputExtCtrl->GetValue();
PkgInExtBuffer = m_PkgExtCtrl->GetValue();
EDA_Appl->m_EDA_CommonConfig->Write( wxT("module_doc_file"),
g_EDA_Appl->m_EDA_CommonConfig->Write( wxT("module_doc_file"),
m_TextHelpModulesFileName->GetValue());
msg = m_LibDirCtrl->GetValue();

View File

@ -681,7 +681,7 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
MirrorYPoint( px, Center );
px.x -= dx;
EDA_Appl->m_SchematicFrame->PutOnGrid( &px );
g_EDA_Appl->m_SchematicFrame->PutOnGrid( &px );
DrawText->m_Pos.x = px.x;
break;
@ -696,14 +696,14 @@ void MirrorOneStruct( EDA_BaseStruct* DrawStruct, wxPoint& Center )
px = DrawText->m_Pos;
MirrorYPoint( px, Center );
EDA_Appl->m_SchematicFrame->PutOnGrid( &px );
g_EDA_Appl->m_SchematicFrame->PutOnGrid( &px );
DrawText->m_Pos.x = px.x;
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
DrawLibItem = (EDA_SchComponentStruct*) DrawStruct;
dx = DrawLibItem->m_Pos.x;
EDA_Appl->m_SchematicFrame->CmpRotationMiroir( DrawLibItem,
g_EDA_Appl->m_SchematicFrame->CmpRotationMiroir( DrawLibItem,
NULL, CMP_MIROIR_Y );
MirrorYPoint( DrawLibItem->m_Pos, Center );
dx -= DrawLibItem->m_Pos.x;

View File

@ -63,7 +63,7 @@ bool SCH_SCREEN::SchematicCleanUp( wxDC* DC )
}
}
EDA_Appl->m_SchematicFrame->TestDanglingEnds( EEDrawList, DC );
g_EDA_Appl->m_SchematicFrame->TestDanglingEnds( EEDrawList, DC );
return Modify;
}

View File

@ -36,7 +36,7 @@ void RemoteCommand( const char* cmdline )
char line[1024];
char* idcmd;
char* text;
WinEDA_SchematicFrame* frame = EDA_Appl->m_SchematicFrame;
WinEDA_SchematicFrame* frame = g_EDA_Appl->m_SchematicFrame;
wxString part_ref, msg;
strncpy( line, cmdline, sizeof(line) - 1 );

View File

@ -24,7 +24,7 @@ void DeleteSubHierarchy(DrawSheetStruct * FirstSheet, bool confirm_deletion)
{
EDA_BaseStruct *DrawStruct;
EDA_BaseStruct *EEDrawList;
WinEDA_SchematicFrame * frame = EDA_Appl->m_SchematicFrame;
WinEDA_SchematicFrame * frame = g_EDA_Appl->m_SchematicFrame;
wxString msg;
if( FirstSheet == NULL ) return;

View File

@ -102,7 +102,7 @@ wxString msg;
Create(parent, id, caption, pos, size, style);
msg = _("from ") + EDA_Appl->m_CurrentOptionFile;
msg = _("from ") + g_EDA_Appl->m_CurrentOptionFile;
SetTitle(msg);
SetFormatsNetListes();
m_ListLibr->InsertItems(g_LibName_List, 0);

View File

@ -142,7 +142,7 @@ wxArrayString liblist_tmp = g_LibName_List;
else FullFileName = CfgFileName;
g_LibName_List.Clear();
if ( ! EDA_Appl->ReadProjectConfig(FullFileName,
if ( ! g_EDA_Appl->ReadProjectConfig(FullFileName,
GROUP, ParamCfgList, ForceRereadConfig ? FALSE : TRUE) ) // Config non lue
{
g_LibName_List = liblist_tmp;
@ -159,13 +159,13 @@ wxArrayString liblist_tmp = g_LibName_List;
g_LibName_List.Add( wxT("device") );
}
if ( EDA_Appl->m_SchematicFrame )
if ( g_EDA_Appl->m_SchematicFrame )
{
EDA_Appl->m_SchematicFrame->SetDrawBgColor(g_DrawBgColor);
EDA_Appl->m_SchematicFrame->m_Draw_Grid = g_ShowGrid;
g_EDA_Appl->m_SchematicFrame->SetDrawBgColor(g_DrawBgColor);
g_EDA_Appl->m_SchematicFrame->m_Draw_Grid = g_ShowGrid;
}
LoadLibraries(EDA_Appl->m_SchematicFrame);
LoadLibraries(g_EDA_Appl->m_SchematicFrame);
return IsRead;
}
@ -197,6 +197,6 @@ wxString mask( wxT("*") );
if ( FullFileName.IsEmpty() ) return;
/* ecriture de la configuration */
EDA_Appl->WriteProjectConfig(FullFileName, GROUP, ParamCfgList);
g_EDA_Appl->WriteProjectConfig(FullFileName, GROUP, ParamCfgList);
}

View File

@ -46,7 +46,7 @@ bool WinEDA_App::OnInit()
{
wxString FFileName;
EDA_Appl = this;
g_EDA_Appl = this;
g_DebugLevel = 0; // Debug level */

View File

@ -329,7 +329,7 @@ void WinEDA_NetlistFrame::SetupPlugin(wxCommandEvent& event)
{
wxString FullFileName, Mask, Path;
Mask = wxT("*");
Path = EDA_Appl->m_BinDir;
Path = g_EDA_Appl->m_BinDir;
FullFileName = EDA_FileSelector( _("Plugin files:"),
Path, /* Chemin par defaut */
FullFileName, /* nom fichier par defaut */

View File

@ -793,7 +793,7 @@ static void ComputeArc( LibDrawArc* DrawItem, wxPoint ArcCentre )
wxString msg;
angle = DrawItem->t2 - DrawItem->t1;
msg.Printf( _( "Arc %.1f deg" ), (float) angle / 10 );
EDA_Appl->m_LibeditFrame->PrintMsg( msg );
g_EDA_Appl->m_LibeditFrame->PrintMsg( msg );
while( (DrawItem->t2 - DrawItem->t1) >= 1800 )
{

View File

@ -26,7 +26,7 @@ bool WinEDA_App::OnInit()
{
wxString FFileName;
EDA_Appl = this;
g_EDA_Appl = this;
InitEDA_Appl( wxT("gerbview") );
if(argc > 1) FFileName = MakeFileName(wxEmptyString, argv[1], g_PhotoFilenameExt);

View File

@ -91,7 +91,7 @@ bool Read_Config()
*/
{
g_Prj_Config_Filename_ext = wxT( ".cnf" );
EDA_Appl->ReadProjectConfig( wxT( "gerbview" ), GROUP, ParamCfgList, FALSE );
g_EDA_Appl->ReadProjectConfig( wxT( "gerbview" ), GROUP, ParamCfgList, FALSE );
/* Inits autres variables */
if( ScreenPcb )
@ -137,7 +137,7 @@ void WinEDA_GerberFrame::Update_config()
return;
/* ecriture de la configuration */
EDA_Appl->WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
g_EDA_Appl->WriteProjectConfig( FullFileName, GROUP, ParamCfgList );
}

View File

@ -22,7 +22,7 @@ OBJECTS= \
drawpanel.o\
set_color.o \
gerbview_config.o \
cursors.o \
class_marker.o \
affiche.o \
tracepcb.o \
class_pcb_text.o\
@ -65,7 +65,7 @@ set_color.o: set_color.cpp set_color.h $(COMMON)
files.o: files.cpp $(COMMON)
cursors.o: ../pcbnew/cursors.cpp $(COMMON)
class_marker.o: ../pcbnew/class_marker.cpp ../pcbnew/class_marker.h $(COMMON)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
sel_layer.o: ../pcbnew/sel_layer.cpp $(COMMON)

View File

@ -95,7 +95,7 @@ wxString title;
m_Parent = parent;
SetFont(* g_DialogFont);
title = _("from ") + EDA_Appl->m_CurrentOptionFile;
title = _("from ") + g_EDA_Appl->m_CurrentOptionFile;
SetTitle(title);
LibModified = FALSE;

View File

@ -18,8 +18,6 @@
/**********************************************/
/* Class representing the entire Application */
/**********************************************/
eda_global WinEDA_App* EDA_Appl; /* application representant le programme */
class WinEDA_App : public wxApp
{

View File

@ -264,6 +264,9 @@ COMMON_GLOBL wxString g_ProductName
#endif
;
COMMON_GLOBL WinEDA_App* g_EDA_Appl; /* this is the main application */
/* Gestion des librairies */
COMMON_GLOBL wxString g_RealLibDirBuffer; // Chemin reel des librairies de module
// = UserLibDirBuffer si non vide

View File

@ -16,7 +16,7 @@
/* define default path for config key file */
#define DEFAULT_HOTKEY_FILENAME_PATH_IS_HOME wxGetHomeDir() + wxT( "/" )
#define DEFAULT_HOTKEY_FILENAME_PATH_IS_KICAD EDA_Appl->m_BinDir + wxT( "../template/" )
#define DEFAULT_HOTKEY_FILENAME_PATH_IS_KICAD g_EDA_Appl->m_BinDir + wxT( "../template/" )
/* keyword idetifier in kicad config use ti store/retrieve path option */
#define HOTKEY_CFG_PATH_OPT wxT( "HotkeyPathOption" )

View File

@ -339,14 +339,14 @@ public:
BOARD_ITEM* GetCurItem() const { return (BOARD_ITEM*) BASE_SCREEN::GetCurItem(); }
};
/***************************/
/* Description des Modules */
/***************************/
/**********************************/
/* Module (Footprint) description */
/**********************************/
#include "class_pad.h" /* Description des Pastilles :*/
#include "class_edge_mod.h"
#include "class_text_mod.h"
#include "class_module.h"
#include "class_pad.h" // class for pads
#include "class_edge_mod.h" // Class for footprint graphic elements
#include "class_text_mod.h" // Class for footprint fields
#include "class_module.h" // Class for the footprint
#include "class_equipot.h"
@ -413,6 +413,7 @@ public:
#include "class_cotation.h"
#include "class_mire.h"
#include "class_track.h"
#include "class_marker.h"
/*******************/
/* class EDGE_ZONE */
@ -427,43 +428,6 @@ public:
};
/***************************************/
/* Markers: used to show a drc problem */
/***************************************/
class MARQUEUR : public BOARD_ITEM
{
public:
wxPoint m_Pos;
char* m_Bitmap; /* Shape (bitmap) */
int m_Type;
int m_Color; /* color */
wxString m_Diag; /* Associated text (comment) */
public:
MARQUEUR( BOARD_ITEM* StructFather );
~MARQUEUR();
void UnLink();
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode );
/**
* Function Display_Infos
* has knowledge about the frame and how and where to put status information
* about this object into the frame's message panel.
* @param frame A WinEDA_DrawFrame in which to print status information.
*/
void Display_Infos( WinEDA_DrawFrame* frame );
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param ref_pos A wxPoint to test
* @return bool - true if a hit, else false
*/
bool HitTest( const wxPoint& ref_pos );
};
class DISPLAY_OPTIONS
{

Some files were not shown because too many files have changed in this diff Show More