Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 9320) +++ trunk/src/obj_subc.c (revision 9321) @@ -35,6 +35,7 @@ #include "obj_text_draw.h" #include "rtree.h" #include "draw.h" +#include "flag.h" #include "operation.h" pcb_subc_t *pcb_subc_alloc(void) @@ -235,7 +236,7 @@ /* pcb_flag_erase(&sc->Flags); ??? */ } -static void DrawSubc(pcb_subc_t *sc) +void DrawSubc(pcb_subc_t *sc) { pcb_draw_invalidate(sc); } @@ -439,6 +440,7 @@ ctx.flag = PCB_FLAG_SELECTED; pcb_subc_op(PCB->Data, sc, &ChgFlagFunctions, &ctx); + PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, sc); if (redraw) DrawSubc(sc); } Index: trunk/src/obj_subc.h =================================================================== --- trunk/src/obj_subc.h (revision 9320) +++ trunk/src/obj_subc.h (revision 9321) @@ -47,6 +47,7 @@ #include "rtree.h" pcb_r_dir_t draw_subc_mark_callback(const pcb_box_t *b, void *cl); +void DrawSubc(pcb_subc_t *sc); /*** loops ***/ Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 9320) +++ trunk/src/select.c (revision 9321) @@ -218,6 +218,7 @@ * returns a list of object IDs matched the search and loads len with the * length of the list. Returns NULL on no match. */ +#warning TODO: should be rewritten with generic ops and rtree static long int *ListBlock_(pcb_board_t *pcb, pcb_box_t *Box, pcb_bool Flag, int *len) { int changed = 0; @@ -364,6 +365,29 @@ } PCB_END_LOOP; + PCB_SUBC_LOOP(pcb->Data); + { + if (PCB_POLYGON_NEAR_BOX(subc, Box) + && !PCB_FLAG_TEST(PCB_FLAG_LOCK, subc) + && PCB_FLAG_TEST(PCB_FLAG_SELECTED, subc) != Flag) { + + if (len == NULL) { + pcb_select_subc(PCB, subc, Flag, 1); + } + else { + if (used >= alloced) { + alloced += 64; + list = realloc(list, sizeof(*list) * alloced); + } + list[used] = subc->ID; + used++; + } + changed = 1; + DrawSubc(subc); + } + } + PCB_END_LOOP; + /* elements */ PCB_ELEMENT_LOOP(pcb->Data); {