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:
parent
c19c18c2f2
commit
e2a83a6487
7 changed files with 201 additions and 77 deletions
|
|
@ -45,10 +45,16 @@ impl OpenCADStudio {
|
|||
return Some(Task::done(Message::QSelectOpen));
|
||||
}
|
||||
|
||||
// CAL <expression> — evaluate an arithmetic expression
|
||||
// CAL / QUICKCALC <expression> — evaluate an arithmetic expression
|
||||
// (+ - * /, parentheses, unary minus, decimals).
|
||||
cmd if cmd == "CAL" || cmd.starts_with("CAL ") => {
|
||||
let expr = cmd.trim_start_matches("CAL").trim();
|
||||
cmd if cmd == "CAL"
|
||||
|| cmd == "QUICKCALC"
|
||||
|| cmd == "QC"
|
||||
|| cmd.starts_with("CAL ")
|
||||
|| cmd.starts_with("QUICKCALC ")
|
||||
|| cmd.starts_with("QC ") =>
|
||||
{
|
||||
let expr = cmd.splitn(2, char::is_whitespace).nth(1).unwrap_or("").trim();
|
||||
if expr.is_empty() {
|
||||
self.command_line
|
||||
.push_info("Usage: CAL <expression> e.g. CAL (2+3)*4");
|
||||
|
|
|
|||
Loading…
Reference in a new issue