waba.ui
Class TabBar

waba.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
 


Fields inherited from class waba.ui.Container
children, tail
 
Fields inherited from class waba.ui.Control
height, next, parent, prev, width, x, y
 
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.Container
findChild, paintChildren, remove
 
Methods inherited from class waba.ui.Control
addTimer, contains, createGraphics, getFontMetrics, getNext, getParent, getRect, postEvent, removeTimer, repaint, setRect
 
Methods inherited from class waba.lang.Object
toString
 

Constructor Detail

TabBar

public TabBar()
Constructs a tab bar control.
Method Detail

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