17. Usefull hints for working with styles
17.Hilfreiche Hinweise zur Arbeit mit Styles

Video Link: https://youtu.be/EUdlE-dsaIo (Code Rage 2019)

GERMAN

Fragen

1. Wo befinden sich die Stile auf meinem Computer?
2. Woher bekomme ich andere Styles?
3. Wie kann ich Stile anzeigen?
4. Wie kann ich VCL-Styles in FMX-Styles konvertieren?
5. Wie ordne ich dem Programm einen Stil zu?
6. Wie verwende ich einen anderen Stil pro Plattform?
 

English

Questions:

1. Where are the styles on my computer?
2. Where can I get other styles from?
3. How can I view styles?
4. How can I convert VCL-Styles to FMX-Styles?
5. How do I assign a style to the program?
6. How to use a different style per platform?

 

1. Wo befinden sich die Stile auf meinem Computer?

Sie können diese hier finden:

C:\Users\public\documents\Embarcadero\20.0\Styles

The base-set you find also in the installation folder:

C:\Program Files(x86)\Embarcadero\Studio\20.0\Redist\Styles

1. Where are the styles on my computer?


You can find them in:

C:\Users\public\documents\Embarcadero\20.0\Styles

The base-set you find also in the installation folder:

C:\Program Files(x86)\Embarcadero\Studio\20.0\Redist\Styles

 

2. Woher bekomme ich andere Styles?

- Verwenden Sie Get-It, Option "Styles"

- Kaufen Sie Styles von einem Dritthersteller, z.B.:
  www.delphistyles.com

 

2. Where can I get other styles from?

- Use Get-It, Option "Styles"

- Buy it form 3RD-Party resseller, eg.:
  www.delphistyles.com

 

3. Wie kann ich Stile anzeigen?

Sie können die mit Delphi gelieferten Programme verwenden:

- FMXStyleViewer.exe
- VCLStyleViewer.exe

Sie finden diese Programm im bin- Installationsordner von Delphi:

C:\Program Files (x86)\Embarcadero\Studio\20.0\bin
 

3. How can I view styles?

You can use the with Delphi delivered programms:

- FMXStyleViewer.exe
- VCLStyleViewer.exe

You find the programs in the bin-folder of your Delphi installation:

C:\Program Files (x86)\Embarcadero\Studio\20.0\bin
 

 

4. Wie kann ich VCL-Styles in FMX-Styles konvertieren?

Öffnen Sie eine ".vsf" -Datei im "Bitmap-Stil-Designer" (Sie finden das Programm über das Menü "Tools" in Delphi) und wählen Sie danach "Speichern unter" und als Datei-Typ ".style".

4. How can I convert VCL-Styles to FMX-Styles?

Open a '.vsf' file in the "Bitmap-Stildesigner" (you will find this program under menu "Tools" in Delphi" and choose "Save As" and select ".style" as file-type.
 

 
5. Wie ordne ich dem Programm einen Stil zu?

Fügen Sie ein Stylebook in das Hauptformular ein und weisen Sie der Formulareigenschaft "Stylebook" Ihr StyleBook  zu. Doppelklicken Sie dann auf das Stylebook, klicken Sie im Style Designer auf die Schaltfläche "Open Folder" und wählen Sie die Style-Datei (* .style) und schließen Sie den Style-Desinger (und sagen Sie "Ja", um die Änderungen zu übernehmen).
5. How do I assign a style to the program?

Put a Stylebook on the main form, assign the form-properts "Stylebook" to your StyleBook. Then Doubleclick on the Stylebook, in the Style Designer klick the "Open Folder" Button and select the Stylefile (*.style) and close the Style Desinger (and say yes to take the changes).

 
6. Wie verwende ich einen anderen Stil pro Plattform?

1. Sie können den TStyleManager verwenden (Sie müssen die Unit "FMX.Styles" hinzufügen) und die benötigten Style-Dateien zur Laufzeit laden, z.B bei der Erstellung des Formulars. Bei dieser Lösung müssen Sie jedoch mit den verschiedenen Dateien und Orten umgehen, an denen sie auf den Betriebssystemen gespeichert werden sollen (z.B. unter MacOS sollte sie sich im Ordner "resources" befinden, unter Windows können Sie sie im Programmordner ablegen.

Sie müssen im Deployment-Manager die richtige Auswahl für die verschiedenen Optionen (Debug, Release, Store usw.) treffen.

2. Deshalb gibt es hier eine andere Methode, mit der Sie schnell und einfach die gewünschten Ergebnisse erzielen können:

* Fügen Sie Ihrem Programm 3 Datenmodule hinzu. Prüfen Sie unter Projekte, Formulare, dass diese nicht automatisch erstellt werden.

* Auf jedem Datenmodul legen Sie ein Stylebookd und aktivieren für alle die Option "UseStyleManager" (wichtig, damit alle Formulare gestylt werden).

* Fügen Sie im Erstellungsereignis in Ihrem Hauptformular den folgenden Code hinzu:

6. How to use a different style per platform?


1. You can use the TStyleManager (your have to add the unit "FMX.Styles") and load the needed Style-files at runtime, eg. at the creation of the form. But with this solution you have to handle with the different files and locations where it should be saved on the OS-Systems (eg. under MacOS it should be in the "resources" folder, on Windows you can place it in the programfolder.

You have to make the right selections in the Deployment-Manager for the different Options (Debug, Release, Store and so on).

2. Therefore here is an other method how you can get fast and easy the wanted results:

* Add 3 Datamodules to your programm. Check under Projects, formulars, that they are not created automaticlly.

* On each Datamodule you put a Stylebookd and activate for all the option "UseStyleManager" (important, so that all forms are styled).

*In the creation event on your main form add the following code:

 

// UseSTyleManager works only once and only when it is set by design time
// 3 Stylebooks on the same form and with "UseStyleManager" activated will crash the program

{$IFDEF MSWindows}
   DataModuleWin := TDataModuleWin.Create(self);
{$ENDIF}

{$IFDEF MACOS}
   DataModuleMac := TDataModuleMac.Create(self);
{$ENDIF}

{$IFDEF LINUX}
   DataModuleLinux := TDataModuleLinux.Create(self);
{$ENDIF}

 
Mehr Video zu styles More videos about styles
For XE3/XE4
Firmonkey Bitmap Styles bearbeiten (german)
https://www.youtube.com/watch?v=LclDKqrj5So

XE5 (or newer)
Farbe eines TPanels unter FMX ändern
https://www.youtube.com/watch?v=ri933tgWe04

For XE5/XE7
FireMonkey Bitmap Styles bearbeiten Teil2 (mit Delphi XE5/XE6)
https://www.youtube.com/watch?v=gcMPZQiVR-w

For Delphi 10.x
Einen geänderten Stil auf Windows 7,8 und 10 anzeigen
https://www.youtube.com/watch?v=n9KBc72eH4s

Alle Videos (Channel-Übersicht: https://www.youtube.com/channel/UCiUVNZgsZZhziFL4oy-evEA)

 

 
Mehr Informationen über Styles finden Sie auch in meinem FMX-Buch (Kapitel 2, Abschnit 5).

 

More information about styles you'll find also in my FMX-Book (II, 5).
An optimal management with style-files you can do with the IDE-Manager, part of the

    Pascal Project Manager & Editor :