Changeset 5527
- Timestamp:
- 08/22/09 21:00:55 (4 years ago)
- Location:
- trunk/eda/fped
- Files:
-
- 4 added
- 6 edited
-
Makefile (modified) (1 diff)
-
gui.c (modified) (6 diffs)
-
gui.h (modified) (1 diff)
-
gui_inst.c (modified) (1 diff)
-
icons/all.fig (added)
-
icons/all_off.fig (added)
-
icons/bright.fig (added)
-
icons/bright_off.fig (added)
-
inst.c (modified) (5 diffs)
-
inst.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eda/fped/Makefile
r5525 r5527 23 23 line.xpm rect.xpm pad.xpm rpad.xpm circ.xpm \ 24 24 meas.xpm meas_x.xpm meas_y.xpm \ 25 stuff.xpm stuff_off.xpm meas_off.xpm 25 stuff.xpm stuff_off.xpm meas_off.xpm \ 26 bright.xpm bright_off.xpm all.xpm all_off.xpm 26 27 27 28 SHELL = /bin/bash -
trunk/eda/fped/gui.c
r5514 r5527 28 28 #include "icons/meas.xpm" 29 29 #include "icons/meas_off.xpm" 30 #include "icons/all.xpm" 31 #include "icons/all_off.xpm" 32 #include "icons/bright.xpm" 33 #include "icons/bright_off.xpm" 30 34 31 35 32 36 GtkWidget *root; 37 int show_all = 1; 33 38 int show_stuff = 1; 34 39 int show_meas = 1; 40 int show_bright = 0; 35 41 36 42 37 43 static GtkWidget *frames_box; 38 static GtkWidget *ev_stuff, *ev_meas; 39 static GtkWidget *stuff_image[2], *meas_image[2]; 44 static GtkWidget *ev_stuff, *ev_meas, *ev_all, *ev_bright; 45 static GtkWidget *stuff_image[2], *meas_image[2], *all_image[2]; 46 static GtkWidget *bright_image[2]; 40 47 41 48 … … 88 95 89 96 97 static gboolean toggle_all(GtkWidget *widget, GdkEventButton *event, 98 gpointer data) 99 { 100 switch (event->button) { 101 case 1: 102 show_all = !show_all; 103 set_image(ev_all, all_image[show_all]); 104 inst_deselect(); 105 redraw(); 106 break; 107 } 108 return TRUE; 109 } 110 111 90 112 static gboolean toggle_stuff(GtkWidget *widget, GdkEventButton *event, 91 113 gpointer data) … … 118 140 119 141 142 static gboolean toggle_bright(GtkWidget *widget, GdkEventButton *event, 143 gpointer data) 144 { 145 switch (event->button) { 146 case 1: 147 show_bright = !show_bright; 148 set_image(ev_bright, bright_image[show_bright]); 149 inst_deselect(); 150 redraw(); 151 break; 152 } 153 return TRUE; 154 } 155 156 120 157 static void make_tool_bar(GtkWidget *hbox, GdkDrawable *drawable) 121 158 { … … 127 164 gtk_toolbar_set_style(GTK_TOOLBAR(bar), GTK_TOOLBAR_ICONS); 128 165 166 ev_all = tool_button(bar, drawable, NULL, toggle_all, NULL); 129 167 ev_stuff = tool_button(bar, drawable, NULL, toggle_stuff, NULL); 130 168 ev_meas = tool_button(bar, drawable, NULL, toggle_meas, NULL); 169 ev_bright = tool_button(bar, drawable, NULL, toggle_bright, NULL); 131 170 132 171 stuff_image[0] = gtk_widget_ref(make_image(drawable, xpm_stuff_off)); … … 134 173 meas_image[0] = gtk_widget_ref(make_image(drawable, xpm_meas_off)); 135 174 meas_image[1] = gtk_widget_ref(make_image(drawable, xpm_meas)); 175 all_image[0] = gtk_widget_ref(make_image(drawable, xpm_all_off)); 176 all_image[1] = gtk_widget_ref(make_image(drawable, xpm_all)); 177 bright_image[0] = gtk_widget_ref(make_image(drawable, xpm_bright_off)); 178 bright_image[1] = gtk_widget_ref(make_image(drawable, xpm_bright)); 136 179 137 180 set_image(ev_stuff, stuff_image[show_stuff]); 138 181 set_image(ev_meas, meas_image[show_meas]); 182 set_image(ev_all, all_image[show_all]); 183 set_image(ev_bright, bright_image[show_bright]); 139 184 } 140 185 … … 146 191 g_object_unref(meas_image[0]); 147 192 g_object_unref(meas_image[1]); 193 g_object_unref(all_image[0]); 194 g_object_unref(all_image[1]); 195 g_object_unref(bright_image[0]); 196 g_object_unref(bright_image[1]); 148 197 } 149 198 -
trunk/eda/fped/gui.h
r5411 r5527 19 19 20 20 extern GtkWidget *root; 21 extern int show_all; 21 22 extern int show_stuff; 22 23 extern int show_meas; 24 extern int show_bright; 23 25 24 26 -
trunk/eda/fped/gui_inst.c
r5525 r5527 112 112 if (selected_inst == self) 113 113 return mode_selected; 114 return self->active ? mode_active : mode_inactive;114 return self->active || bright(self) ? mode_active : mode_inactive; 115 115 } 116 116 -
trunk/eda/fped/inst.c
r5525 r5527 42 42 static struct inst_ops vec_ops; 43 43 static struct inst_ops frame_ops; 44 static struct inst_ops meas_ops; 44 45 45 46 … … 61 62 return 1; 62 63 } 64 } 65 66 67 int bright(const struct inst *inst) 68 { 69 if (!show_bright) 70 return 0; 71 return inst->ops != &vec_ops && inst->ops != &frame_ops && 72 inst->ops != &meas_ops; 73 } 74 75 76 static int show_this(const struct inst *inst) 77 { 78 if (show_all) 79 return 1; 80 if (inst->ops == &frame_ops && inst->u.frame.ref == active_frame) 81 return 1; 82 if (!inst->outer) 83 return active_frame == root_frame; 84 return inst->outer->u.frame.ref == active_frame; 63 85 } 64 86 … … 177 199 continue; 178 200 FOR_ALL_INSTS(i, prio, inst) { 201 if (!show_this(inst)) 202 continue; 179 203 if (!inst->ops->distance) 180 204 continue; … … 229 253 } 230 254 255 if (!show_all) 256 return 0; 257 231 258 if (any_same_frame) { 232 259 if (activate_item(any_same_frame)) … … 1149 1176 FOR_INST_PRIOS_UP(prio) 1150 1177 FOR_ALL_INSTS(i, prio, inst) 1151 if (show(prio) && !inst->active && inst->ops->draw) 1152 inst->ops->draw(inst); 1178 if (show_this(inst)) 1179 if (show(prio) && !inst->active && 1180 inst->ops->draw) 1181 inst->ops->draw(inst); 1153 1182 FOR_INST_PRIOS_UP(prio) 1154 1183 FOR_ALL_INSTS(i, prio, inst) -
trunk/eda/fped/inst.h
r5522 r5527 148 148 149 149 150 int bright(const struct inst *inst); 151 150 152 void inst_select_outside(void *item, void (*deselect)(void *item)); 151 153 int inst_select(struct coord pos);
Note: See TracChangeset
for help on using the changeset viewer.
