Bands and Menus Sample
This sample is located in \Samples\afc11\BandsnMenus.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
Description
This sample shows how to use AFC graphics and effects classes to create and manipulate bands, buttons, menus, and scrollable viewers.
The sample displays a panel that contains the following components:
- The band box control contains three bands. Each band contains a header that is the name of a planet (Venus, Earth, Mars), a button, and a menu of options for the associated planet. The Earth band also contains a Geology button and menu.
- The Information area displays information about the item currently selected in the band box. By default, this viewer displays information about the planet Venus.
You can experiment with the various controls by selecting menu buttons and options and repositioning the bands within the band box.
Using the Sample
To use the sample
You can manipulate the panel's components by performing the following actions:
- Click the Venus button to display a small drop-down menu with a Planet Information option. Selecting this option displays information about Venus in the viewer. This option is the default selection in the sample.
- Click and drag the slider to the left of the Earth header to bring that band into view and place it next to the Venus button. Clicking the Earth button also displays a small drop-down menu with a Planet Information option. Clicking this option displays information about Earth in the viewer.
- Click the Geology button to display a menu containing multiple options that reflect the geological periods of the Earth. Passing a mouse over options that are followed by static arrows displays subsidiary menus with more options.
- Click the slider to the left of the Mars button to drag it to the top band and back to the bottom again. Click the slider to the left of the Earth button to drag and release it beneath the planet Venus; this gives each band a row of its own. As the screen space available to the display area below is reduced, its ScrollViewer properties become apparent: a scroll bar automatically appears on its right.
- In addition to dragging bands by the slider, clicking a band's header ensures that the band is fully visible.
Key Project Files
SDKCtrlPnl.java
This class implements a container for multiple components. It extends com.ms.ui.UIPanel with the action setInitialFocus and getInsets methods to create menus and initialize the applet.
SDKConsts.java
This interface defines arrays of graphics and the text that is displayed upon menu selection.
Technologies Demonstrated
AFC
- This sample shows how to use AFC graphics and effects classes to create and manipulate bands, buttons, menus, and scrollable viewers.
© 1999 Microsoft Corporation. All rights reserved. Terms of use.