Insert ribbon: Import panel

Import File split button (PDF Import / DGN Import / Import), Recognize
SHX Text, Recognition Settings and Combine Text; Land XML moves to the
panel slide-out and Open leaves the panel. Ribbon commands may be menu
macros (`;` answers the running command's prompt). KeyTips IF, PI, DI,
OI, PS, PT, TM; labels in every locale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-15 14:53:08 +03:00
1 parent 39c3e9af58
commit 8a87a09e30
33 files changed
+326 -41

No files matched your search

-10
View File
@@ -1,10 +0,0 @@
use crate::modules::{IconKind, ModuleEvent, ToolDef};
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/landxml.svg"));
pub fn tool() -> ToolDef {
ToolDef {
id: "LANDXMLIMPORT",
label: "Land\nXML",
icon: ICON,
event: ModuleEvent::Command("LANDXMLIMPORT".to_string()),
}
}
+40 -6
View File
@@ -11,10 +11,8 @@ mod design_center;
pub(crate) mod edit_block;
pub(crate) mod image_transparency;
pub(crate) mod insert_block;
mod landxml;
pub mod minsert;
mod mview_block;
mod open_obj;
pub(crate) mod pc_attach;
pub(crate) mod pc_crop;
pub(crate) mod pc_extract;
@@ -32,7 +30,9 @@ pub(crate) mod xattach;
pub(crate) mod xclip;
pub(crate) mod xref_cmd;
use crate::modules::{CadModule, IconKind, RibbonGroup, RibbonItem};
use crate::modules::{CadModule, IconKind, ModuleEvent, RibbonGroup, RibbonItem, ToolDef};
const IMPORT_ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/import_obj.svg"));
const FRAMES_ICON: IconKind =
IconKind::Svg(include_bytes!("../../../assets/icons/underlay_frames.svg"));
@@ -144,12 +144,46 @@ impl CadModule for InsertModule {
},
],
},
// ── Import ────────────────────────────────────────────────────────
// ── Import (slide-out: Land XML) ──────────────────────────────────
RibbonGroup {
title: "Import",
tools: vec![
RibbonItem::LargeTool(open_obj::tool()),
RibbonItem::LargeTool(landxml::tool()),
// The face names and runs the last one chosen. A `;`
// answers the started command's prompt, as in a menu
// macro.
RibbonItem::LargeDropdown {
id: "IMPORT_FILE",
label: "",
icon: IMPORT_ICON,
items: vec![
("PDFIMPORT;FILE", "PDF Import", underlay_layers::ICON),
("DGNIMPORT", "DGN Import", underlay_layers::ICON),
("IMPORT", "Import…", IMPORT_ICON),
],
default: "PDFIMPORT;FILE",
},
RibbonItem::LabeledTool(ToolDef {
id: "PDFSHXTEXT",
label: "Recognize SHX Text",
icon: IconKind::Svg(include_bytes!("../../../assets/icons/text.svg")),
event: ModuleEvent::Command("PDFSHXTEXT".to_string()),
}),
RibbonItem::LabeledTool(ToolDef {
id: "PDFSHXTEXT_SETTINGS",
label: "Recognition Settings",
icon: IconKind::Svg(include_bytes!(
"../../../assets/icons/options_tool.svg"
)),
event: ModuleEvent::Command(
"PDFSHXTEXTSETTINGS 1;PDFSHXTEXT;SETTINGS".to_string(),
),
}),
RibbonItem::LargeTool(ToolDef {
id: "TXT2MTXT",
label: "Combine Text",
icon: IconKind::Svg(include_bytes!("../../../assets/icons/mtext.svg")),
event: ModuleEvent::Command("TXT2MTXT".to_string()),
}),
],
},
// ── Content ───────────────────────────────────────────────────────
-9
View File
@@ -1,9 +0,0 @@
use crate::modules::{IconKind, ModuleEvent, ToolDef};
pub fn tool() -> ToolDef {
ToolDef {
id: "OPEN",
label: "Open",
icon: IconKind::Svg(include_bytes!("../../../assets/icons/import_obj.svg")),
event: ModuleEvent::OpenFileDialog,
}
}