TBoldEdit¶
TBoldEdit is a data-aware edit control that displays and edits a single Bold attribute value. It connects to a TBoldElementHandle or TBoldExpressionHandle and provides automatic validation and rendering.
Class Hierarchy¶
classDiagram
TCustomEdit <|-- TBoldCustomEdit
TBoldCustomEdit <|-- TBoldEdit
TBoldEdit : +BoldHandle
TBoldEdit : +BoldProperties
TBoldEdit : +Expression
TBoldEdit : +ReadOnly
TBoldEdit : +ButtonStyle
click TBoldExpressionHandle href "../TBoldExpressionHandle/" "TBoldExpressionHandle"
Key Properties¶
| Property | Type | Description |
|---|---|---|
BoldHandle |
TBoldElementHandle |
Handle providing the value |
BoldProperties |
TBoldStringFollowerController |
Controls rendering and validation |
Expression |
string |
OCL expression for sub-navigation |
ReadOnly |
Boolean |
Prevent editing |
ButtonStyle |
TBoldEditButtonStyle |
None, ellipsis, or dropdown button |
Alignment |
TAlignment |
Text alignment |
BeepOnInvalidKey |
Boolean |
Audio feedback on invalid input |
| Public Property | Description |
|---|---|
EffectiveReadOnly |
Combines ReadOnly + model constraints |
EffectiveFont |
Font after renderer override |
EffectiveColor |
Color after renderer override |
Follower |
The internal follower tracking the value |
Working with TBoldEdit¶
Form Designer Setup¶
- Drop
TBoldEditon a form - Set
BoldHandleto an expression handle - The edit automatically displays and allows editing the value
Connecting to Attributes¶
// Expression handle connected to current customer's name
ExpressionHandle1.RootHandle := BoldSystemHandle1;
ExpressionHandle1.Expression := 'Customer.allInstances->first';
BoldEdit1.BoldHandle := ExpressionHandle1;
BoldEdit1.BoldProperties.Expression := 'name';
Validation¶
TBoldEdit validates input automatically:
- Per-keystroke:
ValidateCharacterprevents invalid characters - On exit:
ValidateStringchecks the complete value - Invalid keys trigger a beep if
BeepOnInvalidKeyisTrue
Button Style¶
// Add an ellipsis button for custom editor
BoldEdit1.ButtonStyle := besEllipsis;
BoldEdit1.OnButtonClick := HandleButtonClick;
procedure TMyForm.HandleButtonClick(Sender: TObject);
begin
// Open custom editor dialog
ShowAddressEditor(CurrentCustomer);
end;
See Also¶
- TBoldLabel - Read-only display
- TBoldComboBox - Selection from list
- TBoldExpressionHandle - Data source