waba.ui
Class TabBar
java.lang.Object
|
+--waba.ui.Control
|
+--waba.ui.Container
|
+--waba.ui.TabBar
- public class TabBar
- extends Container
TabBar is a bar of tabs.
Here is an example showing a tab bar being used:
public class MyProgram extends MainWindow
{
Tab tabOne;
Tab tabTwo;
public void onStart()
{
TabBar tabBarar = new TabBar();
tabOne = new Tab("One");
tabBar.add(tabOne);
tabTwo = new Tab("Two");
tabBar.add(tabTwo);
tabBar.setRect(10, 10, 80, 30);
add(tabBar);
}
public void onEvent(Event event)
{
if (event.type == ControlEvent.PRESSED &&
event.target == tabOne)
{
... handle tab one being pressed
Constructor Summary |
TabBar()
Constructs a tab bar control. |
Method Summary |
void |
add(Control control)
Adds a tab to the tab bar. |
void |
onEvent(Event event)
Called by the system to pass events to the tab bar control. |
void |
onPaint(Graphics g)
Called by the system to draw the tab bar. |
void |
setActiveTab(Tab tab)
Sets the currently active tab. |
Methods inherited from class waba.ui.Control |
addTimer,
contains,
createGraphics,
getFontMetrics,
getNext,
getParent,
getRect,
postEvent,
removeTimer,
repaint,
setRect |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
TabBar
public TabBar()
- Constructs a tab bar control.
add
public void add(Control control)
- Adds a tab to the tab bar.
- Overrides:
- add in class Container
setActiveTab
public void setActiveTab(Tab tab)
- Sets the currently active tab. A PRESSED event will be posted to
the given tab if it is not the currently active tab.
onEvent
public void onEvent(Event event)
- Called by the system to pass events to the tab bar control.
- Overrides:
- onEvent in class Control
- Tags copied from class: Control
- Parameters:
event
- the event to process- See Also:
Event
,
KeyEvent
,
PenEvent
onPaint
public void onPaint(Graphics g)
- Called by the system to draw the tab bar.
- Overrides:
- onPaint in class Control
- Tags copied from class: Control
- Parameters:
g
- the graphics object for drawing- See Also:
Graphics