Constraint-Based Layout and FA_* Values

For many applications, you must create a resource file and use resource type definitions to specify such elements as controls, menus, and string tables. Typically, you specify the coordinates for the dimensions and placement of a control or other resource. In addition to this method, Auto PC provides a constraint-based layout for use with controls and dialog boxes. With constraint-based layout, you only have to specify a predefined FA_* value. The Auto PC uses this value to supply the coordinates based on the control’s relationship to either the parent form or another control. The result is a flexible alternative to specifically defining the size and location of a resource.

    To use constraints

  1. Specify the constraints in a resource file, and use the IfmManage::LoadFormResource interface to load the file.

    Note If you are defining a dialog box, use the DIALOGEX resource type.

  2. Create and start your form before calling LoadFormResource, so the layout engine can get a device context (DC) for the display device.