ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MainIndicatorTHStockFrame.h
Go to the documentation of this file.
1 
8 #ifndef _MAININDICATORTHSTOCKFRAME_H_
9 #define _MAININDICATORTHSTOCKFRAME_H_
10 
11 #include <iostream>
12 
13 // available for
14 #include <TGFrame.h>
15 #include <TGLabel.h>
16 #include <TGNumberEntry.h>
17 #include <TGMenu.h>
18 #include <TGToolBar.h>
19 #include <TG3DLine.h>
20 #include <TGComboBox.h>
21 #include <TGStatusBar.h>
22 #include <TGComboBox.h>
23 #include <TGTextEntry.h>
24 
26 class THStockFrame;
27 class IndicatorFrame;
28 
44 // If derive from TGMainFrame, the frames scales correctly
46 {
47  private :
48  // better here, not global
51  ktoto //kChoiceDate
52  };
53 
56 
61 
62  // all theses other frames are generic, created in constructor
63  // maybe can deleted from data_member
64  //TGHorizontalFrame * fHIndicTHStock;
65 
66  //horizontal frame for ToolBar and combox box(es)
68  TGToolBar *ftoolbar;
69 
71  //deal with research text entry, pointer necessary to read the values
72  TGLabel *fLabelSearch;
73  TGTextEntry *fTextResearch;
74  //deal with combox time and indicator
75  TGComboBox *fComboTime;
76  //deal with combo indic
77  TGComboBox *fComboIndic;
78  //deal with entry parameters for indicator SMA,MACD,..., has to be hidden/showed, max 2
79  TGTextEntry *fParamEntry[3];
80  // Check button
81  TGCheckButton *check_to_add_canvas;
82  // to add if want an independent frame
83  TGCheckButton *check_to_make_main;
84 
86  // could react to return as well
87  TGTextButton *fValidB;
88 
89  // include the status bar here, but need vertical layout, default ?
90  TGStatusBar *fStatusBar;
91 
92  // if here, not global, need static variable to be initialized in *.cxx
93  static const char * xpms[];
94  static const char * tips[];
95  static const char * ListTimeScaleLabel[];
96  // static and const could be setup in the header ?? c++11 ??
97  static Int_t statbar_parts[];
98 
99  void CreateToolBar( TGVerticalFrame * fVMain );
100 
101  public :
106  MainIndicatorTHStockFrame( const TGWindow *p, MainControllerIndicatorTHStock *parent_control,
107  std::string name_frame, UInt_t w,UInt_t h );
108  virtual ~MainIndicatorTHStockFrame();
109 
110  // if independent frame, able to close it directly
111  virtual void CloseWindow();
112 
114  void SetTextResearch( std::string new_text ) { fTextResearch->SetText( new_text.c_str()); }
115  // may not the best, mixing enum and integer, make be cleaner
116  void SetTimeScale( int tmscl ) { fComboTime->Select( tmscl + 10 ); }
117 
121  // just for test, rescaling main frame problem
122  //TGHorizontalFrame * GetIndicTHStockFrame() {return fHIndicTHStock;}
123 
125  void ResetEntries();
126 
128  bool ToAddCanvas() {return check_to_add_canvas->IsOn() ? true : false;}
129  bool ToMakeMain() {return check_to_make_main->IsOn() ? true : false;}
131  void ExtractInfoForValidation( std::string & longname );
132 
134  void HandleButtons( Int_t id = -1 );
135  void HandleComboBox ( Int_t widgetId, Int_t id);
136  void HandleToolBar ( Int_t id );
137 
141  void EventInfo(Int_t, Int_t px, Int_t py, TObject *selected);
143  void SetStatusBar ( std::vector<std::string> & vec_str_text );
144 
146 };
147 
148 #endif /* _MAININDICATORTHSTOCKFRAME_H_ */
static const char * ListTimeScaleLabel[]
for TimeScale ComboxBox
void SetTextResearch(std::string new_text)
need for controller to set up
TGVerticalFrame * fVframe_indicator
frame for all indicators
Controller for a dual frame containing Indicator+THStock(s).
MainControllerIndicatorTHStock * fcontroller
pointer to the parent controller
void ResetEntries()
reset all widget entries, may add options
void CreateToolBar(TGVerticalFrame *fVMain)
void EventInfo(Int_t, Int_t px, Int_t py, TObject *selected)
Called after DistancetoPrimitive for the selection of "objects" Done by the system, appends after a gPad->SetSelected( obj_stock ) in THistPainterStock::DtP.
MainIndicatorTHStockFrame(const TGWindow *p, MainControllerIndicatorTHStock *parent_control, std::string name_frame, UInt_t w, UInt_t h)
Constructor, create only generic frames to design the output, but empty inserted in a generic frames ...
bool ToAddCanvas()
check state of button
TGTextButton * fValidB
Validation button, after update of search and combo.
TGHorizontalFrame * GetTHStockFrame() const
TGLabel * fLabelSearch
For selection and validation of a new indicator.
Contains an EmbeddedCanvas and a CanvasStock.
Definition: THStockFrame.h:46
void ExtractInfoForValidation(std::string &longname)
Extract symbol, timescale, indicator and paramaters from input.
Frame contains Indicator and THStock.
TGVerticalFrame * GetIndicatorFrame() const
get the important child frames for drawing
Show all data loaded in memory, allow to deal with Button.
ClassDef(MainIndicatorTHStockFrame, 0)
void HandleComboBox(Int_t widgetId, Int_t id)
static Int_t statbar_parts[]
for Status Bar, place in %, no in a namespace, need to be static
TGHorizontalFrame * fHframe_c_stock
frame for all THStockFrame ( 1 canvas stock inside each )
void SetStatusBar(std::vector< std::string > &vec_str_text)
print data from EventInfo in the status bar
static const char * tips[]
For ToolBar, define text.