Esempio n. 1
0
void LoginDialog::makeInputs(unsigned &row, Client *client, bool bQuick)
{
    if (!bQuick){
        QLabel *pict = new QLabel(this);
        pict->setPixmap(Pict(client->protocol()->description()->icon));
        picts.push_back(pict);
        PLayout->addWidget(pict, row, 0);
        pict->show();
    }
    QLabel *txt = new QLabel(this);
    txt->setText(bQuick ? i18n("Password:"******"Forgot password?"));
        lnkHelp->setUrl(i18n(helpUrl).latin1());
        lnkHelp->show();
        links.push_back(lnkHelp);
    }
    row++;
}
Esempio n. 2
0
void StartScreen::init() {
    loadContent();
    label = LinkLabel(font);
    label.setText("Press bugista nappia to begin");
    label.setFocused(true);
    label.setTabStop(true);
    int w, h;
    TTF_SizeText(font, label.getText().c_str(), &w, &h);
    Vector position((game->getWidth() - w )/ 2, (game->getHeight()-h)/2);
    label.setPosition(position);
    controlManager.add(&label);

    passwordLabel = LinkLabel(font);
    passwordLabel.setText("Password");
    passwordLabel.setFocused(false);
    passwordLabel.setTabStop(true);
    TTF_SizeText(font, passwordLabel.getText().c_str(), &w, &h);
    position.y += 50;
    passwordLabel.setPosition(position);
    controlManager.add(&passwordLabel);
}
Esempio n. 3
0
namespace startscreen {

void onLinkLabelSelected(Control *source);
TTF_Font *font;
Vector pos(100, 100);
SDL_Color color = {0xFF, 0xFF, 0xFF };
LinkLabel label = NULL;
LinkLabel passwordLabel = NULL;
SDL_Event event;

void StartScreen::init() {
    loadContent();
    label = LinkLabel(font);
    label.setText("Press bugista nappia to begin");
    label.setFocused(true);
    label.setTabStop(true);
    int w, h;
    TTF_SizeText(font, label.getText().c_str(), &w, &h);
    Vector position((game->getWidth() - w )/ 2, (game->getHeight()-h)/2);
    label.setPosition(position);
    controlManager.add(&label);

    passwordLabel = LinkLabel(font);
    passwordLabel.setText("Password");
    passwordLabel.setFocused(false);
    passwordLabel.setTabStop(true);
    TTF_SizeText(font, passwordLabel.getText().c_str(), &w, &h);
    position.y += 50;
    passwordLabel.setPosition(position);
    controlManager.add(&passwordLabel);
}

void StartScreen::update(Uint32 elapsed) {
    controlManager.update(elapsed);
    handleEvents();
}

void StartScreen::draw(SpriteBatch* batch) {
    SDL_FillRect(batch->screen, &batch->screen->clip_rect, SDL_MapRGB(batch->screen->format, 0x0, 0x0, 0x0));
    controlManager.draw(batch);
}

void StartScreen::pause() {
}

void StartScreen::resume() {
}

void StartScreen::cleanUp() {
    TTF_CloseFont(font);
}

void StartScreen::loadContent() {
    font = TTF_OpenFont("font/Adore64.ttf", 16);
}

StartScreen::StartScreen(Game *game) : BaseGameState(game) {

}

void onLinkLabelSelected(Control *source) {
    if (source == &label) {

    }
}

StartScreen::~StartScreen() {

}

void StartScreen::handleEvents() {
    while (SDL_PollEvent(&event)) {
        if (event.type == SDL_USEREVENT) {
            if (event.user.code == LINK_LABEL_SELECTED && event.user.data1 == &label) {
                LastenMan *game = (LastenMan*)this->game;
                game->changeState(&game->stageSelectScreen);
            }
        }
    }
}
}