Main Page   Class Hierarchy   Data Structures   File List   Data Fields  

chartdialog.cpp

00001 /***************************************************************************
00002                           chartdialog.cpp  -  description
00003                              -------------------
00004     begin                : Wed Nov 6 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 "chartdialog.h"
00019 
00020 #include "stock.h"
00021 #include "chartdrawing.h"
00022 #include "config.h"
00023 
00024 #include <gtkmm/stock.h>
00025 
00029 ChartDialog::ChartDialog(const Stock * const stock) {
00030 
00031   ChartDialog::stock = stock;
00032 
00033   Gtk::VBox *vbox;
00034   Gtk::HButtonBox *hButtonBox;
00035   Gtk::Button *buttonClose;
00036   Gtk::HSeparator *hSep;
00037   
00038   set_title(stock->getName());
00039   set_border_width(5);
00040   //set_resizable(false);
00041   set_modal(false);
00042 
00043   // setting up the notebook and filling it with pages
00044   vbox = manage(new Gtk::VBox(false, 0));
00045   vbox->set_spacing(5);
00046   add(*vbox);
00047 
00048   chart = new ChartDrawing(stock);
00049   vbox->pack_start(*chart, Gtk::PACK_SHRINK, 0);
00050   
00051   hSep = manage(new Gtk::HSeparator());
00052   vbox->pack_start(*hSep, Gtk::PACK_SHRINK, 0);
00053   
00054   hButtonBox = manage( new Gtk::HButtonBox());
00055   hButtonBox->set_spacing(5);
00056   vbox->pack_start(*hButtonBox, Gtk::PACK_SHRINK, 0);
00057 
00058   buttonClose = manage(new Gtk::Button(Gtk::Stock::OK));
00059   buttonClose->signal_clicked().connect(slot(*this,&ChartDialog::quit));
00060   hButtonBox->pack_start(*buttonClose, Gtk::PACK_SHRINK, 0);
00061  
00062   show_all();
00063 }
00064 
00068 ChartDialog::~ChartDialog(){
00069   delete chart;
00070 }
00071 
00075 void ChartDialog::quit() {
00076   delete this;
00077 }
00078 
00083 bool ChartDialog::on_delete_event(GdkEventAny *event) {
00084   quit();
00085   return true;
00086 }

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