44 changed files with 329 additions and 295 deletions
-
8change_log.txt
-
6common/eda_doc.cpp
-
36common/gestfich.cpp
-
14common/projet_config.cpp
-
4cvpcb/cfg.cpp
-
2cvpcb/cvpcb.cpp
-
2cvpcb/dialog_cvpcb_config.cpp
-
4cvpcb/menucfg.cpp
-
6eeschema/block.cpp
-
2eeschema/cleanup.cpp
-
2eeschema/cross-probing.cpp
-
2eeschema/delsheet.cpp
-
2eeschema/dialog_eeschema_config.cpp
-
12eeschema/eeconfig.cpp
-
2eeschema/eeschema.cpp
-
2eeschema/netlist_control.cpp
-
2eeschema/symbdraw.cpp
-
2gerbview/gerbview.cpp
-
4gerbview/gerbview_config.cpp
-
4gerbview/makefile.include
-
2gerbview/reglage.cpp
-
2include/appl_wxstruct.h
-
3include/common.h
-
2include/hotkeys_basic.h
-
54include/pcbstruct.h
-
3include/wxstruct.h
-
4kicad/buildmnu.cpp
-
2kicad/files-io.cpp
-
2kicad/kicad.cpp
-
32kicad/preferences.cpp
-
2kicad/prjconfig.cpp
-
2pcbnew/block_module_editor.cpp
-
164pcbnew/class_marker.cpp
-
46pcbnew/class_marker.h
-
81pcbnew/classpcb.cpp
-
2pcbnew/cross-probing.cpp
-
74pcbnew/cursors.cpp
-
6pcbnew/dialog_setup_libs.cpp
-
2pcbnew/edit.cpp
-
2pcbnew/makefile.include
-
4pcbnew/pcbcfg.cpp
-
2pcbnew/pcbnew.cpp
-
8share/drawframe.cpp
-
5todo.txt
@ -0,0 +1,164 @@ |
|||||
|
/*****************************************************************************/ |
||||
|
/* Functions to handle markers used to show somthing (usually a drc problem) */ |
||||
|
/*****************************************************************************/ |
||||
|
|
||||
|
/* file class_marker.cpp */ |
||||
|
|
||||
|
#include "fctsys.h"
|
||||
|
#include "gr_basic.h"
|
||||
|
|
||||
|
#include "common.h"
|
||||
|
#include "pcbnew.h"
|
||||
|
#include "class_marker.h"
|
||||
|
|
||||
|
|
||||
|
/* Routines Locales : */ |
||||
|
|
||||
|
|
||||
|
/* Default bitmap shape for markers */ |
||||
|
static char Default_MarkerBitmap[] = |
||||
|
{ |
||||
|
12, 12, /* x and y sise of the bitmap */ |
||||
|
1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, /* bitmap: 1 = color, 0 = notrace */ |
||||
|
1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, |
||||
|
1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, |
||||
|
1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, |
||||
|
1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, |
||||
|
1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, |
||||
|
1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, |
||||
|
0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, |
||||
|
0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, |
||||
|
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, |
||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, |
||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
/*******************/ |
||||
|
/* Classe MARQUEUR */ |
||||
|
/*******************/ |
||||
|
|
||||
|
MARQUEUR::MARQUEUR( BOARD_ITEM* StructFather ) : |
||||
|
BOARD_ITEM( StructFather, TYPEMARQUEUR ) |
||||
|
{ |
||||
|
m_Bitmap = NULL; |
||||
|
m_Type = 0; |
||||
|
m_Color = RED; |
||||
|
m_Bitmap = Default_MarkerBitmap; |
||||
|
m_Size.x = Default_MarkerBitmap[0]; |
||||
|
m_Size.y = Default_MarkerBitmap[1]; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* Effacement memoire de la structure */ |
||||
|
MARQUEUR:: ~MARQUEUR() |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* supprime du chainage la structure Struct
|
||||
|
* les structures arrieres et avant sont chainees directement |
||||
|
*/ |
||||
|
void MARQUEUR::UnLink() |
||||
|
{ |
||||
|
/* Modification du chainage arriere */ |
||||
|
if( Pback ) |
||||
|
{ |
||||
|
if( Pback->Type() != TYPEPCB ) |
||||
|
{ |
||||
|
Pback->Pnext = Pnext; |
||||
|
} |
||||
|
else /* Le chainage arriere pointe sur la structure "Pere" */ |
||||
|
{ |
||||
|
( (BOARD*) Pback )->m_Drawings = (BOARD_ITEM*) Pnext; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/* Modification du chainage avant */ |
||||
|
if( Pnext ) |
||||
|
Pnext->Pback = Pback; |
||||
|
|
||||
|
Pnext = Pback = NULL; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
void MARQUEUR::Display_Infos( WinEDA_DrawFrame* frame ) |
||||
|
{ |
||||
|
int text_pos; |
||||
|
|
||||
|
frame->MsgPanel->EraseMsgBox(); |
||||
|
|
||||
|
text_pos = 1; |
||||
|
Affiche_1_Parametre( frame, text_pos, _( "Type" ), _("Marker"), DARKCYAN ); |
||||
|
|
||||
|
text_pos = 12; |
||||
|
Affiche_1_Parametre( frame, text_pos, _( "Marker Error Text" ), m_Diag, RED ); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/**********************************************/ |
||||
|
bool MARQUEUR::HitTest( const wxPoint& refPos ) |
||||
|
/**********************************************/ |
||||
|
{ |
||||
|
// the MARKER is 12 pixels by 12 pixels, but is not resized with zoom, so
|
||||
|
// as zoom changes, the effective real size (in user units) of the MARKER changes.
|
||||
|
|
||||
|
wxSize TrueSize = m_Size; |
||||
|
if ( ActiveScreen ) |
||||
|
{ |
||||
|
TrueSize.x *= ActiveScreen->GetZoom(); |
||||
|
TrueSize.y *= ActiveScreen->GetZoom(); |
||||
|
} |
||||
|
|
||||
|
int dx = refPos.x - m_Pos.x; |
||||
|
int dy = refPos.y - m_Pos.y; |
||||
|
|
||||
|
/* is refPos in the box: Marker size to right an bottom,
|
||||
|
or size/2 to left or top */ |
||||
|
if( dx <= TrueSize.x && dy <= TrueSize.y && |
||||
|
dx >= -TrueSize.x/2 && dy >= -TrueSize.y/2 ) |
||||
|
return true; |
||||
|
else |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/**********************************************************************/ |
||||
|
void MARQUEUR::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode ) |
||||
|
/**********************************************************************/ |
||||
|
|
||||
|
/*
|
||||
|
* Trace un repere sur l'ecran au point de coordonnees PCB pos |
||||
|
* Le marqueur est defini par un tableau de 2 + (lig*col) elements: |
||||
|
* 1er element: dim nbre ligne |
||||
|
* 2er element: dim nbre col |
||||
|
* suite: lig * col elements a 0 ou 1 : si 1 mise a color du pixel |
||||
|
*/ |
||||
|
{ |
||||
|
int px, py; |
||||
|
int ii, jj; |
||||
|
char* pt_bitmap = m_Bitmap; |
||||
|
|
||||
|
if( pt_bitmap == NULL ) return; |
||||
|
|
||||
|
GRSetDrawMode( DC, DrawMode ); |
||||
|
|
||||
|
px = GRMapX( m_Pos.x ); |
||||
|
py = GRMapY( m_Pos.y ); |
||||
|
|
||||
|
/* Get the bitmap size */ |
||||
|
m_Size.x = *(pt_bitmap++); |
||||
|
m_Size.y = *(pt_bitmap++); |
||||
|
|
||||
|
/* Draw the bitmap */ |
||||
|
for( ii = 0; ii < m_Size.x; ii++ ) |
||||
|
{ |
||||
|
for( jj = 0; jj < m_Size.y; jj++, pt_bitmap++ ) |
||||
|
{ |
||||
|
if( *pt_bitmap ) |
||||
|
GRSPutPixel( &panel->m_ClipBox, DC, |
||||
|
px + ii, py + jj, m_Color ); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,46 @@ |
|||||
|
/***************************************/ |
||||
|
/* Markers: used to show a drc problem */ |
||||
|
/***************************************/ |
||||
|
|
||||
|
#ifndef CLASS_MARKER_H |
||||
|
#define CLASS_MARKER_H |
||||
|
|
||||
|
#include "base_struct.h" |
||||
|
|
||||
|
|
||||
|
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) */ |
||||
|
wxSize m_Size; /* Size of the graphic symbol */ |
||||
|
|
||||
|
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 ); |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
#endif // end #ifndef CLASS_MARKER_H |
||||
@ -1,74 +0,0 @@ |
|||||
/****************************************************************/ |
|
||||
/* Routines generales d'affichage des curseurs et des marqueurs */ |
|
||||
/****************************************************************/ |
|
||||
|
|
||||
/* fichier curseurs.cpp */ |
|
||||
|
|
||||
#include "fctsys.h"
|
|
||||
#include "gr_basic.h"
|
|
||||
|
|
||||
#include "common.h"
|
|
||||
#include "pcbnew.h"
|
|
||||
|
|
||||
|
|
||||
/* Routines Locales : */ |
|
||||
|
|
||||
|
|
||||
/* Forme (bit_map) du marqueur */ |
|
||||
static char Default_MarkerBitmap[] = |
|
||||
{ |
|
||||
12, 12, /* Dimensions x et y du dessin de marqueurs*/ |
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, /* bitmap: 1 = color, 0 = notrace */ |
|
||||
1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, |
|
||||
1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, |
|
||||
1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, |
|
||||
1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, |
|
||||
1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, |
|
||||
1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, |
|
||||
0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, |
|
||||
0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
/**********************************************************************/ |
|
||||
void MARQUEUR::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode ) |
|
||||
/**********************************************************************/ |
|
||||
|
|
||||
/*
|
|
||||
* Trace un repere sur l'ecran au point de coordonnees PCB pos |
|
||||
* Le marqueur est defini par un tableau de 2 + (lig*col) elements: |
|
||||
* 1er element: dim nbre ligne |
|
||||
* 2er element: dim nbre col |
|
||||
* suite: lig * col elements a 0 ou 1 : si 1 mise a color du pixel |
|
||||
*/ |
|
||||
{ |
|
||||
int px, py; |
|
||||
int ii, ii_max, jj, jj_max; |
|
||||
char* pt_bitmap = m_Bitmap; |
|
||||
|
|
||||
if( pt_bitmap == NULL ) |
|
||||
pt_bitmap = Default_MarkerBitmap; |
|
||||
|
|
||||
GRSetDrawMode( DC, DrawMode ); |
|
||||
|
|
||||
px = GRMapX( m_Pos.x ); |
|
||||
py = GRMapY( m_Pos.y ); |
|
||||
|
|
||||
/* Lecture des dimensions */ |
|
||||
ii_max = *(pt_bitmap++); |
|
||||
jj_max = *(pt_bitmap++); |
|
||||
|
|
||||
/* Trace du bitmap */ |
|
||||
for( ii = 0; ii < ii_max; ii++ ) |
|
||||
{ |
|
||||
for( jj = 0; jj < jj_max; jj++, pt_bitmap++ ) |
|
||||
{ |
|
||||
if( *pt_bitmap ) |
|
||||
GRSPutPixel( &panel->m_ClipBox, DC, |
|
||||
px + ii, py + jj, m_Color ); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue