feat(commands): step the selection-first text commands (bucket C)

Add SelectThenValueCommand (gather selection, then one value) and convert:
- SelectThenValueCommand: HYPERLINK (url), ARCTEXT (text), TEXTFIT (width),
  SCALETEXT (factor), TCOUNT (start), TEXTMASK (Enter to apply).
- SelectThenKeywordCommand: JUSTIFYTEXT (Left/Center/Right/Middle/Aligned/Fit),
  TCASE (Upper/Lower/Sentence/Title).

Each bare form gathers a selection when none is set, prompts, and delegates to
the inline handler. OBJECTSCALE already opens its dialog; TABLE CELL takes three
values (row/col/text) and stays typeable — TABLE bare already builds a table
interactively.
This commit is contained in:
Hakan Seven 2026-07-16 14:37:10 +03:00
commit 208e617868
4 changed files with 185 additions and 8 deletions

View file

@ -640,7 +640,18 @@ impl OpenCADStudio {
// HYPERLINK <url> — attach a hyperlink to the selected objects, stored
// in the standard PE_URL XData record so it round-trips in the file.
cmd if cmd == "HYPERLINK" || cmd.starts_with("HYPERLINK ") => {
"HYPERLINK" => {
use crate::command::SelectThenValueCommand;
let has_sel = !self.tabs[i].scene.selected_entities().is_empty();
let c = SelectThenValueCommand::new(
"HYPERLINK",
"HYPERLINK URL to attach:",
has_sel,
);
self.command_line.push_info(&c.prompt());
self.tabs[i].active_cmd = Some(Box::new(c));
}
cmd if cmd.starts_with("HYPERLINK ") => {
use acadrust::xdata::{ExtendedDataRecord, XDataValue};
let url = cmd.strip_prefix("HYPERLINK").unwrap_or("").trim().to_string();
if url.is_empty() {