Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 14630) +++ trunk/src/conf_act.c (revision 14631) @@ -279,22 +279,17 @@ return (PCB->Grid == pcb_get_value_ex(argv[0], NULL, NULL, NULL, NULL, NULL)); } -static const char ChkElementName_syntax[] = - "ChkElementName(1) - expect description\n" - "ChkElementName(2) - expect refdes\n" - "ChkElementName(3) - expect value\n" - ; -static const char ChkElementName_help[] = "Return 1 if currently shown element label (name) type matches the expected"; -static int pcb_act_ChkElementName(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) +static const char ChkSubcID_syntax[] = "ChkSubcID(pattern)\n"; +static const char ChkSubcID_help[] = "Return 1 if currently shown subc ID matches the requested pattern"; +static int pcb_act_ChkSubcID(int argc, const char **argv, pcb_coord_t x, pcb_coord_t y) { - int have, expected = argv[0][0] - '0'; + const char *have = conf_core.editor.subc_id, *expected; - assert(argc == 1); - if (conf_core.editor.description) have = 1; - else if (conf_core.editor.name_on_pcb) have = 2; - else have = 3; + if (have == NULL) have = ""; + if (argc > 0) expected = argv[0]; + else expected = ""; - return expected == have; + return strcmp(expected, have) == 0; } static const char ChkGridUnits_syntax[] = "ChkGridUnits(expected)"; @@ -328,8 +323,8 @@ {"ChkGridSize", 0, pcb_act_ChkGridSize, ChkGridSize_help, ChkGridSize_syntax} , - {"ChkElementName", 0, pcb_act_ChkElementName, - ChkElementName_help, ChkElementName_syntax} + {"ChkSubcID", 0, pcb_act_ChkSubcID, + ChkSubcID_help, ChkSubcID_syntax} , {"ChkGridUnits", 0, pcb_act_ChkGridUnits, ChkGridUnits_help, ChkGridUnits_syntax} Index: trunk/src/pcb-menu-gtk.lht =================================================================== --- trunk/src/pcb-menu-gtk.lht (revision 14630) +++ trunk/src/pcb-menu-gtk.lht (revision 14631) @@ -200,11 +200,12 @@ } ha:Realign grid = { action={ GetXY(Click to set the grid origin); Display(ToggleGrid) } } - - ha:Displayed element name { + ha:Displayed subcircuit ID { li:submenu { - ha:refdes = { checked=ChkElementName(5); action=Display(SubcID); update_on={editor/name_on_pcb} } - ha:footprint = { checked=ChkElementName(5); action=Display(SubcID,"%a.footprint%"); update_on={editor/description} } - ha:Value = { checked=ChkElementName(5); action=Display(SubcID,"%a.value%"); update_on={editor/name_on_pcb} } + ha:refdes = { checked=ChkSubcID(); action=Display(SubcID); update_on={editor/name_on_pcb} } + ha:footprint = { checked=ChkSubcID(%a.footprint%); action=Display(SubcID,"%a.footprint%"); update_on={editor/subc_id} } + ha:value = { checked=ChkSubcID(%a.value%); action=Display(SubcID,"%a.value%"); update_on={editor/subc_id} } + ha:refdes+value = { checked=ChkSubcID(%a.refdes%\\n%a.value%); action=Display(SubcID,"%a.refdes%\\\\n%a.value%"); update_on={editor/subc_id} } } } ha:Enable Pinout shows number = { checked=editor/show_number; action=conf(toggle, editor/show_number, design) } Index: trunk/src/pcb-menu-lesstif.lht =================================================================== --- trunk/src/pcb-menu-lesstif.lht (revision 14630) +++ trunk/src/pcb-menu-lesstif.lht (revision 14631) @@ -89,9 +89,10 @@ ha:Show soldermask = { checked=editor/show_mask; action=Display(ToggleMask) } - ha:Displayed element-name... = { foreground=grey50; sensitive=false } - ha:Description = { checked=ChkElementName(1); action=Display(Description) } - ha:Reference Designator = { checked=ChkElementName(2); action=Display(NameOnPCB) } - ha:Value = { checked=ChkElementName(3); action=Display(Value) } + ha:refdes = { checked=ChkSubcID(); action=Display(SubcID) } + ha:footprint = { checked=ChkSubcID(%a.footprint%); action=Display(SubcID,"%a.footprint%") } + ha:value = { checked=ChkSubcID(%a.value%); action=Display(SubcID,"%a.value%") } + ha:refdes+value = { checked=ChkSubcID(%a.refdes%\\n%a.value%); action=Display(SubcID,"%a.refdes%\\\\n%a.value%") } ha:Lock floaters = { checked=editor/lock_names; action=conf(toggle, editor/lock_names, design) } ha:Only floaters = { checked=editor/only_names; action=conf(toggle, editor/only_names, design) } ha:Hide floaters = { checked=editor/hide_names; action=conf(toggle, editor/hide_names, design) } Index: trunk/src/pcb-menu-mkey.lht =================================================================== --- trunk/src/pcb-menu-mkey.lht (revision 14630) +++ trunk/src/pcb-menu-mkey.lht (revision 14631) @@ -200,11 +200,12 @@ } ha:Realign grid = { action={ GetXY(Click to set the grid origin); Display(ToggleGrid) } } - - ha:Displayed element name { + ha:Displayed subcircuit ID { li:submenu { - ha:Description = { checked=ChkElementName(1); action=Display(Description); update_on={editor/description} } - ha:Reference Designator = { checked=ChkElementName(2); action=Display(NameOnPCB); update_on={editor/name_on_pcb} } - ha:Value = { checked=ChkElementName(3); action=Display(Value); update_on={editor/name_on_pcb} } + ha:refdes = { checked=ChkSubcID(); action=Display(SubcID); update_on={editor/name_on_pcb} } + ha:footprint = { checked=ChkSubcID(%a.footprint%); action=Display(SubcID,"%a.footprint%"); update_on={editor/subc_id} } + ha:value = { checked=ChkSubcID(%a.value%); action=Display(SubcID,"%a.value%"); update_on={editor/subc_id} } + ha:refdes+value = { checked=ChkSubcID(%a.refdes%\\n%a.value%); action=Display(SubcID,"%a.refdes%\\\\n%a.value%"); update_on={editor/subc_id} } } } ha:Enable Pinout shows number = { checked=editor/show_number; action=conf(toggle, editor/show_number, design) }