00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef STOCKGUI_H
00019 #define STOCKGUI_H
00020
00021 #include <gtkmm.h>
00022 #include <iostream>
00023
00024 #include "Observer.h"
00025
00026 using namespace std;
00027
00028 class Stock;
00029
00034 class StockGui : public Gtk::Label , Observer{
00035 private:
00036 Gtk::Label *labelWkn, *labelBuyingDate;
00037 Gtk::SpinButton *spinButtonAmount, *spinButtonBuyingRate;
00038 Gtk::Label *labelPurchaseValue;
00039 Gtk::SpinButton *spinButtonPurchaseCost, *spinButtonCurrentMarketPrice;
00040 Gtk::Label *labelDayPerformance, *labelTotalMarketValue, *labelOverallPerformance;
00041 Gtk::Button *buttonInfo, *buttonChart;
00042 Gtk::Adjustment *adjustmentAmount, *adjustmentBuyingRate, *adjustmentPurchaseCost, *adjustmentCurrentMarketPrice;
00043
00044
00045 Stock *stock;
00046
00047 void eventAmountChanged();
00048 void eventBuyingRateChanged();
00049 void eventPurchaseCostChanged();
00050 void eventCurrentMarketPriceChanged();
00051
00052 void updateLabelPurchaseValue();
00053 void updateLabelDayPerformance();
00054 void updateLabelTotalMarketValue();
00055 void updateLabelOverallPerformance();
00056
00057 void eventButtonInfo();
00058 void eventButtonChart();
00059
00060
00061
00062 public:
00063 StockGui(Stock * const stock);
00064 ~StockGui();
00065
00066 Gtk::Label *getLabelWkn() const;
00067 Gtk::Label *getLabelBuyingDate() const;
00068 Gtk::SpinButton *getSpinButtonAmount() const;
00069 Gtk::SpinButton *getSpinButtonBuyingRate() const;
00070 Gtk::Label *getLabelPurchaseValue() const;
00071 Gtk::SpinButton *getSpinButtonPurchaseCost() const;
00072 Gtk::SpinButton *getSpinButtonCurrentMarketPrice() const;
00073 Gtk::Label *getLabelDayPerformance() const;
00074 Gtk::Label *getLabelTotalMarketValue() const;
00075 Gtk::Label *getLabelOverallPerformance() const;
00076 Gtk::Button *getButtonInfo() const;
00077 Gtk::Button *getButtonChart() const;
00078
00079 void update(const Subject *const subject);
00080
00081 };
00082
00083 #endif
00084