#define DJ_DBG
#include "widgets.h"

ButtonTab::ButtonTab()
{
  GroupBoxWidget * pushGroup = new GroupBoxWidget("Push Button");
  _push = new PushButtonWidget("Push");
  GroupBoxWidget * checkGroup = new GroupBoxWidget("Check Button");
  _check = new CheckButtonWidget("Check");
  GroupBoxWidget * toolGroup = new GroupBoxWidget("Tool Buttons");
  _tools[0] = new ToolButtonWidget("toolLeft");
  _tools[1] = new ToolButtonWidget("toolRight");
  _tools[2] = new ToolButtonWidget("toolUp");
  _tools[3] = new ToolButtonWidget("toolDown");
  _tools[4] = new ToolButtonWidget("toolX");
  _tools[5] = new ToolButtonWidget("toolLock");
  
  VLayout * layout = new VLayout(this);
  layout->add(pushGroup);
  layout->add(checkGroup);
  layout->add(toolGroup);
  layout->stretchAdd();
  
  HLayout * groupLayout = new HLayout(pushGroup);
  groupLayout->add(_push);
  groupLayout = new HLayout(checkGroup);
  groupLayout->add(_check);
  groupLayout = new HLayout(toolGroup);
  groupLayout->add(_tools[0]);
  groupLayout->add(_tools[1]);
  groupLayout->add(_tools[2]);
  groupLayout->add(_tools[3]);
  groupLayout->add(_tools[4]);
  groupLayout->add(_tools[5]);
  
  _push->sig().set(this, pushCallback);
  _check->sig().set(this, checkCallback);
}

void ButtonTab::pushCallback(bool in)
  { djApp->print(Str("value = %1").arg(deflateStr(in))); }
void ButtonTab::checkCallback(bool in)
  { djApp->print(Str("value = %1").arg(deflateStr(in))); }
