Statics Sample
This sample is located in \Samples\afc11\Statics.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
Description
This sample shows the various ways you can position and combine AFC's static controls. The sample displays a panel that contains the following components:
- Two panels (Static Components and Other Statics) that contain options for selecting different types of static controls.
- The Image Placement control, activated when a UIItem (both image and text) is displayed, allows you to change the placement of the image relative to the text.
- The Alignment control allows you to change the orientation of the displayed static control.
- The image display area on the right shows the results of the selected options.
Using the Sample
To use the sample
You can manipulate the sample's components by performing the following actions:
- The default static control displayed is a UIItem control (an image and text combination static). Clicking the UIText radio button option in the Static Components group replaces the image and text combination with text only. Clicking UIGraphic replaces the text with an image static control.
- Displaying a UIItem (both image and text) activates the Image Placement group. Selecting either of the image placement options allows you to change the placement of the image relative to the text.
- Select one of the points of the compass in the Alignment group to see the possible orientations of the static control displayed. By moving the mouse over the compass image, you can adjust the corresponding orientation of the control more smoothly.
- Selecting and clearing the options under Other Statics causes these controls to appear and disappear in the display area. All these options are selected by default.
- UIGroup provides the border and text around the image display area. Clearing UIGroup removes this border and text.
- UIDrawText provides static, non-editable text. Clearing UIDrawText removes the text beneath the image area titled An Epic Tale.
- UIStatus displays the ship's position. Clearing UIStatus removes the status panel at the bottom of the display area.
Key Project Files
SDKCtrlPnl.java
This class extends UIPanel and implements SDKConsts and SDKCallbacks. It creates all the basic user interface items and contains the switch-case-break code that re-positions the image according to user input and displays or removes text and other controls.
Technologies Demonstrated
AFC
- This sample shows how to use AFC classes to create and manipulate various types of static controls.
© 1999 Microsoft Corporation. All rights reserved. Terms of use.