forked from 1b-agent/opencadstudio-upstream
feat(commands): step the remaining inquiry / solid commands (bucket E)
- ValuePromptCommand: CAL/QUICKCALC/QC (expression), FIND, FINDALL (search). - SelectThenKeywordCommand (select the solid, then axis + value): SECTION, SLICE, 3DMIRROR, 3DROTATE. SLICE's optional TOP/BOTTOM stays typeable. - TwoValuePromptCommand: PYRAMID (radius + height; sides typeable). Left as-is by design: UNDO (bare already undoes one step — a correct default, not a usage line); POLYSOLID (select a polyline then width + height — needs a two-value-after-selection form) and 3DALIGN (six 3-D points) stay typeable.
This commit is contained in:
1 parent
f0f9a57bf6
commit
49c10bc806
2 files changed
+101
-30
No files matched your search
@@ -55,10 +55,13 @@ impl OpenCADStudio {
|
||||
|
||||
// CAL / QUICKCALC <expression> — evaluate an arithmetic expression
|
||||
// (+ - * /, parentheses, unary minus, decimals).
|
||||
cmd if cmd == "CAL"
|
||||
|| cmd == "QUICKCALC"
|
||||
|| cmd == "QC"
|
||||
|| cmd.starts_with("CAL ")
|
||||
"CAL" | "QUICKCALC" | "QC" => {
|
||||
use crate::command::ValuePromptCommand;
|
||||
let c = ValuePromptCommand::new("CAL", "CAL expression (e.g. (2+3)*4):");
|
||||
self.command_line.push_info(&c.prompt());
|
||||
self.tabs[self.active_tab].active_cmd = Some(Box::new(c));
|
||||
}
|
||||
cmd if cmd.starts_with("CAL ")
|
||||
|| cmd.starts_with("QUICKCALC ")
|
||||
|| cmd.starts_with("QC ") =>
|
||||
{
|
||||
@@ -922,11 +925,25 @@ impl OpenCADStudio {
|
||||
// FIND <search> — list all Text/MText/Dimension containing <search>
|
||||
// FIND <search> REPLACE <rep> — replace first occurrence (case-insensitive)
|
||||
// FINDALL <search> REPLACE <rep> — replace all occurrences
|
||||
cmd if cmd == "FIND"
|
||||
|| cmd.starts_with("FIND ")
|
||||
|| cmd == "FINDALL"
|
||||
|| cmd.starts_with("FINDALL ") =>
|
||||
{
|
||||
"FIND" => {
|
||||
use crate::command::ValuePromptCommand;
|
||||
let c = ValuePromptCommand::new(
|
||||
"FIND",
|
||||
"FIND text to find (add REPLACE <text> by typing):",
|
||||
);
|
||||
self.command_line.push_info(&c.prompt());
|
||||
self.tabs[self.active_tab].active_cmd = Some(Box::new(c));
|
||||
}
|
||||
"FINDALL" => {
|
||||
use crate::command::ValuePromptCommand;
|
||||
let c = ValuePromptCommand::new(
|
||||
"FINDALL",
|
||||
"FINDALL text to find (add REPLACE <text> by typing):",
|
||||
);
|
||||
self.command_line.push_info(&c.prompt());
|
||||
self.tabs[self.active_tab].active_cmd = Some(Box::new(c));
|
||||
}
|
||||
cmd if cmd.starts_with("FIND ") || cmd.starts_with("FINDALL ") => {
|
||||
let all_mode = cmd.starts_with("FINDALL");
|
||||
let rest = cmd.split_once(' ').map(|(_, r)| r.trim()).unwrap_or("");
|
||||
|
||||
|
||||
Reference in new issue
Block a user