Main Page   Class Hierarchy   Data Structures   File List   Data Fields  

aboutdialog.cpp

00001 /***************************************************************************
00002                           aboutdialog.cpp  -  description
00003                              -------------------
00004     begin                : Sat Oct 26 2002
00005     copyright            : (C) 2002 by Michael Otto
00006     email                : Michael.Otto@saskathex.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include "aboutdialog.h"
00019 
00020 //#include "config.h"
00021 
00022 #include "creditsdialog.h"
00023 #include <gtkmm/stock.h>
00024 
00028 AboutDialog::AboutDialog(){
00029 
00030   Gtk::VBox *vbox;
00031   Gtk::HButtonBox *hButtonBox;
00032   Gtk::Button *buttonOk, *buttonCredits;
00033   Gtk::Label *label;
00034   Gtk::HSeparator *hSep;
00035 
00036 #ifdef DEBUG
00037   cout << "starting About Dialog" << endl;
00038 #endif  
00039   set_title("About");
00040   set_border_width(5);
00041   set_resizable(false);
00042   set_modal(false);
00043   vbox = manage(new Gtk::VBox(false, 0));
00044   vbox->set_spacing(5);
00045   add(*vbox);
00046 
00047   label = manage (new Gtk::Label("gstockcalc 0.17.5"));
00048   vbox->pack_start(*label, Gtk::PACK_SHRINK, 0);
00049   label = manage (new Gtk::Label("Stocks and custody account management tool"));
00050   vbox->pack_start(*label, Gtk::PACK_SHRINK, 0);
00051   label = manage (new Gtk::Label("Copyright (c) 2002-2003 Michael Otto"));
00052   vbox->pack_start(*label, Gtk::PACK_SHRINK, 0);
00053   
00054   hSep = manage(new Gtk::HSeparator());
00055   vbox->pack_start(*hSep, Gtk::PACK_SHRINK, 0);
00056   hButtonBox = manage( new Gtk::HButtonBox());
00057   hButtonBox->set_spacing(5);
00058   vbox->pack_start(*hButtonBox, Gtk::PACK_SHRINK, 0);
00059   buttonCredits = manage( new Gtk::Button("Credits"));
00060   buttonCredits->signal_clicked().connect(slot(*this,&AboutDialog::showCredits));
00061   hButtonBox->pack_start(*buttonCredits, Gtk::PACK_SHRINK, 0);
00062   buttonOk = manage( new Gtk::Button(Gtk::Stock::OK));
00063   buttonOk->signal_clicked().connect(slot(*this,&AboutDialog::quit));
00064   hButtonBox->pack_start(*buttonOk, Gtk::PACK_SHRINK, 0);
00065   show_all();
00066 }
00067 
00068 
00072 AboutDialog::~AboutDialog(){
00073 }
00074 
00078 void AboutDialog::quit() {
00079 #ifdef DEBUG
00080   cout << "quiting About Dialog" << endl;
00081 #endif
00082   delete this;
00083 }
00084 
00088 void AboutDialog::showCredits() {
00089   new class CreditsDialog();
00090 }                 
00091 
00092 
00097 bool AboutDialog::on_delete_event(GdkEventAny *event) {
00098   quit();
00099   return true;
00100 }

Generated on Tue May 27 21:24:01 2003 for gstockcalc by doxygen1.3-rc3