Create A Custom Styled Firemonkey Component With The Delphi IDE

Simple Custom Styled Component Delphi FiremonkeyAndrea Magni has a blog post up that explains a simple method for creating a custom styled control using the Delphi IDE. This lets you bypass the Style Designer. The sample control that he builds is called TGmailLabel because it has a similar look and feel to an element from Gmail. The interesting thing here is that he builds the control that he wants on a normal FMX form and then does ‘View as Text’ on the form to get to the form objects as text. He then copies the form objects as text and puts them straight into a style file. Apparently form objects as text and style files have very similar formats. It looks like the component names are stripped out, any positioning of the main object is removed, and a StyleName line is added to each object. Here is a sample of the style below:

The example source code comes with the free TGmailLabel control so you get a free Delphi Firemonkey component too. The resulting component is cross platform and works on IOS, Android, OSX, and Windows. The blog is in Italian and the link auto translates it for you via Google Translate.

Check out the full blog post on how to build your own custom styled component.

Here is a mirror of the example source if the original goes down: Delphi Firemonkey GmailLabel Component

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Create A Custom Styled Firemonkey Component With The Delphi IDE by Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Firemonkey, Delphi Android, Delphi IOS is licensed under a Creative Commons Attribution 4.0 International License.

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Delphi Firemonkey Android Text To Speech TTS
Text To Speech (TTS) Wrapper For Android With Delphi XE5 Firemonkey

Embarcadero has a blog post from September 2013 that highlights a Text To Speech (TTS) unit that was created by...

Close