examples/script/qstetrix/tetrixwindow.js
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 19 Feb 2010 23:40:16 +0200
branchRCL_3
changeset 4 3b1da2848fc7
parent 0 1918ee327afb
permissions -rw-r--r--
Revision: 201003 Kit: 201007

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)"]);
}