Lists Sample
This sample is located in \Samples\afc11\Lists.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
Description
This sample shows how to use the various list types and selection options provided by AFC's UIList controls. The sample displays a panel that contains the following components:
- The List Type control provides options for selecting different types of lists.
- The Selection Types control provides options for selecting items in the UIListSample area.
- The UIListSample area displays the results of the list types selected and provides status information. This area can be used to test the different Selection Types.
The default list type is a Multi Column UIList that displays two columns of animation frames in the UIListSample area. When an item is selected, the item's status appears at the bottom of the panel. The default Selection Type is Single, which allows only single items to be selected.
Using the Sample
To use the sample
You can manipulate the sample's components by performing the following actions:
- The three selection types (SINGLE, MULTI, EXTEND) can be applied to any list type.
- If you choose MULTI, you can select multiple items in the list. Changing the selection type updates the status bar to reflect the number of items selected.
- If you choose EXTEND, you can use the SHIFT or CTRL keys to select multiple items in a block (SHIFT) or in an irregular pattern (CTRL). You can also use the keyboard to select items. For example, you can hold down SHIFT and then move the arrow keys. The status bar changes to reflect the number of items selected.
- Select the UIChoice list type to display a UIChoice control in the UIListSample area. Clicking the drop-down arrow displays a list of animation frames. The globe changes when a frame is selected and will animate smoothly if the mouse is passed over the list of frames. If a list of items is too large to fit in the available screen space, it will automatically appear in a scroll viewer. You can then use the scroll bar to move through the full list of items.
- Selecting the UITree list type displays an expanding tree with custom items that represent geological eras, periods, and epochs of the Earth. Clicking the plus signs expands the tree and clicking the minus signs collapses the tree. The status bar now displays the item in the tree that is selected, plus the duration of the geological period. As the UITree expands and fills its available space, the scrollable viewer automatically appears. The SINGLE, MULTI, and EXTEND selection options can be used as before.
Key Project Files
TreePanel.java
This class extends UIPanel and implements SDKConsts. It displays the list types and status information about the selected list items.
ChoicePanel.java
This class extends UIPanel and implements SDKConsts. It controls the list types that can be displayed in the right pane.
ListPanel.java
This class extends UIPanel and implements SDKConsts. It controls the selection modes that can be used in the right pane.
Technologies Demonstrated
AFC
- This sample shows how to use the various list types and selection options provided by AFC's UIList controls.
© 1999 Microsoft Corporation. All rights reserved. Terms of use.