Changeset 5419
- Timestamp:
- 08/11/09 22:52:33 (4 years ago)
- Location:
- trunk/eda/fped
- Files:
-
- 1 added
- 6 edited
-
Makefile (modified) (1 diff)
-
TODO (modified) (3 diffs)
-
gui_tool.c (modified) (7 diffs)
-
gui_tool.h (modified) (2 diffs)
-
icons/delete.fig (modified) (1 diff)
-
icons/delete_off.fig (added)
-
inst.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eda/fped/Makefile
r5418 r5419 19 19 XPMS = point.xpm delete.xpm vec.xpm frame.xpm frame_locked.xpm frame_ready.xpm \ 20 20 line.xpm rect.xpm pad.xpm circ.xpm meas.xpm meas_x.xpm meas_y.xpm \ 21 stuff.xpm stuff_off.xpm meas_off.xpm 21 stuff.xpm stuff_off.xpm meas_off.xpm delete_off.xpm 22 22 23 23 CFLAGS_GTK = `pkg-config --cflags gtk+-2.0` -
trunk/eda/fped/TODO
r5416 r5419 3 3 - add default unit (combine with grid unit selection ?) 4 4 - consider adding auto/mm/mil selection for each dimension 5 - add postscript output 5 - add postscript output (partially done) 6 6 - add option to include/omit helper vecs and frames (done for display, still 7 need postscript) 7 need postscript). Better idea: in PS, print the component 10x, 1x, and then 8 each individual frame 10x. 8 9 9 10 Minor missing features: … … 36 37 list of points at each stage, then handle the highlighting and hovering 37 38 inside a dragging module. 39 - code organization is very poor. E.g., functions belonging to the different 40 items (pads, silk objects, vectors, etc.) should be grouped by item, not by 41 type of function, similar to how some things are now with gui_meas.c 38 42 39 43 Open decisions: … … 61 65 - future: when encountering an error after a change, we could try to find the 62 66 same element in the old instance, and select it 63 - future: consider editing off-canvas items in place 67 - idea: run the sort algorithm of dump.c to generate a list of objects per 68 frame, then show the list per frame in the GUI, e.g., as an alternative to 69 the variables. Allow selection. 70 - future: consider editing non-canvas items in place 64 71 - near future: treat part name as pattern -
trunk/eda/fped/gui_tool.c
r5415 r5419 42 42 #include "icons/point.xpm" 43 43 #include "icons/delete.xpm" 44 #include "icons/delete_off.xpm" 44 45 #include "icons/rect.xpm" 45 46 #include "icons/vec.xpm" 46 47 47 48 48 static GtkWidget *ev_point, *ev_ frame;49 static GtkWidget *ev_point, *ev_delete, *ev_frame; 49 50 static GtkWidget *active_tool; 50 51 static struct tool_ops *active_ops = NULL; 51 52 static struct inst *hover_inst = NULL; 52 53 static GtkWidget *frame_image, *frame_image_locked, *frame_image_ready; 54 static GtkWidget *delete_image[2]; 53 55 54 56 static struct drag_state { … … 168 170 169 171 170 static void click_delete(struct coord pos) 171 { 172 inst_deselect(); 173 inst_select(pos); 172 static void tool_selected_delete(void) 173 { 174 174 if (selected_inst) { 175 175 tool_dehover(); 176 176 inst_delete(selected_inst); 177 }178 change_world();177 change_world(); 178 } 179 179 tool_reset(); 180 180 } … … 182 182 183 183 static struct tool_ops delete_ops = { 184 . click = click_delete,184 .tool_selected = tool_selected_delete, 185 185 }; 186 187 188 void tool_selected_inst(struct inst *inst) 189 { 190 set_image(ev_delete, delete_image[inst != NULL]); 191 } 186 192 187 193 … … 773 779 * N N don't 774 780 * Y - if we could drag, drag_new/end_new, else fall over to tool 775 * N Y click,else single-click creation, else drag_new/end_new781 * N Y else single-click creation, else drag_new/end_new 776 782 */ 777 783 … … 801 807 if (!active_ops) 802 808 return 0; 803 if (active_ops->click) {804 active_ops->click(pos);805 return 0;806 }807 809 808 810 curr = get_hover_inst(pos); … … 962 964 ev_point = tool_button(bar, drawable, xpm_point, 963 965 tool_button_press_event, NULL); 964 tool_button(bar, drawable, xpm_delete,965 tool_button_press_event, &delete_ops);966 ev_delete = tool_button(bar, drawable, NULL, 967 tool_button_press_event, &delete_ops); 966 968 tool_separator(bar); 967 969 tool_button(bar, drawable, xpm_vec, … … 992 994 set_frame_image(frame_image); 993 995 996 delete_image[0] = gtk_widget_ref(make_image(drawable, xpm_delete_off)); 997 delete_image[1] = gtk_widget_ref(make_image(drawable, xpm_delete)); 998 set_image(ev_delete, delete_image[0]); 999 994 1000 tool_reset(); 995 1001 -
trunk/eda/fped/gui_tool.h
r5414 r5419 24 24 void (*tool_deselected)(void); 25 25 struct inst *(*find_point)(struct coord pos); 26 void (*click)(struct coord pos);27 26 void (*begin_drag_new)(struct inst *from); 28 27 struct pix_buf *(*drag_new)(struct inst *from, struct coord to); … … 72 71 void tool_frame_deleted(const struct frame *frame); 73 72 73 void tool_selected_inst(struct inst *inst); 74 74 75 void tool_reset(void); 75 76 -
trunk/eda/fped/icons/delete.fig
r5403 r5419 10 10 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 11 11 3600 2400 6000 2400 6000 4800 3600 4800 3600 2400 12 2 1 0 15 1 87 50 -1 -1 0.000 0 1 -1 0 0 212 2 1 0 15 19 7 50 -1 -1 0.000 0 1 -1 0 0 2 13 13 4125 2925 5475 4275 14 2 1 0 15 1 87 50 -1 -1 0.000 0 1 -1 0 0 214 2 1 0 15 19 7 50 -1 -1 0.000 0 1 -1 0 0 2 15 15 4125 4275 5475 2925 -
trunk/eda/fped/inst.c
r5416 r5419 119 119 edit_nothing(); 120 120 selected_inst = NULL; 121 if (selected_inst) 122 tool_selected_inst(NULL); 121 123 FOR_INST_PRIOS_DOWN(prio) { 122 124 if (!show(prio)) … … 155 157 selected: 156 158 set_path(1); 159 tool_selected_inst(selected_inst); 157 160 if (selected_inst->ops->select) 158 161 selected_inst->ops->select(selected_inst); … … 264 267 void inst_deselect(void) 265 268 { 266 if (selected_inst) 269 if (selected_inst) { 267 270 set_path(0); 271 tool_selected_inst(NULL); 272 } 268 273 deselect_outside(); 269 274 status_set_type_x("");
Note: See TracChangeset
for help on using the changeset viewer.
