#define DJ_DBG
#include "widgets.h"

InputTab::InputTab()
{
  GroupBoxWidget * textGroup = new GroupBoxWidget("Text Input");
  _text = new TextWidget;
  GroupBoxWidget * intGroup = new GroupBoxWidget("Integer Input");
  _int = new IntWidget;
  GroupBoxWidget * floatGroup = new GroupBoxWidget("Float Input");
  _float = new FloatWidget;
  
  VLayout * layout = new VLayout(this);
  layout->add(textGroup);
  layout->add(intGroup);
  layout->add(floatGroup);
  layout->stretchAdd();
  
  HLayout * groupLayout = new HLayout(textGroup);
  groupLayout->add(_text);
  groupLayout = new HLayout(intGroup);
  groupLayout->add(_int);
  groupLayout = new HLayout(floatGroup);
  groupLayout->add(_float);

  _text->sig().set(this, textCallback);
  _int->sig().set(this, intCallback);
  _float->sig().set(this, floatCallback);
}

void InputTab::textCallback(const Str & in)
  { djApp->print(Str("value = %1").arg(deflateStr(in))); }
void InputTab::intCallback(int in)
  { djApp->print(Str("value = %1").arg(deflateStr(in))); }
void InputTab::floatCallback(double in)
  { djApp->print(Str("value = %1").arg(deflateStr(in))); }
