Tab spacing

The new TTMSFMXPageControl couldn't have come at a better time. I've been trying to use the TTabControl and have been really struggling trying to get some basic tasks accomplished.

With your PageControl the tasks that I have been struggling with the most are much easier. However there are a couple of items that I haven't yet figured out how to configure to meet the requirement.

Here is my setup code so far. In the constructor:

  Interaction.SelectTabOnFocus := True;
  Interaction.SelectTabOnScroll := True;
  Layout.Position := TTMSFMXTabSetLayoutPosition.tlpBottom;
  TabAppearance.Fill.Color := TAlphaColors.White;
  TabAppearance.TextColor := TAlphaColors.Black;
  TabAppearance.ActiveFill.Color := TAlphaColors.Blue
  TabAppearance.ActiveTextColor := TAlphaColors.White;
  TabAppearance.Font.Size := 18;   
  TabAppearance.DisabledFill.Color := TAlphaColors.DarkGray;
  TabAppearance.DisabledTextColor := TAlphaColors.Gray;
  TabAppearance.WordWrapping := True;
  TabAppearance.ShapeRounding := 10;
  TabSize.Spacing := 1;
  TabSize.Margins.Left := 1;
  TabSize.Margins.Right := 1;

In the custom addtab method:

  Tabs[Pred(Tabs.Count)].Enabled := TabEnabled;
  Tabs[Pred(Tabs.Count)].UseDefaultAppearance := True;
  if Pages.Count = 1 then
  TabSize.Height := Round(TabSize.Height * 1.8);
  TabSize.Mode := tsmFixedSizeAutoShrink;

So far setting the tab width, tab spacing, tab mode etc. has not brought the tabs closer together. With the TTabControl I had the tabs touching each other side by side, with rounded edges on the bottom. With your PageControl, I can't get the tabs to be any closer together.

Also, when I specify wordwrapping for the tab text, the text seems to be double spaced. I really need it to be single spaced. 

How can I adjust these two items?



You are using a pyramid which has slopes. You can change the shape to tsRound and set the ShapeOverlap to 0 to have no more spacing.

TabAppearance.Shape := tsRound;
TabAppearance.ShapeOverlap := 0;

If you want them to overlap you can set the ShapeOverlap to a higher number.

Pieter Scheldeman2016-06-09 08:38:53

Wow thanks! That works great! And it seems to solve the word spacing issue when the text on the tab is word wrapped.

Thanks again!