Index: trunk/doc/TODO =================================================================== --- trunk/doc/TODO (revision 8986) +++ trunk/doc/TODO (revision 8987) @@ -7,7 +7,7 @@ - {a a} on the sheet should edit the attributes of the direct group - popup menu for sheet and symbol-as-sheet, keep none for off-drawing-area - verify that uuid can be changed - - look for TODO "symedit" in the source + - compiler should ignore sheets that are symbols? - CLEANUP/BUG: connect attribute works only on existing ports {des2:55} [report: Majenko] - consider making it create ports - don't return -1 in std_cschem.c:157 because a second connection in the array is not processed then Index: trunk/src/plugins/std_tools/tool_circle.c =================================================================== --- trunk/src/plugins/std_tools/tool_circle.c (revision 8986) +++ trunk/src/plugins/std_tools/tool_circle.c (revision 8987) @@ -95,7 +95,6 @@ { csch_sheet_t *sheet = (csch_sheet_t *)hl; -TODO("symedit: when editing symbol, use the symbol deco style"); if (csch_tool_circle.clicked) { double dx, dy; rnd_coord_t ps; Index: trunk/src/plugins/std_tools/tool_line.c =================================================================== --- trunk/src/plugins/std_tools/tool_line.c (revision 8986) +++ trunk/src/plugins/std_tools/tool_line.c (revision 8987) @@ -52,7 +52,6 @@ return; } -TODO("symedit: when editing symbol, use the symbol deco style"); if (csch_tool_line.stroke == NULL) csch_tool_line.stroke = SCH_RND_DIRECT_PEN(sheet, tool_line_stroke, &csch_tool_line.stroke_name); line_create_all(hl, &sheet->direct, 0); @@ -69,7 +68,7 @@ static void tool_line_draw_attached(rnd_design_t *hl) { csch_sheet_t *sheet = (csch_sheet_t *)hl; -TODO("symedit: when editing symbol, use the symbol deco style"); + if (csch_tool_line.stroke == NULL) csch_tool_line.stroke = SCH_RND_DIRECT_PEN(sheet, tool_line_stroke, &csch_tool_line.stroke_name); line_draw_attached(hl, &sheet->direct); Index: trunk/src/plugins/std_tools/tool_rect.c =================================================================== --- trunk/src/plugins/std_tools/tool_rect.c (revision 8986) +++ trunk/src/plugins/std_tools/tool_rect.c (revision 8987) @@ -113,7 +113,6 @@ { csch_sheet_t *sheet = (csch_sheet_t *)hl; -TODO("symedit: when editing symbol, use the symbol deco style"); if (csch_tool_rect.clicked) { rnd_coord_t x1, y1, x2, y2, ps; Index: trunk/src/sch-rnd/sheet.c =================================================================== --- trunk/src/sch-rnd/sheet.c (revision 8986) +++ trunk/src/sch-rnd/sheet.c (revision 8987) @@ -48,6 +48,7 @@ #include #include "conf_core.h" +#include "util_sheet.h" #include "draw.h" static const char sheet_cookie[] = "sch-rnd/sheet.c"; @@ -127,6 +128,9 @@ the new sheet, even tho librnd's current sheet is not yet set */ csch_lib_add_all(sheet, csch_lib_get_master("symbol", 1), &conf_core.rc.library_search_paths, 0); } + + if (sheet->is_symbol) + sch_rnd_reconf_for_symbol_as_sheet(); } static csch_sheet_t *sch_rnd_sheet_new_(csch_project_t *prj, csch_sheet_t *dst_sheet, int emit_ev) Index: trunk/src/sch-rnd/util_sheet.c =================================================================== --- trunk/src/sch-rnd/util_sheet.c (revision 8986) +++ trunk/src/sch-rnd/util_sheet.c (revision 8987) @@ -29,6 +29,7 @@ #include "config.h" #include +#include #include #include #include @@ -59,3 +60,12 @@ minuid_clr(dst->direct.data.grp.src_uuid); } } + +void sch_rnd_reconf_for_symbol_as_sheet(void) +{ + rnd_conf_set(RND_CFR_DESIGN, "editor/style/tool_circle_stroke", 0, "sym-decor", RND_POL_OVERWRITE); + rnd_conf_set(RND_CFR_DESIGN, "editor/style/tool_line_stroke", 0, "sym-decor", RND_POL_OVERWRITE); + rnd_conf_set(RND_CFR_DESIGN, "editor/style/tool_text_stroke", 0, "sym-decor", RND_POL_OVERWRITE); + rnd_conf_set(RND_CFR_DESIGN, "editor/style/tool_rect_stroke", 0, "sym-decor", RND_POL_OVERWRITE); + rnd_conf_set(RND_CFR_DESIGN, "editor/style/tool_rect_fill", 0, "sym-decor-fill", RND_POL_OVERWRITE); +} Index: trunk/src/sch-rnd/util_sheet.h =================================================================== --- trunk/src/sch-rnd/util_sheet.h (revision 8986) +++ trunk/src/sch-rnd/util_sheet.h (revision 8987) @@ -11,3 +11,8 @@ is copied only if it returns non-zero. If chk_copy_pen is NULL, it is assumed to always return 1. */ void sch_rnd_sheet_setup(csch_sheet_t *dst, sch_rnd_sheet_setup_cfg_t cfg, int (*chk_copy_pen)(void *udata, csch_sheet_t *dst, csch_cpen_t *p), void *udata); + +/* Change DESIGN role configuration on current sheet for symbol-as-sheet + editing */ +void sch_rnd_reconf_for_symbol_as_sheet(void); +