minor changes and cleanup

This commit is contained in:
charras 2008-04-03 18:03:42 +00:00
parent b2494d5b01
commit 9039a0a579
7 changed files with 19 additions and 131 deletions

View File

@ -9,9 +9,7 @@
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "gr_basic.h"
#include "common.h" #include "common.h"
#include "macros.h"
/* table des evenements captes par un WinEDA_MsgPanel */ /* table des evenements captes par un WinEDA_MsgPanel */
BEGIN_EVENT_TABLE( WinEDA_MsgPanel, wxPanel ) BEGIN_EVENT_TABLE( WinEDA_MsgPanel, wxPanel )
@ -171,7 +169,6 @@ void WinEDA_MsgPanel::EraseMsgBox()
Refresh(); Refresh();
} }
/*******************************************/ /*******************************************/
void WinEDA_MsgPanel::erase( wxDC* DC ) void WinEDA_MsgPanel::erase( wxDC* DC )
/*******************************************/ /*******************************************/
@ -192,4 +189,3 @@ void WinEDA_MsgPanel::erase( wxDC* DC )
DC->DrawRectangle( 0, 0, size.x, size.y ); DC->DrawRectangle( 0, 0, size.x, size.y );
} }

View File

@ -51,7 +51,7 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_AnnotateFrame, wxDialog )
*/ */
BEGIN_EVENT_TABLE( WinEDA_AnnotateFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_AnnotateFrame, wxDialog )
EVT_BUTTON( wxID_CLEAR, WinEDA_AnnotateFrame::OnClear ) EVT_BUTTON( ID_CLEAR_ANNOTATION, WinEDA_AnnotateFrame::OnClearAnnotation )
EVT_BUTTON( wxID_APPLY, WinEDA_AnnotateFrame::OnApply ) EVT_BUTTON( wxID_APPLY, WinEDA_AnnotateFrame::OnApply )
EVT_BUTTON( wxID_CANCEL, WinEDA_AnnotateFrame::OnCancel ) EVT_BUTTON( wxID_CANCEL, WinEDA_AnnotateFrame::OnCancel )
END_EVENT_TABLE() END_EVENT_TABLE()
@ -204,15 +204,15 @@ void WinEDA_AnnotateFrame::CreateControls()
/* Standard dialog buttons and sizer. */ /* Standard dialog buttons and sizer. */
wxBoxSizer* sizerDialogButtons = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* sizerDialogButtons = new wxBoxSizer( wxHORIZONTAL );
wxButton* btnClose = new wxButton( this, wxID_CANCEL ); wxButton* btnClose = new wxButton( this, wxID_CANCEL, _("Close") );
/* TODO: Check if there is any existing annotation and enable/disable /* TODO: Check if there is any existing annotation and enable/disable
* the clear button accordingly. Probably should also enable/ * the clear button accordingly. Probably should also enable/
* disable new components radio button if all of the components * disable new components radio button if all of the components
* are already annotated. Some low level work on the DrawSheetPath * are already annotated. Some low level work on the DrawSheetPath
* class will need to be done to accomadate this. * class will need to be done to accomadate this.
*/ */
m_btnClear = new wxButton( this, wxID_CLEAR ); m_btnClear = new wxButton( this, ID_CLEAR_ANNOTATION, _("Clear Annotation") );
wxButton* btnApply = new wxButton( this, wxID_APPLY ); wxButton* btnApply = new wxButton( this, wxID_APPLY, _("Annotation") );
sizerDialogButtons->Add( btnClose, flagsDialogButtonSpacing ); sizerDialogButtons->Add( btnClose, flagsDialogButtonSpacing );
sizerDialogButtons->Add( new wxBoxSizer( wxHORIZONTAL ), sizerDialogButtons->Add( new wxBoxSizer( wxHORIZONTAL ),
wxSizerFlags( 1 ).Expand( ) ); wxSizerFlags( 1 ).Expand( ) );
@ -256,7 +256,7 @@ wxIcon WinEDA_AnnotateFrame::GetIconResource( const wxString& name )
return wxNullIcon; return wxNullIcon;
} }
void WinEDA_AnnotateFrame::OnClear( wxCommandEvent& event ) void WinEDA_AnnotateFrame::OnClearAnnotation( wxCommandEvent& event )
{ {
int response; int response;

View File

@ -40,6 +40,8 @@
#define ID_RESET_ANNOTATION 10003 #define ID_RESET_ANNOTATION 10003
#define ID_SORT_BY_POSITION 10004 #define ID_SORT_BY_POSITION 10004
#define ID_SORT_BY_VALUE 10005 #define ID_SORT_BY_VALUE 10005
#define ID_CLEAR_ANNOTATION 10006
#define ANNOTATE_DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER #define ANNOTATE_DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER
#define ANNOTATE_DIALOG_TITLE _( "Annotate" ) #define ANNOTATE_DIALOG_TITLE _( "Annotate" )
@ -101,7 +103,7 @@ public:
private: private:
void CloseDialog( void ); void CloseDialog( void );
void OnClear( wxCommandEvent& event ); void OnClearAnnotation( wxCommandEvent& event );
void OnApply( wxCommandEvent& event ); void OnApply( wxCommandEvent& event );
void OnCancel( wxCommandEvent& event ); void OnCancel( wxCommandEvent& event );

View File

@ -150,6 +150,16 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
if( (pt_pad->m_Masque_Layer & masklayer ) == 0 ) if( (pt_pad->m_Masque_Layer & masklayer ) == 0 )
continue; continue;
// Usually we draw pads in sketch mode on non copper layers:
if ( (masklayer & ALL_CU_LAYERS) == 0 )
{
int tmp_fill = ((WinEDA_BasePcbFrame*)panel->m_Parent)->m_DisplayPadFill;
// Switch in sketch mode
((WinEDA_BasePcbFrame*)panel->m_Parent)->m_DisplayPadFill = 0;
pt_pad->Draw( panel, DC, draw_mode );
((WinEDA_BasePcbFrame*)panel->m_Parent)->m_DisplayPadFill = tmp_fill;
}
else // on copper layer, draw pads accordint to current options
pt_pad->Draw( panel, DC, draw_mode ); pt_pad->Draw( panel, DC, draw_mode );
} }

View File

@ -25,7 +25,6 @@
#include "PolyLine2Kicad.h" #include "PolyLine2Kicad.h"
#include "freepcb_ids.h"
#include "freepcbDisplayList.h" #include "freepcbDisplayList.h"
#include "math_for_graphics.h" #include "math_for_graphics.h"

View File

@ -1,118 +0,0 @@
// definition of ID structure used by FreePCB
//
#pragma once
// struct id : this structure is used to identify PCB design elements
// such as instances of parts or nets, and their subelements
// Each element will have its own id.
// An id is attached to each item of the Display List so that it can
// be linked back to the PCB design element which drew it.
// These are mainly used to identify items selected by clicking the mouse
//
// In general:
// id.type = type of PCB element (e.g. part, net, text)
// id.st = subelement type (e.g. part pad, net connection)
// id.i = subelement index (zero-based)
// id.sst = subelement of subelement (e.g. net connection segment)
// id.ii = subsubelement index (zero-based)
//
// For example, the id for segment 0 of connection 4 of net 12 would be
// id = { ID_NET, 12, ID_CONNECT, 4, ID_SEG, 0 };
//
//
class id {
public:
// constructor
id( int qt=0, int qst=0, int qis=0, int qsst=0, int qiis=0 )
{ type=qt; st=qst; i=qis; sst=qsst; ii=qiis; }
// operators
friend int operator ==(id id1, id id2)
{ return (id1.type==id2.type
&& id1.st==id2.st
&& id1.sst==id2.sst
&& id1.i==id2.i
&& id1.ii==id2.ii );
}
// member functions
void Clear()
{ type=0; st=0; i=0; sst=0; ii=0; }
void Set( int qt, int qst=0, int qis=0, int qsst=0, int qiis=0 )
{ type=qt; st=qst; i=qis; sst=qsst; ii=qiis; }
// member variables
unsigned int type; // type of element
unsigned int st; // type of subelement
unsigned int i; // index of subelement
unsigned int sst; // type of subsubelement
unsigned int ii; // index of subsubelement
};
// these are constants used in ids
// root types
enum {
ID_NONE = 0, // an undefined type or st (or an error)
ID_BOARD, // board outline
ID_PART, // part
ID_NET, // net
ID_TEXT, // free-standing text
ID_DRC, // DRC error
ID_SM_CUTOUT, // cutout for solder mask
ID_MULTI // if multiple selections
};
// subtypes of ID_PART
enum {
ID_PAD = 1, // pad_stack in a part
ID_SEL_PAD, // selection rectangle for pad_stack in a part
ID_OUTLINE, // part outline
ID_REF_TXT, // text showing ref num for part
ID_ORIG, // part origin
ID_SEL_RECT, // selection rectangle for part
ID_SEL_REF_TXT // selection rectangle for ref text
};
// subtypes of ID_TEXT
enum {
ID_SEL_TXT = 1, // selection rectangle
ID_STROKE // stroke for text
};
// subtypes of ID_NET
enum {
ID_ENTIRE_NET = 0,
ID_CONNECT, // connection
ID_AREA // copper area
};
// subtypes of ID_BOARD
enum {
ID_BOARD_OUTLINE = 1,
};
// subsubtypes of ID_NET.ID_CONNECT
enum {
ID_ENTIRE_CONNECT = 0,
ID_SEG,
ID_SEL_SEG,
ID_VERTEX,
ID_SEL_VERTEX,
ID_VIA
};
// subsubtypes of ID_NET.ID_AREA, ID_BOARD.ID_BOARD_OUTLINE, ID_SM_CUTOUT
enum {
ID_SIDE = 1,
ID_SEL_SIDE,
ID_SEL_CORNER,
ID_HATCH,
ID_PIN_X, // only used by ID_AREA
ID_STUB_X // only used by ID_AREA
};
// subtypes of ID_DRC
// for subsubtypes, use types in DesignRules.h
enum {
ID_DRE = 1,
ID_SEL_DRE
};

View File

@ -13,7 +13,6 @@ using namespace std;
#include "defs-macros.h" #include "defs-macros.h"
#include "PolyLine2Kicad.h" #include "PolyLine2Kicad.h"
#include "freepcb_ids.h"
#include "PolyLine.h" #include "PolyLine.h"