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

- simplified tool_button and moved it from gui_tool.c to into gui_util.c

- moved make_image from gui_tool.c to into gui_util.c as well
- generalized set_frame_image and moved it to gui_util.c as set_image
- tool_button_press_event didn't check which button was pressed
- added buttons to switch visibility of frames, vectors, and measurements
- when creating a measurement through the GUI, don't invert if both points are
  minima (otherwise, one could never get the text point the other way)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5411 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner
2009-08-08 21:59:33 +00:00
parent e677ee1691
commit 851c82af6f
11 changed files with 261 additions and 90 deletions
+30 -5
View File
@@ -24,6 +24,7 @@
#include "gui_status.h"
#include "gui_tool.h"
#include "gui_inst.h"
#include "gui.h"
#include "inst.h"
@@ -83,6 +84,23 @@ static unsigned long active_set = 0;
#define IS_ACTIVE ((active_set & 1))
/* ----- selective visibility ---------------------------------------------- */
static int show(enum inst_prio prio)
{
switch (prio) {
case ip_vec:
case ip_frame:
return show_stuff;
case ip_meas:
return show_meas;
default:
return 1;
}
}
/* ----- selection of items not on the canvas ------------------------------ */
@@ -142,6 +160,8 @@ int inst_select(struct coord pos)
edit_nothing();
selected_inst = NULL;
FOR_INST_PRIOS_DOWN(prio) {
if (!show(prio))
continue;
for (inst = insts[prio]; inst; inst = inst->next) {
if (!inst->active || !inst->ops->distance)
continue;
@@ -155,6 +175,9 @@ int inst_select(struct coord pos)
goto selected;
}
if (!show_stuff)
return 0;
/* give vectors a second chance */
for (inst = insts[ip_vec]; inst; inst = inst->next) {
@@ -828,15 +851,17 @@ void inst_draw(void)
struct inst *inst;
FOR_INSTS_UP(prio, inst)
if (!inst->active && inst->ops->draw)
if (show(prio) && !inst->active && inst->ops->draw)
inst->ops->draw(inst);
FOR_INSTS_UP(prio, inst)
if (prio != ip_frame && inst->active &&
if (show(prio) && prio != ip_frame && inst->active &&
inst != selected_inst && inst->ops->draw)
inst->ops->draw(inst);
for (inst = insts[ip_frame]; inst; inst = inst->next)
if (inst->active && inst != selected_inst && inst->ops->draw)
inst->ops->draw(inst);
if (show_stuff)
for (inst = insts[ip_frame]; inst; inst = inst->next)
if (inst->active && inst != selected_inst &&
inst->ops->draw)
inst->ops->draw(inst);
if (selected_inst && selected_inst->ops->draw)
selected_inst->ops->draw(selected_inst);
}