Subject Re: [IBO] Problem with AutoLabels
Author Mark Pickersgill
Hi Steve,
I followed your steps as best I could, and everything appears as it
should up to step 8.
I've tried with the most recent IBO 4.5Ai and setting albTrimX on the
model to true does not untruncate the Edit box with the long Autolabel
caption.

This is what I did:
1 - Start out with the following edit boxes and properties (form
resource abreviated):
Initial State
object IB_Edit1: TIB_Edit
AutoLabel.Caption = 'Test'
AutoLabel.Color = clLime
AutoLabel.Kind = albLeft
AutoLabel.Transparent = False
end
object IB_Edit3: TIB_Edit
AutoLabel.Caption = 'Super Smith Somewhere'
AutoLabel.Kind = albLeft
AutoLabel.Model = IB_Edit1
end
object IB_Edit4: TIB_Edit
AutoLabel.Caption = 'Test2'
AutoLabel.Kind = albLeft
AutoLabel.Model = IB_Edit1
end

2 - Set the AutoLabel->Model property to IB_Edit1 for IB_Edit3 and
IB_Edit4 and set albAlignToModel to true for IB_Edit3 and IB_Edit4.

Result - Autolabels for IB_Edit3 and IB_Edit4 are truncated to the same
width as IB_Edit1 as expected.

3 - Set the albTrimX property on IB_Edit3 and IB_Edit4 to true (I'm not
100% sure which controls you meant so this is what I've assumed).

Result - No change as expected (albTrimX has to do with the trimming the
excess space around a label, and not truncating it).

4 - Clear the AutoLabel->Model property for IB_Edit3 and IB_Edit4
Result - No longer truncated as expected.

5 - Set the AutoLabel->Model property for IB_Edit3 and IB_Edit4 again.
Result - Truncated as expected.

6 - Set the albTrimX field on the model to true.
Result - NO truncation as expected.

I've also done the above steps but with the IB_Edits placed on a
TGroupBox with Bold font, 12pt and the groupbox colour blue. The results
are the same as above.

I've also verified v4.3Aa of IBObjects and setting the model property
and it also truncates the long Autolabel caption as it should.

What version of IBObjects were you previously using?

A demo base app maybe useful if I've missed something.

If this is a real problem for your current apps (as you mentioned in
another email), then might I suggest using the old IBC_Label.pas file to
keep the behaviour you want.

cheers
Mark

Steve Fields wrote:

> The following situation arises:
>
>1. Add a group of TIB_Edits to a form.
>2. Make the autolabels model on the first TIB_Edit field.
>3. Make one of the edit's label wider than the actual text area.
>4. The label is tuncated to the same width.
>5. Set the albTrimX to true it is still truncated.
>6. Clear the model field and the label is now untruncated.
>7. Set the model field again, it truncates again.
>8. Set the albTrimX field on the model to true, IT untruncates.
>
> None of the other edits will un-truncate unless they do
>NOT have a model.
>
> This came about because I was trying to place a group of
>TIB_Edits in a group panel while setting the group panel font
>to a larger, bold, different color. This would force the labels
>on the edits to match the font settings. Setting th e parentfont
>setting to false, of course, only sets the font of the text in
>the TIB_Edit, not the label.
>
>Steve Fields
>
>