Example #1
0
/** void HBoxLayout::addWidget(QWidget *widget, int stretch=0, int alignment=0)
 * include/mimas/HBoxLayout.h:54
 */
static int HBoxLayout_addWidget(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      QWidget *widget = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
      int stretch = dub_checkint(L, 3);
      int alignment = dub_checkint(L, 4);
      self->addWidget(widget, stretch, alignment);
      return 0;
    } else if (top__ >= 3) {
      QWidget *widget = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
      int stretch = dub_checkint(L, 3);
      self->addWidget(widget, stretch);
      return 0;
    } else {
      QWidget *widget = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
      self->addWidget(widget);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "addWidget: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "addWidget: Unknown exception");
  }
  return dub_error(L);
}
Example #2
0
ILXStatusBar::ILXStatusBar(int argc, char* argv[])
        : Application(&argc, &argv, (AppOptions) (OptDaleAuto))
{
    setBackgroundImage(ILIXI_DATADIR"car/statusbar/statusbar_bg.png");

    setMargins(0, 0, 0, 0);
    HBoxLayout* mainLayout = new HBoxLayout();
    mainLayout->setVerticalAlignment(Alignment::Middle);
    mainLayout->setSpacing(0);
    setLayout(mainLayout);

    _home = new StatusbarButton();
    _home->addImage(new Image(ILIXI_DATADIR"car/statusbar/home.png", Size(48, 48)));
    _home->addImage(new Image(ILIXI_DATADIR"car/statusbar/homeG.png", Size(48, 48)));
    _home->setActive(1);
    _home->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedHome));
    addWidget(_home);

    _switch = new StatusbarButton();
    _switch->addImage(new Image(ILIXI_DATADIR"car/statusbar/switch.png", Size(48, 48)));
    _switch->addImage(new Image(ILIXI_DATADIR"car/statusbar/switchG.png", Size(48, 48)));
    _switch->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedSwitcher));
    addWidget(_switch);

    _dash = new StatusbarButton();
    _dash->addImage(new Image(ILIXI_DATADIR"car/statusbar/dash.png", Size(48, 48)));
    _dash->addImage(new Image(ILIXI_DATADIR"car/statusbar/dashG.png", Size(48, 48)));
    _dash->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedDash));
    addWidget(_dash);

    _sound = new StatusbarButton();
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol0.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol0G.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol1.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol1G.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol2.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol2G.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol3.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol3G.png", Size(48, 48)));
    _sound->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedSound));
    _sound->setButtonState(6);
    addWidget(_sound);

    _back = new StatusbarButton();
    _back->setVisible(false);
    _back->addImage(new Image(ILIXI_DATADIR"car/statusbar/back0.png", Size(48, 48)));
    _back->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedBack));
    addWidget(_back);

    addWidget(new Clock());

    _rca = new RemoteContentArea();
    addWidget(_rca);

    sigVisible.connect(sigc::mem_fun(this, &ILXStatusBar::onShow));
    sigHidden.connect(sigc::mem_fun(this, &ILXStatusBar::onHide));

    _statComp = new StatusbarComponent(this);

}
Example #3
0
/** QVariant QObject::property(const char *name)
 * bind/QObject.h:9
 */
static int HBoxLayout_property(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    const char *name = dub_checkstring(L, 2);
    return pushVariantInLua(L, self->property(name));
  } catch (std::exception &e) {
    lua_pushfstring(L, "property: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "property: Unknown exception");
  }
  return dub_error(L);
}
Example #4
0
/** void QLayout::activate()
 * bind/QLayout.h:12
 */
static int HBoxLayout_activate(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    self->activate();
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "activate: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "activate: Unknown exception");
  }
  return dub_error(L);
}
Example #5
0
/** QString QObject::objectName() const
 * bind/QObject.h:7
 */
static int HBoxLayout_objectName(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    QByteArray str_(self->objectName().toUtf8());
    lua_pushlstring(L, str_.constData(), str_.size());
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "objectName: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "objectName: Unknown exception");
  }
  return dub_error(L);
}
Example #6
0
/** void QObject::setParent(QObject *parent)
 * bind/QObject.h:11
 */
static int HBoxLayout_setParent(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    QObject *parent = *((QObject **)dub_checksdata(L, 2, "mimas.QObject"));
    self->setParent(parent);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setParent: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setParent: Unknown exception");
  }
  return dub_error(L);
}
Example #7
0
/** void QBoxLayout::setSpacing(int space)
 * bind/QBoxLayout.h:19
 */
static int HBoxLayout_setSpacing(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int space = dub_checkint(L, 2);
    self->setSpacing(space);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setSpacing: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setSpacing: Unknown exception");
  }
  return dub_error(L);
}
Example #8
0
/** LuaStackSize QLayout::minimumSize(lua_State *L)
 * bind/QLayout.h:14
 */
static int HBoxLayout_minimumSize(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    QSize s(self->minimumSize());
    lua_pushnumber(L, s.width());
    lua_pushnumber(L, s.height());
    return 2;
  } catch (std::exception &e) {
    lua_pushfstring(L, "minimumSize: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "minimumSize: Unknown exception");
  }
  return dub_error(L);
}
Example #9
0
/** bool QLayout::setAlignment(QWidget *w, int alignment)
 * bind/QLayout.h:13
 */
static int HBoxLayout_setAlignment(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    QWidget *w = *((QWidget **)dub_checksdata(L, 2, "mimas.QWidget"));
    int alignment = dub_checkint(L, 3);
    lua_pushboolean(L, self->setAlignment(w, (Qt::Alignment)alignment));
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setAlignment: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setAlignment: Unknown exception");
  }
  return dub_error(L);
}
Example #10
0
/** bool QObject::setProperty(const char *name, const QVariant &value)
 * bind/QObject.h:10
 */
static int HBoxLayout_setProperty(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    const char *name = dub_checkstring(L, 2);
    QVariant value(variantFromLua(L, 3));
    lua_pushboolean(L, self->setProperty(name, value));
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setProperty: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setProperty: Unknown exception");
  }
  return dub_error(L);
}
Example #11
0
LayoutBase*
WidgetsDemo::createLabelGroup()
{
    HBoxLayout* group = new HBoxLayout();

    Label* label1 = new Label("This is a Label");
    group->addWidget(label1);

    Label* label2 = new Label("This is a disabled Label");
    label2->setDisabled();
    group->addWidget(label2);

    return group;
}
Example #12
0
/** QObject* QObject::parent()
 * bind/QObject.h:12
 */
static int HBoxLayout_parent(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    QObject *retval__ = self->parent();
    if (!retval__) return 0;
    dub_pushudata(L, retval__, "mimas.QObject", false);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "parent: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "parent: Unknown exception");
  }
  return dub_error(L);
}
Example #13
0
/** void QObject::setObjectName(const QString &name)
 * bind/QObject.h:8
 */
static int HBoxLayout_setObjectName(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    size_t name_sz_;
    const char *name = dub_checklstring(L, 2, &name_sz_);
    
    self->setObjectName(QString::fromUtf8(name, name_sz_));
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setObjectName: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setObjectName: Unknown exception");
  }
  return dub_error(L);
}
Example #14
0
/** void QLayout::setContentsMargins(int left, int top, int right, int bottom)
 * bind/QLayout.h:15
 */
static int HBoxLayout_setContentsMargins(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int left = dub_checkint(L, 2);
    int top = dub_checkint(L, 3);
    int right = dub_checkint(L, 4);
    int bottom = dub_checkint(L, 5);
    self->setContentsMargins(left, top, right, bottom);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setContentsMargins: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setContentsMargins: Unknown exception");
  }
  return dub_error(L);
}
Example #15
0
/** void QBoxLayout::addStretch(int stretch=0)
 * bind/QBoxLayout.h:11
 */
static int HBoxLayout_addStretch(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      int stretch = dub_checkint(L, 2);
      self->addStretch(stretch);
      return 0;
    } else {
      self->addStretch();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "addStretch: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "addStretch: Unknown exception");
  }
  return dub_error(L);
}
Example #16
0
LayoutBase*
WidgetsDemo::createPBGroup()
{
    HBoxLayout* group = new HBoxLayout();

    PushButton* pb1 = new PushButton("PushButton");
    group->addWidget(pb1);

    PushButton* pb2 = new PushButton("PushButton Disabled");
    pb2->setDisabled();
    group->addWidget(pb2);

    PushButton* pb3 = new PushButton("OK");
    pb3->setPushButtonStyle(OK);
    group->addWidget(pb3);

    PushButton* pb4 = new PushButton("CANCEL");
    pb4->setPushButtonStyle(CANCEL);
    group->addWidget(pb4);

    return group;
}
Example #17
0
/** void HBoxLayout::insertLayout(int pos, QLayout *layout, int stretch=0)
 * include/mimas/HBoxLayout.h:72
 */
static int HBoxLayout_insertLayout(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      int pos = dub_checkint(L, 2);
      QLayout *layout = *((QLayout **)dub_checksdata(L, 3, "mimas.QLayout"));
      int stretch = dub_checkint(L, 4);
      self->insertLayout(pos, layout, stretch);
      return 0;
    } else {
      int pos = dub_checkint(L, 2);
      QLayout *layout = *((QLayout **)dub_checksdata(L, 3, "mimas.QLayout"));
      self->insertLayout(pos, layout);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "insertLayout: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "insertLayout: Unknown exception");
  }
  return dub_error(L);
}
Example #18
0
ilixi::LayoutBase*
WidgetsDemo::createTBGroup()
{
    HBoxLayout* group = new HBoxLayout();

    ToolButton* tb1 = new ToolButton("ToolButton");
    tb1->setToolButtonStyle(ToolButton::IconBelowText);
    tb1->setIcon(ILIXI_DATADIR"images/default.png");
    tb1->setCheckable(true);
    group->addWidget(tb1);

    ToolButton* tb2 = new ToolButton("IconAboveText");
    tb2->setToolButtonStyle(ToolButton::IconAboveText);
    tb2->setIcon(ILIXI_DATADIR"images/default.png");
    tb2->setCheckable(true);
    group->addWidget(tb2);

    ToolButton* tb3 = new ToolButton("Text");
    tb3->setToolButtonStyle(ToolButton::IconBeforeText);
    tb3->setIcon(ILIXI_DATADIR"images/default.png");
    tb3->setCheckable(true);
    group->addWidget(tb3);

    ToolButton* tb4 = new ToolButton("IconOnly");
    tb4->setToolButtonStyle(ToolButton::IconOnly);
    tb4->setIcon(ILIXI_DATADIR"images/default.png");
    tb4->setCheckable(true);
    group->addWidget(tb4);

    ToolButton* tb5 = new ToolButton("TextOnly");
    tb5->setToolButtonStyle(ToolButton::TextOnly);
    tb5->setIcon(ILIXI_DATADIR"images/default.png");
    tb5->setCheckable(true);
    group->addWidget(tb5);

    ToolButton* tb6 = new ToolButton("Disabled");
    tb6->setChecked(true);
    tb6->setCheckable(true);
    tb6->setDisabled();
    group->addWidget(tb6);

    return group;
}
Example #19
0
ILXSoundMixer::ILXSoundMixer(int argc, char* argv[])
        : Application(&argc, &argv, AppOptions(OptDaleAuto | OptSound)),
          _soundComponent(NULL),
          _music(NULL),
          _bandSliderFont(NULL)
{
    setMargin(20);
    setLayout(new VBoxLayout());

    _bandSliderFont = new Font("Sans", 8);

    HBoxLayout* volStuff = new HBoxLayout();
    addWidget(volStuff);
    TabPanel* panel = new TabPanel();
    volStuff->addWidget(panel);

    //**********
    HBoxLayout* volHBox = new HBoxLayout();
    panel->addTab(volHBox, "Volume Control");

    GridLayout* volGrid = new GridLayout(8, 3);
    volHBox->addWidget(volGrid);
    volGrid->addWidget(new Label("Master Volume:"), 0, 0, 0, 3);

    _masterVolume = new Slider();
    _masterVolume->setRange(0, 1);
    _masterVolume->setValue(SoundDFB::getMasterVolume());
    _masterVolume->setStep(0.1);
    _masterVolume->setPageStep(0.2);
    _masterVolume->setUpdateMode(Slider::UponRelease);
    _masterVolume->sigValueChanged.connect(sigc::mem_fun(this, &ILXSoundMixer::changeMasterVolume));
    volGrid->addWidget(_masterVolume, 1, 0, 0, 2);

    _mute = new PushButton("Mute");
    _mute->setXConstraint(FixedConstraint);
    volGrid->addWidget(_mute, 1, 2);
    _mute->sigClicked.connect(sigc::mem_fun(this, &ILXSoundMixer::mute));

    volGrid->addWidget(new Label("Sound Effects:"), 2, 0, 0, 3);
    _effectsVolume = new Slider();
    _effectsVolume->setRange(0, 1);
    _effectsVolume->setValue(1);
    _effectsVolume->setStep(0.1);
    _effectsVolume->setPageStep(0.2);
    _effectsVolume->setUpdateMode(Slider::UponRelease);
    _effectsVolume->sigValueChanged.connect(sigc::mem_fun(this, &ILXSoundMixer::changeEffectsVolume));
    volGrid->addWidget(_effectsVolume, 3, 0, 0, 2);

    volGrid->addWidget(new Label("Balance:"), 4, 0, 0, 3);

    volGrid->addWidget(new Label("Front"), 5, 0);
    Slider* frSlider = new Slider();
    frSlider->setValue(50);
    volGrid->addWidget(frSlider, 5, 1);
    volGrid->addWidget(new Label("Rear"), 5, 2);

    volGrid->addWidget(new Label("Left"), 6, 0);
    Slider* lrSlider = new Slider();
    lrSlider->setValue(50);
    volGrid->addWidget(lrSlider, 6, 1);
    volGrid->addWidget(new Label("Right"), 6, 2);

    volGrid->addWidget(new Spacer(Vertical), 7, 0);

    GroupBox* volMeter = new GroupBox("Meter");
    VBoxLayout* volMeterLayout = new VBoxLayout();
    volMeterLayout->setHorizontalAlignment(Alignment::Center);
    volMeter->setLayout(volMeterLayout);
    volMeter->setXConstraint(FixedConstraint);
    volStuff->addWidget(volMeter);
    VolumeMeter* meter = new VolumeMeter();
    volMeter->addWidget(meter);
    volHBox->addWidget(volMeter);

    //*********
    VBoxLayout* eqBox = new VBoxLayout();
    panel->addTab(eqBox, "Equalizer");

    HBoxLayout* buttons = new HBoxLayout();
    buttons->addWidget(new CheckBox("EQ Enabled"));
    buttons->addWidget(new Spacer(Horizontal));
    buttons->addWidget(new PushButton("Load Preset"));
    buttons->addWidget(new PushButton("Save Preset"));
    PushButton* testSound = new PushButton("Test");
    testSound->sigClicked.connect(sigc::mem_fun(this, &ILXSoundMixer::playTestSound));
    buttons->addWidget(testSound);
    eqBox->addWidget(buttons);

    HBoxLayout* rowLevels = new HBoxLayout();
    rowLevels->setYConstraint(ExpandingConstraint);
    rowLevels->addWidget(new BandSlider("50Hz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("100Hz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("156Hz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("220Hz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("311Hz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("440Hz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("622Hz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("880Hz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("1.25KHz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("1.75KHz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("2.5KHz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("3.5KHz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("5KHz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("10KHz", _bandSliderFont));
    rowLevels->addWidget(new BandSlider("20KHz", _bandSliderFont));
    eqBox->addWidget(rowLevels);

#if ILIXI_HAVE_COMPOSITOR
    DaleDFB::comaGetComponent("SoundMixer", &_soundComponent);
    if (_soundComponent)
        _soundComponent->Listen(_soundComponent, SoundMixer::VolumeChanged, volumeListener, this);
#endif
    _music = new Music(ILIXI_DATADIR"soundmixer/test.wav");
    _music->setRepeat(true);

}
Example #20
0
WidgetsDemo::WidgetsDemo(int argc, char* argv[])
        : Application(&argc, &argv, (AppOptions) (OptDaleAuto | OptSound))
{
    setMargins(5, 5, 5, 5);
    setLayout(new VBoxLayout());

    // ToolBar
    ToolBar* bar = new ToolBar();
    bar->addWidget(new Label("ilixi_widgets"));
    bar->addWidget(new Spacer(Horizontal));
    ToolBarButton* barButton = new ToolBarButton("Quit");
    barButton->setIcon(StyleHint::Cross);
    barButton->sigClicked.connect(sigc::ptr_fun(WidgetsDemo::quit));
    bar->addWidget(barButton);
    setToolbar(bar);

    // TabPanel
    TabPanel* tab = new TabPanel();
//    tab->surface()->setSurfaceFlag(Surface::SubSurface);
//    tab->surface()->unsetSurfaceFlag(Surface::SharedSurface);
    addWidget(tab);

    // Buttons Tab
    VBoxLayout* vBox = new VBoxLayout();
    tab->addTab(vBox, "Tab 1");

    // Label
    vBox->addWidget(createLabelGroup());
    vBox->addWidget(new LineSeperator());

    // CheckBox and RadioButton
    HBoxLayout* box1 = new HBoxLayout();
    box1->addWidget(createCheckGroup());
    box1->addWidget(createRadioGroup());
    vBox->addWidget(box1);
    vBox->addWidget(new LineSeperator());

    // PushButton
    vBox->addWidget(createPBGroup());
    vBox->addWidget(new LineSeperator());

    // ToolButton
    vBox->addWidget(createTBGroup());
    vBox->addWidget(new LineSeperator());

    // ButtonGroup
    DirectionalButton* db1 = new DirectionalButton("Left");
    DirectionalButton* db2 = new DirectionalButton("1");
    DirectionalButton* db3 = new DirectionalButton("2");
    DirectionalButton* db4 = new DirectionalButton("3");
    DirectionalButton* db5 = new DirectionalButton("Right");

    ButtonGroup* bg = new ButtonGroup(Horizontal);
    bg->addButton(db1);
    bg->addButton(db2);
    bg->addButton(db3);
    bg->addButton(db4);
    bg->addButton(db5);
    vBox->addWidget(bg);

    vBox->addWidget(new Spacer(Vertical));

    // Disabled
    VBoxLayout* vBox4 = new VBoxLayout();
    tab->addTab(vBox4, "Tab 2");
    tab->setTabEnabled(1, false);

    // LineInput Tab
    VBoxLayout* vBox2 = new VBoxLayout();
    tab->addTab(vBox2, "Tab 3");

    LineInput *li1 = new LineInput("123...");
    li1->sigTextEntered.connect(sigc::mem_fun(this, &WidgetsDemo::print));
    vBox2->addWidget(li1);
    vBox2->addWidget(new Spacer(Vertical));

    LineInput *li2 = new LineInput("Line input has some text...");
    vBox2->addWidget(li2);
    vBox2->addWidget(new Spacer(Vertical));

    LineInput *li3 = new LineInput("Line input has some text...");
    vBox2->addWidget(li3);
    vBox2->addWidget(new Spacer(Vertical));

    LineInput *li4 = new LineInput("Line input has some text...");
    vBox2->addWidget(li4);
    li4->setDisabled();
    vBox2->addWidget(new Spacer(Vertical));

    LineInput *li5 = new LineInput("Line input has some text...");
    vBox2->addWidget(li5);

    VBoxLayout* vBox3 = new VBoxLayout();
    tab->addTab(vBox3, "Tab 4");

    ProgressBar* bar1 = new ProgressBar();
    bar1->setValue(5);
    vBox3->addWidget(bar1);

    ProgressBar* bar1d = new ProgressBar();
    bar1d->setValue(5);
    bar1d->setDisabled();
    vBox3->addWidget(bar1d);

    Slider* slider1 = new Slider();
    slider1->sigValueChanged.connect(sigc::mem_fun(bar1, &ProgressBar::setValue));
    vBox3->addWidget(slider1);

    Slider* slider11 = new Slider();
    slider11->setValue(48);
    slider11->setDisabled();
    vBox3->addWidget(slider11);

    Slider* slider2 = new Slider();
    slider2->setInverted(true);
    slider2->sigValueChanged.connect(sigc::mem_fun(bar1, &ProgressBar::setValue));
    vBox3->addWidget(slider2);

    ScrollBar* sb1 = new ScrollBar(Horizontal);
    sb1->setRange(0, 10);
    vBox3->addWidget(sb1);

    ScrollBar* sb12 = new ScrollBar(Horizontal);
    sb12->setDisabled();
    sb12->setRange(0, 10);
    sb12->setValue(5);
    vBox3->addWidget(sb12);

    // Verticals
    HBoxLayout* vSliderLayout = new HBoxLayout();
    vBox3->addWidget(vSliderLayout);

    ProgressBar* bar2 = new ProgressBar();
    bar2->setValue(5);
    bar2->setOrientation(Vertical);
    vSliderLayout->addWidget(bar2);

    Slider* slider3 = new Slider();
    slider3->setOrientation(Vertical);
    slider3->sigValueChanged.connect(sigc::mem_fun(bar2, &ProgressBar::setValue));
    vSliderLayout->addWidget(slider3);

    Slider* slider4 = new Slider();
    slider4->setOrientation(Vertical);
    slider4->setInverted(true);
    slider4->sigValueChanged.connect(sigc::mem_fun(bar2, &ProgressBar::setValue));
    vSliderLayout->addWidget(slider4);

    ScrollBar* sb2 = new ScrollBar(Vertical);
    sb2->setRange(0, 10);
    vSliderLayout->addWidget(sb2);

    ComboBox::StringList list;

    char str[5];
    for (int i = 2005; i > 1900; --i)
    {
        sprintf(str, "%d", i);
        list.push_back(str);
    }

    ComboBox* co1 = new ComboBox("Select your date of birth:");
    co1->addItems(list);
    vBox3->addWidget(co1);

    SpinBox* spin1 = new SpinBox(5);
    vBox3->addWidget(spin1);


}