examples/script/qstetrix/tetrixwindow.js
author Eckhart Koeppen <eckhart.koppen@nokia.com>
Thu, 29 Apr 2010 15:15:16 +0300
branchRCL_3
changeset 16 4b6ee5efea19
parent 0 1918ee327afb
permissions -rw-r--r--
2010-17 9996a03743ab23f83c83c5bc7ade0f82f71b1506

function TetrixWindow(ui)
{
    this.ui = ui;

    var boardUi = ui.findChild("board");
    boardUi.nextPieceLabel = ui.findChild("nextPieceLabel");

    this.board = new TetrixBoard(boardUi);

    ui.findChild("startButton").clicked.connect(this.board, this.board.start);
    ui.findChild("quitButton").clicked.connect(Qt.App.quit);
    ui.findChild("pauseButton").clicked.connect(this.board, this.board.pause);
    boardUi.scoreChanged.connect(ui.findChild("scoreLcd")["display(int)"]);
    boardUi.levelChanged.connect(ui.findChild("levelLcd")["display(int)"]);
    boardUi.linesRemovedChanged.connect(ui.findChild("linesLcd")["display(int)"]);
}