Modify styles

To modify the presentation styles of a generated Genero application, add a Genero presentation styles file (*.4st) to your BAM project.

The presentation styles are initially defined by a default Genero presentation styles file (dbapp.4st) located in the styles sub-directory of the template set directory.

To add a new, custom Genero presentation styles file:

  1. Select File > New.
    The Select an item dialog opens.
  2. Select either Genero BAM Desktop or Genero BAM Mobile, depending on what type of BAM application you are working with.
  3. Under the Resources section, select Styles (.4st).
    An untitled Genero presentation styles file with a .4st extension displays in the central workspace. This file is based on the default styles file for the selected template set.
  4. Modify the styles file by adding, modifying, or deleting style and style attributes.

    For details regarding the syntax of a Genero Styles file, see the Genero Business Development Language User Guide.

  5. Save the modified file to your project.
    Save the file to the Resources folder in your project and to the '$(ProjectDir)/resources' folder on disk. You can save using the default filename of the Genero presentation styles file for a generated app or you can specify a different name.

    The default filename expected for the Genero presentation styles file is dbapp.4st. If you use this default name, Genero Studio will ignore the template default and use your file at runtime.

    If you save your file using a different name, you must find the BLOCK in the generated code that calls the ui.Interface.loadStyles() method and change the parameter name to the name of your new file. This generated code is found in the application's MAIN module, and the filename can be defined using the l_style variable. For example, if your Genero presentation styles file is named myStyle.4st, you would add the following code to the MAIN module:
    {<POINT Name="MAIN.define" Status="MODIFIED">}
    LET l_style="myStyle"
    {</POINT>}
  6. To deploy to the GAS, you create a Genero archive file (*.gar). You must update the packaging rules to have your custom Genero presentation styles file (*.4st) included in the Genero archive.
    Package rules define what files are included in the Genero archive (*.gar). Under the Application_GAR package node, the Resources_dbapp and Resources packaging directories manage the packaging of the Genero presentation styles files (*.4st).
    • For the packaging directory Resources_dbapp, all Genero presentation styles files (*.4st) are copied from '$(GSTSETUPDIR)/styles' to '$(RootDir)'. This rule copies the template default dbapp.4st file to your package.
    • For the packaging directory Resources, all Genero presentation style files (*.4st) are copied from '$(ProjectDir)/resources' to '$(RootDir)'. This rule copies any Genero presentation style file you saved in '$(ProjectDir)/resources' to your package.
    If you used the default filename of dbapp.4st, you have two options.
    1. Exclude or update one of the packaging directories to keep only the dbapp.4st you want to package.
      For example, to only keep your customized dbapp.4st, you need to either exclude the Resources_dbapp packaging directory, or update the definition to exclude copying *.4st files. To exclude a packaging directory, select the Exclude from package property.
      If you simply exclude the packaging directory, it will exclude all template resource files, not just the Genero presentation styles file dbapp.4st
      This is the easier of the two methods.
    2. Package dbapp.4st in a directory other than '$(RootDir)' by changing the properties of the Resources packaging directory.
      For example, you could update the Destination directory property to specify that the presentation style resource file (*.4st) be moved from '$(ProjectDir)/resources' to '$(RootDir)/resources', then update your application configuration (.xcf) to include this new destination directory in its FGLRESOURCEPATH:
      <ENVIRONMENT_VARIABLE Id="FGLRESOURCEPATH" Concat="PREPEND">resources</ENVIRONMENT_VARIABLE>
      You would also update the Resources_dbapp packaging directory to ensure the the Include files property does not include the default presentation style resource file. You can simply remove "*.4st" from the included files list.
      This is the harder of the two methods. You can consider this option if you want to reflect the structure of the sources in the destination; however, it complicates the configuration and requires an update of the configuration file.
    If you used a filename other than the default (dbapp.4st), your next steps will depend on whether you saved your file in the recommended '$(ProjectDir)/resources' directory or an alternate directory.
    1. If you saved your file in the recommended '$(ProjectDir)/resources' directory, there is no need to create or modify any packaging directory node. The defaults for the Resources packaging directory ensures that your custom Genero presentation styles file is copied to the package.
    2. If you saved your file in a different directory than '$(ProjectDir)/resources' , add a new packaging directory node, where you will:
      • Set the Source directory property to the directory containing your Genero presentation styles file.
      • Set the Include files property to include "*.4st"; you can be specific and include only your custom filename.
      • Set the Destination directory property to '$(RootDir)'.