• R/O
  • HTTP
  • SSH
  • HTTPS

dialektos: Commit

dialektos


Commit MetaInfo

Revisionb82b4b8f03bf042479476602e1eace1841ede8eb (tree)
Time2010-03-02 22:44:33
AuthorAiwota Programmer <aiwotaprog@tett...>
CommiterAiwota Programmer

Log Message

Add a menu item 'Close'.

Change Summary

Incremental Difference

--- a/src/application_framework.cxx
+++ b/src/application_framework.cxx
@@ -68,6 +68,8 @@ void ApplicationFrameWork::build_menubar() {
6868 action_group_->add(Gtk::Action::create("MenuFile", "_File"));
6969 action_group_->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT),
7070 sigc::mem_fun(*this, &ApplicationFrameWork::on_action_file_quit));
71+ action_group_->add(Gtk::Action::create("FileClose", Gtk::Stock::CLOSE),
72+ sigc::mem_fun(*this, &ApplicationFrameWork::on_action_file_close));
7173
7274 // Edit menu
7375 action_group_->add(Gtk::Action::create("MenuEdit", "_Edit"));
@@ -102,6 +104,7 @@ void ApplicationFrameWork::build_menubar() {
102104 " <menubar name='MenuBar'>"
103105 " <menu action='MenuFile'>"
104106 " <menuitem action='FileQuit'/>"
107+ " <menuitem action='FileClose'/>"
105108 " </menu>"
106109 " <menu action='MenuEdit'>"
107110 " <menuitem action='EditCopy'/>"
@@ -158,6 +161,12 @@ void ApplicationFrameWork::on_action_file_quit() {
158161 Gtk::Main::quit();
159162 }
160163
164+void ApplicationFrameWork::on_action_file_close() {
165+ std::vector<ApplicationWindow*> closes;
166+ closes.push_back(this);
167+ close_windows(closes);
168+}
169+
161170 void ApplicationFrameWork::on_action_edit_copy() {
162171 std::cout << "edit copy activated" << std::endl;
163172 }
--- a/src/application_framework.hxx
+++ b/src/application_framework.hxx
@@ -44,6 +44,7 @@ public:
4444 protected:
4545 void build_menubar();
4646 virtual void on_action_file_quit();
47+ virtual void on_action_file_close();
4748 virtual void on_action_edit_copy();
4849 virtual void on_action_view_refresh();
4950 virtual void on_action_view_stop();
Show on old repository browser