feat(bedit): add Edit Block Definition dialog and new block authoring

Open the Edit Block Definition dialog when BEDIT is invoked without an active selection, listing candidate block definitions alphabetically while filtering layout records, anonymous blocks, and external references. Allow typing a new valid block name to start an empty block editor session that only commits to the drawing block table upon explicit save.
This commit is contained in:
Karim Jerbi committed 2026-10-14 14:46:48 +01:00
1 parent 9632979d09
commit abad1b9045
10 files changed
+719 -86

No files matched your search

+7
View File
@@ -79,6 +79,7 @@ impl OpenCADStudio {
Some(K::LayerDeleteWarning) => crate::tr!("modal", "delete-layer"),
Some(K::Unsaved) => crate::tr!("modal", "unsaved-changes"),
Some(K::BlockEditChanges) => crate::t!("Block Editor").into_owned(),
Some(K::BlockEditPicker) => crate::t!("Edit Block Definition").into_owned(),
Some(K::BlockSaveAs) => crate::t!("Save Block As").into_owned(),
Some(K::PointStyle) => crate::tr!("modal", "point-style"),
Some(K::AttributeEditor) => crate::tr!("modal", "attribute-editor"),
@@ -501,6 +502,12 @@ impl OpenCADStudio {
crate::ui::window::block_definition::view_window(state, flow)
})
}
super::super::ModalKind::BlockEditPicker => {
let state = self.block_edit_picker.as_ref()?;
sized_flow(ex, 540, 380, |flow| {
crate::ui::window::block_edit_picker::view(state, flow)
})
}
super::super::ModalKind::BlockSaveAs => {
let state = self.block_save_as.as_ref()?;
sized_flow(ex, 430, 370, |flow| {