ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TransientFrame.h
Go to the documentation of this file.
1 
9 // see link for debugging ROOT
10 // http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=10496&p=45231&hilit=TGTransientFrame#p45231
11 // waiting a menu close
12 // http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=1189&p=4169&hilit=TGTransientFrame#p4169
13 // maybe a easy solution, for accessing data
14 // http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=738&p=2654&hilit=TGTransientFrame#p2654
15 
16 #ifndef TRANSIENTFRAME_H_
17 #define TRANSIENTFRAME_H_
18 
19 #include <iostream>
20 //#include <TGGC.h>
21 #include <TGClient.h>
22 #include <TGFrame.h>
23 #include <TGLabel.h>
24 #include <TGNumberEntry.h>
25 
26 #include <TQObject.h>
27 #include <RQ_OBJECT.h>
28 
29 #include "../utils/Utils.h"
30 #include "../utils/TimeScale.h"
31 #include "../utils/FullName.h"
32 #include "../utils/Indicator.h"
33 
34 #include "GUIException.h"
35 
36 // for TransDateBox
37 class Stock;
38 
39 // usefull to get a base class, always needed TGwindow constructor
41 {
42  RQ_OBJECT("TransFrameGUI")
43  public :
44  TransFrameGUI( const TGWindow *p, const TGWindow *main );
45  // Need destructor
47 
48  // nothing, or a general way to print the error/text ??
49  // nothing better
50  //private :
51  protected :
52  /* cool if can make in base class */
53  // all use those variable
56  TGLayoutHints *fL1;
57 
60  TGTextButton *fBcancel,*fBvalid,*fBretry;
61 
62 
64  virtual void BuildInterface() = 0;
66  virtual void CreateButtons( unsigned int mode=1 );
67  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t /*parm2*/);
68  virtual void FinalizeTransGUI();
69 
71 
72 };
73 
75 {
76  RQ_OBJECT("TransFrameError")
77  public :
78  // minimum to set up base class
79  //TransFrameError( const TGWindow *p, const TGWindow *main );
80  // more useful constructor
81  //TransFrameError( const TGWindow *p, const TGWindow *main, std::string message );
82  // even more usefull, always ref for exception
83  TransFrameError( const TGWindow *p, const TGWindow *main, const GUIException & fError );
84 
85  protected :
87  TGLabel *fLabel;
88 
89  virtual void BuildInterface();
90 
92 };
93 
95 {
96  RQ_OBJECT("TransDateBox")
97  private :
98 
100  TGLabel *fLabel[2];
101  TGNumberEntry *fNumericEntries[2];
102  TGCheckButton *fCheckButton[2];
103 
107  //Indicator findic;
108  // cannot pass by reference ?
110  bool *bvalid;
111 
112  // if use stock, no need of reference, stock will survive and be updated
113  // for simplicity make a real copy
115  // if modified, by button keep previous in memory
116  // ftrans_data is modified directly
117  time_t memo_date;
118 
119  public :
120  // constructors
121  TransDateBox ( const TGWindow *p, const TGWindow *main );
122  TransDateBox ( const TGWindow *p, const TGWindow *main, Stock *stock,
123  ETime & tmscl, Indicator & indic, Utils::firstlast_dates & dates, bool * to_insert );
124  // destructors and for closing the window
125  virtual ~TransDateBox() {
126 #ifdef DEBUG_CONT_FRAME
127  std::cout << "Destructor TransDataBox" << std::endl;
128 #endif
129  // cannot delete, error !! Cleanup ??
130  //delete fvframe0; fvframe0=0; ftrans_data = 0; fload_last = 0;
131  };
132  virtual void CloseWindow();
133 
134  void BuildInterface();
135  Bool_t Valid();
136  //Bool_t Valid( Utils::firstlast_dates dates = Utils::get_fldate_default() );
137  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t /*parm2*/);
138 
140 };
141 
142 #endif /* TRANSIENTFRAME_H_ */
TGLayoutHints * fL1
Layout for global, date entry and label.
Stock * fstock
internal use
"Clever" enumeration of the ListDataStock type : StockCSV, Volume, EMA, BOLL,...
Definition: Indicator.h:29
TGHorizontalFrame * fFdate[2]
void BuildInterface()
need overwrite by all sub-classes
TGLabel * fLabel
specific to this subclass
TransFrameGUI(const TGWindow *p, const TGWindow *main)
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t)
virtual void BuildInterface()=0
need overwrite by all sub-classes
virtual void BuildInterface()
need overwrite by all sub-classes
TransFrameError(const TGWindow *p, const TGWindow *main, const GUIException &fError)
bool * bvalid
true if cancel is chosen, to_insert in calling
TransDateBox(const TGWindow *p, const TGWindow *main)
Utils::firstlast_dates ftrans_data
TGHorizontalFrame * fValid
Button for Validation.
TGVerticalFrame * fvframe0
Main class to deal with one stock.
Definition: Stock.h:56
ETime
Enumeration for the different time representation, from instantaneous (INST) to year(YEAR) ...
Definition: TimeScale.h:48
TGTextButton * fBvalid
ClassDef(TransFrameGUI, 0)
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t)
virtual void CloseWindow()
TGLabel * fLabel[2]
TGTextButton * fBcancel
TGCheckButton * fCheckButton[2]
TGTextButton * fBretry
virtual void CreateButtons(unsigned int mode=1)
called by all sub-classes
general structure for dates in csv files
Definition: Utils.h:54
int main(int argc, char *argv[])
TGNumberEntry * fNumericEntries[2]
virtual void FinalizeTransGUI()
virtual ~TransDateBox()