/* Aseprite * Copyright (C) 2001-2013 David Capello * * 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 */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "app/app.h" #include "app/commands/command.h" #include "app/context.h" #include "app/find_widget.h" #include "app/ini_file.h" #include "app/load_widget.h" #include "app/modules/editors.h" #include "app/modules/gui.h" #include "app/settings/document_settings.h" #include "app/settings/settings.h" #include "app/ui/color_button.h" #include "app/ui/editor/editor.h" #include "app/util/render.h" #include "base/bind.h" #include "raster/image.h" #include "ui/ui.h" namespace app { using namespace ui; class OptionsCommand : public Command { public: OptionsCommand(); Command* clone() const OVERRIDE { return new OptionsCommand(*this); } protected: void onExecute(Context* context); private: void onResetCheckedBg(); ComboBox* m_checked_bg; Widget* m_checked_bg_zoom; ColorButton* m_checked_bg_color1; ColorButton* m_checked_bg_color2; }; OptionsCommand::OptionsCommand() : Command("Options", "Options", CmdUIOnlyFlag) { } void OptionsCommand::onExecute(Context* context) { // Load the window widget base::UniquePtr window(app::load_widget("options.xml", "options")); Widget* check_smooth = app::find_widget(window, "smooth"); Widget* check_autotimeline = app::find_widget(window, "autotimeline"); Widget* show_scrollbars = app::find_widget(window, "show_scrollbars"); Widget* cursor_color_box = app::find_widget(window, "cursor_color_box"); Widget* grid_color_box = app::find_widget(window, "grid_color_box"); Widget* pixel_grid_color_box = app::find_widget(window, "pixel_grid_color_box"); m_checked_bg = app::find_widget(window, "checked_bg_size"); m_checked_bg_zoom = app::find_widget(window, "checked_bg_zoom"); Widget* checked_bg_color1_box = app::find_widget(window, "checked_bg_color1_box"); Widget* checked_bg_color2_box = app::find_widget(window, "checked_bg_color2_box"); Button* checked_bg_reset = app::find_widget