Classes:TabControl
From XfireWiki
A TabControl component is the most versatile class available to a component (in terms of programming capability). It allows only 1 of its child tile to be displayed at a time, giving the appearance of switching tabs. This class is used to handle the changing of buttons and views in the Xfire Main Window, but could be used to implement very creative and unique Skin GUI's.
Contents |
Example Code
Component implementation:
|
<Component Name="TabbedControl"
/> |
Tile implemntation (within a window XML file). At first only the first child tile (BuddyView) and its children will be displayed.
|
<Tile Name="TabbedControl" X="7" Z="10" Y="Divider.BOTTOM" IndentTop="TabHeader.height" IndentBottom="BottomBevel.height-8" IndentRight="6" ResizeX="100" ResizeY="100" Component="TabbedControl">
</Tile> |
Attribute definitions
Stretch: The same as the tile stretch attribute. It is recommended that you leave it as ToContent or else you may run into difficulties getting the child tiles to display.
ControlGroupId: A unique id for the TabControl. This id will be used within the components that control the switching of children displayed (See Control Buttons).
Control Buttons
You can set a component to control the child tile that is displayed by setting the components GroupId attribute to the ControlGroupId of the TabControl. These components are usually PushButtons. You must also specify a trigger in the controlling component that sends the command GroupMessage(n), where n is the number of the child tile to display.
For example, in the above code Example sending a trigger of GroupMessage(0) would display the BuddyView Tile, GroupMessage(1) would display the ServerView and GroupMessage(2) would display the DownloadView.
If your using a PushButton to control the TabControl you may also want to set the PushType attribute of the component to "Sticky" and the button which controls the display of the first child tile (GroupMessage(0)) should also have the attribute Default set to "lbtndown" (see PushButton for more details).
Other Notes
A component with the class of TabControl can be used in multiple tiles and will all change the Child Tile displayed when a GroupMessage is sent by a controlling component. The Xfire Main Window uses the same TabControl component to switch the views and buttons (add,chat,join,profile,etc.) from one control button.
