Delphi 5 Form Caption Font Size - delphi

I am currently resizing my Delphi5 application from 800x600 to be scalable up to 1440x1080.
The only thing that still looks too small is the Form Caption and the ShowMessage/MessageDlg text.
Am I right in thinking the ShowMessage text is related to the Windows default size?
Is there any way to increase the Form Caption font size? It doesn't seem connected to the Form font size.
Thanks

The font size of the title bar is handled by windows and is system wide. If you want modify the font or other attibutes you must draw manually the non client area of the form(Windows).
Until Windows XP you can draw directly in the caption(title) bar modifying the font , color and text handling the WM_NCPAINT message, starting with windows vista and the DWM introduction you must use the DwmSetWindowAttribute function with the DWMWA_ALLOW_NCPAINT value in order to use this technique.

Related

Edit the spacing between lines in any of Delphi FMX text components

is there a way to alter the spacing of any Delphi FMX component ? all are doubled spaced between lines i believe, i'm sure there is a way to edit the spacing between lines. the most important that it work for FMX
The difference between the two screenshots isn't that they have different line heights or line spacings.
The difference is that the left application is using a variable-width font, while the right application is using a fixed-width (monospaced) font.
You can see this extremely clearly in the top centre part of the image, where you have four full stops (....).
I assume you consider the right screenshot to display the desired appearance. If so, the solution is to change the font in the left application to a fixed-width (monospaced) font.

Increase space / height between TListView items (and TTreeView items) on Windows larger items selection

I use Borland C++ Builder 2009 (yet I assume the issue and solution is the same for Delphi) and right now I assume the answer I'm looking for is the same for both TListView items and TTreeView items. I may be wrong !?
I have noticed, on a smaller Win 8.1 laptop with Display setting 'Change the size of all items' set to 125% . That the items in both TreeView and ListView get closer to each other.
I haven't tested 150% yet, I assume it will be worse.
I would like to adjust for that if possible.
I assume the same logic goes for when a larger sized font is chosen to display these items ?
How would you test if the height of the items is 'too' big and the items need a bit more space between them ?
And how would you increase the spacing between them ? Taking in account that my ListView implementation is virtual (ListView->OwnerData = true ;) !
TForm has Scaled property. If it is true, all components on a form should be resized automatically accordingly to font size. I cannot check right now if this works for TListView and TTreeView, but you should check this property anyway.

Wrong font although it is installed

I draw text on a canvas and set the font by:
Image3.Canvas.font.name := 'Arial Narrow';
Everything is right on my machine. But on another pc from my client the wrong font (bigger) is printed.
So I installed all Arial Narrow fonts on the clients machine. But I still have the wrong font.
Edit: Font seems to be right, but not scale:
This is the problem
Windows 7 has on its Control Panel, Appearance and Personalization, Display setting, an ability to Magnify the text and other items by 125% or 150%.
Any ideas how to get those settings?
At first you set the size of the image as bitmap,Because before using canvas, bitmap has to be created.
so that bitmap.canvas.font does have a default size,
so later it wont increase its size.So the original font will be produced.
Getting the DPI and adjusting the font size did it for me:
DC := GetDC(HWND_DESKTOP);
try
DPI:=GetDeviceCaps(DC,LOGPIXELSY);
finally
ReleaseDC(DC,HWND_DESKTOP);
end;
Image3.Canvas.font.size := round(myConstant*96/DPI);

What is the optimal icon size for XPages Mobile Control line items in views?

I have been adding icons to my mobile control Line Item controls and haven't quite figured out what the preferred size of these icons should be. The CSS has max size settings of 35 by 35px.
The reason I ask this is because the icons don't seem to line up correctly. The CSS positions them at 0 0. If all else fails I may modify CSS and position them to something other than 0 0.
Still interested in hearing how you have dealt with this.
In the teamroom template, the mobile view for Recent Activity has icons that line up with the text. All these images are 16 X 16px.
There will never be 1 fit for all, the layout will be dependant on font size, row height and where you want it to line up. Some people may want it to align in the middle vertically and others will want it to align with the title in the row.
I would say 21px x 21px. but that depends on what font-size you are using.
Icon size can depends upon the applicaton. Normal size is 32x32 and an extended icon size is 64x64. If you want to line up the icons, you might have to change the icons to a standard size.

In Delphi, Is there a way to adjust the line spacing of a TMemo?

I'm working with a TMemo component to display some text in a limited space. Currently it's using a truetype font which doesn't ship with windows and is installed by the app when it runs.
On my PC (Running Windows XP), the spacing between each line of text seems to be about eight pixels. On a different PC running Windows 7, the line spacing seems to be about 14 pixels, which is pushing the bottom row of text out of visibility on the memo.
So, My question is really this:
Is this caused by the different versions of Windows? It's all I could think that was different.
Is there some way I can adjust this value so it would be consistent across all instances of the application, wherever it was running?
Alternatatively, is there a different component I could use which might let me tweak this value?
TMemo is a descendent of Windows Common controls and it's behavior depends on current Windows configuration so it is natural to get different results with it.
If you just want to display some information it's better to use components which let you set texts positions and their style precisely like TRichView. This component is not free but it has it's own text rendering engine and let you style texts with CSS like selectors which look the same in different versions of windows.
In addition to Mohsen's answer I'd like to mention LMD ElPack and it's ElEdit component which also has it's own text rendering engine. Unlike TRichView ElEdit is a plain text edit / memo component, so it's a drop-in replacement for TEdit / TMemo. And line height is configurable there

Resources