summaryrefslogtreecommitdiffstats
path: root/kmahjongg/Editor.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
commit838baf3f99ec5ab81b063eb5449a3381d860f377 (patch)
treedd31abcfde08ca92e4623b8f50b3d762a87c997a /kmahjongg/Editor.cpp
parent2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff)
downloadtdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz
tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmahjongg/Editor.cpp')
-rw-r--r--kmahjongg/Editor.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/kmahjongg/Editor.cpp b/kmahjongg/Editor.cpp
index d11ff7b2..833718c3 100644
--- a/kmahjongg/Editor.cpp
+++ b/kmahjongg/Editor.cpp
@@ -35,17 +35,17 @@
// When we assign a tile to draw in a slot we do it in order from te following
-// table, wrapping on the tile number. It makes the tile layout look more
+// table, wrapping on the tile number. It makes the tile tqlayout look more
// random.
Editor::Editor
(
- TQWidget* parent,
+ TQWidget* tqparent,
const char* name
)
:
- TQDialog( parent, name, true, 0 ), tiles(false)
+ TQDialog( tqparent, name, true, 0 ), tiles(false)
{
clean= true;
@@ -61,7 +61,7 @@ Editor::Editor
drawFrame->setGeometry( 10, 40 ,sWidth ,sHeight);
drawFrame->setMinimumSize( 0, 0 );
drawFrame->setMaximumSize( 32767, 32767 );
- drawFrame->setFocusPolicy( TQWidget::NoFocus );
+ drawFrame->setFocusPolicy( TQ_NoFocus );
drawFrame->setBackgroundMode( TQWidget::PaletteBackground );
drawFrame->setFrameStyle( 49 );
drawFrame->setMouseTracking(true);
@@ -69,10 +69,10 @@ Editor::Editor
// setup the tool bar
setupToolbar();
- TQVBoxLayout *layout = new TQVBoxLayout(this, 1);
- layout->addWidget(topToolbar,0);
- layout->addWidget(drawFrame,1);
- layout->activate();
+ TQVBoxLayout *tqlayout = new TQVBoxLayout(this, 1);
+ tqlayout->addWidget(topToolbar,0);
+ tqlayout->addWidget(drawFrame,1);
+ tqlayout->activate();
resize( sWidth+60, sHeight+60);
setMinimumSize( sWidth+60, sHeight+60);
@@ -170,7 +170,7 @@ void Editor::setupToolbar()
// status in the toolbar for now (ick)
theLabel = new TQLabel(statusText(), topToolbar);
- int lWidth = theLabel->sizeHint().width();
+ int lWidth = theLabel->tqsizeHint().width();
topToolbar->insertWidget(ID_TOOL_STATUS,lWidth, theLabel );
topToolbar->alignItemRight( ID_TOOL_STATUS, true );
@@ -209,19 +209,19 @@ void Editor::topToolbarOption(int option) {
break;
case ID_TOOL_LEFT:
theBoard.shiftLeft();
- repaint(false);
+ tqrepaint(false);
break;
case ID_TOOL_RIGHT:
theBoard.shiftRight();
- repaint(false);
+ tqrepaint(false);
break;
case ID_TOOL_UP:
theBoard.shiftUp();
- repaint(false);
+ tqrepaint(false);
break;
case ID_TOOL_DOWN:
theBoard.shiftDown();
- repaint(false);
+ tqrepaint(false);
break;
case ID_TOOL_DEL:
mode=remove;
@@ -260,7 +260,7 @@ TQString Editor::statusText() {
if (x >=BoardLayout::width || x <0 || y >=BoardLayout::height || y <0)
x = y = z = 0;
- buf = i18n("Tiles: %1 Pos: %2,%3,%4").arg(numTiles).arg(x).arg(y).arg(z);
+ buf = i18n("Tiles: %1 Pos: %2,%3,%4").tqarg(numTiles).tqarg(x).tqarg(y).tqarg(z);
return buf;
}
@@ -272,7 +272,7 @@ void Editor::loadBoard() {
KURL url = KFileDialog::getOpenURL(
NULL,
- i18n("*.layout|Board Layout (*.layout)\n"
+ i18n("*.tqlayout|Board Layout (*.tqlayout)\n"
"*|All Files"),
this,
i18n("Open Board Layout" ));
@@ -283,7 +283,7 @@ void Editor::loadBoard() {
theBoard.loadBoardLayout( url.path() );
- repaint(false);
+ tqrepaint(false);
}
@@ -302,14 +302,14 @@ void Editor::newBoard() {
clean=true;
numTiles=0;
statusChanged();
- repaint(false);
+ tqrepaint(false);
}
bool Editor::saveBoard() {
// get a save file name
KURL url = KFileDialog::getSaveURL(
NULL,
- i18n("*.layout|Board Layout (*.layout)\n"
+ i18n("*.tqlayout|Board Layout (*.tqlayout)\n"
"*|All Files"),
this,
i18n("Save Board Layout" ));
@@ -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?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::dontSave());
+ "like to save the changes?"),TQString(),KStdGuiItem::save(),KStdGuiItem::dontSave());
if (res == KMessageBox::Yes) {
// yes to save
@@ -373,7 +373,7 @@ bool Editor::testSave()
// The main paint event, draw in the grid and blit in
-// the tiles as specified by the layout.
+// the tiles as specified by the tqlayout.
void Editor::paintEvent( TQPaintEvent* ) {
@@ -386,7 +386,7 @@ void Editor::paintEvent( TQPaintEvent* ) {
drawTiles(&buff);
bitBlt(dest, 0,0,&buff, 0,0,buff.width(), buff.height(), CopyROP);
- drawFrame->repaint(false);
+ drawFrame->tqrepaint(false);
}
void Editor::drawBackground(TQPixmap *pixmap) {
@@ -564,7 +564,7 @@ void Editor::drawFrameMousePressEvent( TQMouseEvent* e )
numTiles--;
statusChanged();
drawFrameMouseMovedEvent(e);
- repaint(false);
+ tqrepaint(false);
}
break;
case insert: {
@@ -577,7 +577,7 @@ void Editor::drawFrameMousePressEvent( TQMouseEvent* e )
theBoard.insertTile(n);
numTiles++;
statusChanged();
- repaint(false);
+ tqrepaint(false);
}
}
break;
@@ -599,7 +599,7 @@ void Editor::drawCursor(POSITION &p, bool visible)
if (p.e==100 || !visible)
x = -1;
drawFrame->setRect(x,y,w,h, tiles.shadowSize(), mode-remove);
- drawFrame->repaint(false);
+ drawFrame->tqrepaint(false);