summaryrefslogtreecommitdiffstats
path: root/kmahjongg/Editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmahjongg/Editor.cpp')
-rw-r--r--kmahjongg/Editor.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/kmahjongg/Editor.cpp b/kmahjongg/Editor.cpp
index 4e141259..d11ff7b2 100644
--- a/kmahjongg/Editor.cpp
+++ b/kmahjongg/Editor.cpp
@@ -1,8 +1,8 @@
#include <stdlib.h>
#include <kapplication.h>
-#include <qlayout.h>
-#include <qpainter.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
#include "Editor.h"
#include "prefs.h"
@@ -41,11 +41,11 @@
Editor::Editor
(
- QWidget* parent,
+ TQWidget* parent,
const char* name
)
:
- QDialog( parent, name, true, 0 ), tiles(false)
+ TQDialog( parent, name, true, 0 ), tiles(false)
{
clean= true;
@@ -61,15 +61,15 @@ Editor::Editor
drawFrame->setGeometry( 10, 40 ,sWidth ,sHeight);
drawFrame->setMinimumSize( 0, 0 );
drawFrame->setMaximumSize( 32767, 32767 );
- drawFrame->setFocusPolicy( QWidget::NoFocus );
- drawFrame->setBackgroundMode( QWidget::PaletteBackground );
+ drawFrame->setFocusPolicy( TQWidget::NoFocus );
+ drawFrame->setBackgroundMode( TQWidget::PaletteBackground );
drawFrame->setFrameStyle( 49 );
drawFrame->setMouseTracking(true);
// setup the tool bar
setupToolbar();
- QVBoxLayout *layout = new QVBoxLayout(this, 1);
+ TQVBoxLayout *layout = new TQVBoxLayout(this, 1);
layout->addWidget(topToolbar,0);
layout->addWidget(drawFrame,1);
layout->activate();
@@ -78,17 +78,17 @@ Editor::Editor
setMinimumSize( sWidth+60, sHeight+60);
setMaximumSize( sWidth+60, sHeight+60);
- QString tile = Prefs::tileSet();
+ TQString tile = Prefs::tileSet();
tiles.loadTileset(tile);
// tell the user what we do
setCaption(kapp->makeStdCaption(i18n("Edit Board Layout")));
- connect( drawFrame, SIGNAL(mousePressed(QMouseEvent *) ),
- SLOT(drawFrameMousePressEvent(QMouseEvent *)));
- connect( drawFrame, SIGNAL(mouseMoved(QMouseEvent *) ),
- SLOT(drawFrameMouseMovedEvent(QMouseEvent *)));
+ connect( drawFrame, TQT_SIGNAL(mousePressed(TQMouseEvent *) ),
+ TQT_SLOT(drawFrameMousePressEvent(TQMouseEvent *)));
+ connect( drawFrame, TQT_SIGNAL(mouseMoved(TQMouseEvent *) ),
+ TQT_SLOT(drawFrameMouseMovedEvent(TQMouseEvent *)));
statusChanged();
@@ -169,14 +169,14 @@ void Editor::setupToolbar()
// status in the toolbar for now (ick)
- theLabel = new QLabel(statusText(), topToolbar);
+ theLabel = new TQLabel(statusText(), topToolbar);
int lWidth = theLabel->sizeHint().width();
topToolbar->insertWidget(ID_TOOL_STATUS,lWidth, theLabel );
topToolbar->alignItemRight( ID_TOOL_STATUS, true );
//addToolBar(topToolbar);
- connect( topToolbar, SIGNAL(clicked(int) ), SLOT( topToolbarOption(int) ) );
+ connect( topToolbar, TQT_SIGNAL(clicked(int) ), TQT_SLOT( topToolbarOption(int) ) );
topToolbar->updateRects(0);
topToolbar->setFullSize(true);
@@ -245,8 +245,8 @@ void Editor::topToolbarOption(int option) {
}
-QString Editor::statusText() {
- QString buf;
+TQString Editor::statusText() {
+ TQString buf;
int x=currPos.x;
int y=currPos.y;
@@ -323,7 +323,7 @@ bool Editor::saveBoard() {
if ( url.isEmpty() )
return false;
- QFileInfo f( url.path() );
+ TQFileInfo f( url.path() );
if ( f.exists() ) {
// if it already exists, querie the user for replacement
int res=KMessageBox::warningContinueCancel(this,
@@ -356,7 +356,7 @@ bool Editor::testSave()
int res;
res=KMessageBox::warningYesNoCancel(this,
i18n("The board has been modified. Would you "
- "like to save the changes?"),QString::null,KStdGuiItem::save(),KStdGuiItem::dontSave());
+ "like to save the changes?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::dontSave());
if (res == KMessageBox::Yes) {
// yes to save
@@ -375,12 +375,12 @@ bool Editor::testSave()
// The main paint event, draw in the grid and blit in
// the tiles as specified by the layout.
-void Editor::paintEvent( QPaintEvent* ) {
+void Editor::paintEvent( TQPaintEvent* ) {
// first we layer on a background grid
- QPixmap buff;
- QPixmap *dest=drawFrame->getPreviewPixmap();
+ TQPixmap buff;
+ TQPixmap *dest=drawFrame->getPreviewPixmap();
buff.resize(dest->width(), dest->height());
drawBackground(&buff);
drawTiles(&buff);
@@ -389,12 +389,12 @@ void Editor::paintEvent( QPaintEvent* ) {
drawFrame->repaint(false);
}
-void Editor::drawBackground(QPixmap *pixmap) {
+void Editor::drawBackground(TQPixmap *pixmap) {
- QPainter p(pixmap);
+ TQPainter p(pixmap);
// blast in a white background
- p.fillRect(0,0,pixmap->width(), pixmap->height(), QColor(white));
+ p.fillRect(0,0,pixmap->width(), pixmap->height(), TQColor(white));
// now put in a grid of tile quater width squares
@@ -412,11 +412,11 @@ void Editor::drawBackground(QPixmap *pixmap) {
}
}
-void Editor::drawTiles(QPixmap *dest) {
+void Editor::drawTiles(TQPixmap *dest) {
- QPainter p(dest);
+ TQPainter p(dest);
- QString tile1 = Prefs::tileSet();
+ TQString tile1 = Prefs::tileSet();
tiles.loadTileset(tile1);
@@ -437,7 +437,7 @@ void Editor::drawTiles(QPixmap *dest) {
if (theBoard.getBoardData(z, y, x) != '1') {
continue;
}
- QPixmap *t;
+ TQPixmap *t;
tile=(z*BoardLayout::depth)+
(y*BoardLayout::height)+
(x*BoardLayout::width);
@@ -486,7 +486,7 @@ void Editor::drawTiles(QPixmap *dest) {
// we return a result too.
void Editor::transformPointToPosition(
- const QPoint& point,
+ const TQPoint& point,
POSITION& MouseClickPos,
bool align)
{
@@ -551,7 +551,7 @@ void Editor::transformPointToPosition(
// we swallow the draw frames mouse clicks and process here
-void Editor::drawFrameMousePressEvent( QMouseEvent* e )
+void Editor::drawFrameMousePressEvent( TQMouseEvent* e )
{
POSITION mPos;
@@ -608,7 +608,7 @@ void Editor::drawCursor(POSITION &p, bool visible)
// we swallow the draw frames mouse moves and process here
-void Editor::drawFrameMouseMovedEvent( QMouseEvent* e ){
+void Editor::drawFrameMouseMovedEvent( TQMouseEvent* e ){
POSITION mPos;