Index: trunk/src/conf_core.h =================================================================== --- trunk/src/conf_core.h (revision 31347) +++ trunk/src/conf_core.h (revision 31348) @@ -63,6 +63,7 @@ RND_CFT_STRING io_incomp_style; /* view listing style (list or simple), when io_incomp_popup is true */ RND_CFT_INTEGER click_time; /* default time for click expiration, in ms */ + RND_CFT_BOOLEAN click_objlist; /* if there are multiple objects available upon a click, present a modal dialog box to select from them */ struct { RND_CFT_BOOLEAN disable_negative; /* selection box behaviour: disable the negative-direction selection - any selection box will select only what's fully within the box */ Index: trunk/src/pcb-conf.lht =================================================================== --- trunk/src/pcb-conf.lht (revision 31347) +++ trunk/src/pcb-conf.lht (revision 31348) @@ -50,6 +50,7 @@ live_routing = 0 beep_when_finished = 0 click_time = 200 + click_objlist = 0 auto_via = 1 io_incomp_popup = 1 io_incomp_style = list Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 31347) +++ trunk/src/search.c (revision 31348) @@ -1658,6 +1658,47 @@ return ans; } +int pcb_search_screen_selector(rnd_coord_t X, rnd_coord_t Y, int Type, void **Result1, void **Result2, void **Result3) +{ + vtp0_t objs; + rnd_rnd_box_t box; + rnd_coord_t radius; + pcb_any_obj_t *obj; + + if ((!conf_core.editor.click_objlist) || (!RND_HAVE_GUI_ATTR_DLG)) + return PCB_OBJ_VOID; + + radius = PCB_SLOP * rnd_pixel_slop; + box.X2 = X - radius; + box.Y2 = Y - radius; + box.X1 = X + radius; + box.Y1 = Y + radius; + + vtp0_init(&objs); + pcb_list_block_cb(PCB, &box, vtp0_append, &objs); + +rnd_trace("selector: %ld radius=%mm\n", objs.used, radius); + + if (objs.used == 1) { + obj = objs.array[0]; + goto found; + } + + if (objs.used > 1) { + + } + + vtp0_uninit(&objs); + return PCB_OBJ_VOID; + + found:; + vtp0_uninit(&objs); + *Result1 = obj->parent.any; + *Result2 = *Result3 = obj; + return obj->type; +} + + int pcb_lines_intersect(rnd_coord_t ax1, rnd_coord_t ay1, rnd_coord_t ax2, rnd_coord_t ay2, rnd_coord_t bx1, rnd_coord_t by1, rnd_coord_t bx2, rnd_coord_t by2) { /* TODO: this should be long double if rnd_coord_t is 64 bits */ Index: trunk/src/search.h =================================================================== --- trunk/src/search.h (revision 31347) +++ trunk/src/search.h (revision 31348) @@ -194,6 +194,12 @@ pcb_line_t *pcb_line_center_cross_point(pcb_layer_t *layer, rnd_coord_t x, rnd_coord_t y, rnd_angle_t *ang, rnd_bool no_subc_part, rnd_bool no_term); int pcb_search_screen(rnd_coord_t X, rnd_coord_t Y, int Type, void **Result1, void **Result2, void **Result3); + +/* If disabled and there's no GUI: return VOID immediatelly; else search + screen at X,Y for any Type; if 0 or 1 found, return immediately. If + there are more hits, present the object selector dialog (modal) */ +int pcb_search_screen_selector(rnd_coord_t X, rnd_coord_t Y, int Type, void **Result1, void **Result2, void **Result3); + int pcb_search_grid_slop(rnd_coord_t X, rnd_coord_t Y, int Type, void **Result1, void **Result2, void **Result3); int pcb_search_obj_by_location(unsigned long Type, void **Result1, void **Result2, void **Result3, rnd_coord_t X, rnd_coord_t Y, rnd_coord_t Radius); int pcb_search_obj_by_id(pcb_data_t *Base, void **Result1, void **Result2, void **Result3, int ID, int type);