2013-08-09 08:01:20 +08:00
|
|
|
/* Aseprite
|
2013-01-27 23:13:13 +08:00
|
|
|
* Copyright (C) 2001-2013 David Capello
|
2012-02-12 22:33:06 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2012-02-12 22:33:06 +08:00
|
|
|
#include "config.h"
|
2013-08-06 08:20:19 +08:00
|
|
|
#endif
|
2012-02-12 22:33:06 +08:00
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
#include "app/commands/command.h"
|
2012-02-12 22:33:06 +08:00
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
#include "app/app.h"
|
|
|
|
#include "app/ui/main_window.h"
|
|
|
|
#include "app/ui/tabs.h"
|
2012-02-12 22:33:06 +08:00
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
namespace app {
|
|
|
|
|
|
|
|
class GotoNextTabCommand : public Command {
|
2012-02-12 22:33:06 +08:00
|
|
|
public:
|
|
|
|
GotoNextTabCommand();
|
2014-03-30 04:08:40 +08:00
|
|
|
Command* clone() const OVERRIDE { return new GotoNextTabCommand(*this); }
|
2012-02-12 22:33:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void onExecute(Context* context);
|
|
|
|
};
|
|
|
|
|
|
|
|
GotoNextTabCommand::GotoNextTabCommand()
|
|
|
|
: Command("GotoNextTab",
|
|
|
|
"Goto Next Tab",
|
|
|
|
CmdUIOnlyFlag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void GotoNextTabCommand::onExecute(Context* context)
|
|
|
|
{
|
2012-07-10 00:20:58 +08:00
|
|
|
App::instance()->getMainWindow()->getTabsBar()->selectNextTab();
|
2012-02-12 22:33:06 +08:00
|
|
|
}
|
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
class GotoPreviousTabCommand : public Command {
|
2012-02-12 22:33:06 +08:00
|
|
|
public:
|
|
|
|
GotoPreviousTabCommand();
|
2014-03-30 04:08:40 +08:00
|
|
|
Command* clone() const OVERRIDE { return new GotoPreviousTabCommand(*this); }
|
2012-02-12 22:33:06 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void onExecute(Context* context);
|
|
|
|
};
|
|
|
|
|
|
|
|
GotoPreviousTabCommand::GotoPreviousTabCommand()
|
|
|
|
: Command("GotoPreviousTab",
|
|
|
|
"Goto Previous tab",
|
|
|
|
CmdRecordableFlag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void GotoPreviousTabCommand::onExecute(Context* context)
|
|
|
|
{
|
2012-07-10 00:20:58 +08:00
|
|
|
App::instance()->getMainWindow()->getTabsBar()->selectPreviousTab();
|
2012-02-12 22:33:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
Command* CommandFactory::createGotoNextTabCommand()
|
|
|
|
{
|
|
|
|
return new GotoNextTabCommand;
|
|
|
|
}
|
|
|
|
|
|
|
|
Command* CommandFactory::createGotoPreviousTabCommand()
|
|
|
|
{
|
|
|
|
return new GotoPreviousTabCommand;
|
|
|
|
}
|
2013-08-06 08:20:19 +08:00
|
|
|
|
|
|
|
} // namespace app
|