ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IndicatorFrame.h
Go to the documentation of this file.
1 /* \file IndicatorFrame.h
2  *
3  * Class IndicatorFrame and IndicatorFrameLabel
4  *
5  * Frame for indicator, entries text label of loaded data and indicators
6  *
7  * Always 1 Indicator - 1 THStockFrame with 1 ControllerIndicatorFrame
8  *
9  * Should allow to modif one value, EMA for instance ( new EMA done by GUIMainStock ), not yet possible
10  *
11  * Allow to hide/show any indicator
12  * modify defaukt color
13  * delete one indicator (really delete from stockmanager)
14  *
15  * Last changed: $Id: IndicatorFrame.h 501 2014-10-09 17:34:50Z martinml $
16  */
17 
18 #ifndef _INDICATOR_FRAME_H_
19 #define _INDICATOR_FRAME_H_
20 
21 //for ACLiC and cout
22 #include <iostream>
23 #include <string>
24 #include <vector>
25 
26 // forward, declared after
28 
29 // link to the controller, avoid signal/slot
31 
32 // gROOT not known
33 //#include <TROOT.h>
34 
35 // these only needed for CINT
36 #include <TGFrame.h>
37 #include <TGLabel.h>
38 
39 #include <RQ_OBJECT.h>
40 
52 {
53  //to get signal/slots, because do not derive from TGMainFrame
54  RQ_OBJECT("IndicatorFrame")
55 
56  //no need private member, use base class fList
57  private:
59 
60  public:
61  // Add name of the frame in the constructor, similar to THStockFrame in this case
62  // why not send the controller at the same time ??
63  IndicatorFrame(const TGWindow *p, const char *name_frame, UInt_t w,UInt_t h);
64  virtual ~IndicatorFrame();
65 
66  // could be set by constructor
68  void SetController( ControllerIndicatorTHStock *controller ) {fcontroller = controller;}
69 
70  /* */
71  bool CheckFirstPad ( std::string fullname );
72  bool CheckFirstPad ();
73 
76  void AddIndicator( std::string, int color );
77 
79  //TGHorizontalFrame * MakeLineLabel ( std::string fullname );
80 
82  void DeleteLines( std::string fullname );
84  void HideLines ();
85  void ShowLines ();
86 
90  void HandleButtons();
92  void PrintList();
93 
95 };
96 
104 {
105  //to get signal/slots, because do not derive from TGMainFrame
106  RQ_OBJECT("IndicatorFrameLabel")
107 
108  private :
110  TGLabel *flabel_indic;
112  // used by IndicatorFrame and MaInindicatorFrame
113  // could be fTGColor
114  Pixel_t fcolor_indic;
115 
116  public :
118  IndicatorFrameLabel ( const TGWindow *p, const char *label, const char *fullname, const int color ); //, UInt_t nb_pad_printed );
120 
122  void MakeLineLabel ( std::string fullname, const int color );
123 
124  //void ChangeColor() {}; //*MENU*
125  Pixel_t GetColorLabel () const { return fcolor_indic;}
126 
128  void SetColorLabel( Pixel_t color );
129 
131 };
132 
133 #endif /* _INDICATOR_FRAME_H_ */
void HideLines()
hide/show all lines, except the first one
IndicatorFrameLabel(const TGWindow *p, const char *label, const char *fullname, const int color)
constructor
TGLabel * flabel_indic
simple label with indicator name, can change color of the label
Deal with labels in IndicatorFrame.
ControllerIndicatorTHStock * fcontroller
IndicatorFrame(const TGWindow *p, const char *name_frame, UInt_t w, UInt_t h)
virtual ~IndicatorFrame()
void DeleteLines(std::string fullname)
new unique for Label and Indicator
void HandleButtons()
manages all buttons of IndicatorFrameLabel.
ControllerIndicatorTHStock * GetController()
Final controller class, does not derive from ListController.
Pixel_t fcolor_indic
keep memory of the color of the associated indicator
Pixel_t GetColorLabel() const
ClassDef(IndicatorFrame, 0)
void MakeLineLabel(std::string fullname, const int color)
create a line with label and all buttons
void SetColorLabel(Pixel_t color)
Slot when color is changed, modify the text label color.
Show all data loaded in memory, allow to deal with Button.
void SetController(ControllerIndicatorTHStock *controller)
void PrintList()
for debug
ClassDef(IndicatorFrameLabel, 0)
void AddIndicator(std::string, int color)
Add an indicator , call MakeLineLabel now should be called by ControllerIndicatorTHStockFrame.