forked from 1b-agent/opencadstudio-upstream
feat(table): add TABLEDIT point picking, and consolidate InputKind
- Implement `TABLEDIT` command supporting viewport point-picking on cell interiors - Support overlapping table hit testing with selection cycling and top-table resolution - Support `/n` and `\n` multiline paragraph breaks (`\P`) in table cell text editing - Unify text input modes via `InputKind` (`Point`, `SingleToken`, `FreeText`) on `CadCommand` - Migrate 15+ commands across annotate, draw, insert, layout, and view modules - Preserve text casing, literal spaces, and bypass arithmetic eval during FreeText input - Add dedicated `tabledit_tests` and `free_text_entry_tests` test suites
This commit is contained in:
1 parent
bde9cc2715
commit
d6a6dd6a7d
23 files changed
+860
-254
No files matched your search
@@ -12,7 +12,7 @@ use acadrust::EntityType;
|
||||
use glam::DVec3;
|
||||
use crate::t;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult, WorkingPlane};
|
||||
use crate::command::{CadCommand, CmdResult, InputKind, WorkingPlane};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
|
||||
enum Step {
|
||||
@@ -88,14 +88,12 @@ impl CadCommand for AttdefCommand {
|
||||
}
|
||||
}
|
||||
|
||||
fn wants_text_input(&self) -> bool {
|
||||
!matches!(self.step, Step::Insertion { .. })
|
||||
}
|
||||
|
||||
fn wants_text_with_spaces(&self) -> bool {
|
||||
// Tag must be a single token (so disallow spaces there); the
|
||||
// Prompt and Default value steps are free-form text.
|
||||
matches!(self.step, Step::Prompt { .. } | Step::Default { .. })
|
||||
fn input_kind(&self) -> InputKind {
|
||||
match self.step {
|
||||
Step::Insertion { .. } => InputKind::Point,
|
||||
Step::Tag => InputKind::SingleToken,
|
||||
Step::Prompt { .. } | Step::Default { .. } => InputKind::FreeText,
|
||||
}
|
||||
}
|
||||
|
||||
fn on_text_input(&mut self, text: &str) -> Option<CmdResult> {
|
||||
|
||||
Reference in new issue
Block a user