feat(commands): interactive value prompts for PDMODE/PDSIZE/LTSCALE/CELTSCALE (F4)
Bare PDMODE / PDSIZE / LTSCALE / CELTSCALE now enter a generic ValuePromptCommand front-end that prompts for the value and delegates to the existing inline `<name> <value>` handler via CmdResult::Dispatch, so they prompt step-by-step like UCS. A bare Enter reports the current value; `PDMODE 3` still works as one typed / headless line. Only pure single-value setting commands are converted. Dialog-opening commands (LAYER, PURGE, DIMSTYLE, STYLE …) intentionally keep their bare-name behaviour (open the panel), and subcommand-tree commands keep their inline handlers — all already typable with arguments since F1. Adds headless test value_prompt_commands_inline_args. Fourth phase of the unified step driver. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
52f6aed2f2
commit
df0e283eba
3 changed files with 109 additions and 4 deletions
|
|
@ -4944,7 +4944,13 @@ impl OpenCADStudio {
|
|||
}
|
||||
}
|
||||
}
|
||||
cmd if cmd == "LTSCALE" || cmd.starts_with("LTSCALE ") => {
|
||||
"LTSCALE" => {
|
||||
use crate::command::ValuePromptCommand;
|
||||
let c = ValuePromptCommand::new("LTSCALE", "LTSCALE new global line-type scale:");
|
||||
self.command_line.push_info(&c.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(c));
|
||||
}
|
||||
cmd if cmd.starts_with("LTSCALE ") => {
|
||||
let val_str = cmd.trim_start_matches("LTSCALE").trim();
|
||||
if val_str.is_empty() {
|
||||
let v = self.tabs[i].scene.document.header.linetype_scale;
|
||||
|
|
@ -4964,7 +4970,16 @@ impl OpenCADStudio {
|
|||
self.command_line.push_error("Usage: LTSCALE [value]");
|
||||
}
|
||||
}
|
||||
cmd if cmd == "PDMODE" || cmd.starts_with("PDMODE ") => {
|
||||
"PDMODE" => {
|
||||
use crate::command::ValuePromptCommand;
|
||||
let c = ValuePromptCommand::new(
|
||||
"PDMODE",
|
||||
"PDMODE new value [0=dot 1=none 2=+ 3=x 4=tick; +32 circle +64 square]:",
|
||||
);
|
||||
self.command_line.push_info(&c.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(c));
|
||||
}
|
||||
cmd if cmd.starts_with("PDMODE ") => {
|
||||
let val_str = cmd.trim_start_matches("PDMODE").trim();
|
||||
if val_str.is_empty() {
|
||||
let v = self.tabs[i].scene.document.header.point_display_mode;
|
||||
|
|
@ -4999,7 +5014,16 @@ impl OpenCADStudio {
|
|||
.push_error("Requires 0 OR 1 OR MULTIPLE OR SINGLE");
|
||||
}
|
||||
}
|
||||
cmd if cmd == "PDSIZE" || cmd.starts_with("PDSIZE ") => {
|
||||
"PDSIZE" => {
|
||||
use crate::command::ValuePromptCommand;
|
||||
let c = ValuePromptCommand::new(
|
||||
"PDSIZE",
|
||||
"PDSIZE new point size (0 = 5% of viewport, <0 = absolute):",
|
||||
);
|
||||
self.command_line.push_info(&c.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(c));
|
||||
}
|
||||
cmd if cmd.starts_with("PDSIZE ") => {
|
||||
let val_str = cmd.trim_start_matches("PDSIZE").trim();
|
||||
if val_str.is_empty() {
|
||||
let v = self.tabs[i].scene.document.header.point_display_size;
|
||||
|
|
@ -5057,7 +5081,16 @@ impl OpenCADStudio {
|
|||
}
|
||||
}
|
||||
}
|
||||
cmd if cmd == "CELTSCALE" || cmd.starts_with("CELTSCALE ") => {
|
||||
"CELTSCALE" => {
|
||||
use crate::command::ValuePromptCommand;
|
||||
let c = ValuePromptCommand::new(
|
||||
"CELTSCALE",
|
||||
"CELTSCALE new current-object line-type scale:",
|
||||
);
|
||||
self.command_line.push_info(&c.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(c));
|
||||
}
|
||||
cmd if cmd.starts_with("CELTSCALE ") => {
|
||||
let val_str = cmd.trim_start_matches("CELTSCALE").trim();
|
||||
if val_str.is_empty() {
|
||||
let v = self.tabs[i]
|
||||
|
|
|
|||
Loading…
Reference in a new issue