Design tab: value-label titles + 5 sketch/UX fixes

Six fixes to the Design tab, all live-verified on :10:
- Datum-plane re-pick: wxEVT_CHOICE on m_draw_plane re-planes the live sketch
- Delete-feature dismisses its lingering settings card (on_delete_feature)
- Revert rotation-orbit regression (no feed_bodies/reload on close_tool)
- Sketch undo/delete via focus-independent CHAR_HOOK (Ctrl+Z/Y, Delete)
- Fix undo hang: reset_autoedit() clears dangling auto-edit sequence
- Titled value fields: each inline dim field shows its role (Width, Height,
  Radius, Angle, Length, Side, Distance, Major, Minor)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVzKmX6Y1aEteit1HTXG4Q
This commit is contained in:
Tommaso Bianchi
2026-07-01 19:19:23 +02:00
co-authored by Claude Opus 4.8
parent 5a005d4728
commit de16d566b2
7 changed files with 181 additions and 52 deletions
+29 -2
View File
@@ -74,6 +74,7 @@ DesignCanvas::DesignCanvas(wxWindow* parent)
// px and wrap the callbacks so each one re-solves and re-renders the viewport.
m_inline_editor = std::make_unique<SketchInlineEditor>(m_canvas_widget);
m_sketch_tool.on_inline_edit = [this](wxPoint screen_px, double current,
const std::string& title,
std::function<void(double)> commit,
std::function<void()> cancel) {
if (!m_inline_editor) { if (cancel) cancel(); return; }
@@ -85,7 +86,7 @@ DesignCanvas::DesignCanvas(wxWindow* parent)
// Freeze the sketch tool while the field is open so a stray click/move on the GL
// canvas can't draw under the floating editor; released on commit or cancel.
m_sketch_tool.set_inline_busy(true);
m_inline_editor->open(scr, current,
m_inline_editor->open(scr, current, title,
[this, commit](double v) {
m_sketch_tool.set_inline_busy(false);
if (commit) commit(v);
@@ -336,6 +337,13 @@ void DesignCanvas::begin_sketch(const SketchPlane& plane, DesignSketchTool::Mode
if (m_canvas_widget) m_canvas_widget->Refresh();
}
void DesignCanvas::set_sketch_plane(const SketchPlane& plane)
{
m_sketch_tool.set_plane(plane); // keeps the 2D entities; only the carrier plane changes
if (m_canvas) m_canvas->set_as_dirty();
if (m_canvas_widget) m_canvas_widget->Refresh();
}
void DesignCanvas::edit_sketch(const std::vector<SketchEntity>& entities,
const std::vector<SketchEntityConstraintDef>& constraints,
const SketchPlane& plane)
@@ -833,6 +841,25 @@ void DesignCanvas::delete_selected_sketch_entities()
request_repaint();
}
bool DesignCanvas::inline_busy() const
{
return m_sketch_tool.inline_busy();
}
bool DesignCanvas::undo_last_sketch_entity()
{
const bool did = m_sketch_tool.undo_last_entity();
if (did) request_repaint();
return did;
}
bool DesignCanvas::delete_selected_or_last_sketch_entity()
{
const bool did = m_sketch_tool.delete_selected_or_last();
if (did) request_repaint();
return did;
}
void DesignCanvas::clear_sketch_selection()
{
m_sketch_tool.clear_selection();
@@ -879,7 +906,7 @@ void DesignCanvas::open_inline_value(double current, std::function<void(double)>
// Freeze the canvas so focus-follows-mouse can't steal keyboard focus off the field — the
// same fix the draw-then-edit path uses (cursor focus stays on the field, no pre-click).
m_sketch_tool.set_inline_busy(true);
m_inline_editor->open(scr, current,
m_inline_editor->open(scr, current, "",
[this, commit](double v) {
m_sketch_tool.set_inline_busy(false);
if (commit) commit(v);