Beispiel #1
0
/* 初始化相应的信号与槽 */
void TextEditer::initConnection()
{
	/* menuFile里的信号与槽 */
	connect(actNew, SIGNAL(triggered()), this, SLOT(doNew()));
	connect(actOpen, SIGNAL(triggered()), this, SLOT(doOpen()));
	connect(actClose, SIGNAL(triggered()), this, SLOT(doClose()));
	connect(actSave, SIGNAL(triggered()), this, SLOT(doSave()));
	connect(actASave, SIGNAL(triggered()), this, SLOT(doASave()));
	connect(actExit, SIGNAL(triggered()), this, SLOT(doExit()));

	/* menuEdit里的信号与槽 */
	connect(actUndo, SIGNAL(triggered()), this, SLOT(doUndo()));
	connect(actRedo, SIGNAL(triggered()), this, SLOT(doRedo()));
	connect(actCut, SIGNAL(triggered()), this, SLOT(doCut()));
	connect(actCopy, SIGNAL(triggered()), this, SLOT(doCopy()));
	connect(actPast, SIGNAL(triggered()), this, SLOT(doPast()));
	connect(actAll, SIGNAL(triggered()), this, SLOT(doSelectAll()));

	/* menuTool里的信号与槽 */
	connect(actFont, SIGNAL(triggered()), this, SLOT(setFontForText()));

	/* 当当前文本内容改变后, 自动调用doModified() */
	connect(textEdit->document(), SIGNAL(contentsChanged()),
				this, SLOT(doModified()));

	/* 当文档修改后, 刷新光标所在的位置 */
	connect(textEdit->document(), SIGNAL(contentsChanged()),
			this, SLOT(doCursorChanged()));
}
Beispiel #2
0
bool ModifyBuildingAction::undo()
{
	// actually, undo does the same thing as redo.
	return doRedo(); 
}
Beispiel #3
0
bool ModifyBuildingAction::redo()
{
	return doRedo();
}
Beispiel #4
0
//-----------------------------------------------------------------------
// Function:	Undo
// ParamsIn:	none
// ParamsOut:	none
// Returns:		nothing
// Description: undos a smart paint operation
////-----------------------------------------------------------------------
bool ActionPaintTile::undo()
{ 
	// actually, undo does the same thing as redo.
	return doRedo(); 
}
Beispiel #5
0
//-----------------------------------------------------------------------
// Function:	ActionPaintTile::Redo
// ParamsIn:	none
// ParamsOut:	none
// Returns:		success of operation
// Description: redoes a smart paint operation
////-----------------------------------------------------------------------
bool ActionPaintTile::redo()
{
	return doRedo();
}