Commit ae74527b authored by dickelbeck's avatar dickelbeck

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

parent 1db13740
......@@ -225,17 +225,35 @@ float spin_quat[4];
if ( event.m_wheelRotation )
{
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 );
......
......@@ -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;
......
......@@ -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
......
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
......
......@@ -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
......
/* 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
/* 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
/* 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
/* 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
/* 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
......@@ -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:
......@@ -99,6 +99,21 @@ void BASE_SCREEN::InitDatas(void)
}
/******************************************************************/
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)
/***************************************/
......
......@@ -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);
}
}
......
......@@ -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;
......
......@@ -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);
}
/*************************************************************************/
......
......@@ -19,7 +19,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;
//Variables locales
......@@ -38,8 +38,9 @@ void InitPlotParametresHPGL(wxPoint offset, double xscale, double yscale, int or
PlotOffset = offset;
XScale = xscale;
YScale = yscale;
PenWidth = 6; /* epaisseur du trait standard en 1/1000 pouce */
g_DefaultPenWidth = 6; /* epaisseur du trait standard en 1/1000 pouce */
PlotOrientOptions = orient;
g_CurrentPenWidth = -1;
}
......@@ -61,7 +62,7 @@ char Line[256];
bool CloseFileHPGL(FILE * plot_file)
/**********************************/
{
fputs("PU;PA;SP0;\n",PlotOutputFile) ; fclose(PlotOutputFile) ;
fputs("PU;PA;SP0;\n",plot_file);
fclose(plot_file);
return TRUE;
}
......@@ -88,7 +89,7 @@ char Line[256];
/********************************************************************/
void PlotArcHPGL(wxPoint centre, int StAngle, int EndAngle, int rayon)
void PlotArcHPGL(wxPoint centre, int StAngle, int EndAngle, int rayon, int width)
/********************************************************************/
/* trace d'un arc de cercle:
centre = coord du centre
......@@ -132,7 +133,7 @@ float angle; /* angle de l'arc*/
/*****************************************************/
void PlotPolyHPGL( int nb, int * coord, int fill)
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
......
......@@ -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
}
......
......@@ -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;
......
......@@ -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") );
......
......@@ -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 cration 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),
......@@ -259,3 +261,10 @@ const wxString ** BufList;
}
/****************************************************/
void WinEDAListBox::OnKeyEvent(wxKeyEvent& event)
/****************************************************/
{
event.Skip();
}
......@@ -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;
......
//////////////////////
// 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];
......@@ -80,8 +83,10 @@ wxSocketBase *sock = evt.GetSocket();
{
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( 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;
......@@ -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 numro de service en ascii.
service is the service number for the TC/IP connection
*/
{
wxSocketClient * sock_client;
......
......@@ -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();
}
......@@ -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);
}
This diff is collapsed.
......@@ -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 $@
......
......@@ -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
......
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)
......
......@@ -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)
......
This diff is collapsed.
......@@ -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)
......
......@@ -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;
}
......
......@@ -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) ;
......
......@@ -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:
......
# makefile pour cvpcb (mingw)
OBJSUFF = o
EXTRACPPFLAGS = -DCVPCB -I./ -I../cvpcb -I../include -Ibitmaps -I../pcbnew -I../3d-viewer
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
......
......@@ -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)
......
......@@ -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);
}
......@@ -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;
......
......@@ -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 */
/************************/
......@@ -171,3 +224,93 @@ DrawSheetLabelStruct * newitem =
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 */
}
......@@ -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,15 +136,15 @@ 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);
......@@ -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);
......
......@@ -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,14 +44,101 @@ EDA_BaseStruct * WinEDA_SchematicFrame::
*/
{
EDA_BaseStruct *DrawStruct;
wxString msg;
wxPoint mouse_position = GetScreen()->m_MousePosition;
LibDrawPin * Pin = NULL;
EDA_SchComponentStruct * LibItem = NULL;
char Line[1024];
DrawStruct = SchematicGeneralLocateAndDisplay(mouse_position, IncludePin);
if(! DrawStruct && ( mouse_position != GetScreen()->m_Curseur) )
{
DrawStruct = SchematicGeneralLocateAndDisplay(GetScreen()->m_Curseur, IncludePin);
}
if ( ! DrawStruct ) return NULL;
/* 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)
{
wxString pinnum;
Pin->ReturnPinStringNum(pinnum);
sprintf(Line,"$PIN: %s $PART: %s", CONV_TO_UTF8(pinnum),
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;
char Line[1024];
wxString msg;
int ii;
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList, MARKERITEM);
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList, MARKERITEM);
if( DrawStruct )
{
DrawMarkerStruct * Marker = (DrawMarkerStruct *) DrawStruct;
......@@ -63,27 +150,27 @@ int ii;
return(DrawStruct);
}
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList,
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList,
NOCONNECTITEM);
if( DrawStruct )
{
Affiche_Message(wxEmptyString);
MsgPanel->EraseMsgBox();
return(DrawStruct);
}
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList,
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList,
JUNCTIONITEM);
if( DrawStruct )
{
Affiche_Message(wxEmptyString);
MsgPanel->EraseMsgBox();
return(DrawStruct);
}
DrawStruct = PickStruct(GetScreen()->m_Curseur, GetScreen()->EEDrawList,
DrawStruct = PickStruct(refpoint, GetScreen()->EEDrawList,
WIREITEM|BUSITEM|RACCORDITEM);
if( DrawStruct ) // Recherche d'une pin eventelle
if( DrawStruct ) // Search for a pin
{
Pin = LocateAnyPin(m_CurrentScreen->EEDrawList,m_CurrentScreen->m_Curseur, &LibItem);
Pin = LocateAnyPin(m_CurrentScreen->EEDrawList,refpoint, &LibItem);
if( Pin )
{
Pin->Display_Infos(this);
......@@ -93,42 +180,23 @@ int ii;
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);
else MsgPanel->EraseMsgBox();
return(DrawStruct);
}
// 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);
DrawStruct = PickStruct(refpoint, 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);
Pin = LocateAnyPin(m_CurrentScreen->EEDrawList, refpoint, &LibItem);
if( Pin )
{
Pin->Display_Infos(this);
......@@ -137,36 +205,19 @@ int ii;
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)
{
wxString pinnum;
Pin->ReturnPinStringNum(pinnum);
sprintf(Line,"$PIN: %s $PART: %s", CONV_TO_UTF8(pinnum),
CONV_TO_UTF8(LibItem->m_Field[REFERENCE].m_Text));
SendCommand(MSG_TO_PCB, Line);
}
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:
......
......@@ -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;
}
......
This diff is collapsed.
......@@ -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;
......
This diff is collapsed.
......@@ -76,21 +76,26 @@ int fill_option = 0;
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;
......@@ -109,6 +114,7 @@ bool WinEDA_bodygraphics_PropertiesFrame::Create( wxWindow* parent, wxWindowID i
////@begin WinEDA_bodygraphics_PropertiesFrame member initialisation
m_CommonUnit = NULL;
m_CommonConvert = NULL;
m_ShapeWidthBoxSizer = NULL;
m_Filled = NULL;
////@end WinEDA_bodygraphics_PropertiesFrame member initialisation
......@@ -117,8 +123,10 @@ bool WinEDA_bodygraphics_PropertiesFrame::Create( wxWindow* parent, wxWindowID i
wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls();
GetSizer()->Fit(this);
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
Centre();
////@end WinEDA_bodygraphics_PropertiesFrame creation
return true;
......@@ -133,7 +141,7 @@ void WinEDA_bodygraphics_PropertiesFrame::CreateControls()
SetFont(*g_DialogFont);
////@begin WinEDA_bodygraphics_PropertiesFrame content construction
// Generated by DialogBlocks, 12/02/2006 11:50:42 (unregistered)
// Generated by DialogBlocks, 21/01/2007 16:28:34 (unregistered)
WinEDA_bodygraphics_PropertiesFrame* itemDialog1 = this;
......@@ -152,26 +160,34 @@ void WinEDA_bodygraphics_PropertiesFrame::CreateControls()
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* 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);
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_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton9->SetForegroundColour(wxColour(206, 0, 0));
itemBoxSizer8->Add(itemButton9, 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);
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);
}
/*!
......
......@@ -27,6 +27,7 @@
*/
////@begin forward declarations
class wxBoxSizer;
////@end forward declarations
/*!
......@@ -35,14 +36,14 @@
////@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
/*!
......@@ -103,9 +104,11 @@ public:
////@begin WinEDA_bodygraphics_PropertiesFrame member variables
wxCheckBox* m_CommonUnit;
wxCheckBox* m_CommonConvert;
wxBoxSizer* m_ShapeWidthBoxSizer;
wxRadioBox* m_Filled;
////@end WinEDA_bodygraphics_PropertiesFrame member variables
WinEDA_LibeditFrame * m_Parent;
WinEDA_ValueCtrl * m_GraphicShapeWidthCtrl;
};
#endif
......
......@@ -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>
......
......@@ -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);
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);
}
......@@ -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
......
This diff is collapsed.
......@@ -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);
......
......@@ -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
......
This diff is collapsed.
......@@ -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;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment