2012-01-06 04:12:57 +00:00
|
|
|
/* ASEPRITE
|
2012-01-06 03:52:11 +00:00
|
|
|
* Copyright (C) 2001-2012 David Capello
|
2012-01-05 22:45:03 +00: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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <allegro.h>
|
|
|
|
|
|
|
|
#include "base/bind.h"
|
2012-06-18 01:49:58 +00:00
|
|
|
#include "ui/gui.h"
|
2012-01-05 22:45:03 +00:00
|
|
|
|
|
|
|
#include "commands/command.h"
|
|
|
|
#include "modules/gui.h"
|
|
|
|
|
2012-06-18 01:02:54 +00:00
|
|
|
using namespace ui;
|
|
|
|
|
2012-01-05 22:45:03 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// about
|
|
|
|
|
|
|
|
class AboutCommand : public Command
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AboutCommand();
|
|
|
|
Command* clone() const { return new AboutCommand(*this); }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void onExecute(Context* context);
|
|
|
|
};
|
|
|
|
|
|
|
|
AboutCommand::AboutCommand()
|
|
|
|
: Command("About",
|
|
|
|
"About",
|
|
|
|
CmdUIOnlyFlag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void AboutCommand::onExecute(Context* context)
|
|
|
|
{
|
2012-06-16 02:37:59 +00:00
|
|
|
UniquePtr<Frame> frame(new Frame(false, "About " PACKAGE));
|
2012-01-05 22:45:03 +00:00
|
|
|
Box* box1 = new Box(JI_VERTICAL);
|
|
|
|
Grid* grid = new Grid(2, false);
|
|
|
|
Label* title = new Label(PACKAGE " v" VERSION);
|
2012-03-21 17:41:48 +00:00
|
|
|
Label* subtitle = new Label("Animated sprite editor && pixel art tool");
|
2012-04-06 02:34:42 +00:00
|
|
|
Separator* authors_separator1 = new Separator("Authors:", JI_HORIZONTAL | JI_TOP);
|
|
|
|
Separator* authors_separator2 = new Separator(NULL, JI_HORIZONTAL);
|
2012-01-05 22:45:03 +00:00
|
|
|
Label* author1 = new LinkLabel("http://dacap.com.ar/", "David Capello");
|
|
|
|
Label* author1_desc = new Label("| Programming");
|
|
|
|
Label* author2 = new LinkLabel("http://ilkke.blogspot.com/", "Ilija Melentijevic");
|
|
|
|
Label* author2_desc = new Label("| Skin and Graphics");
|
|
|
|
Label* author3 = new LinkLabel("http://code.google.com/p/aseprite/people/list", "Contributors");
|
|
|
|
Box* bottom_box1 = new Box(JI_HORIZONTAL);
|
|
|
|
Box* bottom_box2 = new Box(JI_HORIZONTAL);
|
|
|
|
Box* bottom_box3 = new Box(JI_HORIZONTAL);
|
|
|
|
Label* copyright = new Label(COPYRIGHT);
|
|
|
|
Label* website = new LinkLabel(WEBSITE);
|
|
|
|
Button* close_button = new Button("&Close");
|
|
|
|
|
|
|
|
grid->addChildInCell(title, 2, 1, 0);
|
|
|
|
grid->addChildInCell(subtitle, 2, 1, 0);
|
|
|
|
grid->addChildInCell(authors_separator1, 2, 1, 0);
|
|
|
|
grid->addChildInCell(author1, 1, 1, 0);
|
|
|
|
grid->addChildInCell(author1_desc, 1, 1, 0);
|
|
|
|
grid->addChildInCell(author2, 1, 1, 0);
|
|
|
|
grid->addChildInCell(author2_desc, 1, 1, 0);
|
|
|
|
grid->addChildInCell(author3, 2, 1, 0);
|
|
|
|
grid->addChildInCell(authors_separator2, 2, 1, 0);
|
|
|
|
grid->addChildInCell(copyright, 2, 1, 0);
|
|
|
|
grid->addChildInCell(website, 2, 1, 0);
|
|
|
|
grid->addChildInCell(bottom_box1, 2, 1, 0);
|
|
|
|
|
2012-04-05 22:00:19 +00:00
|
|
|
close_button->setFocusMagnet(true);
|
2012-01-05 22:45:03 +00:00
|
|
|
|
2012-04-05 22:00:19 +00:00
|
|
|
bottom_box2->setExpansive(true);
|
|
|
|
bottom_box3->setExpansive(true);
|
2012-01-05 22:45:03 +00:00
|
|
|
|
|
|
|
bottom_box1->addChild(bottom_box2);
|
|
|
|
bottom_box1->addChild(close_button);
|
|
|
|
bottom_box1->addChild(bottom_box3);
|
|
|
|
|
|
|
|
box1->addChild(grid);
|
|
|
|
frame->addChild(box1);
|
|
|
|
|
|
|
|
jwidget_set_border(close_button,
|
|
|
|
close_button->border_width.l + 16*jguiscale(),
|
|
|
|
close_button->border_width.t,
|
|
|
|
close_button->border_width.r + 16*jguiscale(),
|
|
|
|
close_button->border_width.b);
|
|
|
|
|
|
|
|
close_button->Click.connect(Bind<void>(&Frame::closeWindow, frame.get(), close_button));
|
|
|
|
|
|
|
|
frame->open_window_fg();
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// CommandFactory
|
|
|
|
|
|
|
|
Command* CommandFactory::createAboutCommand()
|
|
|
|
{
|
|
|
|
return new AboutCommand;
|
|
|
|
}
|