Jean-Pierre's changes for kicad-2007-05-25 release

This commit is contained in:
dickelbeck 2007-05-28 18:09:49 +00:00
parent 1db1374098
commit ae74527bc2
223 changed files with 15290 additions and 6116 deletions

View File

@ -225,16 +225,34 @@ float spin_quat[4];
if ( event.m_wheelRotation )
{
if ( event.GetWheelRotation() > 0 )
{
g_Parm_3D_Visu.m_Zoom /= 1.4;
if ( g_Parm_3D_Visu.m_Zoom <= 0.01)
g_Parm_3D_Visu.m_Zoom = 0.01;
}
else g_Parm_3D_Visu.m_Zoom *= 1.4;
DisplayStatus();
Refresh(FALSE);
if( event.ShiftDown() ) {
if ( event.GetWheelRotation() < 0 ) {
/* up */
SetView3D(WXK_UP);
} else {
/* down */
SetView3D(WXK_DOWN);
}
} else if( event.ControlDown() ) {
if ( event.GetWheelRotation() > 0 ) {
/* right */
SetView3D(WXK_RIGHT);
} else {
/* left */
SetView3D(WXK_LEFT);
}
}
else {
if ( event.GetWheelRotation() > 0 )
{
g_Parm_3D_Visu.m_Zoom /= 1.4;
if ( g_Parm_3D_Visu.m_Zoom <= 0.01)
g_Parm_3D_Visu.m_Zoom = 0.01;
}
else g_Parm_3D_Visu.m_Zoom *= 1.4;
DisplayStatus();
Refresh(FALSE);
}
}
if (event.Dragging())
@ -582,6 +600,8 @@ bool fmt_is_jpeg = FALSE;
);
if ( FullFileName.IsEmpty() ) return;
}
wxYield(); // Requested to allow tne window redraw after closing the dialog box
wxSize image_size = GetClientSize();
wxClientDC dc(this);
wxBitmap bitmap(image_size.x, image_size.y );

View File

@ -49,6 +49,8 @@ int LineNum = 0;
return -1;
}
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
setlocale(LC_NUMERIC, "C");
while ( GetLine(file, line, &LineNum, 512) )
{
text = strtok(line, " \t\n\r");
@ -68,6 +70,7 @@ int LineNum = 0;
}
fclose (file);
setlocale(LC_NUMERIC, ""); // revert to the current locale
return 0;
}
@ -130,44 +133,44 @@ S3D_Material * material = NULL;
if ( stricmp (text, "diffuseColor") == 0 )
{
text = strtok(NULL," \t\n\r");
material->m_DiffuseColor.x = atof(from_point(text));
material->m_DiffuseColor.x = atof(text);
text = strtok(NULL," \t\n\r");
material->m_DiffuseColor.y = atof(from_point(text));
material->m_DiffuseColor.y = atof(text);
text = strtok(NULL," \t\n\r");
material->m_DiffuseColor.z = atof(from_point(text));
material->m_DiffuseColor.z = atof(text);
}
else if ( stricmp (text, "emissiveColor") == 0 )
{
text = strtok(NULL," \t\n\r");
material->m_EmissiveColor.x = atof(from_point(text));
material->m_EmissiveColor.x = atof(text);
text = strtok(NULL," \t\n\r");
material->m_EmissiveColor.y = atof(from_point(text));
material->m_EmissiveColor.y = atof(text);
text = strtok(NULL," \t\n\r");
material->m_EmissiveColor.z = atof(from_point(text));
material->m_EmissiveColor.z = atof(text);
}
else if ( strnicmp (text, "specularColor", 13 ) == 0 )
{
text = strtok(NULL," \t\n\r");
material->m_SpecularColor.x = atof(from_point(text));
material->m_SpecularColor.x = atof(text);
text = strtok(NULL," \t\n\r");
material->m_SpecularColor.y = atof(from_point(text));
material->m_SpecularColor.y = atof(text);
text = strtok(NULL," \t\n\r");
material->m_SpecularColor.z = atof(from_point(text));
material->m_SpecularColor.z = atof(text);
}
else if ( strnicmp (text, "ambientIntensity", 16 ) == 0 )
{
text = strtok(NULL," \t\n\r");
material->m_AmbientIntensity = atof(from_point(text));
material->m_AmbientIntensity = atof(text);
}
else if ( strnicmp (text, "transparency", 12 ) == 0 )
{
text = strtok(NULL," \t\n\r");
material->m_Transparency = atof(from_point(text));
material->m_Transparency = atof(text);
}
else if ( strnicmp (text, "shininess", 9 ) == 0 )
{
text = strtok(NULL," \t\n\r");
material->m_Shininess = atof(from_point(text));
material->m_Shininess = atof(text);
}
}
}
@ -323,7 +326,7 @@ char string_num[512];
case ',':
jj = 0;
if ( ! StartData || !HasData) break;
data_list[ii] = atof(from_point(string_num));
data_list[ii] = atof(string_num);
string_num[jj] = 0;
ii++;
if ( ii >= nn )
@ -463,7 +466,7 @@ int * index = NULL;
while ( text )
{
if ( *text == ']') break;
jj = atoi(from_point(text));
jj = atoi(text);
if ( jj < 0 )
{
S3D_Vertex * curr_coord = coords;

View File

@ -4,7 +4,7 @@ CC = gcc
# Compiler flags.
CPPFLAGS = -Wall -O2 -DPCBNEW -I../pcbnew -I ../include -I../common\
`wx-config --cxxflags`
`wx-config --cxxflags` -fno-strict-aliasing
include ../libs.linux
@ -23,6 +23,7 @@ $(TARGET).a: $(OBJECTS3D) makefile.gtk makefile.include
ar -rv $@ $(OBJECTS3D)
ranlib $@
install:$(TARGET).a
clean:
rm -f *.o

View File

@ -1,17 +1,11 @@
EXTRALIBS =
EXTRACPPFLAGS= -I./ -I../include -I../common -I../pcbnew
CPPFLAGS += $(EXTRACPPFLAGS)
OBJECTS3D = 3d_frame.o 3d_read_mesh.o 3d_canvas.o trackball.o 3d_aux.o\
3d_draw.o 3d_toolbar.o 3d_class.o
OBJECTS= ../common/trigo.o
AUXLIBS= -mthreads -o $(TARGET)$(DLLSUFF)\
$(WXLIB_BASE) $(LIBS3D)\
-lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm\
-lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32
3d_class.o: 3d_class.cpp 3d_struct.h 3d_viewer.h
3d_read_mesh.o: 3d_read_mesh.cpp 3d_struct.h 3d_viewer.h

View File

@ -5,6 +5,7 @@ CC = gcc
CPPFLAGS = -Wall -O2 -DPCBNEW -I../pcbnew -I ../include -I../common\
`wx-config --cxxflags`
CPPFLAGS += -arch i386 -arch ppc
include ../libs.macosx

160
bitmaps/directory.xpm Normal file
View File

@ -0,0 +1,160 @@
/* XPM */
#ifndef XPMMAIN
extern char * directory_xpm[];
#else
char * directory_xpm[] = {
"16 16 136 2",
" c None",
". c #469FFF",
"+ c #4193FF",
"@ c #4499FF",
"# c #2C63AC",
"$ c #4DA0FF",
"% c #B5D9FB",
"& c #AAD3FB",
"* c #ADD3FB",
"= c #89C4FF",
"- c #184888",
"; c #4495FF",
"> c #AED5FB",
", c #6DB3F9",
"' c #6FB2F9",
") c #6BAEF8",
"! c #67ABF6",
"~ c #549FF9",
"{ c #3E91FF",
"] c #ACD4FB",
"^ c #6BAEF9",
"/ c #6CAFF8",
"( c #66AAF7",
"_ c #5DA3F6",
": c #74AEF7",
"< c #9EC4F8",
"[ c #92BCF7",
"} c #8DB5F5",
"| c #88B1F3",
"1 c #83ABF2",
"2 c #80A8F0",
"3 c #87AEF5",
"4 c #0940B7",
"5 c #AAD2FB",
"6 c #67ACF8",
"7 c #68ABF8",
"8 c #61A4F7",
"9 c #5B9FF5",
"0 c #5399F3",
"a c #498FF1",
"b c #3F85EF",
"c c #367CEB",
"d c #2E73E8",
"e c #286BE6",
"f c #2164E2",
"g c #2163E5",
"h c #023AB6",
"i c #4394FF",
"j c #A7D0FA",
"k c #63A9F7",
"l c #61A7F7",
"m c #5BA0F6",
"n c #5499F4",
"o c #4B90F2",
"p c #4186EF",
"q c #377DEB",
"r c #2E73E7",
"s c #266AE5",
"t c #2062E2",
"u c #1C5DDF",
"v c #1A5CE2",
"w c #A4CEF9",
"x c #5DA5F7",
"y c #5DA1F6",
"z c #559AF4",
"A c #4C91F3",
"B c #4489F1",
"C c #3A7FED",
"D c #3075E9",
"E c #276BE5",
"F c #2062E1",
"G c #1B5CDE",
"H c #1758DB",
"I c #1857DE",
"J c #0239B6",
"K c #A1CBF9",
"L c #589FF6",
"M c #559BF5",
"N c #4F96F3",
"O c #478CF2",
"P c #3D84F0",
"Q c #3378EB",
"R c #2B6EE7",
"S c #2265E3",
"T c #1C5DDE",
"U c #1757DB",
"V c #1554DA",
"W c #1555DD",
"X c #0139B5",
"Y c #4696FF",
"Z c #FFFFFF",
"` c #FBFBFB",
" . c #F2F2F2",
".. c #E9E9E9",
"+. c #E0E0E0",
"@. c #D7D7D7",
"#. c #D4D4D4",
"$. c #A9A9A9",
"%. c #BABABA",
"&. c #9E9990",
"*. c #0A3DAF",
"=. c #FEFEFE",
"-. c #F8F8F8",
";. c #F1F1F1",
">. c #E8E8E8",
",. c #DCDCDC",
"'. c #D6D6D6",
"). c #D2D2D2",
"!. c #A7A7A7",
"~. c #B7B7B7",
"{. c #929292",
"]. c #BAB6AC",
"^. c #0E41B3",
"/. c #F0F0F0",
"(. c #E5E5E5",
"_. c #DDDDDD",
":. c #D3D3D3",
"<. c #D0D0D0",
"[. c #ABABAB",
"}. c #B5B5B5",
"|. c #939393",
"1. c #ADADAD",
"2. c #938E85",
"3. c #0A3DAE",
"4. c #FFFFFE",
"5. c #F4F4F4",
"6. c #EDEDED",
"7. c #DBDBDB",
"8. c #AEAEAE",
"9. c #969696",
"0. c #878787",
"a. c #AFABA1",
"b. c #0D40B2",
"c. c #0037B2",
"d. c #0034A8",
"e. c #0038B6",
" ",
" . + @ # ",
" $ % & * = - ",
"; > , ' ) ! ~ { + + + + + . ",
"; ] ^ / ( _ : < [ } | 1 2 3 4 ",
"; 5 6 7 8 9 0 a b c d e f g h ",
"i j k l m n o p q r s t u v h ",
"i w x y z A B C D E F G H I J ",
"i K L M N O P Q R S T U V W X ",
"Y Z Z Z Z ` ...+.@.#.$.%.&.*. ",
"Y Z Z =.-.;.>.,.'.).!.~.{.].^. ",
"Y Z =.-./.(._.:.<.[.}.|.1.2.3. ",
"Y 4.5.6.(.7.#.<.1.8.9.!.0.a.b. ",
" c.d.d.d.d.d.d.d.d.d.d.d.e. ",
" ",
" "};
#endif

113
bitmaps/icon_python.xpm Normal file
View File

@ -0,0 +1,113 @@
/* XPM */
#ifndef XPMMAIN
extern char * icon_python_xpm[];
#else
char * icon_python_xpm[] = {
"32 32 72 1",
" c None",
". c #7EA5C6",
"+ c #6495BD",
"@ c #4383B6",
"# c #437FB2",
"$ c #6491B5",
"% c #7DA1BF",
"& c #3882BE",
"* c #387CB5",
"= c #3779AF",
"- c #3776AB",
"; c #4988BB",
"> c #CDDFEE",
", c #F7F7FF",
"' c #82ADD1",
") c #3773A5",
"! c #7096B5",
"~ c #4385BB",
"{ c #FFFFFF",
"] c #F6F5F5",
"^ c #3C729E",
"/ c #9BBDDA",
"( c #366D9C",
"_ c #387FBA",
": c #5A91BF",
"< c #376A94",
"[ c #FFED60",
"} c #FFE659",
"| c #F8E16E",
"1 c #FFEB5E",
"2 c #FFE354",
"3 c #4489C0",
"4 c #3885C3",
"5 c #FFDB4C",
"6 c #FBCE47",
"7 c #FFD544",
"8 c #72A0C5",
"9 c #507CA1",
"0 c #FFE052",
"a c #FFD040",
"b c #F5D98D",
"c c #7F9EB8",
"d c #F1ECDA",
"e c #FFCC3B",
"f c #FBC840",
"g c #FBD54F",
"h c #FCC539",
"i c #4379A7",
"j c #DCE1E7",
"k c #FAE262",
"l c #FFC532",
"m c #FBC037",
"n c #80A6C6",
"o c #FFBC29",
"p c #F7CD74",
"q c #427DAE",
"r c #FABE40",
"s c #FFB521",
"t c #497FAC",
"u c #FFCD57",
"v c #FFE097",
"w c #FFD67B",
"x c #FFD849",
"y c #FFFBF2",
"z c #F7DE92",
"A c #FFCF6A",
"B c #FFEDC8",
"C c #FFE4AC",
"D c #F7D284",
"E c #FFB531",
"F c #F7D47B",
"G c #FDBE2E",
" ",
" ",
" .+@###$% ",
" &&&**==--- ",
" ;&>,'*===))))! ",
" ~&{{]==--))))^ ",
" &&'/@===)))((( ",
" __**===)))(((( ",
" ((((( ",
" :&&&**====)))(((<<[[}}| ",
" &&&&&**===)))(((<<<11}22 ",
" 34&__***---))(((<<<<222556 ",
" 4&&&**====)))((<<<<<225557 ",
" 84&&***==--))(((<<<<900577ab ",
" ~&&&**===)))(((<<<<cd5577aef ",
" ___**====)))((<<<<9dg577eeeh ",
" __***==ijk[[[[[}225557aeelll ",
" @_**===j|[[[[[}}00577aeelllm ",
" n*==---k[[[[}}225577aellllop ",
" **=---}[[[[}225577eelllloo ",
" q===))[[[[}225577aeellloor ",
" --)))[[}}00577aeelllooos ",
" tiii11}005566fffffmmmmp ",
" 22255 ",
" 225557aeelllom ",
" 00557aeeeuvwoo ",
" gx77aeelly{{sm ",
" z77aellllABCsD ",
" 6ellloossE ",
" FmGoop ",
" ",
" "};
#endif

View File

@ -0,0 +1,123 @@
/* XPM */
#ifndef XPMMAIN
extern char * icon_python_small_xpm[];
#else
char *icon_python_small_xpm[] = {
"16 16 98 2",
" c None",
". c #5490C0",
"+ c #3E7EB4",
"@ c #3D7CB0",
"# c #5488B2",
"$ c #4686BB",
"% c #8FB8DA",
"& c #DCE6F1",
"* c #377AB0",
"= c #3778AD",
"- c #3773A5",
"; c #5684AA",
"> c #3880BC",
", c #4A8AC0",
"' c #538DBD",
") c #3779AF",
"! c #3774A8",
"~ c #3772A3",
"{ c #366D9C",
"] c #366C9A",
"^ c #799785",
"/ c #FFEA5C",
"( c #FCE464",
"_ c #3883BF",
": c #387EB7",
"< c #387AB1",
"[ c #366E9E",
"} c #376A94",
"| c #9BA876",
"1 c #FFE658",
"2 c #FFDF50",
"3 c #4B8EC4",
"4 c #3882BE",
"5 c #387AB2",
"6 c #3778AE",
"7 c #3775A9",
"8 c #A1AA77",
"9 c #FFDE50",
"0 c #FFD848",
"a c #FCD55B",
"b c #3B81BB",
"c c #3880BB",
"d c #387BB4",
"e c #3776AA",
"f c #376B96",
"g c #7E9CB2",
"h c #FADE70",
"i c #FFD646",
"j c #FFCF3E",
"k c #FDC93C",
"l c #3B80B9",
"m c #387CB5",
"n c #6393BB",
"o c #F3E486",
"p c #FFED60",
"q c #FFE85B",
"r c #FFE253",
"s c #FFDA4A",
"t c #FFD545",
"u c #FFCD3C",
"v c #FFC734",
"w c #FEC433",
"x c #508ABB",
"y c #3776AB",
"z c #9AAD84",
"A c #FFE558",
"B c #FFE152",
"C c #FFD342",
"D c #FFCB3A",
"E c #FFC532",
"F c #FFC330",
"G c #FCC242",
"H c #9BB082",
"I c #FFEB5E",
"J c #FFE659",
"K c #FFE052",
"L c #FFD241",
"M c #FFC02E",
"N c #FFBA27",
"O c #4379A7",
"P c #C0C273",
"Q c #FFDE4F",
"R c #FFDB4C",
"S c #FFD040",
"T c #FFCC3B",
"U c #FFCE54",
"V c #FFC540",
"W c #FDBE30",
"X c #F9DA70",
"Y c #FFD645",
"Z c #FFC836",
"` c #FFEEC9",
" . c #FFD37B",
".. c #F9C95E",
"+. c #FCCC4D",
"@. c #FEC232",
"#. c #FFBC29",
"$. c #FCBD3D",
" ",
" . + @ # ",
" $ % & * = - - ; ",
" > , ' ) ! ~ { { ",
" { ] ^ / ( ",
" _ > : < = - [ ] } | 1 2 ",
" 3 4 : 5 6 7 ~ { } } 8 9 0 a ",
" b c d ) e - { f } g h i j k ",
" l m * n o p p q r s t u v w ",
" x * y z p p A B s C D E F G ",
" = ! H I J K 0 L D v M N ",
" O P 1 Q R ",
" r 9 s S T U V W ",
" X Y S Z E ` ... ",
" +.@.#.$. ",
" "
};
#endif

125
bitmaps/icon_txt.xpm Normal file
View File

@ -0,0 +1,125 @@
/* XPM */
#ifndef XPMMAIN
extern char * icon_txt_xpm[];
#else
char * icon_txt_xpm[] = {
"16 16 100 2",
" c None",
". c #AFAFAF",
"+ c #B8CEF8",
"@ c #B4CBF6",
"# c #9EBDF1",
"$ c #7CA5EA",
"% c #719EE6",
"& c #6697E2",
"* c #5B8FDE",
"= c #5088DA",
"- c #4581D6",
"; c #3A7AD2",
"> c #3072CE",
", c #256BCA",
"' c #F2F6FD",
") c #F1F5FD",
"! c #EFF4FC",
"~ c #EEF3FC",
"{ c #ECF1FA",
"] c #E9EFF8",
"^ c #E6ECF6",
"/ c #E3EAF5",
"( c #E0E8F2",
"_ c #DDE5F0",
": c #DBE3EF",
"< c #D8E1EC",
"[ c #FFFFFF",
"} c #FDFDFD",
"| c #FDE080",
"1 c #F2CC84",
"2 c #E0AB8A",
"3 c #F6F6F6",
"4 c #F5F5F5",
"5 c #F3F3F3",
"6 c #F0F0F0",
"7 c #FEFEFE",
"8 c #FCFBF8",
"9 c #FCE135",
"0 c #FFC729",
"a c #F6AB5E",
"b c #F2EBE8",
"c c #F4F4F4",
"d c #F2F2F2",
"e c #EDEDED",
"f c #FDE394",
"g c #FFDB35",
"h c #FFC340",
"i c #EAA871",
"j c #EAEAEA",
"k c #FCFCFC",
"l c #FDE24E",
"m c #FFCC36",
"n c #FCAC4C",
"o c #EEE1D8",
"p c #F1F1F1",
"q c #ECECEC",
"r c #FCE8B2",
"s c #FFE458",
"t c #FFCD55",
"u c #EDAA6D",
"v c #EEEEEE",
"w c #FEE473",
"x c #FFD861",
"y c #FDC16A",
"z c #EAD4C5",
"A c #F7E8C4",
"B c #FEEB80",
"C c #FFD871",
"D c #EFB579",
"E c #EEEEEF",
"F c #E3E3E6",
"G c #DDDDE1",
"H c #EDEDEE",
"I c #FCDF8D",
"J c #FFE389",
"K c #FED58A",
"L c #E7C8B2",
"M c #ECECED",
"N c #E1E1E4",
"O c #DBDBE0",
"P c #F7D090",
"Q c #FFEAB7",
"R c #ECB989",
"S c #E0E0E4",
"T c #DCDCE1",
"U c #E0B98F",
"V c #E2AD8A",
"W c #DBD1D1",
"X c #DDDDE2",
"Y c #DFDFE3",
"Z c #FBFBFB",
"` c #F9F9F9",
" . c #F8F8F8",
".. c #D3A78A",
"+. c #DFD9DA",
"@. c #E0E0E5",
"#. c #E4E4E8",
"$. c #EEEEF0",
"%. c #F7F7F7",
"&. c #E6E6E6",
" . . . . . . . . . . . . . . ",
" . + @ # $ % & * = - ; > , . ",
" . ' ) ! ~ { ] ^ / ( _ : < . ",
" . [ [ [ [ } | 1 2 3 4 5 6 . ",
" . [ [ [ 7 8 9 0 a b c d e . ",
" . [ [ 7 } f g h i c 5 6 j . ",
" . [ [ 7 k l m n o c p q q . ",
" . [ 7 } r s t u c d v v v . ",
" . } } k w x y z p 6 6 6 6 . ",
" . d 5 A B C D d d E F G H . ",
" . 5 5 I J K L M N O O O F . ",
" . 4 4 P Q R S T T . . . . . ",
" . 3 3 U V W X X Y . Z k ` . ",
" . . ...+.@.#.$.%.. d v . ",
" . ` ` ` ` ` ` ` ` . &.. ",
" . . . . . . . . . . . "};
#endif

102
bitmaps/new_txt.xpm Normal file
View File

@ -0,0 +1,102 @@
/* XPM */
#ifndef XPMMAIN
extern char * new_txt_xpm[];
#else
char * new_txt_xpm[] = {
"16 16 78 1",
" c None",
". c #000000",
"+ c #FEFEFE",
"@ c #090909",
"# c #EEEEEE",
"$ c #F1F1F1",
"% c #FBFBFB",
"& c #FBE291",
"* c #F2CC84",
"= c #E2B497",
"- c #F3F3F3",
"; c #767676",
"> c #F3F2F1",
", c #FCE135",
"' c #FFC729",
") c #F6AB5E",
"! c #F1EBE9",
"~ c #F0F0F0",
"{ c #161616",
"] c #FCE397",
"^ c #FFDB35",
"/ c #FFC340",
"( c #EAA871",
"_ c #EFEFEF",
": c #C4C4C4",
"< c #F6F6F6",
"[ c #FDE24E",
"} c #FFCC36",
"| c #FCAC4C",
"1 c #EEE2D9",
"2 c #ECECEC",
"3 c #FBE8B5",
"4 c #FFE458",
"5 c #FFCD55",
"6 c #EDAA6D",
"7 c #EBEBEB",
"8 c #FEE473",
"9 c #FFD861",
"0 c #FDC16A",
"a c #EADBD1",
"b c #EDEDED",
"c c #EAEAEA",
"d c #F4E9CE",
"e c #FEEB80",
"f c #FFD871",
"g c #EFB579",
"h c #E9E9E9",
"i c #E8E8E8",
"j c #E3E3E6",
"k c #DDDDE1",
"l c #FDFDFD",
"m c #FBDF8D",
"n c #FFE389",
"o c #FED58A",
"p c #E7C8B2",
"q c #E2E2E5",
"r c #DEDEE2",
"s c #DFDFE2",
"t c #E7E7E7",
"u c #FCFCFC",
"v c #F7D090",
"w c #FFEAB7",
"x c #ECB989",
"y c #E0E0E4",
"z c #DCDCE1",
"A c #E6E6E6",
"B c #E5E5E5",
"C c #E0B98F",
"D c #E2AD8A",
"E c #DBD1D1",
"F c #DDDDE2",
"G c #E0E0E3",
"H c #E4E4E4",
"I c #DBBDA9",
"J c #E0DBDC",
"K c #E1E1E6",
"L c #E5E5E8",
"M c #E3E3E3",
" ............ ",
".++++++++++@+. ",
".+###$$$$$$@%+. ",
".+###&*=-$$@;++.",
".+##>,')!$~@@@{.",
".+#~]^/(-___##:.",
".+#<[}|1_####2:.",
".+#3456~#####7:.",
".+-890a222bccc:.",
".+defghihjkhii:.",
".lmnop7qkrsttt:.",
".uvwxyzzAAAAAB:.",
".uCDEFFGAABBHH:.",
".lIJKL####HMMM:.",
".::::::::::::::.",
" .............. "};
#endif

View File

@ -64,7 +64,7 @@ void BASE_SCREEN::InitDatas(void)
case CVPCB_DISPLAY_FRAME:
case MODULE_EDITOR_FRAME:
case PCB_FRAME:
m_CurrentSheet = &g_Sheet_A3;
m_CurrentSheet = &g_Sheet_A4;
break;
case GERBER_FRAME:
@ -98,7 +98,22 @@ void BASE_SCREEN::InitDatas(void)
m_FlagSave = 1; // indique sauvegarde auto faite
}
/******************************************************************/
wxPoint BASE_SCREEN::CursorRealPosition(const wxPoint & ScreenPos)
/******************************************************************/
{
wxPoint curpos;
curpos.x = ScreenPos.x * GetZoom();
curpos.y = ScreenPos.y * GetZoom();
curpos.x += m_DrawOrg.x;
curpos.y += m_DrawOrg.y;
return curpos;
}
/***************************************/
int BASE_SCREEN::GetInternalUnits(void)
/***************************************/

View File

@ -12,8 +12,8 @@
#include "common.h"
#include "wxstruct.h"
#include "base_struct.h"
#include "grfonte.h"
#include "grfonte.h"
#include "macros.h"
@ -65,7 +65,7 @@ wxT("lib cmp draw line"),
wxT("lib cmp pin"),
wxT("lib cmp field"),
wxT("unknown"),
wxT("unknown")
wxT("unknown")
};
@ -84,32 +84,32 @@ EDA_BaseStruct::EDA_BaseStruct(EDA_BaseStruct * parent, int idType)
m_StructType = idType;
m_Parent = parent; /* Chainage hierarchique sur struct racine */
}
/********************************************/
EDA_BaseStruct::EDA_BaseStruct(int idType)
/********************************************/
{
{
InitVars();
m_StructType = idType;
}
/********************************************/
void EDA_BaseStruct::InitVars(void)
void EDA_BaseStruct::InitVars(void)
/********************************************/
{
{
m_StructType = TYPE_NOT_INIT;
Pnext = NULL; /* Linked list: Link (next struct) */
Pback = NULL; /* Linked list: Link (previous struct) */
m_Parent = NULL; /* Linked list: Link (parent struct) */
m_Son = NULL; /* Linked list: Link (son struct) */
m_Son = NULL; /* Linked list: Link (son struct) */
m_Image = NULL; /* Link to an image copy for undelete or abort command */
m_Flags = 0; /* flags for editions and other */
m_TimeStamp = 0; // Time stamp used for logical links
m_Status = 0;
m_Selected = 0; /* Used by block commands, and selective editing */
}
}
/* Gestion de l'etat (status) de la structure (active, deleted..) */
int EDA_BaseStruct::GetState(int type)
@ -136,20 +136,20 @@ addition d'une nouvelle struct a la liste chain
laststruct->Pnext = this;
}
/**************************************************************************************/
void EDA_BaseStruct::Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset,
int draw_mode, int Color)
/**************************************************************************************/
/* Virtual
void EDA_BaseStruct::Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset,
int draw_mode, int Color)
/**************************************************************************************/
/* Virtual
*/
{
wxString msg, name;
msg.Printf( wxT("EDA_BaseStruct::Draw() error. Method for struct type %d used but not implemented ("),
m_StructType);
msg += ReturnClassName() + wxT(")\n");
printf ( CONV_TO_UTF8(msg));
}
{
wxString msg, name;
msg.Printf( wxT("EDA_BaseStruct::Draw() error. Method for struct type %d used but not implemented ("),
m_StructType);
msg += ReturnClassName() + wxT(")\n");
printf ( CONV_TO_UTF8(msg));
}
#if 0
/**************************************************************/
@ -219,20 +219,20 @@ EDA_TextStruct::~EDA_TextStruct(void)
}
m_TextDrawingsSize = 0; /* nombre de sommets a dessiner */
}
/********************************/
int EDA_TextStruct::Len_Size(void)
/********************************/
// Return the text lenght in internal units
{
int nbchar = m_Text.Len();
int len;
if ( nbchar == 0 ) return 0;
len = ((10 * m_Size.x ) / 9) * nbchar;
return len;
}
/********************************/
int EDA_TextStruct::Len_Size(void)
/********************************/
// Return the text lenght in internal units
{
int nbchar = m_Text.Len();
int len;
if ( nbchar == 0 ) return 0;
len = ((10 * m_Size.x ) / 9) * nbchar;
return len;
}
/*************************************************/
int EDA_TextStruct::Locate(const wxPoint & posref)
@ -302,7 +302,7 @@ int width;
m_TextDrawings[2] + offset.y + m_Pos.y,
m_TextDrawings[3] + offset.x + m_Pos.x,
m_TextDrawings[4] + offset.y + m_Pos.y,
color);
width, color);
}
else
@ -317,9 +317,9 @@ int width;
int cY = m_Pos.y - offset.y;
/* trace ancre du texte */
GRLine(&panel->m_ClipBox, DC, cX - anchor_size, cY,
cX + anchor_size, cY, anchor_color);
cX + anchor_size, cY, 0, anchor_color);
GRLine(&panel->m_ClipBox, DC, cX, cY - anchor_size ,
cX, cY + anchor_size , anchor_color);
cX, cY + anchor_size , 0, anchor_color);
}
jj = 5; ii = jj+1;
while (ii < m_TextDrawingsSize)
@ -352,7 +352,7 @@ int width;
}
}
else
GRPoly(&panel->m_ClipBox, DC, nbpoints, coord, 0, color, color);
GRPoly(&panel->m_ClipBox, DC, nbpoints, coord, 0, 0, color, color);
}
}
@ -377,7 +377,7 @@ int ii, jj, kk,nbchar, nbpoints, AsciiCode, endcar;
int k1 , k2 , x0 , y0 ;
int size_h , size_v , espacement ;
char f_cod , plume = 'U';
const wxChar * ptr;
const wxChar * ptr;
const SH_CODE * ptcar;
int ux0, uy0, dx, dy; // Coord de trace des segments de texte & variables de calcul */
int cX, cY; // Centre du texte

View File

@ -29,7 +29,7 @@ wxSize minsize;
SetFont(*g_StdFont);
m_MenuBar = NULL; // menu du haut d'ecran
m_HToolBar = NULL;
m_FrameIsActive = FALSE;
m_FrameIsActive = TRUE;
m_MsgFrameHeight = MSG_PANEL_DEFAULT_HEIGHT;
minsize.x = 470;

View File

@ -112,10 +112,10 @@ void DrawBlockStruct::Draw(WinEDA_DrawPanel * panel, wxDC * DC)
int h = GetHeight()/panel->GetZoom();
if ( w == 0 || h == 0 )
GRLine(&panel->m_ClipBox, DC, GetX(), GetY(),
GetRight(), GetBottom(), m_Color);
GetRight(), GetBottom(), 0, m_Color);
else
GRRect(&panel->m_ClipBox, DC, GetX(), GetY(),
GetRight(), GetBottom(), m_Color);
GetRight(), GetBottom(), 0, m_Color);
}
/*************************************************************************/

View File

@ -1,206 +1,207 @@
/******************************************/
/* Kicad: Common plot HPGL Routines */
/******************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "trigo.h"
#include "wxstruct.h"
#include "base_struct.h"
#include "common.h"
#include "plot_common.h"
#include "macros.h"
/* parametre HPGL pour trace de cercle: */
#define CHORD_ANGLE 10
// Variables partagees avec Common plot Postscript Routines
extern wxPoint LastPenPosition;
extern wxPoint PlotOffset;
extern FILE * PlotOutputFile;
extern double XScale, YScale;
extern int PenWidth;
extern int PlotOrientOptions, etat_plume;
//Variables locales
void Move_Plume_HPGL( wxPoint pos, int plume );
void Plume_HPGL( int plume );
/***********************************************************************************/
void InitPlotParametresHPGL(wxPoint offset, double xscale, double yscale, int orient)
/***********************************************************************************/
/* Set the plot offset for the current plotting
xscale,yscale = coordinate scale (scale coefficient for coordinates)
device_xscale,device_yscale = device coordinate scale (i.e scale used by plot device)
*/
{
PlotOffset = offset;
XScale = xscale;
YScale = yscale;
PenWidth = 6; /* epaisseur du trait standard en 1/1000 pouce */
PlotOrientOptions = orient;
}
/*****************************************************************/
bool PrintHeaderHPGL(FILE * plot_file, int pen_speed, int pen_num)
/*****************************************************************/
{
char Line[256];
PlotOutputFile = plot_file;
etat_plume = 'U';
sprintf(Line,"IN;VS%d;PU;PA;SP%d;\n",pen_speed,pen_num);
fputs(Line,plot_file);
return TRUE;
}
/**********************************/
bool CloseFileHPGL(FILE * plot_file)
/**********************************/
{
fputs("PU;PA;SP0;\n",PlotOutputFile) ; fclose(PlotOutputFile) ;
fclose(plot_file);
return TRUE;
}
/************************************************************/
void PlotCircle_HPGL(wxPoint centre, int diameter, int width)
/************************************************************/
{
int rayon;
char Line[256];
UserToDeviceCoordinate(centre);
rayon = (int)(diameter / 2 * XScale);
if(rayon < 0 ) rayon = 0 ;
Plume_HPGL('U');
sprintf(Line,"PA %d,%d;CI %d,%d;\n", centre.x, centre.y, rayon , CHORD_ANGLE);
fputs(Line,PlotOutputFile) ;
Plume_HPGL('U'); return ;
}
/********************************************************************/
void PlotArcHPGL(wxPoint centre, int StAngle, int EndAngle, int rayon)
/********************************************************************/
/* trace d'un arc de cercle:
centre = coord du centre
StAngle, EndAngle = angle de debut et fin
rayon = rayon de l'arc
commande
PU;PA x,y;PD;AA start_arc_X, start_arc_Y, angle, NbSegm; PU;
ou PU;PA x,y;PD;AA start_arc_X, start_arc_Y, angle; PU;
*/
{
char Line[256];
wxPoint cmap; /* point de depart */
wxPoint cpos; /* centre */
float angle; /* angle de l'arc*/
if(rayon <= 0 ) return ;
cpos = centre; UserToDeviceCoordinate(cpos);
if( PlotOrientOptions == PLOT_MIROIR)
{
EndAngle = - EndAngle;
StAngle = - StAngle;
EXCHG (StAngle, EndAngle);
}
angle = (EndAngle - StAngle) /10.0;
/* Calcul des coord du point de depart : */
cmap.x = (int)( centre.x + ( rayon * cos(StAngle * M_PI / 1800 ) ) );
cmap.y = (int)(centre.y + ( rayon * sin(StAngle * M_PI / 1800 ) ) );
UserToDeviceCoordinate(cmap);
Plume_HPGL('U');
sprintf(Line,"PU;PA %d,%d;PD;AA %d,%d, ", cmap.x, cmap.y, cpos.x, cpos.y);
fputs(Line,PlotOutputFile) ;
sprintf(Line,"%f", - angle); to_point(Line); // Transforme , et . du separateur
fputs(Line,PlotOutputFile) ;
sprintf(Line,", %d", CHORD_ANGLE); fputs(Line,PlotOutputFile) ;
sprintf(Line,";PU;\n"); fputs(Line,PlotOutputFile) ;
Plume_HPGL('U');
}
/*****************************************************/
void PlotPolyHPGL( int nb, int * coord, int fill)
/*****************************************************/
/* Trace un polygone (ferme si rempli) en format HPGL
coord = tableau des coord des sommets
nb = nombre de coord ( 1 coord = 2 elements: X et Y du tableau )
fill : si != 0 polygone rempli
*/
{
int ii;
if( nb <= 1 ) return;
Move_Plume_HPGL( wxPoint(coord[0],coord[1]), 'U');
for( ii = 1; ii < nb ; ii ++ )
{
Move_Plume_HPGL( wxPoint(coord[ii * 2],coord[(ii*2) +1]), 'D');
}
/* Fermeture eventuelle du polygone */
if ( fill )
{
ii = (nb - 1) * 2;
if( (coord[ii] != coord[0] ) || (coord[ii+1] != coord[0]) )
Move_Plume_HPGL( wxPoint(coord[0],coord[1]), 'D');
}
Plume_HPGL('U');
}
/**********************************************/
void Move_Plume_HPGL( wxPoint pos, int plume )
/**********************************************/
/*
deplace la plume levee (plume = 'U') ou baissee (plume = 'D')
en position x,y
Unites en Unites DESSIN
Si plume = 'Z' lever de plume sans deplacement
*/
{
char Line[256];
if ( plume == 'Z')
{
Plume_HPGL('U');
return;
}
Plume_HPGL(plume);
UserToDeviceCoordinate(pos);
sprintf(Line,"PA %d,%d;\n",pos.x,pos.y) ; fputs(Line,PlotOutputFile) ;
}
/***************************/
void Plume_HPGL( int plume )
/***************************/
/* leve (plume = 'U') ou baisse (plume = 'D') la plume
*/
{
if ( plume == 'U')
{
if(etat_plume != 'U' ) fputs("PU;",PlotOutputFile) ;
etat_plume = 'U';
}
else
{
if(etat_plume != 'D' )fputs("PD;",PlotOutputFile) ;
etat_plume = 'D';
}
}
/******************************************/
/* Kicad: Common plot HPGL Routines */
/******************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "trigo.h"
#include "wxstruct.h"
#include "base_struct.h"
#include "common.h"
#include "plot_common.h"
#include "macros.h"
/* parametre HPGL pour trace de cercle: */
#define CHORD_ANGLE 10
// Variables partagees avec Common plot Postscript Routines
extern wxPoint LastPenPosition;
extern wxPoint PlotOffset;
extern FILE * PlotOutputFile;
extern double XScale, YScale;
extern int g_DefaultPenWidth, g_CurrentPenWidth;
extern int PlotOrientOptions, etat_plume;
//Variables locales
void Move_Plume_HPGL( wxPoint pos, int plume );
void Plume_HPGL( int plume );
/***********************************************************************************/
void InitPlotParametresHPGL(wxPoint offset, double xscale, double yscale, int orient)
/***********************************************************************************/
/* Set the plot offset for the current plotting
xscale,yscale = coordinate scale (scale coefficient for coordinates)
device_xscale,device_yscale = device coordinate scale (i.e scale used by plot device)
*/
{
PlotOffset = offset;
XScale = xscale;
YScale = yscale;
g_DefaultPenWidth = 6; /* epaisseur du trait standard en 1/1000 pouce */
PlotOrientOptions = orient;
g_CurrentPenWidth = -1;
}
/*****************************************************************/
bool PrintHeaderHPGL(FILE * plot_file, int pen_speed, int pen_num)
/*****************************************************************/
{
char Line[256];
PlotOutputFile = plot_file;
etat_plume = 'U';
sprintf(Line,"IN;VS%d;PU;PA;SP%d;\n",pen_speed,pen_num);
fputs(Line,plot_file);
return TRUE;
}
/**********************************/
bool CloseFileHPGL(FILE * plot_file)
/**********************************/
{
fputs("PU;PA;SP0;\n",plot_file);
fclose(plot_file);
return TRUE;
}
/************************************************************/
void PlotCircle_HPGL(wxPoint centre, int diameter, int width)
/************************************************************/
{
int rayon;
char Line[256];
UserToDeviceCoordinate(centre);
rayon = (int)(diameter / 2 * XScale);
if(rayon < 0 ) rayon = 0 ;
Plume_HPGL('U');
sprintf(Line,"PA %d,%d;CI %d,%d;\n", centre.x, centre.y, rayon , CHORD_ANGLE);
fputs(Line,PlotOutputFile) ;
Plume_HPGL('U'); return ;
}
/********************************************************************/
void PlotArcHPGL(wxPoint centre, int StAngle, int EndAngle, int rayon, int width)
/********************************************************************/
/* trace d'un arc de cercle:
centre = coord du centre
StAngle, EndAngle = angle de debut et fin
rayon = rayon de l'arc
commande
PU;PA x,y;PD;AA start_arc_X, start_arc_Y, angle, NbSegm; PU;
ou PU;PA x,y;PD;AA start_arc_X, start_arc_Y, angle; PU;
*/
{
char Line[256];
wxPoint cmap; /* point de depart */
wxPoint cpos; /* centre */
float angle; /* angle de l'arc*/
if(rayon <= 0 ) return ;
cpos = centre; UserToDeviceCoordinate(cpos);
if( PlotOrientOptions == PLOT_MIROIR)
{
EndAngle = - EndAngle;
StAngle = - StAngle;
EXCHG (StAngle, EndAngle);
}
angle = (EndAngle - StAngle) /10.0;
/* Calcul des coord du point de depart : */
cmap.x = (int)( centre.x + ( rayon * cos(StAngle * M_PI / 1800 ) ) );
cmap.y = (int)(centre.y + ( rayon * sin(StAngle * M_PI / 1800 ) ) );
UserToDeviceCoordinate(cmap);
Plume_HPGL('U');
sprintf(Line,"PU;PA %d,%d;PD;AA %d,%d, ", cmap.x, cmap.y, cpos.x, cpos.y);
fputs(Line,PlotOutputFile) ;
sprintf(Line,"%f", - angle); to_point(Line); // Transforme , et . du separateur
fputs(Line,PlotOutputFile) ;
sprintf(Line,", %d", CHORD_ANGLE); fputs(Line,PlotOutputFile) ;
sprintf(Line,";PU;\n"); fputs(Line,PlotOutputFile) ;
Plume_HPGL('U');
}
/*****************************************************/
void PlotPolyHPGL( int nb, int * coord, int fill, int width)
/*****************************************************/
/* Trace un polygone (ferme si rempli) en format HPGL
coord = tableau des coord des sommets
nb = nombre de coord ( 1 coord = 2 elements: X et Y du tableau )
fill : si != 0 polygone rempli
*/
{
int ii;
if( nb <= 1 ) return;
Move_Plume_HPGL( wxPoint(coord[0],coord[1]), 'U');
for( ii = 1; ii < nb ; ii ++ )
{
Move_Plume_HPGL( wxPoint(coord[ii * 2],coord[(ii*2) +1]), 'D');
}
/* Fermeture eventuelle du polygone */
if ( fill )
{
ii = (nb - 1) * 2;
if( (coord[ii] != coord[0] ) || (coord[ii+1] != coord[0]) )
Move_Plume_HPGL( wxPoint(coord[0],coord[1]), 'D');
}
Plume_HPGL('U');
}
/**********************************************/
void Move_Plume_HPGL( wxPoint pos, int plume )
/**********************************************/
/*
deplace la plume levee (plume = 'U') ou baissee (plume = 'D')
en position x,y
Unites en Unites DESSIN
Si plume = 'Z' lever de plume sans deplacement
*/
{
char Line[256];
if ( plume == 'Z')
{
Plume_HPGL('U');
return;
}
Plume_HPGL(plume);
UserToDeviceCoordinate(pos);
sprintf(Line,"PA %d,%d;\n",pos.x,pos.y) ; fputs(Line,PlotOutputFile) ;
}
/***************************/
void Plume_HPGL( int plume )
/***************************/
/* leve (plume = 'U') ou baisse (plume = 'D') la plume
*/
{
if ( plume == 'U')
{
if(etat_plume != 'U' ) fputs("PU;",PlotOutputFile) ;
etat_plume = 'U';
}
else
{
if(etat_plume != 'D' )fputs("PD;",PlotOutputFile) ;
etat_plume = 'D';
}
}

View File

@ -16,7 +16,7 @@ extern wxPoint LastPenPosition;
extern wxPoint PlotOffset;
extern FILE * PlotOutputFile;
extern double XScale, YScale;
extern int PenWidth;
extern int g_DefaultPenWidth, g_CurrentPenWidth;
extern int PlotOrientOptions, etat_plume;
// Locales
@ -36,6 +36,7 @@ void InitPlotParametresPS(wxPoint offset, Ki_PageDescr * sheet,
SheetPS = sheet;
XScale = xscale;
YScale = yscale;
g_CurrentPenWidth = -1;
}
/*************************************************************************************/
@ -44,7 +45,23 @@ void SetDefaultLineWidthPS( int width)
/* Set the default line width (in 1/1000 inch) for the current plotting
*/
{
PenWidth = width; /* epaisseur du trait standard en 1/1000 pouce */
g_DefaultPenWidth = width; /* epaisseur du trait standard en 1/1000 pouce */
g_CurrentPenWidth = -1;
}
/***************************************/
void SetCurrentLineWidthPS( int width)
/***************************************/
/* Set the Current line width (in 1/1000 inch) for the next plot
*/
{
int pen_width;
if ( width > 0 ) pen_width = width;
else pen_width = g_DefaultPenWidth;
if ( pen_width != g_CurrentPenWidth )
fprintf(PlotOutputFile,"%d setlinewidth\n", (int)(XScale * pen_width));
g_CurrentPenWidth = pen_width;
}
/******************************/
@ -77,7 +94,7 @@ void PlotFilledSegmentPS(wxPoint start , wxPoint end, int width)
UserToDeviceCoordinate(start);
UserToDeviceCoordinate(end);
fprintf(PlotOutputFile,"%d setlinewidth\n", (int)(XScale * width));
SetCurrentLineWidthPS(width);
fprintf(PlotOutputFile,"%d %d %d %d line\n", start.x, start.y, end.x, end.y);
}
@ -94,21 +111,16 @@ char Line[256];
if(rayon < 0 ) rayon = 0 ;
if ( width > 0 )
{
sprintf(Line,"%d setlinewidth\n", (int)( width * XScale) ) ;
fputs(Line,PlotOutputFile);
}
SetCurrentLineWidthPS(width);
sprintf(Line,"newpath %d %d %d 0 360 arc stroke\n", pos.x, pos.y, rayon);
fputs(Line,PlotOutputFile) ;
}
/********************************************************************/
void PlotArcPS(wxPoint centre, int StAngle, int EndAngle, int rayon)
/********************************************************************/
/**************************************************************************************/
void PlotArcPS(wxPoint centre, int StAngle, int EndAngle, int rayon, int width)
/**************************************************************************************/
/* Plot an arc:
StAngle, EndAngle = start and end arc in 0.1 degree
*/
@ -117,6 +129,7 @@ char Line[256];
if(rayon <= 0 ) return ;
SetCurrentLineWidthPS(width);
/* Calcul des coord du point de depart : */
UserToDeviceCoordinate(centre);
@ -132,29 +145,11 @@ char Line[256];
}
/*****************************************************************************/
void PlotArcPS(wxPoint centre, int StAngle, int EndAngle, int rayon, int width)
/*****************************************************************************/
/* trace d'un arc de cercle:
x, y = coord du centre
StAngle, EndAngle = angle de debut et fin
rayon = rayon de l'arc
w = epaisseur de l'arc
*/
{
char Line[256];
if(rayon <= 0 ) return ;
sprintf(Line,"%d setlinewidth\n", (int) (width * XScale) );
fputs(Line, PlotOutputFile);
PlotArcPS( centre, StAngle, EndAngle, rayon);
}
/***************************************************/
void PlotPolyPS( int nb_segm, int * coord, int fill)
/***************************************************/
/****************************************************************/
void PlotPolyPS( int nb_segm, int * coord, int fill, int width)
/*****************************************************************/
/* Trace un polygone ( ferme si rempli ) en format POSTSCRIPT
coord = tableau des coord des sommets
nb_segm = nombre de coord ( 1 coord = 2 elements: X et Y du tableau )
@ -166,6 +161,8 @@ wxPoint pos;
if( nb_segm <= 1 ) return;
SetCurrentLineWidthPS(width);
pos.x = coord[0]; pos.y = coord[1];
UserToDeviceCoordinate(pos);
fprintf(PlotOutputFile, "newpath %d %d moveto\n", pos.x, pos.y);
@ -275,7 +272,7 @@ time_t time1970 = time(NULL);
fputs(Line,PlotOutputFile);
// Set default line width:
fprintf(PlotOutputFile,"%d setlinewidth\n", PenWidth ); //PenWidth in user units
fprintf(PlotOutputFile,"%d setlinewidth\n", g_DefaultPenWidth ); //g_DefaultPenWidth in user units
}

View File

@ -18,13 +18,24 @@ wxPoint LastPenPosition;
wxPoint PlotOffset;
FILE * PlotOutputFile;
double XScale, YScale;
int PenWidth;
int g_DefaultPenWidth;
int g_CurrentPenWidth = -1;
int PlotOrientOptions, etat_plume;
// Locales
static Ki_PageDescr * SheetPS;
/*************************/
void ForcePenReinit(void)
/*************************/
/* set the flag g_CurrentPenWidth to -1 in order to force a pen width redefinition
for the next draw command
*/
{
g_CurrentPenWidth = -1;
}
/**********************************************/
void SetPlotScale(double xscale, double yscale)
/**********************************************/
@ -56,7 +67,8 @@ void InitPlotParametresGERBER(wxPoint offset, double xscale, double yscale)
SheetPS = NULL;
XScale = xscale;
YScale = yscale;
PenWidth = 120; /* epaisseur du trait standard en 1/1000 pouce */
g_DefaultPenWidth = 120; /* epaisseur du trait standard en 1/1000 pouce */
g_CurrentPenWidth = -1;
}
@ -74,7 +86,8 @@ wxSize PageSize;
wxPoint pos, ref;
int color;
Ki_WorkSheetData * WsItem;
int conv_unit = screen->GetInternalUnits()/1000;
int conv_unit = screen->GetInternalUnits()/1000; /* Scale to convert dimension in 1/1000 in into internal units
(1/1000 inc for EESchema, 1/10000 for pcbnew */
wxString msg;
wxSize text_size;
void (*FctPlume)(wxPoint pos, int state);
@ -124,10 +137,10 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
text_size.x = WSTEXTSIZE * conv_unit;
text_size.y = WSTEXTSIZE * conv_unit;
ref.x = Sheet->m_LeftMargin * conv_unit;
ref.y = Sheet->m_TopMargin * conv_unit; /* Upper left corner */
xg = (PageSize.x - Sheet->m_RightMargin) * conv_unit;
yg = (PageSize.y - Sheet->m_BottomMargin) * conv_unit; /* lower right corner */
ref.x = Sheet->m_LeftMargin;
ref.y = Sheet->m_TopMargin; /* Upper left corner in 1/1000 inch */
xg = (PageSize.x - Sheet->m_RightMargin);
yg = (PageSize.y - Sheet->m_BottomMargin); /* lower right corner in 1/1000 inch */
/* Trace des reperes selon l'axe X */
ipas = (xg - ref.x) / PAS_REF;

View File

@ -137,9 +137,6 @@ void wxSVGFileDC::Init (wxString f, int Width, int Height, float dpi)
s.Printf ( wxT("<svg\n") );
write(s);
// s.Printf ( wxT(" xmlns:svg=\"http://www.w3.org/2000/svg\"\n") );
//
write(s);
s.Printf ( wxT(" xmlns=\"http://www.w3.org/2000/svg\"\n") );
write(s);
s.Printf ( wxT(" version=\"1.1\"\n") );

View File

@ -26,6 +26,8 @@ BEGIN_EVENT_TABLE(WinEDAListBox, wxDialog)
EVT_BUTTON(ID_LISTBOX_CANCEL, WinEDAListBox::Cancel)
EVT_LISTBOX(ID_LISTBOX_LIST, WinEDAListBox::ClickOnList)
EVT_LISTBOX_DCLICK(ID_LISTBOX_LIST, WinEDAListBox::D_ClickOnList)
EVT_CHAR(WinEDAListBox::OnKeyEvent)
EVT_CHAR_HOOK(WinEDAListBox::OnKeyEvent)
EVT_CLOSE( WinEDAListBox::OnClose )
END_EVENT_TABLE()
@ -39,7 +41,7 @@ END_EVENT_TABLE()
movefct = fonction de création de commentaires a afficher
*/
WinEDAListBox::WinEDAListBox( wxWindow * parent, const wxString & title,
WinEDAListBox::WinEDAListBox( WinEDA_DrawFrame * parent, const wxString & title,
const wxChar ** itemlist,
const wxString & reftext,
void(* movefct)(wxString & Text),
@ -186,12 +188,12 @@ void WinEDAListBox::ClickOnList(wxCommandEvent& event)
wxString text;
if (m_MoveFct)
{
{
m_WinMsg->Clear();
text = m_List->GetStringSelection();
m_MoveFct(text);
m_WinMsg->WriteText(text.GetData());
}
}
}
/*******************************************************/
@ -259,3 +261,10 @@ const wxString ** BufList;
}
/****************************************************/
void WinEDAListBox::OnKeyEvent(wxKeyEvent& event)
/****************************************************/
{
event.Skip();
}

View File

@ -170,7 +170,7 @@ bool sketch_mode = FALSE;
dx += cX; dy = cY;
RotatePoint(&ux0, &uy0, cX, cY, orient);
RotatePoint(&dx, &dy, cX, cY, orient);
GRLine(&panel->m_ClipBox, DC, ux0, uy0, dx, dy, gcolor);
GRLine(&panel->m_ClipBox, DC, ux0, uy0, dx, dy, width, gcolor);
return;
}
@ -210,7 +210,7 @@ return;
if(ii && (plume == 'D' ) )
{
if ( width <= 1 )
GRPoly(&panel->m_ClipBox, DC, ii /2, coord, 0,
GRPoly(&panel->m_ClipBox, DC, ii /2, coord, 0, 0,
gcolor, gcolor);
else if ( sketch_mode )
{
@ -222,8 +222,8 @@ return;
}
else
GRPolyLines(&panel->m_ClipBox, DC, ii /2, coord,
gcolor, gcolor, width);
GRPoly(&panel->m_ClipBox, DC, ii /2, coord, 0,
width, gcolor, gcolor);
}
plume = f_cod; ii = 0;
break;

View File

@ -1,7 +1,7 @@
//////////////////////
// Name: eda_dde.cc //
//////////////////////
///////////////////////
// Name: eda_dde.cpp //
///////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
@ -21,13 +21,16 @@
#include "id.h"
#include "common.h"
#include "macros.h"
#define ID_CONN "CAO_COM"
wxString HOSTNAME(wxT("localhost"));
/* variables locales */
#define IPC_BUF_SIZE 4000
// buffers for read and write data in socket connections
#define IPC_BUF_SIZE 4096
char client_ipc_buffer[IPC_BUF_SIZE];
char server_ipc_buffer[IPC_BUF_SIZE];
@ -77,22 +80,24 @@ size_t len;
wxSocketBase *sock = evt.GetSocket();
switch (evt.GetSocketEvent())
{
{
case wxSOCKET_INPUT:
sock->Read(server_ipc_buffer,1);
len = sock->Read(server_ipc_buffer+1,IPC_BUF_SIZE-2).LastCount();
server_ipc_buffer[len+1] = 0;
if(RemoteFct ) RemoteFct(server_ipc_buffer);
break;
sock->Read(server_ipc_buffer,1);
if( sock->LastCount() == 0 ) break; // No data: Occurs on open connection
sock->Read(server_ipc_buffer+1,IPC_BUF_SIZE-2);
len = 1 + sock->LastCount();
server_ipc_buffer[len] = 0;
if(RemoteFct ) RemoteFct(server_ipc_buffer);
break;
case wxSOCKET_LOST:
case wxSOCKET_LOST:
return;
break;
default:
default:
wxPrintf( wxT("WinEDA_DrawFrame::OnSockRequest() error: Invalid event !"));
break;
}
}
}
/**************************************************************/
@ -120,12 +125,12 @@ wxSocketServer *server = (wxSocketServer *) evt.GetSocket();
/********************************************/
bool SendCommand( int service, char * cmdline)
/********************************************/
/* Fonction utilisee par un client pour envoyer une information a un serveur.
- Etablit une connection Socket Client
- envoie le contenu du buffer cmdline
- ferme la connexion
/* Used by a client to sent (by a socket connection) a data to a server.
- Open a Socket Client connection
- Send the buffer cmdline
- Close the socket connection
service contient le numéro de service en ascii.
service is the service number for the TC/IP connection
*/
{
wxSocketClient * sock_client;

View File

@ -8,6 +8,10 @@
#define EDA_BASE
#define COMMON_GLOBL
#ifdef KICAD_PYTHON
#include <pyhandler.h>
#endif
#include "fctsys.h"
#include <wx/image.h>
#include "wx/html/htmlwin.h"
@ -95,8 +99,6 @@ WinEDA_App::~WinEDA_App(void)
delete g_ItalicFont;
delete g_FixedFont;
delete g_MsgFont;
delete DrawPen;
delete DrawBrush;
if ( m_Checker ) delete m_Checker;
delete m_Locale;
}
@ -130,10 +132,6 @@ wxString EnvLang;
m_EDA_Config = new wxConfig(name);
m_EDA_CommonConfig = new wxConfig(wxT("kicad_common"));
/* Creation des outils de trace */
DrawPen = new wxPen( wxT("GREEN"), 1, wxSOLID);
DrawBrush = new wxBrush(wxT("BLACK"), wxTRANSPARENT);
/* Creation des fontes utiles */
g_StdFontPointSize = FONT_DEFAULT_SIZE;
g_MsgFontPointSize = FONT_DEFAULT_SIZE;
@ -166,6 +164,9 @@ bool succes = SetLanguage(TRUE);
if ( atof("0,1") ) g_FloatSeparator = ','; // Nombres flottants = 0,1
else g_FloatSeparator = '.';
#ifdef KICAD_PYTHON
PyHandler::GetInstance()->SetAppName( name );
#endif
}
@ -590,3 +591,12 @@ wxMenuItem * item;
}
int WinEDA_App::OnRun(void)
/* Run init scripts */
{
#ifdef KICAD_PYTHON
PyHandler::GetInstance()->RunScripts();
#endif
return wxApp::OnRun();
}

View File

@ -5,6 +5,7 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/mimetype.h"
#ifdef __BORLANDC__
#pragma hdrstop
@ -276,6 +277,8 @@ wxString defaultpath = Path;
defaultpath.Replace(wxT("/"), STRING_DIR_SEP);
if ( defaultpath.IsEmpty() ) defaultpath = wxGetCwd();
wxSetWorkingDirectory( defaultpath );
fullfilename = wxFileSelector( wxString(Title),
defaultpath,
defaultname,
@ -415,12 +418,24 @@ wxString FullFileName;
/***********************************************************************************/
int ExecuteFile(wxWindow * frame, const wxString & ExecFile, const wxString & param)
/***********************************************************************************/
/* appelle le logiciel ExecFile, avec les parametres filename
/* Call the executable file "ExecFile", with params "param"
*/
{
wxString FullFileName;
#ifdef __WXMAC__
// Mac part
wxGetEnv("HOME", &FullFileName);
FullFileName += wxString("/bin/") + newExecFile;
if (! wxFileExists(FullFileName) )
{
FullFileName = FindKicadFile(ExecFile);
}
#else
FullFileName = FindKicadFile(ExecFile);
#endif
if ( wxFileExists(FullFileName) )
{
@ -429,7 +444,6 @@ wxString FullFileName;
return 0;
}
wxString msg;
msg.Printf( wxT("Command file <%s> not found"), FullFileName.GetData() );
DisplayError(frame, msg, 20);
@ -569,3 +583,71 @@ wxString GetEditorName(void)
}
return g_EditorName;
}
void OpenPDF( const wxString & file )
{
wxString command;
wxString filename = file;
wxString type;
EDA_Appl->ReadPdfBrowserInfos();
if ( !EDA_Appl->m_PdfBrowserIsDefault )
{
AddDelimiterString(filename);
command = EDA_Appl->m_PdfBrowser + filename;
}
else
{
bool success = false;
wxFileType * filetype = NULL;
wxFileType::MessageParameters params(filename, type);
filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(wxT(".pdf"));
if (filetype ) success = filetype->GetOpenCommand( &command, params);
delete filetype;
if (!success)
{
AddDelimiterString(filename);
command.Empty();
wxString tries[] =
{
wxT("/usr/bin/evince"),
wxT("/usr/bin/xpdf"),
wxT("/usr/bin/konqueror"),
wxT("/usr/bin/gpdf"),
wxT(""),
};
for ( int i = 0;; i++ )
{
if (tries[i].IsEmpty()) break;
if (wxFileExists(tries[i]))
{
command = tries[i] + wxT(" ") + filename;
}
}
}
}
if (!command.IsEmpty()) wxExecute(command);
}
void OpenFile( const wxString & file )
{
wxString command;
wxString filename = file;
wxFileName CurrentFileName(filename);
wxString ext, type;
ext = CurrentFileName.GetExt();
wxFileType * filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(ext);
bool success = false;
wxFileType::MessageParameters params(filename, type);
if (filetype) success = filetype->GetOpenCommand( &command, params);
delete filetype;
if (success && !command.IsEmpty()) wxExecute(command);
}

View File

@ -31,8 +31,8 @@ static int xcliplo = 0,
ycliphi = 2000; /* coord de la surface de trace */
static int lastcolor = -1;
static int lastwidth = -1;
static int s_Last_Pen_Style = -1;
static wxDC * lastDC = NULL;
/*
Macro de clipping du trace d'une ligne:
la ligne (x1,y1 x2,y2) est clippee pour rester dans le cadre
@ -217,7 +217,7 @@ void SetPenMinWidth(int minwidth)
/* Routine de changement de couleurs et epaisseur de la plume courante */
void GRSetColorPen(wxDC * DC, int Color , int width)
void GRSetColorPen(wxDC * DC, int Color , int width, int style)
{
Color &= MASKCOLOR; // Pour 32 couleurs Max
@ -225,17 +225,21 @@ void GRSetColorPen(wxDC * DC, int Color , int width)
if( ForceBlackPen && Color != WHITE ) Color = BLACK;
if( (lastcolor != Color) || (lastwidth != width) || (lastDC != DC ) )
if( (lastcolor != Color) || (lastwidth != width) || (s_Last_Pen_Style != style) || (lastDC != DC ) )
{
DrawPen->SetColour(
wxPen DrawPen;
DrawPen.SetColour(
ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue
);
DrawPen->SetWidth(width);
if ( &DC->GetPen() != DrawPen ) DC->SetPen(*DrawPen);
DrawPen.SetWidth(width);
DrawPen.SetStyle(style);
// if ( &DC->GetPen() != DrawPen )
DC->SetPen(DrawPen);
lastcolor = Color; lastwidth = width; lastDC = DC;
s_Last_Pen_Style = style;
}
}
@ -245,15 +249,16 @@ void GRSetBrush(wxDC * DC, int Color , int fill)
{
Color &= MASKCOLOR; // Pour 32 couleurs Max
if( ForceBlackPen && Color != WHITE ) Color = BLACK;
DrawBrush->SetColour(
wxBrush DrawBrush;
DrawBrush.SetColour(
ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
ColorRefs[Color].m_Blue
);
if ( fill ) DrawBrush->SetStyle(wxSOLID);
else DrawBrush->SetStyle(wxTRANSPARENT);
if ( &DC->GetBrush() != DrawBrush ) DC->SetBrush(*DrawBrush);
if ( fill ) DrawBrush.SetStyle(wxSOLID);
else DrawBrush.SetStyle(wxTRANSPARENT);
DC->SetBrush(DrawBrush);
}
/*************************************/
@ -340,68 +345,46 @@ int ii;
/****************************************************************************
* Routine to draw a line, in Object spaces. *
****************************************************************************/
void GRLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
void GRLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
{
GRSLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), Color);
GRSLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), ZoomValue(width), Color);
}
/***************************************************/
/* Routine to draw a Dashed line, in Screen space. */
/***************************************************/
void GRSDashedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
void GRSDashedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
{
GRLastMoveToX = x2;
GRLastMoveToY = y2;
lastcolor = -1;
DrawPen->SetStyle(wxSHORT_DASH);
GRSLine(ClipBox, DC, x1, y1, x2, y2, Color);
GRSetColorPen(DC, Color, width, wxSHORT_DASH);
GRSLine(ClipBox, DC, x1, y1, x2, y2, width, Color);
lastcolor = -1;
DrawPen->SetStyle(wxSOLID);
GRSetColorPen(DC, Color, width);
}
void GRSDashedLineTo(EDA_Rect * ClipBox,wxDC * DC, int x2, int y2, int Color)
void GRSDashedLineTo(EDA_Rect * ClipBox,wxDC * DC, int x2, int y2, int width, int Color)
{
lastcolor = -1;
DrawPen->SetStyle(wxSHORT_DASH);
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x2, y2, Color);
GRSetColorPen(DC, Color, width, wxSHORT_DASH);
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x2, y2, width, Color);
lastcolor = -1;
DrawPen->SetStyle(wxSOLID);
GRSetColorPen(DC, Color, width);
GRLastMoveToX = x2;
GRLastMoveToY = y2;
}
/****************************************************************************
* Routine to draw a Dashed line, in Object spaces. *
****************************************************************************/
void GRDashedLineTo(EDA_Rect * ClipBox,wxDC * DC,int x2, int y2, int Color)
void GRDashedLineTo(EDA_Rect * ClipBox,wxDC * DC,int x2, int y2, int width, int Color)
{
GRSDashedLineTo(ClipBox, DC, GRMapX(x2), GRMapY(y2), Color);
GRSDashedLineTo(ClipBox, DC, GRMapX(x2), GRMapY(y2), ZoomValue(width), Color);
}
void GRDashedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
void GRDashedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
{
GRSDashedLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), Color);
}
/*************************************************/
/* Routine to draw a Bus line, in Object spaces. */
/*************************************************/
void GRBusLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
{
x1 = GRMapX(x1); x2 = GRMapX(x2);
y1 = GRMapY(y1); y2 = GRMapY(y2);
GRSBusLine(ClipBox, DC, x1, y1, x2, y2, Color);
}
/****************************************************************
* Routine to draw a Bus Line, in Screen (pixels) space. *
****************************************************************************/
void GRSBusLine(EDA_Rect * ClipBox, wxDC * DC, int x1, int y1, int x2, int y2, int Color)
{
GRSFillCSegm(ClipBox, DC, x1, y1, x2, y2, 3*PenMinWidth, Color);
GRLastMoveToX = x2;
GRLastMoveToY = y2;
GRSDashedLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), ZoomValue(width), Color);
}
@ -417,46 +400,32 @@ void GRMoveTo(int x, int y)
/*******************************************************/
/* Routine to draw to a new position, in Object space. */
/*******************************************************/
void GRLineTo(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int Color)
void GRLineTo(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int width, int Color)
{
int GRLineToX, GRLineToY;
GRLineToX = GRMapX(x); GRLineToY = GRMapY(y);
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, Color);
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, ZoomValue(width), Color);
}
/*************************************************/
/* Routine to draw a Mixed line, in Object space */
/*************************************************/
void GRMixedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
void GRMixedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
{
GRSMixedLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), Color);
GRSMixedLine(ClipBox, DC, GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2), ZoomValue(width), Color);
}
/***********************************************************/
/* Routine to draw a Mixed line, in Screen (Pixels) space */
/***********************************************************/
void GRSMixedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
void GRSMixedLine(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
{
DrawPen->SetStyle(wxDOT_DASH);
GRSLine(ClipBox, DC, x1, y1, x2, y2, Color);
DrawPen->SetStyle(wxSOLID);
GRSetColorPen(DC, Color, width, wxDOT_DASH);
GRSLine(ClipBox, DC, x1, y1, x2, y2, width, Color);
GRSetColorPen(DC, Color, width);
}
/*******************************************************************/
/* Routine to draw a Bus line to a new position, in Object spaces. */
/*******************************************************************/
void GRBusLineTo(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int Color)
{
int GRLineToX, GRLineToY;
GRLineToX = GRMapX(x); GRLineToY = GRMapY(y);
GRSBusLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY,
Color);
GRLastMoveToX = GRLineToX;
GRLastMoveToY = GRLineToY;
}
/****************************************************************************
* Routine to move to a new position, in Screen (pixels) space. *
@ -470,18 +439,18 @@ void GRSMoveTo(int x, int y)
/****************************************************************************
* Routine to draw to a new position, in Screen (pixels) space. *
****************************************************************************/
void GRSLineTo(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int Color)
void GRSLineTo(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int width, int Color)
{
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x, y, Color);
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, x, y, width, Color);
GRLastMoveToX = x; GRLastMoveToY = y;
}
/****************************************************************************
* Routine to draw to a new position, in Screen (pixels) space. *
****************************************************************************/
void GRSLine(EDA_Rect * ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int Color)
void GRSLine(EDA_Rect * ClipBox, wxDC *DC, int x1, int y1, int x2, int y2, int width, int Color)
{
WinClipAndDrawLine(ClipBox, DC, x1, y1, x2, y2, Color);
WinClipAndDrawLine(ClipBox, DC, x1, y1, x2, y2, Color, width );
GRLastMoveToX = x2; GRLastMoveToY = y2;
}
@ -499,7 +468,7 @@ void GRMoveRel(int x, int y)
* Routine to line to a new position relative to current one, as in Object *
* space. *
****************************************************************************/
void GRLineRel(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int Color)
void GRLineRel(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int width, int Color)
{
int GRLineToX = GRLastMoveToX,
GRLineToY = GRLastMoveToY;
@ -507,7 +476,7 @@ int GRLineToX = GRLastMoveToX,
GRLineToX += ZoomValue(x);
GRLineToY += ZoomValue(y);
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, Color);
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, ZoomValue(width), Color);
}
/****************************************************************************
@ -524,12 +493,12 @@ void GRSMoveRel(int x, int y)
* Routine to line to a new position relative to current one, as in Screen *
* space (pixel coords.). *
****************************************************************************/
void GRSLineRel(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int Color)
void GRSLineRel(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int width, int Color)
{
long GRLineToX = GRLastMoveToX + x,
GRLineToY = GRLastMoveToY + y;
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, Color);
GRSLine(ClipBox, DC, GRLastMoveToX, GRLastMoveToY, GRLineToX, GRLineToY, width, Color);
GRLastMoveToX = GRLineToX;
GRLastMoveToY = GRLineToY;
}
@ -724,13 +693,13 @@ int Xmin, Xmax, Ymin, Ymax;
/* Routine to draw a new polyline and fill it if Fill, in screen space. */
/************************************************************************/
void GRSPoly(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points, int Fill,
int Color, int BgColor)
int width, int Color, int BgColor)
{
int startx, starty;
if ( ! IsGRSPolyDrawable(ClipBox, n, Points) ) return;
GRSetColorPen(DC, Color );
GRSetColorPen(DC, Color, width );
if( Fill && ( n > 2 ) )
{
@ -745,34 +714,24 @@ int startx, starty;
}
}
/************************************************************************/
/* Routine to draw a new polyline (line width = Width), in screen space. */
/************************************************************************/
void GRSPolyLines(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points,
int Color, int BgColor, int Width)
{
int startx, starty;
if ( ! IsGRSPolyDrawable(ClipBox, n, Points) ) return;
GRSetColorPen(DC, Color, Width );
startx = Points[n * 2 - 2]; starty = Points[n * 2 - 1];
GRSetBrush(DC, Color);
DC->DrawLines(n, (wxPoint*)Points);
}
/******************************************************************************/
/* Routine to draw a new closed polyline and fill it if Fill, in screen space */
/******************************************************************************/
void GRSClosedPoly(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points,
int Fill, int Color, int BgColor)
{
GRSClosedPoly( ClipBox, DC, n, Points, Fill, 0, Color, BgColor);
}
void GRSClosedPoly(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points,
int Fill, int width, int Color, int BgColor)
{
int startx, starty;
if ( ! IsGRSPolyDrawable(ClipBox, n, Points) ) return;
GRSetColorPen(DC, Color );
GRSetColorPen(DC, Color, width );
if( Fill && ( n > 2 ) )
{
@ -789,7 +748,7 @@ int startx, starty;
/* Fermeture du polygone */
if( (startx != Points[0]) || (starty != Points[1]) )
{
GRSLine(ClipBox, DC, Points[0], Points[1], startx, starty, Color);
GRSLine(ClipBox, DC, Points[0], Points[1], startx, starty, width, Color);
}
}
}
@ -799,27 +758,11 @@ int startx, starty;
/* Routine to draw a new polyline and fill it if Fill, in drawing space. */
/************************************************************************/
void GRPoly(EDA_Rect * ClipBox, wxDC * DC, int n, int *Points,
int Fill, int Color, int BgColor)
{
int ii, jj;
for (ii = 0; ii < n; ii++)
{
jj = ii << 1;
Points[jj] = GRMapX(Points[jj]);
jj++;
Points[jj] = GRMapY(Points[jj]);
}
GRSPoly(ClipBox, DC, n, Points, Fill, Color, BgColor);
}
void GRPolyLines(EDA_Rect * ClipBox, wxDC * DC, int n, int *Points,
int Color, int BgColor, int width)
int Fill, int width, int Color, int BgColor)
{
int ii, jj;
width = ZoomValue(width);
for (ii = 0; ii < n; ii++)
{
jj = ii << 1;
@ -827,17 +770,24 @@ int ii, jj;
jj++;
Points[jj] = GRMapY(Points[jj]);
}
if ( width <= 1 ) GRSPoly(ClipBox, DC, n, Points, 0, Color, BgColor);
else GRSPolyLines(ClipBox, DC, n, Points, Color, BgColor, width);
GRSPoly(ClipBox, DC, n, Points, Fill, width, Color, BgColor);
}
/**************************************************************************/
/* Routine to draw a closed polyline and fill it if Fill, in object space */
/**************************************************************************/
void GRClosedPoly(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points,
int Fill, int Color, int BgColor)
{
GRClosedPoly(ClipBox, DC, n, Points, Fill, 0, Color, BgColor);
}
void GRClosedPoly(EDA_Rect * ClipBox,wxDC * DC, int n, int *Points,
int Fill, int width, int Color, int BgColor)
{
int ii, jj;
width = ZoomValue(width);
for (ii = 0; ii < n; ii++)
{
jj = ii << 1;
@ -845,7 +795,7 @@ int ii, jj;
jj++;
Points[jj] = GRMapY(Points[jj]);
}
GRSClosedPoly(ClipBox, DC, n, Points, Fill, Color, BgColor);
GRSClosedPoly(ClipBox, DC, n, Points, Fill, width, Color, BgColor);
}
/***********************************************/
@ -857,21 +807,48 @@ int cx = GRMapX(x);
int cy = GRMapY(y);
int rayon = ZoomValue(r);
GRSCircle(ClipBox, DC, cx, cy, rayon, Color );
GRSCircle(ClipBox, DC, cx, cy, rayon, 0, Color );
}
/*****************************************************/
/* Routine to draw a Filled circle, in object space. */
/*****************************************************/
void GRFilledCircle(EDA_Rect * ClipBox,wxDC * DC, int x, int y, int r,
int Color, int BgColor)
int width, int Color, int BgColor)
{
r = ZoomValue(r);
GRSFilledCircle(ClipBox, DC, GRMapX(x), GRMapY(y), r, Color, BgColor );
width = ZoomValue(width);
GRSFilledCircle(ClipBox, DC, GRMapX(x), GRMapY(y), r, width, Color, BgColor );
}
/******************************************************/
/* Routine to draw a FILLED circle, in drawing space. */
/******************************************************/
void GRSFilledCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r,
int width, int Color, int BgColor)
{
/* suppression des cercles hors ecran */
if ( ClipBox )
{
int x0, y0, xm, ym;
x0 = ClipBox->GetX();
y0 = ClipBox->GetY();
xm = ClipBox->GetRight();
ym = ClipBox->GetBottom();
if ( x < (x0-r) ) return;
if ( y < (y0-r) ) return;
if ( x > (r+xm) ) return;
if ( y > (r+ym) ) return;
}
GRSetColorPen(DC, Color, width );
GRSetBrush(DC, BgColor, FILLED);
DC->DrawEllipse(x-r, y-r, r+r, r+r);
}
/***********************************************************/
/* Routine to draw un anneau, epaisseur w, in object space. */
/* Routine to draw a circle, in object space. */
/***********************************************************/
void GRCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int width, int Color)
{
@ -884,58 +861,6 @@ void GRCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int width, in
/***********************************************/
/* Routine to draw a circle, in drawing space. */
/***********************************************/
void GRSCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r, int Color)
{
int d = r + r;
/* suppression des cercles hors ecran */
if ( ClipBox )
{
int x0, y0, xm, ym;
x0 = ClipBox->GetX();
y0 = ClipBox->GetY();
xm = ClipBox->GetRight();
ym = ClipBox->GetBottom();
if ( x < (x0-r) ) return;
if ( y < (y0-r) ) return;
if ( x > (r+xm) ) return;
if ( y > (r+ym) ) return;
}
GRSetColorPen(DC, Color);
GRSetBrush(DC,Color,FALSE);
DC->DrawEllipse(x-r,y-r, d, d);
}
/******************************************************/
/* Routine to draw a FILLED circle, in drawing space. */
/******************************************************/
void GRSFilledCircle(EDA_Rect * ClipBox, wxDC * DC, int x, int y, int r,
int Color, int BgColor)
{
/* suppression des cercles hors ecran */
if ( ClipBox )
{
int x0, y0, xm, ym;
x0 = ClipBox->GetX();
y0 = ClipBox->GetY();
xm = ClipBox->GetRight();
ym = ClipBox->GetBottom();
if ( x < (x0-r) ) return;
if ( y < (y0-r) ) return;
if ( x > (r+xm) ) return;
if ( y > (r+ym) ) return;
}
GRSetColorPen(DC, Color );
GRSetBrush(DC, BgColor, FILLED);
DC->DrawEllipse(x-r, y-r, r+r, r+r);
}
/***********************************************************************/
/* Routine de trace d'un cercle epais ( Screen space = pixel coords.) */
/***********************************************************************/
void GRSCircle(EDA_Rect * ClipBox,wxDC * DC, int xc, int yc, int r, int width, int Color)
{
/* suppression des cercles hors ecran */
@ -958,6 +883,7 @@ void GRSCircle(EDA_Rect * ClipBox,wxDC * DC, int xc, int yc, int r, int width, i
}
/************************************************/
/* Routine to draw an arc, in USER space. */
/* Debut et fin de l'arc donnes par leur coord. */
@ -967,7 +893,7 @@ void GRArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
{
GRSArc1(ClipBox, DC,
GRMapX(x1), GRMapY(y1), GRMapX(x2), GRMapY(y2),
GRMapX(xc), GRMapY(yc), Color);
GRMapX(xc), GRMapY(yc), 0, Color);
}
/************************************************/
@ -982,32 +908,6 @@ void GRArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
GRMapX(xc), GRMapY(yc), ZoomValue(width), Color);
}
/************************************************/
/* Routine to draw an arc, in screen space. */
/* Debut et fin de l'arc donnes par leur coord. */
/************************************************/
void GRSArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
int xc, int yc, int Color)
{
/* suppression des cercles hors ecran */
if ( ClipBox )
{
int x0, y0, xm, ym, r;
x0 = ClipBox->GetX();
y0 = ClipBox->GetY();
xm = ClipBox->GetRight();
ym = ClipBox->GetBottom();
r = (int)hypot(x1-xc, y1-yc);
if ( xc < (x0-r) ) return;
if ( yc < (y0-r) ) return;
if ( xc > (r+xm) ) return;
if ( yc > (r+ym) ) return;
}
GRSetColorPen(DC, Color );
GRSetBrush(DC,Color,FALSE);
DC->DrawArc(x1, y1, x2, y2, xc, yc);
}
/************************************************/
/* Routine to draw an arc, width = width, in screen space. */
@ -1040,40 +940,6 @@ void GRSArc1(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
/* Routine to draw an arc, in screen space. */
/* As the Y axe is inverted the Angles should be inverted as well. */
/********************************************************************/
void GRSArc(EDA_Rect * ClipBox,wxDC * DC, int xc, int yc,
int StAngle, int EndAngle, int r, int Color)
{
int x1, y1, x2, y2;
/* suppression des cercles hors ecran */
if ( ClipBox )
{
int x0, y0, xm, ym;
x0 = ClipBox->GetX();
y0 = ClipBox->GetY();
xm = ClipBox->GetRight();
ym = ClipBox->GetBottom();
if ( xc < (x0-r - 1) ) return;
if ( yc < (y0-r - 1) ) return;
if ( xc > (r+xm + 1) ) return;
if ( yc > (r+ym + 1) ) return;
}
x1 = r; y1 = 0;
RotatePoint( &x1, & y1, EndAngle);
x2 = r; y2 = 0;
RotatePoint( &x2, & y2, StAngle);
GRSetColorPen(DC, Color);
GRSetBrush(DC,Color,FALSE);
DC->DrawArc(xc + x1, yc - y1, xc + x2, yc - y2, xc, yc);
}
/********************************************************************/
/* Routine to draw an arc, width = width, in screen space. */
/* As the Y axe is inverted the Angles should be inverted as well. */
/********************************************************************/
void GRSArc(EDA_Rect * ClipBox,wxDC * DC, int xc, int yc, int StAngle, int EndAngle,
int r, int width, int Color)
{
@ -1109,7 +975,7 @@ int x1, y1, x2, y2;
/* As the Y axes is inverted the Angles should be inverted as well. */
/********************************************************************/
void GRSFilledArc(EDA_Rect * ClipBox,wxDC * DC, int xc, int yc,
int StAngle, int EndAngle, int r, int Color, int BgColor)
int StAngle, int EndAngle, int r, int width, int Color, int BgColor)
{
int x1, y1, x2, y2;
@ -1134,7 +1000,7 @@ int x1, y1, x2, y2;
RotatePoint( &x2, & y2, StAngle);
GRSetBrush(DC, BgColor, FILLED);
GRSetColorPen(DC, Color);
GRSetColorPen(DC, Color, width);
DC->DrawArc(xc + x1, yc - y1, xc + x2, yc - y2, xc, yc);
}
@ -1142,12 +1008,21 @@ int x1, y1, x2, y2;
/* Routine to draw a Filled arc, in drawing space. */
/* As the Y axes is inverted the Angles should be inverted as well. */
/********************************************************************/
void GRFilledArc(EDA_Rect * ClipBox,wxDC * DC, int x, int y,
int StAngle, int EndAngle, int r, int width, int Color, int BgColor)
{
width = ZoomValue(width);
GRSFilledArc(ClipBox, DC, GRMapX(x), GRMapY(y),
StAngle, EndAngle,
ZoomValue(r), width, Color, BgColor);
}
void GRFilledArc(EDA_Rect * ClipBox,wxDC * DC, int x, int y,
int StAngle, int EndAngle, int r, int Color, int BgColor)
{
GRSFilledArc(ClipBox, DC, GRMapX(x), GRMapY(y),
StAngle, EndAngle,
ZoomValue(r), Color, BgColor);
ZoomValue(r), 0, Color, BgColor);
}
/********************************************************************/
@ -1213,6 +1088,17 @@ void GRRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Co
GRSRect(ClipBox, DC, x1, y1, x2, y2, Color );
}
/**************************************************/
/* Routine to draw a Rectangle, in drawing space. */
/**************************************************/
void GRRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int width, int Color)
{
x1 = GRMapX(x1); y1 = GRMapY(y1);
x2 = GRMapX(x2); y2 = GRMapY(y2);
width = ZoomValue(width);
GRSRect(ClipBox, DC, x1, y1, x2, y2, width, Color );
}
/************************************************************************************/
void GRFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
int Color, int BgColor)
@ -1222,14 +1108,32 @@ void GRFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
x1 = GRMapX(x1); y1 = GRMapY(y1);
x2 = GRMapX(x2); y2 = GRMapY(y2);
GRSFilledRect(ClipBox, DC, x1, y1, x2, y2, Color, BgColor );
GRSFilledRect(ClipBox, DC, x1, y1, x2, y2, 0, Color, BgColor );
}
/************************************************************************************/
void GRFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
int width, int Color, int BgColor)
/************************************************************************************/
/* Routine to draw a Rectangle (filled with AreaColor), in drawing space. */
{
x1 = GRMapX(x1); y1 = GRMapY(y1);
x2 = GRMapX(x2); y2 = GRMapY(y2);
width = ZoomValue(width);
GRSFilledRect(ClipBox, DC, x1, y1, x2, y2, width, Color, BgColor );
}
/*************************************************/
/* Routine to draw a Rectangle, in screen space. */
/*************************************************/
void GRSRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int Color)
{
GRSRect(ClipBox, DC, x1, y1, x2, y2, 0, Color);
}
void GRSRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
int width, int Color)
{
if(x1 > x2) EXCHG(x1,x2);
if(y1 > y2) EXCHG(y1,y2);
@ -1248,7 +1152,7 @@ void GRSRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int C
if ( y2 < ymin ) return;
}
GRSetColorPen(DC, Color );
GRSetColorPen(DC, Color, width );
if ( (x1 == x2) || (y1 == y2) ) DC->DrawLine(x1, y1, x2, y2);
else
{
@ -1258,11 +1162,18 @@ void GRSRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2, int C
}
/* Routine to draw a Filled Rectangle, in screen space. */
/***************************************************************************************/
void GRSFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
int Color, int BgColor)
/***************************************************************************************/
/* Routine to draw a Filled Rectangle, in screen space. */
{
GRSFilledRect( ClipBox, DC, x1, y1, x2, y2, 0, Color, BgColor);
}
/***************************************************************************************/
void GRSFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
int width, int Color, int BgColor)
/***************************************************************************************/
{
if(x1 > x2) EXCHG(x1,x2);
if(y1 > y2) EXCHG(y1,y2);
@ -1278,14 +1189,14 @@ void GRSFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
if ( y1 > ymax ) return;
if ( y2 < ymin ) return;
// Clipping des coordonnees
// Clipping coordinates
if ( x1 < xmin )x1 = xmin -1;
if ( y1 < ymin )y1 = ymin -1;
if ( x2 > xmax ) x2 = xmax +1;
if ( y2 > ymax ) y2 = ymax +1;
}
GRSetColorPen(DC, Color );
GRSetColorPen(DC, Color, width );
if ( (x1 == x2) || (y1 == y2) ) DC->DrawLine(x1, y1, x2, y2);
else
{
@ -1295,25 +1206,22 @@ void GRSFilledRect(EDA_Rect * ClipBox,wxDC * DC, int x1, int y1, int x2, int y2,
}
/****************************************/
/* Routines relatives au trace de texte */
/****************************************/
/*********************************************/
/* Routine de selection de la fonte courante */
/*********************************************/
/*******************************/
/* Routines used to draw texts */
/*******************************/
/*********************************************/
void GRSetFont(wxDC * DC, wxFont * Font)
/*********************************************/
/* Routine to set the current font */
{
DC->SetFont(*Font);
}
/*********************************************************/
/* void GRSetTextFgColor(wxFont * Font, int Color) */
/*********************************************************/
/* Mise a la valeur Color des textes a afficher */
/*********************************************************/
void GRSetTextFgColor(wxDC * DC, int Color)
/*********************************************************/
/* Set the foreground color used to draw texts */
{
DC->SetTextForeground(wxColour(
ColorRefs[Color].m_Red,
@ -1322,7 +1230,6 @@ void GRSetTextFgColor(wxDC * DC, int Color)
);
}
/* Mise a la valeur Color des textes a afficher */
void GRSetTextFgColor(wxDC * DC, wxFont *, int Color)
{
DC->SetTextForeground(wxColour(
@ -1336,7 +1243,7 @@ void GRSetTextFgColor(wxDC * DC, wxFont *, int Color)
/*****************************************************************************/
void GRGetTextExtent(wxDC * DC, const wxChar * Text, long * width, long * height)
/*****************************************************************************/
/* donne la taille du rectangle d'encadrement du texte Text
/* Return the size of the text
*/
{
long w = 0, h = 0;
@ -1349,25 +1256,21 @@ long w = 0, h = 0;
if ( height ) * height = h;
}
/********************************/
/* void GRReseTextFgColor(void) */
/********************************/
/* Mise a la couleur par defaut des textes a afficher */
/********************************/
void GRResetTextFgColor(wxDC * DC)
/********************************/
/* Set the foreground color used to draw texts to the default value */
{
GRSetTextFgColor(DC, Text_Color);
}
/*********************************************************/
/* void GRSetTextBgColor(wxFont * Font, int Color) */
/*********************************************************/
/* Mise a la valeur Color du fond pour les textes a afficher */
/*********************************************************/
void GRSetTextBgColor(wxDC * DC, int Color)
/*********************************************************/
/* Set the background color used to draw texts */
{
Color &= MASKCOLOR; // Pour 32 couleurs Max
Color &= MASKCOLOR; // keep only the bits used to select the color
DC->SetTextBackground(wxColour(
ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,
@ -1377,7 +1280,7 @@ void GRSetTextBgColor(wxDC * DC, int Color)
void GRSetTextBgColor(wxDC * DC, wxFont *, int Color)
{
Color &= MASKCOLOR; // Pour 32 couleurs Max
Color &= MASKCOLOR; // keep only the bits used to select the color
DC->SetTextBackground(wxColour(
ColorRefs[Color].m_Red,
ColorRefs[Color].m_Green,

View File

@ -2,9 +2,10 @@ WXDIR = $(WXWIN)
all: common.a
include makefile.include
include ../libs.win
include makefile.include
common.a: $(OBJECTS) ../libs.win makefile.include
ar ruv $@ $(OBJECTS)
ranlib $@

View File

@ -8,9 +8,11 @@ EDACPPFLAGS = $(CPPFLAGS)
all: common.a
include ../libs.linux
include makefile.include
CPPFLAGS += $(EXTRACPPFLAGS)
CPPFLAGS += $(EXTRACPPFLAGS) -fno-strict-aliasing
EDACPPFLAGS = $(CPPFLAGS)
@ -19,6 +21,7 @@ common.a: $(OBJECTS) makefile.gtk makefile.include
ar -rv $@ $(OBJECTS)
ranlib $@
install:common.a
clean:
rm -f *.o; rm -f *~; rm core; rm *.bak; rm *.obj

View File

@ -1,4 +1,4 @@
EXTRACPPFLAGS= -I$(SYSINCLUDE) -I./ -Ibitmaps -I../include
EXTRACPPFLAGS += -I$(SYSINCLUDE) -I./ -Ibitmaps -I../include
COMMON = ../include/colors.h
@ -34,6 +34,11 @@ OBJECTS= \
base_screen.o\
dcsvg.o
ifdef KICAD_PYTHON
OBJECTS += pyhandler.o
pyhandler.o: pyhandler.cpp $(COMMON) ../include/pyhandler.h
endif
gr_basic.o: gr_basic.cpp ../include/gr_basic.h $(DEPEND)
confirm.o: confirm.cpp $(COMMON)

View File

@ -2,7 +2,8 @@
CC = gcc
# Compiler flags.
CPPFLAGS = -Wall -O2 -I./ -I../include `wx-config --cflags`
CPPFLAGS = -Wall -O2 -I./ -I../include `wx-config --cxxflags`
CPPFLAGS += -arch i386 -arch ppc
EDACPPFLAGS = $(CPPFLAGS)

383
common/pyhandler.cpp Normal file
View File

@ -0,0 +1,383 @@
#include "wx/wxprec.h"
#include <id.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers (this file is usually all you
// need because it includes almost all "standard" wxWindows headers
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/dir.h>
#include <wx/utils.h>
#include <pyhandler.h>
#include <iostream>
#include "fctsys.h"
#include "common.h"
using namespace boost::python;
/*****************************************************************************/
/* Common Python Binding */
/*****************************************************************************/
static int GetLastID( void ) { return ID_END_LIST; }
static object ChooseFile( str objTitle, str objMask, object objOpen )
{
wxString mask = PyHandler::MakeStr( objMask );
int open = extract<int>( objOpen );
wxString script = EDA_FileSelector( PyHandler::MakeStr( objTitle ),
wxEmptyString, /* Chemin par defaut */
wxEmptyString, /* nom fichier par defaut */
mask, /* extension par defaut */
mask, /* Masque d'affichage */
NULL,
open ? wxFD_OPEN : wxFD_SAVE,
TRUE
);
return PyHandler::Convert( script );
}
static void Print( str message ) { std::cout << extract<char *>(message) << std::endl; }
static void Clear() {}
static void RegisterCb( str objKey, object callback )
{ PyHandler::GetInstance()->RegisterCallback( PyHandler::MakeStr(objKey), callback ); }
static void UnRegisterCb( str objKey, object callback )
{ PyHandler::GetInstance()->UnRegisterCallback( PyHandler::MakeStr(objKey), callback ); }
static void init_base_utils(void)
{
def ( "ChooseFile", &ChooseFile );
def ( "RegisterCallback", &RegisterCb );
def ( "UnRegisterCallback", &UnRegisterCb );
def ( "GetLastID", &GetLastID );
def ( "Print", &Print );
def ( "Clear", &Clear);
}
static void InitPyModules() { PyHandler::GetInstance()->InitNextModule(); } // Dummy boost callback
/*****************************************************************************/
/* PyHandler */
/*****************************************************************************/
// std::vector< T > -> python object implicit conversion
template <typename T> struct std_vector_to_tuple
{
static PyObject * makeItem( const wxString & str ) { return boost::python::incref( PyHandler::Convert( str ).ptr() ); }
static PyObject * makeItem( const std::string & str ) { return boost::python::incref( boost::python::str( str.c_str() ).ptr() ); }
static PyObject * makeItem( int item ) { return boost::python::incref( PyInt_FromLong( item ) ); }
static PyObject * convert( const T& vect )
{
PyObject * tuple = PyTuple_New( vect.size() );
for ( unsigned int i = 0; i < vect.size() ; i++ )
{
PyTuple_SET_ITEM( tuple, i, makeItem( vect[i] ) );
}
return tuple;
}
};
PyHandler* PyHandler::m_instance = NULL;
PyHandler * PyHandler::GetInstance()
/* Singleton implementation */
{
if ( !PyHandler::m_instance )
{
PyHandler::m_instance = new PyHandler();
}
return PyHandler::m_instance;
}
PyHandler::PyHandler()
/* Init the Python env */
{
Py_Initialize();
PyEval_InitThreads();
m_ModulesLoaded = false;
m_current = 0;
if ( !wxPyCoreAPI_IMPORT() )
{
std::cerr << "Can't get wx Python binding\n" ;
PyErr_Print();
}
// m_mainTState = wxPyBeginAllowThreads(); // I can't figure out why this make py crash ...
m_mainTState = NULL;
// Make the console appear in a window:
wxString initConsole;
initConsole += wxT( "import sys\n" );
initConsole += wxT( "import wx\n" );
initConsole += wxT( "output = wx.PyOnDemandOutputWindow()\n" );
initConsole += wxT( "sys.stdout = sys.stderr = output\n" );
RunSimpleString( initConsole );
AddToModule ( wxT( "common" ), &init_base_utils );
// Register converters
to_python_converter < std::vector< std::string >, std_vector_to_tuple< const std::vector < std::string > > > ();
to_python_converter < std::vector< wxString >, std_vector_to_tuple< const std::vector < wxString > > > ();
}
void PyHandler::DoInitModules()
{
if ( m_ModulesLoaded ) return;
m_ModulesLoaded = true;
for ( unsigned int i = 0; i < m_ModuleRegistry.size(); i ++ )
{
detail::init_module( m_ModuleRegistry[i].name.fn_str(), &InitPyModules );
}
}
int PyHandler::GetModuleIndex( const wxString & name ) const
/* Returns the module index in the registry, -1 if not found*/
{
for ( unsigned int i = 0; i < m_ModuleRegistry.size(); i ++ )
{
if ( m_ModuleRegistry[i].name == name ) return i;
}
return -1;
}
void PyHandler::AddToModule( const wxString & name, PyHandler::initfunc_t initfunc )
/* Adds an init function to a python module */
{
if (!initfunc) return;
int i = GetModuleIndex( name );
if ( -1 == i )
{
m_ModuleRegistry.push_back( ModuleRecord( name ) );
i = m_ModuleRegistry.size() - 1;
}
m_ModuleRegistry[i].registry.push_back( initfunc );
}
void PyHandler::InitNextModule()
/* Called to initialize a module on py 'import module' */
{
for ( unsigned int j = 0; j < m_ModuleRegistry[m_current].registry.size() ; j ++ )
{
m_ModuleRegistry[m_current].registry[j]();
}
m_current++;
}
PyHandler::~PyHandler()
/* Closes the Python env */
{
wxPyEndAllowThreads(m_mainTState);
Py_Finalize();
}
void PyHandler::RunBaseScripts( const wxString & base )
/* Run scripts looking in 'base' directory */
{
const wxString sep = wxFileName().GetPathSeparator();
// check if we can have a kicad_startup.py around ?
wxString script = base + wxT( "scripts" ) + sep + wxT( "kicad_startup.py" );
if ( wxFileExists( script ) ) RunScript( script );
// First find scripts/<name>.py and run it if found :
script = base + wxString::FromAscii( "scripts" ) + sep + m_appName + wxString::FromAscii(".py");
if ( wxFileExists( script ) ) RunScript( script );
// Now lets see if we can find a suitable plugin directory (plugin/<name>) somewhere
wxString pluginDir = base + wxT( "plugins" ) + sep + m_appName;
if ( wxDirExists( pluginDir ) )
{
// We do have a systemwide plugin dir, let's find files in it
wxArrayString pluginList;
wxDir::GetAllFiles( pluginDir, &pluginList, wxT("*.py") );
for ( unsigned int i = 0; i < pluginList.Count() ; i++ )
{
RunScript( pluginList[i] );
}
}
}
void PyHandler::RunScripts()
/* Run application startup scripts */
{
// SYSTEMWIDE:
const wxString sep = wxFileName().GetPathSeparator();
wxString dataPath = ReturnKicadDatasPath();
if ( wxDirExists( dataPath ) ) RunBaseScripts( dataPath );
// USER Scripts:
wxString userDir = wxGetUserHome() + sep + wxString::FromAscii(".kicad.d") + sep;
if ( wxDirExists( userDir ) ) RunBaseScripts( userDir );
userDir = wxGetUserHome() + sep + wxString::FromAscii("_kicad_d") + sep;
if ( wxDirExists( userDir ) ) RunBaseScripts( userDir );
}
bool PyHandler::RunScript( const wxString & name )
/* Run the script specified by 'name' */
{
DoInitModules();
object module( handle<>(borrowed(PyImport_AddModule("__main__"))));
object ns = module.attr( "__dict__" );
bool ret = true;
FILE * file = fopen( name.fn_str(), "r" );
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if ( !file )
{
// do something
std::cout << "Unable to Load " << name.fn_str() << "\n";
ret = false;
}
else
{
wxString currDir = wxGetCwd();
wxFileName fname( name );
wxString pyDir = fname.GetPath();
wxSetWorkingDirectory( pyDir );
try
{
ns["currentScript"] = Convert( name );
handle<> ignored( PyRun_File( file, name.fn_str(), Py_file_input, ns.ptr(), ns.ptr() ) );
}
catch ( error_already_set )
{
PyErr_Print(); // should be printed into an error message ...
ret = false;
}
wxSetWorkingDirectory( currDir );
}
fclose( file );
wxPyEndBlockThreads(blocked);
return ret;
}
bool PyHandler::RunSimpleString( const wxString & code )
/* Run the code in 'code' */
{
wxPyBlock_t blocked = wxPyBeginBlockThreads();
try
{
PyRun_SimpleString( code.fn_str() );
}
catch ( error_already_set )
{
PyErr_Print(); // should be printed into an error message ...
wxPyEndBlockThreads(blocked);
return false;
}
wxPyEndBlockThreads(blocked);
return true;
}
void PyHandler::SetAppName( const wxString & name )
/* Set the application name in the python scope */
{
m_appName = name;
object module(( handle<>(borrowed(PyImport_AddModule("__main__")))));
object ns = module.attr( "__dict__" );
try {
ns["kicadApp"] = std::string( name.ToAscii() );
}
catch (error_already_set)
{
PyErr_Print();
}
}
const char * PyHandler::GetVersion() { return Py_GetVersion(); }
// Event handling :
void PyHandler::DeclareEvent( const wxString & key ) { m_EventRegistry.push_back( Event( key ) ); }
int PyHandler::GetEventIndex( const wxString & key )
{
for ( unsigned int i = 0; i < m_EventRegistry.size(); i ++ )
{
if ( m_EventRegistry[i].key == key ) return i;
}
return -1;
}
void PyHandler::TriggerEvent( const wxString & key ) { TriggerEvent( key, str( "" ) ); }
void PyHandler::TriggerEvent( const wxString & key, const object & param )
{
int i = GetEventIndex( key );
if ( -1 == i ) return;
wxPyBlock_t blocked = wxPyBeginBlockThreads();
for ( unsigned int j = 0; j < m_EventRegistry[i].functors.size(); j++ )
{
try
{
m_EventRegistry[i].functors[j]( param );
}
catch (error_already_set)
{
std::cout << "Error in event " << key.fn_str() << " callback" << std::endl;
PyErr_Print();
}
}
wxPyEndBlockThreads(blocked);
}
void PyHandler::RegisterCallback( const wxString & key, const object & callback )
{
int i = GetEventIndex( key );
if ( -1 == i ) return;
m_EventRegistry[i].functors.push_back( callback );
}
void PyHandler::UnRegisterCallback( const wxString & key, const object & callback )
{
int i = GetEventIndex( key );
if ( -1 == i ) return;
for ( unsigned int j = 0; j < m_EventRegistry[i].functors.size() ; j++ )
{
if ( callback == m_EventRegistry[i].functors[j] )
{
m_EventRegistry[i].functors.erase( m_EventRegistry[i].functors.begin() + j );
break;
}
}
}
// Object conversion:
wxString PyHandler::MakeStr( const object & objStr ) { return wxString( extract<const char *>( objStr ), wxConvLocal ); }
object PyHandler::Convert( const wxString & wxStr ) { return str( std::string( wxStr.fn_str() ).c_str() ); }
// vim: set tabstop=4 :

View File

@ -6,8 +6,8 @@
#include "fctsys.h"
#include <time.h>
#include "common.h"
/*********************************************************************/
int ReadDelimitedText(char * dest, char * source, int NbMaxChar )
/*********************************************************************/
@ -302,22 +302,6 @@ char * line = Text;
return line;
}
/****************************/
char * from_point(char * Text)
/****************************/
/* convertit les . en , dans une chaine. utilisé pour compenser
l'internalisation imbecile de la fct scanf
qui lit les flottants avec une virgule au lieu du point
*/
{
char * line = Text;
if ( Text == NULL ) return NULL;
for ( ; *Text != 0; Text++ )
if (*Text == '.') *Text = g_FloatSeparator;
return line;
}
/********************************/
char * strupper(char * Text)

View File

@ -13,9 +13,9 @@
/* Must be defined in main applications: */
extern wxString g_Main_Title;
/*********************************************************************/
void WinEDA_DrawFrame::TraceWorkSheet(wxDC * DC, BASE_SCREEN * screen)
/*********************************************************************/
/*************************************************************************************/
void WinEDA_DrawFrame::TraceWorkSheet(wxDC * DC, BASE_SCREEN * screen, int line_width)
/*************************************************************************************/
/* Draw the sheet references
*/
{
@ -32,6 +32,7 @@ wxSize size(SIZETEXT*scale,SIZETEXT*scale);
wxSize size_ref(SIZETEXT_REF*scale,SIZETEXT_REF*scale);
wxString msg;
int UpperLimit = VARIABLE_BLOCK_START_POSITION;
int width = line_width;
Color = RED;
if(Sheet == NULL)
@ -46,7 +47,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
{
GRSetDrawMode(DC, GR_COPY);
GRRect(&DrawPanel->m_ClipBox, DC, 0, 0,
Sheet->m_Size.x * scale, Sheet->m_Size.y * scale,
Sheet->m_Size.x * scale, Sheet->m_Size.y * scale, width,
g_DrawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY );
}
@ -60,7 +61,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
for ( ii = 0; ii < 2 ; ii++ )
{
GRRect(&DrawPanel->m_ClipBox, DC, refx * scale, refy * scale,
xg * scale, yg * scale, Color);
xg * scale, yg * scale, width, Color);
refx += GRID_REF_W; refy += GRID_REF_W;
xg -= GRID_REF_W; yg -= GRID_REF_W;
@ -80,23 +81,23 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
if( ii < xg - PAS_REF/2 )
{
GRLine(&DrawPanel->m_ClipBox, DC, ii * scale, refy * scale,
ii * scale, (refy + GRID_REF_W) * scale, Color);
ii * scale, (refy + GRID_REF_W) * scale, width, Color);
}
DrawGraphicText(DrawPanel, DC,
wxPoint( (ii - gxpas/2) * scale, (refy + GRID_REF_W/2) * scale),
Color,
Line, TEXT_ORIENT_HORIZ, size_ref,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, width);
if( ii < xg - PAS_REF/2 )
{
GRLine(&DrawPanel->m_ClipBox, DC,ii * scale, yg * scale,
ii * scale, (yg - GRID_REF_W) * scale, Color);
ii * scale, (yg - GRID_REF_W) * scale, width, Color);
}
DrawGraphicText(DrawPanel, DC,
wxPoint( (ii - gxpas/2) * scale, (yg - GRID_REF_W/2) * scale),
Color,
Line, TEXT_ORIENT_HORIZ, size_ref,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, width);
}
/* Trace des reperes selon l'axe Y */
@ -110,23 +111,23 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
if( ii < yg - PAS_REF/2 )
{
GRLine(&DrawPanel->m_ClipBox, DC, refx * scale, ii * scale,
(refx + GRID_REF_W) * scale, ii * scale, Color);
(refx + GRID_REF_W) * scale, ii * scale, width, Color);
}
DrawGraphicText(DrawPanel, DC,
wxPoint((refx + GRID_REF_W/2) * scale, (ii - gypas/2) * scale),
Color,
Line, TEXT_ORIENT_HORIZ, size_ref,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, width);
if( ii < yg - PAS_REF/2 )
{
GRLine(&DrawPanel->m_ClipBox, DC, xg * scale, ii * scale,
(xg - GRID_REF_W) * scale, ii * scale, Color);
(xg - GRID_REF_W) * scale, ii * scale, width, Color);
}
DrawGraphicText(DrawPanel, DC,
wxPoint((xg - GRID_REF_W/2) * scale, (ii - gxpas/2) * scale),
Color,
Line, TEXT_ORIENT_HORIZ, size_ref,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, width);
}
@ -147,7 +148,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
msg += screen->m_Date;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case WS_REV:
@ -155,7 +156,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
msg += screen->m_Revision;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case WS_LICENCE:
@ -164,7 +165,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
msg += wxT(" ") + GetBuildVersion();
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case WS_SIZESHEET:
@ -172,7 +173,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
msg += Sheet->m_Name;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
@ -182,7 +183,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
screen->m_NumberOfSheet;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case WS_COMPANY_NAME:
@ -192,7 +193,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
{
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
UpperLimit = MAX(UpperLimit, WsItem->m_Posy+SIZETEXT);
}
break;
@ -202,7 +203,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
msg += screen->m_Title;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case WS_COMMENT1:
@ -212,7 +213,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
{
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
UpperLimit = MAX(UpperLimit, WsItem->m_Posy+SIZETEXT);
}
break;
@ -224,7 +225,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
{
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
UpperLimit = MAX(UpperLimit, WsItem->m_Posy+SIZETEXT);
}
break;
@ -236,7 +237,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
{
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
UpperLimit = MAX(UpperLimit, WsItem->m_Posy+SIZETEXT);
}
break;
@ -248,7 +249,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
{
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
UpperLimit = MAX(UpperLimit, WsItem->m_Posy+SIZETEXT);
}
break;
@ -266,7 +267,7 @@ int UpperLimit = VARIABLE_BLOCK_START_POSITION;
yg = Sheet->m_Size.y -
GRID_REF_W - Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine(&DrawPanel->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, Color);
xg * scale, yg * scale, width, Color);
break;
}

View File

@ -80,7 +80,10 @@ MODULE * Module = NULL;
if( stricmp(Name,CONV_TO_UTF8(CmpName)) == 0 ) /* composant localise */
{
Module = new MODULE(m_Pcb);
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
setlocale(LC_NUMERIC, "C");
Module->ReadDescr(lib_module, &LineNum);
setlocale(LC_NUMERIC, ""); // revert to the current locale
Module->SetPosition(wxPoint(0,0) );
fclose(lib_module);
return(Module) ;

View File

@ -31,7 +31,7 @@ $(TARGET): $(OBJECTS) makefile.gtk makefile.include $(EXTRALIBS) ../libs.linux $
$(LD) $(OBJECTS) $(LDFLAGS) $(LIBVIEWER3D) $(LIBS_WITH_GL) -o $(TARGET)
install:
install: $(TARGET)
cp -f $(TARGET) $(KICAD_BIN)
clean:

View File

@ -1,141 +1,141 @@
# makefile pour cvpcb (mingw)
OBJSUFF = o
EXTRACPPFLAGS = -DCVPCB -I./ -I../cvpcb -I../include -Ibitmaps -I../pcbnew -I../3d-viewer
EXTRALIBS = ../common/common.a
LIBVIEWER3D = ../3d-viewer/3d-viewer.a
# DEPEND = cvpcb.h ../include/pcbstruct.h
OBJECTS = $(TARGET).o \
class_cvpcb.o\
memoire.o \
cvframe.o\
listboxes.o\
drawframe.o\
class_pcb_text.o\
class_cotation.o\
class_mire.o\
displayframe.o\
drawpanel.o \
init.o rdpcad.o \
readschematicnetlist.o\
viewlogi.o viewlnet.o \
loadcmp.o savecmp.o \
tool_cvpcb.o \
writenetlistpcbnew.o\
genequiv.o \
ioascii.o \
menucfg.o \
cfg.o listlib.o \
infospgm.o autosel.o \
setvisu.o\
dialog_display_options.o\
zoom.o \
visumod.o\
tracemod.o \
classpcb.o \
class_board.o \
class_module.o \
class_pad.o \
class_text_mod.o \
class_edge_mod.o \
class_equipot.o \
class_track.o\
basepcbframe.o
cvpcb.o: cvpcb.cpp cvpcb.h $(DEPEND)
displayframe.o: displayframe.cpp $(DEPEND)
listboxes.o: listboxes.cpp $(DEPEND)
drawpanel.o: ../share/drawpanel.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
drawframe.o: ../share/drawframe.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
init.o: init.cpp $(DEPEND)
memoire.o: memoire.cpp $(DEPEND)
rdpcad.o: rdpcad.cpp $(DEPEND)
classpcb.o: ../pcbnew/classpcb.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_mire.o: ../pcbnew/class_mire.cpp ../pcbnew/class_mire.h $(COMMON)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_cotation.o: ../pcbnew/class_cotation.cpp ../pcbnew/class_cotation.h $(COMMON)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_pcb_text.o: ../pcbnew/class_pcb_text.cpp ../pcbnew/class_pcb_text.h $(COMMON)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_board.o: ../pcbnew/class_board.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_track.o: ../pcbnew/class_track.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_pad.o: ../pcbnew/class_pad.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_module.o: ../pcbnew/class_module.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_text_mod.o: ../pcbnew/class_text_mod.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_edge_mod.o: ../pcbnew/class_edge_mod.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_equipot.o: ../pcbnew/class_equipot.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
basepcbframe.o: ../pcbnew/basepcbframe.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
readschematicnetlist.o: readschematicnetlist.cpp $(DEPEND)
viewlogi.o: viewlogi.cpp $(DEPEND)
viewlnet.o: viewlnet.cpp $(DEPEND)
loadcmp.o: loadcmp.cpp $(DEPEND)
savecmp.o: savecmp.cpp $(DEPEND)
writenetlistpcbnew.o: writenetlistpcbnew.cpp $(DEPEND)
genequiv.o: genequiv.cpp $(DEPEND)
ioascii.o: ../pcbnew/ioascii.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
listlib.o: listlib.cpp $(DEPEND)
cfg.o: cfg.cpp cfg.h $(DEPEND)
menucfg.o: menucfg.cpp dialog_cvpcb_config.cpp dialog_cvpcb_config.h $(DEPEND)
infospgm.o: ../share/infospgm.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
autosel.o: autosel.cpp $(DEPEND)
setvisu.o: setvisu.cpp $(DEPEND)
zoom.o: ../share/zoom.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
visumod.o: visumod.cpp $(DEPEND)
tracemod.o: ../pcbnew/tracemod.cpp ../include/gr_basic.h $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
dialog_display_options.o: dialog_display_options.cpp dialog_display_options.h $(DEPEND)
# makefile pour cvpcb (mingw)
OBJSUFF = o
EXTRACPPFLAGS += -DCVPCB -fno-strict-aliasing -I./ -I../cvpcb -I../include -Ibitmaps -I../pcbnew -I../3d-viewer
EXTRALIBS = ../common/common.a
LIBVIEWER3D = ../3d-viewer/3d-viewer.a
# DEPEND = cvpcb.h ../include/pcbstruct.h
OBJECTS = $(TARGET).o \
class_cvpcb.o\
memoire.o \
cvframe.o\
listboxes.o\
drawframe.o\
class_pcb_text.o\
class_cotation.o\
class_mire.o\
displayframe.o\
drawpanel.o \
init.o rdpcad.o \
readschematicnetlist.o\
viewlogi.o viewlnet.o \
loadcmp.o savecmp.o \
tool_cvpcb.o \
writenetlistpcbnew.o\
genequiv.o \
ioascii.o \
menucfg.o \
cfg.o listlib.o \
infospgm.o autosel.o \
setvisu.o\
dialog_display_options.o\
zoom.o \
visumod.o\
tracemod.o \
classpcb.o \
class_board.o \
class_module.o \
class_pad.o \
class_text_mod.o \
class_edge_mod.o \
class_equipot.o \
class_track.o\
basepcbframe.o
cvpcb.o: cvpcb.cpp cvpcb.h $(DEPEND)
displayframe.o: displayframe.cpp $(DEPEND)
listboxes.o: listboxes.cpp $(DEPEND)
drawpanel.o: ../share/drawpanel.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
drawframe.o: ../share/drawframe.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
init.o: init.cpp $(DEPEND)
memoire.o: memoire.cpp $(DEPEND)
rdpcad.o: rdpcad.cpp $(DEPEND)
classpcb.o: ../pcbnew/classpcb.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_mire.o: ../pcbnew/class_mire.cpp ../pcbnew/class_mire.h $(COMMON)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_cotation.o: ../pcbnew/class_cotation.cpp ../pcbnew/class_cotation.h $(COMMON)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_pcb_text.o: ../pcbnew/class_pcb_text.cpp ../pcbnew/class_pcb_text.h $(COMMON)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_board.o: ../pcbnew/class_board.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_track.o: ../pcbnew/class_track.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_pad.o: ../pcbnew/class_pad.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_module.o: ../pcbnew/class_module.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_text_mod.o: ../pcbnew/class_text_mod.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_edge_mod.o: ../pcbnew/class_edge_mod.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_equipot.o: ../pcbnew/class_equipot.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
basepcbframe.o: ../pcbnew/basepcbframe.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
readschematicnetlist.o: readschematicnetlist.cpp $(DEPEND)
viewlogi.o: viewlogi.cpp $(DEPEND)
viewlnet.o: viewlnet.cpp $(DEPEND)
loadcmp.o: loadcmp.cpp $(DEPEND)
savecmp.o: savecmp.cpp $(DEPEND)
writenetlistpcbnew.o: writenetlistpcbnew.cpp $(DEPEND)
genequiv.o: genequiv.cpp $(DEPEND)
ioascii.o: ../pcbnew/ioascii.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
listlib.o: listlib.cpp $(DEPEND)
cfg.o: cfg.cpp cfg.h $(DEPEND)
menucfg.o: menucfg.cpp dialog_cvpcb_config.cpp dialog_cvpcb_config.h $(DEPEND)
infospgm.o: ../share/infospgm.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
autosel.o: autosel.cpp $(DEPEND)
setvisu.o: setvisu.cpp $(DEPEND)
zoom.o: ../share/zoom.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
visumod.o: visumod.cpp $(DEPEND)
tracemod.o: ../pcbnew/tracemod.cpp ../include/gr_basic.h $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
dialog_display_options.o: dialog_display_options.cpp dialog_display_options.h $(DEPEND)

View File

@ -19,11 +19,12 @@ include ../libs.macosx
TARGET = cvpcb
all: $(TARGET)
all: $(TARGET) $(TARGET).app
include makefile.include
CPPFLAGS += $(EXTRACPPFLAGS)
CPPFLAGS += -arch i386 -arch ppc
EDACPPFLAGS = $(CPPFLAGS)
@ -33,6 +34,22 @@ $(TARGET): $(OBJECTS) $(TARGET).r makefile.macosx makefile.include $(EXTRALIBS)
$(SETFILE) -a C $(TARGET)
$(TARGET).app: $(OBJS)
rm -Rf $(TARGET).app
mkdir -p $(TARGET).app
mkdir -p $(TARGET).app/Contents
mkdir -p $(TARGET).app/Contents/MacOS
mkdir -p $(TARGET).app/Contents/Frameworks
mkdir -p $(TARGET).app/Contents/Resources
sed -e "s/IDENTIFIER/`echo . | sed -e s,\.\./,,g | sed -e s,/,.,g`/" -e "s/EXECUTABLE/$(TARGET)/" \
-e "s/VERSION/$(MKMK_WX_VERSION)/" $(HOME)/wxMac-$(MKMK_WX_VERSION)/src/mac/carbon/wxmac.icns \
>$(TARGET).app/Contents/Resources/wxmac.icns
sed -e "s/IDENTIFIER/`echo . | sed -e s,\.\./,,g | sed -e s,/,.,g`/" -e "s/EXECUTABLE/$(TARGET)/"\
-e "s/VERSION/$(MKMK_WX_VERSION)/" $(HOME)/wxMac-$(MKMK_WX_VERSION)/src/mac/carbon/Info.plist.in \
>$(TARGET).app/Contents/Info.plist
echo -n "APPL????" >$(TARGET).app/Contents/PkgInfo
ln -f $(TARGET) $(TARGET).app/Contents/MacOS/$(TARGET)
install:
cp -f $(TARGET) $(KICAD_BIN)

View File

@ -141,6 +141,10 @@ wxString msg;
else if( m_Convert == 2 ) msg = _("yes");
else msg = wxT("?");
Affiche_1_Parametre(frame, 16, _("Convert"), msg, BROWN);
if ( m_Width ) valeur_param(m_Width, msg);
else msg = _("default");
Affiche_1_Parametre(frame, 24, _("Width"), msg, BLUE);
}

View File

@ -88,13 +88,13 @@ bool ItemIsInOtherPart, ItemIsInOtherConvert;
{
case COMPONENT_ARC_DRAW_TYPE:
{
pos = ((LibDrawArc*)item)->m_Start; pos.y = -pos.y;
pos = ((LibDrawArc*)item)->m_ArcStart; pos.y = -pos.y;
if ( Rect.Inside(pos) )
{
item->m_Selected = IS_SELECTED;
ItemsCount++;
}
pos = ((LibDrawArc*)item)->m_End; pos.y = -pos.y;
pos = ((LibDrawArc*)item)->m_ArcEnd; pos.y = -pos.y;
if ( Rect.Inside(pos) )
{
item->m_Selected = IS_SELECTED;
@ -113,7 +113,7 @@ bool ItemIsInOtherPart, ItemIsInOtherConvert;
break;
case COMPONENT_RECT_DRAW_TYPE:
pos = ((LibDrawSquare*)item)->m_Start; pos.y = -pos.y;
pos = ((LibDrawSquare*)item)->m_Pos; pos.y = -pos.y;
if ( Rect.Inside(pos) )
{
item->m_Selected = IS_SELECTED;
@ -529,10 +529,10 @@ LibEDA_BaseStruct * item;
{
((LibDrawArc*)item)->m_Pos.x += offset.x;
((LibDrawArc*)item)->m_Pos.y += offset.y;
((LibDrawArc*)item)->m_Start.x += offset.x;
((LibDrawArc*)item)->m_Start.y += offset.y;
((LibDrawArc*)item)->m_End.x += offset.x;
((LibDrawArc*)item)->m_End.y += offset.y;
((LibDrawArc*)item)->m_ArcStart.x += offset.x;
((LibDrawArc*)item)->m_ArcStart.y += offset.y;
((LibDrawArc*)item)->m_ArcEnd.x += offset.x;
((LibDrawArc*)item)->m_ArcEnd.y += offset.y;
break;
}
@ -542,8 +542,8 @@ LibEDA_BaseStruct * item;
break;
case COMPONENT_RECT_DRAW_TYPE:
((LibDrawSquare*)item)->m_Start.x += offset.x;
((LibDrawSquare*)item)->m_Start.y += offset.y;
((LibDrawSquare*)item)->m_Pos.x += offset.x;
((LibDrawSquare*)item)->m_Pos.y += offset.y;
((LibDrawSquare*)item)->m_End.x += offset.x;
((LibDrawSquare*)item)->m_End.y += offset.y;
break;
@ -632,9 +632,9 @@ LibEDA_BaseStruct * item;
case COMPONENT_ARC_DRAW_TYPE:
{
SETMIRROR(((LibDrawArc*)item)->m_Pos.x);
SETMIRROR(((LibDrawArc*)item)->m_Start.x);
SETMIRROR(((LibDrawArc*)item)->m_End.x);
EXCHG(((LibDrawArc*)item)->m_Start,((LibDrawArc*)item)->m_End);
SETMIRROR(((LibDrawArc*)item)->m_ArcStart.x);
SETMIRROR(((LibDrawArc*)item)->m_ArcEnd.x);
EXCHG(((LibDrawArc*)item)->m_ArcStart,((LibDrawArc*)item)->m_ArcEnd);
break;
}
@ -643,7 +643,7 @@ LibEDA_BaseStruct * item;
break;
case COMPONENT_RECT_DRAW_TYPE:
SETMIRROR(((LibDrawSquare*)item)->m_Start.x);
SETMIRROR(((LibDrawSquare*)item)->m_Pos.x);
SETMIRROR(((LibDrawSquare*)item)->m_End.x);
break;

View File

@ -28,6 +28,7 @@
#include "libcmp.h"
#include "general.h"
#include "protos.h"
/***********************************************************/
@ -97,6 +98,7 @@ DrawSheetLabelStruct * Slabel = NULL, * label = m_Label;
newitem->m_DrawOrg = m_DrawOrg;
newitem->m_Curseur = m_Curseur;
newitem->m_MousePosition = m_MousePosition;
newitem->m_MousePositionInPixels = m_MousePositionInPixels;
newitem->m_O_Curseur = m_O_Curseur;
newitem->m_ScrollbarPos = m_ScrollbarPos;
newitem->m_ScrollbarNumber = m_ScrollbarNumber;
@ -140,7 +142,58 @@ void DrawSheetStruct::SwapData(DrawSheetStruct * copyitem)
EXCHG(m_NbLabel, copyitem->m_NbLabel);
}
/************************/
/**************************************************************************************/
void DrawSheetStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
/**************************************************************************************/
/* Draw the hierarchical sheet shape */
{
DrawSheetLabelStruct * SheetLabelStruct;
int txtcolor;
wxString Text;
int color;
wxPoint pos = m_Pos + offset;
int LineWidth = g_DrawMinimunLineWidth;
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(m_Layer);
GRSetDrawMode(DC, DrawMode);
GRRect(&panel->m_ClipBox, DC, pos.x, pos.y,
pos.x + m_Size.x, pos.y + m_Size.y, LineWidth, color);
/* Trace des textes : SheetName */
if( Color > 0 ) txtcolor = Color;
else txtcolor = ReturnLayerColor(LAYER_SHEETNAME);
Text = wxT("Sheet: ") + m_SheetName;
DrawGraphicText(panel, DC,
wxPoint(pos.x, pos.y - 8), txtcolor,
Text, TEXT_ORIENT_HORIZ, wxSize(m_SheetNameSize,m_SheetNameSize),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth);
/* Trace des textes : FileName */
if( Color >= 0 ) txtcolor = Color;
else txtcolor = ReturnLayerColor(LAYER_SHEETFILENAME);
Text = wxT("File: ") + m_FileName;
DrawGraphicText(panel, DC,
wxPoint(pos.x, pos.y + m_Size.y + 4),
txtcolor,
Text, TEXT_ORIENT_HORIZ, wxSize(m_FileNameSize,m_FileNameSize),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, LineWidth);
/* Trace des textes : SheetLabel */
SheetLabelStruct = m_Label;
while( SheetLabelStruct != NULL )
{
SheetLabelStruct->Draw(panel, DC, offset,DrawMode, Color);
SheetLabelStruct = (DrawSheetLabelStruct*)(SheetLabelStruct->Pnext);
}
}
/************************/
/* DrawSheetLabelStruct */
/************************/
@ -170,4 +223,94 @@ DrawSheetLabelStruct * newitem =
newitem->m_Shape = m_Shape;
return newitem;
}
}
/********************************************************************************************/
void DrawSheetLabelStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
/********************************************************************************************/
/* Routine de dessin des Labels type hierarchie */
{
int side, txtcolor;
int posx , tposx, posy, size2;
wxSize size;
int NbSegm, coord[12];
int LineWidth = g_DrawMinimunLineWidth;
if( Color >= 0 ) txtcolor = Color;
else txtcolor = ReturnLayerColor(m_Layer);
GRSetDrawMode(DC, DrawMode);
posx = m_Pos.x + offset.x; posy = m_Pos.y + offset.y; size = m_Size;
if( !m_Text.IsEmpty() )
{
if( m_Edge )
{
tposx = posx - size.x;
side = GR_TEXT_HJUSTIFY_RIGHT;
}
else
{
tposx = posx + size.x + (size.x /8) ;
side = GR_TEXT_HJUSTIFY_LEFT;
}
DrawGraphicText(panel, DC, wxPoint(tposx, posy), txtcolor,
m_Text, TEXT_ORIENT_HORIZ,size ,
side, GR_TEXT_VJUSTIFY_CENTER, LineWidth);
}
/* dessin du symbole de connexion */
if(m_Edge)
{
size.x = -size.x;
size.y = -size.y;
}
coord[0] = posx; coord[1] = posy; size2 = size.x /2;
NbSegm = 0;
switch(m_Shape)
{
case 0: /* input |> */
coord[2] = posx ; coord[3] = posy - size2;
coord[4] = posx + size2; coord[5] = posy - size2;
coord[6] = posx + size.x; coord[7] = posy;
coord[8] = posx + size2; coord[9] = posy + size2;
coord[10] = posx ; coord[11] = posy + size2;
coord[12] = coord[0] ; coord[13] = coord[1];
NbSegm = 7;
break;
case 1: /* output <| */
coord[2] = posx + size2; coord[3] = posy - size2;
coord[4] = posx + size.x; coord[5] = posy - size2;
coord[6] = posx + size.x; coord[7] = posy + size2;
coord[8] = posx + size2; coord[9] = posy + size2;
coord[10] = coord[0] ; coord[11] = coord[1];
NbSegm = 6;
break;
case 2: /* bidi <> */
case 3: /* TriSt <> */
coord[2] = posx + size2; coord[3] = posy - size2;
coord[4] = posx + size.x; coord[5] = posy;
coord[6] = posx + size2; coord[7] = posy +size2;
coord[8] = coord[0]; coord[9] = coord[1];
NbSegm = 5;
break;
default: /* unsp []*/
coord[2] = posx ; coord[3] = posy - size2;
coord[4] = posx + size.x; coord[5] = posy - size2;
coord[6] = posx + size.x; coord[7] = posy + size2;
coord[8] = posx ; coord[9] = posy + size2;
coord[10] = coord[0] ; coord[11] = coord[1];
NbSegm = 6;
break;
}
int FillShape = FALSE;
GRPoly(&panel->m_ClipBox, DC, NbSegm, coord, FillShape, LineWidth, txtcolor, txtcolor); /* Poly Non rempli */
}

View File

@ -43,6 +43,7 @@ DrawTextStruct * newitem = new DrawTextStruct(m_Pos, m_Text);
newitem->m_Shape = m_Shape;
newitem->m_Orient = m_Orient;
newitem->m_Size = m_Size;
newitem->m_Width = m_Width;
newitem->m_HJustify = m_HJustify;
newitem->m_VJustify = m_VJustify;
newitem->m_IsDangling = m_IsDangling ;
@ -58,6 +59,7 @@ void DrawTextStruct::SwapData(DrawTextStruct * copyitem)
EXCHG(m_Text, copyitem->m_Text);
EXCHG(m_Pos, copyitem->m_Pos);
EXCHG(m_Size, copyitem->m_Size);
EXCHG(m_Width, copyitem->m_Width);
EXCHG(m_Shape, copyitem->m_Shape);
EXCHG(m_Orient, copyitem->m_Orient);
EXCHG(m_StructType, copyitem->m_StructType);
@ -134,16 +136,16 @@ void DrawTextStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & of
}
}
/***************************************************************/
/*******************************************************************************************/
void DrawTextStruct::DrawAsText(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
/***************************************************************/
/* Les textes type label ou notes peuvent avoir 4 directions, mais
sont tj cadres par rapport a la 1ere lettre du texte
/*******************************************************************************************/
/* Texts type Label or Comment (text on layer "NOTE") have 4 directions, and the Text origin is the first letter
*/
{
int color;
int width = MAX(m_Width, g_DrawMinimunLineWidth);
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(m_Layer);
GRSetDrawMode(DC, DrawMode);
@ -155,28 +157,28 @@ int color;
wxPoint(m_Pos.x + offset.x, m_Pos.y - TXTMARGE + offset.y),
color,
m_Text, m_Orient*900, m_Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, width);
break;
case 1: /* Orientation vert UP */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x - TXTMARGE + offset.x, m_Pos.y + offset.y), color,
m_Text, m_Orient*900, m_Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM);
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_BOTTOM, width);
break;
case 2: /* Orientation horiz inverse */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + offset.x, m_Pos.y + TXTMARGE + offset.y), color,
m_Text, m_Orient*900, m_Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_TOP);
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_TOP, width);
break;
case 3: /* Orientation vert BOTTOM */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + TXTMARGE + offset.y, m_Pos.y + offset.y), color,
m_Text, m_Orient*900, m_Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, width);
break;
}
if ( m_IsDangling )
@ -195,14 +197,14 @@ void DrawTextStruct::DrawAsLabel(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoi
void DrawTextStruct::DrawAsGlobalLabel(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint& offset,
int DrawMode, int Color)
/*****************************************************************************/
/* Les textes type Global label peuvent avoir 4 directions, mais
sont tj cadres par rapport au symbole graphique (icone)
/* Texts type Global Label have 4 directions, and the Text origin is the graphic icon
*/
{
int * Template;
int Poly[12];
int ii, jj, imax, color, HalfSize;
wxSize Size = m_Size;
int width = MAX(m_Width, g_DrawMinimunLineWidth);
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(m_Layer);
@ -217,28 +219,28 @@ wxSize Size = m_Size;
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x - ii + offset.x, m_Pos.y + offset.y), color,
m_Text, TEXT_ORIENT_HORIZ, Size,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case 1: /* Orientation vert UP */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + offset.x, m_Pos.y + ii + offset.y), color,
m_Text, TEXT_ORIENT_VERT, Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, width);
break;
case 2: /* Orientation horiz inverse */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + ii + offset.x, m_Pos.y + offset.y), color,
m_Text, TEXT_ORIENT_HORIZ, Size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case 3: /* Orientation vert BOTTOM */
DrawGraphicText(panel, DC,
wxPoint(m_Pos.x + offset.x, m_Pos.y - ii + offset.y), color,
m_Text, TEXT_ORIENT_VERT, Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, width);
break;
}
@ -254,8 +256,8 @@ wxSize Size = m_Size;
jj++; Template++;
}
// GRPoly(&panel->m_ClipBox, DC, imax,Poly,1, color, color ); /* Polygne Rempli */
GRPoly(&panel->m_ClipBox, DC, imax,Poly,0, color, color ); /* Polygne Non Rempli */
// GRPoly(&panel->m_ClipBox, DC, imax,Poly,1, width, color, color ); /* Polygne Rempli */
GRPoly(&panel->m_ClipBox, DC, imax,Poly,0, width, color, color ); /* Polygne Non Rempli */
if ( m_IsDangling )
DrawDanglingSymbol(panel, DC, m_Pos + offset, color);

View File

@ -81,7 +81,7 @@ public:
int m_FlagControlMulti;
int m_Convert; /* Gestion des mutiples representations (ex: conversion De Morgan) */
int m_Transform[2][2]; /* The rotation/mirror transformation matrix. */
bool * m_PinIsDangling; // liste des indicateurs de pin non connectee
bool * m_PinIsDangling; // liste des indicateurs de pin non connectee
public:
EDA_SchComponentStruct(const wxPoint & pos = wxPoint(0,0));

View File

@ -30,7 +30,7 @@ EDA_BaseStruct * WinEDA_SchematicFrame::
/**************************************************************/
/* Routine de localisation et d'affichage des caract (si utile )
de l'element pointe par la souris
de l'element pointe par la souris ou par le curseur pcb
- marqueur
- noconnect
- jonction
@ -44,100 +44,58 @@ EDA_BaseStruct * WinEDA_SchematicFrame::
*/
{
EDA_BaseStruct *DrawStruct;
LibDrawPin * Pin;
EDA_SchComponentStruct * LibItem;
wxString Text;
char Line[1024];
wxString msg;
int ii;
wxPoint mouse_position = GetScreen()->m_MousePosition;
LibDrawPin * Pin = NULL;
EDA_SchComponentStruct * LibItem = NULL;
char Line[1024];
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList, MARKERITEM);
if( DrawStruct )
{
DrawMarkerStruct * Marker = (DrawMarkerStruct *) DrawStruct;
ii = Marker->m_Type;
Text = Marker->GetComment();
if(Text.IsEmpty() ) Text = wxT("NoComment");
msg = NameMarqueurType[ii]; msg << wxT(" << ") << Text;
Affiche_Message(msg);
return(DrawStruct);
}
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList,
NOCONNECTITEM);
if( DrawStruct )
{
Affiche_Message(wxEmptyString);
return(DrawStruct);
}
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList,
JUNCTIONITEM);
if( DrawStruct )
{
Affiche_Message(wxEmptyString);
return(DrawStruct);
}
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList,
WIREITEM|BUSITEM|RACCORDITEM);
if( DrawStruct ) // Recherche d'une pin eventelle
DrawStruct = SchematicGeneralLocateAndDisplay(mouse_position, IncludePin);
if(! DrawStruct && ( mouse_position != GetScreen()->m_Curseur) )
{
Pin = LocateAnyPin(m_CurrentScreen->EEDrawList,m_CurrentScreen->m_Curseur, &LibItem);
if( Pin )
{
Pin->Display_Infos(this);
if ( LibItem )
Affiche_1_Parametre( this, 1,
LibItem->m_Field[REFERENCE].m_Text,
LibItem->m_Field[VALUE].m_Text,
CYAN);
/* envoi id pin a pcbnew */
if(Pin->m_PinNum)
{
char pinnum[20];
pinnum[0] = Pin->m_PinNum & 255;
pinnum[1] = (Pin->m_PinNum >> 8 ) & 255;
pinnum[2] = (Pin->m_PinNum >> 16 ) & 255;
pinnum[3] = (Pin->m_PinNum >> 24 ) & 255;
pinnum[4] = 0;
sprintf(Line,"$PIN: %s $PART: %s", pinnum,
CONV_TO_UTF8(LibItem->m_Field[REFERENCE].m_Text));
SendCommand(MSG_TO_PCB, Line);
}
}
else Affiche_Message(wxEmptyString);
return(DrawStruct);
DrawStruct = SchematicGeneralLocateAndDisplay(GetScreen()->m_Curseur, IncludePin);
}
if ( ! DrawStruct ) return NULL;
// Cross probing: Send a command to pcbnew via a socket link, service 4242
// Cross probing:1- look for a component, and send a locate footprint command to pcbnew
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList,
FIELDCMPITEM);
if( DrawStruct )
{
PartTextStruct * Field = (PartTextStruct *) DrawStruct;
LibItem = (EDA_SchComponentStruct * )Field->m_Parent;
LibItem->Display_Infos(this);
sprintf(Line,"$PART: %s", CONV_TO_UTF8(LibItem->m_Field[REFERENCE].m_Text) );
SendCommand(MSG_TO_PCB, Line);
return(DrawStruct);
}
/* search for a pin */
Pin = LocateAnyPin(m_CurrentScreen->EEDrawList,m_CurrentScreen->m_Curseur, &LibItem);
if( Pin )
/* Cross probing to pcbnew if a pin or a component is found */
switch (DrawStruct->m_StructType )
{
case COMPONENT_FIELD_DRAW_TYPE:
{
PartTextStruct * Field = (PartTextStruct *) DrawStruct;
LibItem = (EDA_SchComponentStruct * )Field->m_Parent;
sprintf(Line,"$PART: %s", CONV_TO_UTF8(LibItem->m_Field[REFERENCE].m_Text));
SendCommand(MSG_TO_PCB, Line);
}
break;
case DRAW_LIB_ITEM_STRUCT_TYPE:
Pin = LocateAnyPin(m_CurrentScreen->EEDrawList, GetScreen()->m_Curseur, &LibItem);
if ( Pin ) break; // Priority is probing a pin first
LibItem = (EDA_SchComponentStruct *) DrawStruct;
sprintf(Line,"$PART: %s", CONV_TO_UTF8(LibItem->m_Field[REFERENCE].m_Text) );
SendCommand(MSG_TO_PCB, Line);
break;
default:
Pin = LocateAnyPin(m_CurrentScreen->EEDrawList, GetScreen()->m_Curseur, &LibItem);
break;
case COMPONENT_PIN_DRAW_TYPE:
Pin = (LibDrawPin*) DrawStruct;
break;
}
if ( Pin )
{
/* Force display pin infos (the previous display could be a component info) */
Pin->Display_Infos(this);
if ( LibItem )
Affiche_1_Parametre( this, 1,
LibItem->m_Field[REFERENCE].m_Text,
LibItem->m_Field[VALUE].m_Text,
CYAN);
// Cross probing:2 - pin found, and send a locate pin command to pcbnew (hightlight net)
if(Pin->m_PinNum)
{
@ -147,26 +105,119 @@ int ii;
CONV_TO_UTF8(LibItem->m_Field[REFERENCE].m_Text));
SendCommand(MSG_TO_PCB, Line);
}
}
return DrawStruct;
}
/************************************************************************************/
EDA_BaseStruct * WinEDA_SchematicFrame::
SchematicGeneralLocateAndDisplay(const wxPoint & refpoint, bool IncludePin)
/************************************************************************************/
/* Find the schematic item at position "refpoint"
the priority order is:
- marker
- noconnect
- junction
- wire/bus/entry
- label
- pin
- component
return:
an EDA_BaseStruct pointer on the item
a Null pointer if no item found
For some items, caracteristics are displayed on the screen.
*/
{
EDA_BaseStruct *DrawStruct;
LibDrawPin * Pin;
EDA_SchComponentStruct * LibItem;
wxString Text;
wxString msg;
int ii;
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList, MARKERITEM);
if( DrawStruct )
{
DrawMarkerStruct * Marker = (DrawMarkerStruct *) DrawStruct;
ii = Marker->m_Type;
Text = Marker->GetComment();
if(Text.IsEmpty() ) Text = wxT("NoComment");
msg = NameMarqueurType[ii]; msg << wxT(" << ") << Text;
Affiche_Message(msg);
return(DrawStruct);
}
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList,
NOCONNECTITEM);
if( DrawStruct )
{
MsgPanel->EraseMsgBox();
return(DrawStruct);
}
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList,
JUNCTIONITEM);
if( DrawStruct )
{
MsgPanel->EraseMsgBox();
return(DrawStruct);
}
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList,
WIREITEM|BUSITEM|RACCORDITEM);
if( DrawStruct ) // Search for a pin
{
Pin = LocateAnyPin(m_CurrentScreen->EEDrawList,refpoint, &LibItem);
if( Pin )
{
Pin->Display_Infos(this);
if ( LibItem )
Affiche_1_Parametre( this, 1,
LibItem->m_Field[REFERENCE].m_Text,
LibItem->m_Field[VALUE].m_Text,
CYAN);
}
else MsgPanel->EraseMsgBox();
return(DrawStruct);
}
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList, FIELDCMPITEM);
if( DrawStruct )
{
PartTextStruct * Field = (PartTextStruct *) DrawStruct;
LibItem = (EDA_SchComponentStruct * )Field->m_Parent;
LibItem->Display_Infos(this);
return(DrawStruct);
}
/* search for a pin */
Pin = LocateAnyPin(m_CurrentScreen->EEDrawList, refpoint, &LibItem);
if( Pin )
{
Pin->Display_Infos(this);
if ( LibItem )
Affiche_1_Parametre( this, 1,
LibItem->m_Field[REFERENCE].m_Text,
LibItem->m_Field[VALUE].m_Text,
CYAN);
if ( IncludePin == TRUE ) return(LibItem);
}
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList,
LIBITEM);
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList, LIBITEM);
if( DrawStruct )
{
DrawStruct = LocateSmallestComponent( GetScreen() );
LibItem = (EDA_SchComponentStruct *) DrawStruct;
LibItem->Display_Infos(this);
sprintf(Line,"$PART: %s",
CONV_TO_UTF8(LibItem->m_Field[REFERENCE].m_Text));
SendCommand(MSG_TO_PCB, Line);
return(DrawStruct);
}
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList,
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList,
SHEETITEM);
if( DrawStruct )
{
@ -175,7 +226,7 @@ int ii;
}
// Recherche des autres elements
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList,
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList,
SEARCHALL);
if( DrawStruct )
{
@ -188,9 +239,9 @@ int ii;
/**************************************************************/
void WinEDA_DrawFrame::GeneralControle(wxDC *DC, wxPoint Mouse)
/**************************************************************/
/***********************************************************************/
void WinEDA_DrawFrame::GeneralControle(wxDC *DC, wxPoint MousePositionInPixels)
/***********************************************************************/
{
wxSize delta;
int zoom = m_CurrentScreen->GetZoom();
@ -199,7 +250,7 @@ int hotkey = 0;
ActiveScreen = (SCH_SCREEN *) m_CurrentScreen;
curpos = DrawPanel->CursorRealPosition(Mouse);
curpos = m_CurrentScreen->m_MousePosition;
oldpos = m_CurrentScreen->m_Curseur;
delta.x = m_CurrentScreen->GetGrid().x / zoom;
@ -252,26 +303,26 @@ int hotkey = 0;
case WXK_NUMPAD8 : /* Deplacement curseur vers le haut */
case WXK_UP :
Mouse.y -= delta.y;
DrawPanel->MouseTo(Mouse);
MousePositionInPixels.y -= delta.y;
DrawPanel->MouseTo(MousePositionInPixels);
break ;
case WXK_NUMPAD2: /* Deplacement curseur vers le bas */
case WXK_DOWN:
Mouse.y += delta.y;
DrawPanel->MouseTo(Mouse);
MousePositionInPixels.y += delta.y;
DrawPanel->MouseTo(MousePositionInPixels);
break ;
case WXK_NUMPAD4: /* Deplacement curseur vers la gauche */
case WXK_LEFT :
Mouse.x -= delta.x;
DrawPanel->MouseTo(Mouse);
MousePositionInPixels.x -= delta.x;
DrawPanel->MouseTo(MousePositionInPixels);
break ;
case WXK_NUMPAD6: /* Deplacement curseur vers la droite */
case WXK_RIGHT:
Mouse.x += delta.x;
DrawPanel->MouseTo(Mouse);
MousePositionInPixels.x += delta.x;
DrawPanel->MouseTo(MousePositionInPixels);
break;
case WXK_INSERT:

View File

@ -254,11 +254,10 @@ DrawPickedStruct * PickedItem, *PickedList = NULL;
/*****************************************************************/
void LocateAndDeleteItem(WinEDA_SchematicFrame * frame, wxDC * DC)
bool LocateAndDeleteItem(WinEDA_SchematicFrame * frame, wxDC * DC)
/*****************************************************************/
/* Routine d'effacement d'un element de schema ( et placement en "undelete" )
si plusieurs elements sont superposes: ordre de priorite:
/* Locate and delete the item found under the mouse cousor
If more than one item found: the priority order is:
1 : MARQUEUR
2 : JUNCTION
2 : NOCONNECT
@ -267,11 +266,13 @@ void LocateAndDeleteItem(WinEDA_SchematicFrame * frame, wxDC * DC)
5 : TEXT
6 : COMPOSANT
7 : SHEET
*/
return TRUE if an item was deleted
*/
{
EDA_BaseStruct * DelStruct;
SCH_SCREEN * screen = frame->GetScreen();
bool item_deleted = FALSE;
DelStruct = PickStruct(screen->m_Curseur,
screen->EEDrawList, MARKERITEM);
@ -298,7 +299,10 @@ SCH_SCREEN * screen = frame->GetScreen();
DeleteStruct(frame->DrawPanel, DC, DelStruct);
frame->TestDanglingEnds(frame->m_CurrentScreen->EEDrawList, DC);
frame->GetScreen()->SetModify();
item_deleted = TRUE;
}
return item_deleted;
}

View File

@ -74,6 +74,7 @@ static bool s_ListWithSubCmponents;
static bool s_ListHierarchicalPinByName;
static bool s_ListBySheet;
static bool s_BrowsList;
static int s_OutputFormOpt;
static bool s_Add_F1_state;
static bool s_Add_F2_state;
static bool s_Add_F3_state;
@ -142,6 +143,7 @@ bool WinEDA_Build_BOM_Frame::Create( wxWindow* parent, wxWindowID id, const wxSt
m_ListCmpbyValItems = NULL;
m_GenListLabelsbyVal = NULL;
m_GenListLabelsbySheet = NULL;
m_OutputFormCtrl = NULL;
m_FieldsToAppendListSizer = NULL;
m_AddField1 = NULL;
m_AddField2 = NULL;
@ -155,7 +157,7 @@ bool WinEDA_Build_BOM_Frame::Create( wxWindow* parent, wxWindowID id, const wxSt
////@end WinEDA_Build_BOM_Frame member initialisation
////@begin WinEDA_Build_BOM_Frame creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
@ -177,7 +179,7 @@ void WinEDA_Build_BOM_Frame::CreateControls()
SetFont(*g_DialogFont);
////@begin WinEDA_Build_BOM_Frame content construction
// Generated by DialogBlocks, 07/08/2006 10:59:57 (unregistered)
// Generated by DialogBlocks, 09/05/2007 13:11:12 (unregistered)
WinEDA_Build_BOM_Frame* itemDialog1 = this;
@ -187,32 +189,42 @@ void WinEDA_Build_BOM_Frame::CreateControls()
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("List items : "));
wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL);
itemBoxSizer3->Add(itemStaticBoxSizer4, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW|wxALL, 5);
wxStaticBox* itemStaticBoxSizer5Static = new wxStaticBox(itemDialog1, wxID_ANY, _("List items : "));
wxStaticBoxSizer* itemStaticBoxSizer5 = new wxStaticBoxSizer(itemStaticBoxSizer5Static, wxVERTICAL);
itemBoxSizer4->Add(itemStaticBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_ListCmpbyRefItems = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Components by Reference"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_ListCmpbyRefItems->SetValue(true);
itemStaticBoxSizer4->Add(m_ListCmpbyRefItems, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer5->Add(m_ListCmpbyRefItems, 0, wxGROW|wxALL, 5);
m_ListSubCmpItems = new wxCheckBox( itemDialog1, ID_CHECKBOX2, _("Sub Components (i.e U2A, U2B..)"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_ListSubCmpItems->SetValue(false);
itemStaticBoxSizer4->Add(m_ListSubCmpItems, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer5->Add(m_ListSubCmpItems, 0, wxGROW|wxALL, 5);
m_ListCmpbyValItems = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Components by Value"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_ListCmpbyValItems->SetValue(true);
itemStaticBoxSizer4->Add(m_ListCmpbyValItems, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer5->Add(m_ListCmpbyValItems, 0, wxGROW|wxALL, 5);
m_GenListLabelsbyVal = new wxCheckBox( itemDialog1, ID_CHECKBOX3, _("Hierachy Pins by name"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_GenListLabelsbyVal->SetValue(false);
itemStaticBoxSizer4->Add(m_GenListLabelsbyVal, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer5->Add(m_GenListLabelsbyVal, 0, wxGROW|wxALL, 5);
m_GenListLabelsbySheet = new wxCheckBox( itemDialog1, ID_CHECKBOX4, _("Hierachy Pins by Sheets"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_GenListLabelsbySheet->SetValue(false);
itemStaticBoxSizer4->Add(m_GenListLabelsbySheet, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer5->Add(m_GenListLabelsbySheet, 0, wxGROW|wxALL, 5);
wxStaticBox* itemStaticBoxSizer10Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Fields to Add"));
m_FieldsToAppendListSizer = new wxStaticBoxSizer(itemStaticBoxSizer10Static, wxVERTICAL);
wxArrayString m_OutputFormCtrlStrings;
m_OutputFormCtrlStrings.Add(_("Print as list"));
m_OutputFormCtrlStrings.Add(_("Print as text for spreadsheet import"));
m_OutputFormCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Ouput:"), wxDefaultPosition, wxDefaultSize, m_OutputFormCtrlStrings, 1, wxRA_SPECIFY_COLS );
m_OutputFormCtrl->SetSelection(0);
itemBoxSizer4->Add(m_OutputFormCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticBox* itemStaticBoxSizer12Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Fields to Add"));
m_FieldsToAppendListSizer = new wxStaticBoxSizer(itemStaticBoxSizer12Static, wxVERTICAL);
itemBoxSizer3->Add(m_FieldsToAppendListSizer, 0, wxGROW|wxALL, 5);
m_AddField1 = new wxCheckBox( itemDialog1, ID_CHECKBOX_FIELD1, _("Add Field 1"), wxDefaultPosition, wxDefaultSize, 0 );
@ -247,25 +259,25 @@ void WinEDA_Build_BOM_Frame::CreateControls()
m_AddField8->SetValue(false);
m_FieldsToAppendListSizer->Add(m_AddField8, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer19, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer21 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer21, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton20 = new wxButton( itemDialog1, wxID_OK, _("&Create List"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton20->SetDefault();
itemButton20->SetForegroundColour(wxColour(166, 0, 0));
itemBoxSizer19->Add(itemButton20, 0, wxGROW|wxALL, 5);
wxButton* itemButton22 = new wxButton( itemDialog1, wxID_OK, _("&Create List"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton22->SetDefault();
itemButton22->SetForegroundColour(wxColour(166, 0, 0));
itemBoxSizer21->Add(itemButton22, 0, wxGROW|wxALL, 5);
wxButton* itemButton21 = new wxButton( itemDialog1, wxID_EXIT, _("&Quit"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton21->SetForegroundColour(wxColour(0, 0, 210));
itemBoxSizer19->Add(itemButton21, 0, wxGROW|wxALL, 5);
wxButton* itemButton23 = new wxButton( itemDialog1, wxID_EXIT, _("&Quit"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton23->SetForegroundColour(wxColour(0, 0, 210));
itemBoxSizer21->Add(itemButton23, 0, wxGROW|wxALL, 5);
wxStaticBox* itemStaticBoxSizer22Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Options"));
wxStaticBoxSizer* itemStaticBoxSizer22 = new wxStaticBoxSizer(itemStaticBoxSizer22Static, wxHORIZONTAL);
itemBoxSizer2->Add(itemStaticBoxSizer22, 0, wxGROW|wxALL, 10);
wxStaticBox* itemStaticBoxSizer24Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Options"));
wxStaticBoxSizer* itemStaticBoxSizer24 = new wxStaticBoxSizer(itemStaticBoxSizer24Static, wxHORIZONTAL);
itemBoxSizer2->Add(itemStaticBoxSizer24, 0, wxGROW|wxALL, 10);
m_GetListBrowser = new wxCheckBox( itemDialog1, ID_CHECKBOX5, _("Launch list browser"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_GetListBrowser->SetValue(false);
itemStaticBoxSizer22->Add(m_GetListBrowser, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemStaticBoxSizer24->Add(m_GetListBrowser, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
// Set validators
m_ListCmpbyRefItems->SetValidator( wxGenericValidator(& s_ListByRef) );
@ -273,6 +285,7 @@ void WinEDA_Build_BOM_Frame::CreateControls()
m_ListCmpbyValItems->SetValidator( wxGenericValidator(& s_ListByValue) );
m_GenListLabelsbyVal->SetValidator( wxGenericValidator(& s_ListHierarchicalPinByName) );
m_GenListLabelsbySheet->SetValidator( wxGenericValidator(& s_ListBySheet) );
m_OutputFormCtrl->SetValidator( wxGenericValidator(& s_OutputFormOpt) );
m_AddField1->SetValidator( wxGenericValidator(& s_Add_F1_state) );
m_AddField2->SetValidator( wxGenericValidator(& s_Add_F2_state) );
m_AddField3->SetValidator( wxGenericValidator(& s_Add_F3_state) );
@ -326,10 +339,7 @@ wxIcon WinEDA_Build_BOM_Frame::GetIconResource( const wxString& name )
void WinEDA_Build_BOM_Frame::OnOkClick( wxCommandEvent& event )
{
GenList();
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_Build_BOM_Frame.
// Before editing this code, remove the block markers.
event.Skip();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in WinEDA_Build_BOM_Frame.
}
@ -347,6 +357,7 @@ void WinEDA_Build_BOM_Frame::OnExitClick( wxCommandEvent& event )
s_Add_F6_state = m_AddField6->GetValue();
s_Add_F7_state = m_AddField7->GetValue();
s_Add_F8_state = m_AddField8->GetValue();
s_OutputFormOpt = m_OutputFormCtrl->GetSelection();
EndModal(0);
}
@ -363,6 +374,7 @@ wxString mask, filename;
s_ListHierarchicalPinByName = m_GenListLabelsbyVal->GetValue();
s_ListBySheet = m_GenListLabelsbySheet->GetValue();
s_BrowsList = m_GetListBrowser->GetValue();
s_OutputFormOpt = m_OutputFormCtrl->GetSelection();
m_ListFileName = ScreenSch->m_FileName;
ChangeFileNameExt(m_ListFileName, EXT_LIST);
@ -380,8 +392,10 @@ wxString mask, filename;
if ( filename.IsEmpty() ) return;
else m_ListFileName = filename;
/* Close dialog and show le list, if wanted */
GenereListeOfItems(m_ListFileName);
/* Close dialog and show the list, if wanted */
if ( s_OutputFormOpt == 0) GenereListeOfItems(m_ListFileName);
else CreateExportList(m_ListFileName);
Close();
if ( s_BrowsList )
@ -392,6 +406,58 @@ wxString mask, filename;
}
}
/****************************************************************************/
void WinEDA_Build_BOM_Frame::CreateExportList(const wxString & FullFileName)
/****************************************************************************/
/*
Print a list of components, in a form which can be imported by a spreadsheet
form is;
cmp name;cmp val; fields;
*/
{
FILE *f;
EDA_BaseStruct ** List;
int NbItems;
wxString msg;
/* Creation de la liste des elements */
if ((f = wxFopen(FullFileName, wxT("wt"))) == NULL)
{
msg = _("Failed to open file "); msg << FullFileName;
DisplayError(this, msg);
return;
}
NbItems = GenListeCmp(NULL );
if ( NbItems )
{
List = (EDA_BaseStruct **)
MyZMalloc( NbItems * sizeof(EDA_BaseStruct **) );
if (List == NULL )
{
fclose(f); return;
}
GenListeCmp(List);
/* sort component list */
qsort( List, NbItems, sizeof( EDA_BaseStruct * ),
(int(*)(const void*, const void*))ListTriComposantByRef);
if( ! s_ListWithSubCmponents ) DeleteSubCmp(List, NbItems);
/* create the file */
PrintListeCmpByRef(f, List, NbItems, TRUE);
MyFree( List );
}
fclose(f);
}
/****************************************************************************/
void WinEDA_Build_BOM_Frame::GenereListeOfItems(const wxString & FullFileName)
/****************************************************************************/
@ -776,7 +842,8 @@ const wxString * OldName = NULL;
/*******************************************************************************************/
void WinEDA_Build_BOM_Frame::PrintFieldData(FILE * f, EDA_SchComponentStruct * DrawLibItem)
void WinEDA_Build_BOM_Frame::PrintFieldData(FILE * f, EDA_SchComponentStruct * DrawLibItem,
bool CompactForm)
/*******************************************************************************************/
{
wxCheckBox * FieldListCtrl[FIELD8-FIELD1+1] = {
@ -787,22 +854,29 @@ wxCheckBox * FieldListCtrl[FIELD8-FIELD1+1] = {
m_AddField5,
m_AddField6,
m_AddField7,
m_AddField8
};
m_AddField8
};
int ii;
wxCheckBox * FieldCtrl = FieldListCtrl[0];
if ( CompactForm )
{
fprintf(f, ";%s", CONV_TO_UTF8(DrawLibItem->m_Field[FOOTPRINT].m_Text));
}
for ( ii = FIELD1; ii <= FIELD8; ii ++ )
{
FieldCtrl = FieldListCtrl[ii-FIELD1];
if ( FieldCtrl == NULL ) continue;
if ( ! FieldCtrl->IsChecked() ) continue;
fprintf(f, "; %-12s", CONV_TO_UTF8(DrawLibItem->m_Field[ii].m_Text));
if ( CompactForm ) fprintf(f, ";%s", CONV_TO_UTF8(DrawLibItem->m_Field[ii].m_Text));
else fprintf(f, "; %-12s", CONV_TO_UTF8(DrawLibItem->m_Field[ii].m_Text));
}
}
/*********************************************************************************************/
int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE * f, EDA_BaseStruct ** List, int NbItems )
int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE * f, EDA_BaseStruct ** List, int NbItems,
bool CompactForm )
/*********************************************************************************************/
/* Print the B.O.M sorted by reference
*/
@ -814,9 +888,35 @@ EDA_LibComponentStruct *Entry;
char NameCmp[80];
wxString msg;
msg = _("\n#Cmp ( order = Reference )");
if ( s_ListWithSubCmponents ) msg << _(" (with SubCmp)");
fprintf( f, "%s\n", CONV_TO_UTF8(msg));
if ( CompactForm )
{
fprintf(f, "ref;value;sheet number;sheet name;footprint" );
wxCheckBox * FieldListCtrl[FIELD8-FIELD1+1] = {
m_AddField1,
m_AddField2,
m_AddField3,
m_AddField4,
m_AddField5,
m_AddField6,
m_AddField7,
m_AddField8
};
for ( ii = FIELD1; ii <= FIELD8; ii ++ )
{
wxCheckBox * FieldCtrl = FieldListCtrl[ii-FIELD1];
if ( FieldCtrl == NULL ) continue;
if ( ! FieldCtrl->IsChecked() ) continue;
msg = _("Field");
fprintf(f, ";%s%d", CONV_TO_UTF8(msg), ii - FIELD1 + 1);
}
fprintf( f, "\n");
}
else {
msg = _("\n#Cmp ( order = Reference )");
if ( s_ListWithSubCmponents ) msg << _(" (with SubCmp)");
fprintf( f, "%s\n", CONV_TO_UTF8(msg));
}
for ( ii = 0; ii < NbItems; ii++ )
{
@ -834,29 +934,37 @@ wxString msg;
if( (Multi > 1 ) && s_ListWithSubCmponents )
Unit = DrawLibItem->m_Multi + 'A' - 1;
sprintf( NameCmp,"%s%c", CONV_TO_UTF8(DrawLibItem->m_Field[REFERENCE].m_Text),
Unit);
fprintf(f, "| %-10s %-12s",
NameCmp,
sprintf( NameCmp,"%s", CONV_TO_UTF8(DrawLibItem->m_Field[REFERENCE].m_Text) );
if ( ! CompactForm || Unit != ' ' ) sprintf( NameCmp+strlen(NameCmp),"%c", Unit);
if ( CompactForm ) fprintf(f, "%s;%s", NameCmp,
CONV_TO_UTF8(DrawLibItem->m_Field[VALUE].m_Text));
else fprintf(f, "| %-10s %-12s", NameCmp,
CONV_TO_UTF8(DrawLibItem->m_Field[VALUE].m_Text));
if ( s_ListWithSubCmponents )
{
BASE_SCREEN * screen = (BASE_SCREEN *)(DrawLibItem->m_Parent);
DrawSheetStruct * sheet = (DrawSheetStruct *)(DrawLibItem->m_Parent);
wxString sheetname;
if( screen->m_Parent )
sheetname = ((DrawSheetStruct*)screen->m_Parent)->m_SheetName.GetData();
if( sheet && sheet->m_StructType == DRAW_SHEET_STRUCT_TYPE )
sheetname = sheet->m_SheetName;
else sheetname = _("Root");
fprintf(f, " (Sheet %.2d: \"%s\")", DrawLibItem->m_FlagControlMulti,
if ( CompactForm )
fprintf(f, ";%d;%s", DrawLibItem->m_FlagControlMulti,
CONV_TO_UTF8(sheetname));
else fprintf(f, " (Sheet %.2d: \"%s\")", DrawLibItem->m_FlagControlMulti,
CONV_TO_UTF8(sheetname));
}
PrintFieldData(f, DrawLibItem);
PrintFieldData(f, DrawLibItem, CompactForm);
fprintf(f,"\n");
}
msg = _("#End Cmp\n");
fprintf(f, CONV_TO_UTF8(msg));
if ( ! CompactForm )
{
msg = _("#End Cmp\n");
fprintf(f, CONV_TO_UTF8(msg));
}
return(0);
}

View File

@ -39,16 +39,12 @@
////@begin control identifiers
#define ID_DIALOG 10000
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxSTAY_ON_TOP|wxCLOSE_BOX
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_TITLE _("List of Material")
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_POSITION wxDefaultPosition
#define ID_CHECKBOX 10001
#define ID_CHECKBOX2 10004
#define ID_CHECKBOX1 10003
#define ID_CHECKBOX3 10005
#define ID_CHECKBOX4 10006
#define ID_RADIOBOX1 10009
#define ID_CHECKBOX_FIELD1 10007
#define ID_CHECKBOX_FIELD2 10008
#define ID_CHECKBOX_FIELD4 10010
@ -57,6 +53,11 @@
#define ID_CHECKBOX_FIELD7 10013
#define ID_CHECKBOX_FIELD8 10014
#define ID_CHECKBOX5 10002
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxSTAY_ON_TOP|wxCLOSE_BOX
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_TITLE _("List of Material")
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
@ -119,9 +120,10 @@ public:
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_Build_BOM_Frame member function declarations
void GenereListeOfItems(const wxString & FullFileName);
int PrintListeCmpByRef( FILE * f, EDA_BaseStruct ** List, int NbItems );
void CreateExportList(const wxString & FullFileName);
int PrintListeCmpByRef( FILE * f, EDA_BaseStruct ** List, int NbItems, bool CompactForm = FALSE );
int PrintListeCmpByVal( FILE *f, EDA_BaseStruct **List, int NbItems);
void PrintFieldData(FILE * f, EDA_SchComponentStruct * DrawLibItem);
void PrintFieldData(FILE * f, EDA_SchComponentStruct * DrawLibItem, bool CompactForm = FALSE);
/// Should we show tooltips?
@ -133,6 +135,7 @@ public:
wxCheckBox* m_ListCmpbyValItems;
wxCheckBox* m_GenListLabelsbyVal;
wxCheckBox* m_GenListLabelsbySheet;
wxRadioBox* m_OutputFormCtrl;
wxStaticBoxSizer* m_FieldsToAppendListSizer;
wxCheckBox* m_AddField1;
wxCheckBox* m_AddField2;

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="windows-1252"?>
<?xml version="1.0" encoding="UTF-8"?>
<anthemion-project version="1.0.0.0" xmlns="http://www.anthemion.co.uk">
<header>
<long name="name_counter">0</long>
@ -6,7 +6,6 @@
<string name="title">""</string>
<string name="author">""</string>
<string name="description">""</string>
<long name="doc_count">31</long>
<string name="xrc_filename">""</string>
<bool name="convert_images_to_xpm">0</bool>
<bool name="inline_images">0</bool>
@ -18,6 +17,7 @@
<string name="copyright_string">"GNU license"</string>
<string name="resource_prefix">""</string>
<bool name="use_two_step_construction">0</bool>
<bool name="use_enums">0</bool>
<string name="current_platform">"&lt;All platforms&gt;"</string>
<string name="target_wx_version">"&lt;Any&gt;"</string>
<string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
@ -43,11 +43,6 @@
// Licence:
/////////////////////////////////////////////////////////////////////////////
"</string>
<string name="cpp_function_comment">"/*!
* %BODY%
*/
"</string>
<string name="cpp_symbols_file_comment">"/////////////////////////////////////////////////////////////////////////////
// Name: %SYMBOLS-FILENAME%
@ -81,6 +76,14 @@
#include &quot;wx/wx.h&quot;
#endif
"</string>
<string name="cpp_function_declaration_comment">" /// %BODY%
"</string>
<string name="cpp_function_implementation_comment">"
/*!
* %BODY%
*/
"</string>
<string name="resource_file_header">"app_resources.h"</string>
<string name="resource_file_implementation">"app_resources.cpp"</string>
@ -92,17 +95,20 @@
<string name="external_symbol_filenames">""</string>
<string name="configuration">"&lt;None&gt;"</string>
<string name="source_encoding">"&lt;System&gt;"</string>
<string name="xrc_encoding">"utf-8"</string>
<string name="project_encoding">"&lt;System&gt;"</string>
<string name="resource_archive">""</string>
<long name="text_file_type">0</long>
<bool name="use_tabs">0</bool>
<long name="indent_size">4</long>
<string name="whitespace_after_return_type">" "</string>
<string name="resource_xrc_cpp">""</string>
<bool name="use_resource_archive">0</bool>
<bool name="use_generated_xrc_cpp">0</bool>
<bool name="always_generate_xrc">1</bool>
<bool name="archive_xrc_files">1</bool>
<bool name="archive_image_files">1</bool>
<bool name="archive_all_image_files">0</bool>
<bool name="xrc_retain_relative_paths">1</bool>
</header>
<data>
@ -237,7 +243,7 @@
<long name="is-transient">1</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<long name="locked">1</long>
<document>
<string name="title">"Windows"</string>
<string name="type">"html-document"</string>
@ -261,6 +267,8 @@
<long name="base-id">10000</long>
<bool name="use-id-prefix">0</bool>
<string name="id-prefix">""</string>
<bool name="use-id-suffix">0</bool>
<string name="id-suffix">""</string>
<long name="use-xrc">0</long>
<string name="event-handler-0">"wxEVT_CLOSE_WINDOW|OnCloseWindow"</string>
<string name="proxy-Id name">"ID_DIALOG"</string>
@ -315,6 +323,7 @@
<long name="proxy-Y">-1</long>
<long name="proxy-Width">400</long>
<long name="proxy-Height">300</long>
<bool name="proxy-AUI manager">0</bool>
<string name="proxy-Event sources">""</string>
<document>
<string name="title">"wxBoxSizer V"</string>
@ -359,7 +368,7 @@
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxStaticBoxSizer V"</string>
<string name="title">"wxBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sizer"</string>
@ -367,16 +376,8 @@
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"15/4/2006"</string>
<string name="proxy-type">"wbStaticBoxSizerProxy"</string>
<string name="proxy-Id name">"wxID_ANY"</string>
<long name="proxy-Id value">-1</long>
<string name="proxy-Label">"List items : "</string>
<string name="proxy-Sizer member variable name">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="created">"9/5/2007"</string>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
@ -392,46 +393,29 @@
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX"</string>
<string name="title">"wxStaticBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"15/4/2006"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX"</string>
<long name="proxy-Id value">10001</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Member variable name">"m_ListCmpbyRefItems"</string>
<string name="proxy-Label">"Components by Reference"</string>
<bool name="proxy-Initial value">1</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_ListByRef"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="created">"9/5/2007"</string>
<string name="proxy-type">"wbStaticBoxSizerProxy"</string>
<string name="proxy-Id name">"wxID_ANY"</string>
<long name="proxy-Id value">-1</long>
<string name="proxy-Label">"List items : "</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Sizer member variable name">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<string name="proxy-Static box class">"wxStaticBox"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Expand"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
@ -441,40 +425,334 @@
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"9/5/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX"</string>
<long name="proxy-Id value">10001</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_ListCmpbyRefItems"</string>
<string name="proxy-Label">"Components by Reference"</string>
<bool name="proxy-Initial value">1</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_ListByRef"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX2"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"9/5/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX2"</string>
<long name="proxy-Id value">10004</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_ListSubCmpItems"</string>
<string name="proxy-Label">"Sub Components (i.e U2A, U2B..)"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_ListWithSubCmponents"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX1"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"9/5/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX1"</string>
<long name="proxy-Id value">10003</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_ListCmpbyValItems"</string>
<string name="proxy-Label">"Components by Value"</string>
<bool name="proxy-Initial value">1</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_ListByValue"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX3"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"9/5/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX3"</string>
<long name="proxy-Id value">10005</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_GenListLabelsbyVal"</string>
<string name="proxy-Label">"Hierachy Pins by name"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_ListHierarchicalPinByName"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX4"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"9/5/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX4"</string>
<long name="proxy-Id value">10006</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_GenListLabelsbySheet"</string>
<string name="proxy-Label">"Hierachy Pins by Sheets"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_ListBySheet"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX2"</string>
<string name="title">"wxRadioBox: ID_RADIOBOX1"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<string name="icon-name">"radiobox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"7/8/2006"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX2"</string>
<long name="proxy-Id value">10004</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Member variable name">"m_ListSubCmpItems"</string>
<string name="proxy-Label">"Sub Components (i.e U2A, U2B..)"</string>
<bool name="proxy-Initial value">0</bool>
<string name="created">"9/5/2007"</string>
<string name="proxy-type">"wbRadioBoxProxy"</string>
<string name="proxy-Id name">"ID_RADIOBOX1"</string>
<long name="proxy-Id value">10009</long>
<string name="proxy-Class">"wxRadioBox"</string>
<string name="proxy-Base class">"wxRadioBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_OutputFormCtrl"</string>
<string name="proxy-Label">"Ouput:"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Items">"Print as list|Print as text for spreadsheet import"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_ListWithSubCmponents"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<string name="proxy-Data variable">"s_OutputFormOpt"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<bool name="proxy-wxRA_SPECIFY_ROWS">0</bool>
<bool name="proxy-wxRA_SPECIFY_COLS">1</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
@ -483,166 +761,7 @@
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX1"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"15/4/2006"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX1"</string>
<long name="proxy-Id value">10003</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Member variable name">"m_ListCmpbyValItems"</string>
<string name="proxy-Label">"Components by Value"</string>
<bool name="proxy-Initial value">1</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_ListByValue"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX3"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"15/4/2006"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX3"</string>
<long name="proxy-Id value">10005</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Member variable name">"m_GenListLabelsbyVal"</string>
<string name="proxy-Label">"Hierachy Pins by name"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_ListHierarchicalPinByName"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX4"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"15/4/2006"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX4"</string>
<long name="proxy-Id value">10006</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Member variable name">"m_GenListLabelsbySheet"</string>
<string name="proxy-Label">"Hierachy Pins by Sheets"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"s_ListBySheet"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
@ -671,13 +790,14 @@
<string name="proxy-Id name">"wxID_ANY"</string>
<string name="proxy-Id value">"-1"</string>
<string name="proxy-Label">"Fields to Add"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Sizer member variable name">"m_FieldsToAppendListSizer"</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Static box class">"wxStaticBox"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Expand"</string>
<long name="proxy-Stretch factor">0</long>
@ -704,6 +824,11 @@
<string name="proxy-Id name">"ID_CHECKBOX_FIELD1"</string>
<long name="proxy-Id value">10007</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_AddField1"</string>
<string name="proxy-Label">"Add Field 1"</string>
<bool name="proxy-Initial value">0</bool>
@ -757,6 +882,11 @@
<string name="proxy-Id name">"ID_CHECKBOX_FIELD2"</string>
<long name="proxy-Id value">10008</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_AddField2"</string>
<string name="proxy-Label">"Add Field 2"</string>
<bool name="proxy-Initial value">0</bool>
@ -810,6 +940,11 @@
<string name="proxy-Id name">"ID_CHECKBOX_FIELD1"</string>
<long name="proxy-Id value">10007</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_AddField3"</string>
<string name="proxy-Label">"Add Field 3"</string>
<bool name="proxy-Initial value">0</bool>
@ -863,6 +998,11 @@
<string name="proxy-Id name">"ID_CHECKBOX_FIELD4"</string>
<long name="proxy-Id value">10010</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_AddField4"</string>
<string name="proxy-Label">"Add Field 4"</string>
<bool name="proxy-Initial value">0</bool>
@ -916,6 +1056,11 @@
<string name="proxy-Id name">"ID_CHECKBOX_FIELD5"</string>
<long name="proxy-Id value">10011</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_AddField5"</string>
<string name="proxy-Label">"Add Field 5"</string>
<bool name="proxy-Initial value">0</bool>
@ -969,6 +1114,11 @@
<string name="proxy-Id name">"ID_CHECKBOX_FIELD6"</string>
<long name="proxy-Id value">10012</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_AddField6"</string>
<string name="proxy-Label">"Add Field 6"</string>
<bool name="proxy-Initial value">0</bool>
@ -1022,6 +1172,11 @@
<string name="proxy-Id name">"ID_CHECKBOX_FIELD7"</string>
<long name="proxy-Id value">10013</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_AddField7"</string>
<string name="proxy-Label">"Add Field 7"</string>
<bool name="proxy-Initial value">0</bool>
@ -1075,6 +1230,11 @@
<string name="proxy-Id name">"ID_CHECKBOX_FIELD8"</string>
<long name="proxy-Id value">10014</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_AddField8"</string>
<string name="proxy-Label">"Add Field 8"</string>
<bool name="proxy-Initial value">0</bool>
@ -1155,6 +1315,11 @@
<string name="proxy-Id name">"wxID_OK"</string>
<long name="proxy-Id value">5100</long>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Base class">"wxButton"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"&amp;Create List"</string>
<bool name="proxy-Default">1</bool>
@ -1209,6 +1374,11 @@
<string name="proxy-Id name">"wxID_EXIT"</string>
<long name="proxy-Id value">5006</long>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Base class">"wxButton"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"&amp;Quit"</string>
<bool name="proxy-Default">0</bool>
@ -1264,13 +1434,14 @@
<string name="proxy-Id name">"wxID_ANY"</string>
<string name="proxy-Id value">"-1"</string>
<string name="proxy-Label">"Options"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Sizer member variable name">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Static box class">"wxStaticBox"</string>
<string name="proxy-Orientation">"Horizontal"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
@ -1297,6 +1468,11 @@
<string name="proxy-Id name">"ID_CHECKBOX5"</string>
<long name="proxy-Id value">10002</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Base class">"wxCheckBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_GetListBrowser"</string>
<string name="proxy-Label">"Launch list browser"</string>
<bool name="proxy-Initial value">0</bool>

View File

@ -1,233 +1,249 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_cmp_graphic_properties.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 12/02/2006 11:38:02
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 12/02/2006 11:38:02
////@begin includes
////@end includes
#include "dialog_cmp_graphic_properties.h"
////@begin XPM images
////@end XPM images
/*!
* WinEDA_bodygraphics_PropertiesFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WinEDA_bodygraphics_PropertiesFrame, wxDialog )
/*!
* WinEDA_bodygraphics_PropertiesFrame event table definition
*/
BEGIN_EVENT_TABLE( WinEDA_bodygraphics_PropertiesFrame, wxDialog )
////@begin WinEDA_bodygraphics_PropertiesFrame event table entries
EVT_BUTTON( wxID_OK, WinEDA_bodygraphics_PropertiesFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_bodygraphics_PropertiesFrame::OnCancelClick )
////@end WinEDA_bodygraphics_PropertiesFrame event table entries
END_EVENT_TABLE()
/*!
* WinEDA_bodygraphics_PropertiesFrame constructors
*/
WinEDA_bodygraphics_PropertiesFrame::WinEDA_bodygraphics_PropertiesFrame( )
{
}
WinEDA_bodygraphics_PropertiesFrame::WinEDA_bodygraphics_PropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
LibEDA_BaseStruct * CurrentItem = CurrentDrawItem;
m_Parent = parent;
Create(parent, id, caption, pos, size, style);
/* Set the dialog items: */
if ( CurrentItem )
{
if ( CurrentItem->m_Unit == 0 ) m_CommonUnit->SetValue(TRUE);
}
else if ( ! g_FlDrawSpecificUnit ) m_CommonUnit->SetValue(TRUE);
if ( CurrentItem )
{
if ( CurrentItem->m_Convert == 0 ) m_CommonConvert->SetValue(TRUE);
}
else if ( !g_FlDrawSpecificConvert ) m_CommonConvert->SetValue(TRUE);
bool show_fill_option = FALSE;
int fill_option = 0;
if( CurrentItem )
switch(CurrentItem->m_StructType)
{
case COMPONENT_ARC_DRAW_TYPE:
show_fill_option = TRUE;
fill_option = ((LibDrawArc*)CurrentItem)->m_Fill;
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
show_fill_option = TRUE;
fill_option = ((LibDrawCircle*)CurrentItem)->m_Fill;
break;
case COMPONENT_RECT_DRAW_TYPE:
show_fill_option = TRUE;
fill_option = ((LibDrawSquare *)CurrentItem)->m_Fill;
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
show_fill_option = TRUE;
fill_option = ((LibDrawPolyline*)CurrentItem)->m_Fill;
break;
default: break;
}
if ( show_fill_option ) m_Filled->SetSelection(fill_option);
else m_Filled->Enable(false);
}
/*!
* WinEDA_bodygraphics_PropertiesFrame creator
*/
bool WinEDA_bodygraphics_PropertiesFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin WinEDA_bodygraphics_PropertiesFrame member initialisation
m_CommonUnit = NULL;
m_CommonConvert = NULL;
m_Filled = NULL;
////@end WinEDA_bodygraphics_PropertiesFrame member initialisation
////@begin WinEDA_bodygraphics_PropertiesFrame creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
Centre();
////@end WinEDA_bodygraphics_PropertiesFrame creation
return true;
}
/*!
* Control creation for WinEDA_bodygraphics_PropertiesFrame
*/
void WinEDA_bodygraphics_PropertiesFrame::CreateControls()
{
SetFont(*g_DialogFont);
////@begin WinEDA_bodygraphics_PropertiesFrame content construction
// Generated by DialogBlocks, 12/02/2006 11:50:42 (unregistered)
WinEDA_bodygraphics_PropertiesFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Options :"));
wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL);
itemBoxSizer2->Add(itemStaticBoxSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_CommonUnit = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Common to Units"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_CommonUnit->SetValue(false);
itemStaticBoxSizer3->Add(m_CommonUnit, 0, wxALIGN_LEFT|wxALL, 5);
m_CommonConvert = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Common to convert"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_CommonConvert->SetValue(false);
itemStaticBoxSizer3->Add(m_CommonConvert, 0, wxALIGN_LEFT|wxALL, 5);
wxString m_FilledStrings[] = {
_("Void"),
_("Filled"),
_("BgFilled")
};
m_Filled = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Fill:"), wxDefaultPosition, wxDefaultSize, 3, m_FilledStrings, 1, wxRA_SPECIFY_COLS );
itemStaticBoxSizer3->Add(m_Filled, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton8 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton8->SetForegroundColour(wxColour(206, 0, 0));
itemBoxSizer7->Add(itemButton8, 0, wxGROW|wxALL, 5);
wxButton* itemButton9 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton9->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer7->Add(itemButton9, 0, wxGROW|wxALL, 5);
////@end WinEDA_bodygraphics_PropertiesFrame content construction
}
/*!
* Should we show tooltips?
*/
bool WinEDA_bodygraphics_PropertiesFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_bodygraphics_PropertiesFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_bodygraphics_PropertiesFrame bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WinEDA_bodygraphics_PropertiesFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WinEDA_bodygraphics_PropertiesFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_bodygraphics_PropertiesFrame icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WinEDA_bodygraphics_PropertiesFrame icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/
void WinEDA_bodygraphics_PropertiesFrame::OnOkClick( wxCommandEvent& event )
{
bodygraphics_PropertiesAccept(event);
Close();
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/
void WinEDA_bodygraphics_PropertiesFrame::OnCancelClick( wxCommandEvent& event )
{
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_bodygraphics_PropertiesFrame.
// Before editing this code, remove the block markers.
event.Skip();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_bodygraphics_PropertiesFrame.
}
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_cmp_graphic_properties.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 12/02/2006 11:38:02
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 12/02/2006 11:38:02
////@begin includes
////@end includes
#include "dialog_cmp_graphic_properties.h"
////@begin XPM images
////@end XPM images
/*!
* WinEDA_bodygraphics_PropertiesFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WinEDA_bodygraphics_PropertiesFrame, wxDialog )
/*!
* WinEDA_bodygraphics_PropertiesFrame event table definition
*/
BEGIN_EVENT_TABLE( WinEDA_bodygraphics_PropertiesFrame, wxDialog )
////@begin WinEDA_bodygraphics_PropertiesFrame event table entries
EVT_BUTTON( wxID_OK, WinEDA_bodygraphics_PropertiesFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_bodygraphics_PropertiesFrame::OnCancelClick )
////@end WinEDA_bodygraphics_PropertiesFrame event table entries
END_EVENT_TABLE()
/*!
* WinEDA_bodygraphics_PropertiesFrame constructors
*/
WinEDA_bodygraphics_PropertiesFrame::WinEDA_bodygraphics_PropertiesFrame( )
{
}
WinEDA_bodygraphics_PropertiesFrame::WinEDA_bodygraphics_PropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
LibEDA_BaseStruct * CurrentItem = CurrentDrawItem;
m_Parent = parent;
Create(parent, id, caption, pos, size, style);
/* Set the dialog items: */
if ( CurrentItem )
{
if ( CurrentItem->m_Unit == 0 ) m_CommonUnit->SetValue(TRUE);
}
else if ( ! g_FlDrawSpecificUnit ) m_CommonUnit->SetValue(TRUE);
if ( CurrentItem )
{
if ( CurrentItem->m_Convert == 0 ) m_CommonConvert->SetValue(TRUE);
}
else if ( !g_FlDrawSpecificConvert ) m_CommonConvert->SetValue(TRUE);
bool show_fill_option = FALSE;
int fill_option = 0;
if( CurrentItem )
switch(CurrentItem->m_StructType)
{
case COMPONENT_ARC_DRAW_TYPE:
show_fill_option = TRUE;
fill_option = ((LibDrawArc*)CurrentItem)->m_Fill;
m_GraphicShapeWidthCtrl->SetValue(((LibDrawArc*)CurrentItem)->m_Width);
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
show_fill_option = TRUE;
fill_option = ((LibDrawCircle*)CurrentItem)->m_Fill;
m_GraphicShapeWidthCtrl->SetValue(((LibDrawCircle*)CurrentItem)->m_Width);
break;
case COMPONENT_RECT_DRAW_TYPE:
show_fill_option = TRUE;
fill_option = ((LibDrawSquare *)CurrentItem)->m_Fill;
m_GraphicShapeWidthCtrl->SetValue(((LibDrawSquare*)CurrentItem)->m_Width);
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
show_fill_option = TRUE;
fill_option = ((LibDrawPolyline*)CurrentItem)->m_Fill;
m_GraphicShapeWidthCtrl->SetValue(((LibDrawPolyline*)CurrentItem)->m_Width);
break;
default: break;
}
if ( show_fill_option ) m_Filled->SetSelection(fill_option);
else m_Filled->Enable(false);
}
/*!
* WinEDA_bodygraphics_PropertiesFrame creator
*/
bool WinEDA_bodygraphics_PropertiesFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin WinEDA_bodygraphics_PropertiesFrame member initialisation
m_CommonUnit = NULL;
m_CommonConvert = NULL;
m_ShapeWidthBoxSizer = NULL;
m_Filled = NULL;
////@end WinEDA_bodygraphics_PropertiesFrame member initialisation
////@begin WinEDA_bodygraphics_PropertiesFrame creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end WinEDA_bodygraphics_PropertiesFrame creation
return true;
}
/*!
* Control creation for WinEDA_bodygraphics_PropertiesFrame
*/
void WinEDA_bodygraphics_PropertiesFrame::CreateControls()
{
SetFont(*g_DialogFont);
////@begin WinEDA_bodygraphics_PropertiesFrame content construction
// Generated by DialogBlocks, 21/01/2007 16:28:34 (unregistered)
WinEDA_bodygraphics_PropertiesFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Options :"));
wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL);
itemBoxSizer2->Add(itemStaticBoxSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_CommonUnit = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Common to Units"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_CommonUnit->SetValue(false);
itemStaticBoxSizer3->Add(m_CommonUnit, 0, wxALIGN_LEFT|wxALL, 5);
m_CommonConvert = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Common to convert"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_CommonConvert->SetValue(false);
itemStaticBoxSizer3->Add(m_CommonConvert, 0, wxALIGN_LEFT|wxALL, 5);
m_ShapeWidthBoxSizer = new wxBoxSizer(wxVERTICAL);
itemStaticBoxSizer3->Add(m_ShapeWidthBoxSizer, 0, wxGROW|wxTOP|wxBOTTOM, 5);
wxString m_FilledStrings[] = {
_("Void"),
_("Filled"),
_("BgFilled")
};
m_Filled = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Fill:"), wxDefaultPosition, wxDefaultSize, 3, m_FilledStrings, 1, wxRA_SPECIFY_COLS );
m_Filled->SetSelection(0);
itemStaticBoxSizer3->Add(m_Filled, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton9 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton9->SetForegroundColour(wxColour(206, 0, 0));
itemBoxSizer8->Add(itemButton9, 0, wxGROW|wxALL, 5);
wxButton* itemButton10 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton10->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer8->Add(itemButton10, 0, wxGROW|wxALL, 5);
////@end WinEDA_bodygraphics_PropertiesFrame content construction
m_GraphicShapeWidthCtrl = new WinEDA_ValueCtrl(this, _("Width"), 0,
g_UnitMetric,m_ShapeWidthBoxSizer, EESCHEMA_INTERNAL_UNIT);
}
/*!
* Should we show tooltips?
*/
bool WinEDA_bodygraphics_PropertiesFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_bodygraphics_PropertiesFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_bodygraphics_PropertiesFrame bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WinEDA_bodygraphics_PropertiesFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WinEDA_bodygraphics_PropertiesFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_bodygraphics_PropertiesFrame icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WinEDA_bodygraphics_PropertiesFrame icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
*/
void WinEDA_bodygraphics_PropertiesFrame::OnOkClick( wxCommandEvent& event )
{
bodygraphics_PropertiesAccept(event);
Close();
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/
void WinEDA_bodygraphics_PropertiesFrame::OnCancelClick( wxCommandEvent& event )
{
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_bodygraphics_PropertiesFrame.
// Before editing this code, remove the block markers.
event.Skip();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_bodygraphics_PropertiesFrame.
}

View File

@ -1,83 +1,84 @@
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_cmp_graphic_properties.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 12/02/2006 11:38:02
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 12/02/2006 11:38:02
#ifndef _DIALOG_CMP_GRAPHIC_PROPERTIES_H_
#define _DIALOG_CMP_GRAPHIC_PROPERTIES_H_
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_cmp_graphic_properties.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 12/02/2006 11:38:02
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 12/02/2006 11:38:02
#ifndef _DIALOG_CMP_GRAPHIC_PROPERTIES_H_
#define _DIALOG_CMP_GRAPHIC_PROPERTIES_H_
/*!
* Includes
*/
////@begin includes
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxBoxSizer;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define ID_CHECKBOX 10001
#define ID_CHECKBOX1 10002
#define ID_RADIOBOX 10003
#define SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_TITLE _("Graphic shape properties")
#define SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_POSITION wxDefaultPosition
#define ID_CHECKBOX 10001
#define ID_CHECKBOX1 10002
#define ID_RADIOBOX 10003
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_bodygraphics_PropertiesFrame class declaration
*/
class WinEDA_bodygraphics_PropertiesFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_bodygraphics_PropertiesFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_bodygraphics_PropertiesFrame( );
WinEDA_bodygraphics_PropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_STYLE );
/// Creation
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_bodygraphics_PropertiesFrame class declaration
*/
class WinEDA_bodygraphics_PropertiesFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_bodygraphics_PropertiesFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_bodygraphics_PropertiesFrame( );
WinEDA_bodygraphics_PropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_IDNAME,
const wxString& caption = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_TITLE,
const wxPoint& pos = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_POSITION,
const wxSize& size = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_SIZE,
long style = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_bodygraphics_PropertiesFrame event handler declarations
long style = SYMBOL_WINEDA_BODYGRAPHICS_PROPERTIESFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_bodygraphics_PropertiesFrame event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event );
@ -85,28 +86,30 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
////@end WinEDA_bodygraphics_PropertiesFrame event handler declarations
////@begin WinEDA_bodygraphics_PropertiesFrame member function declarations
////@end WinEDA_bodygraphics_PropertiesFrame event handler declarations
////@begin WinEDA_bodygraphics_PropertiesFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_bodygraphics_PropertiesFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void bodygraphics_PropertiesAccept(wxCommandEvent& event);
////@begin WinEDA_bodygraphics_PropertiesFrame member variables
////@end WinEDA_bodygraphics_PropertiesFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void bodygraphics_PropertiesAccept(wxCommandEvent& event);
////@begin WinEDA_bodygraphics_PropertiesFrame member variables
wxCheckBox* m_CommonUnit;
wxCheckBox* m_CommonConvert;
wxBoxSizer* m_ShapeWidthBoxSizer;
wxRadioBox* m_Filled;
////@end WinEDA_bodygraphics_PropertiesFrame member variables
////@end WinEDA_bodygraphics_PropertiesFrame member variables
WinEDA_LibeditFrame * m_Parent;
};
#endif
// _DIALOG_CMP_GRAPHIC_PROPERTIES_H_
WinEDA_ValueCtrl * m_GraphicShapeWidthCtrl;
};
#endif
// _DIALOG_CMP_GRAPHIC_PROPERTIES_H_

View File

@ -6,7 +6,7 @@
<string name="title">""</string>
<string name="author">""</string>
<string name="description">""</string>
<long name="doc_count">16</long>
<long name="doc_count">17</long>
<string name="xrc_filename">""</string>
<bool name="convert_images_to_xpm">0</bool>
<bool name="inline_images">0</bool>
@ -18,6 +18,7 @@
<string name="copyright_string">"License GNU"</string>
<string name="resource_prefix">""</string>
<bool name="use_two_step_construction">0</bool>
<bool name="use_enums">0</bool>
<string name="current_platform">"&lt;All platforms&gt;"</string>
<string name="target_wx_version">"&lt;Any&gt;"</string>
<string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
@ -95,9 +96,17 @@
<string name="source_encoding">"&lt;System&gt;"</string>
<string name="project_encoding">"&lt;System&gt;"</string>
<string name="resource_archive">""</string>
<long name="text_file_type">0</long>
<bool name="use_tabs">0</bool>
<long name="indent_size">4</long>
<string name="whitespace_after_return_type">" "</string>
<string name="resource_xrc_cpp">""</string>
<bool name="use_resource_archive">0</bool>
<bool name="use_generated_xrc_cpp">0</bool>
<bool name="always_generate_xrc">1</bool>
<bool name="archive_xrc_files">1</bool>
<bool name="archive_image_files">1</bool>
<bool name="xrc_retain_relative_paths">1</bool>
</header>
<data>
<document>
@ -237,7 +246,9 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxCLIP_CHILDREN ">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxCLIP_CHILDREN">0</bool>
<bool name="proxy-wxTAB_TRAVERSAL">0</bool>
<bool name="proxy-wxWS_EX_VALIDATE_RECURSIVELY">0</bool>
<bool name="proxy-wxWS_EX_BLOCK_EVENTS">1</bool>
@ -331,6 +342,8 @@
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -382,6 +395,8 @@
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -401,6 +416,32 @@
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"21/1/2007"</string>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">"m_ShapeWidthBoxSizer"</string>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">0</bool>
<bool name="proxy-wxRIGHT">0</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
</document>
<document>
<string name="title">"wxRadioBox: ID_RADIOBOX"</string>
<string name="type">"dialog-control-document"</string>
@ -418,6 +459,8 @@
<string name="proxy-Member variable name">"m_Filled"</string>
<string name="proxy-Label">"Fill:"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Items">"Void|Filled|BgFilled"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
@ -430,8 +473,9 @@
<string name="proxy-Data validator">""</string>
<bool name="proxy-wxRA_SPECIFY_ROWS">0</bool>
<bool name="proxy-wxRA_SPECIFY_COLS">1</bool>
<string name="proxy-Items">"Void|Filled|BgFilled"</string>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -510,6 +554,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -562,6 +608,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>

View File

@ -79,6 +79,8 @@ BEGIN_EVENT_TABLE( KiConfigEeschemaFrame, wxDialog )
EVT_BUTTON( INSERT_LIB, KiConfigEeschemaFrame::OnInsertLibClick )
EVT_BUTTON( ID_LIB_PATH_SEL, KiConfigEeschemaFrame::OnLibPathSelClick )
////@end KiConfigEeschemaFrame event table entries
END_EVENT_TABLE()
@ -125,8 +127,10 @@ bool KiConfigEeschemaFrame::Create( wxWindow* parent, wxWindowID id, const wxStr
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end KiConfigEeschemaFrame creation
return true;
@ -141,7 +145,7 @@ void KiConfigEeschemaFrame::CreateControls()
SetFont(*g_DialogFont);
////@begin KiConfigEeschemaFrame content construction
// Generated by DialogBlocks, 18/02/2006 09:45:23 (unregistered)
// Generated by DialogBlocks, 28/02/2007 15:16:31 (unregistered)
KiConfigEeschemaFrame* itemDialog1 = this;
@ -149,7 +153,7 @@ void KiConfigEeschemaFrame::CreateControls()
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW|wxALL, 5);
@ -168,6 +172,7 @@ void KiConfigEeschemaFrame::CreateControls()
_("Other")
};
m_NetFormatBox = new wxRadioBox( itemDialog1, FORMAT_NETLIST, _("NetList Formats:"), wxDefaultPosition, wxDefaultSize, 5, m_NetFormatBoxStrings, 1, wxRA_SPECIFY_COLS );
m_NetFormatBox->SetSelection(0);
itemBoxSizer4->Add(m_NetFormatBox, 0, wxGROW|wxALL, 5);
itemBoxSizer4->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
@ -211,12 +216,16 @@ void KiConfigEeschemaFrame::CreateControls()
m_ListLibr = new wxListBox( itemDialog1, ID_LIST_LIBS, wxDefaultPosition, wxSize(-1, 300), 0, m_ListLibrStrings, wxLB_SINGLE );
itemBoxSizer17->Add(m_ListLibr, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxStaticText* itemStaticText20 = new wxStaticText( itemDialog1, wxID_STATIC, _("Library files path:"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText20->SetForegroundColour(wxColour(204, 0, 0));
itemBoxSizer2->Add(itemStaticText20, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 5);
wxStaticBox* itemStaticBoxSizer20Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Library files 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 );
itemBoxSizer2->Add(m_LibDirCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
m_LibDirCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(350, -1), 0 );
itemStaticBoxSizer20->Add(m_LibDirCtrl, 0, 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
@ -453,3 +462,24 @@ void KiConfigEeschemaFrame::OnSaveCfgClick( wxCommandEvent& event )
}
/*!
* 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

@ -38,11 +38,6 @@
////@begin control identifiers
#define ID_DIALOG 10000
#define SYMBOL_KICONFIGEESCHEMAFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_KICONFIGEESCHEMAFRAME_TITLE _("Dialog")
#define SYMBOL_KICONFIGEESCHEMAFRAME_IDNAME ID_DIALOG
#define SYMBOL_KICONFIGEESCHEMAFRAME_SIZE wxSize(400, 300)
#define SYMBOL_KICONFIGEESCHEMAFRAME_POSITION wxDefaultPosition
#define SAVE_CFG 10001
#define FORMAT_NETLIST 10006
#define DEL_LIB 10002
@ -50,6 +45,12 @@
#define INSERT_LIB 10004
#define ID_LIST_LIBS 10005
#define ID_TEXTCTRL 10007
#define ID_LIB_PATH_SEL 10008
#define SYMBOL_KICONFIGEESCHEMAFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#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
/*!
@ -100,6 +101,9 @@ public:
/// 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

View File

@ -6,7 +6,7 @@
<string name="title">""</string>
<string name="author">""</string>
<string name="description">""</string>
<long name="doc_count">28</long>
<long name="doc_count">29</long>
<string name="xrc_filename">""</string>
<bool name="convert_images_to_xpm">0</bool>
<bool name="inline_images">0</bool>
@ -18,6 +18,7 @@
<string name="copyright_string">"License GNU"</string>
<string name="resource_prefix">""</string>
<bool name="use_two_step_construction">0</bool>
<bool name="use_enums">0</bool>
<string name="current_platform">"&lt;All platforms&gt;"</string>
<string name="target_wx_version">"&lt;Any&gt;"</string>
<string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
@ -95,9 +96,17 @@
<string name="source_encoding">"&lt;System&gt;"</string>
<string name="project_encoding">"&lt;System&gt;"</string>
<string name="resource_archive">""</string>
<long name="text_file_type">0</long>
<bool name="use_tabs">0</bool>
<long name="indent_size">4</long>
<string name="whitespace_after_return_type">" "</string>
<string name="resource_xrc_cpp">""</string>
<bool name="use_resource_archive">0</bool>
<bool name="use_generated_xrc_cpp">0</bool>
<bool name="always_generate_xrc">1</bool>
<bool name="archive_xrc_files">1</bool>
<bool name="archive_image_files">1</bool>
<bool name="xrc_retain_relative_paths">1</bool>
</header>
<data>
<document>
@ -238,7 +247,9 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxCLIP_CHILDREN ">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxCLIP_CHILDREN">0</bool>
<bool name="proxy-wxTAB_TRAVERSAL">0</bool>
<bool name="proxy-wxWS_EX_VALIDATE_RECURSIVELY">0</bool>
<bool name="proxy-wxWS_EX_BLOCK_EVENTS">1</bool>
@ -281,7 +292,7 @@
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Horizontal"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
@ -351,6 +362,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -414,6 +427,8 @@
<string name="proxy-Member variable name">"m_NetFormatBox"</string>
<string name="proxy-Label">"NetList Formats:"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Items">"PcbNew|&amp;OrcadPcb2|&amp;CadStar|&amp;Spice|Other"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
@ -426,8 +441,9 @@
<string name="proxy-Data validator">""</string>
<bool name="proxy-wxRA_SPECIFY_ROWS">0</bool>
<bool name="proxy-wxRA_SPECIFY_COLS">1</bool>
<string name="proxy-Items">"PcbNew|&amp;OrcadPcb2|&amp;CadStar|&amp;Spice|Other"</string>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -641,6 +657,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -693,6 +711,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -745,6 +765,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -806,6 +828,7 @@
<string name="proxy-Class">"wxStaticText"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Libraries"</string>
<long name="proxy-Wrapping width">-1</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
@ -827,6 +850,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -887,6 +912,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -912,128 +939,162 @@
</document>
</document>
<document>
<string name="title">"wxStaticText: wxID_STATIC"</string>
<string name="title">"wxStaticBoxSizer H"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"statictext"</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"17/8/2006"</string>
<string name="proxy-type">"wbStaticTextProxy"</string>
<string name="proxy-Id name">"wxID_STATIC"</string>
<long name="proxy-Id value">5105</long>
<string name="proxy-Class">"wxStaticText"</string>
<string name="proxy-Member variable name">""</string>
<string name="created">"28/2/2007"</string>
<string name="proxy-type">"wbStaticBoxSizerProxy"</string>
<string name="proxy-Id name">"wxID_ANY"</string>
<string name="proxy-Id value">"-1"</string>
<string name="proxy-Label">"Library files path:"</string>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">"CC0000"</string>
<string name="proxy-Sizer member variable name">""</string>
<string name="proxy-Foreground colour">"CE0000"</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<bool name="proxy-wxALIGN_LEFT">0</bool>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxALIGN_CENTRE">0</bool>
<bool name="proxy-wxST_NO_AUTORESIZE">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxSIMPLE_BORDER">0</bool>
<bool name="proxy-wxDOUBLE_BORDER">0</bool>
<bool name="proxy-wxSUNKEN_BORDER">0</bool>
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Left"</string>
<string name="proxy-AlignV">"Top"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">0</bool>
<bool name="proxy-wxBOTTOM">0</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">1</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxTextCtrl: ID_TEXTCTRL"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"textctrl"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"17/8/2006"</string>
<string name="proxy-type">"wbTextCtrlProxy"</string>
<string name="proxy-Id name">"ID_TEXTCTRL"</string>
<long name="proxy-Id value">10007</long>
<string name="proxy-Class">"wxTextCtrl"</string>
<string name="proxy-Member variable name">"m_LibDirCtrl"</string>
<string name="proxy-Initial value">""</string>
<long name="proxy-Max length">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<bool name="proxy-wxTE_MULTILINE">0</bool>
<bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
<bool name="proxy-wxTE_PROCESS_TAB">0</bool>
<bool name="proxy-wxTE_PASSWORD">0</bool>
<bool name="proxy-wxTE_READONLY">0</bool>
<bool name="proxy-wxTE_RICH">0</bool>
<bool name="proxy-wxTE_RICH2">0</bool>
<bool name="proxy-wxTE_AUTO_URL">0</bool>
<bool name="proxy-wxTE_NOHIDESEL">0</bool>
<bool name="proxy-wxTE_LEFT">0</bool>
<bool name="proxy-wxTE_CENTRE">0</bool>
<bool name="proxy-wxTE_RIGHT">0</bool>
<bool name="proxy-wxHSCROLL">0</bool>
<bool name="proxy-wxTE_LINEWRAP">0</bool>
<bool name="proxy-wxTE_WORDWRAP">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxSIMPLE_BORDER">0</bool>
<bool name="proxy-wxDOUBLE_BORDER">0</bool>
<bool name="proxy-wxSUNKEN_BORDER">0</bool>
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-Orientation">"Horizontal"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">0</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxTextCtrl: ID_TEXTCTRL"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"textctrl"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"28/2/2007"</string>
<string name="proxy-type">"wbTextCtrlProxy"</string>
<string name="proxy-Id name">"ID_TEXTCTRL"</string>
<long name="proxy-Id value">10007</long>
<string name="proxy-Class">"wxTextCtrl"</string>
<string name="proxy-Member variable name">"m_LibDirCtrl"</string>
<string name="proxy-Initial value">""</string>
<long name="proxy-Max length">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<bool name="proxy-wxTE_MULTILINE">0</bool>
<bool name="proxy-wxTE_PROCESS_ENTER">0</bool>
<bool name="proxy-wxTE_PROCESS_TAB">0</bool>
<bool name="proxy-wxTE_PASSWORD">0</bool>
<bool name="proxy-wxTE_READONLY">0</bool>
<bool name="proxy-wxTE_RICH">0</bool>
<bool name="proxy-wxTE_RICH2">0</bool>
<bool name="proxy-wxTE_AUTO_URL">0</bool>
<bool name="proxy-wxTE_NOHIDESEL">0</bool>
<bool name="proxy-wxTE_LEFT">0</bool>
<bool name="proxy-wxTE_CENTRE">0</bool>
<bool name="proxy-wxTE_RIGHT">0</bool>
<bool name="proxy-wxHSCROLL">0</bool>
<bool name="proxy-wxTE_LINEWRAP">0</bool>
<bool name="proxy-wxTE_WORDWRAP">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxSIMPLE_BORDER">0</bool>
<bool name="proxy-wxDOUBLE_BORDER">0</bool>
<bool name="proxy-wxSUNKEN_BORDER">0</bool>
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">350</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Expand"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">0</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxButton: ID_LIB_PATH_SEL"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogcontrol"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"28/2/2007"</string>
<string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnLibPathSelClick"</string>
<string name="proxy-Id name">"ID_LIB_PATH_SEL"</string>
<long name="proxy-Id value">10008</long>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Browse"</string>
<bool name="proxy-Default">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxBU_LEFT">0</bool>
<bool name="proxy-wxBU_RIGHT">0</bool>
<bool name="proxy-wxBU_TOP">0</bool>
<bool name="proxy-wxBU_BOTTOM">0</bool>
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
</document>
</document>
</document>

View File

@ -156,11 +156,13 @@ wxString title = _("Delta Step X") + ReturnUnitSymbol(g_UnitMetric);
bool WinEDA_SetOptionsFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin WinEDA_SetOptionsFrame member initialisation
m_DrawOptionsSizer = NULL;
m_ShowGridOpt = NULL;
m_SelGridSize = NULL;
m_SelShowPins = NULL;
m_AutoPANOpt = NULL;
m_Selunits = NULL;
m_LabelSizeCtrlSizer = NULL;
m_SelDirWires = NULL;
m_Show_Page_Limits = NULL;
m_DeltaStepXTitle = NULL;
@ -193,7 +195,7 @@ void WinEDA_SetOptionsFrame::CreateControls()
{
SetFont(*g_DialogFont);
////@begin WinEDA_SetOptionsFrame content construction
// Generated by DialogBlocks, 26/08/2006 18:23:26 (unregistered)
// Generated by DialogBlocks, 23/02/2007 10:59:46 (unregistered)
WinEDA_SetOptionsFrame* itemDialog1 = this;
@ -203,9 +205,13 @@ void WinEDA_SetOptionsFrame::CreateControls()
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Draw Options:"));
m_DrawOptionsSizer = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL);
itemBoxSizer3->Add(m_DrawOptionsSizer, 0, wxGROW|wxALL, 5);
m_ShowGridOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Show grid"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_ShowGridOpt->SetValue(false);
itemBoxSizer3->Add(m_ShowGridOpt, 0, wxALIGN_LEFT|wxALL, 5);
m_DrawOptionsSizer->Add(m_ShowGridOpt, 0, wxALIGN_LEFT|wxALL, 5);
wxString m_SelGridSizeStrings[] = {
_("Normal (50 mils)"),
@ -227,13 +233,13 @@ void WinEDA_SetOptionsFrame::CreateControls()
m_SelShowPins->SetSelection(0);
itemBoxSizer3->Add(m_SelShowPins, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_AutoPANOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Auto PAN"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_AutoPANOpt->SetValue(false);
m_AutoPANOpt->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer7->Add(m_AutoPANOpt, 0, wxGROW|wxALL, 5);
itemBoxSizer8->Add(m_AutoPANOpt, 0, wxGROW|wxALL, 5);
wxString m_SelunitsStrings[] = {
_("millimeter"),
@ -241,7 +247,10 @@ void WinEDA_SetOptionsFrame::CreateControls()
};
m_Selunits = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("Units"), wxDefaultPosition, wxDefaultSize, 2, m_SelunitsStrings, 1, wxRA_SPECIFY_COLS );
m_Selunits->SetSelection(0);
itemBoxSizer7->Add(m_Selunits, 0, wxGROW|wxALL, 5);
itemBoxSizer8->Add(m_Selunits, 0, wxGROW|wxALL, 5);
m_LabelSizeCtrlSizer = new wxBoxSizer(wxVERTICAL);
itemBoxSizer8->Add(m_LabelSizeCtrlSizer, 0, wxGROW|wxALL, 5);
wxString m_SelDirWiresStrings[] = {
_("Horiz/Vertical"),
@ -249,7 +258,7 @@ void WinEDA_SetOptionsFrame::CreateControls()
};
m_SelDirWires = new wxRadioBox( itemDialog1, ID_RADIOBOX3, _("Wires - Bus orient"), wxDefaultPosition, wxDefaultSize, 2, m_SelDirWiresStrings, 1, wxRA_SPECIFY_COLS );
m_SelDirWires->SetSelection(0);
itemBoxSizer7->Add(m_SelDirWires, 0, wxGROW|wxALL, 5);
itemBoxSizer8->Add(m_SelDirWires, 0, wxGROW|wxALL, 5);
wxString m_Show_Page_LimitsStrings[] = {
_("Yes"),
@ -257,42 +266,51 @@ void WinEDA_SetOptionsFrame::CreateControls()
};
m_Show_Page_Limits = new wxRadioBox( itemDialog1, ID_RADIOBOX4, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 2, m_Show_Page_LimitsStrings, 1, wxRA_SPECIFY_COLS );
m_Show_Page_Limits->SetSelection(0);
itemBoxSizer7->Add(m_Show_Page_Limits, 0, wxGROW|wxALL, 5);
itemBoxSizer8->Add(m_Show_Page_Limits, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton13 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton13->SetForegroundColour(wxColour(202, 0, 0));
itemBoxSizer12->Add(itemButton13, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxButton* itemButton15 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton15->SetForegroundColour(wxColour(202, 0, 0));
itemBoxSizer14->Add(itemButton15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxButton* itemButton14 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton14->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer12->Add(itemButton14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxButton* itemButton16 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton16->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer14->Add(itemButton16, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticBox* itemStaticBoxSizer15Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Auto increment params"));
wxStaticBoxSizer* itemStaticBoxSizer15 = new wxStaticBoxSizer(itemStaticBoxSizer15Static, wxVERTICAL);
itemBoxSizer12->Add(itemStaticBoxSizer15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer14->Add(5, 5, 0, wxGROW|wxALL, 5);
wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Auto increment params"));
wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(itemStaticBoxSizer18Static, wxVERTICAL);
itemBoxSizer14->Add(itemStaticBoxSizer18, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_DeltaStepXTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Delta Step X"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer15->Add(m_DeltaStepXTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
itemStaticBoxSizer18->Add(m_DeltaStepXTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
m_DeltaStepCtrl_X = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer15->Add(m_DeltaStepCtrl_X, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_DeltaStepCtrl_X, 0, wxGROW|wxALL, 5);
m_DeltaStepYTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Delta Step Y"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer15->Add(m_DeltaStepYTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
itemStaticBoxSizer18->Add(m_DeltaStepYTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
m_DeltaStepCtrl_Y = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer15->Add(m_DeltaStepCtrl_Y, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_DeltaStepCtrl_Y, 0, wxGROW|wxALL, 5);
m_DeltaIncTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Delta Label:"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer15->Add(m_DeltaIncTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
itemStaticBoxSizer18->Add(m_DeltaIncTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
m_DeltaLabelCtrl = new wxSpinCtrl( itemDialog1, ID_SPINCTRL, _T("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -16, 16, 0 );
itemStaticBoxSizer15->Add(m_DeltaLabelCtrl, 0, wxGROW|wxALL, 5);
itemStaticBoxSizer18->Add(m_DeltaLabelCtrl, 0, wxGROW|wxALL, 5);
////@end WinEDA_SetOptionsFrame content construction
m_DefaultDrawLineWidthCtrl = new WinEDA_ValueCtrl(this, _("Default Line Width"),g_DrawMinimunLineWidth,
g_UnitMetric, m_DrawOptionsSizer, EESCHEMA_INTERNAL_UNIT);
m_DefaultLabelSizeCtrl = new WinEDA_ValueCtrl(this, _("Default Label Size"),g_DefaultTextLabelSize,
g_UnitMetric, m_LabelSizeCtrlSizer, EESCHEMA_INTERNAL_UNIT);
}
/*!
@ -364,6 +382,14 @@ wxSize grid;
bool setgrid = TRUE;
wxString msg;
g_DrawMinimunLineWidth = m_DefaultDrawLineWidthCtrl->GetValue();
if ( g_DrawMinimunLineWidth < 0 ) g_DrawMinimunLineWidth = 0;
if ( g_DrawMinimunLineWidth > 100 ) g_DrawMinimunLineWidth = 100;
g_DefaultTextLabelSize = m_DefaultLabelSizeCtrl->GetValue();
if ( g_DefaultTextLabelSize < 0 ) g_DefaultTextLabelSize = 0;
if ( g_DefaultTextLabelSize > 1000 ) g_DefaultTextLabelSize = 1000;
msg = m_DeltaStepCtrl_X->GetValue();
g_RepeatStep.x =
ReturnValueFromString( g_UnitMetric, msg, m_Parent->m_InternalUnits);

View File

@ -31,6 +31,7 @@
*/
////@begin forward declarations
class wxBoxSizer;
class wxSpinCtrl;
////@end forward declarations
@ -40,11 +41,6 @@ class wxSpinCtrl;
////@begin control identifiers
#define ID_DIALOG 10000
#define SYMBOL_WINEDA_SETOPTIONSFRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxSTAY_ON_TOP|wxCLOSE_BOX
#define SYMBOL_WINEDA_SETOPTIONSFRAME_TITLE _("General Options")
#define SYMBOL_WINEDA_SETOPTIONSFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_SETOPTIONSFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_SETOPTIONSFRAME_POSITION wxDefaultPosition
#define ID_CHECKBOX1 10001
#define ID_RADIOBOX 10003
#define ID_RADIOBOX1 10004
@ -55,6 +51,11 @@ class wxSpinCtrl;
#define ID_TEXTCTRL 10008
#define ID_TEXTCTRL1 10009
#define ID_SPINCTRL 10010
#define SYMBOL_WINEDA_SETOPTIONSFRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxSTAY_ON_TOP|wxCLOSE_BOX
#define SYMBOL_WINEDA_SETOPTIONSFRAME_TITLE _("General Options")
#define SYMBOL_WINEDA_SETOPTIONSFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_SETOPTIONSFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_SETOPTIONSFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
@ -112,11 +113,13 @@ public:
WinEDA_DrawFrame * m_Parent;
////@begin WinEDA_SetOptionsFrame member variables
wxStaticBoxSizer* m_DrawOptionsSizer;
wxCheckBox* m_ShowGridOpt;
wxRadioBox* m_SelGridSize;
wxRadioBox* m_SelShowPins;
wxCheckBox* m_AutoPANOpt;
wxRadioBox* m_Selunits;
wxBoxSizer* m_LabelSizeCtrlSizer;
wxRadioBox* m_SelDirWires;
wxRadioBox* m_Show_Page_Limits;
wxStaticText* m_DeltaStepXTitle;
@ -126,6 +129,9 @@ public:
wxStaticText* m_DeltaIncTitle;
wxSpinCtrl* m_DeltaLabelCtrl;
////@end WinEDA_SetOptionsFrame member variables
WinEDA_ValueCtrl * m_DefaultDrawLineWidthCtrl;
WinEDA_ValueCtrl * m_DefaultLabelSizeCtrl;
};
#endif

View File

@ -6,7 +6,7 @@
<string name="title">""</string>
<string name="author">""</string>
<string name="description">""</string>
<long name="doc_count">28</long>
<long name="doc_count">31</long>
<string name="xrc_filename">""</string>
<bool name="convert_images_to_xpm">0</bool>
<bool name="inline_images">0</bool>
@ -18,6 +18,7 @@
<string name="copyright_string">"GNU License"</string>
<string name="resource_prefix">""</string>
<bool name="use_two_step_construction">0</bool>
<bool name="use_enums">0</bool>
<string name="current_platform">"&lt;All platforms&gt;"</string>
<string name="target_wx_version">"&lt;Any&gt;"</string>
<string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
@ -98,6 +99,7 @@
<long name="text_file_type">0</long>
<bool name="use_tabs">0</bool>
<long name="indent_size">4</long>
<string name="whitespace_after_return_type">" "</string>
<string name="resource_xrc_cpp">""</string>
<bool name="use_resource_archive">0</bool>
<bool name="use_generated_xrc_cpp">0</bool>
@ -299,44 +301,27 @@
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX1"</string>
<string name="title">"wxStaticBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX1"</string>
<long name="proxy-Id value">10001</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Member variable name">"m_ShowGridOpt"</string>
<string name="proxy-Label">"Show grid"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Background colour">""</string>
<string name="created">"22/1/2007"</string>
<string name="proxy-type">"wbStaticBoxSizerProxy"</string>
<string name="proxy-Id name">"wxID_ANY"</string>
<string name="proxy-Id value">"-1"</string>
<string name="proxy-Label">"Draw Options:"</string>
<string name="proxy-Sizer member variable name">"m_DrawOptionsSizer"</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Left"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
@ -347,8 +332,60 @@
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX1"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"22/1/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX1"</string>
<long name="proxy-Id value">10001</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Member variable name">"m_ShowGridOpt"</string>
<string name="proxy-Label">"Show grid"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">""</string>
<string name="proxy-Data validator">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Left"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
</document>
<document>
<string name="title">"wxRadioBox: ID_RADIOBOX"</string>
@ -540,6 +577,7 @@
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"23/2/2007"</string>
<string name="proxy-type">"wbRadioBoxProxy"</string>
<string name="proxy-Id name">"ID_RADIOBOX2"</string>
<long name="proxy-Id value">10005</long>
@ -583,6 +621,32 @@
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"23/2/2007"</string>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">"m_LabelSizeCtrlSizer"</string>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
</document>
<document>
<string name="title">"wxRadioBox: ID_RADIOBOX3"</string>
<string name="type">"dialog-control-document"</string>
@ -818,6 +882,32 @@
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"Spacer"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"spacer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"23/2/2007"</string>
<string name="proxy-type">"wbSpacerProxy"</string>
<long name="proxy-Width">5</long>
<long name="proxy-Height">5</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
</document>
<document>
<string name="title">"wxStaticBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>

View File

@ -86,7 +86,7 @@ int ii;
m_FieldSize[ii] = m_Cmp->m_Field[ii].m_Size.x;
m_FieldFlags[ii] =
(m_Cmp->m_Field[ii].m_Attributs & TEXT_NO_VISIBLE) ? 0 : 1;
m_FieldOrient[ii] = m_Cmp->m_Field[ii].m_Orient;
m_FieldOrient[ii] = m_Cmp->m_Field[ii].m_Orient == TEXT_ORIENT_VERT ? 1 : 0;
if ( m_Cmp->m_Field[ii].m_Text.IsEmpty() ) continue;
// These values have meaning only if this field is not void:
@ -372,7 +372,7 @@ wxString newname;
m_Cmp->m_Field[ii].m_Attributs &= ~TEXT_NO_VISIBLE;
else
m_Cmp->m_Field[ii].m_Attributs |= TEXT_NO_VISIBLE;
m_Cmp->m_Field[ii].m_Orient = m_FieldOrient[ii] ? 1 : 0;
m_Cmp->m_Field[ii].m_Orient = m_FieldOrient[ii] ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ;
m_Cmp->m_Field[ii].m_Pos = m_FieldPosition[ii];
m_Cmp->m_Field[ii].m_Pos.x += cmp_pos.x;
m_Cmp->m_Field[ii].m_Pos.y += cmp_pos.y;

View File

@ -21,8 +21,8 @@ static void ExitMoveTexte(WinEDA_DrawPanel * panel, wxDC *DC);
static wxPoint ItemInitialPosition;
static int OldOrient;
static wxSize OldSize;
static int ShapeGLabel = (int) NET_INPUT;
static int TextLabelSize = DEFAULT_SIZE_TEXT;
static int s_DefaultShapeGLabel = (int) NET_INPUT;
static int s_DefaultOrientGLabel = 0;
/************************************/
/* class WinEDA_LabelPropertiesFrame */
@ -37,7 +37,7 @@ void WinEDA_LabelPropertiesFrame::TextPropertiesAccept(wxCommandEvent& event)
{
wxString text;
int value;
/* save old text in undo list if not already in edit */
if ( m_CurrentText->m_Flags == 0 )
m_Parent->SaveCopyInUndoList(m_CurrentText, IS_CHANGED);
@ -55,6 +55,10 @@ int value;
m_Parent->GetScreen()->SetModify();
/* Make the text size as new default size if it is a new text */
if ( (m_CurrentText->m_Flags & IS_NEW) != 0 )
g_DefaultTextLabelSize = m_CurrentText->m_Size.x;
Close(TRUE);
}
@ -106,7 +110,8 @@ void WinEDA_SchematicFrame::StartMoveTexte(DrawTextStruct * TextStruct, wxDC *DC
void WinEDA_SchematicFrame::EditSchematicText(DrawTextStruct * TextStruct,
wxDC * DC)
/*************************************************************************/
/* Changement du texte (Label.. ) pointe par la souris
/* Edit the properties of the text (Label, Gloab label, graphic text).. )
pointed by "TextStruct"
*/
{
if(TextStruct == NULL) return;
@ -137,6 +142,7 @@ void WinEDA_SchematicFrame::ChangeTextOrient(DrawTextStruct * TextStruct, wxDC *
SaveCopyInUndoList(TextStruct, IS_CHANGED);
/* Effacement du texte en cours */
DrawPanel->CursorOff(DC);
RedrawOneStruct(DrawPanel, DC, TextStruct, g_XorMode);
/* Rotation du texte */
@ -156,6 +162,7 @@ void WinEDA_SchematicFrame::ChangeTextOrient(DrawTextStruct * TextStruct, wxDC *
/* Reaffichage */
RedrawOneStruct(DrawPanel, DC, TextStruct, g_XorMode);
DrawPanel->CursorOn(DC);
}
/*************************************************************************/
@ -172,20 +179,21 @@ DrawTextStruct * NewText = NULL;
{
case LAYER_NOTES:
NewText = new DrawTextStruct(m_CurrentScreen->m_Curseur);
NewText->m_Size.x = NewText->m_Size.y = TextLabelSize;
NewText->m_Size.x = NewText->m_Size.y = g_DefaultTextLabelSize;
break;
case LAYER_LOCLABEL:
{
NewText = new DrawLabelStruct(m_CurrentScreen->m_Curseur);
NewText->m_Size.x = NewText->m_Size.y = TextLabelSize;
NewText->m_Size.x = NewText->m_Size.y = g_DefaultTextLabelSize;
}
break;
case LAYER_GLOBLABEL:
NewText = new DrawGlobalLabelStruct(m_CurrentScreen->m_Curseur);
NewText->m_Size.x = NewText->m_Size.y = TextLabelSize;
((DrawGlobalLabelStruct*)NewText)->m_Shape = ShapeGLabel;
NewText->m_Size.x = NewText->m_Size.y = g_DefaultTextLabelSize;
((DrawGlobalLabelStruct*)NewText)->m_Shape = s_DefaultShapeGLabel;
((DrawGlobalLabelStruct*)NewText)->m_Orient = s_DefaultOrientGLabel;
break;
default:
@ -195,6 +203,7 @@ DrawTextStruct * NewText = NULL;
NewText->m_Flags = IS_NEW | IS_MOVED;
RedrawOneStruct(DrawPanel, DC, NewText, g_XorMode);
EditSchematicText(NewText, DC);
if ( NewText->m_Text.IsEmpty() )
@ -203,6 +212,12 @@ DrawTextStruct * NewText = NULL;
return NULL;
}
if ( type == LAYER_GLOBLABEL )
{
s_DefaultShapeGLabel = ((DrawGlobalLabelStruct*)NewText)->m_Shape;
s_DefaultOrientGLabel = ((DrawGlobalLabelStruct*)NewText)->m_Orient;
}
RedrawOneStruct(DrawPanel, DC, NewText, GR_DEFAULT_DRAWMODE);
DrawPanel->ManageCurseur = ShowWhileMoving;
DrawPanel->ForceCloseManageCurseur = ExitMoveTexte;

View File

@ -13,461 +13,462 @@
#include "netlist.h" /* Definitions generales liees au calcul de netliste */
/* variables importees */
extern int PenMinWidth;
extern int g_PenMinWidth;
/* saving parameters option : */
#define INSETUP TRUE // used when the parameter is saved in general config
// if not used, the parameter is saved in the loca config (project config)
/* Liste des parametres */
#define INSETUP TRUE
static PARAM_CFG_WXSTRING UserLibDirBufCfg
(
wxT("LibDir"), /* identification */
&g_UserLibDirBuffer /* Adresse du parametre */
wxT("LibDir"), /* Ident String */
&g_UserLibDirBuffer /* Parameter address */
);
static PARAM_CFG_LIBNAME_LIST LibNameBufCfg
(
wxT("LibName"), /* identification */
&g_LibName_List, /* Adresse du parametre */
wxT("LibName"), /* Ident String */
&g_LibName_List, /* Parameter address */
GROUPLIB /* Groupe */
);
static PARAM_CFG_INT NetFormatCfg
(
wxT("NetFmt"), /* identification */
&g_NetFormat, /* Adresse du parametre */
NET_TYPE_PCBNEW, /* Valeur par defaut */
NET_TYPE_NOT_INIT, NET_TYPE_MAX-1 /* Valeurs extremes */
wxT("NetFmt"), /* Ident String */
&g_NetFormat, /* Parameter address */
NET_TYPE_PCBNEW, /* Default value */
NET_TYPE_NOT_INIT, NET_TYPE_MAX-1 /* Min and Max values for the parameter */
);
static PARAM_CFG_INT UnitCfg
(
INSETUP,
wxT("Unite"), /* identification */
&g_UnitMetric, /* Adresse du parametre */
0, /* Valeur par defaut */
0, 1 /* Valeurs extremes */
wxT("Unite"), /* Ident String */
&g_UnitMetric, /* Parameter address */
0, /* Default value */
0, 1 /* Min and Max values for the parameter */
);
static PARAM_CFG_INT CursorShapeCfg
(
INSETUP,
wxT("CuShape"), /* identification */
&g_CursorShape, /* Adresse du parametre */
0, /* Valeur par defaut */
0, 1 /* Valeurs extremes */
wxT("CuShape"), /* Ident String */
&g_CursorShape, /* Parameter address */
0, /* Default value */
0, 1 /* Min and Max values for the parameter */
);
static PARAM_CFG_INT ShowGridCfg
(
INSETUP,
wxT("ShGrid"), /* identification */
&g_ShowGrid, /* Adresse du parametre */
0, 1, /* Valeurs extremes */
1 /* Valeur par defaut */
wxT("ShGrid"), /* Ident String */
&g_ShowGrid, /* Parameter address */
0, 1, /* Min and Max values for the parameter */
1 /* Default value */
);
static PARAM_CFG_SETCOLOR DrawBgColorCfg
(
INSETUP,
wxT("BgColor"), /* identification */
&g_DrawBgColor, /* Adresse du parametre */
WHITE /* Valeur par defaut */
wxT("BgColor"), /* Ident String */
&g_DrawBgColor, /* Parameter address */
WHITE /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerWireCfg
(
INSETUP,
wxT("ColWire"), /* identification */
&g_LayerDescr.LayerColor[LAYER_WIRE], /* Adresse du parametre */
GREEN /* Valeur par defaut */
wxT("ColWire"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_WIRE], /* Parameter address */
GREEN /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerBusCfg
(
INSETUP,
wxT("ColorBus"), /* identification */
&g_LayerDescr.LayerColor[LAYER_BUS], /* Adresse du parametre */
BLUE /* Valeur par defaut */
wxT("ColorBus"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_BUS], /* Parameter address */
BLUE /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerJunctionCfg
(
INSETUP,
wxT("ColorConn"), /* identification */
&g_LayerDescr.LayerColor[LAYER_JUNCTION], /* Adresse du parametre */
GREEN /* Valeur par defaut */
wxT("ColorConn"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_JUNCTION], /* Parameter address */
GREEN /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerLLabelCfg
(
INSETUP,
wxT("ColorLlab"), /* identification */
&g_LayerDescr.LayerColor[LAYER_LOCLABEL], /* Adresse du parametre */
BLACK /* Valeur par defaut */
wxT("ColorLlab"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_LOCLABEL], /* Parameter address */
BLACK /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerGLabelCfg
(
INSETUP,
wxT("ColorGlab"), /* identification */
&g_LayerDescr.LayerColor[LAYER_GLOBLABEL], /* Adresse du parametre */
BROWN /* Valeur par defaut */
wxT("ColorGlab"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_GLOBLABEL], /* Parameter address */
BROWN /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerPinFunCfg
(
INSETUP,
wxT("ColorPinF"), /* identification */
&g_LayerDescr.LayerColor[LAYER_PINFUN], /* Adresse du parametre */
MAGENTA /* Valeur par defaut */
wxT("ColorPinF"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_PINFUN], /* Parameter address */
MAGENTA /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerPinNumCfg
(
INSETUP,
wxT("ColPinN"), /* identification */
&g_LayerDescr.LayerColor[LAYER_PINNUM], /* Adresse du parametre */
RED /* Valeur par defaut */
wxT("ColPinN"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_PINNUM], /* Parameter address */
RED /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerPinNamCfg
(
INSETUP,
wxT("ColorPNam"), /* identification */
&g_LayerDescr.LayerColor[LAYER_PINNAM], /* Adresse du parametre */
CYAN /* Valeur par defaut */
wxT("ColorPNam"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_PINNAM], /* Parameter address */
CYAN /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerFieldsCfg
(
INSETUP,
wxT("ColorField"), /* identification */
&g_LayerDescr.LayerColor[LAYER_FIELDS], /* Adresse du parametre */
MAGENTA /* Valeur par defaut */
wxT("ColorField"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_FIELDS], /* Parameter address */
MAGENTA /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerReferenceCfg
(
INSETUP,
wxT("ColorRef"), /* identification */
&g_LayerDescr.LayerColor[LAYER_REFERENCEPART], /* Adresse du parametre */
CYAN /* Valeur par defaut */
wxT("ColorRef"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_REFERENCEPART], /* Parameter address */
CYAN /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerValueCfg
(
INSETUP,
wxT("ColorValue"), /* identification */
&g_LayerDescr.LayerColor[LAYER_VALUEPART], /* Adresse du parametre */
CYAN /* Valeur par defaut */
wxT("ColorValue"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_VALUEPART], /* Parameter address */
CYAN /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerNotesCfg
(
INSETUP,
wxT("ColorNote"), /* identification */
&g_LayerDescr.LayerColor[LAYER_NOTES], /* Adresse du parametre */
LIGHTBLUE /* Valeur par defaut */
wxT("ColorNote"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_NOTES], /* Parameter address */
LIGHTBLUE /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerBodyCfg
(
INSETUP,
wxT("ColorBody"), /* identification */
&g_LayerDescr.LayerColor[LAYER_DEVICE], /* Adresse du parametre */
RED /* Valeur par defaut */
wxT("ColorBody"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_DEVICE], /* Parameter address */
RED /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerBodyBackgroundCfg
(
INSETUP,
wxT("ColorBodyBg"), /* identification */
&g_LayerDescr.LayerColor[LAYER_DEVICE_BACKGROUND], /* Adresse du parametre */
LIGHTYELLOW /* Valeur par defaut */
wxT("ColorBodyBg"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_DEVICE_BACKGROUND], /* Parameter address */
LIGHTYELLOW /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerNetNameCfg
(
INSETUP,
wxT("ColorNetN"), /* identification */
&g_LayerDescr.LayerColor[LAYER_NETNAM], /* Adresse du parametre */
DARKGRAY /* Valeur par defaut */
wxT("ColorNetN"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_NETNAM], /* Parameter address */
DARKGRAY /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerPinCfg
(
INSETUP,
wxT("ColorPin"), /* identification */
&g_LayerDescr.LayerColor[LAYER_PIN], /* Adresse du parametre */
RED /* Valeur par defaut */
wxT("ColorPin"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_PIN], /* Parameter address */
RED /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerSheetCfg
(
INSETUP,
wxT("ColorSheet"), /* identification */
&g_LayerDescr.LayerColor[LAYER_SHEET], /* Adresse du parametre */
MAGENTA /* Valeur par defaut */
wxT("ColorSheet"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_SHEET], /* Parameter address */
MAGENTA /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerSheetFileNameCfg
(
INSETUP,
wxT("ColorSheetFileName"), /* identification */
&g_LayerDescr.LayerColor[LAYER_SHEETFILENAME], /* Adresse du parametre */
BROWN /* Valeur par defaut */
wxT("ColorSheetFileName"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_SHEETFILENAME], /* Parameter address */
BROWN /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerSheetNameCfg
(
INSETUP,
wxT("ColorSheetName"), /* identification */
&g_LayerDescr.LayerColor[LAYER_SHEETNAME], /* Adresse du parametre */
CYAN /* Valeur par defaut */
wxT("ColorSheetName"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_SHEETNAME], /* Parameter address */
CYAN /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerSheetLabelCfg
(
INSETUP,
wxT("ColorSheetLab"), /* identification */
&g_LayerDescr.LayerColor[LAYER_SHEETLABEL], /* Adresse du parametre */
BROWN /* Valeur par defaut */
wxT("ColorSheetLab"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_SHEETLABEL], /* Parameter address */
BROWN /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerNoConnectCfg
(
INSETUP,
wxT("ColorNoCo"), /* identification */
&g_LayerDescr.LayerColor[LAYER_NOCONNECT], /* Adresse du parametre */
BLUE /* Valeur par defaut */
wxT("ColorNoCo"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_NOCONNECT], /* Parameter address */
BLUE /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerErcWarnCfg
(
INSETUP,
wxT("ColorErcW"), /* identification */
&g_LayerDescr.LayerColor[LAYER_ERC_WARN], /* Adresse du parametre */
GREEN /* Valeur par defaut */
wxT("ColorErcW"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_ERC_WARN], /* Parameter address */
GREEN /* Default value */
);
static PARAM_CFG_SETCOLOR ColorLayerErcErrCfg
(
INSETUP,
wxT("ColorErcE"), /* identification */
&g_LayerDescr.LayerColor[LAYER_ERC_ERR], /* Adresse du parametre */
RED /* Valeur par defaut */
wxT("ColorErcE"), /* Ident String */
&g_LayerDescr.LayerColor[LAYER_ERC_ERR], /* Parameter address */
RED /* Default value */
);
static PARAM_CFG_INT PlotMarginCfg
(
INSETUP,
wxT("Pltmarg"), /* identification */
&g_PlotMargin, /* Adresse du parametre */
300, /* Valeur par defaut */
0,10000 /* Valeurs extremes */
wxT("Pltmarg"), /* Ident String */
&g_PlotMargin, /* Parameter address */
300, /* Default value */
0,10000 /* Min and Max values for the parameter */
);
static PARAM_CFG_INT HPGLSpeed
(
wxT("HPGLSpd"), /* identification */
&g_HPGL_Pen_Descr.m_Pen_Speed, /* Adresse du parametre */
20, /* Valeur par defaut */
2,45 /* Valeurs extremes */
wxT("HPGLSpd"), /* Ident String */
&g_HPGL_Pen_Descr.m_Pen_Speed, /* Parameter address */
20, /* Default value */
2,45 /* Min and Max values for the parameter */
);
static PARAM_CFG_INT HPGLDiam
(
wxT("HPGLDm"), /* identification */
&g_HPGL_Pen_Descr.m_Pen_Diam, /* Adresse du parametre */
15, /* Valeur par defaut */
1,150 /* Valeurs extremes */
wxT("HPGLDm"), /* Ident String */
&g_HPGL_Pen_Descr.m_Pen_Diam, /* Parameter address */
15, /* Default value */
1,150 /* Min and Max values for the parameter */
);
static PARAM_CFG_INT HPGLPenNum
(
wxT("HPGLNum"), /* identification */
&g_HPGL_Pen_Descr.m_Pen_Num, /* Adresse du parametre */
1, /* Valeur par defaut */
1,8 /* Valeurs extremes */
wxT("HPGLNum"), /* Ident String */
&g_HPGL_Pen_Descr.m_Pen_Num, /* Parameter address */
1, /* Default value */
1,8 /* Min and Max values for the parameter */
);
static PARAM_CFG_INT PlotSheetOffsetX_A4
(
wxT("offX_A4"), /* identification */
&g_Sheet_A4.m_Offset.x /* Adresse du parametre */
wxT("offX_A4"), /* Ident String */
&g_Sheet_A4.m_Offset.x /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetY_A4
(
wxT("offY_A4"), /* identification */
&g_Sheet_A4.m_Offset.y /* Adresse du parametre */
wxT("offY_A4"), /* Ident String */
&g_Sheet_A4.m_Offset.y /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetX_A3
(
wxT("offX_A3"), /* identification */
&g_Sheet_A3.m_Offset.x /* Adresse du parametre */
wxT("offX_A3"), /* Ident String */
&g_Sheet_A3.m_Offset.x /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetY_A3
(
wxT("offY_A3"), /* identification */
&g_Sheet_A3.m_Offset.y /* Adresse du parametre */
wxT("offY_A3"), /* Ident String */
&g_Sheet_A3.m_Offset.y /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetX_A2
(
wxT("offX_A2"), /* identification */
&g_Sheet_A2.m_Offset.x /* Adresse du parametre */
wxT("offX_A2"), /* Ident String */
&g_Sheet_A2.m_Offset.x /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetY_A2
(
wxT("offY_A2"), /* identification */
&g_Sheet_A2.m_Offset.y /* Adresse du parametre */
wxT("offY_A2"), /* Ident String */
&g_Sheet_A2.m_Offset.y /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetX_A1
(
wxT("offX_A1"), /* identification */
&g_Sheet_A1.m_Offset.x /* Adresse du parametre */
wxT("offX_A1"), /* Ident String */
&g_Sheet_A1.m_Offset.x /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetY_A1
(
wxT("offY_A1"), /* identification */
&g_Sheet_A1.m_Offset.y /* Adresse du parametre */
wxT("offY_A1"), /* Ident String */
&g_Sheet_A1.m_Offset.y /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetX_A0
(
wxT("offX_A0"), /* identification */
&g_Sheet_A0.m_Offset.x /* Adresse du parametre */
wxT("offX_A0"), /* Ident String */
&g_Sheet_A0.m_Offset.x /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetY_A0
(
wxT("offY_A0"), /* identification */
&g_Sheet_A0.m_Offset.y /* Adresse du parametre */
wxT("offY_A0"), /* Ident String */
&g_Sheet_A0.m_Offset.y /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetX_A
(
wxT("offX_A"), /* identification */
&g_Sheet_A.m_Offset.x /* Adresse du parametre */
wxT("offX_A"), /* Ident String */
&g_Sheet_A.m_Offset.x /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetY_A
(
wxT("offY_A"), /* identification */
&g_Sheet_A.m_Offset.y /* Adresse du parametre */
wxT("offY_A"), /* Ident String */
&g_Sheet_A.m_Offset.y /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetX_B
(
wxT("offX_B"), /* identification */
&g_Sheet_B.m_Offset.x /* Adresse du parametre */
wxT("offX_B"), /* Ident String */
&g_Sheet_B.m_Offset.x /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetY_B
(
wxT("offY_B"), /* identification */
&g_Sheet_B.m_Offset.y /* Adresse du parametre */
wxT("offY_B"), /* Ident String */
&g_Sheet_B.m_Offset.y /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetX_C
(
wxT("offX_C"), /* identification */
&g_Sheet_C.m_Offset.x /* Adresse du parametre */
wxT("offX_C"), /* Ident String */
&g_Sheet_C.m_Offset.x /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetY_C
(
wxT("offY_C"), /* identification */
&g_Sheet_C.m_Offset.y /* Adresse du parametre */
wxT("offY_C"), /* Ident String */
&g_Sheet_C.m_Offset.y /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetX_D
(
wxT("offX_D"), /* identification */
&g_Sheet_D.m_Offset.x /* Adresse du parametre */
wxT("offX_D"), /* Ident String */
&g_Sheet_D.m_Offset.x /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetY_D
(
wxT("offY_D"), /* identification */
&g_Sheet_D.m_Offset.y /* Adresse du parametre */
wxT("offY_D"), /* Ident String */
&g_Sheet_D.m_Offset.y /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetX_E
(
wxT("offX_E"), /* identification */
&g_Sheet_E.m_Offset.x /* Adresse du parametre */
wxT("offX_E"), /* Ident String */
&g_Sheet_E.m_Offset.x /* Parameter address */
);
static PARAM_CFG_INT PlotSheetOffsetY_E
(
wxT("offY_E"), /* identification */
&g_Sheet_E.m_Offset.y /* Adresse du parametre */
wxT("offY_E"), /* Ident String */
&g_Sheet_E.m_Offset.y /* Parameter address */
);
static PARAM_CFG_INT CfgRepeatDeltaX
(
wxT("RptD_X"), /* identification */
&g_RepeatStep.x, /* Adresse du parametre */
0, /* Valeur par defaut */
-1000,+1000 /* Valeurs extremes */
wxT("RptD_X"), /* Ident String */
&g_RepeatStep.x, /* parameter address */
0, /* Default value */
-1000,+1000 /* Min and Max values for the parameter */
);
static PARAM_CFG_INT CfgRepeatDeltaY
(
wxT("RptD_Y"), /* identification */
&g_RepeatStep.y, /* Adresse du parametre */
100, /* Valeur par defaut */
-1000,+1000 /* Valeurs extremes */
wxT("RptD_Y"), /* Ident String */
&g_RepeatStep.y, /* Parameter address */
100, /* Default value */
-1000,+1000 /* Min and Max values for the parameter */
);
static PARAM_CFG_INT CfgRepeatDeltaLabel
(
wxT("RptLab"), /* identification */
&g_RepeatDeltaLabel, /* Adresse du parametre */
1, /* Valeur par defaut */
-10,+10 /* Valeurs extremes */
);
static PARAM_CFG_INT CfgPenMinWidth
(
wxT("PenMin"), /* identification */
&PenMinWidth, /* Adresse du parametre */
30, /* Valeur par defaut */
5, 100 /* Valeurs extremes */
wxT("RptLab"), /* Ident String */
&g_RepeatDeltaLabel, /* Parameter address */
1, /* Default value */
-10,+10 /* Min and Max values for the parameter */
);
static PARAM_CFG_WXSTRING CfgSimulatorCommandLine
(
wxT("SimCmd"), /* identification */
&g_SimulatorCommandLine /* Adresse du parametre */
wxT("SimCmd"), /* Ident String */
&g_SimulatorCommandLine /* Parameter address */
);
static PARAM_CFG_INT OptNetListUseNamesCfg
(
wxT("UseNetN"), /* identification */
&g_OptNetListUseNames, /* Adresse du parametre */
0, /* Valeur par defaut */
0, 1 /* Valeurs extremes */
wxT("UseNetN"), /* Ident String */
&g_OptNetListUseNames, /* Parameter address */
0, /* Default value */
0, 1 /* Min and Max values for the parameter */
);
static PARAM_CFG_INT OptDefaultLabelSizeCfg
(
wxT("LabSize"), /* Ident String */
&g_DefaultTextLabelSize, /* Parameter address */
DEFAULT_SIZE_TEXT, /* Default value */
0, 1000 /* Min and Max values for the parameter */
);
PARAM_CFG_BASE * ParamCfgList[] =
{
& UserLibDirBufCfg,
@ -530,8 +531,8 @@ PARAM_CFG_BASE * ParamCfgList[] =
& CfgRepeatDeltaX,
& CfgRepeatDeltaY,
& CfgRepeatDeltaLabel,
& CfgPenMinWidth,
& CfgSimulatorCommandLine,
& OptNetListUseNamesCfg,
& OptDefaultLabelSizeCfg,
NULL
};

View File

@ -0,0 +1,986 @@
/****************************************/
/* Modules to handle component drawing. */
/****************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "component_class.h"
#include "general.h"
#include "trigo.h"
#include "protos.h"
#define UNVISIBLE_COLOR DARKGRAY
//#define DRAW_ARC_WITH_ANGLE // Used to draw arcs
/* Fonctions locales */
/* Descr component <DUMMY> used when a component is not found in library,
to draw a dummy shape*/
/*
This component is a 400 mils square with the text ??
DEF DUMMY U 0 40 Y Y 1 0 N
F0 "U" 0 -350 60 H V
F1 "DUMMY" 0 350 60 H V
DRAW
T 0 0 0 150 0 0 0 ??
S -200 200 200 -200 0 1 0
ENDDRAW
ENDDEF
*/
static int s_ItemSelectColor = BROWN;
static EDA_LibComponentStruct * DummyCmp;
static int * Buf_Poly_Drawings, Buf_Poly_Size; // Used fo polyline drawings
static void DrawLibPartAux(WinEDA_DrawPanel * panel, wxDC * DC,
EDA_SchComponentStruct *Component,
EDA_LibComponentStruct *Entry,
const wxPoint & Pos,
int TransMat[2][2],
int Multi, int convert,
int DrawMode, int Color = -1, bool DrawPinText = TRUE);
/******************************/
static void CreateDummyCmp(void)
/******************************/
{
DummyCmp = new EDA_LibComponentStruct( NULL);
LibDrawSquare * Square = new LibDrawSquare();
Square->m_Pos = wxPoint(- 200,200);
Square->m_End = wxPoint(200, - 200);
Square->m_Width = 4;
LibDrawText * Text = new LibDrawText();
Text->m_Size.x = Text->m_Size.y = 150;
Text->m_Text = wxT("??");
DummyCmp->m_Drawings = Square;
Square->Pnext = Text;
}
/*************************************************************/
void DrawLibEntry(WinEDA_DrawPanel * panel,wxDC * DC,
EDA_LibComponentStruct *LibEntry,
int posX, int posY,
int Multi, int convert,
int DrawMode, int Color)
/**************************************************************/
/* Routine de dessin d'un composant d'une librairie
LibEntry = pointeur sur la description en librairie
posX, posY = position du composant
DrawMode = GrOR ..
Color = 0 : dessin en vraies couleurs, sinon couleur = Color
Une croix symbolise le point d'accrochage (ref position) du composant
Le composant est toujours trace avec orientation 0
*/
{
int color;
int TransMat[2][2];
wxString Prefix;
LibDrawField * Field;
wxPoint text_pos;
/* Orientation normale */
TransMat[0][0] = 1; TransMat[1][1] = -1;
TransMat[1][0] = TransMat[0][1] = 0;
DrawLibPartAux(panel, DC, NULL, LibEntry, wxPoint(posX, posY),
TransMat, Multi,
convert, DrawMode, Color);
/* Trace des 2 champs ref et value (Attention aux coord: la matrice
de transformation change de signe les coord Y */
GRSetDrawMode(DC, DrawMode);
if( LibEntry->m_Prefix.m_Attributs & TEXT_NO_VISIBLE )
{
if( Color >= 0 ) color = Color;
else color = UNVISIBLE_COLOR;
}
else {
if( Color >= 0) color = Color;
else color = ReturnLayerColor(LAYER_REFERENCEPART);
}
if (LibEntry->m_UnitCount > 1)
Prefix.Printf( wxT("%s?%c"),LibEntry->m_Prefix.m_Text.GetData(),Multi + 'A' - 1);
else Prefix = LibEntry->m_Prefix.m_Text + wxT("?");
text_pos.x = LibEntry->m_Prefix.m_Pos.x + posX;
text_pos.y = posY - LibEntry->m_Prefix.m_Pos.y;
int LineWidth = MAX(LibEntry->m_Prefix.m_Width, g_DrawMinimunLineWidth);
if ( (LibEntry->m_Prefix.m_Flags & IS_MOVED) == 0 )
DrawGraphicText(panel, DC, text_pos,
color,LibEntry->m_Prefix.m_Text.GetData(),
LibEntry->m_Prefix.m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
LibEntry->m_Prefix.m_Size,
LibEntry->m_Prefix.m_HJustify, LibEntry->m_Prefix.m_VJustify, LineWidth);
if( LibEntry->m_Name.m_Attributs & TEXT_NO_VISIBLE )
{
if( Color >= 0) color = Color;
else color = UNVISIBLE_COLOR;
}
else {
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(LAYER_VALUEPART);
}
text_pos.x = LibEntry->m_Name.m_Pos.x + posX;
text_pos.y = posY - LibEntry->m_Name.m_Pos.y;
LineWidth = MAX(LibEntry->m_Name.m_Width, g_DrawMinimunLineWidth);
if ( (LibEntry->m_Name.m_Flags & IS_MOVED) == 0 )
DrawGraphicText(panel, DC, text_pos,
color, LibEntry->m_Name.m_Text.GetData(),
LibEntry->m_Name.m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
LibEntry->m_Name.m_Size,
LibEntry->m_Name.m_HJustify, LibEntry->m_Name.m_VJustify, LineWidth);
for( Field = LibEntry->Fields; Field != NULL; Field = (LibDrawField *)Field->Pnext )
{
if( Field->m_Text.IsEmpty() ) return;
if ( (Field->m_Flags & IS_MOVED) != 0 ) continue;
if( Field->m_Attributs & TEXT_NO_VISIBLE )
{
if( Color >= 0) color = Color;
else color = UNVISIBLE_COLOR;
}
else
{
if( Color >= 0) color = Color;
else color = ReturnLayerColor(LAYER_FIELDS);
}
text_pos.x = Field->m_Pos.x + posX;
text_pos.y = posY - Field->m_Pos.y;
LineWidth = MAX(Field->m_Width, g_DrawMinimunLineWidth);
DrawGraphicText(panel, DC, text_pos,
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify, LineWidth);
}
// Tracé de l'ancre
int len = 3 * panel->GetZoom();
GRLine(&panel->m_ClipBox, DC, posX, posY - len, posX, posY + len, 0, color);
GRLine(&panel->m_ClipBox, DC, posX - len, posY, posX + len, posY, 0, color);
}
/*****************************************************************************
* Routine to draw the given part at given position, transformed/mirror as *
* specified, and in the given drawing mode. Only this one is visible... *
*****************************************************************************/
void EDA_SchComponentStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC,
const wxPoint & offset, int DrawMode, int Color)
{
EDA_LibComponentStruct *Entry;
int ii;
bool dummy = FALSE;
if( (Entry = FindLibPart(m_ChipName.GetData(),wxEmptyString,FIND_ROOT)) == NULL)
{ /* composant non trouvé, on affiche un composant "dummy" */
dummy = TRUE;
if( DummyCmp == NULL ) CreateDummyCmp();
Entry = DummyCmp;
}
DrawLibPartAux(panel, DC, this, Entry, m_Pos + offset,
m_Transform,
dummy ? 0 : m_Multi,
dummy ? 0 : m_Convert,
DrawMode);
/* Trace des champs, avec placement et orientation selon orient. du
composant
*/
if( ((m_Field[REFERENCE].m_Attributs & TEXT_NO_VISIBLE) == 0)
&& ! (m_Field[REFERENCE].m_Flags & IS_MOVED) )
{
if ( Entry->m_UnitCount > 1 )
DrawTextField(panel, DC, &m_Field[REFERENCE],1,DrawMode);
else
DrawTextField(panel, DC, &m_Field[REFERENCE],0,DrawMode);
}
for( ii = VALUE; ii < NUMBER_OF_FIELDS; ii++ )
{
if (m_Field[ii].m_Flags & IS_MOVED) continue;
DrawTextField(panel, DC, &m_Field[ii],0,DrawMode);
}
}
/***********************************************************/
void DrawTextField(WinEDA_DrawPanel * panel,wxDC * DC,
PartTextStruct * Field, int IsMulti, int DrawMode)
/***********************************************************/
/* Routine de trace des textes type Field du composant.
entree:
IsMulti: flag Non Null si il y a plusieurs parts par boitier.
n'est utile que pour le champ reference pour ajouter a celui ci
l'identification de la part ( A, B ... )
DrawMode: mode de trace
*/
{
int orient, color;
wxPoint pos; /* Position des textes */
EDA_SchComponentStruct *DrawLibItem = (EDA_SchComponentStruct *) Field->m_Parent;
int hjustify, vjustify;
int LineWidth = MAX(Field->m_Width, g_DrawMinimunLineWidth);
if( Field->m_Attributs & TEXT_NO_VISIBLE ) return;
if( Field->IsVoid() ) return;
GRSetDrawMode(DC, DrawMode);
/* Calcul de la position des textes, selon orientation du composant */
orient = Field->m_Orient;
hjustify = Field->m_HJustify; vjustify = Field->m_VJustify;
pos.x = Field->m_Pos.x - DrawLibItem->m_Pos.x;
pos.y = Field->m_Pos.y - DrawLibItem->m_Pos.y;
pos = DrawLibItem->GetScreenCoord(pos);
pos.x += DrawLibItem->m_Pos.x;
pos.y += DrawLibItem->m_Pos.y;
/* Y a t-il rotation (pour l'orientation, la justification)*/
if(DrawLibItem->m_Transform[0][1]) // Rotation du composant de 90deg
{
if ( orient == TEXT_ORIENT_HORIZ) orient = TEXT_ORIENT_VERT;
else orient = TEXT_ORIENT_HORIZ;
/* Y a t-il rotation, miroir (pour les justifications)*/
EXCHG(hjustify, vjustify);
if (DrawLibItem->m_Transform[1][0] < 0 ) vjustify = - vjustify;
if (DrawLibItem->m_Transform[1][0] > 0 ) hjustify = - hjustify;
}
else
{ /* Texte horizontal: Y a t-il miroir (pour les justifications)*/
if (DrawLibItem->m_Transform[0][0] < 0 )
hjustify = - hjustify;
if (DrawLibItem->m_Transform[1][1] > 0 )
vjustify = - vjustify;
}
if( Field->m_FieldId == REFERENCE )
color = ReturnLayerColor(LAYER_REFERENCEPART);
else if( Field->m_FieldId == VALUE )
color = ReturnLayerColor(LAYER_VALUEPART);
else color = ReturnLayerColor(LAYER_FIELDS);
if( !IsMulti || (Field->m_FieldId != REFERENCE) )
{
DrawGraphicText(panel, DC, pos, color, Field->m_Text.GetData(),
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
hjustify, vjustify, LineWidth);
}
else /* Le champ est la reference, et il y a plusieurs parts par boitier */
{/* On ajoute alors A ou B ... a la reference */
wxString fulltext = Field->m_Text;
fulltext.Append('A' - 1 + DrawLibItem->m_Multi);
DrawGraphicText(panel, DC, pos, color, fulltext.GetData(),
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
hjustify, vjustify, LineWidth);
}
}
/********************************************************************************/
EDA_LibComponentStruct *FindLibPart(const wxChar *Name, const wxString & LibName, int Alias)
/********************************************************************************/
/*
Routine to find a part in one of the libraries given its name.
Name = Name of part.
LibName = Name of Lib; if "": seach in all libs
Alias = Flag: si flag != 0, retourne un pointeur sur une part ou un alias
si flag = 0, retourne un pointeur sur une part meme si le nom
correspond a un alias
Alias = FIND_ROOT, ou Alias = FIND_ALIAS
*/
{
EDA_LibComponentStruct *Entry;
static EDA_LibComponentStruct DummyEntry(wxEmptyString); /* Used only to call PQFind. */
LibraryStruct *Lib = g_LibraryList;
DummyEntry.m_Drawings = NULL; /* Used only to call PQFind. */
DummyEntry.m_Name.m_Text = Name;
PQCompFunc((PQCompFuncType) LibraryEntryCompare);
Entry = NULL; FindLibName.Empty();
while (Lib)
{
if( ! LibName.IsEmpty() )
{
if( Lib->m_Name != LibName )
{
Lib = Lib->m_Pnext; continue ;
}
}
if( Lib == NULL ) break;
Entry = (EDA_LibComponentStruct*)PQFind(Lib->m_Entries, &DummyEntry);
if( Entry != NULL)
{
FindLibName = Lib->m_Name;
break;
}
Lib = Lib->m_Pnext;
}
/* Si le nom est un alias, recherche du vrai composant */
if( Entry )
{
if( (Entry->Type != ROOT ) && (Alias == FIND_ROOT) )
Entry = FindLibPart( ((EDA_LibCmpAliasStruct*)Entry)->m_RootName.GetData() ,
Lib->m_Name, FIND_ROOT);
}
return (Entry);
}
/*****************************************************************************
* Routine to draw the given part at given position, transformed/mirror as
* specified, and in the given drawing mode.
* if Color < 0: Draw in normal color
* else draw in color = Color
*****************************************************************************/
/* DrawMode = GrXOR, GrOR ..*/
void DrawLibPartAux(WinEDA_DrawPanel * panel,wxDC * DC,
EDA_SchComponentStruct *Component,
EDA_LibComponentStruct *Entry,
const wxPoint & Pos,
int TransMat[2][2],
int Multi, int convert, int DrawMode,
int Color, bool DrawPinText)
{
int i, x1, y1, x2, y2, t1, t2, orient;
LibEDA_BaseStruct *DEntry = NULL;
int CharColor;
int fill_option;
int SetHightColor;
int LineWidth;
//#define GETCOLOR(l) Color < 0 ? (ReturnLayerColor(l)| SetHightColor) : Color;
#define GETCOLOR(l) Color < 0 ? SetHightColor ? s_ItemSelectColor : (ReturnLayerColor(l)| SetHightColor) : Color;
if (Entry->m_Drawings == NULL) return;
GRSetDrawMode(DC, DrawMode);
for( DEntry = Entry->m_Drawings; DEntry != NULL;DEntry = DEntry->Next())
{
/* Elimination des elements non relatifs a l'unite */
if( Multi && DEntry->m_Unit && (DEntry->m_Unit != Multi) ) continue;
if( convert && DEntry->m_Convert && (DEntry->m_Convert != convert) )
continue;
if ( DEntry->m_Flags & IS_MOVED ) continue; // Element en deplacement non trace
SetHightColor = (DEntry->m_Selected & IS_SELECTED) ? HIGHT_LIGHT_FLAG : 0;
LineWidth = MAX(DEntry->m_Width, g_DrawMinimunLineWidth);
switch (DEntry->m_StructType)
{
case COMPONENT_ARC_DRAW_TYPE:
{
int xc,yc, x2, y2;
LibDrawArc * Arc = (LibDrawArc *) DEntry;
CharColor = GETCOLOR(LAYER_DEVICE);
xc = Pos.x + TransMat[0][0] * Arc->m_Pos.x +
TransMat[0][1] * Arc->m_Pos.y;
yc = Pos.y + TransMat[1][0] * Arc->m_Pos.x +
TransMat[1][1] * Arc->m_Pos.y;
x2 = Pos.x + TransMat[0][0] * Arc->m_ArcStart.x +
TransMat[0][1] * Arc->m_ArcStart.y;;
y2 = Pos.y + TransMat[1][0] * Arc->m_ArcStart.x +
TransMat[1][1] * Arc->m_ArcStart.y;
x1 = Pos.x + TransMat[0][0] * Arc->m_ArcEnd.x +
TransMat[0][1] * Arc->m_ArcEnd.y;;
y1 = Pos.y + TransMat[1][0] * Arc->m_ArcEnd.x +
TransMat[1][1] * Arc->m_ArcEnd.y;
t1 = Arc->t1; t2 = Arc->t2;
bool swap = MapAngles(&t1, &t2, TransMat);
if ( swap ) { EXCHG(x1,x2); EXCHG(y1, y2) }
fill_option = Arc->m_Fill & (~g_PrintFillMask);
if ( Color < 0 ) // Normal Color Layer
{
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, Arc->m_Width, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRFilledArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, CharColor, CharColor);
#ifdef DRAW_ARC_WITH_ANGLE
else GRArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, LineWidth, CharColor);
#else
else GRArc1(&panel->m_ClipBox, DC, x1, y1, x2, y2,
xc, yc, LineWidth, CharColor);
#endif
}
#ifdef DRAW_ARC_WITH_ANGLE
else GRArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, Circle->m_Width, CharColor);
#else
else GRArc1(&panel->m_ClipBox, DC, x1, y1, x2, y2,
xc, yc, Arc->m_Width, CharColor);
#endif
}
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
{
LibDrawCircle * Circle = (LibDrawCircle *) DEntry;
CharColor = GETCOLOR(LAYER_DEVICE);
x1 = Pos.x + TransMat[0][0] * Circle->m_Pos.x +
TransMat[0][1] * Circle->m_Pos.y;
y1 = Pos.y + TransMat[1][0] * Circle->m_Pos.x +
TransMat[1][1] * Circle->m_Pos.y;
fill_option = Circle->m_Fill & (~g_PrintFillMask);
if ( Color < 0 )
{
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, LineWidth, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRFilledCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, 0, CharColor, CharColor);
else GRCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, LineWidth, CharColor);
}
else GRCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, LineWidth, CharColor);
}
break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
{
LibDrawText * Text = (LibDrawText *) DEntry;
CharColor = GETCOLOR(LAYER_DEVICE);
/* The text orientation may need to be flipped if the
transformation matrix cuases xy axes to be flipped. */
t1 = (TransMat[0][0] != 0) ^ (Text->m_Horiz != 0);
x1 = Pos.x + TransMat[0][0] * Text->m_Pos.x
+ TransMat[0][1] * Text->m_Pos.y;
y1 = Pos.y + TransMat[1][0] * Text->m_Pos.x
+ TransMat[1][1] * Text->m_Pos.y;
DrawGraphicText(panel, DC, wxPoint(x1, y1), CharColor, Text->m_Text,
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
Text->m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, LineWidth);
}
break;
case COMPONENT_RECT_DRAW_TYPE:
{
LibDrawSquare * Square = (LibDrawSquare *) DEntry;
CharColor = GETCOLOR(LAYER_DEVICE);
x1 = Pos.x + TransMat[0][0] * Square->m_Pos.x
+ TransMat[0][1] * Square->m_Pos.y;
y1 = Pos.y + TransMat[1][0] * Square->m_Pos.x
+ TransMat[1][1] * Square->m_Pos.y;
x2 = Pos.x + TransMat[0][0] * Square->m_End.x
+ TransMat[0][1] * Square->m_End.y;
y2 = Pos.y + TransMat[1][0] * Square->m_End.x
+ TransMat[1][1] * Square->m_End.y;
fill_option = Square->m_Fill & (~g_PrintFillMask);
if ( Color < 0 )
{
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor, LineWidth,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRFilledRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor, CharColor);
else GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
LineWidth, CharColor);
}
else GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
LineWidth, CharColor);
}
break;
case COMPONENT_PIN_DRAW_TYPE: /* Trace des Pins */
{
LibDrawPin * Pin = (LibDrawPin *) DEntry;
if(Pin->m_Attributs & PINNOTDRAW)
{
if( (ActiveScreen->m_Type == SCHEMATIC_FRAME) &&
!g_ShowAllPins )
break;
}
/* Calcul de l'orientation reelle de la Pin */
orient = Pin->ReturnPinDrawOrient(TransMat);
/* Calcul de la position du point de reference */
x2 = Pos.x + (TransMat[0][0] * Pin->m_Pos.x)
+ (TransMat[0][1] * Pin->m_Pos.y);
y2 = Pos.y + (TransMat[1][0] * Pin->m_Pos.x)
+ (TransMat[1][1] * Pin->m_Pos.y);
/* Dessin de la pin et du symbole special associe */
CharColor = GETCOLOR(LAYER_PIN);
Pin->DrawPinSymbol(panel, DC, wxPoint(x2, y2) , orient, DrawMode, CharColor );
if ( DrawPinText )
{
wxPoint pinpos(x2,y2);
CharColor = SetHightColor ? s_ItemSelectColor : Color;
Pin->DrawPinTexts(panel, DC, pinpos, orient,
Entry->m_TextInside,
Entry->m_DrawPinNum,Entry->m_DrawPinName,
CharColor, DrawMode);
}
}
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
{
LibDrawPolyline * polyline = (LibDrawPolyline *) DEntry;
CharColor = GETCOLOR(LAYER_DEVICE);
if ( Buf_Poly_Drawings == NULL )
{
Buf_Poly_Size = polyline->n;
Buf_Poly_Drawings = (int *) MyMalloc(sizeof(int) * 2 * Buf_Poly_Size);
}
else if ( Buf_Poly_Size < polyline->n )
{
Buf_Poly_Size = polyline->n;
Buf_Poly_Drawings = (int *) realloc(Buf_Poly_Drawings,
sizeof(int) * 2 * Buf_Poly_Size);
}
for (i = 0; i < polyline->n; i++)
{
Buf_Poly_Drawings[i * 2] = Pos.x +
TransMat[0][0] * polyline->PolyList[i * 2] +
TransMat[0][1] * polyline->PolyList[i * 2 + 1];
Buf_Poly_Drawings[i * 2 + 1] = Pos.y +
TransMat[1][0] * polyline->PolyList[i * 2] +
TransMat[1][1] * polyline->PolyList[i * 2 + 1];
}
fill_option = polyline->m_Fill & (~g_PrintFillMask);
if ( Color < 0 )
{
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 1, LineWidth, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE )
GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 1, LineWidth, CharColor, CharColor);
else GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 0, LineWidth, CharColor, CharColor);
}
else GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 0, LineWidth, CharColor, CharColor);
}
break;
default:
wxBell();
break;
} /* Fin Switch */
} /* Fin Boucle de dessin */
if ( g_DebugLevel > 4 ) /* Draw the component boundary box */
{
EDA_Rect BoundaryBox;
if ( Component ) BoundaryBox = Component->GetBoundaryBox();
else BoundaryBox = Entry->GetBoundaryBox(Multi, convert);
x1 = BoundaryBox.GetX();
y1 = BoundaryBox.GetY();
x2 = BoundaryBox.GetRight();
y2 = BoundaryBox.GetBottom();
GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN);
BoundaryBox = Component->m_Field[REFERENCE].GetBoundaryBox();
x1 = BoundaryBox.GetX();
y1 = BoundaryBox.GetY();
x2 = BoundaryBox.GetRight();
y2 = BoundaryBox.GetBottom();
GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN);
BoundaryBox = Component->m_Field[VALUE].GetBoundaryBox();
x1 = BoundaryBox.GetX();
y1 = BoundaryBox.GetY();
x2 = BoundaryBox.GetRight();
y2 = BoundaryBox.GetBottom();
GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2, BROWN);
}
}
/********************************************************************************/
void LibDrawPin::DrawPinSymbol(WinEDA_DrawPanel * panel, wxDC * DC,
const wxPoint & pin_pos, int orient, int DrawMode, int Color)
/*******************************************************************************/
/* Draw the pin symbol (without texts)
if Color != 0 draw with Color, eles with the normal pin color
*/
{
int MapX1, MapY1, x1, y1;
int color;
int width = MAX(m_Width, g_DrawMinimunLineWidth);
int posX = pin_pos.x, posY = pin_pos.y, len = m_PinLen;
if( Color >= 0) color = Color;
else color = ReturnLayerColor(LAYER_PIN);
GRSetDrawMode(DC, DrawMode);
MapX1 = MapY1 = 0; x1 = posX; y1 = posY;
switch ( orient )
{
case PIN_UP:
y1 = posY - len; MapY1 = 1;
break;
case PIN_DOWN:
y1 = posY + len; MapY1 = -1;
break;
case PIN_LEFT:
x1 = posX - len, MapX1 = 1;
break;
case PIN_RIGHT:
x1 = posX + len; MapX1 = -1;
break;
}
if( m_PinShape & INVERT)
{
GRCircle(&panel->m_ClipBox, DC, MapX1 * INVERT_PIN_RADIUS + x1,
MapY1 * INVERT_PIN_RADIUS + y1,
INVERT_PIN_RADIUS, width, color);
GRMoveTo(MapX1 * INVERT_PIN_RADIUS * 2 + x1,
MapY1 * INVERT_PIN_RADIUS * 2 + y1);
GRLineTo(&panel->m_ClipBox, DC, posX, posY, width, color);
}
else
{
GRMoveTo(x1, y1);
GRLineTo(&panel->m_ClipBox, DC, posX, posY, width, color);
}
if(m_PinShape & CLOCK)
{
if(MapY1 == 0 ) /* MapX1 = +- 1 */
{
GRMoveTo(x1, y1 + CLOCK_PIN_DIM);
GRLineTo(&panel->m_ClipBox, DC, x1 - MapX1 * CLOCK_PIN_DIM, y1, width, color);
GRLineTo(&panel->m_ClipBox, DC, x1, y1 - CLOCK_PIN_DIM, width, color);
}
else /* MapX1 = 0 */
{
GRMoveTo(x1 + CLOCK_PIN_DIM, y1 );
GRLineTo(&panel->m_ClipBox, DC, x1, y1 - MapY1 * CLOCK_PIN_DIM, width, color);
GRLineTo(&panel->m_ClipBox, DC, x1 - CLOCK_PIN_DIM, y1, width, color);
}
}
if(m_PinShape & LOWLEVEL_IN) /* IEEE symbol "Active Low Input" */
{
if(MapY1 == 0 ) /* MapX1 = +- 1 */
{
GRMoveTo(x1 + MapX1 * IEEE_SYMBOL_PIN_DIM*2, y1);
GRLineTo(&panel->m_ClipBox, DC, x1 + MapX1 * IEEE_SYMBOL_PIN_DIM*2,
y1 - IEEE_SYMBOL_PIN_DIM, width, color);
GRLineTo(&panel->m_ClipBox, DC, x1, y1, width, color);
}
else /* MapX1 = 0 */
{
GRMoveTo(x1, y1 + MapY1 * IEEE_SYMBOL_PIN_DIM*2);
GRLineTo(&panel->m_ClipBox, DC, x1 - IEEE_SYMBOL_PIN_DIM,
y1 + MapY1 * IEEE_SYMBOL_PIN_DIM*2, width, color);
GRLineTo(&panel->m_ClipBox, DC, x1 , y1, width, color);
}
}
if(m_PinShape & LOWLEVEL_OUT) /* IEEE symbol "Active Low Output" */
{
if(MapY1 == 0 ) /* MapX1 = +- 1 */
{
GRMoveTo(x1, y1 - IEEE_SYMBOL_PIN_DIM);
GRLineTo(&panel->m_ClipBox, DC, x1 + MapX1 * IEEE_SYMBOL_PIN_DIM*2, y1, width, color);
}
else /* MapX1 = 0 */
{
GRMoveTo(x1 - IEEE_SYMBOL_PIN_DIM, y1);
GRLineTo(&panel->m_ClipBox, DC, x1 , y1 + MapY1 * IEEE_SYMBOL_PIN_DIM*2, width, color);
}
}
/* Draw the pin end target (active end of the pin) */
if ( ! g_IsPrinting ) // Draw but do not print the pin end target 1 pixel width */
GRCircle(&panel->m_ClipBox, DC, posX,posY,TARGET_PIN_DIAM, 0, color);
}
/*****************************************************************************
* Routine to rotate the given angular direction by the given Transformation. *
* Input (and output) angles must be as follows: *
* Unit is 0.1 degre *
* Angle1 in [0..3600], Angle2 > Angle1 in [0..7200]. Arc is assumed to be less *
* than 180.0 degrees. *
* Algorithm: *
* Map the angles to a point on the unit circle which is mapped using the *
* transform (only mirror and rotate so it remains on the unit circle) to *
* a new point which is used to detect new angle. *
*****************************************************************************/
bool MapAngles(int *Angle1, int *Angle2, int TransMat[2][2])
{
int Angle, Delta;
double x, y, t;
bool swap = FALSE;
Delta = *Angle2 - *Angle1;
if ( Delta >= 1800 )
{
*Angle1 -=1;
*Angle2 +=1;
}
x = cos(*Angle1 * M_PI / 1800.0);
y = sin(*Angle1 * M_PI / 1800.0);
t = x * TransMat[0][0] + y * TransMat[0][1];
y = x * TransMat[1][0] + y * TransMat[1][1];
x = t;
*Angle1 = (int) (atan2(y, x) * 1800.0 / M_PI + 0.5);
x = cos(*Angle2 * M_PI / 1800.0);
y = sin(*Angle2 * M_PI / 1800.0);
t = x * TransMat[0][0] + y * TransMat[0][1];
y = x * TransMat[1][0] + y * TransMat[1][1];
x = t;
*Angle2 = (int) (atan2(y, x) * 1800.0 / M_PI + 0.5);
NORMALIZE_ANGLE(*Angle1);
NORMALIZE_ANGLE(*Angle2);
if (*Angle2 < *Angle1) *Angle2 += 3600;
if (*Angle2 - *Angle1 > 1800)
{ /* Need to swap the two angles. */
Angle = (*Angle1);
*Angle1 = (*Angle2);
*Angle2 = Angle;
NORMALIZE_ANGLE(*Angle1);
NORMALIZE_ANGLE(*Angle2);
if (*Angle2 < *Angle1) *Angle2 += 3600;
swap = TRUE;
}
if ( Delta >= 1800 )
{
*Angle1 +=1;
*Angle2 -=1;
}
return swap;
}
/*****************************************************************************
* Routine to display an outline version of given library entry. *
* This routine is applied by the PlaceLibItem routine above. *
*****************************************************************************/
void DrawingLibInGhost(WinEDA_DrawPanel * panel, wxDC * DC,
EDA_LibComponentStruct *LibEntry,
EDA_SchComponentStruct *DrawLibItem, int PartX, int PartY,
int multi, int convert, int Color, bool DrawPinText)
{
int DrawMode = g_XorMode;
DrawLibPartAux(panel, DC, DrawLibItem, LibEntry, wxPoint(PartX, PartY),
DrawLibItem->m_Transform,
multi, convert, DrawMode, Color, DrawPinText);
}
/************************************************************/
/* Routine to draw One LibraryDrawStruct at given position, */
/* matrice de transformation 1 0 0 -1 (normale) */
/* DrawMode = GrXOR, GrOR .. */
/************************************************************/
/* Utilise en LibEdit et Lib Browse */
void DrawLibraryDrawStruct(WinEDA_DrawPanel * panel, wxDC * DC,
EDA_LibComponentStruct *LibEntry,
int PartX, int PartY,
LibEDA_BaseStruct *DrawItem, int Multi,
int DrawMode, int Color)
{
int i, x1, y1, x2, y2, t1, t2, orient;
int CharColor;
int TransMat[2][2];
int fill_option;
#undef GETCOLOR
#define GETCOLOR(l) Color < 0 ? ReturnLayerColor(l) : Color;
Multi = 0; /* unused */
/* Trace de la structure */
CharColor = GETCOLOR(LAYER_DEVICE);
GRSetDrawMode(DC, DrawMode);
TransMat[0][0] = 1;
TransMat[0][1] = TransMat[1][0] = 0;
TransMat[1][1] = -1;
int LineWidth = MAX(DrawItem->m_Width, g_DrawMinimunLineWidth);
switch (DrawItem->m_StructType)
{
case COMPONENT_ARC_DRAW_TYPE:
{
int xc,yc, x2,y2;
LibDrawArc * Arc = (LibDrawArc *) DrawItem;
t1 = Arc->t1; t2 = Arc->t2;
bool swap = MapAngles(&t1, &t2, TransMat);
xc = PartX + Arc->m_Pos.x;
yc = PartY - Arc->m_Pos.y;
x2 = PartX + Arc->m_ArcStart.x;
y2 = PartY - Arc->m_ArcStart.y;
x1 = PartX + Arc->m_ArcEnd.x;
y1 = PartY - Arc->m_ArcEnd.y;
if ( swap ) { EXCHG(x1,x2); EXCHG(y1, y2)}
fill_option = Arc->m_Fill & (~g_PrintFillMask);
if ( (Arc->m_Fill == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( Arc->m_Fill == FILLED_SHAPE)
GRFilledArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, LineWidth, CharColor, CharColor);
#ifdef DRAW_ARC_WITH_ANGLE
else GRArc(&panel->m_ClipBox, DC, xc, yc, t1, t2,
Arc->m_Rayon, CharColor);
#else
else GRArc1(&panel->m_ClipBox, DC, x1, y1, x2, y2,
xc, yc, LineWidth, CharColor);
#endif
}
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
{
LibDrawCircle * Circle = (LibDrawCircle *) DrawItem;
x1 = PartX + Circle->m_Pos.x;
y1 = PartY - Circle->m_Pos.y;
fill_option = Circle->m_Fill & (~g_PrintFillMask);
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, LineWidth, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRFilledCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, 0, CharColor, CharColor);
else GRCircle(&panel->m_ClipBox, DC, x1, y1,
Circle->m_Rayon, LineWidth, CharColor);
}
break;
case COMPONENT_GRAPHIC_TEXT_DRAW_TYPE:
{
LibDrawText * Text = (LibDrawText *) DrawItem;
x1 = PartX + Text->m_Pos.x;
y1 = PartY - Text->m_Pos.y;
DrawGraphicText(panel, DC, wxPoint(x1, y1), CharColor, Text->m_Text,
Text->m_Horiz,
Text->m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, LineWidth);
}
break;
case COMPONENT_RECT_DRAW_TYPE:
{
LibDrawSquare * Square = (LibDrawSquare *) DrawItem;
x1 = PartX + Square->m_Pos.x;
y1 = PartY - Square->m_Pos.y;
x2 = PartX + Square->m_End.x;
y2 = PartY - Square->m_End.y;
fill_option = Square->m_Fill & (~g_PrintFillMask);
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRFilledRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor, LineWidth,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE)
GRFilledRect(&panel->m_ClipBox, DC, x1, y1, x2, y2,
CharColor, CharColor);
else GRRect(&panel->m_ClipBox, DC, x1, y1, x2, y2, LineWidth,
CharColor);
}
break;
case COMPONENT_PIN_DRAW_TYPE: /* Trace des Pins */
{
LibDrawPin * Pin = (LibDrawPin *) DrawItem;
x2 = PartX + Pin->m_Pos.x;
y2 = PartY - Pin->m_Pos.y;
/* Compute the real pin orientation, i.e. pin orient + component orient */
orient = Pin->ReturnPinDrawOrient(TransMat);
/* Dessin de la pin et du symbole special associe */
if( Pin->m_Attributs & PINNOTDRAW) CharColor = DARKGRAY;
else CharColor = -1;
Pin->DrawPinSymbol(panel, DC, wxPoint(x2, y2), orient, DrawMode);
wxPoint pinpos(x2,y2);
Pin->DrawPinTexts(panel, DC, pinpos, orient,
LibEntry->m_TextInside,
LibEntry->m_DrawPinNum,LibEntry->m_DrawPinName,
CharColor, DrawMode);
}
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
{
LibDrawPolyline * polyline = (LibDrawPolyline *) DrawItem;
if ( Buf_Poly_Drawings == NULL )
{
Buf_Poly_Size = polyline->n;
Buf_Poly_Drawings = (int *) MyMalloc(sizeof(int) * 2 * Buf_Poly_Size);
}
else if ( Buf_Poly_Size < polyline->n )
{
Buf_Poly_Size = polyline->n;
Buf_Poly_Drawings = (int *) realloc(Buf_Poly_Drawings,
sizeof(int) * 2 * Buf_Poly_Size);
}
for (i = 0; i < polyline->n; i++)
{
Buf_Poly_Drawings[i * 2] = PartX + polyline->PolyList[i * 2];
Buf_Poly_Drawings[i * 2 + 1] = PartY - polyline->PolyList[i * 2 + 1];
}
fill_option = polyline->m_Fill & (~g_PrintFillMask);
if ( (fill_option == FILLED_WITH_BG_BODYCOLOR) && ! g_IsPrinting )
GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 1, LineWidth, CharColor,
ReturnLayerColor(LAYER_DEVICE_BACKGROUND));
else if ( fill_option == FILLED_SHAPE )
GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 1, LineWidth, CharColor, CharColor);
else GRPoly(&panel->m_ClipBox, DC, polyline->n,
Buf_Poly_Drawings, 0, LineWidth, CharColor, CharColor);
break;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -19,12 +19,13 @@ static void LoadSubHierarchy(WinEDA_SchematicFrame * frame, EDA_BaseStruct *Draw
/* Variables locales */
/************************************************************************************/
int WinEDA_SchematicFrame::LoadOneEEProject(const wxString & FileName, bool IsNew)
/************************************************************************************/
/*
Routine de chargement d'un projet ( schema principal "Root" et ses
sous schemas ( hierarchie )
Load an entire project ( shcematic root file and its subhierarchies, the configuration and the libs
which are not already loaded)
*/
{
SCH_SCREEN *screen;

View File

@ -60,7 +60,7 @@ void DrawDanglingSymbol(WinEDA_DrawPanel * panel,wxDC * DC,
GRRect(&panel->m_ClipBox, DC,
pos.x - DANGLING_SYMBOL_SIZE, pos.y - DANGLING_SYMBOL_SIZE,
pos.x + DANGLING_SYMBOL_SIZE, pos.y + DANGLING_SYMBOL_SIZE,
Color);
0, Color);
}
}
@ -101,7 +101,7 @@ wxString title;
RedrawStructList(DrawPanel, DC, GetScreen()->EEDrawList, GR_DEFAULT_DRAWMODE);
TraceWorkSheet(DC, GetScreen());
TraceWorkSheet(DC, GetScreen(), g_DrawMinimunLineWidth );
DrawPanel->CursorOn(DC); // reaffichage curseur
if(DrawPanel->ManageCurseur)
@ -138,7 +138,7 @@ BASE_SCREEN * screen, * oldscreen = m_Parent->GetScreen();
RedrawStructList(this,DC, screen->EEDrawList, GR_COPY);
if ( Print_Sheet_Ref )
m_Parent->TraceWorkSheet(DC, screen);
m_Parent->TraceWorkSheet(DC, screen, g_DrawMinimunLineWidth );
m_Parent->m_CurrentScreen = oldscreen;
wxEndBusyCursor();
@ -183,166 +183,33 @@ void RedrawOneStruct(WinEDA_DrawPanel * panel, wxDC * DC,
Struct->Draw(panel, DC, wxPoint(0,0), DrawMode, Color);
}
/********************************************************************************************/
void DrawSheetLabelStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
/********************************************************************************************/
/* Routine de dessin des Labels type hierarchie */
{
int side, txtcolor;
int posx , tposx, posy, size2;
wxSize size;
int NbSegm, coord[12];
if( Color >= 0 ) txtcolor = Color;
else txtcolor = ReturnLayerColor(m_Layer);
GRSetDrawMode(DC, DrawMode);
posx = m_Pos.x + offset.x; posy = m_Pos.y + offset.y; size = m_Size;
if( !m_Text.IsEmpty() )
{
if( m_Edge )
{
tposx = posx - size.x;
side = GR_TEXT_HJUSTIFY_RIGHT;
}
else
{
tposx = posx + size.x + (size.x /8) ;
side = GR_TEXT_HJUSTIFY_LEFT;
}
DrawGraphicText(panel, DC, wxPoint(tposx, posy), txtcolor,
m_Text, TEXT_ORIENT_HORIZ,size ,
side, GR_TEXT_VJUSTIFY_CENTER);
}
/* dessin du symbole de connexion */
if(m_Edge)
{
size.x = -size.x;
size.y = -size.y;
}
coord[0] = posx; coord[1] = posy; size2 = size.x /2;
NbSegm = 0;
switch(m_Shape)
{
case 0: /* input |> */
coord[2] = posx ; coord[3] = posy - size2;
coord[4] = posx + size2; coord[5] = posy - size2;
coord[6] = posx + size.x; coord[7] = posy;
coord[8] = posx + size2; coord[9] = posy + size2;
coord[10] = posx ; coord[11] = posy + size2;
coord[12] = coord[0] ; coord[13] = coord[1];
NbSegm = 7;
break;
case 1: /* output <| */
coord[2] = posx + size2; coord[3] = posy - size2;
coord[4] = posx + size.x; coord[5] = posy - size2;
coord[6] = posx + size.x; coord[7] = posy + size2;
coord[8] = posx + size2; coord[9] = posy + size2;
coord[10] = coord[0] ; coord[11] = coord[1];
NbSegm = 6;
break;
case 2: /* bidi <> */
case 3: /* TriSt <> */
coord[2] = posx + size2; coord[3] = posy - size2;
coord[4] = posx + size.x; coord[5] = posy;
coord[6] = posx + size2; coord[7] = posy +size2;
coord[8] = coord[0]; coord[9] = coord[1];
NbSegm = 5;
break;
default: /* unsp []*/
coord[2] = posx ; coord[3] = posy - size2;
coord[4] = posx + size.x; coord[5] = posy - size2;
coord[6] = posx + size.x; coord[7] = posy + size2;
coord[8] = posx ; coord[9] = posy + size2;
coord[10] = coord[0] ; coord[11] = coord[1];
NbSegm = 6;
break;
}
// GRPoly(&panel->m_ClipBox, DC, NbSegm, coord, 1, txtcolor, txtcolor); /* Poly rempli */
GRPoly(&panel->m_ClipBox, DC, NbSegm, coord, 0, txtcolor, txtcolor); /* Poly Non rempli */
}
/**************************************************************************************/
void DrawSheetStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
/**************************************************************************************/
/* Draw the hierarchical sheet shape */
{
DrawSheetLabelStruct * SheetLabelStruct;
int txtcolor;
wxString Text;
int color;
wxPoint pos = m_Pos + offset;
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(m_Layer);
GRSetDrawMode(DC, DrawMode);
GRRect(&panel->m_ClipBox, DC, pos.x, pos.y,
pos.x + m_Size.x, pos.y + m_Size.y, color);
/* Trace des textes : SheetName */
if( Color > 0 ) txtcolor = Color;
else txtcolor = ReturnLayerColor(LAYER_SHEETNAME);
Text = wxT("Sheet: ") + m_SheetName;
DrawGraphicText(panel, DC,
wxPoint(pos.x, pos.y - 8), txtcolor,
Text, TEXT_ORIENT_HORIZ, wxSize(m_SheetNameSize,m_SheetNameSize),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM);
/* Trace des textes : FileName */
if( Color >= 0 ) txtcolor = Color;
else txtcolor = ReturnLayerColor(LAYER_SHEETFILENAME);
Text = wxT("File: ") + m_FileName;
DrawGraphicText(panel, DC,
wxPoint(pos.x, pos.y + m_Size.y + 4),
txtcolor,
Text, TEXT_ORIENT_HORIZ, wxSize(m_FileNameSize,m_FileNameSize),
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP);
/* Trace des textes : SheetLabel */
SheetLabelStruct = m_Label;
while( SheetLabelStruct != NULL )
{
SheetLabelStruct->Draw(panel, DC, offset,DrawMode, Color);
SheetLabelStruct = (DrawSheetLabelStruct*)(SheetLabelStruct->Pnext);
}
}
/*********************************************************************/
/*****************************************************************************************/
void EDA_DrawLineStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
/*********************************************************************/
/* Routine de dessin des segments type wire, Bus .. */
/*****************************************************************************************/
/* Draw wires, Bus, and dashed liges.. */
{
int color;
int zoom = panel->GetZoom();
int width = MAX(m_Width, g_DrawMinimunLineWidth);
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(m_Layer);
GRSetDrawMode(DC, DrawMode);
if( (m_Layer == LAYER_BUS) && (zoom <= 16) )
width *= 3;
if( m_Layer == LAYER_NOTES)
GRDashedLine(&panel->m_ClipBox, DC, m_Start.x + offset.x, m_Start.y + offset.y,
m_End.x + offset.x, m_End.y + offset.y, color);
m_End.x + offset.x, m_End.y + offset.y, width, color);
else if( (m_Layer == LAYER_BUS) && (zoom <= 16) )
GRBusLine(&panel->m_ClipBox, DC, m_Start.x + offset.x, m_Start.y + offset.y,
m_End.x + offset.x, m_End.y + offset.y, color);
else
GRLine(&panel->m_ClipBox, DC, m_Start.x + offset.x, m_Start.y + offset.y,
m_End.x + offset.x, m_End.y + offset.y, color);
m_End.x + offset.x, m_End.y + offset.y, width, color);
if ( m_StartIsDangling )
DrawDanglingSymbol(panel, DC, m_Start + offset, color);
@ -351,11 +218,10 @@ int zoom = panel->GetZoom();
}
/*******************************************************************/
/****************************************************************************************/
void DrawMarkerStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
/*******************************************************************/
/* Routine de dessin des marqueurs .. */
/****************************************************************************************/
{
#define WAR 1 // utilisé aussi dans erc.cpp
@ -378,10 +244,11 @@ void DrawMarkerStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoint &
void DrawNoConnectStruct::Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & offset,
int DrawMode, int Color)
/*************************************************************************/
/* Routine de dessin des symboles de "No Connexion" .. */
/* DRaw the "No Connect" symbol.. */
{
#define DELTA (DRAWNOCONNECT_SIZE/2)
int pX, pY, color;
int width = g_DrawMinimunLineWidth;
pX = m_Pos.x + offset.x; pY = m_Pos.y + offset.y;
@ -389,8 +256,8 @@ int pX, pY, color;
else color = ReturnLayerColor(LAYER_NOCONNECT);
GRSetDrawMode(DC, DrawMode);
GRLine(&panel->m_ClipBox, DC, pX - DELTA, pY - DELTA, pX + DELTA, pY + DELTA, color);
GRLine(&panel->m_ClipBox, DC, pX + DELTA, pY - DELTA, pX - DELTA, pY + DELTA, color);
GRLine(&panel->m_ClipBox, DC, pX - DELTA, pY - DELTA, pX + DELTA, pY + DELTA, width, color);
GRLine(&panel->m_ClipBox, DC, pX + DELTA, pY - DELTA, pX - DELTA, pY + DELTA, width, color);
}
@ -399,22 +266,22 @@ void DrawBusEntryStruct::Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint
int DrawMode, int Color)
/***************************************************************/
/* Routine de dessin des Raccords a 45 degre type wire, Bus .. */
/* Draw the bus entries .. */
{
int color;
int zoom = panel->GetZoom();
int width = MAX(m_Width, g_DrawMinimunLineWidth);
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(m_Layer);
GRSetDrawMode(DC, DrawMode);
if( (m_Layer == LAYER_BUS) && (zoom <= 16) )
GRBusLine(&panel->m_ClipBox, DC, m_Pos.x + offset.x, m_Pos.y + offset.y,
m_End().x + offset.x, m_End().y + offset.y, color);
else
GRLine(&panel->m_ClipBox, DC, m_Pos.x + offset.x, m_Pos.y + offset.y,
m_End().x + offset.x, m_End().y + offset.y, color);
width *= 3;
GRLine(&panel->m_ClipBox, DC, m_Pos.x + offset.x, m_Pos.y + offset.y,
m_End().x + offset.x, m_End().y + offset.y, width, color);
}
@ -426,28 +293,29 @@ void DrawPolylineStruct::Draw(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint
{
int i, color ;
int zoom = panel->GetZoom();
int width = MAX(m_Width, g_DrawMinimunLineWidth);
if( Color >= 0 ) color = Color;
else color = ReturnLayerColor(m_Layer);
GRSetDrawMode(DC, DrawMode);
GRMoveTo(m_Points[0], m_Points[1]);
if( (m_Layer == LAYER_BUS) && (zoom <= 16) )
{
width *= 3;
}
GRMoveTo(m_Points[0], m_Points[1]);
if( m_Layer == LAYER_NOTES)
{
for (i = 1; i < m_NumOfPoints; i++)
GRDashedLineTo(&panel->m_ClipBox, DC, m_Points[i * 2] + offset.x,
m_Points[i * 2 + 1] + offset.y, color);
}
else if( (m_Layer == LAYER_BUS) && (zoom <= 16) )
{
for (i = 1; i < m_NumOfPoints; i++)
GRBusLineTo(&panel->m_ClipBox, DC, m_Points[i * 2] + offset.x,
m_Points[i * 2 + 1] + offset.y, color);
m_Points[i * 2 + 1] + offset.y, width, color);
}
else
{
for (i = 1; i < m_NumOfPoints; i++)
GRLineTo(&panel->m_ClipBox, DC, m_Points[i * 2] + offset.x, m_Points[i * 2 + 1] + offset.y, color);
GRLineTo(&panel->m_ClipBox, DC, m_Points[i * 2] + offset.x, m_Points[i * 2 + 1] + offset.y,
width, color);
}
}
@ -480,7 +348,9 @@ de structures.
{
int Width, ii;
int DrawMode = g_XorMode;
int width = g_DrawMinimunLineWidth;
GRSetDrawMode(DC, DrawMode);
switch (DrawStruct->m_StructType)
@ -492,7 +362,7 @@ int DrawMode = g_XorMode;
GRMoveTo(Struct->m_Points[0] + dx, Struct->m_Points[1] + dy);
for (ii = 1; ii < Struct->m_NumOfPoints; ii++)
GRLineTo(&panel->m_ClipBox, DC, Struct->m_Points[ii * 2] + dx,
Struct->m_Points[ii * 2 + 1] +dy, g_GhostColor);
Struct->m_Points[ii * 2 + 1] +dy, width, g_GhostColor);
break;
}
@ -510,11 +380,11 @@ int DrawMode = g_XorMode;
}
if( (Struct->m_Flags & ENDPOINT) == 0 )
{
GRLineTo(&panel->m_ClipBox, DC, Struct->m_End.x + dx, Struct->m_End.y + dy, g_GhostColor);
GRLineTo(&panel->m_ClipBox, DC, Struct->m_End.x + dx, Struct->m_End.y + dy, width, g_GhostColor);
}
else
{
GRLineTo(&panel->m_ClipBox, DC, Struct->m_End.x, Struct->m_End.y, g_GhostColor);
GRLineTo(&panel->m_ClipBox, DC, Struct->m_End.x, Struct->m_End.y, width, g_GhostColor);
}
break;
}
@ -524,7 +394,7 @@ int DrawMode = g_XorMode;
DrawBusEntryStruct * Struct = (DrawBusEntryStruct *) DrawStruct;
int xx = Struct->m_Pos.x + dx, yy = Struct->m_Pos.y + dy;
GRMoveTo(xx, yy);
GRLineTo(&panel->m_ClipBox, DC, Struct->m_Size.x + xx, Struct->m_Size.y + yy, g_GhostColor);
GRLineTo(&panel->m_ClipBox, DC, Struct->m_Size.x + xx, Struct->m_Size.y + yy, width, g_GhostColor);
break;
}
@ -598,7 +468,7 @@ int DrawMode = g_XorMode;
DrawSheetStruct *Struct = (DrawSheetStruct * ) DrawStruct;
GRRect(&panel->m_ClipBox, DC, Struct->m_Pos.x + dx, Struct->m_Pos.y + dy,
Struct->m_Pos.x + Struct->m_Size.x + dx,
Struct->m_Pos.y + Struct->m_Size.y + dy, g_GhostColor);
Struct->m_Pos.y + Struct->m_Size.y + dy, width, g_GhostColor);
break;
}

View File

@ -16,22 +16,6 @@
extern void Move_Plume( wxPoint pos, int plume ); // see plot.cpp
/*****************************************************************************/
void PutTextInfo(WinEDA_DrawPanel * panel, wxDC * DC,
int Orient, const wxPoint& Pos, const wxSize& Size,
const wxString & Str, int DrawMode, int color)
/*****************************************************************************/
/* Put out a string, always centered to the given position, with given
orientation, taking into account current zoom factor.
*/
{
GRSetDrawMode(DC, DrawMode);
DrawGraphicText(panel, DC, Pos, color, Str, Orient, Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER);
}
/*****************************************************************************
Put out pin number and pin text info, given the pin line coordinates.
The line must be vertical or horizontal.
@ -53,8 +37,9 @@ int PinTextBarPos[256];
int PinTextBarCount;
int NameColor, NumColor;
int PinTxtLen;
wxSize PinNameSize(m_SizeName,m_SizeName);
wxSize PinNumSize(m_SizeNum,m_SizeNum);
wxSize PinNameSize(m_PinNameSize,m_PinNameSize);
wxSize PinNumSize(m_PinNumSize,m_PinNumSize);
int LineWidth = g_DrawMinimunLineWidth;
GRSetDrawMode(DC, DrawMode);
@ -112,7 +97,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
DrawGraphicText(panel, DC, wxPoint(x, y1), NameColor, PinText,
TEXT_ORIENT_HORIZ,
PinNameSize,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, LineWidth);
for ( ii = 0; ii < PinTextBarCount; )
{
@ -122,7 +107,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
dx = PinTextBarPos[ii++]; // Get the line pos
GRMoveRel(dx, 0);
len = PinTextBarPos[ii++] - dx; // Get the line length
GRLineRel(&panel->m_ClipBox, DC, len, 0, NameColor);
GRLineRel(&panel->m_ClipBox, DC, len, 0, LineWidth, NameColor);
}
}
else // Orient == PIN_LEFT
@ -131,7 +116,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
DrawGraphicText(panel, DC, wxPoint(x, y1) , NameColor, PinText,
TEXT_ORIENT_HORIZ,
PinNameSize,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, LineWidth);
for ( ii = 0; ii < PinTextBarCount; )
{
@ -141,7 +126,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
dx = PinTextBarPos[ii++]; // Get the line pos
GRMoveRel(dx - PinTxtLen, 0);
len = PinTextBarPos[ii++] - dx; // Get the line length
GRLineRel(&panel->m_ClipBox, DC, len, 0, NameColor);
GRLineRel(&panel->m_ClipBox, DC, len, 0, LineWidth, NameColor);
}
}
}
@ -151,7 +136,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
DrawGraphicText(panel, DC,
wxPoint((x1 + pin_pos.x) / 2, y1 - TXTMARGE), NumColor, StringPinNum,
TEXT_ORIENT_HORIZ, PinNumSize,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth);
}
}
@ -165,7 +150,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
DrawGraphicText(panel, DC, wxPoint(x1, y), NameColor, PinText,
TEXT_ORIENT_VERT, PinNameSize,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, LineWidth);
for ( ii = 0; ii < PinTextBarCount; )
{
@ -175,7 +160,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
dx = PinTextBarPos[ii++]; // Get the line pos
GRMoveRel(0, PinTxtLen - dx);
len = PinTextBarPos[ii++] - dx; // Get the line length
GRLineRel(&panel->m_ClipBox, DC, 0, -len, NameColor);
GRLineRel(&panel->m_ClipBox, DC, 0, -len, LineWidth, NameColor);
}
}
@ -185,7 +170,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
DrawGraphicText(panel, DC, wxPoint(x1, y), NameColor, PinText,
TEXT_ORIENT_VERT, PinNameSize,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth);
for ( ii = 0; ii < PinTextBarCount; )
{
@ -195,7 +180,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
dx = PinTextBarPos[ii++]; // Get the line pos
GRMoveRel(0, - dx);
len = PinTextBarPos[ii++] - dx; // Get the line length
GRLineRel(&panel->m_ClipBox, DC, 0, -len, NameColor);
GRLineRel(&panel->m_ClipBox, DC, 0, -len, LineWidth, NameColor);
}
}
}
@ -205,7 +190,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
DrawGraphicText(panel, DC,
wxPoint(x1 - TXTMARGE, (y1 + pin_pos.y) / 2) , NumColor, StringPinNum,
TEXT_ORIENT_VERT, PinNumSize,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, LineWidth);
}
}
}
@ -221,7 +206,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
DrawGraphicText(panel, DC, wxPoint(x , y1 - TXTMARGE),
NameColor, PinText,
TEXT_ORIENT_HORIZ, PinNameSize,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth);
for ( ii = 0; ii < PinTextBarCount; )
{
@ -230,7 +215,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
dx = PinTextBarPos[ii++]; // Get the line pos
GRMoveRel(dx, 0);
len = PinTextBarPos[ii++] - dx; // Get the line length
GRLineRel(&panel->m_ClipBox, DC, len, 0, NameColor);
GRLineRel(&panel->m_ClipBox, DC, len, 0, LineWidth, NameColor);
}
}
if(DrawPinNum)
@ -239,7 +224,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
DrawGraphicText(panel, DC, wxPoint(x, y1 + TXTMARGE),
NumColor, StringPinNum,
TEXT_ORIENT_HORIZ, PinNumSize,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP);
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP, LineWidth);
}
}
else /* Its a vertical line. */
@ -250,7 +235,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
DrawGraphicText(panel, DC, wxPoint(x1 - TXTMARGE , y ),
NameColor, PinText,
TEXT_ORIENT_VERT, PinNameSize,
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_RIGHT, GR_TEXT_VJUSTIFY_CENTER, LineWidth);
for ( ii = 0; ii < PinTextBarCount; )
{
@ -259,7 +244,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
dx = PinTextBarPos[ii++]; // Get the line pos
GRMoveRel(0, PinTxtLen - dx);
len = PinTextBarPos[ii++] - dx; // Get the line length
GRLineRel(&panel->m_ClipBox, DC, 0, - len, NameColor);
GRLineRel(&panel->m_ClipBox, DC, 0, - len, LineWidth, NameColor);
}
}
@ -268,7 +253,7 @@ wxSize PinNumSize(m_SizeNum,m_SizeNum);
DrawGraphicText(panel, DC, wxPoint(x1 + TXTMARGE , (y1 + pin_pos.y) / 2),
NumColor, StringPinNum,
TEXT_ORIENT_VERT, PinNumSize,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, LineWidth);
}
}
}
@ -294,8 +279,8 @@ int PinTextBarPos[256];
int PinTextBarCount;
int NameColor, NumColor;
int PinTxtLen = 0;
wxSize PinNameSize = wxSize(m_SizeName,m_SizeName);
wxSize PinNumSize = wxSize(m_SizeNum,m_SizeNum);
wxSize PinNameSize = wxSize(m_PinNameSize,m_PinNameSize);
wxSize PinNumSize = wxSize(m_PinNumSize,m_PinNumSize);
bool plot_color = (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt;
/* Get the num and name colors */

View File

@ -44,37 +44,40 @@ int id = event.GetId();
}
/**********************************************************************************/
bool WinEDA_SchematicFrame::LoadOneSheet(SCH_SCREEN * screen, const wxString & FullFileName)
/**********************************************************************************/
/******************************************************************************************/
bool WinEDA_SchematicFrame::LoadOneSheet(SCH_SCREEN * screen, const wxString & filename)
/******************************************************************************************/
{
wxString FullFileName = filename;
if( screen->EEDrawList != NULL )
{
if( !IsOK(this, _("Clear SubHierarchy ?") ) ) return FALSE;
ClearProjectDrawList(screen, TRUE);
}
if( FullFileName.IsEmpty())
if( FullFileName.IsEmpty() )
{
wxString filename, mask;
wxString mask;
mask = wxT("*") + g_SchExtBuffer;
filename = EDA_FileSelector( _("Schematic files:"),
wxEmptyString, /* Chemin par defaut */
screen->m_FileName, /* nom fichier par defaut */
FullFileName = EDA_FileSelector( _("Schematic files:"),
wxEmptyString, /* default path */
screen->m_FileName, /* default filename */
g_SchExtBuffer, /* extension par defaut */
mask, /* Masque d'affichage */
this,
wxFD_OPEN,
FALSE
);
if ( filename.IsEmpty() ) return FALSE;
else screen->m_FileName = filename;
if ( FullFileName.IsEmpty() ) return FALSE;
}
else screen->m_FileName = FullFileName;
ClearProjectDrawList(screen, TRUE);
LoadOneEEFile(screen, screen->m_FileName);
screen->SetRefreshReq();
screen->m_FileName = FullFileName;
LoadOneEEFile(screen, FullFileName);
screen->SetModify();
if ( GetScreen() == screen ) Refresh(TRUE);
return TRUE;
}

View File

@ -172,13 +172,20 @@ eda_global struct EESchemaVariables g_EESchemaVar;
eda_global int g_PrintFillMask; /* pour les options "FILL",
l'option reelle est m_Fill & ~PrintFillMask */
/* Variables eda_globales pour Libview */
/* Variables globales pour Libview */
eda_global wxString g_CurrentViewLibraryName; /* nom de la librairie en cours d'examen */
eda_global wxString g_CurrentViewComponentName; /* nom du le composant en cours d'examen */
eda_global int g_ViewConvert; /* Vue normal / convert */
eda_global int g_ViewUnit; /* unité a afficher (A, B ..) */
/* Variables globales pour Schematic Edit */
eda_global int g_DefaultTextLabelSize
#ifdef MAIN
= DEFAULT_SIZE_TEXT
#endif
;
/* Variables eda_globales pour LibEdit */
/* Variables globales pour LibEdit */
eda_global int g_LastTextSize
#ifdef MAIN
= DEFAULT_SIZE_TEXT
@ -263,4 +270,10 @@ eda_global bool g_EditPinByPinIsOn /* bool: TRUE si edition des pins pin a pin a
#endif
;
eda_global int g_LibSymbolDefaultLineWidth; /* default line width (in EESCHEMA units) used when creating a new graphic item in libedit : 0 = default */
eda_global int g_DrawMinimunLineWidth; /* Minimum line (in EESCHEMA units) width used to draw items on screen; 0 = single pixel line width */
eda_global int g_PlotPSMinimunLineWidth; /* Minimum line (in EESCHEMA units) width used to Plot items , postscript format */
/* Config keys */
#define MINI_DRAW_LINE_WIDTH_KEY wxT("MinimunDrawLineWidth")
#define MINI_PLOTPS_LINE_WIDTH_KEY wxT("MinimunPlotPSLineWidth")

View File

@ -36,7 +36,8 @@ sous le courseur souris
{
bool PopupOn = m_CurrentScreen->m_CurrentItem &&
m_CurrentScreen->m_CurrentItem->m_Flags;
bool RefreshToolBar = FALSE; // We must refresh tool bar when the undo/redo tool state is modified
if ( hotkey == 0 ) return;
switch (hotkey)
@ -44,7 +45,7 @@ bool PopupOn = m_CurrentScreen->m_CurrentItem &&
case WXK_DELETE:
case WXK_NUMPAD_DELETE:
if ( PopupOn ) break;
LocateAndDeleteItem(this, DC);
RefreshToolBar = LocateAndDeleteItem(this, DC);
m_CurrentScreen->SetModify();
m_CurrentScreen->m_CurrentItem = NULL;
TestDanglingEnds(m_CurrentScreen->EEDrawList, DC);
@ -69,6 +70,12 @@ bool PopupOn = m_CurrentScreen->m_CurrentItem &&
switch (DrawStruct->m_StructType)
{
case DRAW_LIB_ITEM_STRUCT_TYPE:
if ( DrawStruct->m_Flags == 0 )
{
SaveCopyInUndoList(DrawStruct, IS_CHANGED);
RefreshToolBar = TRUE;
}
CmpRotationMiroir(
(EDA_SchComponentStruct *) DrawStruct, DC, CMP_ROTATE_COUNTERCLOCKWISE );
break;
@ -76,6 +83,11 @@ bool PopupOn = m_CurrentScreen->m_CurrentItem &&
case DRAW_TEXT_STRUCT_TYPE:
case DRAW_LABEL_STRUCT_TYPE:
case DRAW_GLOBAL_LABEL_STRUCT_TYPE:
if ( DrawStruct->m_Flags == 0 )
{
SaveCopyInUndoList(DrawStruct, IS_CHANGED);
RefreshToolBar = TRUE;
}
ChangeTextOrient( (DrawTextStruct*)DrawStruct, DC);
break;
}
@ -87,6 +99,11 @@ bool PopupOn = m_CurrentScreen->m_CurrentItem &&
DrawStruct = LocateSmallestComponent( GetScreen() );
if ( DrawStruct )
{
if ( DrawStruct->m_Flags == 0 )
{
SaveCopyInUndoList(DrawStruct, IS_CHANGED);
RefreshToolBar = TRUE;
}
CmpRotationMiroir(
(EDA_SchComponentStruct *) DrawStruct, DC, CMP_MIROIR_Y );
}
@ -98,6 +115,11 @@ bool PopupOn = m_CurrentScreen->m_CurrentItem &&
DrawStruct = LocateSmallestComponent( GetScreen() );
if ( DrawStruct )
{
if ( DrawStruct->m_Flags == 0 )
{
SaveCopyInUndoList(DrawStruct, IS_CHANGED);
RefreshToolBar = TRUE;
}
CmpRotationMiroir(
(EDA_SchComponentStruct *) DrawStruct, DC, CMP_MIROIR_X );
}
@ -109,6 +131,11 @@ bool PopupOn = m_CurrentScreen->m_CurrentItem &&
DrawStruct = LocateSmallestComponent( GetScreen() );
if ( DrawStruct )
{
if ( DrawStruct->m_Flags == 0 )
{
SaveCopyInUndoList(DrawStruct, IS_CHANGED);
RefreshToolBar = TRUE;
}
CmpRotationMiroir(
(EDA_SchComponentStruct *) DrawStruct, DC, CMP_NORMAL );
TestDanglingEnds(m_CurrentScreen->EEDrawList, DC);
@ -127,4 +154,6 @@ bool PopupOn = m_CurrentScreen->m_CurrentItem &&
}
break;
}
if ( RefreshToolBar ) SetToolbars();
}

View File

@ -98,7 +98,7 @@ char Line[1024], * text, * data;
/* class LibCmpEntry */
/*********************/
/* Basic class for librarty oomponent description
Nor directly used
Not directly used
Used to create the 2 derived classes :
- EDA_LibCmpAliasStruct
- EDA_LibComponentStruct
@ -125,10 +125,12 @@ LibCmpEntry::~LibCmpEntry(void)
/* class EDA_LibCmpAliasStruct */
/*******************************/
/* Decrit un alias d'un composant standard en librairie
Un alias est identique au composant standard
Dans un alias on ne redefinit que le nom et la documentation associée.
Le gain de place en memoire est important
/* Class to define an alias of a component
An alias uses the component defintion (graphic, pins...)
but has its own name and documentation.
Therefore, when the component is modified, alias of this component are modified.
This is a simple method to create components with differs very few
(like 74LS00, 74HC00 ... and many op amps )
*/
EDA_LibCmpAliasStruct:: EDA_LibCmpAliasStruct( const wxChar * CmpName,
@ -230,14 +232,14 @@ EDA_Rect BoundaryBox;
// Arc is reduced to a line from m_Start to m_End.
// TO DO better.
LibDrawArc * Arc = (LibDrawArc *) DrawEntry;
x1 = Arc->m_Start.x;
y1 = Arc->m_Start.y;
x1 = Arc->m_ArcStart.x;
y1 = Arc->m_ArcStart.y;
xmin = MIN(xmin, x1);
ymin = MIN(ymin, y1);
xmax = MAX(xmax, x1);
ymax = MAX(ymax, y1);
x1 = Arc->m_End.x;
y1 = Arc->m_End.y;
x1 = Arc->m_ArcEnd.x;
y1 = Arc->m_ArcEnd.y;
xmin = MIN(xmin, x1);
ymin = MIN(ymin, y1);
xmax = MAX(xmax, x1);
@ -262,13 +264,13 @@ EDA_Rect BoundaryBox;
case COMPONENT_RECT_DRAW_TYPE:
{
LibDrawSquare * Square = (LibDrawSquare *) DrawEntry;
xmin = MIN(xmin, Square->m_Start.x);
xmin = MIN(xmin, Square->m_Pos.x);
xmin = MIN(xmin, Square->m_End.x);
xmax = MAX(xmax, Square->m_Start.x);
xmax = MAX(xmax, Square->m_Pos.x);
xmax = MAX(xmax, Square->m_End.x);
ymin = MIN(ymin, Square->m_Start.y);
ymin = MIN(ymin, Square->m_Pos.y);
ymin = MIN(ymin, Square->m_End.y);
ymax = MAX(ymax, Square->m_Start.y);
ymax = MAX(ymax, Square->m_Pos.y);
ymax = MAX(ymax, Square->m_End.y);
}
break;
@ -351,12 +353,13 @@ LibDrawField::LibDrawField(int idfield) : LibEDA_BaseStruct(COMPONENT_FIELD_DRAW
if ( m_FieldId >= NUMBER_OF_FIELDS ) m_FieldId = NUMBER_OF_FIELDS - 1;
m_Size.x = m_Size.y = DEFAULT_SIZE_TEXT;
m_Orient = 0; /* Orientation */
m_Attributs = 0; /* Attributs = Non visible ... */
m_Attributs = 0; /* Attributs = unvisible ... */
m_Width = 0;
m_HJustify = GR_TEXT_HJUSTIFY_CENTER;
m_VJustify = GR_TEXT_VJUSTIFY_CENTER; /* Justifications Horiz et Vert du texte */
m_VJustify = GR_TEXT_VJUSTIFY_CENTER; /* Horizontal and vertical text justification */
}
LibDrawField::~LibDrawField(void) // Destructor
LibDrawField::~LibDrawField(void)
{
}
@ -374,6 +377,7 @@ void LibDrawField::Copy(LibDrawField * Target)
{
Target->m_Pos = m_Pos;
Target->m_Size = m_Size;
Target->m_Width = m_Width;
Target->m_Orient = m_Orient;
Target->m_Attributs = m_Attributs;
Target->m_Text = m_Text;
@ -390,6 +394,7 @@ LibEDA_BaseStruct::LibEDA_BaseStruct(int struct_type):
0 if the item is common to all units */
m_Convert = 0; /* Shape identification (for parts which have a convert shape)
0 if the item is common to all shapes */
m_Width = 0; /* Default value to draw lines or arc ... */
}
/***************************************************************/
@ -402,8 +407,10 @@ LibDrawPin::LibDrawPin(void) : LibEDA_BaseStruct(COMPONENT_PIN_DRAW_TYPE)
m_PinType = PIN_UNSPECIFIED; /* electrical type of pin */
m_Attributs = 0; /* bit 0 != 0: pin invisible */
m_PinNum = 0; /*pin number ( i.e. 4 codes Ascii ) */
m_SizeNum = 50;
m_SizeName = 50; /* Default size for pin name and num */
m_PinNumSize = 50;
m_PinNameSize = 50; /* Default size for pin name and num */
m_Width = 0;
// m_PinNumWidth = m_PinNameWidth = 0; // Unused
}
@ -509,11 +516,12 @@ LibDrawPin * newpin = new LibDrawPin();
newpin->m_PinType = m_PinType;
newpin->m_Attributs = m_Attributs;
newpin->m_PinNum = m_PinNum;
newpin->m_SizeNum = m_SizeNum;
newpin->m_SizeName = m_SizeName;
newpin->m_PinNumSize = m_PinNumSize;
newpin->m_PinNameSize = m_PinNameSize;
newpin->m_Unit = m_Unit;
newpin->m_Convert = m_Convert;
newpin->m_Flags = m_Flags;
newpin->m_Width = m_Width;
newpin->m_PinName = m_PinName;
@ -538,8 +546,8 @@ LibDrawArc * LibDrawArc::GenCopy(void)
LibDrawArc * newitem = new LibDrawArc();
newitem->m_Pos = m_Pos;
newitem->m_Start = m_Start;
newitem->m_End = m_End;
newitem->m_ArcStart = m_ArcStart;
newitem->m_ArcEnd = m_ArcEnd;
newitem->m_Rayon = m_Rayon;
newitem->t1 = t1;
newitem->t2 = t2;
@ -557,7 +565,6 @@ LibDrawCircle::LibDrawCircle(void) : LibEDA_BaseStruct(COMPONENT_CIRCLE_DRAW_TYP
/**********************************************************************/
{
m_Rayon = 0;
m_Width = 0;
m_Fill = NO_FILL;
}
@ -585,6 +592,7 @@ LibDrawText::LibDrawText(void) : LibEDA_BaseStruct(COMPONENT_GRAPHIC_TEXT_DRAW_T
m_Horiz = TEXT_ORIENT_HORIZ;
m_Size = wxSize(50,50);
m_Type = 0;
m_Width = 0;
}
/***************************************/
@ -601,6 +609,7 @@ LibDrawText * newitem = new LibDrawText();
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Text = m_Text;
newitem->m_Width = m_Width;
return newitem;
}
@ -616,7 +625,7 @@ LibDrawSquare * LibDrawSquare::GenCopy(void)
{
LibDrawSquare * newitem = new LibDrawSquare();
newitem->m_Start = m_Start;
newitem->m_Pos = m_Pos;
newitem->m_End = m_End;
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
@ -635,7 +644,7 @@ LibDrawSegment * LibDrawSegment::GenCopy(void)
{
LibDrawSegment * newitem = new LibDrawSegment();
newitem->m_Start = m_Start;
newitem->m_Pos = m_Pos;
newitem->m_End = m_End;
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
@ -667,6 +676,7 @@ int size;
newitem->PolyList = (int*)MyMalloc(size);
memcpy(newitem->PolyList, PolyList, size);
}
newitem->m_Pos = m_Pos;
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;

View File

@ -142,7 +142,7 @@ public:
LibraryStruct * m_Pnext; /* Point on next lib in chain. */
int m_Modified; /* flag indicateur d'edition */
int m_Size; // Size in bytes (for statistics)
long m_TimeStamp; // Signature temporelle
unsigned long m_TimeStamp; // Signature temporelle
int m_Flags; // variable used in some functions
bool m_IsLibCache; // False for the "standard" libraries,
// True for the library cache
@ -167,10 +167,12 @@ public:
class LibEDA_BaseStruct : public EDA_BaseStruct
{
public:
int m_Unit; /* Unit identification (for multi part per parkage)
int m_Unit; /* Unit identification (for multi part per parkage)
0 if the item is common to all units */
int m_Convert; /* Shape identification (for parts which have a convert shape)
int m_Convert; /* Shape identification (for parts which have a convert shape)
0 if the item is common to all shapes */
wxPoint m_Pos; /* Position or centre (Arc and Circle) or start point (segments) */
int m_Width; /* Width of draw lines */
public:
LibEDA_BaseStruct * Next(void) {return (LibEDA_BaseStruct *) Pnext;}
@ -179,20 +181,20 @@ public:
void Display_Infos_DrawEntry(WinEDA_DrawFrame * frame);
};
class LibDrawPin : public LibEDA_BaseStruct
{
public:
wxPoint m_Pos; /* Pin position */
short m_PinLen; /* Pin lenght */
short m_Orient; /* Pin orientation (Up, Down, Left, Right) */
short m_PinShape; /* Bitwise ORed: Pin shape (see enum DrawPinShape) */
char m_PinType; /* Electrical pin properties */
char m_Attributs; /* bit 0 != 0: pin invisible */
long m_PinNum; /* Pin number: 4 Ascii code like
"12" or "anod" or "G6"
int m_PinLen; /* Pin lenght */
int m_Orient; /* Pin orientation (Up, Down, Left, Right) */
int m_PinShape; /* Bitwise ORed: Pin shape (see enum DrawPinShape) */
int m_PinType; /* Electrical pin properties */
int m_Attributs; /* bit 0 != 0: pin invisible */
long m_PinNum; /* Pin number: 4 Ascii code like "12" or "anod" or "G6"
"12" is really "12\0\0"*/
wxString m_PinName;
short m_SizeNum, m_SizeName; /* Pin num and Pin name sizes */
int m_PinNumSize, m_PinNameSize; /* Pin num and Pin name sizes */
// short m_PinNumWidth, m_PinNameWidth; /* (Unused) Pin num and Pin name text width */
public:
LibDrawPin(void);
@ -204,6 +206,9 @@ public:
int ReturnPinDrawOrient(int TransMat[2][2]);
void ReturnPinStringNum(wxString & buffer);
void SetPinNumFromString(wxString & buffer);
void DrawPinSymbol(WinEDA_DrawPanel * panel, wxDC * DC, const wxPoint & pin_pos, int orient,
int DrawMode, int Color = -1);
void DrawPinTexts(WinEDA_DrawPanel * panel, wxDC * DC,
wxPoint & pin_pos, int orient,
int TextInside, bool DrawPinNum, bool DrawPinName,
@ -216,12 +221,10 @@ public:
class LibDrawArc : public LibEDA_BaseStruct
{
public:
wxPoint m_Pos; /* Position du point de reference (Centre)*/
int m_Rayon;
int m_Width;
int m_Fill;
int t1, t2; /* position des 2 extremites de l'arc en 0,1 degres */
wxPoint m_Start, m_End; /* position des 2 extremites de l'arc en coord reelles*/
wxPoint m_ArcStart, m_ArcEnd; /* position des 2 extremites de l'arc en coord reelles*/
public:
LibDrawArc(void);
@ -233,9 +236,7 @@ public:
class LibDrawCircle : public LibEDA_BaseStruct
{
public:
wxPoint m_Pos; /* Position du point de reference */
int m_Rayon;
int m_Width;
int m_Fill;
public:
@ -248,7 +249,6 @@ public:
class LibDrawText : public LibEDA_BaseStruct
{
public:
wxPoint m_Pos; /* Position du point de reference */
int m_Horiz;
wxSize m_Size;
int m_Type;
@ -264,9 +264,7 @@ public:
class LibDrawSquare : public LibEDA_BaseStruct
{
public:
wxPoint m_Start;
wxPoint m_End;
int m_Width;
int m_Fill;
public:
@ -279,9 +277,7 @@ public:
class LibDrawSegment : public LibEDA_BaseStruct
{
public:
wxPoint m_Start;
wxPoint m_End;
int m_Width;
public:
LibDrawSegment(void);
@ -294,7 +290,6 @@ class LibDrawPolyline : public LibEDA_BaseStruct
{
public:
int n, *PolyList;
int m_Width;
int m_Fill;
public:

View File

@ -50,14 +50,25 @@ LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
}
else
{
DrawEntry = LocatePin(m_CurrentScreen->m_Curseur, CurrentLibEntry,
DrawEntry = LocatePin(m_CurrentScreen->m_MousePosition, CurrentLibEntry,
CurrentUnit, CurrentConvert);
if (DrawEntry == NULL )
{
DrawEntry = LocateDrawItem(GetScreen(), CurrentLibEntry,CurrentUnit,
DrawEntry = LocateDrawItem(GetScreen(), GetScreen()->m_MousePosition,
CurrentLibEntry,CurrentUnit,
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
}
if (DrawEntry == NULL )
DrawEntry = LocatePin(m_CurrentScreen->m_Curseur, CurrentLibEntry,
CurrentUnit, CurrentConvert);
if (DrawEntry == NULL )
{
DrawEntry = LocateDrawItem(GetScreen(), GetScreen()->m_Curseur,
CurrentLibEntry,CurrentUnit,
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
}
if ( DrawEntry ) DrawEntry->Display_Infos_DrawEntry(this);
else
@ -110,14 +121,24 @@ LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
break;
case ID_LIBEDIT_DELETE_ITEM_BUTT :
DrawEntry = LocatePin(m_CurrentScreen->m_Curseur, CurrentLibEntry,
DrawEntry = LocatePin(m_CurrentScreen->m_MousePosition, CurrentLibEntry,
CurrentUnit, CurrentConvert);
if (DrawEntry == NULL )
{
DrawEntry = LocateDrawItem(GetScreen(), CurrentLibEntry,CurrentUnit,
DrawEntry = LocateDrawItem(GetScreen(), m_CurrentScreen->m_MousePosition,
CurrentLibEntry,CurrentUnit,
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
}
if (DrawEntry == NULL )
DrawEntry = LocatePin(m_CurrentScreen->m_Curseur, CurrentLibEntry,
CurrentUnit, CurrentConvert);
if (DrawEntry == NULL )
{
DrawEntry = LocateDrawItem(GetScreen(), m_CurrentScreen->m_Curseur,
CurrentLibEntry,CurrentUnit,
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
}
if ( DrawEntry == NULL )
{
AfficheDoc(this, CurrentLibEntry->m_Doc.GetData(),
@ -167,13 +188,23 @@ LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
if ( !m_ID_current_state || // Simple localisation des elements
(DrawEntry == NULL) || (DrawEntry->m_Flags == 0) )
{
DrawEntry = LocatePin(m_CurrentScreen->m_Curseur, CurrentLibEntry,
DrawEntry = LocatePin(m_CurrentScreen->m_MousePosition, CurrentLibEntry,
CurrentUnit, CurrentConvert);
if ( DrawEntry == NULL )
{
DrawEntry = CurrentDrawItem = LocateDrawItem(GetScreen(), CurrentLibEntry,CurrentUnit,
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
}
if ( DrawEntry == NULL )
DrawEntry = LocatePin(m_CurrentScreen->m_Curseur, CurrentLibEntry,
CurrentUnit, CurrentConvert);
if ( DrawEntry == NULL )
{
DrawEntry = CurrentDrawItem = LocateDrawItem((SCH_SCREEN*)m_CurrentScreen,
m_CurrentScreen->m_MousePosition,CurrentLibEntry,CurrentUnit,
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
}
if ( DrawEntry == NULL )
{
DrawEntry = CurrentDrawItem = LocateDrawItem((SCH_SCREEN*)m_CurrentScreen,
m_CurrentScreen->m_Curseur, CurrentLibEntry,CurrentUnit,
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
}
if ( DrawEntry == NULL )
{
DrawEntry = CurrentDrawItem = (LibEDA_BaseStruct*)
@ -242,6 +273,7 @@ LibEDA_BaseStruct* DrawEntry = CurrentDrawItem;
case COMPONENT_FIELD_DRAW_TYPE:
if( DrawEntry->m_Flags == 0 )
{
EditField(DC, (LibDrawField *)DrawEntry);
}
break;

View File

@ -43,7 +43,13 @@ bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
DrawEntry = LocatePin(m_CurrentScreen->m_Curseur, CurrentLibEntry, CurrentUnit, CurrentConvert);
if ( DrawEntry == NULL )
{
DrawEntry = CurrentDrawItem = LocateDrawItem(GetScreen(), CurrentLibEntry,CurrentUnit,
DrawEntry = CurrentDrawItem = LocateDrawItem(GetScreen(),
GetScreen()->m_MousePosition,CurrentLibEntry,CurrentUnit,
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
}
if ( DrawEntry == NULL )
{
DrawEntry = CurrentDrawItem = LocateDrawItem(GetScreen(), GetScreen()->m_Curseur, CurrentLibEntry,CurrentUnit,
CurrentConvert,LOCATE_ALL_DRAW_ITEM);
}
if ( DrawEntry == NULL )

View File

@ -100,6 +100,7 @@ LibDrawField *Field = (LibDrawField *)CurrentDrawItem;
break;
}
int LineWidth = MAX(Field->m_Width, g_DrawMinimunLineWidth);
if( Field->m_Attributs & TEXT_NO_VISIBLE ) color = DARKGRAY;
if( erase )
DrawGraphicText(panel, DC,
@ -107,7 +108,7 @@ LibDrawField *Field = (LibDrawField *)CurrentDrawItem;
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
Field->m_HJustify, Field->m_VJustify, LineWidth);
LastTextPosition.x = panel->GetScreen()->m_Curseur.x;
@ -120,7 +121,7 @@ LibDrawField *Field = (LibDrawField *)CurrentDrawItem;
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
Field->m_HJustify, Field->m_VJustify, LineWidth);
}
/*******************************************************************/
@ -131,10 +132,8 @@ int color;
if(Field == NULL ) return;
GRSetDrawMode(DC, GR_DEFAULT_DRAWMODE);
switch (Field->m_FieldId)
{
{
case REFERENCE:
color = ReturnLayerColor(LAYER_REFERENCEPART);
break;
@ -146,18 +145,25 @@ int color;
default:
color = ReturnLayerColor(LAYER_FIELDS);
break;
}
}
if( Field->m_Attributs & TEXT_NO_VISIBLE ) color = DARKGRAY;
Field->m_Flags = 0;
if( (Field->m_Attributs & TEXT_NO_VISIBLE) != 0 ) color = DARKGRAY;
Field->m_Pos.x = GetScreen()->m_Curseur.x;
Field->m_Pos.y = - GetScreen()->m_Curseur.y;
int LineWidth = MAX(Field->m_Width, g_DrawMinimunLineWidth);
DrawPanel->CursorOff(DC);
GRSetDrawMode(DC, GR_DEFAULT_DRAWMODE);
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
Field->m_HJustify, Field->m_VJustify, LineWidth);
Field->m_Flags = 0;
DrawPanel->CursorOn(DC);
m_CurrentScreen->SetModify();
DrawPanel->ManageCurseur = NULL;
@ -200,11 +206,12 @@ wxString title = wxT("Text:");
Text.Replace( wxT(" ") , wxT("_") );
GRSetDrawMode(DC, g_XorMode);
int LineWidth = MAX(Field->m_Width, g_DrawMinimunLineWidth);
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
Field->m_HJustify, Field->m_VJustify, LineWidth);
if( ! Text.IsEmpty() )
{
@ -219,7 +226,7 @@ wxString title = wxT("Text:");
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
Field->m_HJustify, Field->m_VJustify, LineWidth);
m_CurrentScreen->SetModify();
@ -254,14 +261,17 @@ int color;
break;
}
if( Field->m_Attributs & TEXT_NO_VISIBLE ) color = DARKGRAY;
if( (Field->m_Attributs & TEXT_NO_VISIBLE) != 0 ) color = DARKGRAY;
DrawPanel->CursorOff(DC);
GRSetDrawMode(DC, g_XorMode);
int LineWidth = MAX(Field->m_Width, g_DrawMinimunLineWidth);
DrawGraphicText(DrawPanel, DC, wxPoint(Field->m_Pos.x, - Field->m_Pos.y),
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
Field->m_HJustify, Field->m_VJustify, LineWidth);
if( Field->m_Orient) Field->m_Orient = 0;
else Field->m_Orient = 1;
@ -272,7 +282,8 @@ int color;
color, Field->m_Text,
Field->m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
Field->m_Size,
Field->m_HJustify, Field->m_VJustify);
Field->m_HJustify, Field->m_VJustify, LineWidth);
DrawPanel->CursorOn(DC);
}

View File

@ -27,16 +27,15 @@ static bool IsPointInBox( int pX, int pY,
static bool IsPointOnSegment( int pX, int pY,
int SegmX1, int SegmY1, int SegmX2, int SegmY2, int seuil = 0);
static bool SnapPoint2(const wxPoint & PosRef, int SearchMask,
EDA_BaseStruct *DrawList, DrawPickedStruct *DontSnapList);
EDA_BaseStruct *DrawList, DrawPickedStruct *DontSnapList, int zoom_value);
/*********************************************************************/
EDA_SchComponentStruct * LocateSmallestComponent( SCH_SCREEN * Screen )
/*********************************************************************/
/* Recherche du plus petit (en surface) composant pointe par la souris
Si 2 (ou plus) composants sont trouves, un pointeur sur le composant
le plus petit est retourne
/* Search the smaller (considering its area) component under the mouse cursor or the pcb cursor
If more than 1 component is found, a pointer to the smaller component is returned
*/
{
EDA_SchComponentStruct * DrawLibItem = NULL, * LastDrawLibItem = NULL;
@ -48,8 +47,12 @@ float sizeref = 0, sizecurr;
while ( DrawList )
{
if( ( SnapPoint2(Screen->m_Curseur, LIBITEM,
DrawList,NULL)) == FALSE ) break;
if( ( SnapPoint2(Screen->m_MousePosition, LIBITEM,
DrawList,NULL, Screen->GetZoom())) == FALSE )
{
if( ( SnapPoint2(Screen->m_Curseur, LIBITEM,
DrawList,NULL, Screen->GetZoom())) == FALSE ) break;
}
DrawLibItem = (EDA_SchComponentStruct *) LastSnappedStruct;
DrawList = DrawLibItem->Pnext;
if ( LastDrawLibItem == NULL ) // First time a component is located
@ -74,10 +77,7 @@ float sizeref = 0, sizecurr;
}
/* 2 functions EDA_BaseStruct * PickStruct:
Search in block, or Search at location pos
SearchMask = (bitwise OR):
/* SearchMask = (bitwise OR):
LIBITEM
WIREITEM
BUSITEM
@ -100,7 +100,7 @@ float sizeref = 0, sizecurr;
Return:
-Bloc searc:
-Bloc search:
pointeur sur liste de pointeurs de structures si Plusieurs
structures selectionnees.
pointeur sur la structure si 1 seule
@ -118,11 +118,11 @@ EDA_BaseStruct * PickStruct(const wxPoint & refpos,
*/
{
bool Snapped;
int zoom = ActiveScreen->GetZoom();
if ( DrawList == NULL ) return NULL;
if( (Snapped = SnapPoint2(refpos, SearchMask,
DrawList,NULL)) != FALSE)
DrawList,NULL, zoom)) != FALSE)
{
return( LastSnappedStruct);
}
@ -186,7 +186,7 @@ EDA_BaseStruct *DrawStruct;
* The routine returns TRUE if point was snapped. *
*****************************************************************************/
bool SnapPoint2(const wxPoint & PosRef, int SearchMask,
EDA_BaseStruct *DrawList, DrawPickedStruct *DontSnapList)
EDA_BaseStruct *DrawList, DrawPickedStruct *DontSnapList, int zoom_value)
{
int i, *Points, x = PosRef.x, y = PosRef.y;
int x1, y1, x2, y2, NumOfPoints2;
@ -272,10 +272,11 @@ int dx, dy;
#undef STRUCT
#define STRUCT ((DrawJunctionStruct *) DrawList)
if( !(SearchMask & JUNCTIONITEM) )break;
x1 = STRUCT->m_Pos.x - (DRAWJUNCTION_SIZE / 2);
y1 = STRUCT->m_Pos.y - (DRAWJUNCTION_SIZE / 2);
x2 = STRUCT->m_Pos.x + (DRAWJUNCTION_SIZE / 2);
y2 = STRUCT->m_Pos.y + (DRAWJUNCTION_SIZE / 2);
dx = DRAWJUNCTION_SIZE / 2;
x1 = STRUCT->m_Pos.x - dx;
y1 = STRUCT->m_Pos.y - dx;
x2 = STRUCT->m_Pos.x + dx;
y2 = STRUCT->m_Pos.y + dx;
if(IsPointInBox(x, y, x1,y1, x2,y2) )
{
LastSnappedStruct = DrawList;
@ -288,10 +289,11 @@ int dx, dy;
#undef STRUCT
#define STRUCT ((DrawNoConnectStruct *) DrawList)
if( !(SearchMask & NOCONNECTITEM) )break;
x1 = STRUCT->m_Pos.x - (DRAWNOCONNECT_SIZE / 2);
y1 = STRUCT->m_Pos.y - (DRAWNOCONNECT_SIZE / 2);
x2 = STRUCT->m_Pos.x + (DRAWNOCONNECT_SIZE / 2);
y2 = STRUCT->m_Pos.y + (DRAWNOCONNECT_SIZE / 2);
dx = (DRAWNOCONNECT_SIZE*zoom_value) / 2;
x1 = STRUCT->m_Pos.x - dx;
y1 = STRUCT->m_Pos.y - dx;
x2 = STRUCT->m_Pos.x + dx;
y2 = STRUCT->m_Pos.y + dx;
if(IsPointInBox(x, y, x1,y1, x2,y2) )
{
LastSnappedStruct = DrawList;
@ -303,10 +305,11 @@ int dx, dy;
#undef STRUCT
#define STRUCT ((DrawMarkerStruct *) DrawList)
if( !(SearchMask & MARKERITEM) )break;
x1 = STRUCT->m_Pos.x - DRAWMARKER_SIZE / 4;
y1 = STRUCT->m_Pos.y - DRAWMARKER_SIZE / 4;
x2 = STRUCT->m_Pos.x + DRAWMARKER_SIZE / 4;
y2 = STRUCT->m_Pos.y + DRAWMARKER_SIZE / 4;
dx = (DRAWMARKER_SIZE*zoom_value) / 2;
x1 = STRUCT->m_Pos.x - dx;
y1 = STRUCT->m_Pos.y - dx;
x2 = STRUCT->m_Pos.x + dx;
y2 = STRUCT->m_Pos.y + dx;
if(IsPointInBox(x, y, x1,y1, x2,y2) )
{
LastSnappedStruct = DrawList;
@ -712,10 +715,10 @@ static bool IsPointOnSegment( int pX, int pY,
else return(FALSE);
}
/****************************************************************/
LibEDA_BaseStruct * LocateDrawItem(SCH_SCREEN * Screen, EDA_LibComponentStruct * LibEntry,
int Unit, int Convert, int masque)
/****************************************************************/
/*********************************************************************************/
LibEDA_BaseStruct * LocateDrawItem(SCH_SCREEN * Screen, const wxPoint & refpoint,
EDA_LibComponentStruct * LibEntry, int Unit, int Convert, int masque)
/*********************************************************************************/
/* Routine de localisation d'un element de dessin de symbole( sauf pins )
Unit = Unite d'appartenance (si Unit = 0, recherche sur toutes unites)
Convert = Conversion d'appartenance (si Convert = 0, recherche sur
@ -738,8 +741,8 @@ int seuil;
DrawItem = LibEntry->m_Drawings;
seuil = 3; /* Tolerance: 1/2 pas de petite grille */
px = Screen->m_Curseur.x;
py = Screen->m_Curseur.y;
px = refpoint.x;
py = refpoint.y;
for( ; DrawItem != NULL ; DrawItem = DrawItem->Next() )
{
@ -772,24 +775,24 @@ int seuil;
break;
case COMPONENT_RECT_DRAW_TYPE:
{
{ // Locate a rect if the mouse cursor is on a segment
LibDrawSquare * Square = (LibDrawSquare *) DrawItem;
if( (masque & LOCATE_COMPONENT_RECT_DRAW_TYPE) == 0) break;
if(IsPointOnSegment(px,py,
Square->m_Start.x, - Square->m_Start.y,
Square->m_End.x, - Square->m_Start.y, seuil) )
if(IsPointOnSegment(px,py, // locate lower segment
Square->m_Pos.x, - Square->m_Pos.y,
Square->m_End.x, - Square->m_Pos.y, seuil) )
return(DrawItem);
if(IsPointOnSegment(px, py,
Square->m_End.x, - Square->m_Start.y,
if(IsPointOnSegment(px, py, // locate right segment
Square->m_End.x, - Square->m_Pos.y,
Square->m_End.x, - Square->m_End.y, seuil) )
return(DrawItem);
if(IsPointOnSegment(px, py,
if(IsPointOnSegment(px, py, // locate upper segment
Square->m_End.x, - Square->m_End.y,
Square->m_Start.x, - Square->m_End.y, seuil) )
Square->m_Pos.x, - Square->m_End.y, seuil) )
return(DrawItem);
if(IsPointOnSegment(px, py,
Square->m_Start.x, - Square->m_End.y,
Square->m_Start.x, - Square->m_Start.y, seuil) )
if(IsPointOnSegment(px, py, // locate left segment
Square->m_Pos.x, - Square->m_End.y,
Square->m_Pos.x, - Square->m_Pos.y, seuil) )
return(DrawItem);
}
break;
@ -813,7 +816,7 @@ int seuil;
LibDrawSegment * Segment = (LibDrawSegment *) DrawItem;
if( (masque & LOCATE_COMPONENT_LINE_DRAW_TYPE) == 0) break;
if(IsPointOnSegment(px, py,
Segment->m_Start.x, - Segment->m_Start.y,
Segment->m_Pos.x, - Segment->m_Pos.y,
Segment->m_End.x, - Segment->m_End.y, seuil) )
return(DrawItem);
}

View File

@ -16,7 +16,7 @@ $(TARGET).exe: $(OBJECTS) $(TARGET)_resources.o $(EDALIBS)
$(CXX) $(ALL_LDFLAGS) -o $(TARGET).exe $(OBJECTS)\
$(TARGET)_resources.o $(EDALIBS) $(SYSWXLIB)
install:
install: $(TARGET).exe
cp -v $(TARGET).exe $(KICAD_BIN)

View File

@ -27,10 +27,10 @@ $(TARGET): $(OBJECTS) makefile.gtk makefile.include $(EXTRALIBS) ../libs.linux
$(LD) $(OBJECTS) $(LDFLAGS) $(LIBS) -o $(TARGET)
netlist_form_pads-pcb: plugins/netlist_form_pads-pcb.cpp makefile.gtk
gcc -D__UNIX__ -Wall plugins/netlist_form_pads-pcb.cpp $(LIBSTDC) -o netlist_form_pads-pcb
gcc $(CXXFLAGS) -D__UNIX__ -Wall plugins/netlist_form_pads-pcb.cpp $(LIBSTDC) -o netlist_form_pads-pcb
install:
install: $(TARGET)
cp $(TARGET) $(KICAD_BIN)

View File

@ -1,187 +1,188 @@
# File: makefile.include
FINAL = 1
EESCHEMA_FLAGS= -DEESCHEMA
EXTRACPPFLAGS=$(KICAD_FLAGS) $(EESCHEMA_FLAGS) -I./ -Ibitmaps -I../include -I../eeschema
EXTRALIBS = ../common/common.a
# DEPEND = program.h general.h
OBJECTS = eeschema.o\
schedit.o\
load_one_schematic_file.o\
libedit_undo_redo.o\
schematic_undo_redo.o\
dialog_create_component.o\
libedit_onrightclick.o\
libedit_onleftclick.o\
dangling_ends.o\
setpage.o\
cmpclass.o\
class_hierarchy_sheet.o\
class_text-label.o\
component_class.o\
libclass.o\
dialog_options.o\
tool_lib.o\
tool_sch.o\
tool_viewlib.o\
drawframe.o\
schframe.o\
viewlib_frame.o\
drawpanel.o\
wxprint.o\
lib_export.o \
busentry.o \
bus-wire-junction.o \
eelibs1.o eelibs2.o \
eeload.o\
block.o\
block_libedit.o\
eeredraw.o\
dialog_eeschema_config.o\
eestring.o eelayer.o \
priorque.o eeconfig.o \
affiche.o \
zoom.o \
getpart.o\
netlist.o\
netlist_control.o\
edit_label.o\
edit_component_in_schematic.o\
locate.o \
save_schemas.o sheet.o \
viewlibs.o \
libedit.o \
libframe.o \
symbedit.o \
pinedit.o \
libfield.o \
edit_component_in_lib.o \
menubar.o \
savelib.o symbtext.o \
symbdraw.o \
hierarch.o files-io.o \
annotate.o plothpgl.o \
plot.o libalias.o \
plotps.o netform.o \
delsheet.o \
infospgm.o \
delete.o dialog_build_BOM.o \
erc.o\
dialog_erc.o\
selpart.o \
libarch.o \
cleanup.o\
sheetlab.o \
class_screen.o \
database.o\
onrightclick.o \
onleftclick.o \
find.o \
controle.o\
hotkeys.o\
svg_print.o
eeschema.o: eeschema.cpp program.h general.h $(DEPEND)
edit_component_in_lib.o: edit_component_in_lib.cpp\
dialog_edit_component_in_lib.cpp dialog_edit_component_in_lib.h $(DEPEND)
edit_component_in_schematic.o: edit_component_in_schematic.cpp\
dialog_edit_component_in_schematic.cpp dialog_edit_component_in_schematic.h $(DEPEND)
edit_label.o: edit_label.cpp dialog_edit_label.cpp dialog_edit_label.h $(DEPEND)
dialog_create_component.o: dialog_create_component.cpp dialog_create_component.h $(DEPEND)
busentry.o: busentry.cpp $(DEPEND)
symbdraw.o: symbdraw.cpp dialog_cmp_graphic_properties.cpp\
dialog_cmp_graphic_properties.h $(DEPEND)
component_class.o: component_class.cpp component_class.h
menubar.o: menubar.cpp $(DEPEND)
find.o:find.cpp dialog_find.cpp dialog_find.h $(DEPEND)
eeconfig.o: eeconfig.cpp eeconfig.h $(DEPEND)
annotate.o: annotate.cpp annotate_dialog.cpp annotate_dialog.h $(DEPEND) netlist.h
netlist.o: netlist.cpp $(DEPEND) netlist.h
netlist_control.o: netlist_control.cpp $(DEPEND) netlist.h
netform.o: netform.cpp $(DEPEND) netlist.h
erc.o: erc.cpp dialog_erc.h $(DEPEND) netlist.h
dialog_erc.o: dialog_erc.cpp dialog_erc.h $(DEPEND)
setpage.o: ../share/setpage.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
svg_print.o: ../share/svg_print.cpp ../share/svg_print.h $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
zoom.o: ../share/zoom.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
treeprj.o: ../share/treeprj.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
drawpanel.o: ../share/drawpanel.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
mdiframe.o: ../share/mdiframe.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
buildmnu.o: ../share/buildmnu.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
pinedit.o: pinedit.cpp pinedit-dialog.cpp pinedit-dialog.h $(DEPEND)
tool_lib.o: tool_lib.cpp $(DEPEND)
controle.o: controle.cpp $(DEPEND) ../include/eda_dde.h
wxprint.o: ../share/wxprint.cpp ../share/dialog_print.cpp ../share/dialog_print.h $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
bus-wire-junction.o: bus-wire-junction.cpp $(DEPEND)
drawframe.o: ../share/drawframe.cpp
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
eelibs1.o: eelibs1.cpp $(DEPEND)
eelibs2.o: eelibs2.cpp $(DEPEND)
eeload.o: eeload.cpp $(DEPEND)
block.o: block.cpp $(DEPEND)
block_libedit.o: block_libedit.cpp $(DEPEND)
onrightclick.o: onrightclick.cpp $(DEPEND)
libedit_undo_redo.o: libedit_undo_redo.cpp $(DEPEND)
libedit_onrightclick.o: libedit_onrightclick.cpp $(DEPEND)
libedit_onleftclick.o: libedit_onleftclick.cpp $(DEPEND)
onleftclick.o: onleftclick.cpp $(DEPEND)
eeredraw.o: eeredraw.cpp $(DEPEND)
dialog_eeschema_config.o: dialog_eeschema_config.cpp dialog_eeschema_config.h $(DEPEND)
libedit.o: libedit.cpp $(DEPEND)
infospgm.o: ../share/infospgm.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
# File: makefile.include
FINAL = 1
EESCHEMA_FLAGS= -DEESCHEMA
EXTRACPPFLAGS += $(KICAD_FLAGS) $(EESCHEMA_FLAGS) -fno-strict-aliasing -I./ -Ibitmaps -I../include -I../eeschema
EXTRALIBS = ../common/common.a
# DEPEND = program.h general.h
OBJECTS = eeschema.o\
schedit.o\
load_one_schematic_file.o\
libedit_undo_redo.o\
schematic_undo_redo.o\
dialog_create_component.o\
libedit_onrightclick.o\
libedit_onleftclick.o\
dangling_ends.o\
setpage.o\
cmpclass.o\
class_hierarchy_sheet.o\
class_text-label.o\
component_class.o\
libclass.o\
dialog_options.o\
tool_lib.o\
tool_sch.o\
tool_viewlib.o\
drawframe.o\
schframe.o\
viewlib_frame.o\
drawpanel.o\
wxprint.o\
lib_export.o \
busentry.o \
bus-wire-junction.o \
eelibs_read_libraryfiles.o \
eelibs_draw_components.o \
eeload.o\
block.o\
block_libedit.o\
eeredraw.o\
dialog_eeschema_config.o\
eestring.o eelayer.o \
priorque.o eeconfig.o \
affiche.o \
zoom.o \
getpart.o\
netlist.o\
netlist_control.o\
edit_label.o\
edit_component_in_schematic.o\
locate.o \
save_schemas.o sheet.o \
viewlibs.o \
libedit.o \
libframe.o \
symbedit.o \
pinedit.o \
libfield.o \
edit_component_in_lib.o \
menubar.o \
savelib.o symbtext.o \
symbdraw.o \
hierarch.o files-io.o \
annotate.o plothpgl.o \
plot.o libalias.o \
plotps.o netform.o \
delsheet.o \
infospgm.o \
delete.o dialog_build_BOM.o \
erc.o\
dialog_erc.o\
selpart.o \
libarch.o \
cleanup.o\
sheetlab.o \
class_screen.o \
database.o\
onrightclick.o \
onleftclick.o \
find.o \
controle.o\
hotkeys.o\
svg_print.o
eeschema.o: eeschema.cpp program.h general.h $(DEPEND)
edit_component_in_lib.o: edit_component_in_lib.cpp\
dialog_edit_component_in_lib.cpp dialog_edit_component_in_lib.h $(DEPEND)
edit_component_in_schematic.o: edit_component_in_schematic.cpp\
dialog_edit_component_in_schematic.cpp dialog_edit_component_in_schematic.h $(DEPEND)
edit_label.o: edit_label.cpp dialog_edit_label.cpp dialog_edit_label.h $(DEPEND)
dialog_create_component.o: dialog_create_component.cpp dialog_create_component.h $(DEPEND)
busentry.o: busentry.cpp $(DEPEND)
symbdraw.o: symbdraw.cpp dialog_cmp_graphic_properties.cpp\
dialog_cmp_graphic_properties.h $(DEPEND)
component_class.o: component_class.cpp component_class.h
menubar.o: menubar.cpp $(DEPEND)
find.o:find.cpp dialog_find.cpp dialog_find.h $(DEPEND)
eeconfig.o: eeconfig.cpp eeconfig.h $(DEPEND)
annotate.o: annotate.cpp annotate_dialog.cpp annotate_dialog.h $(DEPEND) netlist.h
netlist.o: netlist.cpp $(DEPEND) netlist.h
netlist_control.o: netlist_control.cpp $(DEPEND) netlist.h
netform.o: netform.cpp $(DEPEND) netlist.h
erc.o: erc.cpp dialog_erc.h $(DEPEND) netlist.h
dialog_erc.o: dialog_erc.cpp dialog_erc.h $(DEPEND)
setpage.o: ../share/setpage.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
svg_print.o: ../share/svg_print.cpp ../share/svg_print.h $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
zoom.o: ../share/zoom.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
treeprj.o: ../share/treeprj.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
drawpanel.o: ../share/drawpanel.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
mdiframe.o: ../share/mdiframe.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
buildmnu.o: ../share/buildmnu.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
pinedit.o: pinedit.cpp pinedit-dialog.cpp pinedit-dialog.h $(DEPEND)
tool_lib.o: tool_lib.cpp $(DEPEND)
controle.o: controle.cpp $(DEPEND) ../include/eda_dde.h
wxprint.o: ../share/wxprint.cpp ../share/dialog_print.cpp ../share/dialog_print.h $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
bus-wire-junction.o: bus-wire-junction.cpp $(DEPEND)
drawframe.o: ../share/drawframe.cpp
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp
eelibs_read_libraryfiles.o: eelibs_read_libraryfiles.cpp $(DEPEND)
eelibs_draw_components.o: eelibs_draw_components.cpp $(DEPEND)
eeload.o: eeload.cpp $(DEPEND)
block.o: block.cpp $(DEPEND)
block_libedit.o: block_libedit.cpp $(DEPEND)
onrightclick.o: onrightclick.cpp $(DEPEND)
libedit_undo_redo.o: libedit_undo_redo.cpp $(DEPEND)
libedit_onrightclick.o: libedit_onrightclick.cpp $(DEPEND)
libedit_onleftclick.o: libedit_onleftclick.cpp $(DEPEND)
onleftclick.o: onleftclick.cpp $(DEPEND)
eeredraw.o: eeredraw.cpp $(DEPEND)
dialog_eeschema_config.o: dialog_eeschema_config.cpp dialog_eeschema_config.h $(DEPEND)
libedit.o: libedit.cpp $(DEPEND)
infospgm.o: ../share/infospgm.cpp $(DEPEND)
$(CC) -c $(EDACPPFLAGS) -o $@ ../share/$*.cpp

View File

@ -15,11 +15,12 @@ TARGET = eeschema
CPPFLAGS = -Wall -O2 `wx-config --cxxflags`
all: $(TARGET) netlist_form_pads-pcb
all: $(TARGET) $(TARGET).app netlist_form_pads-pcb
include makefile.include
CPPFLAGS += $(EXTRACPPFLAGS)
CPPFLAGS += -arch i386 -arch ppc
EDACPPFLAGS = $(CPPFLAGS)
$(TARGET): $(OBJECTS) $(TARGET).r makefile.macosx makefile.include $(EXTRALIBS) ../libs.macosx
@ -27,12 +28,28 @@ $(TARGET): $(OBJECTS) $(TARGET).r makefile.macosx makefile.include $(EXTRALIBS)
$(RESCOMP) -o $(TARGET) Carbon.r $(TARGET).r
$(SETFILE) -a C $(TARGET)
$(TARGET).app: $(OBJS)
rm -Rf $(TARGET).app
mkdir -p $(TARGET).app
mkdir -p $(TARGET).app/Contents
mkdir -p $(TARGET).app/Contents/MacOS
mkdir -p $(TARGET).app/Contents/Frameworks
mkdir -p $(TARGET).app/Contents/Resources
sed -e "s/IDENTIFIER/`echo . | sed -e s,\.\./,,g | sed -e s,/,.,g`/" -e "s/EXECUTABLE/$(TARGET)/" \
-e "s/VERSION/$(MKMK_WX_VERSION)/" $(HOME)/wxMac-$(MKMK_WX_VERSION)/src/mac/carbon/wxmac.icns \
>$(TARGET).app/Contents/Resources/wxmac.icns
sed -e "s/IDENTIFIER/`echo . | sed -e s,\.\./,,g | sed -e s,/,.,g`/" -e "s/EXECUTABLE/$(TARGET)/"\
-e "s/VERSION/$(MKMK_WX_VERSION)/" $(HOME)/wxMac-$(MKMK_WX_VERSION)/src/mac/carbon/Info.plist.in \
>$(TARGET).app/Contents/Info.plist
echo -n "APPL????" >$(TARGET).app/Contents/PkgInfo
ln -f $(TARGET) $(TARGET).app/Contents/MacOS/$(TARGET)
netlist_form_pads-pcb: plugins/netlist_form_pads-pcb.cpp
gcc -Wall plugins/netlist_form_pads-pcb.cpp -o netlist_form_pads-pcb
gcc $(CXXFLAGS) -Wall plugins/netlist_form_pads-pcb.cpp -o netlist_form_pads-pcb
install:
install: $(TARGET)
cp $(TARGET) $(KICAD_BIN)
cp netlist_form_pads-pcb $(KICAD_BIN)

View File

@ -39,6 +39,12 @@ wxMenuBar * menuBar = GetMenuBar();
item->SetBitmap(open_xpm);
m_FilesMenu->Append(item);
item = new wxMenuItem(m_FilesMenu, ID_LOAD_ONE_SHEET,
_("&Reload the current sheet"),
_("Load or reload a schematic file from file into the current sheet") );
item->SetBitmap(import_xpm);
m_FilesMenu->Append(item);
m_FilesMenu->AppendSeparator();
item = new wxMenuItem(m_FilesMenu,ID_SAVE_PROJECT,
_("&Save Schematic Project"),

View File

@ -90,7 +90,7 @@ public:
bool m_PartsLocked; // For multi part components: True if the part cannot be changed
int m_Unit; /* Numero de part */
int m_Sheet; /* Numero de hierarchie */
int m_TimeStamp; /* Signature temporelle */
unsigned long m_TimeStamp; /* Signature temporelle */
int m_IsNew; /* != 0 pour composants non annotes */
char m_TextValue[32]; /* Valeur */
char m_TextRef[32]; /* Reference ( hors numero ) */

View File

@ -65,10 +65,10 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PinPropertiesFrame, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_PinPropertiesFrame, wxDialog )
////@begin WinEDA_PinPropertiesFrame event table entries
EVT_BUTTON( wxID_OK, WinEDA_PinPropertiesFrame::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_PinPropertiesFrame::OnCancelClick )
EVT_BUTTON( wxID_OK, WinEDA_PinPropertiesFrame::OnOkClick )
////@end WinEDA_PinPropertiesFrame event table entries
END_EVENT_TABLE()
@ -100,14 +100,14 @@ int tmp, ii;
if ( CurrentPin ) msg = CurrentPin->m_PinName;
else msg = wxEmptyString;
m_PinNameCtrl->SetValue(msg);
tmp = CurrentPin ? CurrentPin->m_SizeName : LastPinNameSize;
tmp = CurrentPin ? CurrentPin->m_PinNameSize : LastPinNameSize;
msg = ReturnStringFromValue(g_UnitMetric, tmp, m_Parent->m_InternalUnits);
m_PinNameSizeCtrl->SetValue(msg);
msg = m_PinNameSizeText->GetLabel() + ReturnUnitSymbol();
m_PinNameSizeText->SetLabel(msg);
/* Init dialog pin num and pin num size values */
m_PinNumCtrl->SetValue(StringPinNum);
tmp = CurrentPin ? CurrentPin->m_SizeNum : LastPinNumSize;
tmp = CurrentPin ? CurrentPin->m_PinNumSize : LastPinNumSize;
msg = ReturnStringFromValue(g_UnitMetric, tmp, m_Parent->m_InternalUnits);
m_PinNumSizeCtrl->SetValue(msg);
msg = m_PinNumSizeText->GetLabel() + ReturnUnitSymbol();
@ -202,8 +202,10 @@ bool WinEDA_PinPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const w
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end WinEDA_PinPropertiesFrame creation
return true;
@ -218,7 +220,7 @@ void WinEDA_PinPropertiesFrame::CreateControls()
SetFont(*g_DialogFont);
////@begin WinEDA_PinPropertiesFrame content construction
// Generated by DialogBlocks, 23/02/2006 09:33:11 (unregistered)
// Generated by DialogBlocks, 20/02/2007 08:45:04 (unregistered)
WinEDA_PinPropertiesFrame* itemDialog1 = this;
@ -244,6 +246,7 @@ void WinEDA_PinPropertiesFrame::CreateControls()
wxStaticBox* itemStaticBoxSizer9Static = new wxStaticBox(itemDialog1, wxID_ANY, _(" Pin Options :"));
wxStaticBoxSizer* itemStaticBoxSizer9 = new wxStaticBoxSizer(itemStaticBoxSizer9Static, wxVERTICAL);
itemStaticBoxSizer9Static->SetForegroundColour(wxColour(64, 0, 128));
itemBoxSizer3->Add(itemStaticBoxSizer9, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText10 = new wxStaticText( itemDialog1, wxID_STATIC, _("Pin lenght :"), wxDefaultPosition, wxDefaultSize, 0 );
@ -288,6 +291,8 @@ void WinEDA_PinPropertiesFrame::CreateControls()
_("Down")
};
m_PinOrient = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Pin Orient:"), wxDefaultPosition, wxDefaultSize, 4, m_PinOrientStrings, 1, wxRA_SPECIFY_COLS );
m_PinOrient->SetSelection(0);
m_PinOrient->SetForegroundColour(wxColour(41, 84, 84));
itemBoxSizer15->Add(m_PinOrient, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxBoxSizer* itemBoxSizer22 = new wxBoxSizer(wxVERTICAL);
@ -296,11 +301,13 @@ void WinEDA_PinPropertiesFrame::CreateControls()
wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer22->Add(itemBoxSizer23, 0, wxGROW|wxALL, 5);
wxButton* itemButton24 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton24->SetDefault();
wxButton* itemButton24 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton24->SetForegroundColour(wxColour(0, 0, 160));
itemBoxSizer23->Add(itemButton24, 0, wxGROW|wxALL, 5);
wxButton* itemButton25 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
wxButton* itemButton25 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton25->SetDefault();
itemButton25->SetForegroundColour(wxColour(198, 0, 0));
itemBoxSizer23->Add(itemButton25, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxHORIZONTAL);
@ -316,6 +323,8 @@ void WinEDA_PinPropertiesFrame::CreateControls()
_("low out")
};
m_PinShape = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Pin Shape:"), wxDefaultPosition, wxDefaultSize, 7, m_PinShapeStrings, 1, wxRA_SPECIFY_COLS );
m_PinShape->SetSelection(0);
m_PinShape->SetForegroundColour(wxColour(0, 64, 0));
itemBoxSizer26->Add(m_PinShape, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxString m_PinElectricalTypeStrings[] = {
@ -331,6 +340,8 @@ void WinEDA_PinPropertiesFrame::CreateControls()
_("Open emit")
};
m_PinElectricalType = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("Electrical Type:"), wxDefaultPosition, wxDefaultSize, 10, m_PinElectricalTypeStrings, 1, wxRA_SPECIFY_COLS );
m_PinElectricalType->SetSelection(0);
m_PinElectricalType->SetForegroundColour(wxColour(68, 68, 34));
itemBoxSizer26->Add(m_PinElectricalType, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
////@end WinEDA_PinPropertiesFrame content construction

View File

@ -1,26 +1,26 @@
/////////////////////////////////////////////////////////////////////////////
// Name: pinedit-dialog.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 11/02/2006 13:30:59
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 11/02/2006 13:30:59
#ifndef _PINEDIT_DIALOG_H_
#define _PINEDIT_DIALOG_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "pinedit-dialog.h"
#endif
/*!
* Includes
*/
/////////////////////////////////////////////////////////////////////////////
// Name: pinedit-dialog.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 11/02/2006 13:30:59
// RCS-ID:
// Copyright: License GNU
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 11/02/2006 13:30:59
#ifndef _PINEDIT_DIALOG_H_
#define _PINEDIT_DIALOG_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "pinedit-dialog.h"
#endif
/*!
* Includes
*/
#include "fctsys.h"
#include "gr_basic.h"
@ -31,30 +31,25 @@
#include "id.h"
#include "protos.h"
////@begin includes
////@begin includes
#include "wx/spinctrl.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxSpinCtrl;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE _("Pin properties")
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION wxDefaultPosition
#define ID_TEXTCTRL 10001
#define ID_TEXTCTRL1 10002
#define ID_SPINCTRL 10003
@ -66,58 +61,63 @@ class wxSpinCtrl;
#define ID_RADIOBOX 10009
#define ID_RADIOBOX1 10012
#define ID_RADIOBOX2 10013
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_PinPropertiesFrame class declaration
*/
class WinEDA_PinPropertiesFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_PinPropertiesFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_PinPropertiesFrame( );
WinEDA_PinPropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id = SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_PinPropertiesFrame event handler declarations
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE _("Pin properties")
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION wxDefaultPosition
////@end control identifiers
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event );
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_PinPropertiesFrame class declaration
*/
class WinEDA_PinPropertiesFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_PinPropertiesFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_PinPropertiesFrame( );
WinEDA_PinPropertiesFrame( WinEDA_LibeditFrame* parent, wxWindowID id = SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PINPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PINPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PINPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PINPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_PINPROPERTIESFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_PinPropertiesFrame event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
////@end WinEDA_PinPropertiesFrame event handler declarations
////@begin WinEDA_PinPropertiesFrame member function declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event );
////@end WinEDA_PinPropertiesFrame event handler declarations
////@begin WinEDA_PinPropertiesFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_PinPropertiesFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@end WinEDA_PinPropertiesFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
void PinPropertiesAccept(wxCommandEvent& event);
void SetPinName(const wxString & newname, int newsize);
void SetPinNum(const wxString & newnum, int newsize);
@ -127,7 +127,7 @@ public:
void SetPinOrient(int neworient);
void SetAttributsPin(bool draw, bool unit, bool convert);
////@begin WinEDA_PinPropertiesFrame member variables
////@begin WinEDA_PinPropertiesFrame member variables
wxTextCtrl* m_PinNameCtrl;
wxTextCtrl* m_PinNumCtrl;
wxSpinCtrl* m_PinSize;
@ -141,10 +141,10 @@ public:
wxRadioBox* m_PinOrient;
wxRadioBox* m_PinShape;
wxRadioBox* m_PinElectricalType;
////@end WinEDA_PinPropertiesFrame member variables
////@end WinEDA_PinPropertiesFrame member variables
WinEDA_LibeditFrame * m_Parent;
};
#endif
// _PINEDIT_DIALOG_H_
};
#endif
// _PINEDIT_DIALOG_H_

View File

@ -18,6 +18,7 @@
<string name="copyright_string">"License GNU"</string>
<string name="resource_prefix">""</string>
<bool name="use_two_step_construction">0</bool>
<bool name="use_enums">0</bool>
<string name="current_platform">"&lt;All platforms&gt;"</string>
<string name="target_wx_version">"&lt;Any&gt;"</string>
<string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
@ -95,9 +96,17 @@
<string name="source_encoding">"&lt;System&gt;"</string>
<string name="project_encoding">"&lt;System&gt;"</string>
<string name="resource_archive">""</string>
<long name="text_file_type">0</long>
<bool name="use_tabs">0</bool>
<long name="indent_size">4</long>
<string name="whitespace_after_return_type">" "</string>
<string name="resource_xrc_cpp">""</string>
<bool name="use_resource_archive">0</bool>
<bool name="use_generated_xrc_cpp">0</bool>
<bool name="always_generate_xrc">1</bool>
<bool name="archive_xrc_files">1</bool>
<bool name="archive_image_files">1</bool>
<bool name="xrc_retain_relative_paths">1</bool>
</header>
<data>
<document>
@ -237,7 +246,9 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxCLIP_CHILDREN ">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxCLIP_CHILDREN">0</bool>
<bool name="proxy-wxTAB_TRAVERSAL">0</bool>
<bool name="proxy-wxWS_EX_VALIDATE_RECURSIVELY">0</bool>
<bool name="proxy-wxWS_EX_BLOCK_EVENTS">1</bool>
@ -307,6 +318,7 @@
<string name="proxy-Class">"wxStaticText"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Pin Name :"</string>
<long name="proxy-Wrapping width">-1</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
@ -328,6 +340,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -396,6 +410,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -431,6 +447,7 @@
<string name="proxy-Class">"wxStaticText"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Pin Num :"</string>
<long name="proxy-Wrapping width">-1</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
@ -452,6 +469,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -520,6 +539,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -580,7 +601,7 @@
<string name="proxy-Id value">"-1"</string>
<string name="proxy-Label">" Pin Options :"</string>
<string name="proxy-Sizer member variable name">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Foreground colour">"400080"</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
@ -614,6 +635,7 @@
<string name="proxy-Class">"wxStaticText"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Pin lenght :"</string>
<long name="proxy-Wrapping width">-1</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
@ -635,6 +657,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -691,6 +715,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -742,6 +768,8 @@
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -793,6 +821,8 @@
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -844,6 +874,8 @@
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -906,6 +938,7 @@
<string name="proxy-Class">"wxStaticText"</string>
<string name="proxy-Member variable name">"m_PinNameSizeText"</string>
<string name="proxy-Label">"Size"</string>
<long name="proxy-Wrapping width">-1</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
@ -927,6 +960,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -995,6 +1030,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -1030,6 +1067,7 @@
<string name="proxy-Class">"wxStaticText"</string>
<string name="proxy-Member variable name">"m_PinNumSizeText"</string>
<string name="proxy-Label">"Size"</string>
<long name="proxy-Wrapping width">-1</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
@ -1051,6 +1089,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -1119,6 +1159,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -1181,10 +1223,12 @@
<string name="proxy-Member variable name">"m_PinOrient"</string>
<string name="proxy-Label">"Pin Orient:"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Items">"Right|Left|Up|Down"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Foreground colour">"295454"</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
@ -1193,8 +1237,9 @@
<string name="proxy-Data validator">""</string>
<bool name="proxy-wxRA_SPECIFY_ROWS">0</bool>
<bool name="proxy-wxRA_SPECIFY_COLS">1</bool>
<string name="proxy-Items">"Right|Left|Up|Down"</string>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -1266,7 +1311,7 @@
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxButton: wxID_OK"</string>
<string name="title">"wxButton: wxID_CANCEL"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogcontrol"</string>
@ -1274,19 +1319,19 @@
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"11/5/2006"</string>
<string name="created">"20/2/2007"</string>
<string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick"</string>
<string name="proxy-Id name">"wxID_OK"</string>
<long name="proxy-Id value">5100</long>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick"</string>
<string name="proxy-Id name">"wxID_CANCEL"</string>
<long name="proxy-Id value">5101</long>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"&amp;OK"</string>
<bool name="proxy-Default">1</bool>
<string name="proxy-Label">"&amp;Cancel"</string>
<bool name="proxy-Default">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Foreground colour">"0000A0"</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
@ -1298,6 +1343,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -1318,7 +1365,7 @@
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxButton: wxID_CANCEL"</string>
<string name="title">"wxButton: wxID_OK"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogcontrol"</string>
@ -1328,17 +1375,17 @@
<long name="locked">0</long>
<string name="created">"11/5/2006"</string>
<string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick"</string>
<string name="proxy-Id name">"wxID_CANCEL"</string>
<long name="proxy-Id value">5101</long>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick"</string>
<string name="proxy-Id name">"wxID_OK"</string>
<long name="proxy-Id value">5100</long>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"&amp;Cancel"</string>
<bool name="proxy-Default">0</bool>
<string name="proxy-Label">"&amp;OK"</string>
<bool name="proxy-Default">1</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Foreground colour">"C60000"</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
@ -1350,6 +1397,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -1412,10 +1461,12 @@
<string name="proxy-Member variable name">"m_PinShape"</string>
<string name="proxy-Label">"Pin Shape:"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Items">"line|invert|clock|clock inv|low in|low clock|low out"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Foreground colour">"004000"</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
@ -1424,8 +1475,9 @@
<string name="proxy-Data validator">""</string>
<bool name="proxy-wxRA_SPECIFY_ROWS">0</bool>
<bool name="proxy-wxRA_SPECIFY_COLS">1</bool>
<string name="proxy-Items">"line|invert|clock|clock inv|low in|low clock|low out"</string>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -1462,10 +1514,12 @@
<string name="proxy-Member variable name">"m_PinElectricalType"</string>
<string name="proxy-Label">"Electrical Type:"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Items">"Input|Output|Bidi|3 States|Passive|Unspecified|Power In|Power Out|Open coll|Open emit"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Foreground colour">"444422"</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
@ -1474,8 +1528,9 @@
<string name="proxy-Data validator">""</string>
<bool name="proxy-wxRA_SPECIFY_ROWS">0</bool>
<bool name="proxy-wxRA_SPECIFY_COLS">1</bool>
<string name="proxy-Items">"Input|Output|Bidi|3 States|Passive|Unspecified|Power In|Power Out|Open coll|Open emit"</string>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>

View File

@ -394,7 +394,7 @@ wxString buf;
buf = newname;
buf.Replace( wxT(" "), wxT("_"));
if ( newsize >= 0 ) CurrentPin->m_SizeName = newsize;
if ( newsize >= 0 ) CurrentPin->m_PinNameSize = newsize;
CurrentPin->m_PinName = buf;
@ -406,7 +406,7 @@ wxString buf;
{
if (Pin->m_StructType != COMPONENT_PIN_DRAW_TYPE ) continue;
if( (Pin->m_Flags & IS_LINKED) == 0 ) continue;
if (newsize >= 0 ) Pin->m_SizeName = newsize;
if (newsize >= 0 ) Pin->m_PinNameSize = newsize;
Pin->m_PinName = buf;
}
}
@ -432,7 +432,7 @@ wxString buf;
CurrentPin->m_PinNum = 0;
if ( newsize >= 0) CurrentPin->m_SizeNum = newsize;
if ( newsize >= 0) CurrentPin->m_PinNumSize = newsize;
CurrentPin->SetPinNumFromString(buf);
m_Parent->GetScreen()->SetModify();
@ -442,7 +442,7 @@ wxString buf;
if (Pin->m_StructType != COMPONENT_PIN_DRAW_TYPE ) continue;
if( (Pin->m_Flags & IS_LINKED) == 0 ) continue;
if( Pin->m_Unit != CurrentPin->m_Unit ) continue;
if ( newsize >= 0) Pin->m_SizeNum = newsize;
if ( newsize >= 0) Pin->m_PinNumSize = newsize;
if ( newnum ) Pin->m_PinNum = CurrentPin->m_PinNum;
}
}
@ -520,8 +520,8 @@ LibDrawPin * CurrentPin = (LibDrawPin *) CurrentDrawItem;
CurrentPin->m_Orient = LastPinOrient;
CurrentPin->m_PinType = LastPinType;
CurrentPin->m_PinShape = LastPinShape;
CurrentPin->m_SizeName = LastPinNameSize;
CurrentPin->m_SizeNum = LastPinNumSize;
CurrentPin->m_PinNameSize = LastPinNameSize;
CurrentPin->m_PinNumSize = LastPinNumSize;
if ( LastPinCommonConvert ) CurrentPin->m_Convert = 0;
else CurrentPin->m_Convert = CurrentConvert;
if ( LastPinCommonUnit ) CurrentPin->m_Unit = 0;
@ -762,11 +762,11 @@ bool selected = (MasterPin->m_Selected & IS_SELECTED) != 0;
switch ( id )
{
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNUMSIZE_ITEM:
Pin->m_SizeNum = MasterPin->m_SizeNum;
Pin->m_PinNumSize = MasterPin->m_PinNumSize;
break;
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINNAMESIZE_ITEM:
Pin->m_SizeName = MasterPin->m_SizeName;
Pin->m_PinNameSize = MasterPin->m_PinNameSize;
break;
case ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_PINSIZE_ITEM:

View File

@ -55,10 +55,24 @@ void Move_Plume( wxPoint pos, int plume )
}
}
void SetCurrentLineWidth( int width)
{
switch ( g_PlotFormat )
{
case PLOT_FORMAT_HPGL:
break;
/***************************************************************/
void PlotArc(wxPoint centre, int StAngle, int EndAngle, int rayon)
/***************************************************************/
case PLOT_FORMAT_POST:
case PLOT_FORMAT_POST_A4:
SetCurrentLineWidthPS(width);
break;
}
}
/*******************************************************************************/
void PlotArc(wxPoint centre, int StAngle, int EndAngle, int rayon, int width)
/*******************************************************************************/
/* trace d'un arc de cercle:
x, y = coord du centre
StAngle, EndAngle = angle de debut et fin
@ -68,33 +82,33 @@ void PlotArc(wxPoint centre, int StAngle, int EndAngle, int rayon)
switch ( g_PlotFormat )
{
case PLOT_FORMAT_HPGL:
PlotArcHPGL(centre, StAngle, EndAngle, rayon);
PlotArcHPGL(centre, StAngle, EndAngle, rayon, width);
break;
case PLOT_FORMAT_POST:
PlotArcPS(centre, StAngle, EndAngle, rayon);
PlotArcPS(centre, StAngle, EndAngle, rayon, width);
break;
}
}
/**************************************************/
void PlotCercle( wxPoint pos,int diametre )
/**************************************************/
/*******************************************************/
void PlotCercle( wxPoint pos,int diametre, int width )
/*******************************************************/
{
switch ( g_PlotFormat )
{
{
case PLOT_FORMAT_HPGL:
PlotCircle_HPGL( pos, diametre);
PlotCircle_HPGL( pos, diametre, width);
break;
case PLOT_FORMAT_POST:
PlotCircle_PS(pos, diametre);
PlotCircle_PS(pos, diametre, width);
break;
}
}
}
/****************************************************/
static void PlotPoly( int nb, int * coord, int fill)
/****************************************************/
/******************************************************************/
void PlotPoly( int nb, int * coord, int fill, int width)
/******************************************************************/
/* Trace un polygone ferme
coord = tableau des coord des sommets
nb = nombre de coord ( 1 coord = 2 elements: X et Y du tableau )
@ -106,11 +120,11 @@ static void PlotPoly( int nb, int * coord, int fill)
switch ( g_PlotFormat )
{
case PLOT_FORMAT_HPGL:
PlotPolyHPGL( nb, coord, fill);
PlotPolyHPGL( nb, coord, fill, width);
break;
case PLOT_FORMAT_POST:
PlotPolyPS( nb, coord, fill);
PlotPolyPS( nb, coord, fill, width);
break;
}
}
@ -128,6 +142,7 @@ int pX, pY;
pX = Struct->m_Pos.x; pY = Struct->m_Pos.y;
SetCurrentLineWidth(-1);
Move_Plume(wxPoint(pX - DELTA, pY - DELTA), 'U');
Move_Plume(wxPoint(pX + DELTA, pY + DELTA), 'D');
Move_Plume(wxPoint(pX + DELTA, pY - DELTA), 'U');
@ -164,6 +179,7 @@ wxPoint pos;
Plume('U');
if ( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt )
SetColorMapPS ( ReturnLayerColor(LAYER_DEVICE) );
switch (DEntry->m_StructType)
{
case COMPONENT_ARC_DRAW_TYPE:
@ -175,7 +191,7 @@ wxPoint pos;
pos.y = PartY + TransMat[1][0] * Arc->m_Pos.x +
TransMat[1][1] * Arc->m_Pos.y;
MapAngles(&t1, &t2, TransMat);
PlotArc(pos, t1, t2, Arc->m_Rayon);
PlotArc(pos, t1, t2, Arc->m_Rayon, Arc->m_Width);
}
break;
@ -186,7 +202,7 @@ wxPoint pos;
TransMat[0][1] * Circle->m_Pos.y;
pos.y = PartY + TransMat[1][0] * Circle->m_Pos.x +
TransMat[1][1] * Circle->m_Pos.y;
PlotCercle(pos, Circle->m_Rayon * 2);
PlotCercle(pos, Circle->m_Rayon * 2, Circle->m_Width);
}
break;
@ -200,6 +216,7 @@ wxPoint pos;
+ TransMat[0][1] * Text->m_Pos.y;
pos.y = PartY + TransMat[1][0] * Text->m_Pos.x
+ TransMat[1][1] * Text->m_Pos.y;
SetCurrentLineWidth(-1);
PlotGraphicText(g_PlotFormat, pos , CharColor,
Text->m_Text,
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
@ -211,15 +228,16 @@ wxPoint pos;
case COMPONENT_RECT_DRAW_TYPE:
{
LibDrawSquare * Square = (LibDrawSquare *) DEntry;
x1 = PartX + TransMat[0][0] * Square->m_Start.x
+ TransMat[0][1] * Square->m_Start.y;
y1 = PartY + TransMat[1][0] * Square->m_Start.x
+ TransMat[1][1] * Square->m_Start.y;
x1 = PartX + TransMat[0][0] * Square->m_Pos.x
+ TransMat[0][1] * Square->m_Pos.y;
y1 = PartY + TransMat[1][0] * Square->m_Pos.x
+ TransMat[1][1] * Square->m_Pos.y;
x2 = PartX + TransMat[0][0] * Square->m_End.x
+ TransMat[0][1] * Square->m_End.y;
y2 = PartY + TransMat[1][0] * Square->m_End.x
+ TransMat[1][1] * Square->m_End.y;
SetCurrentLineWidth(Square->m_Width);
Move_Plume(wxPoint(x1, y1), 'U');
Move_Plume(wxPoint(x1, y2), 'D');
Move_Plume(wxPoint(x2, y2), 'D');
@ -246,6 +264,7 @@ wxPoint pos;
+ TransMat[1][1] * Pin->m_Pos.y;
/* Dessin de la pin et du symbole special associe */
SetCurrentLineWidth(-1);
PlotPinSymbol(x2, y2, Pin->m_PinLen, orient, Pin->m_PinShape);
wxPoint pinpos(x2, y2);
Pin->PlotPinTexts(pinpos, orient,
@ -267,7 +286,7 @@ wxPoint pos;
TransMat[1][0] * polyline->PolyList[ii * 2] +
TransMat[1][1] * polyline->PolyList[ii * 2 + 1];
}
PlotPoly(ii, Poly, polyline->m_Fill);
PlotPoly(ii, Poly, polyline->m_Fill, polyline->m_Width);
MyFree(Poly);
}
break;
@ -356,6 +375,8 @@ int orient, color = -1;
vjustify = - vjustify;
}
SetCurrentLineWidth(-1);
if( !IsMulti || (FieldNumber != REFERENCE) )
{
PlotGraphicText( g_PlotFormat, wxPoint(px, py), color, Field->m_Text,
@ -390,6 +411,8 @@ int color;
if ( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt )
SetColorMapPS ( color );
SetCurrentLineWidth(-1);
MapX1 = MapY1 = 0; x1 = posX; y1 = posY;
switch ( orient )
{
@ -411,7 +434,7 @@ int color;
{
PlotCercle( wxPoint(MapX1 * INVERT_PIN_RADIUS + x1,
MapY1 * INVERT_PIN_RADIUS + y1),
INVERT_PIN_RADIUS * 2 );
INVERT_PIN_RADIUS * 2);
Move_Plume( wxPoint(MapX1 * INVERT_PIN_RADIUS * 2 + x1,
MapY1 * INVERT_PIN_RADIUS * 2 + y1), 'U' );
@ -514,6 +537,8 @@ int HalfSize;
if(Size.x == 0 ) Size = wxSize(DEFAULT_SIZE_TEXT, DEFAULT_SIZE_TEXT);
SetCurrentLineWidth(-1);
switch(Orient)
{
case 0: /* Orientation horiz normale */
@ -587,7 +612,7 @@ static void PlotSheetLabelStruct(DrawSheetLabelStruct *Struct)
{
int side, txtcolor = -1;
int posx , tposx, posy, size, size2;
int coord[12];
int coord[16];
if ( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt )
txtcolor = ReturnLayerColor(Struct->m_Layer);
@ -617,7 +642,8 @@ int coord[12];
coord[6] = posx + size; coord[7] = posy;
coord[8] = posx + size2; coord[9] = posy + size2;
coord[10] = posx ; coord[11] = posy + size2;
PlotPoly(6, coord, FILL);
coord[12] = posx; coord[13] = posy;
PlotPoly(7, coord, NOFILL);
break;
case 1: /* output <| */
@ -625,7 +651,8 @@ int coord[12];
coord[4] = posx + size; coord[5] = posy - size2;
coord[6] = posx + size; coord[7] = posy + size2;
coord[8] = posx + size2; coord[9] = posy + size2;
PlotPoly(5, coord, FILL);
coord[10] = posx; coord[11] = posy;
PlotPoly(6, coord, NOFILL);
break;
case 2: /* bidi <> */
@ -633,7 +660,8 @@ int coord[12];
coord[2] = posx + size2; coord[3] = posy - size2;
coord[4] = posx + size; coord[5] = posy;
coord[6] = posx + size2; coord[7] = posy +size2;
PlotPoly(4, coord, FILL);
coord[8] = posx; coord[9] = posy;
PlotPoly(5, coord, NOFILL);
break;
default: /* unsp []*/
@ -641,7 +669,8 @@ int coord[12];
coord[4] = posx + size; coord[5] = posy - size2;
coord[6] = posx + size; coord[7] = posy + size2;
coord[8] = posx ; coord[9] = posy + size2;
PlotPoly(5, coord, NOFILL);
coord[10] = posx; coord[11] = posy;
PlotPoly(6, coord, NOFILL);
break;
}
}
@ -659,6 +688,9 @@ wxPoint pos;
if ( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt )
SetColorMapPS ( ReturnLayerColor(Struct->m_Layer) );
SetCurrentLineWidth(-1);
Move_Plume(Struct->m_Pos, 'U');
pos = Struct->m_Pos; pos.x += Struct->m_Size.x;
Move_Plume(pos,'D');

View File

@ -498,13 +498,13 @@ int margin;
g_PlotFormat = PLOT_FORMAT_HPGL;
screen = ActiveScreen;
if ( Select_PlotAll == TRUE )
{
screen = ScreenSch;
}
while( screen )
{
/* Build the screen list */
EDA_ScreenList ScreenList(NULL);
if ( Select_PlotAll == TRUE ) screen = screen = ScreenList.GetFirst();
else screen = ActiveScreen;
for ( ; screen != NULL; screen = ScreenList.GetNext() )
{
ReturnSheetDims(screen, SheetSize, SheetOffset);
/* Calcul des echelles de conversion */
g_PlotScaleX = Scale_X * SCALE_HPGL ;
@ -531,7 +531,7 @@ int margin;
InitPlotParametresHPGL(PlotOffset, g_PlotScaleX, g_PlotScaleY);
Plot_1_Page_HPGL(PlotFileName,screen);
screen = (BASE_SCREEN*)screen->Pnext;
if ( Select_PlotAll == FALSE ) screen = NULL;
if ( Select_PlotAll == FALSE ) break;
}
m_MsgBox->AppendText(_("** Plot End **\n"));

View File

@ -1,158 +1,160 @@
/////////////////////////////////////////////////////////////////////////////
// Name: plotps.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 01/02/2006 08:37:24
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 01/02/2006 08:37:24
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "plotps.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "worksheet.h"
#include "plot_common.h"
#include "protos.h"
/* coeff de conversion dim en 1 mil -> dim en unite PS: */
#define SCALE_PS 0.001
extern void Move_Plume( wxPoint pos, int plume );
extern void Plume( int plume );
enum PageFormatReq {
PAGE_SIZE_AUTO,
PAGE_SIZE_A4,
PAGE_SIZE_A
};
/* Variables locales : */
static int s_DefaultPenWidth = 6; /* default pen width for drawings in 1/1000 inch */
static int PS_SizeSelect = PAGE_SIZE_AUTO;
extern FILE * PlotOutput;
static bool Plot_Sheet_Ref = TRUE;
////@begin includes
////@end includes
#include "plotps.h"
////@begin XPM images
////@end XPM images
/***********************************************************/
void WinEDA_SchematicFrame::ToPlot_PS(wxCommandEvent& event)
/***********************************************************/
/* fonction relai de creation de la frame de dialogue pour trace Postscript
*/
{
wxPoint pos;
pos = GetPosition();
pos.x += 10; pos.y += 20;
WinEDA_PlotPSFrame * Ps_frame = new WinEDA_PlotPSFrame(this);
Ps_frame->ShowModal(); Ps_frame->Destroy();
}
/*!
* WinEDA_PlotPSFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WinEDA_PlotPSFrame, wxDialog )
/*!
* WinEDA_PlotPSFrame event table definition
*/
BEGIN_EVENT_TABLE( WinEDA_PlotPSFrame, wxDialog )
////@begin WinEDA_PlotPSFrame event table entries
/////////////////////////////////////////////////////////////////////////////
// Name: plotps.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 01/02/2006 08:37:24
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 01/02/2006 08:37:24
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "plotps.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "worksheet.h"
#include "plot_common.h"
#include "protos.h"
/* coeff de conversion dim en 1 mil -> dim en unite PS: */
#define SCALE_PS 0.001
extern void Move_Plume( wxPoint pos, int plume );
extern void Plume( int plume );
enum PageFormatReq {
PAGE_SIZE_AUTO,
PAGE_SIZE_A4,
PAGE_SIZE_A
};
/* Variables locales : */
static int PS_SizeSelect = PAGE_SIZE_AUTO;
extern FILE * PlotOutput;
static bool Plot_Sheet_Ref = TRUE;
////@begin includes
////@end includes
#include "plotps.h"
////@begin XPM images
////@end XPM images
/***********************************************************/
void WinEDA_SchematicFrame::ToPlot_PS(wxCommandEvent& event)
/***********************************************************/
/* fonction relai de creation de la frame de dialogue pour trace Postscript
*/
{
wxPoint pos;
pos = GetPosition();
pos.x += 10; pos.y += 20;
WinEDA_PlotPSFrame * Ps_frame = new WinEDA_PlotPSFrame(this);
Ps_frame->ShowModal(); Ps_frame->Destroy();
}
/*!
* WinEDA_PlotPSFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WinEDA_PlotPSFrame, wxDialog )
/*!
* WinEDA_PlotPSFrame event table definition
*/
BEGIN_EVENT_TABLE( WinEDA_PlotPSFrame, wxDialog )
////@begin WinEDA_PlotPSFrame event table entries
EVT_BUTTON( ID_PLOT_PS_CURRENT_EXECUTE, WinEDA_PlotPSFrame::OnPlotPsCurrentExecuteClick )
EVT_BUTTON( ID_PLOT_PS_ALL_EXECUTE, WinEDA_PlotPSFrame::OnPlotPsAllExecuteClick )
EVT_BUTTON( wxID_CLOSE, WinEDA_PlotPSFrame::OnCloseClick )
////@end WinEDA_PlotPSFrame event table entries
END_EVENT_TABLE()
/*!
* WinEDA_PlotPSFrame constructors
*/
WinEDA_PlotPSFrame::WinEDA_PlotPSFrame( )
{
}
WinEDA_PlotPSFrame::WinEDA_PlotPSFrame( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Create(parent, id, caption, pos, size, style);
}
/*!
* WinEDA_PlotPSFrame creator
*/
bool WinEDA_PlotPSFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin WinEDA_PlotPSFrame member initialisation
////@end WinEDA_PlotPSFrame event table entries
END_EVENT_TABLE()
/*!
* WinEDA_PlotPSFrame constructors
*/
WinEDA_PlotPSFrame::WinEDA_PlotPSFrame( )
{
}
WinEDA_PlotPSFrame::WinEDA_PlotPSFrame( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
Create(parent, id, caption, pos, size, style);
}
/*!
* WinEDA_PlotPSFrame creator
*/
bool WinEDA_PlotPSFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin WinEDA_PlotPSFrame member initialisation
m_SizeOption = NULL;
m_PlotPSColorOption = NULL;
m_Plot_Sheet_Ref = NULL;
m_DefaultLineSizeCtrlSizer = NULL;
m_MsgBox = NULL;
////@end WinEDA_PlotPSFrame member initialisation
////@begin WinEDA_PlotPSFrame creation
////@end WinEDA_PlotPSFrame member initialisation
////@begin WinEDA_PlotPSFrame creation
SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end WinEDA_PlotPSFrame creation
return true;
}
/*!
* Control creation for WinEDA_PlotPSFrame
*/
void WinEDA_PlotPSFrame::CreateControls()
{
SetFont(*g_DialogFont);
////@begin WinEDA_PlotPSFrame content construction
// Generated by DialogBlocks, 04/02/2006 17:30:50 (unregistered)
////@end WinEDA_PlotPSFrame creation
return true;
}
/*!
* Control creation for WinEDA_PlotPSFrame
*/
void WinEDA_PlotPSFrame::CreateControls()
{
SetFont(*g_DialogFont);
////@begin WinEDA_PlotPSFrame content construction
// Generated by DialogBlocks, 22/01/2007 11:32:43 (unregistered)
WinEDA_PlotPSFrame* itemDialog1 = this;
@ -168,40 +170,49 @@ void WinEDA_PlotPSFrame::CreateControls()
_("Page Size A")
};
m_SizeOption = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("Plot page size:"), wxDefaultPosition, wxDefaultSize, 3, m_SizeOptionStrings, 1, wxRA_SPECIFY_COLS );
itemBoxSizer3->Add(m_SizeOption, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_SizeOption->SetSelection(0);
itemBoxSizer3->Add(m_SizeOption, 0, wxGROW|wxALL, 5);
itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxStaticBox* itemStaticBoxSizer6Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Plot Options:"));
wxStaticBoxSizer* itemStaticBoxSizer6 = new wxStaticBoxSizer(itemStaticBoxSizer6Static, wxVERTICAL);
itemBoxSizer3->Add(itemStaticBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxString m_PlotPSColorOptionStrings[] = {
_("B/W"),
_("Color")
};
m_PlotPSColorOption = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("Plot Color:"), wxDefaultPosition, wxDefaultSize, 2, m_PlotPSColorOptionStrings, 1, wxRA_SPECIFY_COLS );
itemBoxSizer3->Add(m_PlotPSColorOption, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton9 = new wxButton( itemDialog1, ID_PLOT_PS_CURRENT_EXECUTE, _("&Plot CURRENT"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton9->SetForegroundColour(wxColour(0, 128, 0));
itemBoxSizer8->Add(itemButton9, 0, wxGROW|wxALL, 5);
wxButton* itemButton10 = new wxButton( itemDialog1, ID_PLOT_PS_ALL_EXECUTE, _("Plot A&LL"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton10->SetForegroundColour(wxColour(179, 0, 0));
itemBoxSizer8->Add(itemButton10, 0, wxGROW|wxALL, 5);
wxButton* itemButton11 = new wxButton( itemDialog1, wxID_CLOSE, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton11->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer8->Add(itemButton11, 0, wxGROW|wxALL, 5);
m_PlotPSColorOption->SetSelection(0);
itemStaticBoxSizer6->Add(m_PlotPSColorOption, 0, wxGROW|wxALL, 5);
m_Plot_Sheet_Ref = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Print Sheet Ref"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
m_Plot_Sheet_Ref->SetValue(false);
itemBoxSizer2->Add(m_Plot_Sheet_Ref, 0, wxALIGN_LEFT|wxALL, 5);
itemStaticBoxSizer6->Add(m_Plot_Sheet_Ref, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText13 = new wxStaticText( itemDialog1, wxID_STATIC, _("Messages :"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemStaticText13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton11 = new wxButton( itemDialog1, ID_PLOT_PS_CURRENT_EXECUTE, _("&Plot CURRENT"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton11->SetForegroundColour(wxColour(0, 128, 0));
itemBoxSizer10->Add(itemButton11, 0, wxGROW|wxALL, 5);
wxButton* itemButton12 = new wxButton( itemDialog1, ID_PLOT_PS_ALL_EXECUTE, _("Plot A&LL"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton12->SetForegroundColour(wxColour(179, 0, 0));
itemBoxSizer10->Add(itemButton12, 0, wxGROW|wxALL, 5);
wxButton* itemButton13 = new wxButton( itemDialog1, wxID_CLOSE, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton13->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer10->Add(itemButton13, 0, wxGROW|wxALL, 5);
m_DefaultLineSizeCtrlSizer = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(m_DefaultLineSizeCtrlSizer, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _("Messages :"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer2->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
m_MsgBox = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(-1, 200), wxTE_MULTILINE );
itemBoxSizer2->Add(m_MsgBox, 0, wxGROW|wxALL|wxFIXED_MINSIZE, 5);
@ -210,81 +221,85 @@ void WinEDA_PlotPSFrame::CreateControls()
m_SizeOption->SetValidator( wxGenericValidator(& PS_SizeSelect) );
m_PlotPSColorOption->SetValidator( wxGenericValidator(& g_PlotPSColorOpt) );
m_Plot_Sheet_Ref->SetValidator( wxGenericValidator(& Plot_Sheet_Ref) );
////@end WinEDA_PlotPSFrame content construction
}
/*!
* Should we show tooltips?
*/
bool WinEDA_PlotPSFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_PlotPSFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_PlotPSFrame bitmap retrieval
////@end WinEDA_PlotPSFrame content construction
m_DefaultLineSizeCtrl = new WinEDA_ValueCtrl(this, _("Default Line Width"), g_PlotPSMinimunLineWidth,
g_UnitMetric, m_DefaultLineSizeCtrlSizer, EESCHEMA_INTERNAL_UNIT );
}
/*!
* Should we show tooltips?
*/
bool WinEDA_PlotPSFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_PlotPSFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WinEDA_PlotPSFrame bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WinEDA_PlotPSFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WinEDA_PlotPSFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_PlotPSFrame icon retrieval
////@end WinEDA_PlotPSFrame bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WinEDA_PlotPSFrame::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WinEDA_PlotPSFrame icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WinEDA_PlotPSFrame icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON
*/
void WinEDA_PlotPSFrame::OnPlotPsCurrentExecuteClick( wxCommandEvent& event )
{
int Select_PlotAll = FALSE;
InitOptVars();
CreatePSFile(Select_PlotAll, PS_SizeSelect);
m_MsgBox->AppendText( wxT("*****\n"));
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON1
*/
void WinEDA_PlotPSFrame::OnPlotPsAllExecuteClick( wxCommandEvent& event )
{
int Select_PlotAll = TRUE;
InitOptVars();
CreatePSFile(Select_PlotAll, PS_SizeSelect);
m_MsgBox->AppendText( wxT("*****\n"));
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
*/
void WinEDA_PlotPSFrame::OnCloseClick( wxCommandEvent& event )
////@end WinEDA_PlotPSFrame icon retrieval
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON
*/
void WinEDA_PlotPSFrame::OnPlotPsCurrentExecuteClick( wxCommandEvent& event )
{
InitOptVars();
Close(TRUE);
}
int Select_PlotAll = FALSE;
InitOptVars();
CreatePSFile(Select_PlotAll, PS_SizeSelect);
m_MsgBox->AppendText( wxT("*****\n"));
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON1
*/
void WinEDA_PlotPSFrame::OnPlotPsAllExecuteClick( wxCommandEvent& event )
{
int Select_PlotAll = TRUE;
InitOptVars();
CreatePSFile(Select_PlotAll, PS_SizeSelect);
m_MsgBox->AppendText( wxT("*****\n"));
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
*/
void WinEDA_PlotPSFrame::OnCloseClick( wxCommandEvent& event )
{
InitOptVars();
Close(TRUE);
}
/*****************************************/
void WinEDA_PlotPSFrame::InitOptVars(void)
@ -293,211 +308,207 @@ void WinEDA_PlotPSFrame::InitOptVars(void)
Plot_Sheet_Ref = m_Plot_Sheet_Ref->GetValue();
g_PlotPSColorOpt = m_PlotPSColorOption->GetSelection();
PS_SizeSelect = m_SizeOption->GetSelection();
}
/*************************************************************/
void WinEDA_PlotPSFrame::CreatePSFile(int AllPages, int pagesize)
/*************************************************************/
{
wxString PlotFileName, ShortFileName;
BASE_SCREEN *screen;
Ki_PageDescr * PlotSheet, * RealSheet;
int BBox[4];
wxPoint plot_offset;
g_PlotFormat = PLOT_FORMAT_POST;
screen = ActiveScreen;
if ( AllPages == TRUE )
{
screen = ScreenSch;
}
while( screen )
{
PlotSheet = screen->m_CurrentSheet;
RealSheet = &g_Sheet_A4;
if ( pagesize == PAGE_SIZE_AUTO ) RealSheet = PlotSheet;
else if ( pagesize == PAGE_SIZE_A ) RealSheet = &g_Sheet_A;
/* Calcul des limites de trace en 1/1000 pouce */
BBox[0] = BBox[1] = g_PlotMargin; // Plot margin in 1/1000 inch
BBox[2] = RealSheet->m_Size.x - g_PlotMargin;
BBox[3] = RealSheet->m_Size.y - g_PlotMargin;
/* Calcul des echelles de conversion */
g_PlotScaleX = SCALE_PS *
(float) (BBox[2] - BBox[0]) /
PlotSheet->m_Size.x;
g_PlotScaleY = SCALE_PS *
(float) (BBox[3] - BBox[1]) /
PlotSheet->m_Size.y;
plot_offset.x = 0;
plot_offset.y = PlotSheet->m_Size.y;
wxSplitPath(screen->m_FileName.GetData(), (wxString*) NULL,
&ShortFileName, (wxString*) NULL);
wxString dirbuf = wxGetCwd() + STRING_DIR_SEP;
if( ! ShortFileName.IsEmpty() )
PlotFileName = MakeFileName(dirbuf, ShortFileName, wxT(".ps"));
else PlotFileName = MakeFileName(dirbuf, g_DefaultSchematicFileName, wxT(".ps"));
PlotOneSheetPS(PlotFileName,screen, RealSheet, BBox, plot_offset);
screen = (BASE_SCREEN*)screen->Pnext;
if (AllPages == FALSE ) screen = NULL;
}
}
/**********************************************************/
void WinEDA_PlotPSFrame::PlotOneSheetPS(const wxString & FileName,
BASE_SCREEN * screen, Ki_PageDescr * sheet, int BBox[4], wxPoint plot_offset)
/**********************************************************/
/* Trace en format PS. d'une feuille de dessin
*/
{
wxString Line;
EDA_BaseStruct *DrawList;
EDA_SchComponentStruct *DrawLibItem;
int x1=0, y1=0, x2=0, y2=0, layer;
PlotOutput = wxFopen(FileName, wxT("wt"));
if (PlotOutput == NULL)
{
Line = wxT("\n** ");
Line += _("Unable to create ") + FileName + wxT(" **\n\n");
m_MsgBox->AppendText(Line);
wxBell();
return ;
}
Line.Printf(_("Plot: %s\n"), FileName.GetData()) ;
m_MsgBox->AppendText(Line);
InitPlotParametresPS(plot_offset, sheet, g_PlotScaleX, g_PlotScaleY);
SetDefaultLineWidthPS( s_DefaultPenWidth);
/* Init : */
PrintHeaderPS(PlotOutput, wxT("EESchema-PS"), FileName, BBox);
InitPlotParametresPS(plot_offset, sheet, 1.0, 1.0);
if ( m_Plot_Sheet_Ref->GetValue() )
{
if ( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt )
SetColorMapPS ( BLACK );
PlotWorkSheet(PLOT_FORMAT_POST, screen);
}
DrawList = screen->EEDrawList;
while ( DrawList ) /* tracage */
{
Plume('U');
layer = LAYER_NOTES;
switch( DrawList->m_StructType )
{
case DRAW_BUSENTRY_STRUCT_TYPE : /* Struct Raccord et Segment sont identiques */
#undef STRUCT
#define STRUCT ((DrawBusEntryStruct*)DrawList)
x1 = STRUCT->m_Pos.x; y1 = STRUCT->m_Pos.y;
x2 = STRUCT->m_End().x; y2 = STRUCT->m_End().y;
layer = STRUCT->m_Layer;
case DRAW_SEGMENT_STRUCT_TYPE :
#undef STRUCT
#define STRUCT ((EDA_DrawLineStruct*)DrawList)
if ( DrawList->m_StructType == DRAW_SEGMENT_STRUCT_TYPE)
{
x1 = STRUCT->m_Start.x; y1 = STRUCT->m_Start.y;
x2 = STRUCT->m_End.x; y2 = STRUCT->m_End.y;
layer = STRUCT->m_Layer;
}
if ( g_PlotPSColorOpt )
SetColorMapPS ( ReturnLayerColor(layer) );
switch (layer)
{
case LAYER_NOTES: /* Trace en pointilles */
fprintf(PlotOutput,"[50 50] 0 setdash\n");
Move_Plume( wxPoint(x1,y1), 'U');
Move_Plume( wxPoint(x2,y2), 'D');
fprintf(PlotOutput,"[] 0 setdash\n");
break;
case LAYER_BUS: /* Trait large */
{
fprintf(PlotOutput,"%d setlinewidth\n", s_DefaultPenWidth * 3);
Move_Plume( wxPoint(x1,y1),'U');
Move_Plume( wxPoint(x2,y2),'D');
fprintf(PlotOutput,"%d setlinewidth\n", s_DefaultPenWidth);
}
break;
default:
Move_Plume( wxPoint(x1,y1),'U');
Move_Plume( wxPoint(x2,y2),'D');
break;
}
break;
case DRAW_JUNCTION_STRUCT_TYPE :
#undef STRUCT
#define STRUCT ((DrawJunctionStruct*)DrawList)
if ( g_PlotPSColorOpt )
SetColorMapPS (ReturnLayerColor(STRUCT->m_Layer) );
PlotCercle( STRUCT->m_Pos, DRAWJUNCTION_SIZE);
break;
case DRAW_TEXT_STRUCT_TYPE :
case DRAW_LABEL_STRUCT_TYPE :
case DRAW_GLOBAL_LABEL_STRUCT_TYPE :
PlotTextStruct(DrawList);
break;
case DRAW_LIB_ITEM_STRUCT_TYPE :
DrawLibItem = (EDA_SchComponentStruct *) DrawList;
PlotLibPart( DrawLibItem );
break;
case DRAW_PICK_ITEM_STRUCT_TYPE : break;
case DRAW_POLYLINE_STRUCT_TYPE : break;
case DRAW_SHEETLABEL_STRUCT_TYPE: break;
case DRAW_MARKER_STRUCT_TYPE : break;
case DRAW_SHEET_STRUCT_TYPE :
#undef STRUCT
#define STRUCT ((DrawSheetStruct*)DrawList)
PlotSheetStruct(STRUCT);
break;
case DRAW_NOCONNECT_STRUCT_TYPE:
#undef STRUCT
#define STRUCT ((DrawNoConnectStruct*)DrawList)
if ( g_PlotPSColorOpt )
SetColorMapPS (ReturnLayerColor(LAYER_NOCONNECT) );
PlotNoConnectStruct(STRUCT);
break;
default:
break;
}
Plume('U');
DrawList = DrawList->Pnext;
}
/* fin */
CloseFilePS(PlotOutput);
m_MsgBox->AppendText( wxT("Ok\n"));
}
g_PlotPSMinimunLineWidth = m_DefaultLineSizeCtrl->GetValue();
if ( g_PlotPSMinimunLineWidth < 1 ) g_PlotPSMinimunLineWidth = 1;
}
/*************************************************************/
void WinEDA_PlotPSFrame::CreatePSFile(int AllPages, int pagesize)
/*************************************************************/
{
wxString PlotFileName, ShortFileName;
BASE_SCREEN *screen;
Ki_PageDescr * PlotSheet, * RealSheet;
int BBox[4];
wxPoint plot_offset;
g_PlotFormat = PLOT_FORMAT_POST;
/* Build the screen list */
EDA_ScreenList ScreenList(NULL);
if ( AllPages == TRUE ) screen = screen = ScreenList.GetFirst();
else screen = ActiveScreen;
for ( ; screen != NULL; screen = ScreenList.GetNext() )
{
PlotSheet = screen->m_CurrentSheet;
RealSheet = &g_Sheet_A4;
if ( pagesize == PAGE_SIZE_AUTO ) RealSheet = PlotSheet;
else if ( pagesize == PAGE_SIZE_A ) RealSheet = &g_Sheet_A;
/* Calcul des limites de trace en 1/1000 pouce */
BBox[0] = BBox[1] = g_PlotMargin; // Plot margin in 1/1000 inch
BBox[2] = RealSheet->m_Size.x - g_PlotMargin;
BBox[3] = RealSheet->m_Size.y - g_PlotMargin;
/* Calcul des echelles de conversion */
g_PlotScaleX = SCALE_PS *
(float) (BBox[2] - BBox[0]) /
PlotSheet->m_Size.x;
g_PlotScaleY = SCALE_PS *
(float) (BBox[3] - BBox[1]) /
PlotSheet->m_Size.y;
plot_offset.x = 0;
plot_offset.y = PlotSheet->m_Size.y;
wxSplitPath(screen->m_FileName.GetData(), (wxString*) NULL,
&ShortFileName, (wxString*) NULL);
wxString dirbuf = wxGetCwd() + STRING_DIR_SEP;
if( ! ShortFileName.IsEmpty() )
PlotFileName = MakeFileName(dirbuf, ShortFileName, wxT(".ps"));
else PlotFileName = MakeFileName(dirbuf, g_DefaultSchematicFileName, wxT(".ps"));
PlotOneSheetPS(PlotFileName,screen, RealSheet, BBox, plot_offset);
screen = (BASE_SCREEN*)screen->Pnext;
if (AllPages == FALSE ) break;
}
}
/*****************************************************************************************/
void WinEDA_PlotPSFrame::PlotOneSheetPS(const wxString & FileName,
BASE_SCREEN * screen, Ki_PageDescr * sheet, int BBox[4], wxPoint plot_offset)
/*****************************************************************************************/
/* Trace en format PS. d'une feuille de dessin
*/
{
wxString Line;
EDA_BaseStruct *DrawList;
EDA_SchComponentStruct *DrawLibItem;
int layer;
wxPoint StartPos, EndPos;
PlotOutput = wxFopen(FileName, wxT("wt"));
if (PlotOutput == NULL)
{
Line = wxT("\n** ");
Line += _("Unable to create ") + FileName + wxT(" **\n\n");
m_MsgBox->AppendText(Line);
wxBell();
return ;
}
Line.Printf(_("Plot: %s\n"), FileName.GetData()) ;
m_MsgBox->AppendText(Line);
InitPlotParametresPS(plot_offset, sheet, g_PlotScaleX, g_PlotScaleY);
SetDefaultLineWidthPS( g_PlotPSMinimunLineWidth);
/* Init : */
PrintHeaderPS(PlotOutput, wxT("EESchema-PS"), FileName, BBox);
InitPlotParametresPS(plot_offset, sheet, 1.0, 1.0);
if ( m_Plot_Sheet_Ref->GetValue() )
{
if ( (g_PlotFormat == PLOT_FORMAT_POST) && g_PlotPSColorOpt )
SetColorMapPS ( BLACK );
PlotWorkSheet(PLOT_FORMAT_POST, screen);
}
DrawList = screen->EEDrawList;
while ( DrawList ) /* tracage */
{
Plume('U');
layer = LAYER_NOTES;
switch( DrawList->m_StructType )
{
case DRAW_BUSENTRY_STRUCT_TYPE : /* Struct Raccord et Segment sont identiques */
#undef STRUCT
#define STRUCT ((DrawBusEntryStruct*)DrawList)
StartPos = STRUCT->m_Pos;
EndPos = STRUCT->m_End();
layer = STRUCT->m_Layer;
case DRAW_SEGMENT_STRUCT_TYPE :
#undef STRUCT
#define STRUCT ((EDA_DrawLineStruct*)DrawList)
if ( DrawList->m_StructType == DRAW_SEGMENT_STRUCT_TYPE)
{
StartPos = STRUCT->m_Start;
EndPos = STRUCT->m_End;
layer = STRUCT->m_Layer;
}
if ( g_PlotPSColorOpt )
SetColorMapPS ( ReturnLayerColor(layer) );
switch (layer)
{
case LAYER_NOTES: /* Trace en pointilles */
SetCurrentLineWidth(-1);
fprintf(PlotOutput,"[50 50] 0 setdash\n");
Move_Plume( StartPos, 'U');
Move_Plume( EndPos, 'D');
fprintf(PlotOutput,"[] 0 setdash\n");
break;
case LAYER_BUS: /* Trait large */
{
fprintf(PlotOutput,"%d setlinewidth\n", g_PlotPSMinimunLineWidth * 3);
Move_Plume( StartPos,'U');
Move_Plume( EndPos,'D');
fprintf(PlotOutput,"%d setlinewidth\n", g_PlotPSMinimunLineWidth);
}
break;
default:
SetCurrentLineWidth(-1);
Move_Plume( StartPos,'U');
Move_Plume( EndPos,'D');
break;
}
break;
case DRAW_JUNCTION_STRUCT_TYPE :
#undef STRUCT
#define STRUCT ((DrawJunctionStruct*)DrawList)
if ( g_PlotPSColorOpt )
SetColorMapPS (ReturnLayerColor(STRUCT->m_Layer) );
PlotCercle( STRUCT->m_Pos, DRAWJUNCTION_SIZE);
break;
case DRAW_TEXT_STRUCT_TYPE :
case DRAW_LABEL_STRUCT_TYPE :
case DRAW_GLOBAL_LABEL_STRUCT_TYPE :
PlotTextStruct(DrawList);
break;
case DRAW_LIB_ITEM_STRUCT_TYPE :
DrawLibItem = (EDA_SchComponentStruct *) DrawList;
PlotLibPart( DrawLibItem );
break;
case DRAW_PICK_ITEM_STRUCT_TYPE : break;
case DRAW_POLYLINE_STRUCT_TYPE : break;
case DRAW_SHEETLABEL_STRUCT_TYPE: break;
case DRAW_MARKER_STRUCT_TYPE : break;
case DRAW_SHEET_STRUCT_TYPE :
#undef STRUCT
#define STRUCT ((DrawSheetStruct*)DrawList)
PlotSheetStruct(STRUCT);
break;
case DRAW_NOCONNECT_STRUCT_TYPE:
#undef STRUCT
#define STRUCT ((DrawNoConnectStruct*)DrawList)
if ( g_PlotPSColorOpt )
SetColorMapPS (ReturnLayerColor(LAYER_NOCONNECT) );
PlotNoConnectStruct(STRUCT);
break;
default:
break;
}
Plume('U');
DrawList = DrawList->Pnext;
}
/* fin */
CloseFilePS(PlotOutput);
m_MsgBox->AppendText( wxT("Ok\n"));
}

View File

@ -1,86 +1,87 @@
/////////////////////////////////////////////////////////////////////////////
// Name: plotps.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 01/02/2006 08:37:24
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 01/02/2006 08:37:24
#ifndef _PLOTPS_H_
#define _PLOTPS_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "plotps.h"
#endif
/*!
* Includes
*/
////@begin includes
/////////////////////////////////////////////////////////////////////////////
// Name: plotps.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 01/02/2006 08:37:24
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 01/02/2006 08:37:24
#ifndef _PLOTPS_H_
#define _PLOTPS_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "plotps.h"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/valgen.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxBoxSizer;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define ID_RADIOBOX1 10002
#define ID_RADIOBOX 10001
#define ID_CHECKBOX 10005
#define ID_PLOT_PS_CURRENT_EXECUTE 10003
#define ID_PLOT_PS_ALL_EXECUTE 10004
#define ID_TEXTCTRL 10006
#define SYMBOL_WINEDA_PLOTPSFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxSTAY_ON_TOP|wxCLOSE_BOX
#define SYMBOL_WINEDA_PLOTPSFRAME_TITLE _("EESchema Plot PS")
#define SYMBOL_WINEDA_PLOTPSFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_PLOTPSFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_PLOTPSFRAME_POSITION wxDefaultPosition
#define ID_RADIOBOX1 10002
#define ID_RADIOBOX 10001
#define ID_PLOT_PS_CURRENT_EXECUTE 10003
#define ID_PLOT_PS_ALL_EXECUTE 10004
#define ID_CHECKBOX 10005
#define ID_TEXTCTRL 10006
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_PlotPSFrame class declaration
*/
class WinEDA_PlotPSFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_PlotPSFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_PlotPSFrame( );
WinEDA_PlotPSFrame( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PLOTPSFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PLOTPSFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PLOTPSFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PLOTPSFRAME_SIZE, long style = SYMBOL_WINEDA_PLOTPSFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PLOTPSFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PLOTPSFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PLOTPSFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PLOTPSFRAME_SIZE, long style = SYMBOL_WINEDA_PLOTPSFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_PlotPSFrame event handler declarations
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_PlotPSFrame class declaration
*/
class WinEDA_PlotPSFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_PlotPSFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_PlotPSFrame( );
WinEDA_PlotPSFrame( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PLOTPSFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PLOTPSFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PLOTPSFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PLOTPSFRAME_SIZE, long style = SYMBOL_WINEDA_PLOTPSFRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PLOTPSFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PLOTPSFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PLOTPSFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PLOTPSFRAME_SIZE, long style = SYMBOL_WINEDA_PLOTPSFRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_PlotPSFrame event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLOT_PS_CURRENT_EXECUTE
void OnPlotPsCurrentExecuteClick( wxCommandEvent& event );
@ -91,32 +92,34 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
void OnCloseClick( wxCommandEvent& event );
////@end WinEDA_PlotPSFrame event handler declarations
////@begin WinEDA_PlotPSFrame member function declarations
////@end WinEDA_PlotPSFrame event handler declarations
////@begin WinEDA_PlotPSFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_PlotPSFrame member function declarations
////@end WinEDA_PlotPSFrame member function declarations
void InitOptVars(void);
void CreatePSFile(int AllPages, int pagesize);
void PlotOneSheetPS(const wxString & FileName,
BASE_SCREEN * screen, Ki_PageDescr * sheet, int BBox[4], wxPoint plot_offset);
/// Should we show tooltips?
static bool ShowToolTips();
////@begin WinEDA_PlotPSFrame member variables
void InitOptVars(void);
void CreatePSFile(int AllPages, int pagesize);
void PlotOneSheetPS(const wxString & FileName,
BASE_SCREEN * screen, Ki_PageDescr * sheet, int BBox[4], wxPoint plot_offset);
/// Should we show tooltips?
static bool ShowToolTips();
////@begin WinEDA_PlotPSFrame member variables
wxRadioBox* m_SizeOption;
wxRadioBox* m_PlotPSColorOption;
wxCheckBox* m_Plot_Sheet_Ref;
wxBoxSizer* m_DefaultLineSizeCtrlSizer;
wxTextCtrl* m_MsgBox;
////@end WinEDA_PlotPSFrame member variables
};
#endif
// _PLOTPS_H_
////@end WinEDA_PlotPSFrame member variables
WinEDA_ValueCtrl * m_DefaultLineSizeCtrl;
};
#endif
// _PLOTPS_H_

View File

@ -6,7 +6,7 @@
<string name="title">""</string>
<string name="author">""</string>
<string name="description">""</string>
<long name="doc_count">21</long>
<long name="doc_count">23</long>
<string name="xrc_filename">""</string>
<bool name="convert_images_to_xpm">0</bool>
<bool name="inline_images">0</bool>
@ -18,6 +18,7 @@
<string name="copyright_string">"GNU License"</string>
<string name="resource_prefix">""</string>
<bool name="use_two_step_construction">0</bool>
<bool name="use_enums">0</bool>
<string name="current_platform">"&lt;All platforms&gt;"</string>
<string name="target_wx_version">"&lt;Any&gt;"</string>
<string name="cpp_header_comment">"/////////////////////////////////////////////////////////////////////////////
@ -95,9 +96,17 @@
<string name="source_encoding">"&lt;System&gt;"</string>
<string name="project_encoding">"&lt;System&gt;"</string>
<string name="resource_archive">""</string>
<long name="text_file_type">0</long>
<bool name="use_tabs">0</bool>
<long name="indent_size">4</long>
<string name="whitespace_after_return_type">" "</string>
<string name="resource_xrc_cpp">""</string>
<bool name="use_resource_archive">0</bool>
<bool name="use_generated_xrc_cpp">0</bool>
<bool name="always_generate_xrc">1</bool>
<bool name="archive_xrc_files">1</bool>
<bool name="archive_image_files">1</bool>
<bool name="xrc_retain_relative_paths">1</bool>
</header>
<data>
<document>
@ -237,7 +246,9 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxCLIP_CHILDREN ">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxCLIP_CHILDREN">0</bool>
<bool name="proxy-wxTAB_TRAVERSAL">0</bool>
<bool name="proxy-wxWS_EX_VALIDATE_RECURSIVELY">0</bool>
<bool name="proxy-wxWS_EX_BLOCK_EVENTS">1</bool>
@ -308,6 +319,8 @@
<string name="proxy-Member variable name">"m_SizeOption"</string>
<string name="proxy-Label">"Plot page size:"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Items">"Auto|Page Size A4|Page Size A"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
@ -320,15 +333,16 @@
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<bool name="proxy-wxRA_SPECIFY_ROWS">0</bool>
<bool name="proxy-wxRA_SPECIFY_COLS">1</bool>
<string name="proxy-Items">"Auto|Page Size A4|Page Size A"</string>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<string name="proxy-AlignV">"Expand"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
@ -368,41 +382,26 @@
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
</document>
<document>
<string name="title">"wxRadioBox: ID_RADIOBOX"</string>
<string name="title">"wxStaticBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"radiobox"</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"1/5/2006"</string>
<string name="proxy-type">"wbRadioBoxProxy"</string>
<string name="proxy-Id name">"ID_RADIOBOX"</string>
<long name="proxy-Id value">10001</long>
<string name="proxy-Class">"wxRadioBox"</string>
<string name="proxy-Member variable name">"m_PlotPSColorOption"</string>
<string name="proxy-Label">"Plot Color:"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="created">"22/1/2007"</string>
<string name="proxy-type">"wbStaticBoxSizerProxy"</string>
<string name="proxy-Id name">"wxID_ANY"</string>
<string name="proxy-Id value">"-1"</string>
<string name="proxy-Label">"Plot Options:"</string>
<string name="proxy-Sizer member variable name">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">"g_PlotPSColorOpt"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<bool name="proxy-wxRA_SPECIFY_ROWS">0</bool>
<bool name="proxy-wxRA_SPECIFY_COLS">1</bool>
<string name="proxy-Items">"B/W|Color"</string>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-AlignH">"Centre"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
@ -414,8 +413,113 @@
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxRadioBox: ID_RADIOBOX"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"radiobox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"22/1/2007"</string>
<string name="proxy-type">"wbRadioBoxProxy"</string>
<string name="proxy-Id name">"ID_RADIOBOX"</string>
<long name="proxy-Id value">10001</long>
<string name="proxy-Class">"wxRadioBox"</string>
<string name="proxy-Member variable name">"m_PlotPSColorOption"</string>
<string name="proxy-Label">"Plot Color:"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Items">"B/W|Color"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">"g_PlotPSColorOpt"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<bool name="proxy-wxRA_SPECIFY_ROWS">0</bool>
<bool name="proxy-wxRA_SPECIFY_COLS">1</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"22/1/2007"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX"</string>
<long name="proxy-Id value">10005</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Member variable name">"m_Plot_Sheet_Ref"</string>
<string name="proxy-Label">"Print Sheet Ref"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"Plot_Sheet_Ref"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
</document>
<document>
<string name="title">"Spacer"</string>
@ -501,6 +605,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -553,6 +659,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -605,6 +713,8 @@
<bool name="proxy-wxBU_EXACTFIT">0</bool>
<bool name="proxy-wxNO_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -627,43 +737,19 @@
</document>
</document>
<document>
<string name="title">"wxCheckBox: ID_CHECKBOX"</string>
<string name="title">"wxBoxSizer V"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"checkbox"</string>
<string name="icon-name">"sizer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"1/5/2006"</string>
<string name="proxy-type">"wbCheckBoxProxy"</string>
<string name="proxy-Id name">"ID_CHECKBOX"</string>
<long name="proxy-Id value">10005</long>
<string name="proxy-Class">"wxCheckBox"</string>
<string name="proxy-Member variable name">"m_Plot_Sheet_Ref"</string>
<string name="proxy-Label">"Print Sheet Ref"</string>
<bool name="proxy-Initial value">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">"Plot_Sheet_Ref"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<bool name="proxy-wxALIGN_RIGHT">0</bool>
<bool name="proxy-wxCHK_2STATE">1</bool>
<bool name="proxy-wxCHK_3STATE">0</bool>
<bool name="proxy-wxCHK_ALLOW_3RD_STATE_FOR_USER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Left"</string>
<string name="created">"22/1/2007"</string>
<string name="proxy-type">"wbBoxSizerProxy"</string>
<string name="proxy-Orientation">"Vertical"</string>
<string name="proxy-Member variable name">"m_DefaultLineSizeCtrlSizer"</string>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
@ -674,8 +760,7 @@
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
</document>
<document>
<string name="title">"wxStaticText: wxID_STATIC"</string>
@ -693,6 +778,7 @@
<string name="proxy-Class">"wxStaticText"</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Messages :"</string>
<long name="proxy-Wrapping width">-1</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
@ -714,6 +800,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
@ -782,6 +870,8 @@
<bool name="proxy-wxRAISED_BORDER">0</bool>
<bool name="proxy-wxSTATIC_BORDER">0</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>

View File

@ -60,10 +60,6 @@ void DrawLibEntry(WinEDA_DrawPanel * panel, wxDC * DC,
int Multi, int convert,
int DrawMode, int Color = -1);
void DrawPinSymbol(WinEDA_DrawPanel * panel, wxDC * DC,
int posX, int posY, int len, int orient, int SymbolType,
int DrawMode, int Color = -1);
void DrawLibraryDrawStruct(WinEDA_DrawPanel * panel, wxDC * DC,
EDA_LibComponentStruct *LibEntry, int PartX, int PartY,
LibEDA_BaseStruct *DrawItem, int Multi,
@ -167,8 +163,8 @@ EDA_BaseStruct * PickStruct(const wxPoint & refpos,
LibEDA_BaseStruct * LocateDrawItem(SCH_SCREEN * Screen,
EDA_LibComponentStruct* LibEntry, int Unit, int Convert, int masque);
LibEDA_BaseStruct * LocateDrawItem(SCH_SCREEN * Screen, const wxPoint & refpoint,
EDA_LibComponentStruct * LibEntry, int Unit, int Convert, int masque);
DrawSheetLabelStruct * LocateSheetLabel(DrawSheetStruct *Sheet, const wxPoint & pos);
LibDrawPin * LocateAnyPin(EDA_BaseStruct *DrawList, const wxPoint & RefPos,
@ -226,9 +222,6 @@ int CountCmpNumber(void);
/* EESTRING.CPP */
/***************/
void PutTextInfo(WinEDA_DrawPanel * panel, wxDC * DC, int Orient, const wxPoint & PosX,
const wxSize& size,
const wxString & Str, int DrawMode, int color);
/***************/
/* EECONFIG.CPP */
@ -315,8 +308,11 @@ int CheckAnnotate(WinEDA_SchematicFrame * frame, bool OneSheetOnly);
/************/
/* PLOT.CPP */
/************/
void PlotArc(wxPoint centre, int StAngle, int EndAngle, int rayon);
void PlotCercle(wxPoint centre, int diametre );
void SetCurrentLineWidth( int width);
void PlotArc(wxPoint centre, int StAngle, int EndAngle, int rayon, int width = -1);
void PlotCercle(wxPoint centre, int diametre, int width = -1);
void PlotPoly( int nb, int * coord, int fill, int width = -1);
void PlotNoConnectStruct(DrawNoConnectStruct * Struct);
void PlotLibPart( EDA_SchComponentStruct *DrawLibItem );
@ -339,7 +335,7 @@ bool ClearProjectDrawList(SCH_SCREEN * FirstWindow, bool confirm_deletion);
/* DELETE.CPP */
/*************/
void LocateAndDeleteItem(WinEDA_SchematicFrame * frame, wxDC * DC);
bool LocateAndDeleteItem(WinEDA_SchematicFrame * frame, wxDC * DC);
void EraseStruct(EDA_BaseStruct *DrawStruct, SCH_SCREEN * Window);
void DeleteAllMarkers(int type);
/* Effacement des marqueurs du type "type" */

View File

@ -41,7 +41,7 @@ int x2 = t2; if(x2 > 1800) x2 -= 3600;
m_Rayon, x1, x2,
m_Unit,m_Convert,
m_Width, fill_tab[m_Fill],
m_Start.x, m_Start.y, m_End.x, m_End.y);
m_ArcStart.x, m_ArcStart.y, m_ArcEnd.x, m_ArcEnd.y);
return FALSE;
}
@ -79,7 +79,7 @@ bool LibDrawSquare::WriteDescr( FILE * ExportFile )
/***************************************************/
{
fprintf(ExportFile,"S %d %d %d %d %d %d %d %c\n",
m_Start.x, m_Start.y, m_End.x, m_End.y,
m_Pos.x, m_Pos.y, m_End.x, m_End.y,
m_Unit,m_Convert,
m_Width, fill_tab[m_Fill]);
return FALSE;
@ -118,7 +118,7 @@ wxString StringPinNum;
CONV_TO_UTF8(StringPinNum),
m_Pos.x, m_Pos.y,
(int)m_PinLen, (int)m_Orient,
m_SizeNum, m_SizeName,
m_PinNumSize, m_PinNameSize,
m_Unit,m_Convert, Etype);
if( (m_PinShape) || (m_Attributs & PINNOTDRAW) )

View File

@ -159,6 +159,10 @@ wxPoint defaultpos(-1,-1);
LoadOneEEProject( wxEmptyString, FALSE);
break;
case ID_LOAD_ONE_SHEET:
LoadOneSheet(GetScreen(), wxEmptyString);
break;
case ID_LOAD_FILE_1:
case ID_LOAD_FILE_2:
case ID_LOAD_FILE_3:
@ -519,7 +523,9 @@ wxPoint defaultpos(-1,-1);
case ID_POPUP_SCH_ORIENT_NORMAL_CMP:
option = CMP_NORMAL; break;
}
DrawPanel->MouseToCursorSchema();
DrawPanel->MouseToCursorSchema();
if ( m_CurrentScreen->m_CurrentItem->m_Flags == 0 )
SaveCopyInUndoList(m_CurrentScreen->m_CurrentItem, IS_CHANGED);
CmpRotationMiroir(
(EDA_SchComponentStruct *) m_CurrentScreen->m_CurrentItem,
&dc, option );

View File

@ -132,7 +132,12 @@ WinEDA_SchematicFrame:: WinEDA_SchematicFrame(wxWindow * father, WinEDA_App *par
m_CurrentScreen = ScreenSch;
g_ItemToRepeat = NULL;
/* Get config */
GetSettings();
g_DrawMinimunLineWidth = m_Parent->m_EDA_Config->Read(MINI_DRAW_LINE_WIDTH_KEY, (long)0);
g_PlotPSMinimunLineWidth = m_Parent->m_EDA_Config->Read(MINI_PLOTPS_LINE_WIDTH_KEY, (long) 4);
/****/
SetSize(m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y);
if ( DrawPanel ) DrawPanel->m_Block_Enable = TRUE;
ReCreateMenuBar();
@ -210,6 +215,9 @@ SCH_SCREEN * screen;
SaveSettings();
m_Parent->m_EDA_Config->Write(MINI_DRAW_LINE_WIDTH_KEY, (long)g_DrawMinimunLineWidth);
m_Parent->m_EDA_Config->Write(MINI_PLOTPS_LINE_WIDTH_KEY, (long) g_PlotPSMinimunLineWidth);
Destroy();
}

View File

@ -249,7 +249,20 @@ wxString FileName, msg;
ChangeFileNameExt( FileName,g_SchExtBuffer );
m_CurrentSheet->m_FileName = FileName;
if ( m_CurrentSheet->m_FileName != FileName )
{
m_CurrentSheet->m_FileName = FileName;
if ( wxFileExists(FileName) ) /* do we reload the data from the existing file */
{
msg.Printf( _("A file named %s exists, load it ?"), FileName.GetData());
if( IsOK (this,msg) )
{
m_Parent->LoadOneSheet(m_CurrentSheet, FileName);
}
}
}
msg = m_FileNameSize->GetValue();
m_CurrentSheet->m_FileNameSize =
ReturnValueFromString(g_UnitMetric,
@ -271,17 +284,14 @@ wxString FileName, msg;
/*************************************************************************/
bool WinEDA_SchematicFrame::EditSheet(DrawSheetStruct * Sheet, wxDC * DC)
/*************************************************************************/
/* Routine de modification des textes (Name et FileName) de la Sheet */
/* Routine to edit the SheetName and the FileName for the sheet "Sheet" */
{
BASE_SCREEN * ScreenSheet = NULL;
WinEDA_SheetPropertiesFrame * frame;
bool edit = TRUE;
if ( Sheet == NULL ) return FALSE;
ScreenSheet = Sheet;
/* Demande du nouveau texte */
/* Get the new texts */
RedrawOneStruct(DrawPanel, DC, Sheet, g_XorMode);
DrawPanel->m_IgnoreMouseEvents = TRUE;
@ -290,16 +300,6 @@ bool edit = TRUE;
DrawPanel->MouseToCursorSchema();
DrawPanel->m_IgnoreMouseEvents = FALSE;
if ( edit )
{
/* Correction du nom fichier dans la structure SCREEN correspondante */
if( ScreenSheet )
{
ScreenSheet->m_FileName = Sheet->m_FileName;
}
GetScreen()->SetModify();
}
RedrawOneStruct(DrawPanel, DC, Sheet, GR_DEFAULT_DRAWMODE);
return edit;
}

View File

@ -1,7 +1,8 @@
/********************************************************************/
/* EESchema - symbdraw.cpp */
/* Menus et Routines de dessin des elements graphiques des symboles */
/********************************************************************/
/*********************************************************************/
/* EESchema - symbdraw.cpp */
/* Create, move .. graphic shapes used to build and draw a component */
/* (lines, arcs .. */
/*********************************************************************/
#include "fctsys.h"
@ -17,8 +18,6 @@
#include "id.h"
/* Routines importees */
/* Routines locales */
static void SymbolDisplayDraw(WinEDA_DrawPanel * panel, wxDC * DC, bool erase);
static void ComputeArc(LibDrawArc * DrawItem, wxPoint ArcCentre);
@ -28,7 +27,7 @@ static void MoveLibDrawItemAt(LibEDA_BaseStruct * DrawItem, wxPoint newpos);
/* Variables locales */
static int StateDrawArc, ArcStartX, ArcStartY, ArcEndX, ArcEndY;
static wxPoint InitPosition, StartCursor, ItemPreviousPos;
static int FlSymbol_Fill = NO_FILL;
static int FlSymbol_Fill = NO_FILL;
/************************************/
@ -48,6 +47,7 @@ void WinEDA_bodygraphics_PropertiesFrame::
g_FlDrawSpecificUnit = m_CommonUnit->GetValue() ? FALSE : TRUE;
if ( m_Filled )
FlSymbol_Fill = m_Filled->GetSelection();
g_LibSymbolDefaultLineWidth = m_GraphicShapeWidthCtrl->GetValue();
if ( CurrentDrawItem )
{
@ -69,18 +69,22 @@ void WinEDA_bodygraphics_PropertiesFrame::
{
case COMPONENT_ARC_DRAW_TYPE:
((LibDrawArc*)CurrentDrawItem)->m_Fill = FlSymbol_Fill;
((LibDrawArc*)CurrentDrawItem)->m_Width = m_GraphicShapeWidthCtrl->GetValue();
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
((LibDrawCircle*)CurrentDrawItem)->m_Fill = FlSymbol_Fill;
((LibDrawCircle*)CurrentDrawItem)->m_Width = m_GraphicShapeWidthCtrl->GetValue();
break;
case COMPONENT_RECT_DRAW_TYPE:
((LibDrawSquare*)CurrentDrawItem)->m_Fill = FlSymbol_Fill;
((LibDrawSquare*)CurrentDrawItem)->m_Width = m_GraphicShapeWidthCtrl->GetValue();
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
((LibDrawPolyline*)CurrentDrawItem)->m_Fill = FlSymbol_Fill;
((LibDrawPolyline*)CurrentDrawItem)->m_Width = m_GraphicShapeWidthCtrl->GetValue();
break;
default: break;
@ -211,7 +215,8 @@ int * ptpoly;
ArcStartX = ArcEndX = m_CurrentScreen->m_Curseur.x;
ArcStartY = ArcEndY = - m_CurrentScreen->m_Curseur.y;
StateDrawArc = 1;
Arc->m_Fill = FlSymbol_Fill;
Arc->m_Fill = FlSymbol_Fill;
Arc->m_Width = g_LibSymbolDefaultLineWidth;
}
break;
@ -222,6 +227,7 @@ int * ptpoly;
Circle->m_Pos.x = m_CurrentScreen->m_Curseur.x;
Circle->m_Pos.y = - m_CurrentScreen->m_Curseur.y;
Circle->m_Fill = FlSymbol_Fill;
Circle->m_Width = g_LibSymbolDefaultLineWidth;
}
break;
@ -229,10 +235,11 @@ int * ptpoly;
{
LibDrawSquare * Square = new LibDrawSquare();
CurrentDrawItem = Square;
Square->m_Start.x = m_CurrentScreen->m_Curseur.x;
Square->m_Start.y = - m_CurrentScreen->m_Curseur.y;
Square->m_End = Square->m_Start;
Square->m_Pos.x = m_CurrentScreen->m_Curseur.x;
Square->m_Pos.y = - m_CurrentScreen->m_Curseur.y;
Square->m_End = Square->m_Pos;
Square->m_Fill = FlSymbol_Fill;
Square->m_Width = g_LibSymbolDefaultLineWidth;
}
break;
@ -246,6 +253,7 @@ int * ptpoly;
ptpoly[0] = ptpoly[2] = m_CurrentScreen->m_Curseur.x;
ptpoly[1] = ptpoly[3] = - m_CurrentScreen->m_Curseur.y;
polyline->m_Fill = FlSymbol_Fill;
polyline->m_Width = g_LibSymbolDefaultLineWidth;
}
break;
@ -253,9 +261,10 @@ int * ptpoly;
{
LibDrawSegment* Segment = new LibDrawSegment();
CurrentDrawItem = Segment;
Segment->m_Start.x = m_CurrentScreen->m_Curseur.x;
Segment->m_Start.y = -m_CurrentScreen->m_Curseur.y;
Segment->m_End = Segment->m_Start;
Segment->m_Pos.x = m_CurrentScreen->m_Curseur.x;
Segment->m_Pos.y = -m_CurrentScreen->m_Curseur.y;
Segment->m_End = Segment->m_Pos;
Segment->m_Width = g_LibSymbolDefaultLineWidth;
}
break;
@ -346,13 +355,13 @@ void WinEDA_LibeditFrame::GraphicItemBeginDraw(wxDC * DC)
/**************************************************************************/
static void RedrawWhileMovingCursor(WinEDA_DrawPanel * panel, wxDC * DC, bool erase)
/**************************************************************************/
/* Redessine le "Draw Symbol" en cours de deplacement
/* Redraw the graphoc shape while moving
*/
{
BASE_SCREEN * Screen = panel->m_Parent->m_CurrentScreen;
int mx, my;
/* Effacement ancien dessin */
/* Erase shape in the old positon*/
if( erase )
{
mx = ItemPreviousPos.x - StartCursor.x ,
@ -362,7 +371,7 @@ int mx, my;
CurrentDrawItem, CurrentUnit, g_XorMode);
}
/* Redraw moved item */
/* Redraw moved shape */
mx = Screen->m_Curseur.x - StartCursor.x ,
my = Screen->m_Curseur.y - StartCursor.y ;
DrawLibraryDrawStruct(panel, DC, CurrentLibEntry, mx , my,
@ -387,10 +396,10 @@ wxSize size;
int dy = - my - ((LibDrawArc*)CurrentDrawItem)->m_Pos.y;
((LibDrawArc*)CurrentDrawItem)->m_Pos.x = mx;
((LibDrawArc*)CurrentDrawItem)->m_Pos.y = - my;
((LibDrawArc*)CurrentDrawItem)->m_Start.x += dx;
((LibDrawArc*)CurrentDrawItem)->m_Start.y += dy;
((LibDrawArc*)CurrentDrawItem)->m_End.x += dx;
((LibDrawArc*)CurrentDrawItem)->m_End.y += dy;
((LibDrawArc*)CurrentDrawItem)->m_ArcStart.x += dx;
((LibDrawArc*)CurrentDrawItem)->m_ArcStart.y += dy;
((LibDrawArc*)CurrentDrawItem)->m_ArcEnd.x += dx;
((LibDrawArc*)CurrentDrawItem)->m_ArcEnd.y += dy;
break;
}
@ -401,11 +410,11 @@ wxSize size;
case COMPONENT_RECT_DRAW_TYPE:
size.x = ((LibDrawSquare*)CurrentDrawItem)->m_End.x -
((LibDrawSquare*)CurrentDrawItem)->m_Start.x;
((LibDrawSquare*)CurrentDrawItem)->m_Pos.x;
size.y = ((LibDrawSquare*)CurrentDrawItem)->m_End.y -
((LibDrawSquare*)CurrentDrawItem)->m_Start.y;
((LibDrawSquare*)CurrentDrawItem)->m_Start.x = mx;
((LibDrawSquare*)CurrentDrawItem)->m_Start.y = - my;
((LibDrawSquare*)CurrentDrawItem)->m_Pos.y;
((LibDrawSquare*)CurrentDrawItem)->m_Pos.x = mx;
((LibDrawSquare*)CurrentDrawItem)->m_Pos.y = - my;
((LibDrawSquare*)CurrentDrawItem)->m_End.x = mx + size.x;
((LibDrawSquare*)CurrentDrawItem)->m_End.y = - my + size.y;
break;
@ -456,7 +465,7 @@ void WinEDA_LibeditFrame::StartMoveDrawSymbol(wxDC * DC)
break;
case COMPONENT_RECT_DRAW_TYPE:
InitPosition = ((LibDrawSquare*)CurrentDrawItem)->m_Start;
InitPosition = ((LibDrawSquare*)CurrentDrawItem)->m_Pos;
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
@ -500,7 +509,7 @@ int mx = Screen->m_Curseur.x,
if( StateDrawArc == 1 )
{
int Color = ReturnLayerColor(LAYER_DEVICE);
GRLine(&panel->m_ClipBox, DC, ArcStartX, - ArcStartY, ArcEndX, - ArcEndY, Color);
GRLine(&panel->m_ClipBox, DC, ArcStartX, - ArcStartY, ArcEndX, - ArcEndY, 0, Color);
}
else
{
@ -512,11 +521,11 @@ int mx = Screen->m_Curseur.x,
GRDashedLine(&panel->m_ClipBox, DC, ArcStartX, - ArcStartY,
((LibDrawArc*)CurrentDrawItem)->m_Pos.x,
- ((LibDrawArc*)CurrentDrawItem)->m_Pos.y,
Color);
0, Color);
GRDashedLine(&panel->m_ClipBox, DC, ArcEndX, - ArcEndY,
((LibDrawArc*)CurrentDrawItem)->m_Pos.x,
- ((LibDrawArc*)CurrentDrawItem)->m_Pos.y,
Color);
0, Color);
}
}
}
@ -569,7 +578,7 @@ int mx = Screen->m_Curseur.x,
if( StateDrawArc == 1 )
{
int Color = ReturnLayerColor(LAYER_DEVICE);
GRLine(&panel->m_ClipBox, DC, ArcStartX, - ArcStartY, ArcEndX, - ArcEndY, Color);
GRLine(&panel->m_ClipBox, DC, ArcStartX, - ArcStartY, ArcEndX, - ArcEndY, 0, Color);
}
else
{
@ -581,11 +590,11 @@ int mx = Screen->m_Curseur.x,
GRDashedLine(&panel->m_ClipBox, DC, ArcStartX, - ArcStartY,
((LibDrawArc*)CurrentDrawItem)->m_Pos.x,
- ((LibDrawArc*)CurrentDrawItem)->m_Pos.y,
Color);
0, Color);
GRDashedLine(&panel->m_ClipBox, DC, ArcEndX, - ArcEndY,
((LibDrawArc*)CurrentDrawItem)->m_Pos.x,
- ((LibDrawArc*)CurrentDrawItem)->m_Pos.y,
Color);
0, Color);
}
}
}
@ -719,10 +728,10 @@ int angle;
DrawItem->t2 = (int)(atan2(dy, dx) *1800 /M_PI);
DrawItem->m_Start.x = ArcStartX;
DrawItem->m_Start.y = ArcStartY;
DrawItem->m_End.x = ArcEndX;
DrawItem->m_End.y = ArcEndY;
DrawItem->m_ArcStart.x = ArcStartX;
DrawItem->m_ArcStart.y = ArcStartY;
DrawItem->m_ArcEnd.x = ArcEndX;
DrawItem->m_ArcEnd.y = ArcEndY;
NORMALIZE_ANGLE(DrawItem->t1);
NORMALIZE_ANGLE(DrawItem->t2); // angles = 0 .. 3600

View File

@ -1,5 +1,8 @@
/*************************************************/
/* Routines d'edition de symboles de composants */
/* Functions to Load from file and save to file */
/* the graphic shapes used to draw a component */
/* When using the import/export symbol options */
/* files are the *.sym files */
/*************************************************/
/* fichier symbedit.cpp */
@ -27,10 +30,8 @@ static bool CompareSymbols(LibEDA_BaseStruct *DEntryRef,
/***************************************************/
void WinEDA_LibeditFrame::LoadOneSymbol(wxDC * DC)
/***************************************************/
/* Cette routine lit un fichier type librairie symbole et
ajoute au symbole courant les elements de trace du nouveau symbole graphique
Si il n'y a pas de symbole courant, le nouveau symbole devient le
symbole courant
/* Read a component shape file and add data (graphic items) to the current
component.
*/
{
int NumOfParts;
@ -64,7 +65,7 @@ wxString msg;
if ( FullFileName.IsEmpty() ) return;
/* Chargement de 1 symbole */
/* Load data */
ImportFile = wxFopen(FullFileName, wxT("rt"));
if (ImportFile == NULL)
{
@ -87,7 +88,7 @@ wxString msg;
if(LibEntry == NULL )
DisplayError(this, _("Symbol File is void"), 20);
else /* Ajout des elements graphiques */
else /* add data to the current symbol */
{
DrawEntry = LibEntry->m_Drawings;
while(DrawEntry)
@ -121,10 +122,9 @@ wxString msg;
/********************************************/
void WinEDA_LibeditFrame::SaveOneSymbol(void)
/********************************************/
/* Routine de sauvegarde du symbole courant edite
Le format est identique aux librairies standards
Les pins invisibles et les elements
non relativ a la forme courante ne sont pas sauves
/* Save in file the current symbol
file format is like the standard libraries, but there is only one symbol
Invisible pins are not saved
*/
{
EDA_LibComponentStruct *LibEntry = CurrentLibEntry;
@ -254,9 +254,9 @@ FILE * ExportFile;
/*****************************************************************/
void SuppressDuplicateDrawItem(EDA_LibComponentStruct * LibEntry)
/*****************************************************************/
/* Routine de suppression des elements de trace dupliques, situation
frequente lorsque l'on charge des symboles predessines plusieurs fois
pour definir un composant
/* Delete redundant graphic items.
Useful after loading asymbole from a file symbol, because some graphic items
can be duplicated.
*/
{
LibEDA_BaseStruct *DEntryRef, *DEntryCompare;
@ -291,9 +291,9 @@ wxDC * DC = NULL;
static bool CompareSymbols(LibEDA_BaseStruct *DEntryRef,
LibEDA_BaseStruct *DEntryCompare)
/********************************************************************/
/* Routine de comparaison de 2 DrawEntryStruct.
retourne FALSE si differentes
TRUE si egales
/* Compare 2 graphic items (arc, lines ...).
return FALSE si different
TRUE si they are identical, and therefore redundant
*/
{
int ii;
@ -332,8 +332,7 @@ int * ptref, *ptcomp;
#undef CMPSTRUCT
#define REFSTRUCT ((LibDrawText *) DEntryRef)
#define CMPSTRUCT ((LibDrawText *) DEntryCompare)
if( REFSTRUCT->m_Pos.x != CMPSTRUCT->m_Pos.x) return(FALSE);
if( REFSTRUCT->m_Pos.y != CMPSTRUCT->m_Pos.y) return(FALSE);
if( REFSTRUCT->m_Pos != CMPSTRUCT->m_Pos) return(FALSE);
if( REFSTRUCT->m_Size != CMPSTRUCT->m_Size) return(FALSE);
if( REFSTRUCT->m_Text != CMPSTRUCT->m_Text )
return(FALSE);
@ -344,10 +343,8 @@ int * ptref, *ptcomp;
#undef CMPSTRUCT
#define REFSTRUCT ((LibDrawSquare *) DEntryRef)
#define CMPSTRUCT ((LibDrawSquare *) DEntryCompare)
if( REFSTRUCT->m_Start.x != CMPSTRUCT->m_Start.x) return(FALSE);
if( REFSTRUCT->m_Start.y != CMPSTRUCT->m_Start.y) return(FALSE);
if( REFSTRUCT->m_End.x != CMPSTRUCT->m_End.x) return(FALSE);
if( REFSTRUCT->m_End.y != CMPSTRUCT->m_End.y) return(FALSE);
if( REFSTRUCT->m_Pos != CMPSTRUCT->m_Pos) return(FALSE);
if( REFSTRUCT->m_End != CMPSTRUCT->m_End) return(FALSE);
break;
case COMPONENT_PIN_DRAW_TYPE:
@ -355,8 +352,7 @@ int * ptref, *ptcomp;
#undef CMPSTRUCT
#define REFSTRUCT ((LibDrawPin *) DEntryRef)
#define CMPSTRUCT ((LibDrawPin *) DEntryCompare)
if( REFSTRUCT->m_Pos.x != CMPSTRUCT->m_Pos.x) return(FALSE);
if( REFSTRUCT->m_Pos.y != CMPSTRUCT->m_Pos.y) return(FALSE);
if( REFSTRUCT->m_Pos != CMPSTRUCT->m_Pos) return(FALSE);
break;
case COMPONENT_POLYLINE_DRAW_TYPE:
@ -415,10 +411,10 @@ LibEDA_BaseStruct * DrawEntry;
#define STRUCT ((LibDrawArc *) DrawEntry)
STRUCT->m_Pos.x += dx;
STRUCT->m_Pos.y += dy;
STRUCT->m_Start.x += dx;
STRUCT->m_Start.y += dy;
STRUCT->m_End.x += dx;
STRUCT->m_End.y += dy;
STRUCT->m_ArcStart.x += dx;
STRUCT->m_ArcStart.y += dy;
STRUCT->m_ArcEnd.x += dx;
STRUCT->m_ArcEnd.y += dy;
break;
case COMPONENT_CIRCLE_DRAW_TYPE:
@ -438,8 +434,8 @@ LibEDA_BaseStruct * DrawEntry;
case COMPONENT_RECT_DRAW_TYPE:
#undef STRUCT
#define STRUCT ((LibDrawSquare *) DrawEntry)
STRUCT->m_Start.x += dx;
STRUCT->m_Start.y += dy;
STRUCT->m_Pos.x += dx;
STRUCT->m_Pos.y += dy;
STRUCT->m_End.x += dx;
STRUCT->m_End.y += dy;
break;
@ -464,7 +460,7 @@ LibEDA_BaseStruct * DrawEntry;
}
DrawEntry = DrawEntry->Next();
}
/* Reaffichage du symbole */
/* Redraw the symbol */
m_CurrentScreen->m_Curseur.x = m_CurrentScreen->m_Curseur.y = 0;
Recadre_Trace(TRUE);
m_CurrentScreen->SetRefreshReq();

View File

@ -15,7 +15,27 @@
/* Routines Locales */
/* Variables locales */
/****************************************************************************************/
void WinEDA_GerberFrame::Delete_DCode_Items(wxDC * DC, int dcode_value, int layer_number)
/****************************************************************************************/
{
if ( dcode_value < FIRST_DCODE ) // No tool selected
return;
BOARD * Pcb = m_Pcb;
TRACK * track = Pcb->m_Track, * next_track;
for ( ; track != NULL ; track = next_track )
{
next_track = track->Next();
if ( dcode_value != track->m_NetCode ) continue;
if ( layer_number >= 0 && layer_number != track->m_Layer ) continue;
Delete_Segment(DC, track);
}
GetScreen()->m_CurrentItem = NULL;
}
/*****************************************************************/
TRACK * WinEDA_GerberFrame::Delete_Segment(wxDC * DC, TRACK *Track)

View File

@ -273,6 +273,11 @@ wxClientDC dc(DrawPanel);
HandleBlockEnd(&dc);
break;
case ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS:
if ( gerber_layer )
Delete_DCode_Items(&dc, gerber_layer->m_Selected_Tool, GetScreen()->m_Active_Layer);
break;
default:
wxMessageBox( wxT("WinEDA_GerberFrame::Process_Special_Functions error"));
break;

View File

@ -0,0 +1,235 @@
/* export_to_pcbnew.cpp */
/*
Export des couches vers pcbnew
*/
#include "fctsys.h"
#include "common.h"
#include "gerbview.h"
#include "protos.h"
/* Routines Locales : */
static int SavePcbFormatAscii(WinEDA_GerberFrame * frame,
FILE * File, int * LayerLookUpTable);
/* Variables Locales */
/************************************************************************/
void WinEDA_GerberFrame::ExportDataInPcbnewFormat(wxCommandEvent& event)
/************************************************************************/
/* Export data in pcbnew format
*/
{
wxString FullFileName, msg;
wxString PcbExt(wxT(".brd"));
FILE * dest;
msg = wxT("*") + PcbExt;
FullFileName = EDA_FileSelector(_("Board file name:"),
wxEmptyString, /* Chemin par defaut */
wxEmptyString, /* nom fichier par defaut */
PcbExt, /* extension par defaut */
msg, /* Masque d'affichage */
this,
wxFD_SAVE,
FALSE
);
if ( FullFileName == wxEmptyString ) return;
int * LayerLookUpTable;
if ( ( LayerLookUpTable = InstallDialogLayerPairChoice(this) ) != NULL )
{
if ( wxFileExists(FullFileName) )
{
if ( ! IsOK(this, _("Ok to change the existing file ?")) )
return;
}
dest = wxFopen(FullFileName, wxT("wt"));
if (dest == 0)
{
msg = _("Unable to create ") + FullFileName;
DisplayError(this, msg) ;
return;
}
GetScreen()->m_FileName = FullFileName;
SavePcbFormatAscii(this, dest, LayerLookUpTable);
fclose(dest) ;
}
}
/***************************************************************/
static int WriteSetup(FILE * File, BOARD * Pcb)
/***************************************************************/
{
char text[1024];
fprintf(File,"$SETUP\n");
sprintf(text, "InternalUnit %f INCH\n", 1.0/PCB_INTERNAL_UNIT);
to_point(text);
fprintf(File, text);
Pcb->m_BoardSettings->m_CopperLayerCount = g_DesignSettings.m_CopperLayerCount;
fprintf(File, "Layers %d\n", g_DesignSettings.m_CopperLayerCount);
fprintf(File,"$EndSETUP\n\n");
return(1);
}
/******************************************************/
static bool WriteGeneralDescrPcb(BOARD * Pcb, FILE * File)
/******************************************************/
{
int NbLayers;
/* generation du masque des couches autorisees */
NbLayers = Pcb->m_BoardSettings->m_CopperLayerCount;
fprintf(File,"$GENERAL\n");
fprintf(File,"LayerCount %d\n",NbLayers);
/* Generation des coord du rectangle d'encadrement */
Pcb->ComputeBoundaryBox();
fprintf(File,"Di %d %d %d %d\n",
Pcb->m_BoundaryBox.GetX(), Pcb->m_BoundaryBox.GetY(),
Pcb->m_BoundaryBox.GetRight(),
Pcb->m_BoundaryBox.GetBottom());
fprintf(File,"$EndGENERAL\n\n");
return TRUE;
}
/*******************************************************************/
static int SavePcbFormatAscii(WinEDA_GerberFrame * frame,FILE * File,
int * LayerLookUpTable)
/*******************************************************************/
/* Routine de sauvegarde du PCB courant sous format ASCII
retourne
1 si OK
0 si sauvegarde non faite
*/
{
char Line[256];
TRACK * track, *next_track;
EDA_BaseStruct * PtStruct, *NextStruct;
BOARD * GerberPcb = frame->m_Pcb;
BOARD * Pcb;
wxBeginBusyCursor();
/* Create an image of gerber data */
Pcb = new BOARD(NULL, frame);
for(track = GerberPcb->m_Track; track != NULL; track = (TRACK*) track->Pnext)
{
int layer = track->m_Layer;
int pcb_layer_number = LayerLookUpTable[layer];
if ( pcb_layer_number < 0 ) continue;
if ( pcb_layer_number > CMP_N )
{
DRAWSEGMENT * drawitem = new DRAWSEGMENT(NULL, TYPEDRAWSEGMENT);
drawitem->m_Layer = pcb_layer_number;
drawitem->m_Start = track->m_Start;
drawitem->m_End = track->m_End;
drawitem->m_Width = track->m_Width;
drawitem->Pnext = Pcb->m_Drawings;
Pcb->m_Drawings = drawitem;
}
else
{
TRACK * newtrack = new TRACK(*track);
newtrack->m_Layer = pcb_layer_number;
newtrack->Insert(Pcb, NULL);
}
}
/* replace spots by vias when possible */
for(track = Pcb->m_Track; track != NULL; track = (TRACK*) track->Pnext)
{
if( (track->m_Shape != S_SPOT_CIRCLE) && (track->m_Shape != S_SPOT_RECT) && (track->m_Shape != S_SPOT_OVALE) )
continue;
/* A spot is found, and can be a via: change it for via, and delete others
spots at same location */
track->m_Shape = VIA_NORMALE;
track->m_StructType = TYPEVIA;
track->m_Layer = 0x0F; // Layers are 0 to 15 (Cu/Cmp)
track->m_Drill = -1;
/* Compute the via position from track position ( Via position is the position of the middle of the track segment */
track->m_Start.x = (track->m_Start.x +track->m_End.x)/2;
track->m_Start.y = (track->m_Start.y +track->m_End.y)/2;
track->m_End = track->m_Start;
}
/* delete redundant vias */
for(track = Pcb->m_Track; track != NULL; track = track->Next())
{
if( track->m_Shape != VIA_NORMALE ) continue;
/* Search and delete others vias*/
TRACK * alt_track = track->Next();
for( ; alt_track != NULL; alt_track = next_track)
{
next_track = (TRACK*) alt_track->Pnext;
if( alt_track->m_Shape != VIA_NORMALE ) continue;
if ( alt_track->m_Start != track->m_Start ) continue;
/* delete track */
alt_track->UnLink();
delete alt_track;
}
}
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
setlocale(LC_NUMERIC, "C");
/* Ecriture de l'entete PCB : */
fprintf(File,"PCBNEW-BOARD Version %d date %s\n\n",g_CurrentVersionPCB,
DateAndTime(Line) );
WriteGeneralDescrPcb(Pcb, File);
WriteSetup(File, Pcb);
/* Ecriture des donnes utiles du pcb */
PtStruct = Pcb->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext )
{
switch ( PtStruct->m_StructType )
{
case TYPETEXTE:
((TEXTE_PCB*)PtStruct)->WriteTextePcbDescr(File) ;
break;
case TYPEDRAWSEGMENT:
((DRAWSEGMENT *)PtStruct)->WriteDrawSegmentDescr(File);
break;
default:
break;
}
}
fprintf(File,"$TRACK\n");
for(track = Pcb->m_Track; track != NULL; track = (TRACK*) track->Pnext)
{
track->WriteTrackDescr(File);
}
fprintf(File,"$EndTRACK\n");
fprintf(File,"$EndBOARD\n");
/* Delete the copy */
for( PtStruct = Pcb->m_Drawings; PtStruct != NULL; PtStruct = NextStruct )
{
NextStruct = PtStruct->Pnext;
delete PtStruct;
}
for(track = Pcb->m_Track; track != NULL; track = next_track)
{
next_track = (TRACK*) track->Pnext;
delete track;
}
delete Pcb;
setlocale(LC_NUMERIC, ""); // revert to the current locale
wxEndBusyCursor();
return 1;
}

View File

@ -122,8 +122,9 @@ wxString path = wxPathOnly(FullFileName);
ActiveScreen = GetScreen();
if( filename == wxEmptyString)
{
wxString mask = wxT("*") + g_PhotoFilenameExt;
{
wxString mask = wxT("*") + g_PhotoFilenameExt;
mask += wxT(";*.gbr;*.lgr;*.ger");
filename = EDA_FileSelector(_("GERBER PLOT files:"),
path, /* Chemin par defaut */
wxEmptyString, /* nom fichier par defaut */
@ -134,7 +135,7 @@ wxString path = wxPathOnly(FullFileName);
FALSE
);
if ( filename == wxEmptyString ) return FALSE;
}
}
GetScreen()->m_FileName = filename;
wxSetWorkingDirectory(path);

View File

@ -49,6 +49,7 @@ BEGIN_EVENT_TABLE(WinEDA_GerberFrame, wxFrame)
EVT_MENU(ID_MENU_SAVE_BOARD, WinEDA_GerberFrame::Files_io)
EVT_MENU(ID_MENU_SAVE_BOARD_AS, WinEDA_GerberFrame::Files_io)
EVT_MENU(ID_GEN_PLOT, WinEDA_GerberFrame::ToPlotter)
EVT_MENU(ID_GERBVIEW_EXPORT_TO_PCBNEW, WinEDA_GerberFrame::ExportDataInPcbnewFormat)
EVT_MENU_RANGE(ID_LOAD_FILE_1,ID_LOAD_FILE_10,
WinEDA_GerberFrame::Files_io)
@ -66,12 +67,13 @@ BEGIN_EVENT_TABLE(WinEDA_GerberFrame, wxFrame)
// menu Postprocess
EVT_MENU(ID_GERBVIEW_SHOW_LIST_DCODES, WinEDA_GerberFrame::Process_Special_Functions)
// menu Miscellaneous
EVT_MENU(ID_PCB_GLOBAL_DELETE, WinEDA_GerberFrame::Process_Special_Functions)
EVT_MENU(ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS, WinEDA_GerberFrame::Process_Special_Functions)
EVT_MENU(ID_GERBVIEW_SHOW_SOURCE,
WinEDA_GerberFrame::Process_Special_Functions )
// menu Miscellaneous
EVT_MENU(ID_PCB_GLOBAL_DELETE, WinEDA_GerberFrame::Process_Special_Functions)
// Menu Help
EVT_MENU(ID_GENERAL_HELP, WinEDA_DrawFrame::GetKicadHelp)
EVT_MENU(ID_KICAD_ABOUT, WinEDA_DrawFrame::GetKicadAbout)
@ -101,6 +103,10 @@ BEGIN_EVENT_TABLE(WinEDA_GerberFrame, wxFrame)
EVT_MENU_RANGE(ID_POPUP_GENERAL_START_RANGE, ID_POPUP_GENERAL_END_RANGE,
WinEDA_PcbFrame::Process_Special_Functions )
// Pop up menu
EVT_MENU(ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
WinEDA_GerberFrame::Process_Special_Functions )
// Option toolbar
EVT_TOOL_RANGE(ID_TB_OPTIONS_START,ID_TB_OPTIONS_END,
WinEDA_GerberFrame::OnSelectOptionToolbar)
@ -187,150 +193,6 @@ PCB_SCREEN * screen;
Destroy();
}
/***********************************************/
void WinEDA_GerberFrame::ReCreateMenuBar(void)
/***********************************************/
/* Cree ou reinitialise le menu du haut d'ecran
*/
{
int ii;
wxMenuBar * menuBar = GetMenuBar();
if( menuBar == NULL )
{
menuBar = new wxMenuBar();
m_FilesMenu = new wxMenu;
m_FilesMenu->Append(ID_MENU_LOAD_FILE,
_("Clear and Load gerber file"),
_("Clear all layers and Load new gerber file"),
FALSE);
m_FilesMenu->Append(ID_MENU_APPEND_FILE,
_("Load gerber file"),
_("Load new gerber file on currrent layer"),
FALSE);
m_FilesMenu->Append(ID_MENU_INC_LAYER_AND_APPEND_FILE,
_("Inc Layer and load gerber file"),
_("Increment layer number, and Load gerber file"),
FALSE);
m_FilesMenu->Append(ID_GERBVIEW_LOAD_DCODE_FILE,
_("Load DCodes"),
_("Load D-Codes File"),
FALSE);
m_FilesMenu->Append(ID_GERBVIEW_LOAD_DRILL_FILE,
_("Load Drill"),
_("Load Drill File (EXCELLON Format)"),
FALSE);
m_FilesMenu->Append(ID_MENU_NEW_BOARD,
_("&New"),
_("Clear all layers"),
FALSE);
m_FilesMenu->AppendSeparator();
m_FilesMenu->Append(ID_MENU_SAVE_BOARD,
_("&Save layers"),
_("Save current layers (GERBER format)"),
FALSE);
m_FilesMenu->Append(ID_MENU_SAVE_BOARD_AS,
_("Save layers as.."),
_("Save current layers as.."),
FALSE);
m_FilesMenu->AppendSeparator();
m_FilesMenu->Append(ID_GEN_PRINT, _("P&rint"), _("Print on current printer"));
m_FilesMenu->Append(ID_GEN_PLOT,
_("Plot"), _("Plotting in various formats") );
m_FilesMenu->AppendSeparator();
m_FilesMenu->Append(ID_EXIT,_("E&xit"), _("Quit Gerbview") );
// Creation des selections des anciens fichiers
m_FilesMenu->AppendSeparator();
for ( int ii = 0; ii < 10; ii++ )
{
if ( GetLastProject(ii).IsEmpty() ) break;
m_FilesMenu->Append(ID_LOAD_FILE_1 + ii, GetLastProject(ii) );
}
// Configuration:
wxMenu * configmenu = new wxMenu;
configmenu->Append(ID_CONFIG_REQ, _("&Files and Dir"),
_("Setting Files extension, Directories and others..."));
configmenu->Append(ID_COLORS_SETUP, _("&Colors"),
_("Select Colors and Display for layers"));
configmenu->Append(ID_OPTIONS_SETUP, _("&Options"),
_(" Select general options"));
configmenu->Append(ID_PCB_LOOK_SETUP, _("Display"),
_(" Select how items are displayed"));
// Font selection and setup
AddFontSelectionMenu(configmenu);
m_Parent->SetLanguageList(configmenu);
configmenu->AppendSeparator();
configmenu->Append(ID_CONFIG_SAVE, _("&Save Gerbview Setup"),
_("Save options in current directory"));
// Menu drill ( generation fichiers percage)
/* wxMenu *drill_menu = new wxMenu;
postprocess_menu->Append(ID_PCB_GEN_DRILL_FILE, "Create &Drill file",
"Gen Drill (EXCELLON] file and/or Drill sheet");
*/
// Menu d'outils divers
wxMenu *miscellaneous_menu = new wxMenu;
miscellaneous_menu->Append(ID_GERBVIEW_SHOW_LIST_DCODES, _("&List DCodes"),
_("List and Edit DCodes") );
miscellaneous_menu->Append(ID_GERBVIEW_SHOW_SOURCE,_("&Show source"),
_("Show source file for the current layer") );
miscellaneous_menu->AppendSeparator();
miscellaneous_menu->Append(ID_PCB_GLOBAL_DELETE, _("&Delete Layer"),
_("Delete current layer") );
// Menu Help:
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(ID_GENERAL_HELP, _("&Help"), _("On line doc") );
helpMenu->Append(ID_KICAD_ABOUT, _("&About"), _("Gerbview Infos") );
menuBar->Append(m_FilesMenu, _("&Files"));
menuBar->Append(configmenu, _("&Preferences"));
menuBar->Append(miscellaneous_menu, _("&Miscellaneous"));
// menuBar->Append(drill_menu, _("&Drill"));
menuBar->Append(helpMenu, _("&Help"));
// Associate the menu bar with the frame
SetMenuBar(menuBar);
}
else // simple mise a jour de la liste des fichiers anciens
{
wxMenuItem * item;
int max_file = m_Parent->m_LastProjectMaxCount;
for ( ii = max_file-1; ii >=0 ; ii-- )
{
if( m_FilesMenu->FindItem(ID_LOAD_FILE_1 + ii) )
{
item = m_FilesMenu->Remove(ID_LOAD_FILE_1 + ii);
if ( item ) delete item;
}
}
for ( ii = 0; ii < max_file; ii++ )
{
if ( GetLastProject(ii).IsEmpty() ) break;
m_FilesMenu->Append(ID_LOAD_FILE_1 + ii, GetLastProject(ii) );
}
}
}
/*******************************************/
void WinEDA_GerberFrame::SetToolbars(void)
/*******************************************/

View File

@ -20,8 +20,7 @@ typedef enum {
FORMAT_GERBER,
FORMAT_POST
} PlotFormat;
//eda_global wxString g_Plot_FileName;
eda_global wxString g_PhotoFilenameExt;
eda_global wxString g_DrillFilenameExt;
@ -124,6 +123,7 @@ public:
int m_Iterpolation; // Linear, 90 arc, Circ.
bool m_ImageNegative; // TRUE = Negative image
int m_Current_Tool; // Current Tool (Dcode) number selected
int m_Last_Pen_Command; // Current or last pen state (0..9, set by Dn option with n <10
int m_CommandState; // donne l'etat de l'analyse des commandes gerber
wxPoint m_CurrentPos; // current specified coord for plot
wxPoint m_PreviousPos; // old current specified coord for plot

View File

@ -26,11 +26,10 @@ static int distance(int seuil);
/* Macro de calcul de la coord de pointage selon le curseur
(ON/OFF grille) choisi
A REVOIR
*/
#define SET_REF_POS(ref) if(typeloc == CURSEUR_ON_GRILLE) \
{ ref = ActiveScreen->m_Curseur;} \
else { ref = ActiveScreen->m_Curseur; }
else { ref = ActiveScreen->m_MousePosition; }
@ -50,7 +49,7 @@ int layer;
/* Localistion des pistes et vias, avec priorite aux vias */
layer = GetScreen()->m_Active_Layer;
Track = Locate_Pistes( m_Pcb->m_Track, NO_TST_LAYER,typeloc );
Track = Locate_Pistes( m_Pcb->m_Track, -1, typeloc );
if ( Track != NULL )
{
TrackLocate = Track ; /* Reperage d'une piste ou via */

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