Merge pull request #16 from TheSUPERCD/upstream-clone
Resolve merge conflicts
This commit is contained in:
commit
ab00028935
269
src/callback.c
269
src/callback.c
|
|
@ -2089,7 +2089,7 @@ static void context_menu_action(double mx, double my)
|
|||
break;
|
||||
case 7: /* cut selection into clipboard */
|
||||
rebuild_selected_array();
|
||||
if(xctx->lastsel) { /* 20071203 check if something selected */
|
||||
if(xctx->lastsel) { /* 20071203 check if something selected */
|
||||
save_selection(2);
|
||||
delete(1/* to_push_undo */);
|
||||
}
|
||||
|
|
@ -2477,7 +2477,8 @@ static void handle_enter_notify(int draw_xhair, int crosshair_size)
|
|||
}
|
||||
|
||||
static void handle_motion_notify(int event, KeySym key, int state, int rstate, int button,
|
||||
int mx, int my, int aux, int draw_xhair, int enable_stretch, int snap_cursor, int wire_draw_active)
|
||||
int mx, int my, int aux, int draw_xhair, int enable_stretch,
|
||||
int snap_cursor, int wire_draw_active)
|
||||
{
|
||||
char str[PATH_MAX + 100];
|
||||
if( waves_selected(event, key, state, button)) {
|
||||
|
|
@ -2584,7 +2585,7 @@ static void handle_motion_notify(int event, KeySym key, int state, int rstate, i
|
|||
select_rect(enable_stretch, START,1);
|
||||
}
|
||||
if(abs(mx-xctx->mx_save) > 8 ||
|
||||
abs(my-xctx->my_save) > 8 ) { /* set reasonable threshold before unsel */
|
||||
abs(my-xctx->my_save) > 8 ) { /* set reasonable threshold before unsel */
|
||||
if(!xctx->already_selected) {
|
||||
select_object(X_TO_XSCHEM(xctx->mx_save),
|
||||
Y_TO_XSCHEM(xctx->my_save), 0, 0, NULL); /* remove near obj if dragging */
|
||||
|
|
@ -2602,22 +2603,24 @@ static void handle_motion_notify(int event, KeySym key, int state, int rstate, i
|
|||
}
|
||||
|
||||
static void handle_key_press(int event, KeySym key, int state, int rstate, int mx, int my,
|
||||
int button, int aux, int infix_interface, int enable_stretch, const char *win_path, double c_snap,
|
||||
int button, int aux, int infix_interface, int enable_stretch,
|
||||
const char *win_path, double c_snap,
|
||||
int cadence_compat, int wire_draw_active, int snap_cursor)
|
||||
{
|
||||
char str[PATH_MAX + 100];
|
||||
int dr_gr;
|
||||
switch (key) {
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
if(state == 0) { /* toggle pin logic level */
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
if(state == 0) { /* toggle pin logic level */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(key == '4') logic_set(-1, 1, NULL);
|
||||
else logic_set((int)key - '0', 1, NULL);
|
||||
}
|
||||
else if(state==ControlMask) { /* choose layer */
|
||||
else if(state==ControlMask) { /* choose layer */
|
||||
char n[30];
|
||||
xctx->rectcolor = (int)key - '0'+4;
|
||||
my_snprintf(n, S(n), "%d", xctx->rectcolor);
|
||||
|
|
@ -2635,7 +2638,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case '5':
|
||||
if(rstate == 0) { /* 20110112 display only probes */
|
||||
if(rstate == 0) { /* 20110112 display only probes */
|
||||
xctx->only_probes = !xctx->only_probes;
|
||||
tclsetboolvar("only_probes", xctx->only_probes);
|
||||
toggle_only_probes();
|
||||
|
|
@ -2646,7 +2649,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
if(state==ControlMask) { /* choose layer */
|
||||
if(state==ControlMask) { /* choose layer */
|
||||
char n[30];
|
||||
xctx->rectcolor = (int)key - '0'+4;
|
||||
my_snprintf(n, S(n), "%d", xctx->rectcolor);
|
||||
|
|
@ -2664,7 +2667,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'a':
|
||||
if(rstate == 0) { /* make symbol */
|
||||
if(rstate == 0) { /* make symbol */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
|
|
@ -2678,7 +2681,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
make_symbol();
|
||||
}
|
||||
}
|
||||
else if(rstate == ControlMask) { /* select all */
|
||||
else if(rstate == ControlMask) { /* select all */
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
break;
|
||||
|
|
@ -2688,7 +2691,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'A':
|
||||
if(rstate == 0) { /* toggle show netlist */
|
||||
if(rstate == 0) { /* toggle show netlist */
|
||||
int net_s;
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
|
|
@ -2705,7 +2708,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
tclsetvar("netlist_show","0");
|
||||
}
|
||||
}
|
||||
else if(rstate == ControlMask) { /* only for graph (toggle hcursor1 if graph_use_ctrl_key set) */
|
||||
else if(rstate == ControlMask) { /* only for graph (toggle hcursor1 if graph_use_ctrl_key set) */
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
break;
|
||||
|
|
@ -2714,7 +2717,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'b':
|
||||
if(rstate==0) { /* merge schematic */
|
||||
if(rstate==0) { /* merge schematic */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
|
|
@ -2722,7 +2725,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
}
|
||||
merge_file(0, ""); /* 2nd parameter not used any more for merge 25122002 */
|
||||
}
|
||||
else if(rstate==ControlMask) { /* toggle show text in symbol */
|
||||
else if(rstate==ControlMask) { /* toggle show text in symbol */
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
break;
|
||||
|
|
@ -2739,7 +2742,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
draw();
|
||||
}
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* hide/show instance details */
|
||||
else if(EQUAL_MODMASK) { /* hide/show instance details */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
xctx->hide_symbols++;
|
||||
if(xctx->hide_symbols >= 3) xctx->hide_symbols = 0;
|
||||
|
|
@ -2749,14 +2752,14 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'B':
|
||||
if(rstate == 0) { /* edit schematic header/license */
|
||||
if(rstate == 0) { /* edit schematic header/license */
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
break;
|
||||
}
|
||||
tcleval("update_schematic_header");
|
||||
}
|
||||
else if(rstate == ControlMask) { /* only for graph (toggle hcursor2 if graph_use_ctrl_key set) */
|
||||
else if(rstate == ControlMask) { /* only for graph (toggle hcursor2 if graph_use_ctrl_key set) */
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
break;
|
||||
|
|
@ -2781,7 +2784,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
else if(rstate == ControlMask) {
|
||||
if(xctx->semaphore >= 2) break;
|
||||
rebuild_selected_array();
|
||||
if(xctx->lastsel) { /* 20071203 check if something selected */
|
||||
if(xctx->lastsel) { /* 20071203 check if something selected */
|
||||
save_selection(2);
|
||||
}
|
||||
}
|
||||
|
|
@ -2801,7 +2804,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'C':
|
||||
if(/* !xctx->ui_state && */ rstate == 0) { /* place arc */
|
||||
if(/* !xctx->ui_state && */ rstate == 0) { /* place arc */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(infix_interface) {
|
||||
xctx->mx_double_save=xctx->mousex_snap;
|
||||
|
|
@ -2813,7 +2816,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
xctx->ui_state2 = MENUSTARTARC;
|
||||
}
|
||||
}
|
||||
else if(/* !xctx->ui_state && */ rstate == ControlMask) { /* place circle */
|
||||
else if(/* !xctx->ui_state && */ rstate == ControlMask) { /* place circle */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(infix_interface) {
|
||||
xctx->mx_double_save=xctx->mousex_snap;
|
||||
|
|
@ -2828,7 +2831,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'd':
|
||||
if(rstate == 0) { /* unselect object under the mouse */
|
||||
if(rstate == 0) { /* unselect object under the mouse */
|
||||
if(infix_interface) {
|
||||
unselect_at_mouse_pos(mx, my);
|
||||
} else {
|
||||
|
|
@ -2836,14 +2839,14 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
xctx->ui_state2 = MENUSTARTDESEL;
|
||||
}
|
||||
}
|
||||
else if(rstate == ControlMask) { /* delete files */
|
||||
else if(rstate == ControlMask) { /* delete files */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
delete_files();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
if(rstate == 0) { /* unselect by area */
|
||||
if(rstate == 0) { /* unselect by area */
|
||||
if( !(xctx->ui_state & STARTPAN) && !xctx->shape_point_selected &&
|
||||
!(xctx->ui_state & (PLACE_SYMBOL | PLACE_TEXT)) && !(xctx->ui_state & STARTSELECT)) {
|
||||
if(infix_interface) {
|
||||
|
|
@ -2860,7 +2863,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'e':
|
||||
if(rstate == 0) { /* descend to schematic */
|
||||
if(rstate == 0) { /* descend to schematic */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
descend_schematic(0, 1, 1, 1);
|
||||
}
|
||||
|
|
@ -2868,7 +2871,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
if(xctx->semaphore >= 2) break;
|
||||
go_back(1);
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* edit schematic in new window */
|
||||
else if(EQUAL_MODMASK) { /* edit schematic in new window */
|
||||
int save = xctx->semaphore;
|
||||
xctx->semaphore--; /* so semaphore for current context wll be saved correctly */
|
||||
/* schematic_in_new_window(0, 1, 0); */
|
||||
|
|
@ -2878,7 +2881,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'E':
|
||||
if(EQUAL_MODMASK) { /* edit schematic in new window - new xschem process */
|
||||
if(EQUAL_MODMASK) { /* edit schematic in new window - new xschem process */
|
||||
int save = xctx->semaphore;
|
||||
xctx->semaphore--; /* so semaphore for current context wll be saved correctly */
|
||||
schematic_in_new_window(1, 1, 0);
|
||||
|
|
@ -2887,7 +2890,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'f':
|
||||
if(rstate == 0) { /* full zoom */
|
||||
if(rstate == 0) { /* full zoom */
|
||||
int flags = 1;
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
|
|
@ -2896,7 +2899,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
if(tclgetboolvar("zoom_full_center")) flags |= 2;
|
||||
zoom_full(1, 0, flags, 0.97);
|
||||
}
|
||||
else if(rstate == ControlMask) { /* search */
|
||||
else if(rstate == ControlMask) { /* search */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
|
|
@ -2904,7 +2907,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
}
|
||||
tcleval("property_search");
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* flip objects around their anchor points 20171208 */
|
||||
else if(EQUAL_MODMASK) { /* flip objects around their anchor points 20171208 */
|
||||
if(xctx->ui_state & STARTMOVE) move_objects(FLIP|ROTATELOCAL,0,0,0);
|
||||
else if(xctx->ui_state & STARTCOPY) copy_objects(FLIP|ROTATELOCAL);
|
||||
else {
|
||||
|
|
@ -2919,7 +2922,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'F':
|
||||
if(rstate == 0) { /* flip */
|
||||
if(rstate == 0) { /* flip */
|
||||
if(xctx->ui_state & STARTMOVE) move_objects(FLIP,0,0,0);
|
||||
else if(xctx->ui_state & STARTCOPY) copy_objects(FLIP);
|
||||
else {
|
||||
|
|
@ -2931,7 +2934,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
move_objects(END,0,0,0);
|
||||
}
|
||||
}
|
||||
else if(rstate == ControlMask ) { /* full zoom selection */
|
||||
else if(rstate == ControlMask ) { /* full zoom selection */
|
||||
if(xctx->ui_state == SELECTION) {
|
||||
zoom_full(1, 1, 3, 0.97);
|
||||
}
|
||||
|
|
@ -2939,18 +2942,18 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'g':
|
||||
if(rstate==0) { /* half snap factor */
|
||||
if(rstate==0) { /* half snap factor */
|
||||
set_snap(c_snap / 2.0);
|
||||
change_linewidth(-1.);
|
||||
draw();
|
||||
}
|
||||
else if(rstate==ControlMask) { /* set snap factor 20161212 */
|
||||
else if(rstate==ControlMask) { /* set snap factor 20161212 */
|
||||
my_snprintf(str, S(str),
|
||||
"input_line {Enter snap value (default: %.16g current: %.16g)} {xschem set cadsnap} {%g} 10",
|
||||
CADSNAP, c_snap, c_snap);
|
||||
tcleval(str);
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* highlight net and send to viewer */
|
||||
else if(EQUAL_MODMASK) { /* highlight net and send to viewer */
|
||||
int tool = 0;
|
||||
int exists = 0;
|
||||
char *tool_name = NULL;
|
||||
|
|
@ -2986,7 +2989,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'G':
|
||||
if(rstate == 0) { /* double snap factor */
|
||||
if(rstate == 0) { /* double snap factor */
|
||||
set_snap(c_snap * 2.0);
|
||||
change_linewidth(-1.);
|
||||
draw();
|
||||
|
|
@ -2994,13 +2997,13 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'h':
|
||||
if(rstate==ControlMask ) { /* go to http link */
|
||||
if(rstate==ControlMask ) { /* go to http link */
|
||||
int savesem = xctx->semaphore;
|
||||
xctx->semaphore = 0;
|
||||
launcher();
|
||||
xctx->semaphore = savesem;
|
||||
}
|
||||
else if (rstate == 0) { /* horizontally constrained drag 20171023 */
|
||||
else if (rstate == 0) { /* horizontally constrained drag 20171023 */
|
||||
if ( xctx->constr_mv == 1 ) {
|
||||
tcleval("set constr_mv 0" );
|
||||
xctx->constr_mv = 0;
|
||||
|
|
@ -3025,27 +3028,27 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'H':
|
||||
if(rstate == 0) { /* attach labels to selected instances */
|
||||
if(rstate == 0) { /* attach labels to selected instances */
|
||||
attach_labels_to_inst(1);
|
||||
}
|
||||
else if (rstate == ControlMask) { /* create schematic and symbol from selected components */
|
||||
else if (rstate == ControlMask) { /* create schematic and symbol from selected components */
|
||||
make_schematic_symbol_from_sel();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
if(rstate==0) { /* descend to symbol */
|
||||
if(rstate==0) { /* descend to symbol */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
descend_symbol();
|
||||
}
|
||||
else if(rstate == ControlMask) { /* insert sym */
|
||||
else if(rstate == ControlMask) { /* insert sym */
|
||||
if(tclgetboolvar("new_symbol_browser")) {
|
||||
tcleval("insert_symbol $new_symbol_browser_paths $new_symbol_browser_depth $new_symbol_browser_ext");
|
||||
} else {
|
||||
tcleval("load_file_dialog {Insert symbol} *.\\{sym,tcl\\} INITIALINSTDIR 2");
|
||||
}
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* edit symbol in new window */
|
||||
else if(EQUAL_MODMASK) { /* edit symbol in new window */
|
||||
int save = xctx->semaphore;
|
||||
xctx->semaphore--; /* so semaphore for current context wll be saved correctly */
|
||||
symbol_in_new_window(0);
|
||||
|
|
@ -3054,7 +3057,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'I':
|
||||
if(rstate == 0) { /* insert sym */
|
||||
if(rstate == 0) { /* insert sym */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(tclgetboolvar("new_symbol_browser")) {
|
||||
tcleval("insert_symbol $new_symbol_browser_paths $new_symbol_browser_depth $new_symbol_browser_ext");
|
||||
|
|
@ -3062,7 +3065,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
start_place_symbol();
|
||||
}
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* edit symbol in new window - new xschem process */
|
||||
else if(EQUAL_MODMASK) { /* edit symbol in new window - new xschem process */
|
||||
int save = xctx->semaphore;
|
||||
xctx->semaphore--; /* so semaphore for current context wll be saved correctly */
|
||||
symbol_in_new_window(1);
|
||||
|
|
@ -3071,19 +3074,19 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'j':
|
||||
if(rstate==0 ) { /* print list of highlight nets */
|
||||
if(rstate==0 ) { /* print list of highlight nets */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
print_hilight_net(1);
|
||||
}
|
||||
else if(rstate==ControlMask) { /* create ipins from highlight nets */
|
||||
else if(rstate==ControlMask) { /* create ipins from highlight nets */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
print_hilight_net(0);
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* create labels without i prefix from hilight nets */
|
||||
else if(EQUAL_MODMASK) { /* create labels without i prefix from hilight nets */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
print_hilight_net(4);
|
||||
}
|
||||
else if( SET_MODMASK && (state & ControlMask) ) { /* print list of highlight net with label expansion */
|
||||
else if( SET_MODMASK && (state & ControlMask) ) { /* print list of highlight net with label expansion */
|
||||
print_hilight_net(3);
|
||||
}
|
||||
break;
|
||||
|
|
@ -3092,38 +3095,38 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
if(rstate == 0) {
|
||||
create_plot_cmd();
|
||||
}
|
||||
else if(SET_MODMASK ) { /* create labels with i prefix from hilight nets */
|
||||
else if(SET_MODMASK ) { /* create labels with i prefix from hilight nets */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
print_hilight_net(2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'k':
|
||||
if(rstate==0) { /* hilight net */
|
||||
if(rstate==0) { /* hilight net */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
xctx->enable_drill=0;
|
||||
hilight_net(0);
|
||||
redraw_hilights(0);
|
||||
/* draw_hilight_net(1); */
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* select whole net (all attached wires/labels/pins) */
|
||||
else if(EQUAL_MODMASK) { /* select whole net (all attached wires/labels/pins) */
|
||||
select_hilight_net();
|
||||
}
|
||||
else if(rstate==ControlMask) { /* unhilight net */
|
||||
else if(rstate==ControlMask) { /* unhilight net */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
unhilight_net();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'K':
|
||||
if(rstate == 0) { /* delete hilighted nets */
|
||||
if(rstate == 0) { /* delete hilighted nets */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
xctx->enable_drill=0;
|
||||
clear_all_hilights();
|
||||
/* undraw_hilight_net(1); */
|
||||
draw();
|
||||
}
|
||||
else if(rstate == ControlMask) { /* hilight net drilling thru elements with 'propag=' prop set on pins */
|
||||
else if(rstate == ControlMask) { /* hilight net drilling thru elements with 'propag=' prop set on pins */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
xctx->enable_drill=1;
|
||||
hilight_net(0);
|
||||
|
|
@ -3133,7 +3136,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'l':
|
||||
if(/* !xctx->ui_state && */ rstate == 0) { /* start line */
|
||||
if(/* !xctx->ui_state && */ rstate == 0) { /* start line */
|
||||
int prev_state = xctx->ui_state;
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(infix_interface) {
|
||||
|
|
@ -3148,17 +3151,17 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
xctx->ui_state2 = MENUSTARTLINE;
|
||||
}
|
||||
}
|
||||
else if(rstate == ControlMask) { /* create schematic from selected symbol 20171004 */
|
||||
else if(rstate == ControlMask) { /* create schematic from selected symbol 20171004 */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
create_sch_from_sym();
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* add pin label*/
|
||||
else if(EQUAL_MODMASK) { /* add pin label*/
|
||||
place_net_label(1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
if(rstate == 0) { /* toggle orthogonal routing */
|
||||
if(rstate == 0) { /* toggle orthogonal routing */
|
||||
if(tclgetboolvar("orthogonal_wiring")){
|
||||
tclsetboolvar("orthogonal_wiring", 0);
|
||||
xctx->manhattan_lines = 0;
|
||||
|
|
@ -3167,7 +3170,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
}
|
||||
redraw_w_a_l_r_p_z_rubbers(1);
|
||||
}
|
||||
else if(EQUAL_MODMASK ) { /* add pin label*/
|
||||
else if(EQUAL_MODMASK ) { /* add pin label*/
|
||||
place_net_label(0);
|
||||
}
|
||||
break;
|
||||
|
|
@ -3250,18 +3253,18 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'n':
|
||||
if(rstate==0) { /* hierarchical netlist */
|
||||
if(rstate==0) { /* hierarchical netlist */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
tcleval("xschem netlist -erc");
|
||||
}
|
||||
else if(rstate == ControlMask) { /* clear schematic */
|
||||
else if(rstate == ControlMask) { /* clear schematic */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
tcleval("xschem clear SCHEMATIC");
|
||||
}
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
if(rstate == 0) { /* current level only netlist */
|
||||
if(rstate == 0) { /* current level only netlist */
|
||||
int err = 0;
|
||||
yyparse_error = 0;
|
||||
if(xctx->semaphore >= 2) break;
|
||||
|
|
@ -3299,14 +3302,14 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
}
|
||||
|
||||
}
|
||||
else if(rstate == ControlMask ) { /* clear symbol */
|
||||
else if(rstate == ControlMask ) { /* clear symbol */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
tcleval("xschem clear SYMBOL");
|
||||
}
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
if(rstate == ControlMask) { /* load */
|
||||
if(rstate == ControlMask) { /* load */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
ask_new_file();
|
||||
xctx->semaphore--;
|
||||
|
|
@ -3316,10 +3319,10 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'O':
|
||||
if(rstate == ControlMask ) { /* load most recent tile */
|
||||
if(rstate == ControlMask ) { /* load most recent tile */
|
||||
tclvareval("xschem load -gui [lindex $recentfile 0]", NULL);
|
||||
}
|
||||
else if(rstate == 0) { /* toggle light/dark colorscheme 20171113 */
|
||||
else if(rstate == 0) { /* toggle light/dark colorscheme 20171113 */
|
||||
int d_c;
|
||||
d_c = tclgetboolvar("dark_colorscheme");
|
||||
d_c = !d_c;
|
||||
|
|
@ -3332,7 +3335,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'p':
|
||||
if(EQUAL_MODMASK) { /* add symbol pin */
|
||||
if(EQUAL_MODMASK) { /* add symbol pin */
|
||||
xctx->push_undo();
|
||||
unselect_all(1);
|
||||
storeobject(-1, xctx->mousex_snap-2.5, xctx->mousey_snap-2.5, xctx->mousex_snap+2.5, xctx->mousey_snap+2.5,
|
||||
|
|
@ -3342,7 +3345,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
move_objects(START,0,0,0);
|
||||
xctx->ui_state |= START_SYMPIN;
|
||||
}
|
||||
else if( !(xctx->ui_state & STARTPOLYGON) && rstate==0) { /* start polygon */
|
||||
else if( !(xctx->ui_state & STARTPOLYGON) && rstate==0) { /* start polygon */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
dbg(1, "callback(): start polygon\n");
|
||||
if(infix_interface) {
|
||||
|
|
@ -3358,7 +3361,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'P':
|
||||
if(rstate == 0) { /* pan, other way to. */
|
||||
if(rstate == 0) { /* pan, other way to. */
|
||||
xctx->xorigin=-xctx->mousex_snap+xctx->areaw*xctx->zoom/2.0;
|
||||
xctx->yorigin=-xctx->mousey_snap+xctx->areah*xctx->zoom/2.0;
|
||||
draw();
|
||||
|
|
@ -3367,18 +3370,18 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'q':
|
||||
if(rstate==ControlMask) { /* quit xschem */
|
||||
if(rstate==ControlMask) { /* quit xschem */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
/* must be set to zero, otherwise switch_tab/switch_win does not proceed
|
||||
* and these are necessary when closing tabs/windows */
|
||||
xctx->semaphore = 0;
|
||||
tcleval("quit_xschem");
|
||||
}
|
||||
else if(rstate==0) { /* edit attributes */
|
||||
else if(rstate==0) { /* edit attributes */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
edit_property(0);
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* edit .sch file (DANGER!!) */
|
||||
else if(EQUAL_MODMASK) { /* edit .sch file (DANGER!!) */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
rebuild_selected_array();
|
||||
if(xctx->lastsel==0 ) {
|
||||
|
|
@ -3395,17 +3398,17 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'Q':
|
||||
if(rstate == 0) { /* edit attributes in editor */
|
||||
if(rstate == 0) { /* edit attributes in editor */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
edit_property(1);
|
||||
}
|
||||
else if(rstate == ControlMask) { /* view attributes */
|
||||
else if(rstate == ControlMask) { /* view attributes */
|
||||
edit_property(2);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
if(/* !xctx->ui_state && */ rstate==0) { /* start rect */
|
||||
if(/* !xctx->ui_state && */ rstate==0) { /* start rect */
|
||||
dbg(1, "callback(): start rect\n");
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(infix_interface) {
|
||||
|
|
@ -3418,7 +3421,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
xctx->ui_state2 = MENUSTARTRECT;
|
||||
}
|
||||
}
|
||||
else if((rstate == ControlMask) && cadence_compat) { /* simulate (for cadence users) */
|
||||
else if((rstate == ControlMask) && cadence_compat) { /* simulate (for cadence users) */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
|
|
@ -3430,7 +3433,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
tcleval("[xschem get top_path].menubar invoke Simulate");
|
||||
}
|
||||
}
|
||||
else if(SET_MODMASK) { /* reload */
|
||||
else if(SET_MODMASK) { /* reload */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
tcleval("tk_messageBox -type okcancel -parent [xschem get topwindow] "
|
||||
"-message {Are you sure you want to reload from disk?}");
|
||||
|
|
@ -3443,7 +3446,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
draw();
|
||||
}
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* rotate objects around their anchor points 20171208 */
|
||||
else if(EQUAL_MODMASK) { /* rotate objects around their anchor points 20171208 */
|
||||
if(xctx->ui_state & STARTMOVE) move_objects(ROTATE|ROTATELOCAL,0,0,0);
|
||||
else if(xctx->ui_state & STARTCOPY) copy_objects(ROTATE|ROTATELOCAL);
|
||||
else {
|
||||
|
|
@ -3458,7 +3461,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'R':
|
||||
if(rstate == 0) { /* rotate */
|
||||
if(rstate == 0) { /* rotate */
|
||||
if(xctx->ui_state & STARTMOVE) move_objects(ROTATE,0,0,0);
|
||||
else if(xctx->ui_state & STARTCOPY) copy_objects(ROTATE);
|
||||
else {
|
||||
|
|
@ -3474,7 +3477,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 's':
|
||||
if((rstate == 0) && !cadence_compat) { /* simulate (original keybind) */
|
||||
if((rstate == 0) && !cadence_compat) { /* simulate (original keybind) */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
|
|
@ -3486,11 +3489,11 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
tcleval("[xschem get top_path].menubar invoke Simulate");
|
||||
}
|
||||
}
|
||||
else if(/* !xctx->ui_state && */ (rstate == 0) && cadence_compat) { /* create wire snapping to closest instance pin (cadence keybind) */
|
||||
else if(/* !xctx->ui_state && */ (rstate == 0) && cadence_compat) { /* create wire snapping to closest instance pin (cadence keybind) */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
snapped_wire(c_snap);
|
||||
}
|
||||
else if(rstate == ControlMask ){ /* save 20121201 */
|
||||
else if(rstate == ControlMask ){ /* save 20121201 */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
|
|
@ -3503,25 +3506,25 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
save(1, 0);
|
||||
}
|
||||
}
|
||||
else if(SET_MODMASK && (state & ControlMask) ) { /* save as symbol */
|
||||
else if(SET_MODMASK && (state & ControlMask) ) { /* save as symbol */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
saveas(NULL, SYMBOL);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
if(rstate == 0) { /* change element order */
|
||||
if(rstate == 0) { /* change element order */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
change_elem_order(-1);
|
||||
}
|
||||
else if(rstate == ControlMask) { /* save as schematic */
|
||||
else if(rstate == ControlMask) { /* save as schematic */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
saveas(NULL, SCHEMATIC);
|
||||
}
|
||||
break;
|
||||
|
||||
case 't':
|
||||
if(rstate == 0) { /* place text */
|
||||
if(rstate == 0) { /* place text */
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
break;
|
||||
|
|
@ -3530,7 +3533,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
xctx->last_command = 0;
|
||||
xctx->mx_double_save = xctx->mousex_snap;
|
||||
xctx->my_double_save = xctx->mousey_snap;
|
||||
if(place_text(0, xctx->mousex_snap, xctx->mousey_snap)) { /* 1 = draw text 24122002 */
|
||||
if(place_text(0, xctx->mousex_snap, xctx->mousey_snap)) { /* 1 = draw text 24122002 */
|
||||
xctx->mousey_snap = xctx->my_double_save;
|
||||
xctx->mousex_snap = xctx->mx_double_save;
|
||||
move_objects(START,0,0,0);
|
||||
|
|
@ -3546,18 +3549,18 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'T':
|
||||
if(rstate == 0) { /* toggle spice_ignore, verilog_ignore, ... flag on selected instances. */
|
||||
if(rstate == 0) { /* toggle spice_ignore, verilog_ignore, ... flag on selected instances. */
|
||||
toggle_ignore();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'u':
|
||||
if(rstate==0) { /* undo */
|
||||
if(rstate==0) { /* undo */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
xctx->pop_undo(0, 1); /* 2nd parameter: set_modify_status */
|
||||
draw();
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* align to grid */
|
||||
else if(EQUAL_MODMASK) { /* align to grid */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
xctx->push_undo();
|
||||
round_schematic_to_grid(c_snap);
|
||||
|
|
@ -3577,7 +3580,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'U':
|
||||
if(rstate == 0) { /* redo */
|
||||
if(rstate == 0) { /* redo */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
xctx->pop_undo(1, 1); /* 2nd parameter: set_modify_status */
|
||||
draw();
|
||||
|
|
@ -3585,7 +3588,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'v':
|
||||
if(rstate==0) { /* vertically constrained drag 20171023 */
|
||||
if(rstate==0) { /* vertically constrained drag 20171023 */
|
||||
if ( xctx->constr_mv == 2 ) {
|
||||
tcleval("set constr_mv 0" );
|
||||
xctx->constr_mv = 0;
|
||||
|
|
@ -3604,11 +3607,11 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
new_line(RUBBER, xctx->mousex_snap, xctx->mousey_snap);
|
||||
}
|
||||
}
|
||||
else if(rstate == ControlMask) { /* paste from clipboard */
|
||||
else if(rstate == ControlMask) { /* paste from clipboard */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
merge_file(2,".sch");
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* vertical flip objects around their anchor points */
|
||||
else if(EQUAL_MODMASK) { /* vertical flip objects around their anchor points */
|
||||
if(xctx->ui_state & STARTMOVE) {
|
||||
move_objects(ROTATE|ROTATELOCAL,0,0,0);
|
||||
move_objects(ROTATE|ROTATELOCAL,0,0,0);
|
||||
|
|
@ -3633,7 +3636,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'V':
|
||||
if(rstate == 0) { /* vertical flip */
|
||||
if(rstate == 0) { /* vertical flip */
|
||||
if(xctx->ui_state & STARTMOVE) {
|
||||
move_objects(ROTATE,0,0,0);
|
||||
move_objects(ROTATE,0,0,0);
|
||||
|
|
@ -3655,7 +3658,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
move_objects(END,0,0,0);
|
||||
}
|
||||
}
|
||||
else if(rstate == ControlMask) { /* toggle spice/vhdl netlist */
|
||||
else if(rstate == ControlMask) { /* toggle spice/vhdl netlist */
|
||||
xctx->netlist_type++;
|
||||
if(xctx->netlist_type==6) xctx->netlist_type=1;
|
||||
set_tcl_netlist_type();
|
||||
|
|
@ -3664,7 +3667,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'w':
|
||||
if(/* !xctx->ui_state && */ rstate==0) { /* place wire. */
|
||||
if(/* !xctx->ui_state && */ rstate==0) { /* place wire. */
|
||||
int prev_state = xctx->ui_state;
|
||||
if(xctx->semaphore >= 2) break;
|
||||
|
||||
|
|
@ -3681,7 +3684,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
if(prev_state & STARTWIRE) start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
||||
}
|
||||
}
|
||||
else if(rstate == ControlMask) { /* close current schematic */
|
||||
else if(rstate == ControlMask) { /* close current schematic */
|
||||
int save_sem;
|
||||
if(xctx->semaphore >= 2) break;
|
||||
save_sem = xctx->semaphore;
|
||||
|
|
@ -3691,17 +3694,17 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'W':
|
||||
if(/* !xctx->ui_state && */ (rstate == 0) && !cadence_compat) { /* create wire snapping to closest instance pin (original keybind) */
|
||||
if(/* !xctx->ui_state && */ (rstate == 0) && !cadence_compat) { /* create wire snapping to closest instance pin (original keybind) */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
snapped_wire(c_snap);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
if(rstate == 0) { /* new cad session */
|
||||
if(rstate == 0) { /* new cad session */
|
||||
new_xschem_process(NULL ,0);
|
||||
}
|
||||
else if(EQUAL_MODMASK) { /* toggle draw crosshair at mouse pos */
|
||||
else if(EQUAL_MODMASK) { /* toggle draw crosshair at mouse pos */
|
||||
if(tclgetboolvar("draw_crosshair")) {
|
||||
tclsetvar("draw_crosshair", "0");
|
||||
} else {
|
||||
|
|
@ -3709,10 +3712,10 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
}
|
||||
draw();
|
||||
}
|
||||
else if(rstate == ControlMask) { /* cut selection into clipboard */
|
||||
else if(rstate == ControlMask) { /* cut selection into clipboard */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
rebuild_selected_array();
|
||||
if(xctx->lastsel) { /* 20071203 check if something selected */
|
||||
if(xctx->lastsel) { /* 20071203 check if something selected */
|
||||
save_selection(2);
|
||||
delete(1/* to_push_undo */);
|
||||
}
|
||||
|
|
@ -3720,13 +3723,13 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'X':
|
||||
if(rstate == 0) { /* highlight discrepanciens between selected instance pin and net names */
|
||||
if(rstate == 0) { /* highlight discrepanciens between selected instance pin and net names */
|
||||
hilight_net_pin_mismatches();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'y':
|
||||
if(rstate == 0) { /* toggle stretching */
|
||||
if(rstate == 0) { /* toggle stretching */
|
||||
enable_stretch = !enable_stretch;
|
||||
tclsetboolvar("enable_stretch", enable_stretch);
|
||||
}
|
||||
|
|
@ -3737,10 +3740,10 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
dbg(1, "callback(): zoom_rectangle call\n");
|
||||
zoom_rectangle(START);
|
||||
}
|
||||
else if(rstate==ControlMask) { /* zoom out */
|
||||
else if(rstate==ControlMask) { /* zoom out */
|
||||
view_unzoom(0.0);
|
||||
}
|
||||
else if(EQUAL_MODMASK && cadence_compat) { /* toggle snap-cursor option */
|
||||
else if(EQUAL_MODMASK && cadence_compat) { /* toggle snap-cursor option */
|
||||
if(tclgetboolvar("snap_cursor")) {
|
||||
tclsetvar("snap_cursor", "0");
|
||||
draw_snap_cursor(1);
|
||||
|
|
@ -3755,18 +3758,22 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case 'Z':
|
||||
if(rstate == 0) { /* zoom in */
|
||||
if(rstate == 0) { /* zoom in */
|
||||
view_zoom(0.0);
|
||||
}
|
||||
break;
|
||||
|
||||
case ' ':
|
||||
if(xctx->ui_state & STARTWIRE) { /* & instead of == 20190409 */
|
||||
if(xctx->ui_state & STARTMOVE) {
|
||||
draw_selection(xctx->gctiled,0);
|
||||
xctx->manhattan_lines++;
|
||||
xctx->manhattan_lines %=3;
|
||||
draw_selection(xctx->gc[SELLAYER], 0);
|
||||
} else if(xctx->ui_state & STARTWIRE) { /* & instead of == 20190409 */
|
||||
new_wire(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
|
||||
xctx->manhattan_lines++;
|
||||
xctx->manhattan_lines %=3;
|
||||
new_wire(RUBBER, xctx->mousex_snap, xctx->mousey_snap);
|
||||
|
||||
} else if(xctx->ui_state & STARTLINE) {
|
||||
new_line(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
|
||||
xctx->manhattan_lines++;
|
||||
|
|
@ -3809,12 +3816,12 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case '$':
|
||||
if( rstate == 0 ) { /* toggle pixmap saving */
|
||||
if( rstate == 0 ) { /* toggle pixmap saving */
|
||||
xctx->draw_pixmap =!xctx->draw_pixmap;
|
||||
if(xctx->draw_pixmap) tcleval("alert_ { enabling draw pixmap} {}");
|
||||
else tcleval("alert_ { disabling draw pixmap} {}");
|
||||
}
|
||||
else if(state & ControlMask) { /* toggle window drawing */
|
||||
else if(state & ControlMask) { /* toggle window drawing */
|
||||
xctx->draw_window =!xctx->draw_window;
|
||||
if(xctx->draw_window) {
|
||||
tcleval("alert_ { enabling draw window} {}");
|
||||
|
|
@ -3827,7 +3834,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case '=':
|
||||
if(state & ControlMask) { /* toggle fill rectangles */
|
||||
if(state & ControlMask) { /* toggle fill rectangles */
|
||||
int x;
|
||||
xctx->fill_pattern++;
|
||||
if(xctx->fill_pattern==2) xctx->fill_pattern=0;
|
||||
|
|
@ -3855,7 +3862,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case '+':
|
||||
if(state & ControlMask) { /* change line width */
|
||||
if(state & ControlMask) { /* change line width */
|
||||
xctx->lw = round_to_n_digits(xctx->lw + 0.5, 2);
|
||||
change_linewidth(xctx->lw);
|
||||
tclsetboolvar("change_lw", 0);
|
||||
|
|
@ -3864,7 +3871,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case '-':
|
||||
if(state & ControlMask) { /* change line width */
|
||||
if(state & ControlMask) { /* change line width */
|
||||
xctx->lw = round_to_n_digits(xctx->lw - 0.5, 2);
|
||||
if(xctx->lw < 0.0) xctx->lw = 0.0;
|
||||
change_linewidth(xctx->lw);
|
||||
|
|
@ -3874,7 +3881,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case XK_Return:
|
||||
if((state == 0 ) && xctx->ui_state & STARTPOLYGON) { /* close polygon */
|
||||
if((state == 0 ) && xctx->ui_state & STARTPOLYGON) { /* close polygon */
|
||||
new_polygon(ADD|END, xctx->mousex_snap, xctx->mousey_snap);
|
||||
}
|
||||
break;
|
||||
|
|
@ -3895,7 +3902,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case XK_Delete:
|
||||
if(xctx->ui_state & SELECTION) { /* delete selection */
|
||||
if(xctx->ui_state & SELECTION) { /* delete selection */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
delete(1/* to_push_undo */);
|
||||
}
|
||||
|
|
@ -3913,7 +3920,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
tcleval("next_tab");
|
||||
xctx->semaphore = save;
|
||||
}
|
||||
else { /* left */
|
||||
else { /* left */
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
break;
|
||||
|
|
@ -3936,7 +3943,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
tcleval("prev_tab");
|
||||
xctx->semaphore = save;
|
||||
}
|
||||
else { /* right */
|
||||
else { /* right */
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
waves_callback(event, mx, my, key, button, aux, state);
|
||||
break;
|
||||
|
|
@ -4021,7 +4028,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case '\\':
|
||||
if(state==0) { /* fullscreen */
|
||||
if(state==0) { /* fullscreen */
|
||||
dbg(1, "callback(): toggle fullscreen, win_path=%s\n", win_path);
|
||||
toggle_fullscreen(win_path);
|
||||
}
|
||||
|
|
@ -4061,17 +4068,17 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
|||
break;
|
||||
|
||||
case ';':
|
||||
if(0 && (state & ControlMask)) { /* testmode */
|
||||
if(0 && (state & ControlMask)) { /* testmode */
|
||||
}
|
||||
break;
|
||||
|
||||
case '~':
|
||||
if(0 && (state & ControlMask)) { /* testmode */
|
||||
if(0 && (state & ControlMask)) { /* testmode */
|
||||
}
|
||||
break;
|
||||
|
||||
case '|':
|
||||
if(0 && (state & ControlMask)) { /* testmode */
|
||||
if(0 && (state & ControlMask)) { /* testmode */
|
||||
static int x = 0;
|
||||
|
||||
if(x == 0) {
|
||||
|
|
@ -4373,7 +4380,8 @@ static void handle_button_press(int event, int state, int rstate, KeySym key, in
|
|||
}
|
||||
|
||||
static void handle_button_release(int event, KeySym key, int state, int button, int mx, int my,
|
||||
int aux, double c_snap, int enable_stretch, int draw_xhair, int snap_cursor, int wire_draw_active)
|
||||
int aux, double c_snap, int enable_stretch, int draw_xhair,
|
||||
int snap_cursor, int wire_draw_active)
|
||||
{
|
||||
char str[PATH_MAX + 100];
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
|
|
@ -4602,7 +4610,8 @@ int wire_draw_active = (xctx->ui_state & STARTWIRE) ||
|
|||
redraw_only = 1;
|
||||
new_schematic("switch_no_tcl_ctx", win_path, "", 1);
|
||||
} else {
|
||||
dbg(1, "callback(): switching window context: %s --> %s, semaphore=%d\n", old_win_path, win_path, xctx->semaphore);
|
||||
dbg(1, "callback(): switching window context: %s --> %s, semaphore=%d\n",
|
||||
old_win_path, win_path, xctx->semaphore);
|
||||
new_schematic("switch", win_path, "", 1);
|
||||
}
|
||||
tclvareval("housekeeping_ctx", NULL);
|
||||
|
|
|
|||
|
|
@ -1136,11 +1136,13 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
else if(wire[n].sel == SELECTED2) wire[n].sel = SELECTED1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if(wire[n].sel & (SELECTED|SELECTED1))
|
||||
{
|
||||
if(xctx->manhattan_lines & 1) xctx->manhattan_lines=2;
|
||||
else if(xctx->manhattan_lines & 2) xctx->manhattan_lines=1;
|
||||
}
|
||||
#endif
|
||||
wire[n].x1 = xctx->rx1;
|
||||
wire[n].y1 = xctx->ry1;
|
||||
if(xctx->manhattan_lines&1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue