feat(commands): add CLOSE, HIDE, VISUALSTYLES, QUICKCALC, HYPERLINK, XOPEN

Six more standard commands by reusing existing infrastructure:
- CLOSE: close the active tab (Message::TabClose)
- HIDE / VISUALSTYLES: per-viewport render mode (Message::SetRenderMode)
- QUICKCALC / QC: alias the CAL arithmetic evaluator
- HYPERLINK <url>: attach a hyperlink via the PE_URL XData record
- XOPEN: open a selected xref's source file (Message::OpenRecent)

COMMANDS.md updated to 214 done / 15 partial / 33 missing of 262.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-29 09:04:18 +03:00
commit e2a83a6487
7 changed files with 201 additions and 77 deletions

View file

@ -988,6 +988,36 @@ impl OpenCADStudio {
));
}
// HIDE — hidden-line view of the active viewport.
"HIDE" | "HI" => {
return Some(Task::done(Message::SetRenderMode(
acadrust::entities::ViewportRenderMode::HiddenLine,
)));
}
// VISUALSTYLES <name> — apply a built-in visual style to the active
// viewport via its render mode (the style-definition manager dialog
// is not modelled; this applies the standard styles).
cmd if cmd == "VISUALSTYLES" || cmd.starts_with("VISUALSTYLES ") => {
use acadrust::entities::ViewportRenderMode as VRM;
let name = cmd.strip_prefix("VISUALSTYLES").unwrap_or("").trim().to_uppercase();
let mode = match name.as_str() {
"2DWIREFRAME" | "2D" => Some(VRM::Wireframe2D),
"3DWIREFRAME" | "WIREFRAME" | "3D" => Some(VRM::Wireframe3D),
"HIDDEN" | "HIDDENLINE" => Some(VRM::HiddenLine),
"FLAT" | "FLATSHADED" => Some(VRM::FlatShaded),
"REALISTIC" | "SHADED" | "GOURAUD" => Some(VRM::GouraudShaded),
"CONCEPTUAL" | "SHADEDWITHEDGES" => Some(VRM::GouraudShadedWithEdges),
_ => None,
};
match mode {
Some(m) => return Some(Task::done(Message::SetRenderMode(m))),
None => self.command_line.push_info(
"VISUALSTYLES <2DWIREFRAME|3DWIREFRAME|HIDDEN|REALISTIC|CONCEPTUAL|SHADED>",
),
}
}
_ => return None,
}
Some(self.finish_dispatch(cmd))