Home › Forums › Konopka Signature VCL Controls (formerly Raize Components) › RZTabbedListBox linked to THeader
- This topic has 1 reply, 2 voices, and was last updated 2023-10-30 at 11:24 pm by Ray Konopka.
-
AuthorPosts
-
-
October 25, 2023 at 2:01 am #3696
since I ran into problems in my project I stripped the code for using TabbedListBoxes down to a very simple test-program
- placing THeader and TRZTabbedListBox an TButton on the form
- configuring 3 Tabs with the propertyeditor of TabSops: 8,16,24
- The Button1Click methode creates 3 lines
- linking Header1Sizing to UpdateFromHeader
now the problem
starting the programm
changing sectionsize with tHeader
observed: the text is indented to the tab position (OK) but moving the section more to right ( the first section gets bigger by that) the indent of the word in line two gets greater and greater the wider the section gets bigger.
before changing the section size
after changing the section size – the ident gets bigger
here my code from main
type
TForm1 = class(TForm)
Header1: THeader;
Button1: TButton;
RzTabbedListBox1: TRzTabbedListBox;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Header1Sizing(Sender: TObject; ASection, AWidth: Integer);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;var
Form1: TForm1;implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
RzTabbedListBox1.Add(‘zeile 1′);
RzTabbedListBox1.Add(#9+’zeile 2′);
RzTabbedListBox1.Add(#9+#9+’zeile 3’);
end;procedure TForm1.Header1Sizing(Sender: TObject; ASection, AWidth: Integer);
begin
RzTabbedListBox1.UpdateFromHeader(header1);
end;end.
and here code from DFM file:
object Form1: TForm1
Left = 0
Top = 0
Caption = ‘Form1’
ClientHeight = 442
ClientWidth = 628
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = ‘Segoe UI’
Font.Style = []
TextHeight = 15
object Header1: THeader
Left = 0
Top = 0
Width = 628
Height = 25
Align = alTop
Sections.Sections = (
#0’29’#0’eins’
#0’31’#0’zwei’
#0’28’#0’drei’)
TabOrder = 0
OnSizing = Header1Sizing
ExplicitTop = -6
end
object Button1: TButton
Left = 48
Top = 384
Width = 75
Height = 25
Caption = ‘Button1’
TabOrder = 2
OnClick = Button1Click
end
object RzTabbedListBox1: TRzTabbedListBox
Left = 0
Top = 25
Width = 628
Height = 248
TabStop = False
TabStops.Min = -2147483647
TabStops.Max = 2147483647
TabStops.Integers = (8
16
24)
Align = alTop
ItemHeight = 15
TabOrder = 1
UseGradients = False
end
object Button2: TButton
Left = 288
Top = 384
Width = 75
Height = 25
Caption = ‘Button2’
TabOrder = 3
end
endwhat is wrong?
thx in advance for help
Juergen
-
October 30, 2023 at 11:24 pm #3732
Hi Juergen,
Thank you for reporting this issue. I’m not entirely sure when this functionality stopped working, but the reason the tab stops are not updating from the header properly is because the internal FDialogUnits property of the TRzTabbedListBox is not getting initialized properly. Normally the FDialogUnits property gets updated in the cm_FontChanged component message handling method. I believe this notification message used to be sent when a component was created, but that is no longer happening. I will have to research that further.
Fortunately, there is a workaround. You can manually send the cm_FontChanged component message to the tabbed list box in the FormCreate event handler as shown below. After that, the tabs will be updated properly when changing the header sections.
procedure TForm1.FormCreate(Sender: TObject); begin RzTabbedListBox1.Perform( cm_FontChanged, 0, 0 ); end;
I believe the proper fix will be to ensure that the FDialogUnits property gets initialized in the TRzTabbedListBox.Loaded method override. I would encourage you to report this issue to Embarcadero as they are the owners and maintainers of the KSVC since 2015.
Ray
-
-
AuthorPosts
- You must be logged in to reply to this topic.