FIELD: Field dialog, FIELD command and the ATTDEF field buttons

A Field dialog with the fields the application evaluates and the
reference format choices, FIELD placing a field as multi-line text, the
attribute definition dialogs' field buttons, field attachment on commit,
system variable / file size / regional date providers for field
evaluation, and the codec patch with the field authoring API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-02 09:56:54 +03:00
1 parent 53f2983e9c
commit 87211f4654
40 files changed
+1859 -14

No files matched your search

+11 -3
View File
@@ -34,6 +34,9 @@ pub enum AttdefDialogMsg {
PickHeight,
PickRotation,
PickWidth,
/// The ƒ button: pick a field for the Default value.
InsertField,
EditInsertField,
/// Edit the default value in the multi-line text editor.
EditValue,
DismissError,
@@ -76,6 +79,8 @@ pub struct AttdefDialogState {
pub can_align_below: bool,
/// Validation message shown above the buttons.
pub error: Option<String>,
/// The field the Default value shows, when one was inserted.
pub field: Option<(String, Vec<codec::Handle>)>,
}
/// The Edit Attribute Definition dialog's fields.
@@ -87,6 +92,10 @@ pub struct AttdefEditState {
pub default: String,
pub constant: bool,
pub error: Option<String>,
pub field: Option<(String, Vec<codec::Handle>)>,
/// The Default was retyped or a field inserted: the stored field is
/// replaced on Apply.
pub field_changed: bool,
}
fn msg(m: AttdefDialogMsg) -> Message {
@@ -239,8 +248,7 @@ pub fn view<'a>(state: &'a AttdefDialogState, sizing: crate::ui::modal::ModalSiz
Some(AttdefDialogMsg::EditValue),
));
}
// No field picker in this application yet.
value.push(pick("ƒ", t!("Insert field").into_owned(), None))
value.push(pick("ƒ", t!("Insert field").into_owned(), Some(AttdefDialogMsg::InsertField)))
}
.spacing(6)
.into(),
@@ -372,7 +380,7 @@ pub fn view_edit<'a>(state: &'a AttdefEditState, sizing: crate::ui::modal::Modal
true,
AttdefDialogMsg::EditDefault
),
pick("ƒ", t!("Insert field").into_owned(), None),
pick("ƒ", t!("Insert field").into_owned(), Some(AttdefDialogMsg::EditInsertField)),
]
.spacing(6)
.align_y(iced::Center),