TADVToolbar and Separator

Hi,
  I Using components ADVToolbar (version 6.2).
  I placed on toolbar some buttons and after two separators. Actual Order is Button1, Button2, Button3, Separator1, Separator2.
 In next step I moved separators on other position. So now I have order Button1, Separator1, Button2, Separator2, Button3.
  In design mode it's look like good, but when I run it Separator2 is invisible.
  I was searching for reason and I found function:


procedure TAdvCustomToolBar.UpdateSeparators;
var
  i: integer;
  visctrl: integer;

begin
  visctrl := 0;

  for i := 0 to ControlCount - 1 do
  begin
    if (Controls is TAdvToolBarSeparator) then
    begin
      Controls.Top := 2;
      Controls.Visible := visctrl > 0;
      visctrl := 0;
    end
    else
      if Controls.Visible then
        inc(visctrl);
  end;
end;



Separators are in DFM still in first order and this is order of Controls list. I think is not good Idea read order from this list, because actual order is different.

I think is a bug and can be fixed in dome next version.

This is for the feature of auto separator hiding / optimizing where the check if two consecutive hidden controls that potentially cause a separator in between to be hidden automatically is based on the control creation order. There is no direct interface at component level to get the consecutive child controls based on position rather than creation order.
We'll need to investigate if we can make up the list based on control position.

Yes, I see the same issue too, with separators ok in design mode but disappearing at runtime.

Are you referring to the same case of multiple separators after each other without controls in between?

No, separators separating groups of images. I have a separator on the far left of a TAdvToolBar which displays ok at design time but not at runtime. Another separator separating two groups of images has the same behaviour. Other separators work ok though. Interestingly, at design time visible=True, I run the app and the two separators don't show. After closing the app, on occasion (but not always) visible is now set to False ie, the property value doesn't always 'stick'.

Here are two images which demonstrate the issue.
Design Time:
DesignTime

Run Time:
RunTime

Both separators had visible=True at design time and were visible=False after running the app. This is probably a different issue to the one in the initial post. Shall I create a new issue?

The issue is caused by setting the TAdvToolBar's AutoPositionControls property to True. Setting it to False displays all separators normally. I hope this isn't wad, because I need AutoPositionControls set to True as I change the toolbar's visible images depending on, for example, the Tabsheet being displayed.

Later: If I put the TAdvToolBar on a TAdvDockPanel, all separators in the TAdvToolBar are now shown ok - and the setting of AutoPositionControls is now fixed at True. Is it normal practice to have to do this?

We see there is indeed a difference in treatment. TAdvToolBar is designed to be used either on a TAdvDockPanel or a TAdvPage. The 3rd case, that it is neither on a TAdvDockPanel or a TAdvPage was therefore handled different. While the control is really designed to be used on a TAdvDockPanel or TAdvPage, we'll investigate if we can also make it work the same way in other scenarios.

Thanks Bruno. I'm happy to keep the TAdvToolBars on TAdvDockPanels for the moment. It does have the added benefit of being able to align the ToolBar at daTop which the TAdvToolBars alone do not have.