ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
THStockFrame.h
Go to the documentation of this file.
1 /* \file THStockFrame.h
2  *
3  * Used to paint an Embedded CanvasTHStock, include Slider here.
4  * Added pointer to a controller, cannot have signal in controller ?? ( without dictionary )
5  *
6  *
7  * Last Changed $Id: THStockFrame.h 501 2014-10-09 17:34:50Z martinml $
8  */
9 
10 #ifndef _THSTOCKFRAME_H
11 #define _THSTOCKFRAME_H
12 
13 //for ACLiC and cout
14 #include <iostream>
15 #include <TCanvas.h>
16 
17 // a lot can be forwarded or even eliminated soon
18 //#include "../src_cpp/Stock.h"
19 // some needed for ListData
20 #include "../ObjectStock/THStock.h"
21 #include "../CanvasStock.h"
22 //#include "../CommonXAxis.h"
23 
24 // gROOT not known
25 #include <TROOT.h>
26 
27 //these only needed for CINT
28 #include <TGClient.h>
29 #include <TGFrame.h>
30 #include <TRootEmbeddedCanvas.h>
31 #include <TGDoubleSlider.h>
32 #include <TGButton.h>
33 #include <RQ_OBJECT.h>
34 
36 
44 // need to derive from a TGFrame or can contain one ?
45 // if derive profit by default of all members, THStockFrame is a Frame
47 {
48  //to get signal/slots, because do not derive from TGMainFrame
49  //no need derive from TQObject
50  RQ_OBJECT("THStockFrame")
51 
52  private:
53  // not yet working with signal/slot with controller
55 
57  // maybe not needed ?
58  TRootEmbeddedCanvas *fECanvas;
61 
62  // Need a vertical frame to group the 2 buttons and the slider
64  //Slider for each frame
65  TGDoubleHSlider *fHslider1;
66  //2 Button for modifying slider of small value
67  TGTextButton * fButslider[2];
68 
69  public:
71  THStockFrame(const TGWindow *p, const char *, UInt_t w,UInt_t h);
72  virtual ~THStockFrame();
73 
76 
77  // general view stuffs
79  void SetController( ControllerIndicatorTHStock *controller ) {fcontroller = controller;}
80 
81  // has to be done in GUIMainFrame which own the list of couple
82  //void SetCurrentTHStockFrame( std::string frame_name );
83 
85  Double_t GetSliderMin() {return fHslider1->GetMinPosition();}
86  Double_t GetSliderMax() {return fHslider1->GetMaxPosition();}
87 
88  //slots, stuffs dealing with slider could be in sub-controller ?? need function for signals
89  void DoSlider();
90  void HandleButton();
91 
92  // cannot connect from a controller, so need controller reference
93  //ConnectToController( child_controller );
94 
95  // used ??
96  void GetSignalSelected( TVirtualPad*,TObject*,Int_t );
97 
98  // deal with it in MainIndicatorTHstockFrame
99  //void EventInfo(Int_t, Int_t px, Int_t py, TObject *selected);
101  //void Update();
102 
104 };
105 
106 #endif /* _THSTOCKFRAME_H */
Owns a vector of THStock.
Definition: CanvasStock.h:53
void GetSignalSelected(TVirtualPad *, TObject *, Int_t)
ControllerIndicatorTHStock * GetController()
Definition: THStockFrame.h:78
virtual ~THStockFrame()
TGTextButton * fButslider[2]
Definition: THStockFrame.h:67
TRootEmbeddedCanvas * fECanvas
contain one embedded CanvasStock
Definition: THStockFrame.h:58
Final controller class, does not derive from ListController.
CanvasStock * GetECanvas()
General function, for tests but may be kept later.
Definition: THStockFrame.h:75
THStockFrame(const TGWindow *p, const char *, UInt_t w, UInt_t h)
constructor, destructor
TGHorizontalFrame * fslider_frame
Definition: THStockFrame.h:63
CanvasStock * fCStock
1 CanvasStock for each frame, easier
Definition: THStockFrame.h:60
Contains an EmbeddedCanvas and a CanvasStock.
Definition: THStockFrame.h:46
void SetController(ControllerIndicatorTHStock *controller)
Definition: THStockFrame.h:79
TGDoubleHSlider * fHslider1
Definition: THStockFrame.h:65
Double_t GetSliderMin()
access to the slider position
Definition: THStockFrame.h:85
ControllerIndicatorTHStock * fcontroller
Definition: THStockFrame.h:54
Double_t GetSliderMax()
Definition: THStockFrame.h:86
ClassDef(THStockFrame, 0)
coming from StockManager
void HandleButton()