/* * GuiLoader/C++ examples * Copyright (c) 2006 Maxim Udushlivy * * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef EXAMPLE_APPLICATION_H #define EXAMPLE_APPLICATION_H #ifdef _WIN32 #include #endif #include #include #include namespace GuiExample { class Application : public sigc::trackable { public: Application(); ~Application(); Gtk::Window * getWindow() { return window; } protected: void updateUi(); void setText(const Glib::ustring & text); void onChanged(); void onMarkSet(const Gtk::TextBuffer::iterator &, const Glib::RefPtr &); void onNew(); void onOpen(); void onSave(); void onSaveAs(); void onQuit(); void onCut(); void onCopy(); void onPaste(); void onDelete(); void onAbout(); bool onDeleteEvent(GdkEventAny *); bool loadFile(const std::string & name, Glib::ustring * data); bool saveFile(const std::string & name, const Glib::ustring & data); std::string askFilename(Gtk::FileChooserAction action); bool askProceed(); void showMessage(const Glib::ustring & message); private: Gui::PLoader loader; std::string file; bool modified; bool lock; Gtk::Window * window; Glib::RefPtr actions; Gtk::TextView * textView; Gtk::Statusbar * statusbar; Gtk::FileChooserDialog * openDialog; Gtk::FileChooserDialog * saveDialog; Gtk::Dialog * proceedDialog; sigc::connection con1, con2; }; } #endif