1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2025-04-21 12:27:27 +03:00

- changed item list font to Courier, which looks a lot tidier

- active items can now be selected from the item list (selecting inactive items
  will be a little harder)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5424 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner
2009-08-12 11:26:59 +00:00
parent e65d90947c
commit a648cb888f
4 changed files with 96 additions and 11 deletions
+46 -5
View File
@@ -109,6 +109,17 @@ return;
}
static void inst_select_inst(struct inst *inst)
{
selected_inst = inst;
set_path(1);
tool_selected_inst(inst);
gui_frame_select_inst(inst);
if (inst->ops->select)
selected_inst->ops->select(inst);
}
int inst_select(struct coord pos)
{
enum inst_prio prio;
@@ -158,11 +169,7 @@ int inst_select(struct coord pos)
return 0;
selected:
set_path(1);
tool_selected_inst(selected_inst);
gui_frame_select_inst(selected_inst);
if (selected_inst->ops->select)
selected_inst->ops->select(selected_inst);
inst_select_inst(selected_inst);
return 1;
}
@@ -289,6 +296,40 @@ void inst_deselect(void)
}
/* ----- select instance by vector/object ---------------------------------- */
void inst_select_vec(const struct vec *vec)
{
struct inst *inst;
for (inst = insts[ip_vec]; inst; inst = inst->next)
if (inst->vec == vec && inst->active) {
inst_deselect();
inst_select_inst(inst);
return;
}
}
void inst_select_obj(const struct obj *obj)
{
enum inst_prio prio;
struct inst *inst;
FOR_INSTS_DOWN(prio, inst)
if (inst->obj && inst->obj == obj && inst->active) {
inst_deselect();
inst_select_inst(inst);
return;
}
}
/* ----- common status reporting ------------------------------------------- */
static void rect_status(struct coord a, struct coord b, unit_type width)
{
struct coord d = sub_vec(b, a);