Modifying JvTabBar with JvTabBarXPPainter - delphi

I tried to modify properties of JvTabBar, but it does not work. I assigned JvTabBarXPPainter to JvTabBar, but it only changed "FixedTabSize" properties. All the other cannot be changed. What interests me is to change the background color and font.

You can use TJvModernTabBarPainter and assign it to the JvTabBar. It allows you to modify all properties. The XP-Painter paints with the theming API and you can't change its colors unless you change the XP theming style system wide.

Related

How to set the application font at design time?

I've read that the most centralized way to have font-consistency through a project is to have all controls with the ParentFont property active and set the Application.DefaultFont at runtime.
I would like to apply a different font, say 'Segoe UI', in the whole application at design time.
How can it be changed at design time?
You have a number of options, what works best for you may depend on your situation.
If you are using your own forms (not from a package or library) then you can design each to inherit from a parent to give you a starting font as suggested in the comments. However the IDE will allow this to be changed, and if the DFM file for the form records a font in the derived form, it will use that font even if the parent class font is changed.
Another approach would be to write a non-visual component that you can drop onto a form. When that component has it's Owner set (at creation) it can check if it is owned by a Form and set the font on the parent. In the same way it can set any properties you want it to, and it can also find the children of it's owner and set any properties on those controls as well.
Moving on from this you could, at runtime, look at the TScreen class which contains properties called CustomForms and Forms which allow you to access all currently active descendents of TCustomForm and TForm respectively. As you can access this you could change the fonts on all of them at runtime. So if you allow your user to select a font, using the Screen object you can change the font on all forms.
The combination of the two can allow you to easily gain control over display properties.
Be aware that changing the font face can change the size of the text rendered. (As of course will changing the font size and style). This can affect how your controls look and the alignment of them.

Is it possible to change the color of a MaterialDesignIcon?

I use a MaterialDesignIcon in a label like this:
Label info = new Label("Label", MaterialDesignIcon.AC_UNIT.graphic("-fx-fill: red;"));
I don't know what CSS is supports (https://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html) but I thought it was Text. -fx-underline worked and so did -fx-font-size. I understand that other font properties don't always work because the font doesn't support them, so that's fine. None of the Shape properties worked so the above fill doesn't do anything.
I only see the colors change by the Swatch but I want something local. What CSS properties are supported and how can I change a single icon's color?
MaterialDesignIcon.graphic() creates an instance of Label. So to change its color you can use fx-text-fill: red.
To inspect your GUI you can use ScenicView

How to change color of the scrollbar in SynMemo with VCL styles

there. I changed style of standard objects with VCl-theme.
I use Color, Font and Gutter properties to change style of SynMemo. But I don't know, how change style of ScrollBar of SynEdit( apply vcl-theme ). Who can help me ?
To add styling support for the TSynEdit you must register a style hook for such control. Try using the TScrollingStyleHook style hook.
Like so
TStyleManager.Engine.RegisterStyleHook(TCustomSynEdit, TScrollingStyleHook);

How to change caption font color on TCheckBox, TRadioButton, TGroupBox?

I don't know what my problem is, but I cannot set the font color in DEx2 for controls like TCheckBox, TRadioButton, TGroubBox, and TRadioGroup. It doesn't matter if I do it in the IDE or programmatically.
I have set my form color to clBlack and want my captions to be clWhite, but they won't render any color but clBlack. When I assign a color on a form's OnShow event and step through it in the debugger, it shows the value I assigned it, but on the screen it is still black.
I am not using styles or anything else. Any ideas?
Here is a sample form:
white on black example http://www.skippix.us/temp/Delphi-Font-Problem.bmp
When you uses the windows themes in an application, most of the custom settings like the font colors are ignored. As workaround and depending of the component you can ownerdraw the control (only when this feature is supported), override the paint method in order to use your own color in the font (TRadioGroup, TGroupBox), and for components like TCheckBox and TRadioButton (which are WinAPI controls wrappers) you must intercept the WM_PAINT windows message and implement your own code to draw the control.
Also starting with Delphi-xe2 you can use the vcl styles which allow you to change the appearance of the controls, from here (and when is possible) you can modify the style hooks to apply your own font colors and other customizations.
A simple and easier workaround is to create a checkbox without caption and add a label after it. You can easily change the label's color. You can also create a new component that binds a label to the checkbox itself. That's what worked for me on Delphi 2007.
It will work under the following setting:
Project Options > Application > Runtime Themes = none

Styling a menubar item (Firemonkey)

I can't seem to figure out how to change the font of a tmenuitem object.
I add a menubar, and add a item to it.
I create a customstyle for the menuitem.
I can change the background color and stroke color etc,etc, but I can NOT change the font of the text part.
If I change the font (size or name or anything) it shows in the style editor but does not show in the form designer or at runtime.
Seems the font somehow default to something.
Has anyone else been able to do this ?
FireMonkey overwrites pretty much any settings you make for fonts (face, size, style) within a style. AFAIK any font changes you want to make have to be done at run time. In the case of a TMenuItem that means by setting the Font property manually after you have created the menu item.
However (and I've never played with this) I seen people saying they can change a font by setting the StyleLookup after a component has been created.
You might want to hook into the OnApplyStyleLookup event to make these updates.

Resources