set eol-style native on new files
This commit is contained in:
parent
64f12ffe5d
commit
9c5b539e04
|
@ -1,66 +1,66 @@
|
|||
/* XPM */
|
||||
#ifndef XPMMAIN
|
||||
extern char *general_ratsnet_xpm[];
|
||||
|
||||
#else
|
||||
char * general_ratsnet_xpm[] = {
|
||||
"16 16 41 1",
|
||||
" c None",
|
||||
". c #FFFFFF",
|
||||
"+ c #2F2F2F",
|
||||
"@ c #444342",
|
||||
"# c #AEAEAE",
|
||||
"$ c #1D1D1D",
|
||||
"% c #F2D7C1",
|
||||
"& c #F2BD8E",
|
||||
"* c #3C3631",
|
||||
"= c #403D3B",
|
||||
"- c #F2B279",
|
||||
"; c #F29747",
|
||||
"> c #443B33",
|
||||
", c #B1B1B1",
|
||||
"' c #444444",
|
||||
") c #333231",
|
||||
"! c #C3C3C3",
|
||||
"~ c #372E28",
|
||||
"{ c #3C3129",
|
||||
"] c #413B36",
|
||||
"^ c #423F3D",
|
||||
"/ c #382F29",
|
||||
"( c #1C1006",
|
||||
"_ c #323232",
|
||||
": c #161514",
|
||||
"< c #181818",
|
||||
"[ c #3B3A39",
|
||||
"} c #3F3F3F",
|
||||
"| c #171009",
|
||||
"1 c #F2D7C0",
|
||||
"2 c #F2BC8E",
|
||||
"3 c #3D3731",
|
||||
"4 c #1D1917",
|
||||
"5 c #2A1F16",
|
||||
"6 c #413E3C",
|
||||
"7 c #F29647",
|
||||
"8 c #1B1007",
|
||||
"9 c #261D16",
|
||||
"0 c #443A32",
|
||||
"a c #BBBBBB",
|
||||
"b c #1A1109",
|
||||
" ... ... ",
|
||||
" .. .. ",
|
||||
" +@# ... ",
|
||||
" $%&* .. ",
|
||||
" =-;>.....,') ",
|
||||
"..!~{!.....'%&].",
|
||||
".. ... ^-;>.",
|
||||
". ... .!/( ",
|
||||
" ..... ",
|
||||
" ... ",
|
||||
" ..... ",
|
||||
" ... .!_: ",
|
||||
" <[!. }%&| ",
|
||||
"...'123 4-;5 ",
|
||||
"...6-78 90a ",
|
||||
" b( .. "};
|
||||
|
||||
#endif
|
||||
/* XPM */
|
||||
#ifndef XPMMAIN
|
||||
extern char *general_ratsnet_xpm[];
|
||||
|
||||
#else
|
||||
char * general_ratsnet_xpm[] = {
|
||||
"16 16 41 1",
|
||||
" c None",
|
||||
". c #FFFFFF",
|
||||
"+ c #2F2F2F",
|
||||
"@ c #444342",
|
||||
"# c #AEAEAE",
|
||||
"$ c #1D1D1D",
|
||||
"% c #F2D7C1",
|
||||
"& c #F2BD8E",
|
||||
"* c #3C3631",
|
||||
"= c #403D3B",
|
||||
"- c #F2B279",
|
||||
"; c #F29747",
|
||||
"> c #443B33",
|
||||
", c #B1B1B1",
|
||||
"' c #444444",
|
||||
") c #333231",
|
||||
"! c #C3C3C3",
|
||||
"~ c #372E28",
|
||||
"{ c #3C3129",
|
||||
"] c #413B36",
|
||||
"^ c #423F3D",
|
||||
"/ c #382F29",
|
||||
"( c #1C1006",
|
||||
"_ c #323232",
|
||||
": c #161514",
|
||||
"< c #181818",
|
||||
"[ c #3B3A39",
|
||||
"} c #3F3F3F",
|
||||
"| c #171009",
|
||||
"1 c #F2D7C0",
|
||||
"2 c #F2BC8E",
|
||||
"3 c #3D3731",
|
||||
"4 c #1D1917",
|
||||
"5 c #2A1F16",
|
||||
"6 c #413E3C",
|
||||
"7 c #F29647",
|
||||
"8 c #1B1007",
|
||||
"9 c #261D16",
|
||||
"0 c #443A32",
|
||||
"a c #BBBBBB",
|
||||
"b c #1A1109",
|
||||
" ... ... ",
|
||||
" .. .. ",
|
||||
" +@# ... ",
|
||||
" $%&* .. ",
|
||||
" =-;>.....,') ",
|
||||
"..!~{!.....'%&].",
|
||||
".. ... ^-;>.",
|
||||
". ... .!/( ",
|
||||
" ..... ",
|
||||
" ... ",
|
||||
" ..... ",
|
||||
" ... .!_: ",
|
||||
" <[!. }%&| ",
|
||||
"...'123 4-;5 ",
|
||||
"...6-78 90a ",
|
||||
" b( .. "};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,249 +1,249 @@
|
|||
/*****************************************/
|
||||
/* class BOARD_ITEM: som basic functions */
|
||||
/*****************************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "pcbnew.h"
|
||||
|
||||
#include "id.h"
|
||||
#include "collectors.h"
|
||||
|
||||
#include "bitmaps.h"
|
||||
#include "add_cotation.xpm"
|
||||
#include "Add_Mires.xpm"
|
||||
#include "Add_Zone.xpm"
|
||||
|
||||
|
||||
/********************************************************/
|
||||
wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
|
||||
/********************************************************/
|
||||
|
||||
/** return a specific comment for "this". Used in pop up menus
|
||||
* @param aPcb = the parent board
|
||||
*/
|
||||
{
|
||||
wxString text;
|
||||
const BOARD_ITEM* item = this;
|
||||
EQUIPOT* net;
|
||||
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_EQUIPOT_STRUCT_TYPE:
|
||||
text << _( "Net" ) << ( (EQUIPOT*) item )->m_Netname << wxT( " " ) <<
|
||||
( (EQUIPOT*) item )->m_NetCode;
|
||||
break;
|
||||
|
||||
case TYPEMODULE:
|
||||
text << _( "Footprint" ) << wxT( " " ) << ( (MODULE*) item )->GetReference();
|
||||
text << wxT( " (" ) << ReturnPcbLayerName( item->m_Layer ) << wxT( ")" );
|
||||
break;
|
||||
|
||||
case TYPEPAD:
|
||||
text << _( "Pad" ) << wxT( " " ) << ( (D_PAD*) item )->ReturnStringPadName() << _( " of " )
|
||||
<< ( (MODULE*) GetParent() )->GetReference();
|
||||
break;
|
||||
|
||||
case TYPEDRAWSEGMENT:
|
||||
text << _( "Pcb Graphic" ) << _( " on " ) << ReturnPcbLayerName( item->GetLayer() ); // @todo: extend text
|
||||
break;
|
||||
|
||||
case TYPETEXTE:
|
||||
text << _( "Pcb Text" ) << wxT( " " );;
|
||||
if( ( (TEXTE_PCB*) item )->m_Text.Len() < 12 )
|
||||
text << ( (TEXTE_PCB*) item )->m_Text;
|
||||
else
|
||||
text += ( (TEXTE_PCB*) item )->m_Text.Left( 10 ) + wxT( ".." );
|
||||
text << _( " on " ) << ReturnPcbLayerName( item->GetLayer() );
|
||||
break;
|
||||
|
||||
case TYPETEXTEMODULE:
|
||||
|
||||
switch( ( (TEXTE_MODULE*) item )->m_Type )
|
||||
{
|
||||
case TEXT_is_REFERENCE:
|
||||
text << _( "Reference" ) << wxT( " " ) << ( (TEXTE_MODULE*) item )->m_Text;
|
||||
break;
|
||||
|
||||
case TEXT_is_VALUE:
|
||||
text << _( "Value" ) << wxT( " " ) << ( (TEXTE_MODULE*) item )->m_Text << _( " of " )
|
||||
<< ( (MODULE*) GetParent() )->GetReference();
|
||||
break;
|
||||
|
||||
default: // wrap this one in quotes:
|
||||
text << _( "Text" ) << wxT( " \"" ) << ( (TEXTE_MODULE*) item )->m_Text <<
|
||||
wxT( "\"" ) << _( " of " )
|
||||
<< ( (MODULE*) GetParent() )->GetReference();
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPEEDGEMODULE:
|
||||
text << _( "Graphic" ) << wxT( " " );
|
||||
const wxChar* cp;
|
||||
|
||||
switch( ( (EDGE_MODULE*) item )->m_Shape )
|
||||
{
|
||||
case S_SEGMENT:
|
||||
cp = _( "Line" ); break;
|
||||
|
||||
case S_RECT:
|
||||
cp = _( "Rect" ); break;
|
||||
|
||||
case S_ARC:
|
||||
cp = _( "Arc" ); break;
|
||||
|
||||
case S_CIRCLE:
|
||||
cp = _( "Circle" ); break;
|
||||
|
||||
/* used in Gerbview: */
|
||||
case S_ARC_RECT:
|
||||
cp = wxT( "arc_rect" ); break;
|
||||
|
||||
case S_SPOT_OVALE:
|
||||
cp = wxT( "spot_oval" ); break;
|
||||
|
||||
case S_SPOT_CIRCLE:
|
||||
cp = wxT( "spot_circle" ); break;
|
||||
|
||||
case S_SPOT_RECT:
|
||||
cp = wxT( "spot_rect" ); break;
|
||||
|
||||
case S_POLYGON:
|
||||
cp = wxT( "polygon" ); break;
|
||||
|
||||
default:
|
||||
cp = wxT( "??EDGE??" ); break;
|
||||
}
|
||||
|
||||
text << *cp << _( " of " )
|
||||
<< ( (MODULE*) GetParent() )->GetReference();
|
||||
break;
|
||||
|
||||
case TYPETRACK:
|
||||
text << _( "Track" ) << wxT( " " ) << ( (TRACK*) item )->m_NetCode;
|
||||
net = aPcb->FindNet( ( (TRACK*) item )->m_NetCode );
|
||||
if( net )
|
||||
{
|
||||
text << wxT( " [" ) << net->m_Netname << wxT( "]" );
|
||||
}
|
||||
text << _( " on " ) << ReturnPcbLayerName( item->GetLayer() );
|
||||
break;
|
||||
|
||||
case TYPEZONE:
|
||||
text << _( "Zone" ) << _( " on " ) << ReturnPcbLayerName( item->GetLayer() );
|
||||
break;
|
||||
|
||||
case TYPEVIA:
|
||||
text << _( "Via" ) << wxT( " " ) << ( (SEGVIA*) item )->m_NetCode;
|
||||
net = aPcb->FindNet( ( (TRACK*) item )->m_NetCode );
|
||||
if( net )
|
||||
{
|
||||
text << wxT( " [" ) << net->m_Netname << wxT( "]" );
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPEMARQUEUR:
|
||||
text << _( "Marker" );
|
||||
break;
|
||||
|
||||
case TYPECOTATION:
|
||||
text << _( "Dimension" ) << wxT(" \"") << ((COTATION*) item)->GetText() << wxT("\"");
|
||||
break;
|
||||
|
||||
case TYPEMIRE:
|
||||
text << _( "Mire" ); // @todo: extend text, Mire is not an english word!
|
||||
break;
|
||||
|
||||
case TYPEEDGEZONE:
|
||||
text << _( "Edge Zone" ) << _( " on " ) << ReturnPcbLayerName( item->GetLayer() ); // @todo: extend text
|
||||
break;
|
||||
|
||||
default:
|
||||
text << item->GetClass() << wxT( " Unexpected item type: BUG!!" );
|
||||
break;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************/
|
||||
const char** BOARD_ITEM::MenuIcon() const
|
||||
/*****************************************/
|
||||
|
||||
/** return a specific icon pointer (an xpm icon) for "this". Used in pop up menus
|
||||
* @return an icon pointer (can be NULL)
|
||||
*/
|
||||
{
|
||||
char** xpm;
|
||||
const BOARD_ITEM* item = this;
|
||||
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_EQUIPOT_STRUCT_TYPE:
|
||||
xpm = general_ratsnet_xpm;
|
||||
break;
|
||||
|
||||
case TYPEMODULE:
|
||||
xpm = module_xpm;
|
||||
break;
|
||||
|
||||
case TYPEPAD:
|
||||
xpm = pad_xpm;
|
||||
break;
|
||||
|
||||
case TYPEDRAWSEGMENT:
|
||||
xpm = add_dashed_line_xpm;
|
||||
break;
|
||||
|
||||
case TYPETEXTE:
|
||||
xpm = add_text_xpm;
|
||||
break;
|
||||
|
||||
case TYPETEXTEMODULE:
|
||||
xpm = footprint_text_xpm;
|
||||
break;
|
||||
|
||||
case TYPEEDGEMODULE:
|
||||
xpm = show_mod_edge_xpm;
|
||||
break;
|
||||
|
||||
case TYPETRACK:
|
||||
xpm = showtrack_xpm;
|
||||
break;
|
||||
|
||||
case TYPEZONE:
|
||||
xpm = add_zone_xpm;
|
||||
break;
|
||||
|
||||
case TYPEVIA:
|
||||
xpm = pad_sketch_xpm;
|
||||
break;
|
||||
|
||||
case TYPEMARQUEUR:
|
||||
xpm = pad_xpm; // @todo: create and use marker xpm
|
||||
break;
|
||||
|
||||
case TYPECOTATION:
|
||||
xpm = add_cotation_xpm;
|
||||
break;
|
||||
|
||||
case TYPEMIRE:
|
||||
xpm = add_mires_xpm;
|
||||
break;
|
||||
|
||||
case TYPEEDGEZONE:
|
||||
xpm = show_mod_edge_xpm; // @todo: pcb edge xpm
|
||||
break;
|
||||
|
||||
default:
|
||||
xpm = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return (const char**) xpm;
|
||||
}
|
||||
/*****************************************/
|
||||
/* class BOARD_ITEM: som basic functions */
|
||||
/*****************************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "pcbnew.h"
|
||||
|
||||
#include "id.h"
|
||||
#include "collectors.h"
|
||||
|
||||
#include "bitmaps.h"
|
||||
#include "add_cotation.xpm"
|
||||
#include "Add_Mires.xpm"
|
||||
#include "Add_Zone.xpm"
|
||||
|
||||
|
||||
/********************************************************/
|
||||
wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
|
||||
/********************************************************/
|
||||
|
||||
/** return a specific comment for "this". Used in pop up menus
|
||||
* @param aPcb = the parent board
|
||||
*/
|
||||
{
|
||||
wxString text;
|
||||
const BOARD_ITEM* item = this;
|
||||
EQUIPOT* net;
|
||||
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_EQUIPOT_STRUCT_TYPE:
|
||||
text << _( "Net" ) << ( (EQUIPOT*) item )->m_Netname << wxT( " " ) <<
|
||||
( (EQUIPOT*) item )->m_NetCode;
|
||||
break;
|
||||
|
||||
case TYPEMODULE:
|
||||
text << _( "Footprint" ) << wxT( " " ) << ( (MODULE*) item )->GetReference();
|
||||
text << wxT( " (" ) << ReturnPcbLayerName( item->m_Layer ) << wxT( ")" );
|
||||
break;
|
||||
|
||||
case TYPEPAD:
|
||||
text << _( "Pad" ) << wxT( " " ) << ( (D_PAD*) item )->ReturnStringPadName() << _( " of " )
|
||||
<< ( (MODULE*) GetParent() )->GetReference();
|
||||
break;
|
||||
|
||||
case TYPEDRAWSEGMENT:
|
||||
text << _( "Pcb Graphic" ) << _( " on " ) << ReturnPcbLayerName( item->GetLayer() ); // @todo: extend text
|
||||
break;
|
||||
|
||||
case TYPETEXTE:
|
||||
text << _( "Pcb Text" ) << wxT( " " );;
|
||||
if( ( (TEXTE_PCB*) item )->m_Text.Len() < 12 )
|
||||
text << ( (TEXTE_PCB*) item )->m_Text;
|
||||
else
|
||||
text += ( (TEXTE_PCB*) item )->m_Text.Left( 10 ) + wxT( ".." );
|
||||
text << _( " on " ) << ReturnPcbLayerName( item->GetLayer() );
|
||||
break;
|
||||
|
||||
case TYPETEXTEMODULE:
|
||||
|
||||
switch( ( (TEXTE_MODULE*) item )->m_Type )
|
||||
{
|
||||
case TEXT_is_REFERENCE:
|
||||
text << _( "Reference" ) << wxT( " " ) << ( (TEXTE_MODULE*) item )->m_Text;
|
||||
break;
|
||||
|
||||
case TEXT_is_VALUE:
|
||||
text << _( "Value" ) << wxT( " " ) << ( (TEXTE_MODULE*) item )->m_Text << _( " of " )
|
||||
<< ( (MODULE*) GetParent() )->GetReference();
|
||||
break;
|
||||
|
||||
default: // wrap this one in quotes:
|
||||
text << _( "Text" ) << wxT( " \"" ) << ( (TEXTE_MODULE*) item )->m_Text <<
|
||||
wxT( "\"" ) << _( " of " )
|
||||
<< ( (MODULE*) GetParent() )->GetReference();
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPEEDGEMODULE:
|
||||
text << _( "Graphic" ) << wxT( " " );
|
||||
const wxChar* cp;
|
||||
|
||||
switch( ( (EDGE_MODULE*) item )->m_Shape )
|
||||
{
|
||||
case S_SEGMENT:
|
||||
cp = _( "Line" ); break;
|
||||
|
||||
case S_RECT:
|
||||
cp = _( "Rect" ); break;
|
||||
|
||||
case S_ARC:
|
||||
cp = _( "Arc" ); break;
|
||||
|
||||
case S_CIRCLE:
|
||||
cp = _( "Circle" ); break;
|
||||
|
||||
/* used in Gerbview: */
|
||||
case S_ARC_RECT:
|
||||
cp = wxT( "arc_rect" ); break;
|
||||
|
||||
case S_SPOT_OVALE:
|
||||
cp = wxT( "spot_oval" ); break;
|
||||
|
||||
case S_SPOT_CIRCLE:
|
||||
cp = wxT( "spot_circle" ); break;
|
||||
|
||||
case S_SPOT_RECT:
|
||||
cp = wxT( "spot_rect" ); break;
|
||||
|
||||
case S_POLYGON:
|
||||
cp = wxT( "polygon" ); break;
|
||||
|
||||
default:
|
||||
cp = wxT( "??EDGE??" ); break;
|
||||
}
|
||||
|
||||
text << *cp << _( " of " )
|
||||
<< ( (MODULE*) GetParent() )->GetReference();
|
||||
break;
|
||||
|
||||
case TYPETRACK:
|
||||
text << _( "Track" ) << wxT( " " ) << ( (TRACK*) item )->m_NetCode;
|
||||
net = aPcb->FindNet( ( (TRACK*) item )->m_NetCode );
|
||||
if( net )
|
||||
{
|
||||
text << wxT( " [" ) << net->m_Netname << wxT( "]" );
|
||||
}
|
||||
text << _( " on " ) << ReturnPcbLayerName( item->GetLayer() );
|
||||
break;
|
||||
|
||||
case TYPEZONE:
|
||||
text << _( "Zone" ) << _( " on " ) << ReturnPcbLayerName( item->GetLayer() );
|
||||
break;
|
||||
|
||||
case TYPEVIA:
|
||||
text << _( "Via" ) << wxT( " " ) << ( (SEGVIA*) item )->m_NetCode;
|
||||
net = aPcb->FindNet( ( (TRACK*) item )->m_NetCode );
|
||||
if( net )
|
||||
{
|
||||
text << wxT( " [" ) << net->m_Netname << wxT( "]" );
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPEMARQUEUR:
|
||||
text << _( "Marker" );
|
||||
break;
|
||||
|
||||
case TYPECOTATION:
|
||||
text << _( "Dimension" ) << wxT(" \"") << ((COTATION*) item)->GetText() << wxT("\"");
|
||||
break;
|
||||
|
||||
case TYPEMIRE:
|
||||
text << _( "Mire" ); // @todo: extend text, Mire is not an english word!
|
||||
break;
|
||||
|
||||
case TYPEEDGEZONE:
|
||||
text << _( "Edge Zone" ) << _( " on " ) << ReturnPcbLayerName( item->GetLayer() ); // @todo: extend text
|
||||
break;
|
||||
|
||||
default:
|
||||
text << item->GetClass() << wxT( " Unexpected item type: BUG!!" );
|
||||
break;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************/
|
||||
const char** BOARD_ITEM::MenuIcon() const
|
||||
/*****************************************/
|
||||
|
||||
/** return a specific icon pointer (an xpm icon) for "this". Used in pop up menus
|
||||
* @return an icon pointer (can be NULL)
|
||||
*/
|
||||
{
|
||||
char** xpm;
|
||||
const BOARD_ITEM* item = this;
|
||||
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_EQUIPOT_STRUCT_TYPE:
|
||||
xpm = general_ratsnet_xpm;
|
||||
break;
|
||||
|
||||
case TYPEMODULE:
|
||||
xpm = module_xpm;
|
||||
break;
|
||||
|
||||
case TYPEPAD:
|
||||
xpm = pad_xpm;
|
||||
break;
|
||||
|
||||
case TYPEDRAWSEGMENT:
|
||||
xpm = add_dashed_line_xpm;
|
||||
break;
|
||||
|
||||
case TYPETEXTE:
|
||||
xpm = add_text_xpm;
|
||||
break;
|
||||
|
||||
case TYPETEXTEMODULE:
|
||||
xpm = footprint_text_xpm;
|
||||
break;
|
||||
|
||||
case TYPEEDGEMODULE:
|
||||
xpm = show_mod_edge_xpm;
|
||||
break;
|
||||
|
||||
case TYPETRACK:
|
||||
xpm = showtrack_xpm;
|
||||
break;
|
||||
|
||||
case TYPEZONE:
|
||||
xpm = add_zone_xpm;
|
||||
break;
|
||||
|
||||
case TYPEVIA:
|
||||
xpm = pad_sketch_xpm;
|
||||
break;
|
||||
|
||||
case TYPEMARQUEUR:
|
||||
xpm = pad_xpm; // @todo: create and use marker xpm
|
||||
break;
|
||||
|
||||
case TYPECOTATION:
|
||||
xpm = add_cotation_xpm;
|
||||
break;
|
||||
|
||||
case TYPEMIRE:
|
||||
xpm = add_mires_xpm;
|
||||
break;
|
||||
|
||||
case TYPEEDGEZONE:
|
||||
xpm = show_mod_edge_xpm; // @todo: pcb edge xpm
|
||||
break;
|
||||
|
||||
default:
|
||||
xpm = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return (const char**) xpm;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue