Forum > LCL

[solved] TPageControl - Format Captions of Tabsheets

<< < (2/2)


--- Quote from: Nicole on July 28, 2022, 08:00:27 am ---Theoretically, I can do this by the space bar. Practically this is ugly, because the space would depend on the fonts-type and will not help me for top and bottom.

--- End quote ---

Try using a Unicode em-space character, or a nonbreaking space. Please report back if these aren't handled properly, or if Trim() etc. subsequently return unexpected results.

Edited: there's a list of the various kinds of spaces at , you should find that the IDE can insert them (see bottom of edit menu, and look for the "General Punctuation" block) even though they're not well labelled.



--- Quote from: Nicole on July 28, 2022, 01:15:18 pm ---Yes, Windows.

--- End quote ---

Ok, so, if you check though the Windows implementation for SetTabSize you will find:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---class procedure TWin32WSCustomTabControl.SetTabSize(  const ATabControl: TCustomTabControl;  const ATabWidth, ATabHeight: integer);begin  if ATabControl is TTabControl then    exit;  Windows.SendMessage(ATabControl.Handle, TCM_SETITEMSIZE,    0, MakeLParam(ATabWidth, ATabHeight));end;  
If you look up the documentation for TCM_SETITEMSIZE you find:

You then see a Windows Vista (minimum) feature called TCM_SETPADDING

TCM_SETPADDING isn't used anywhere in Lazarus 2.0.10, but is defined in FreePascal. ie: Windows unit contains TabCtrl_SetPadding()

So, you could go with a Windows Vista (minimum) implementation by sending this message explicitly. I'm not on a Windows machine anymore, so I can't help you with that. Ideally, if all Widget sets supported such a feature, it might get included in LCL. I also don't know if Delphi supports such a feature, which would give the LCL developers a "standard" way to add the property to Lazarus.

Either way, Hope that helps.

Thank you so much for this verbose and interesting answer (saved in my records)


[0] Message Index

[*] Previous page

Go to full version