PSM Studio Integration

This section describes the points to consider when using a file output by the UI Composer in a PSM Studio project.

Project Configuration of an Application

Add the source files output by the UI Composer (files with * indicated below) and the added image asset files (files with **) to SampleApp.csproj and carry out build.:

SampleApp/
          SampleApp.csproj

          SampleApp.uic
          SampleApp_LanguageTable.csv

          AppMain.cs

          SampleA.cs
          SampleB.cs
          SampleC.cs

          SampleScene.cs             *
          SampleScene.composer.cs    *
          SamplePanel.cs             *
          SamplePanel.composer.cs    *
          SampleDialog.cs            *
          SampleDialog.composer.cs   *

          UIStringTable.cs           *

          assets/
                 AAA.png             **
                 BBB.png             **

Class Definition Files

The UI Composer automatically generates class definitions for each "screen" laid out by the user. A class is generated automatically as a partial class divided into xxx.composer.cs and xxx.cs.

  • xxx.composer.cs defines the method for setting the layout information (X-Y coordinates) of the positioned widgets and the property settings. It is continually overwritten.
  • xxx.cs defines the class constructor and describes the initialization method call defined in xxx.composer.cs. This will not be generated if it already exists.

For example, when two "screens" are laid out, the following files are output.

  • SampleScene.composer.cs: Layout definition
  • SampleScene.cs: Event handler and logic implementation file
  • SamplePanel.composer.cs: Layout definition
  • SamplePanel.cs: Event handler and logic implementation file
  • UIStringTable.cs: String table for displaying strings according to the "screen" for each language

Loading the output .cs files to a PSM Studio project enables the use of operations performed on the UI Composer. Note that if the "screen" layout is adjusted on the UI Composer, SampleScene.cs and SamplePanel.cs will not be overwritten, but xxx.composer.cs will always be overwritten. Editing this file is not recommended. Implement the event handler to xxxxx.cs. Also, if xxxxx.cs already exists, this file will not be overwritten; to change the namespace midway, the xxxxx.cs namespace must be changed manually.

Image Asset Files

The image asset file used by the UI Composer must be registered as a "content" to the PSM Studio project.

  • Registering the Image Asset File
    • First, open the solution file on PSM Studio.
    • On the solution panel, right-click the target project and select [Add] > [AddExisitingFolder...].
    • On the folder selecting dialog, select the assets folder and [Open].
    • On the file selecting dialog, select the image asset file.
    • Right-click the image asset file added to the solution panel and select [Build Action] > [Content]. (For a png file, the build action will be set as the content by default.)