Example #1
0
StGLButton::StGLButton(StGLWidget*     theParent,
                       const int       theLeft,
                       const int       theTop,
                       const StString& theText)
: StGLMenu(theParent, theLeft, theTop, StGLMenu::MENU_ZERO) {
    setShowBounds(true);
    StGLMenuItem* aBtn = addItem(theText);
    aBtn->signals.onItemClick.connect(this, &StGLButton::doItemClick);
    aBtn->setupAlignment(StGLTextFormatter::ST_ALIGN_X_CENTER,
                         StGLTextFormatter::ST_ALIGN_Y_CENTER);

    myWidth = aBtn->computeTextWidth() + myRoot->scale(16);
}