From 814733d5bb657d4902b66f85f9aac256821f811d Mon Sep 17 00:00:00 2001 From: Chayan Deb Date: Sun, 16 Mar 2025 15:07:40 +0530 Subject: [PATCH] [UI/UX Feature Update]: Bottom statusbar now displays all the different drawing modes (wire, line, arc, ploygon, rect etc.) in a green box - that only showed the wire-drawing mode before this update. --- src/callback.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/callback.c b/src/callback.c index b1a7f6ac..cc43b616 100644 --- a/src/callback.c +++ b/src/callback.c @@ -4544,9 +4544,23 @@ int infix_interface = tclgetboolvar("infix_interface"); int rstate; /* (reduced state, without ShiftMask) */ int snap_cursor = tclgetboolvar("snap_cursor"); int cadence_compat = tclgetboolvar("cadence_compat"); +int persistent_command = tclgetboolvar("persistent_command"); + int wire_draw_active = (xctx->ui_state & STARTWIRE) || ((xctx->ui_state2 & MENUSTARTWIRE) && (xctx->ui_state & MENUSTART)) || - (tclgetboolvar("persistent_command") && (xctx->last_command & STARTWIRE)); + (persistent_command && (xctx->last_command & STARTWIRE)); +int line_draw_active = (xctx->ui_state & STARTLINE) || + ((xctx->ui_state2 & MENUSTARTLINE) && (xctx->ui_state & MENUSTART)) || + (persistent_command && (xctx->last_command & STARTLINE)); +int poly_draw_active = (xctx->ui_state & STARTPOLYGON) || + ((xctx->ui_state2 & MENUSTARTPOLYGON) && (xctx->ui_state & MENUSTART)) || + (persistent_command && (xctx->last_command & STARTPOLYGON)); +int arc_draw_active = (xctx->ui_state & STARTARC) || + ((xctx->ui_state2 & MENUSTARTARC) && (xctx->ui_state & MENUSTART)) || + (persistent_command && (xctx->last_command & STARTARC)); +int rect_draw_active = (xctx->ui_state & STARTRECT) || + ((xctx->ui_state2 & MENUSTARTRECT) && (xctx->ui_state & MENUSTART)) || + (persistent_command && (xctx->last_command & STARTRECT)); /* this fix uses an alternative method for getting mouse coordinates on KeyPress/KeyRelease * events. Some remote connection softwares do not generate the correct coordinates @@ -4582,6 +4596,14 @@ int wire_draw_active = (xctx->ui_state & STARTWIRE) || if(wire_draw_active) { tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW WIRE! }", NULL); + } else if(line_draw_active) { + tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW LINE! }", NULL); + } else if(poly_draw_active) { + tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW POLYGON! }", NULL); + } else if(arc_draw_active) { + tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW ARC! }", NULL); + } else if(rect_draw_active) { + tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW RECTANGLE! }", NULL); } else { tclvareval(xctx->top_path, ".statusbar.10 configure -state normal -text { }", NULL); }