overbar patch merged mainly in eechema/class_pin.cpp. Some cleanup and compil problem fixes.

This commit is contained in:
charras 2009-04-06 10:56:17 +00:00
parent c6501e7d3a
commit 71ca194b68
40 changed files with 2437 additions and 3456 deletions

View File

@ -493,6 +493,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
text->m_Text, text->m_Orient, text->m_Size,
text->m_HJustify, text->m_VJustify,
text->m_Width, text->m_Italic,
true,
Draw3dTextSegm );
}

View File

@ -4,7 +4,17 @@ 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>
2009-apr-06 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++common:
overbar patch merged in drawtxt.cpp and mainly in eechema/class_pin.cpp
some cleanup and some compiling problems fixed.
++eeschema:
changed dialog_eeschema_config.cpp to use wxFormBuilder to create
the corresponding equivalent dialog in dialog_eeschema_config_fbp.cpp
2009-apr-05 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++All
* Removed all instances #ifdef eda_global, COMMON_GLOBL, and MAIN in order

View File

@ -738,19 +738,20 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC )
for( ii = 0; ; ii++ )
{
xg = wxRound(ii * screen_grid_size.x);
if( xg > size.x )
break;
int xpos = org.x + xg;
xpos = GRMapX( xpos );
for( jj = 0; ; jj++ )
{
yg = wxRound(jj * screen_grid_size.y);
GRPutPixel( &m_ClipBox, DC, xpos, org.y + yg, color );
if( yg > size.y )
break;
int ypos = org.y + yg;
DC->DrawPoint( xpos, GRMapY( ypos ) );
}
if( xg > size.x )
break;
}
}
}
/* Draw axis */

View File

@ -20,6 +20,55 @@
#define EDA_DRAWBASE
#include "grfonte.h"
/** Function NegableTextLength
* Return the text length of a negable string, excluding the ~ markers */
int NegableTextLength(const wxString& aText)
{
int char_count = aText.length();
/* Fix the character count, removing the ~ found */
for (int i = char_count-1; i >= 0; i--) {
if (aText[i] == '~') {
char_count--;
}
}
return char_count;
}
/* Helper function for drawing character polygons */
static void DrawGraphicTextPline(
WinEDA_DrawPanel* aPanel,
wxDC* aDC,
EDA_Colors aColor,
int aWidth,
bool sketch_mode,
int point_count,
wxPoint *coord,
void (* aCallback) (int x0, int y0, int xf, int yf))
{
if ( aCallback )
{
for( int ik = 0; ik < (point_count - 1); ik ++ )
{
aCallback( coord[ik].x, coord[ik].y,
coord[ik+1].x, coord[ik+1].y );
}
}
else if( sketch_mode )
{
for( int ik = 0; ik < (point_count - 1); ik ++ )
GRCSegm( &aPanel->m_ClipBox, aDC, coord[ik].x, coord[ik].y,
coord[ik+1].x, coord[ik+1].y, aWidth, aColor );
}
else
GRPoly( &aPanel->m_ClipBox, aDC, point_count, coord, 0,
aWidth, aColor, aColor );
}
static int overbar_position(int size_v, int thickness)
{
return size_v*1.1+thickness;
}
/** Function DrawGraphicText
* Draw a graphic text (like module texts)
@ -35,6 +84,7 @@
* @param aWidth = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width)
* @param aItalic = true to simulate an italic font
* @param aNegable = true to enable the ~ char for overbarring
* @param aCallback() = function called (if non null) to draw each segment.
* used to draw 3D texts or for plotting, NULL for normal drawings
*/
@ -50,10 +100,11 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
enum GRTextVertJustifyType aV_justify,
int aWidth,
bool aItalic,
bool aNegable,
void (* aCallback) (int x0, int y0, int xf, int yf))
/****************************************************************************************************/
{
int kk, char_count, AsciiCode;
int char_count, AsciiCode;
int x0, y0;
int size_h, size_v, pitch;
SH_CODE f_cod, plume = 'U';
@ -62,10 +113,12 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
int ux0, uy0, dx, dy; // Draw coordinate for segments to draw. also used in some other calculation
int cX, cY; // Texte center
int ox, oy; // Draw coordinates for the current char
int overbar_x, overbar_y; // Start point for the current overbar
int overbars; // Number of ~ seen
#define BUF_SIZE 100
wxPoint coord[BUF_SIZE+1]; // Buffer coordinate used to draw polylines (one char shape)
bool sketch_mode = false;
bool italic_reverse = false; // true for mirrored texts with m_Size.x < 0
bool italic_reverse = false; // true for mirrored texts with m_Size.x < 0
size_h = aSize.x;
size_v = aSize.y;
@ -76,21 +129,22 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
sketch_mode = true;
}
int thickness = aWidth;
if ( aSize.x < 0 ) // text is mirrored using size.x < 0 (mirror / Y axis)
italic_reverse = true;
if ( aSize.x < 0 ) // text is mirrored using size.x < 0 (mirror / Y axis)
italic_reverse = true;
kk = 0;
ptr = 0; /* ptr = text index */
char_count = aText.Len();
if (aNegable) {
char_count = NegableTextLength(aText);
} else {
char_count = aText.Len();
}
if( char_count == 0 )
return;
pitch = (10 * size_h ) / 9; // this is the pitch between chars
if ( pitch > 0 )
pitch += ABS(thickness);
pitch += thickness;
else
pitch -= ABS(thickness);
pitch -= thickness;
ox = cX = aPos.x;
oy = cY = aPos.y;
@ -220,17 +274,44 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
return;
}
while( kk++ < char_count )
overbars = 0;
ptr = 0; /* ptr = text index */
while( ptr < char_count )
{
x0 = 0; y0 = 0;
if (aNegable) {
if (aText[ptr+overbars] == '~') {
/* Found an overbar, adjust the pointers */
overbars++;
if (overbars % 2) {
/* Starting the overbar */
overbar_x = ox;
overbar_y = oy-overbar_position(size_v, thickness);
RotatePoint( &overbar_x, &overbar_y, cX, cY, aOrient );
} else {
/* Ending the overbar */
coord[0].x = overbar_x;
coord[0].y = overbar_y;
overbar_x = ox;
overbar_y = oy-overbar_position(size_v, thickness);
RotatePoint( &overbar_x, &overbar_y, cX, cY, aOrient );
coord[1].x = overbar_x;
coord[1].y = overbar_y;
/* Plot the overbar segment */
DrawGraphicTextPline(aPanel, aDC, aColor, aWidth,
sketch_mode, 2, coord, aCallback);
}
continue; /* Skip ~ processing */
}
}
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
AsciiCode = aText.GetChar(ptr) & 0x7FF;
AsciiCode = aText.GetChar(ptr+overbars) & 0x7FF;
if ( AsciiCode > 0x40F && AsciiCode < 0x450 ) // big small Cyr
AsciiCode = utf8_to_ascii[AsciiCode - 0x410] & 0xFF;
else
AsciiCode = AsciiCode & 0xFF;
#else
AsciiCode = aText.GetChar( ptr ) & 0xFF;
AsciiCode = aText.GetChar(ptr+overbars) & 0xFF;
#endif
ptcar = graphic_fonte_shape[AsciiCode]; /* ptcar pointe la description
* du caractere a dessiner */
@ -253,24 +334,8 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
{
if( aWidth <= 1 )
aWidth = 0;
if ( aCallback )
{
for( int ik = 0; ik < (point_count - 1); ik ++ )
{
aCallback( coord[ik].x, coord[ik].y,
coord[ik+1].x, coord[ik+1].y );
}
}
else if( sketch_mode )
{
for( int ik = 0; ik < (point_count - 1); ik ++ )
GRCSegm( &aPanel->m_ClipBox, aDC, coord[ik].x, coord[ik].y,
coord[ik+1].x, coord[ik+1].y, aWidth, aColor );
}
else
GRPoly( &aPanel->m_ClipBox, aDC, point_count, coord, 0,
aWidth, aColor, aColor );
DrawGraphicTextPline(aPanel, aDC, aColor, aWidth,
sketch_mode, point_count, coord, aCallback);
}
plume = f_cod; point_count = 0;
break;
@ -311,6 +376,19 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
ptr++; ox += pitch;
}
if (overbars % 2) {
/* Close the last overbar */
coord[0].x = overbar_x;
coord[0].y = overbar_y;
overbar_x = ox;
overbar_y = oy-overbar_position(size_v, thickness);
RotatePoint( &overbar_x, &overbar_y, cX, cY, aOrient );
coord[1].x = overbar_x;
coord[1].y = overbar_y;
/* Plot the overbar segment */
DrawGraphicTextPline(aPanel, aDC, aColor, aWidth,
sketch_mode, 2, coord, aCallback);
}
}
@ -375,6 +453,7 @@ s_Callback_plot(int x0,
* @param aWidth = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width)
* @param aItalic = true to simulate an italic font
* @param aNegable = true to enable the ~ char for overbarring
*/
/******************************************************************************************/
void PlotGraphicText( int aFormat_plot,
@ -386,7 +465,8 @@ void PlotGraphicText( int aFormat_plot,
enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify,
int aWidth,
bool aItalic )
bool aItalic,
bool aNegable)
/******************************************************************************************/
{
// Initialise the actual function used to plot lines:
@ -415,7 +495,7 @@ void PlotGraphicText( int aFormat_plot,
DrawGraphicText( NULL, NULL, aPos, aColor, aText,
aOrient, aSize,
aH_justify, aV_justify,
aWidth, aItalic,
aWidth, aItalic, aNegable,
s_Callback_plot);
/* end text : pen UP ,no move */

View File

@ -1,16 +0,0 @@
WXDIR = $(WXWIN)
all: common.a
include ../libs.win
include makefile.include
common.a: $(OBJECTS) ../libs.win makefile.include
ar ruv $@ $(OBJECTS)
ranlib $@
clean:
rm -f *.bak
rm -f *.o
rm -f common.a

View File

@ -1,75 +1,106 @@
EXTRACPPFLAGS += -I$(SYSINCLUDE) -I./ -Ibitmaps -I../include -I../polygon
COMMON = ../include/colors.h
PCBINCL = -I../pcbnew -I../polygon -I../3d-viewer
PCBINCL = -I../pcbnew -I../polygon
OBJECTS= \
about_kicad.o\
base_struct.o\
basicframe.o\
drawframe.o\
confirm.o \
copy_to_clipboard.o\
class_drawpickedstruct.o\
common_plot_functions.o\
COMMON_OBJECTS= \
about_kicad.o\
base_screen.o\
base_struct.o\
basicframe.o\
block_commande.o\
class_drawpickedstruct.o\
common.o\
common_plot_functions.o\
common_plotHPGL_functions.o\
common_plotPS_functions.o\
common_plotGERBER_functions.o\
common_plotPS_functions.o\
common_plotHPGL_functions.o\
dlist.o \
hotkeys_basic.o\
drawtxt.o \
confirm.o\
copy_to_clipboard.o\
dcsvg.o\
displlst.o\
dlist.o\
drawframe.o\
drawpanel.o\
wxwineda.o \
string.o \
gr_basic.o\
gestfich.o\
trigo.o\
selcolor.o\
common.o\
eda_doc.o\
toolbars.o\
displlst.o \
edaappl.o\
block_commande.o\
msgpanel.o\
projet_config.o\
get_component_dialog.o\
eda_dde.o\
worksheet.o\
base_screen.o\
dcsvg.o\
zoom.o\
drawtxt.o\
edaappl.o\
eda_dde.o\
eda_doc.o\
gestfich.o\
get_component_dialog.o\
gr_basic.o\
hotkeys_basic.o\
msgpanel.o\
projet_config.o\
selcolor.o\
string.o\
toolbars.o\
trigo.o\
worksheet.o\
wxwineda.o\
zoom.o
PCB_COMMON_OBJECTS =\
pcbcommon.o\
basepcbframe.o\
class_board.o\
class_board_connected_item.o\
class_board_item.o\
class_cotation.o\
class_drawsegment.o\
class_drc_item.o\
class_edge_mod.o\
class_equipot.o\
class_marker.o\
class_mire.o\
class_module.o\
class_pad.o\
class_pad_draw_functions.o\
class_pcb_text.o\
class_text_mod.o\
class_track.o\
class_zone.o\
class_zone_setting.o\
classpcb.o\
collectors.o\
sel_layer.o\
tracemod.o\
dialog_print_using_printer_base.o
ifdef KICAD_PYTHON
OBJECTS += pyhandler.o
pyhandler.o: pyhandler.cpp $(COMMON) ../include/pyhandler.h
COMMON_OBJECTS += pyhandler.o
pyhandler.o: pyhandler.cpp ../include/pyhandler.h
endif
pcbcommon.o: pcbcommon.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ $*.cpp
basepcbframe.o: ../pcbnew/basepcbframe.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_board.o: ../pcbnew/class_board.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_board_item.o: ../pcbnew/class_board_item.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_drawsegment.o: ../pcbnew/class_drawsegment.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_edge_mod.o: ../pcbnew/class_edge_mod.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_equipot.o: ../pcbnew/class_equipot.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_module.o: ../pcbnew/class_module.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_text_mod.o: ../pcbnew/class_text_mod.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_board_connected_item.o: ../pcbnew/class_board_connected_item.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
@ -94,6 +125,12 @@ class_pad_draw_functions.o: ../pcbnew/class_pad_draw_functions.cpp
class_pcb_text.o: ../pcbnew/class_pcb_text.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_track.o: ../pcbnew/class_track.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
tracemod.o: ../pcbnew/tracemod.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_zone.o: ../pcbnew/class_zone.cpp
$(CXX) $(PCBINCL) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
@ -114,41 +151,41 @@ dialog_print_using_printer_base.o: ../pcbnew/dialog_print_using_printer_base.cpp
gr_basic.o: gr_basic.cpp ../include/gr_basic.h $(DEPEND)
confirm.o: confirm.cpp $(COMMON)
confirm.o: confirm.cpp
hotkeys_basic.o: hotkeys_basic.cpp ../include/hotkeys_basic.h $(COMMON)
hotkeys_basic.o: hotkeys_basic.cpp ../include/hotkeys_basic.h
worksheet.o: worksheet.cpp ../include/worksheet.h $(COMMON)
worksheet.o: worksheet.cpp ../include/worksheet.h
selcolor.o: selcolor.cpp ../include/colors.h $(COMMON)
selcolor.o: selcolor.cpp ../include/colors.h
get_component_dialog.o: get_component_dialog.cpp $(COMMON)
get_component_dialog.o: get_component_dialog.cpp
common_plotPS_functions.o: common_plotPS_functions.cpp ../include/plot_common.h $(COMMON)
common_plotPS_functions.o: common_plotPS_functions.cpp ../include/plot_common.h
common_plotHPGL_functions.o: common_plotPS_functions.cpp ../include/plot_common.h $(COMMON)
common_plotHPGL_functions.o: common_plotPS_functions.cpp ../include/plot_common.h
drawtxt.o: drawtxt.cpp ../include/grfonte.h $(COMMON)
drawtxt.o: drawtxt.cpp ../include/grfonte.h
gr_basic.o: gr_basic.cpp ../include/gr_basic.h $(COMMON) ../include/plot_common.h
gr_basic.o: gr_basic.cpp ../include/gr_basic.h ../include/plot_common.h
dcsvg.o: dcsvg.cpp $(COMMON) ../include/dcsvg.h
dcsvg.o: dcsvg.cpp ../include/dcsvg.h
projet_config.o: projet_config.cpp $(COMMON)
projet_config.o: projet_config.cpp
base_struct.o: base_struct.cpp $(COMMON)
base_struct.o: base_struct.cpp
eda_doc.o: eda_doc.cpp $(COMMON)
eda_doc.o: eda_doc.cpp
common.o: common.cpp $(COMMON)
common.o: common.cpp
gestfich.o: gestfich.cpp $(COMMON)
gestfich.o: gestfich.cpp
toolbars.o: toolbars.cpp $(COMMON)
toolbars.o: toolbars.cpp
msgpanel.o: msgpanel.cpp $(COMMON)
msgpanel.o: msgpanel.cpp
block_commande.o: block_commande.cpp $(COMMON)
block_commande.o: block_commande.cpp
string.o: string.cpp
@ -156,10 +193,10 @@ trigo.o: trigo.cpp ../include/trigo.h
bitmaps.o: bitmaps.cpp ../include/bitmaps.h
edaappl.o: edaappl.cpp $(COMMON) ../include/worksheet.h\
edaappl.o: edaappl.cpp ../include/worksheet.h\
../include/common.h ../include/gr_basic.h\
../include/build_version.h
eda_dde.o: eda_dde.cpp $(COMMON) ../include/eda_dde.h
eda_dde.o: eda_dde.cpp ../include/eda_dde.h
displlst.o: displlst.cpp $(COMMON)
displlst.o: displlst.cpp

24
common/makefile.mingw Normal file
View File

@ -0,0 +1,24 @@
WXDIR = $(WXWIN)
all: common.a
include ../libs.win
include makefile.include
all: common.a pcbcommon.a
common.a: $(COMMON_OBJECTS) ../libs.win makefile.include
ar ruv $@ $(COMMON_OBJECTS)
ranlib $@
pcbcommon.a: $(PCB_COMMON_OBJECTS) ../libs.win makefile.include
ar ruv $@ $(PCB_COMMON_OBJECTS)
ranlib $@
clean:
rm -f *.bak
rm -f *.o
rm -f common.a

View File

@ -1,6 +1,6 @@
/****************************************************/
/* class_drawpickedstruct.cpp */
/****************************************************/
/************************/
/* sch_item_struct.cpp */
/************************/
#include "fctsys.h"
#include "common.h"

View File

@ -35,7 +35,6 @@ MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName )
wxString tmp, msg;
wxFileName fn;
MODULE* Module = NULL;
FILE* file;
for( ii = 0; ii < g_LibName_List.GetCount(); ii++ )
{
@ -54,7 +53,7 @@ MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName )
continue;
}
file = wxFopen( tmp, wxT( "rt" ) );
FILE* file = wxFopen( tmp, wxT( "rt" ) );
if( file == NULL )
{
@ -131,12 +130,9 @@ MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName )
}
fclose( file );
file = 0;
file = NULL;
}
if( file )
fclose( file );
msg.Printf( _( "Module %s not found" ), CmpName.GetData() );
DisplayError( this, msg );
return NULL;

View File

@ -4,7 +4,7 @@ OBJSUFF = o
EXTRACPPFLAGS += -DCVPCB -I../include -Ibitmaps\
-I../pcbnew -I../cvpcb -I../share -I../3d-viewer -I ../polygon
EXTRALIBS = ../common/common.a ../bitmaps/libbitmaps.a\
EXTRALIBS = ../common/common.a ../common/pcbcommon.a ../bitmaps/libbitmaps.a\
../polygon/lib_polygon.a\
../polygon/kbool/src/libkbool.a

View File

@ -12,7 +12,7 @@ include ../libs.win
$(TARGET).exe: $(OBJECTS) $(TARGET)_resources.o\
$(EDALIBS) $(LIBVIEWER3D) makefile.g95
$(EDALIBS) $(LIBVIEWER3D) makefile.mingw
$(CXX) $(ALL_LDFLAGS) -o $(TARGET).exe\
$(OBJECTS) $(LIBVIEWER3D) $(TARGET)_resources.o $(EDALIBS) $(SYSWXLIB)

View File

@ -48,6 +48,7 @@ set(EESCHEMA_SRCS
dialog_edit_libentry_fields_in_lib.cpp
dialog_edit_libentry_fields_in_lib_base.cpp
dialog_eeschema_config.cpp
dialog_eeschema_config_fbp.cpp
dialog_erc.cpp
# dialog_find.cpp
dialog_options.cpp

View File

@ -98,7 +98,7 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
}
DrawGraphicText( panel, DC, wxPoint( tposx, posy ), txtcolor,
m_Text, TEXT_ORIENT_HORIZ, size,
side, GR_TEXT_VJUSTIFY_CENTER, LineWidth );
side, GR_TEXT_VJUSTIFY_CENTER, LineWidth, false, true );
}
/* dessin du symbole de connexion */

File diff suppressed because it is too large Load Diff

View File

@ -195,7 +195,7 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
wxPoint( m_Pos.x + offset.x, m_Pos.y - TXTMARGE + offset.y ),
color, m_Text, TEXT_ORIENT_HORIZ, m_Size,
GR_TEXT_HJUSTIFY_LEFT,
GR_TEXT_VJUSTIFY_BOTTOM, width, m_Italic );
GR_TEXT_VJUSTIFY_BOTTOM, width, m_Italic, true );
break;
case 1: /* Vert Orientation UP */
@ -204,7 +204,7 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
m_Pos.y + offset.y ),
color, m_Text, TEXT_ORIENT_VERT, m_Size,
GR_TEXT_HJUSTIFY_RIGHT,
GR_TEXT_VJUSTIFY_BOTTOM, width, m_Italic );
GR_TEXT_VJUSTIFY_BOTTOM, width, m_Italic, true );
break;
case 2: /* Horiz Orientation - Right justified */
@ -213,7 +213,7 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
TXTMARGE + offset.y ),
color, m_Text, TEXT_ORIENT_HORIZ, m_Size,
GR_TEXT_HJUSTIFY_RIGHT,
GR_TEXT_VJUSTIFY_BOTTOM, width, m_Italic );
GR_TEXT_VJUSTIFY_BOTTOM, width, m_Italic, true );
break;
case 3: /* Vert Orientation BOTTOM */
@ -222,7 +222,7 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
m_Pos.y + offset.y ),
color, m_Text, TEXT_ORIENT_VERT, m_Size,
GR_TEXT_HJUSTIFY_RIGHT,
GR_TEXT_VJUSTIFY_TOP, width, m_Italic );
GR_TEXT_VJUSTIFY_TOP, width, m_Italic, true );
break;
}
@ -448,28 +448,28 @@ void SCH_HIERLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offs
DrawGraphicText( panel, DC,
wxPoint( AnchorPos.x - ii, AnchorPos.y ), color,
m_Text, TEXT_ORIENT_HORIZ, m_Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, width, m_Italic );
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, width, m_Italic, true );
break;
case 1: /* Orientation vert UP */
DrawGraphicText( panel, DC,
wxPoint( AnchorPos.x, AnchorPos.y + ii ), color,
m_Text, TEXT_ORIENT_VERT, m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, width, m_Italic );
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, width, m_Italic, true );
break;
case 2: /* Orientation horiz inverse */
DrawGraphicText( panel, DC,
wxPoint( AnchorPos.x + ii, AnchorPos.y ), color,
m_Text, TEXT_ORIENT_HORIZ, m_Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, m_Italic );
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, m_Italic, true );
break;
case 3: /* Orientation vert BOTTOM */
DrawGraphicText( panel, DC,
wxPoint( AnchorPos.x, AnchorPos.y - ii ), color,
m_Text, TEXT_ORIENT_VERT, m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, width, m_Italic );
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, width, m_Italic, true );
break;
}
@ -519,7 +519,7 @@ EDA_Rect SCH_HIERLABEL::GetBoundingBox()
int width = MAX( m_Width, g_DrawMinimunLineWidth );
height = m_Size.y + 2*TXTMARGE;
length = ( Pitch(width) * GetLength() ) + height + 2*DANGLING_SYMBOL_SIZE; // add height for triangular shapes
length = ( Pitch(width) * NegableTextLength(m_Text) ) + height + 2*DANGLING_SYMBOL_SIZE; // add height for triangular shapes
switch( m_Orient ) // respect orientation
{
@ -605,28 +605,28 @@ void SCH_GLOBALLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& dr
DrawGraphicText( panel, DC,
wxPoint( AnchorPos.x - offset, AnchorPos.y ), color,
m_Text, TEXT_ORIENT_HORIZ, m_Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, width, m_Italic );
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, width, m_Italic, true );
break;
case 1: /* Orientation vert UP */
DrawGraphicText( panel, DC,
wxPoint( AnchorPos.x, AnchorPos.y + offset ), color,
m_Text, TEXT_ORIENT_VERT, m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, width, m_Italic );
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, width, m_Italic, true );
break;
case 2: /* Orientation horiz inverse */
DrawGraphicText( panel, DC,
wxPoint( AnchorPos.x + offset, AnchorPos.y ), color,
m_Text, TEXT_ORIENT_HORIZ, m_Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, m_Italic );
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width, m_Italic, true );
break;
case 3: /* Orientation vert BOTTOM */
DrawGraphicText( panel, DC,
wxPoint( AnchorPos.x, AnchorPos.y - offset ), color,
m_Text, TEXT_ORIENT_VERT, m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, width, m_Italic );
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, width, m_Italic, true );
break;
}
@ -647,15 +647,15 @@ void SCH_GLOBALLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& dr
*/
void SCH_GLOBALLABEL::CreateGraphicShape( int* corner_list, const wxPoint& Pos )
{
int HalfSize = m_Size.x / 2;
int HalfSize = m_Size.y / 2;
int width = MAX( m_Width, g_DrawMinimunLineWidth );
*corner_list = 7; corner_list++; // 7 corners in list
int symb_len = ( Pitch(width) * GetLength() ) + (TXTMARGE * 2);
int symb_len = ( Pitch(width) * NegableTextLength(m_Text) ) + (TXTMARGE * 2);
// Create outline shape : 6 points
int x = symb_len + width + 3;
int y = HalfSize + width + 3;
int y = HalfSize*1.5 + width + 3; /* 50% more for negation bar */
corner_list[0] = 0; corner_list[1] = 0; // Starting point (anchor)
corner_list[2] = 0; corner_list[3] = -y; // Up
corner_list[4] = -x; corner_list[5] = -y; // left Up
@ -734,7 +734,7 @@ EDA_Rect SCH_GLOBALLABEL::GetBoundingBox()
int width = MAX( m_Width, g_DrawMinimunLineWidth );
height = m_Size.y + 2*TXTMARGE;
length = ( Pitch(width) * GetLength() ) + 2* height + 2*DANGLING_SYMBOL_SIZE; // add 2*height for triangular shapes (bidirectional)
length = ( Pitch(width) * NegableTextLength(m_Text) ) + 2* height + 2*DANGLING_SYMBOL_SIZE; // add 2*height for triangular shapes (bidirectional)
switch( m_Orient ) // respect orientation
{
@ -782,7 +782,7 @@ EDA_Rect SCH_TEXT::GetBoundingBox()
x = m_Pos.x;
y = m_Pos.y;
int width = MAX( m_Width, g_DrawMinimunLineWidth );
length = ( Pitch(width) * GetLength() );
length = ( Pitch(width) * NegableTextLength(m_Text) );
height = m_Size.y;
dx = dy = 0;

View File

@ -203,8 +203,7 @@ void DIALOG_BUILD_BOM::OnCancelClick( wxCommandEvent& event )
void DIALOG_BUILD_BOM::SavePreferences()
/**************************************************/
{
wxConfig* config = wxGetApp().m_EDA_Config;
wxASSERT( config != NULL );
wxASSERT( m_Config != NULL );
// Determine current settings of "List items" and "Options" checkboxes
// (NOTE: These 6 settings are restored when the dialog box is next

View File

@ -1,22 +1,13 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_eeschema_config.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 17/02/2006 21:14:46
// RCS-ID:
// Copyright: License GNU
// Licence:
// Copyright: Kicad Team
// Licence: GPL
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 17/02/2006 21:14:46
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "dialog_eeschema_config.h"
#endif
////@begin includes
////@end includes
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
@ -32,454 +23,266 @@
#include "id.h"
#include "dialog_eeschema_config.h"
#include "dialog_eeschema_config_fbp.h"
class DIALOG_EESCHEMA_CONFIG : public DIALOG_EESCHEMA_CONFIG_FBP
{
private:
WinEDA_SchematicFrame* m_Parent;
bool m_LibListChanged;
private:
// Virtual event handlers, overide them in your derived class
void Init();
virtual void OnCloseWindow( wxCloseEvent& event );
virtual void OnSaveCfgClick( wxCommandEvent& event );
virtual void OnRemoveLibClick( wxCommandEvent& event );
virtual void OnAddOrInsertLibClick( wxCommandEvent& event );
virtual void OnLibPathSelClick( wxCommandEvent& event );
virtual void OnOkClick( wxCommandEvent& event );
virtual void OnCancelClick( wxCommandEvent& event );
public:
DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame * parent );
~DIALOG_EESCHEMA_CONFIG() {};
};
////@begin XPM images
////@end XPM images
/******************************************************************/
void WinEDA_SchematicFrame::InstallConfigFrame(const wxPoint & pos)
void WinEDA_SchematicFrame::InstallConfigFrame( const wxPoint& pos )
/******************************************************************/
{
KiConfigEeschemaFrame * CfgFrame = new KiConfigEeschemaFrame(this);
CfgFrame->ShowModal(); CfgFrame->Destroy();
DIALOG_EESCHEMA_CONFIG* CfgFrame = new DIALOG_EESCHEMA_CONFIG( this );
CfgFrame->ShowModal(); CfgFrame->Destroy();
}
/*!
* KiConfigEeschemaFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( KiConfigEeschemaFrame, wxDialog )
/*!
* KiConfigEeschemaFrame event table definition
*/
BEGIN_EVENT_TABLE( KiConfigEeschemaFrame, wxDialog )
////@begin KiConfigEeschemaFrame event table entries
EVT_CLOSE( KiConfigEeschemaFrame::OnCloseWindow )
EVT_BUTTON( SAVE_CFG, KiConfigEeschemaFrame::OnSaveCfgClick )
EVT_LISTBOX( FORMAT_NETLIST, KiConfigEeschemaFrame::OnFormatNetlistSelected )
EVT_BUTTON( REMOVE_LIB, KiConfigEeschemaFrame::OnRemoveLibClick )
EVT_BUTTON( ADD_LIB, KiConfigEeschemaFrame::OnAddLibClick )
EVT_BUTTON( INSERT_LIB, KiConfigEeschemaFrame::OnInsertLibClick )
EVT_BUTTON( ID_LIB_PATH_SEL, KiConfigEeschemaFrame::OnLibPathSelClick )
////@end KiConfigEeschemaFrame event table entries
END_EVENT_TABLE()
/*!
* KiConfigEeschemaFrame constructors
*/
KiConfigEeschemaFrame::KiConfigEeschemaFrame( )
/*******************************************************************************/
DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent )
: DIALOG_EESCHEMA_CONFIG_FBP( parent )
/*******************************************************************************/
{
wxString msg;
m_Parent = parent;
m_LibListChanged = false;
Init();
msg = _( "from " ) + wxGetApp().m_CurrentOptionFile;
SetTitle( msg );
if( GetSizer() )
GetSizer()->SetSizeHints( this );
}
KiConfigEeschemaFrame::KiConfigEeschemaFrame( WinEDA_SchematicFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
/***********************************/
void DIALOG_EESCHEMA_CONFIG::Init()
/***********************************/
{
wxString msg;
SetFont( *g_DialogFont );
SetFocus();
m_Parent = parent;
m_LibListChanged = FALSE;
// Display current files extension (info)
wxString msg = m_InfoCmpFileExt->GetLabel() + g_NetCmpExtBuffer;
m_InfoCmpFileExt->SetLabel( msg );
Create(parent, id, caption, pos, size, style);
msg = m_InfoNetFileExt->GetLabel() + NetlistFileExtension;
m_InfoNetFileExt->SetLabel( msg );
msg = _("from ") + wxGetApp().m_CurrentOptionFile;
SetTitle(msg);
SetFormatsNetListes();
m_ListLibr->InsertItems(g_LibName_List, 0);
m_LibDirCtrl->SetValue( g_UserLibDirBuffer );
}
msg = m_InfoLibFileExt->GetLabel() + CompLibFileExtension;
m_InfoLibFileExt->SetLabel( msg );
/*!
* KiConfigEeschemaFrame creator
*/
msg = m_InfoSymbFileExt->GetLabel() + g_SymbolExtBuffer;
m_InfoSymbFileExt->SetLabel( msg );
bool KiConfigEeschemaFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin KiConfigEeschemaFrame member initialisation
m_NetFormatBox = NULL;
m_FileExtList = NULL;
m_ListLibr = NULL;
m_LibDirCtrl = NULL;
////@end KiConfigEeschemaFrame member initialisation
////@begin KiConfigEeschemaFrame creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end KiConfigEeschemaFrame creation
return true;
}
/*!
* Control creation for KiConfigEeschemaFrame
*/
void KiConfigEeschemaFrame::CreateControls()
{
SetFont(*g_DialogFont);
////@begin KiConfigEeschemaFrame content construction
// Generated by DialogBlocks, 10/11/2007 16:00:50 (unregistered)
KiConfigEeschemaFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW|wxALL, 5);
wxButton* itemButton5 = new wxButton( itemDialog1, SAVE_CFG, _("Save Cfg"), wxDefaultPosition, wxDefaultSize, 0 );
if (KiConfigEeschemaFrame::ShowToolTips())
itemButton5->SetToolTip(_("save current configuration setting in the local .pro file"));
itemButton5->SetForegroundColour(wxColour(204, 0, 0));
itemBoxSizer4->Add(itemButton5, 0, wxGROW|wxALL, 5);
itemBoxSizer4->Add(5, 5, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText7 = new wxStaticText( itemDialog1, wxID_STATIC, _("NetList Formats:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer4->Add(itemStaticText7, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_NetFormatBoxStrings;
m_NetFormatBox = new wxListBox( itemDialog1, FORMAT_NETLIST, wxDefaultPosition, wxDefaultSize, m_NetFormatBoxStrings, wxLB_SINGLE );
itemBoxSizer4->Add(m_NetFormatBox, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
itemBoxSizer4->Add(5, 5, 0, wxGROW|wxALL, 5);
wxStaticBox* itemStaticBoxSizer10Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Files ext:"));
m_FileExtList = new wxStaticBoxSizer(itemStaticBoxSizer10Static, wxVERTICAL);
itemBoxSizer4->Add(m_FileExtList, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer11, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer11->Add(itemBoxSizer12, 1, wxGROW, 5);
wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer12->Add(itemBoxSizer13, 0, wxGROW|wxALL, 5);
wxButton* itemButton14 = new wxButton( itemDialog1, REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
if (KiConfigEeschemaFrame::ShowToolTips())
itemButton14->SetToolTip(_("Unload the selected library"));
itemButton14->SetForegroundColour(wxColour(204, 0, 0));
itemBoxSizer13->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton15 = new wxButton( itemDialog1, ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
if (KiConfigEeschemaFrame::ShowToolTips())
itemButton15->SetToolTip(_("Add a new library after the selected library, and load it"));
itemButton15->SetForegroundColour(wxColour(0, 128, 0));
itemBoxSizer13->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton16 = new wxButton( itemDialog1, INSERT_LIB, _("Ins"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton16->SetHelpText(_("Add a new library before the selected library, and load it"));
if (KiConfigEeschemaFrame::ShowToolTips())
itemButton16->SetToolTip(_("Add a new library beforer the selected library, add load it"));
itemButton16->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer13->Add(itemButton16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer12->Add(itemBoxSizer17, 1, wxGROW|wxALL, 5);
wxStaticText* itemStaticText18 = new wxStaticText( itemDialog1, wxID_STATIC, _("Libraries"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText18->SetForegroundColour(wxColour(204, 0, 0));
itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 5);
wxArrayString m_ListLibrStrings;
m_ListLibr = new wxListBox( itemDialog1, ID_LISTBOX, wxDefaultPosition, wxDefaultSize, m_ListLibrStrings, wxLB_SINGLE );
itemBoxSizer17->Add(m_ListLibr, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5);
wxStaticBox* itemStaticBoxSizer20Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Default library file path:"));
wxStaticBoxSizer* itemStaticBoxSizer20 = new wxStaticBoxSizer(itemStaticBoxSizer20Static, wxHORIZONTAL);
itemStaticBoxSizer20Static->SetForegroundColour(wxColour(206, 0, 0));
itemBoxSizer2->Add(itemStaticBoxSizer20, 0, wxGROW|wxALL, 5);
m_LibDirCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
if (KiConfigEeschemaFrame::ShowToolTips())
m_LibDirCtrl->SetToolTip(_("Default path to search libraries which have no absolute path in name,\nor a name which does not start by ./ or ../\nIf void, the default path is kicad/library"));
itemStaticBoxSizer20->Add(m_LibDirCtrl, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxButton* itemButton22 = new wxButton( itemDialog1, ID_LIB_PATH_SEL, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer20->Add(itemButton22, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
////@end KiConfigEeschemaFrame content construction
wxString msg = _("Cmp file Ext: ") + g_NetCmpExtBuffer;
wxStaticText * text = new wxStaticText( itemDialog1, -1, msg, wxDefaultPosition, wxDefaultSize, 0 );
m_FileExtList->Add(text, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 5);
msg = _("Net file Ext: ") + NetlistFileExtension;
text = new wxStaticText( itemDialog1, -1, msg, wxDefaultPosition, wxDefaultSize, 0 );
m_FileExtList->Add(text, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 5);
msg = _("Library file Ext: ") + CompLibFileExtension;
text = new wxStaticText( itemDialog1, -1, msg, wxDefaultPosition, wxDefaultSize, 0 );
m_FileExtList->Add(text, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 5);
msg = _("Symbol file Ext: ") + g_SymbolExtBuffer;
text = new wxStaticText( itemDialog1, -1, msg, wxDefaultPosition, wxDefaultSize, 0 );
m_FileExtList->Add(text, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 5);
msg = _("Schematic file Ext: ") + SchematicFileExtension;
text = new wxStaticText( itemDialog1, -1, msg, wxDefaultPosition, wxDefaultSize, 0 );
m_FileExtList->Add(text, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 5);
msg = m_InfoSchFileExt->GetLabel() + SchematicFileExtension;
m_InfoSchFileExt->SetLabel( msg );
// Init currently availlable netlist formats
wxArrayString NetlistNameItems;
NetlistNameItems.Add(wxT("Pcbnew"));
NetlistNameItems.Add(wxT("OrcadPcb2"));
NetlistNameItems.Add(wxT("CadStar"));
NetlistNameItems.Add(wxT("Spice"));
NetlistNameItems.Add( wxT( "Pcbnew" ) );
NetlistNameItems.Add( wxT( "OrcadPcb2" ) );
NetlistNameItems.Add( wxT( "CadStar" ) );
NetlistNameItems.Add( wxT( "Spice" ) );
// Add extra neltlist format (using external converter)
msg = ReturnUserNetlistTypeName( true );
while ( ! msg.IsEmpty() )
while( !msg.IsEmpty() )
{
NetlistNameItems.Add(msg);
NetlistNameItems.Add( msg );
msg = ReturnUserNetlistTypeName( false );
}
m_NetFormatBox->InsertItems(NetlistNameItems, 0);
m_NetFormatBox->InsertItems( NetlistNameItems, 0 );
if( g_NetFormat > (int) m_NetFormatBox->GetCount() )
g_NetFormat = NET_TYPE_PCBNEW;
m_NetFormatBox->SetSelection( g_NetFormat - NET_TYPE_PCBNEW );
m_ListLibr->InsertItems( g_LibName_List, 0 );
m_LibDirCtrl->SetValue( g_UserLibDirBuffer );
}
/*!
* Should we show tooltips?
*/
bool KiConfigEeschemaFrame::ShowToolTips()
/******************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnCancelClick( wxCommandEvent& event )
/******************************************************************/
{
return true;
EndModal( -1 );
}
/*!
* Get bitmap resources
*/
wxBitmap KiConfigEeschemaFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin KiConfigEeschemaFrame bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end KiConfigEeschemaFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon KiConfigEeschemaFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin KiConfigEeschemaFrame icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end KiConfigEeschemaFrame icon retrieval
}
/**************************************************************/
void KiConfigEeschemaFrame::OnCloseWindow(wxCloseEvent & event)
void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
/**************************************************************/
{
ChangeSetup();
if ( m_LibListChanged )
{
LoadLibraries(m_Parent);
if ( m_Parent->m_ViewlibFrame )
m_Parent->m_ViewlibFrame->ReCreateListLib();
}
EndModal(0);
// Set new netlist format
g_NetFormat = m_NetFormatBox->GetSelection() + NET_TYPE_PCBNEW;
// Set new default path lib
g_UserLibDirBuffer = m_LibDirCtrl->GetValue();
SetRealLibraryPath( wxT( "library" ) ); // set real path lib
// Set new active lib list
if( m_LibListChanged )
{
// Recreate lib list
g_LibName_List.Clear();
for ( unsigned ii = 0; ii < m_ListLibr->GetCount(); ii ++ )
g_LibName_List.Add(m_ListLibr->GetString(ii) );
// take new list in account
LoadLibraries( m_Parent );
if( m_Parent->m_ViewlibFrame )
m_Parent->m_ViewlibFrame->ReCreateListLib();
}
if ( event.GetId() != ID_SAVE_CFG )
EndModal( 0 );
}
/*********************************************/
void KiConfigEeschemaFrame::ChangeSetup()
/*********************************************/
/**************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnCloseWindow( wxCloseEvent& event )
/**************************************************************/
{
g_UserLibDirBuffer = m_LibDirCtrl->GetValue();
EndModal( 0 );
}
/********************************************************/
void KiConfigEeschemaFrame::LibDelFct(wxCommandEvent& event)
/********************************************************/
/*********************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
/*********************************************************************/
{
int ii;
int ii;
ii = m_ListLibr->GetSelection();
if ( ii < 0 ) return;
g_LibName_List.RemoveAt(ii);
m_ListLibr->Clear();
m_ListLibr->InsertItems(g_LibName_List, 0);
m_LibListChanged = TRUE;
}
/****************************************************************/
void KiConfigEeschemaFrame::AddOrInsertLibrary(wxCommandEvent& event)
/****************************************************************/
/* Insert or add a library to the existing library list:
New library is put in list before (insert) or after (add)
the selection
*/
{
int ii;
wxString tmp;
wxFileName fn;
/* TODO: Fix this, it's broken. Add should add the new library to the
* end of the list and insert should insert the new library ahead
* of the selected library in the list or at the beginning if no
* library is selected. */
ii = m_ListLibr->GetSelection();
if ( ii < 0 )
ii = 0;
ChangeSetup();
if( event.GetId() == ADD_LIB)
{
if( g_LibName_List.GetCount() != 0 )
ii++; /* Add after selection */
}
wxFileDialog dlg( this, _( "Schematic Component Library Files" ),
g_RealLibDirBuffer, wxEmptyString, CompLibFileWildcard,
wxFD_OPEN | wxFD_MULTIPLE | wxFD_FILE_MUST_EXIST );
if ( dlg.ShowModal() != wxID_OK )
ii = m_ListLibr->GetSelection();
if( ii < 0 )
return;
wxArrayString Filenames;
dlg.GetPaths(Filenames);
m_ListLibr->Delete(ii);
m_LibListChanged = TRUE;
}
for ( unsigned jj = 0; jj < Filenames.GetCount(); jj ++ )
{
fn = Filenames[jj];
/* If the library path is already in the library search paths
* list, just add the library name to the list. Otherwise, add
* the library name with the full path. */
if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) == wxNOT_FOUND )
tmp = fn.GetPathWithSep() + fn.GetName();
/**************************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
/**************************************************************************/
/* Insert or add a library to the existing library list:
* New library is put in list before (insert) or after (add)
* the selection
*/
{
int ii;
wxString FullLibName, ShortLibName, Mask;
ii = m_ListLibr->GetSelection();
if( ii < 0 )
ii = 0;
if( event.GetId() == ID_ADD_LIB )
{
if( m_ListLibr->GetCount() != 0 )
ii++; /* Add after selection */
}
wxString libpath = m_LibDirCtrl->GetValue();
if ( libpath.IsEmpty() )
libpath = g_RealLibDirBuffer;
Mask = wxT( "*" ) + CompLibFileExtension;
wxFileDialog FilesDialog( this, _( "Library files:" ), libpath,
wxEmptyString, Mask,
wxFD_DEFAULT_STYLE | wxFD_MULTIPLE );
int diag = FilesDialog.ShowModal();
if( diag != wxID_OK )
return;
wxArrayString Filenames;
FilesDialog.GetPaths( Filenames );
for( unsigned jj = 0; jj < Filenames.GetCount(); jj++ )
{
FullLibName = Filenames[jj];
ShortLibName = MakeReducedFileName( FullLibName, libpath, CompLibFileExtension );
if( ShortLibName.IsEmpty() ) //Just in case...
continue;
//Add or insert new library name, if not already in list
#ifdef __WINDOWS__
bool case_sensitive = false;
#else
bool case_sensitive = true;
#endif
if( m_ListLibr->FindString( ShortLibName, case_sensitive ) == wxNOT_FOUND )
{
m_LibListChanged = TRUE;
m_ListLibr->Insert( ShortLibName, ii );
}
else
tmp = fn.GetName();
// Add or insert new library name.
if( g_LibName_List.Index( tmp ) == wxNOT_FOUND )
{
m_LibListChanged = TRUE;
g_LibName_List.Insert( tmp, ii++ );
m_ListLibr->Clear();
m_ListLibr->InsertItems(g_LibName_List, 0);
}
else
{
wxString msg = wxT("<") + tmp + wxT("> : ") +
_("Library already in use");
DisplayError(this, msg);
}
}
{
wxString msg;
msg << wxT( "<" ) << ShortLibName << wxT( "> : " ) << _( "Library already in use" );
DisplayError( this, msg );
}
}
}
/****************************************************/
void KiConfigEeschemaFrame::SetFormatsNetListes()
/****************************************************/
/* Adjust the m_NetFormatBox current selection, according to the current netlist format*/
/*******************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnSaveCfgClick( wxCommandEvent& event )
/*******************************************************************/
{
if ( g_NetFormat > (int)m_NetFormatBox->GetCount() )
g_NetFormat = NET_TYPE_PCBNEW;
m_NetFormatBox->SetSelection(g_NetFormat - NET_TYPE_PCBNEW);
OnOkClick( event );
m_Parent->Save_Config( this );
}
/*!
* wxEVT_COMMAND_NETLIST_SELECTED event handler for FORMAT_NETLIST
*/
void KiConfigEeschemaFrame::OnFormatNetlistSelected( wxCommandEvent& event )
/***********************************************************************/
void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event )
/***********************************************************************/
{
g_NetFormat = m_NetFormatBox->GetSelection() + NET_TYPE_PCBNEW;
wxString path = m_LibDirCtrl->GetValue();
if ( path.IsEmpty() )
path = g_RealLibDirBuffer;
bool select = EDA_DirectorySelector( _( " Default Path for libraries" ), /* Titre de la fenetre */
path, /* Chemin par defaut */
wxDD_DEFAULT_STYLE,
this, /* parent frame */
wxDefaultPosition );
if( !select )
return;
m_LibDirCtrl->SetValue( path );
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for DEL_LIB
*/
void KiConfigEeschemaFrame::OnRemoveLibClick( wxCommandEvent& event )
{
LibDelFct(event);
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ADD_LIB
*/
void KiConfigEeschemaFrame::OnAddLibClick( wxCommandEvent& event )
{
AddOrInsertLibrary(event);
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for INSERT_LIB
*/
void KiConfigEeschemaFrame::OnInsertLibClick( wxCommandEvent& event )
{
AddOrInsertLibrary(event);
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for SAVE_CFG
*/
void KiConfigEeschemaFrame::OnSaveCfgClick( wxCommandEvent& event )
{
ChangeSetup();
m_Parent->Save_Config(this);
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIB_PATH_SEL
*/
void KiConfigEeschemaFrame::OnLibPathSelClick( wxCommandEvent& event )
{
wxString path = g_RealLibDirBuffer;
bool select = EDA_DirectorySelector(_(" Default Path for libraries"), /* Titre de la fenetre */
path, /* Chemin par defaut */
wxDD_DEFAULT_STYLE,
this, /* parent frame */
wxDefaultPosition);
if ( !select ) return;
m_LibDirCtrl->SetValue(path);
}

View File

@ -1,139 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_eeschema_config.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 17/02/2006 21:14:46
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 17/02/2006 21:14:46
#ifndef _DIALOG_EESCHEMA_CONFIG_H_
#define _DIALOG_EESCHEMA_CONFIG_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "dialog_eeschema_config.h"
#endif
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define SAVE_CFG 10001
#define FORMAT_NETLIST 10006
#define REMOVE_LIB 10009
#define ADD_LIB 10010
#define INSERT_LIB 10011
#define ID_LISTBOX 10012
#define ID_TEXTCTRL 10007
#define ID_LIB_PATH_SEL 10008
#define SYMBOL_KICONFIGEESCHEMAFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
#define SYMBOL_KICONFIGEESCHEMAFRAME_TITLE _("Dialog")
#define SYMBOL_KICONFIGEESCHEMAFRAME_IDNAME ID_DIALOG
#define SYMBOL_KICONFIGEESCHEMAFRAME_SIZE wxSize(400, 300)
#define SYMBOL_KICONFIGEESCHEMAFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* KiConfigEeschemaFrame class declaration
*/
class KiConfigEeschemaFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( KiConfigEeschemaFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
KiConfigEeschemaFrame( );
KiConfigEeschemaFrame( WinEDA_SchematicFrame* parent, wxWindowID id = SYMBOL_KICONFIGEESCHEMAFRAME_IDNAME, const wxString& caption = SYMBOL_KICONFIGEESCHEMAFRAME_TITLE, const wxPoint& pos = SYMBOL_KICONFIGEESCHEMAFRAME_POSITION, const wxSize& size = SYMBOL_KICONFIGEESCHEMAFRAME_SIZE, long style = SYMBOL_KICONFIGEESCHEMAFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_KICONFIGEESCHEMAFRAME_IDNAME, const wxString& caption = SYMBOL_KICONFIGEESCHEMAFRAME_TITLE, const wxPoint& pos = SYMBOL_KICONFIGEESCHEMAFRAME_POSITION, const wxSize& size = SYMBOL_KICONFIGEESCHEMAFRAME_SIZE, long style = SYMBOL_KICONFIGEESCHEMAFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin KiConfigEeschemaFrame event handler declarations
/// wxEVT_CLOSE_WINDOW event handler for ID_DIALOG
void OnCloseWindow( wxCloseEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for SAVE_CFG
void OnSaveCfgClick( wxCommandEvent& event );
/// wxEVT_COMMAND_LISTBOX_SELECTED event handler for FORMAT_NETLIST
void OnFormatNetlistSelected( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for REMOVE_LIB
void OnRemoveLibClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ADD_LIB
void OnAddLibClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for INSERT_LIB
void OnInsertLibClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIB_PATH_SEL
void OnLibPathSelClick( wxCommandEvent& event );
////@end KiConfigEeschemaFrame event handler declarations
////@begin KiConfigEeschemaFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end KiConfigEeschemaFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void SetFormatsNetListes();
void LibDelFct(wxCommandEvent& event);
void AddOrInsertLibrary(wxCommandEvent& event);
void ChangeSetup();
////@begin KiConfigEeschemaFrame member variables
wxListBox* m_NetFormatBox;
wxStaticBoxSizer* m_FileExtList;
wxListBox* m_ListLibr;
wxTextCtrl* m_LibDirCtrl;
////@end KiConfigEeschemaFrame member variables
WinEDA_SchematicFrame * m_Parent;
bool m_LibListChanged;
};
#endif
// _DIALOG_EESCHEMA_CONFIG_H_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,164 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_eeschema_config_fbp.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
m_staticTextNetListFormats = new wxStaticText( this, wxID_ANY, _("NetList Formats:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextNetListFormats->Wrap( -1 );
bLeftSizer->Add( m_staticTextNetListFormats, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_NetFormatBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE );
bLeftSizer->Add( m_NetFormatBox, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bLeftSizer->Add( 0, 20, 0, wxEXPAND, 5 );
wxStaticBoxSizer* sFileExtBox;
sFileExtBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Files ext:") ), wxVERTICAL );
m_InfoCmpFileExt = new wxStaticText( this, wxID_ANY, _("Cmp file Ext: "), wxDefaultPosition, wxDefaultSize, 0 );
m_InfoCmpFileExt->Wrap( -1 );
sFileExtBox->Add( m_InfoCmpFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_InfoNetFileExt = new wxStaticText( this, wxID_ANY, _("Net file Ext: "), wxDefaultPosition, wxDefaultSize, 0 );
m_InfoNetFileExt->Wrap( -1 );
sFileExtBox->Add( m_InfoNetFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_InfoLibFileExt = new wxStaticText( this, wxID_ANY, _("Library file Ext: "), wxDefaultPosition, wxDefaultSize, 0 );
m_InfoLibFileExt->Wrap( -1 );
sFileExtBox->Add( m_InfoLibFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_InfoSymbFileExt = new wxStaticText( this, wxID_ANY, _("Symbol file Ext: "), wxDefaultPosition, wxDefaultSize, 0 );
m_InfoSymbFileExt->Wrap( -1 );
sFileExtBox->Add( m_InfoSymbFileExt, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_InfoSchFileExt = new wxStaticText( this, wxID_ANY, _("Schematic file Ext: "), wxDefaultPosition, wxDefaultSize, 0 );
m_InfoSchFileExt->Wrap( -1 );
sFileExtBox->Add( m_InfoSchFileExt, 0, wxALL, 5 );
bLeftSizer->Add( sFileExtBox, 0, wxEXPAND, 5 );
bUpperSizer->Add( bLeftSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* sbLibsChoiceSizer;
sbLibsChoiceSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Libraries") ), wxVERTICAL );
wxBoxSizer* bLibsButtonsSizer;
bLibsButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
sbLibsChoiceSizer->Add( bLibsButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticTextlibList = new wxStaticText( this, wxID_ANY, _("Active Libraries:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextlibList->Wrap( -1 );
sbLibsChoiceSizer->Add( m_staticTextlibList, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListLibr = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL|wxLB_NEEDED_SB|wxLB_SINGLE );
m_ListLibr->SetToolTip( _("List of active library files.\nOnly library files in this list are loaded by Eeschema.\nThe order of this list is important:\nEeschema searchs for a given component using this list order priority.") );
m_ListLibr->SetMinSize( wxSize( 300,-1 ) );
sbLibsChoiceSizer->Add( m_ListLibr, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bUpperSizer->Add( sbLibsChoiceSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
m_buttonRemove = new wxButton( this, ID_REMOVE_LIB, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonRemove->SetForegroundColour( wxColour( 186, 1, 38 ) );
m_buttonRemove->SetToolTip( _("Unload the selected library") );
bRightSizer->Add( m_buttonRemove, 0, wxALL, 5 );
m_buttonAdd = new wxButton( this, ID_ADD_LIB, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonAdd->SetForegroundColour( wxColour( 13, 118, 1 ) );
m_buttonAdd->SetToolTip( _("Add a new library after the selected library, and load it") );
bRightSizer->Add( m_buttonAdd, 0, wxALL, 5 );
m_buttonIns = new wxButton( this, wxID_ANY, _("Ins"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonIns->SetForegroundColour( wxColour( 0, 65, 130 ) );
m_buttonIns->SetToolTip( _("Add a new library before the selected library, and load it") );
bRightSizer->Add( m_buttonIns, 0, wxALL, 5 );
bRightSizer->Add( 0, 20, 1, wxEXPAND, 5 );
m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
bRightSizer->Add( m_buttonOk, 0, wxALL, 5 );
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonCancel->SetForegroundColour( wxColour( 14, 0, 179 ) );
bRightSizer->Add( m_buttonCancel, 0, wxALL, 5 );
m_buttonSave = new wxButton( this, ID_SAVE_CFG, _("Save Cfg"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonSave->SetToolTip( _("Accept and save current configuration setting in the local .pro file") );
bRightSizer->Add( m_buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bUpperSizer->Add( bRightSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
wxStaticBoxSizer* sbLibPathSizer;
sbLibPathSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Default library file path:") ), wxHORIZONTAL );
m_LibDirCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_LibDirCtrl->SetToolTip( _("Default path to search libraries which have no absolute path in name,\nor a name which does not start by ./ or ../\nIf void, the default path is kicad/share/library") );
sbLibPathSizer->Add( m_LibDirCtrl, 1, wxALL, 5 );
m_buttonBrowse = new wxButton( this, ID_LIB_PATH_SEL, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
sbLibPathSizer->Add( m_buttonBrowse, 0, wxALL, 5 );
bMainSizer->Add( sbLibPathSizer, 0, wxEXPAND, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) );
m_buttonRemove->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this );
m_buttonAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this );
m_buttonIns->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this );
m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this );
m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this );
m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnSaveCfgClick ), NULL, this );
m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnLibPathSelClick ), NULL, this );
}
DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCloseWindow ) );
m_buttonRemove->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnRemoveLibClick ), NULL, this );
m_buttonAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this );
m_buttonIns->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnAddOrInsertLibClick ), NULL, this );
m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnOkClick ), NULL, this );
m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnCancelClick ), NULL, this );
m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnSaveCfgClick ), NULL, this );
m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EESCHEMA_CONFIG_FBP::OnLibPathSelClick ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,82 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_eeschema_config_fbp__
#define __dialog_eeschema_config_fbp__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/listbox.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/statline.h>
#include <wx/textctrl.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_EESCHEMA_CONFIG_FBP
///////////////////////////////////////////////////////////////////////////////
class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog
{
private:
protected:
enum
{
ID_REMOVE_LIB = 1000,
ID_ADD_LIB,
ID_SAVE_CFG,
ID_LIB_PATH_SEL,
};
wxStaticText* m_staticTextNetListFormats;
wxListBox* m_NetFormatBox;
wxStaticText* m_InfoCmpFileExt;
wxStaticText* m_InfoNetFileExt;
wxStaticText* m_InfoLibFileExt;
wxStaticText* m_InfoSymbFileExt;
wxStaticText* m_InfoSchFileExt;
wxStaticText* m_staticTextlibList;
wxListBox* m_ListLibr;
wxButton* m_buttonRemove;
wxButton* m_buttonAdd;
wxButton* m_buttonIns;
wxButton* m_buttonOk;
wxButton* m_buttonCancel;
wxButton* m_buttonSave;
wxStaticLine* m_staticline1;
wxTextCtrl* m_LibDirCtrl;
wxButton* m_buttonBrowse;
// Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); }
virtual void OnRemoveLibClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnAddOrInsertLibClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnSaveCfgClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLibPathSelClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 593,400 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EESCHEMA_CONFIG_FBP();
};
#endif //__dialog_eeschema_config_fbp__

View File

@ -40,6 +40,7 @@ OBJECTS = eeschema.o\
tool_sch.o\
tool_viewlib.o\
schframe.o\
sch_item_struct.o\
viewlib_frame.o\
dialog_print_using_printer_base.o\
dialog_print_using_printer.o\
@ -52,6 +53,7 @@ OBJECTS = eeschema.o\
block_libedit.o\
eeredraw.o\
dialog_eeschema_config.o\
dialog_eeschema_config_fbp.o\
eelayer.o \
priorque.o eeconfig.o \
getpart.o\
@ -191,8 +193,12 @@ onleftclick.o: onleftclick.cpp $(DEPEND)
eeredraw.o: eeredraw.cpp $(DEPEND)
dialog_eeschema_config.o: dialog_eeschema_config.cpp dialog_eeschema_config.h $(DEPEND)
dialog_eeschema_config.o: dialog_eeschema_config.cpp dialog_eeschema_config_fbp.h $(DEPEND)
dialog_eeschema_config_fbp.o: dialog_eeschema_config_fbp.cpp dialog_eeschema_config_fbp.h $(DEPEND)
libedit.o: libedit.cpp $(DEPEND)
sch_item_struct.o: ../common/sch_item_struct.cpp
$(CXX) -c $(EDACPPFLAGS) -o $@ ../common/$*.cpp

View File

@ -1,4 +1,4 @@
EXTRALIBS = ../common/common.a ../bitmaps/libbitmaps.a\
EXTRALIBS = ../common/common.a ../common/pcbcommon.a ../bitmaps/libbitmaps.a\
../polygon/lib_polygon.a ../polygon/kbool/src/libkbool.a
EXTRACPPFLAGS= -DGERBVIEW -DPCBNEW -fno-strict-aliasing\

View File

@ -10,6 +10,11 @@
class WinEDA_DrawPanel;
/** Function NegableTextLength
* Return the text length of a negable string, excluding the ~ markers */
int NegableTextLength( const wxString& aText );
/** Function DrawGraphicText
* Draw a graphic text (like module texts)
* @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas
@ -24,21 +29,23 @@ class WinEDA_DrawPanel;
* @param aWidth = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width)
* @param aItalic = true to simulate an italic font
* @param aNegable = true to enable the ~ char for overbarring
* @param aCallback() = function called (if non null) to draw each segment.
* used to draw 3D texts or for plotting, NULL for normal drawings
*/
void DrawGraphicText( WinEDA_DrawPanel* aPanel,
wxDC* aDC,
const wxPoint& aPos,
enum EDA_Colors aColor,
const wxString& aText,
int aOrient,
const wxSize& aSize,
enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify,
int aWidth = 0,
bool aItalic = false,
void (*aCallback)(int x0, int y0, int xf, int yf) = NULL);
void DrawGraphicText( WinEDA_DrawPanel * aPanel,
wxDC * aDC,
const wxPoint &aPos,
enum EDA_Colors aColor,
const wxString &aText,
int aOrient,
const wxSize &aSize,
enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify,
int aWidth = 0,
bool aItalic = false,
bool aNegable = false,
void (*aCallback)( int x0, int y0, int xf, int yf ) = NULL );
/** Function PlotGraphicText
* same as DrawGraphicText, but plot graphic text insteed of draw it
@ -53,18 +60,19 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
* @param aWidth = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width)
* @param aItalic = true to simulate an italic font
* @param aNegable = true to enable the ~ char for overbarring
*/
void PlotGraphicText( int aFormat_plot,
const wxPoint& aPos,
enum EDA_Colors aColor,
const wxString& aText,
int aOrient,
const wxSize& aSize,
enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify,
int aWidth,
bool aItalic = false );
void PlotGraphicText( int aFormat_plot,
const wxPoint& aPos,
enum EDA_Colors aColor,
const wxString& aText,
int aOrient,
const wxSize& aSize,
enum GRTextHorizJustifyType aH_justify,
enum GRTextVertJustifyType aV_justify,
int aWidth,
bool aItalic = false,
bool aNegable = false );
#endif /* __INCLUDE__DRAWTXT_H__ */

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
KICAD_SUBDIRS = common bitmaps 3d-viewer polygon polygon/kbool/src eeschema eeschema/plugins pcbnew kicad cvpcb gerbview
KICAD_SUBDIRS_BIN = eeschema eeschema/plugins pcbnew cvpcb kicad gerbview
# How to invoke make:
MAKE = make -k -f makefile.g95
MAKE_INSTALL = make -f makefile.g95 install
MAKE_CLEAN = make -f makefile.g95 clean
MAKE = make -k -f makefile.mingw
MAKE_INSTALL = make -f makefile.mingw install
MAKE_CLEAN = make -f makefile.mingw clean
all:
@for d in $(KICAD_SUBDIRS); do (cd $$d && $(MAKE)); done

View File

@ -70,11 +70,19 @@ void ZONE_CONTAINER::SetNet( int anet_code )
if( m_Parent )
{
EQUIPOT* net = ( (BOARD*) m_Parent )->FindNet( anet_code );
BOARD* board = (BOARD*) m_Parent;
EQUIPOT* net = board->FindNet( anet_code );
if( net )
m_Netname = net->GetNetname();
else
m_Netname.Empty();
// Set corresponding SEGZONE items if this zone uses fill areas by segments
for( SEGZONE* zseg = board->m_Zone; zseg; zseg = zseg->Next() )
{
if ( zseg->m_TimeStamp == m_TimeStamp )
zseg->SetNet(GetNet());
}
}
else
m_Netname.Empty();

View File

@ -77,7 +77,7 @@ MODULE* WinEDA_ModuleEditFrame::Import_Module( wxDC* DC )
if( file == NULL )
{
wxString msg;
msg.Printf( _( "File <%s> not found" ), dlg.GetPath() );
msg.Printf( _( "File <%s> not found" ), dlg.GetPath().GetData() );
DisplayError( this, msg );
return NULL;
}

View File

@ -1,5 +1,5 @@
EXTRALIBS = ../common/common.a ../bitmaps/libbitmaps.a\
EXTRALIBS = ../common/common.a ../common/pcbcommon.a ../bitmaps/libbitmaps.a\
../polygon/lib_polygon.a\
../polygon/kbool/src/libkbool.a
@ -49,14 +49,7 @@ OBJECTS= $(TARGET).o\
setpage.o \
tool_pcb.o \
pcbframe.o \
class_drawsegment.o \
class_track.o \
class_cotation.o\
class_equipot.o \
class_module.o \
class_edge_mod.o \
class_text_mod.o\
class_board_item.o\
track.o \
set_color.o \
set_grid.o \
@ -65,7 +58,6 @@ OBJECTS= $(TARGET).o\
affiche.o \
swap_layers.o \
tracepcb.o \
tracemod.o \
trpiste.o \
surbrill.o \
edit_pcb_text.o \
@ -154,16 +146,6 @@ export_gencad.o: export_gencad.cpp
print_board_functions.o: print_board_functions.cpp
class_track.o: class_track.cpp class_track.h
class_equipot.o: class_equipot.cpp
class_module.o: class_module.cpp
class_edge_mod.o: class_edge_mod.cpp
class_text_mod.o: class_text_mod.cpp
pcbnew.o: pcbnew.cpp pcbnew.h pcbplot.h drag.h \
autorout.h ../include/eda_dde.h
@ -179,8 +161,6 @@ swap_layers.o: swap_layers.cpp
tracepcb.o: tracepcb.cpp
tracemod.o: tracemod.cpp ../include/grfonte.h
trpiste.o: trpiste.cpp
surbrill.o: surbrill.cpp

View File

@ -11,7 +11,7 @@ all: $(TARGET).exe
include makefile.include
$(TARGET).exe: $(OBJECTS) $(TARGET)_resources.o\
$(EDALIBS) $(LIBVIEWER3D) makefile.g95
$(EDALIBS) $(LIBVIEWER3D) makefile.mingw
$(CXX) $(ALL_LDFLAGS) -o $(TARGET).exe\
$(OBJECTS) $(LIBVIEWER3D) $(TARGET)_resources.o $(EDALIBS) $(SYSWXLIB)