ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TransientFrame.cxx
Go to the documentation of this file.
1 
8 #include "TransientFrame.h"
9 #include "../src_cpp/Stock.h"
10 
11 //#include "GUIException.h"
12 
13 //for ROOT dictionnary, gc say ; extra, change nothing for bug
17 
18 TransFrameGUI::TransFrameGUI( const TGWindow * p, const TGWindow * main) :
19  TGTransientFrame(p, main, 10, 10, kHorizontalFrame), fvframe0(0), fL1(0),
20  fValid(0),fBcancel(0),fBvalid(0),fBretry(0)
21 {
22 #ifdef DEBUG_CONT_FRAME
23  std::cout << "Constructor base class TransFrameGUI " << std::endl;
24 #endif
25 
26  // enought if put in base class ??
27  // use hierarchical clean up
28  SetCleanup(kDeepCleanup);
29 }
30 
31 void TransFrameGUI::CreateButtons( unsigned int mode )
32 {
33  // make button close and valid
34  TGLayoutHints *fLB = new TGLayoutHints(kLHintsCenterX,10,10,10,10);
36  fvframe0->AddFrame( fValid, fLB );
37 
38  // not find CloseWindow() ??
39  //fBcancel = new TGTextButton(fValid,"&Cancel","CloseWindow()");
40  // only one button, can just continue
41  if ( mode == 1 ) {
42  fBcancel = new TGTextButton( fValid, "&Continue", 1 );
43  // very important for ProcessMessage()
44  // test other dependencies...
45  fBcancel->Associate(this);
46  fValid->AddFrame( fBcancel, new TGLayoutHints(kLHintsCenterX,5,5,3,4 ) );
47  }
48  //default 2 buttons, cancel, Valid
49  if ( mode >= 2) {
50  fBcancel = new TGTextButton( fValid, "&Cancel", 1 );
51  fBcancel->Associate(this);
52  fValid->AddFrame( fBcancel, new TGLayoutHints(kLHintsCenterX,5,5,3,4 ) );
53  // Valid button
54  fBvalid = new TGTextButton(fValid,"&Valid", 2 );
55  fBvalid->Associate(this);
56  // add
57  fValid->AddFrame( fBvalid , new TGLayoutHints(kLHintsCenterX,5,5,3,4 ) );
58  }
59 }
60 
61 Bool_t TransFrameGUI::ProcessMessage(Long_t msg, Long_t parm1, Long_t /*parm2*/)
62 {
63 
64 #ifdef DEBUG_CONT_FRAME
65  std::cout << "TransFrameGUI::ProcessMessage " << " " << msg << " " << parm1 << std::endl;
66 #endif
67 
68  int status;
69 
70  switch (GET_MSG(msg)) {
71  case kC_COMMAND:
72  {
73  switch (GET_SUBMSG(msg)) {
74  case kCM_BUTTON:
75  {
76  switch (parm1) {
77  // exit button
78  case 1:
79  {
80  //*bvalid = false;
81  CloseWindow();
82  break;
83  }
84  // set button
85  case 2:
86  {
87  // could be default base class //Valid();
88  //std::cout << "Will close the window" << std::endl;
89  CloseWindow();
90  break;
91  }
92  }
93  break;
94  }
95  }
96  break;
97  }
98  }
99  return kTRUE;
100 }
101 
103 {
104  // here very general, could be in base class
105  // FinaliseTransGUI();
106  // resize & move to center
107  MapSubwindows();
108  UInt_t width = GetDefaultWidth();
109  UInt_t height = GetDefaultHeight();
110  Resize(width, height);
111 
112  // no effect ??
113  CenterOnParent();
114 
115  // make the message box non-resizable
116  SetWMSize(width, height);
117  SetWMSizeHints(width, height, width, height, 0, 0);
118  SetMWMHints(kMWMDecorAll | kMWMDecorResizeH | kMWMDecorMaximize |
119  kMWMDecorMinimize | kMWMDecorMenu,
120  kMWMFuncAll | kMWMFuncResize | kMWMFuncMaximize |
121  kMWMFuncMinimize, kMWMInputModeless);
122 
123  MapWindow();
124  // all will call, this is ok here ??
125  fClient->WaitFor(this);
126 }
127 
129 /*
130 TransFrameError::TransFrameError( const TGWindow * p, const TGWindow * main) :
131  TransFrameGUI( p, main ), fLabel(0)
132 {
133 #ifdef DEBUG_CONT_FRAME
134  std::cout << "Constructor TransFrameError " << std::endl;
135 #endif
136  // use hierarchical clean up, no need destructor
137  // already in base class, needed again, maybe slicing kind
138  // not sure
139  SetCleanup(kDeepCleanup);
140 }
141 */
142 
143 /*
144 TransFrameError::TransFrameError( const TGWindow * p, const TGWindow * main, std::string message ) :
145  TransFrameGUI( p, main )
146 {
147 #ifdef DEBUG_CONT_FRAME
148  std::cout << "Constructor TransFrameError with message " << std::endl;
149 #endif
150  // use hierarchical clean up, no need destructor
151  // present in base class, really needed here ? to test simple script / example
152  //SetCleanup(kDeepCleanup);
153  // need to be specific
154  BuildInterface();
155 
156  fLabel->ChangeText( message.c_str() );
157 
158  // can use a base class function, with options, default 1
159  CreateButtons( 1 );
160 
161  // general for all, could use exception directly ??
162  SetWindowName("ErrorFrame");
163  SetIconName("ErrorFrame");
164  SetClassHints("ErrorFrame", "ErrorFrame");
165 
166  // here very general, in base class
167  FinalizeTransGUI();
168 }
169 */
170 
171 // const seems a problem for casting
172 TransFrameError::TransFrameError( const TGWindow * p, const TGWindow * main, const GUIException & fError ) :
173  TransFrameGUI( p, main )
174 {
175 #ifdef DEBUG_CONT_FRAME
176  std::cout << "Constructor TransFrameError with GUIException " << std::endl;
177 #endif
178 
179 #ifdef DEBUG_EXCEPT
180  std::cout << "TransFrame: No cast GUIStockException.what() " << fError.what() << std::endl;
181 #endif
182  // use hierarchical clean up, no need destructor
183  // present in base class, really needed here ? to test simple script / example
184  SetCleanup(kDeepCleanup);
185  // need to be specific, some option for slight change
186  BuildInterface();
187 
188  // assign the error message
189  fLabel->ChangeText( fError.what() );
190 
191  // can use a base class function, with options, default 1
192  CreateButtons( 1 );
193 
194  // general for all, could use exception directly ??
195  SetWindowName("ErrorFrame");
196  SetIconName("ErrorFrame");
197  SetClassHints("ErrorFrame", "ErrorFrame");
198 
199  // here very general, in base class
201 }
202 
204 {
205 #ifdef DEBUG_CONT_FRAME
206  std::cout << "Build interface of TransFrameError from constructor" << std::endl;
207 #endif
208 
209  // very general, could be in base class
210  fvframe0 = new TGVerticalFrame(this,100,60);
211  fL1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
212  AddFrame ( fvframe0, fL1 );
213 
214  // specific
215  fLabel = new TGLabel( this, "toto should make a message longer");
216  fvframe0->AddFrame(fLabel, fL1);
217 
218  // need buttons to continue
219 
220 /*
221 #ifdef DEBUG_CONT_FRAME
222  std::cout << "End Build interface of TransFrameError " << std::endl;
223 #endif
224 */
225 }
226 
228 
229 // not used default, may be in a base class...later
230 TransDateBox::TransDateBox(const TGWindow * p, const TGWindow * main)
231  : TransFrameGUI(p, main ) // 10, 10, kHorizontalFrame)
232 {
233 #ifdef DEBUG_CONT_FRAME
234  // build widgets
235  std::cout << "Constructor TransDateBox default, shoud not be used" << std::endl;
236 #endif
237 
238  // use hierarchical clean up
239  SetCleanup(kDeepCleanup);
240 
241  // seems general, do not compile
242  //TGGC myGC = *fClient->GetResourcePool()->GetFrameGC();
243  //TGFont *myfont = fClient->GetFont("-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1");
244  //if (myfont) myGC.SetFont(myfont->GetFontHandle());
245 
246  // build interface
247  //BuildInterface();
248 
249 
250  // rest copy from example EntryTestDlg::EntryTestDlg
251  // set dialog box title
252  //SetWindowName("Number Entry Test");
253  //SetIconName("Number Entry Test");
254  //SetClassHints("NumberEntryDlg", "NumberEntryDlg");
255 
256  // can use a base class function, with options, default 1
257  //CreateButtons( 3 );
258 
259  //FinalizeTransGUI();
260 }
261 
262 /*
263 TransDateBox::TransDateBox(const TGWindow * p, const TGWindow * main, Stock *stock, bool & to_insert )
264  : TransFrameGUI(p, main )
265 {
266  std::cout << "Constructor TransDateBox with argument stock" << std::endl;
267  //std::cout << trans_data.last << std::endl;
268 
269  // use hierarchical clean up
270  SetCleanup(kDeepCleanup);
271 
272  //std::cout << " copy pointer to stock " << stock << std::endl;
273  fstock = stock;
274  // used only for output
275  bvalid = to_insert;
276 
277  // keep the pointer for modification possible
278  //ftrans_data = &trans_data;
279  // here force the timescale, but need to change it !
280  // need timescale
281  // here need the ListData, not created yet
282  //ftrans_data = fstock->GetDatesCSV( DAY );
283  // can be done before, safer for error
284  fstock->Read_Header( DAY, ftrans_data );
285  std::cout << "check copy date " << ftrans_data.first << " " << ftrans_data.last << std::endl;
286 
287  BuildInterface();
288 
289  // can use a base class function, with options, default 1
290  CreateButtons( 3 );
291 
292  SetWindowName("Validation");
293  SetIconName("ValidationFrame");
294  SetClassHints("ValidationFrame", "ValidationFrame");
295 
296  FinalizeTransGUI();
297 
298 }
299 */
300 // Need more parameters to be sure of the indicator to check
301 // timescale should be enought to decide StockCSV or StockInst
302 TransDateBox::TransDateBox(const TGWindow * p, const TGWindow * main, Stock *stock,
303  ETime & tmscl, Indicator & indic, Utils::firstlast_dates & dates, bool * to_insert )
304  : TransFrameGUI(p, main )
305 {
306 #ifdef DEBUG_CONT_FRAME
307  std::cout << "Constructor TransDateBox with all arguments " << std::endl;
308 #endif
309  // use hierarchical clean up
310  SetCleanup(kDeepCleanup);
311 
312  //std::cout << " copy pointer to stock " << stock << std::endl;
313  fstock = stock;
314  ftmscl = tmscl;
315  ftrans_data = dates;
316  // used only for output, false means cancel
317  //bvalid = to_insert; bcancel would be better
318  bvalid = to_insert;
319 
320  BuildInterface();
321  // can use a base class function, with options, default 1
322  CreateButtons( 2 );
323 
325 }
326 
328 #ifdef DEBUG_CONT_FRAME
329  std::cout << "Entry TransDateBox::CloseWindow()" << std::endl;
330 #endif
331  DeleteWindow();
332 }
333 
335 
336 #ifdef DEBUG_CONT_FRAME
337  std::cout << "TransDateBox::BuiltInterface " << std::endl;
338 #endif
339 
340  // pointer, will reference first and last date of stock
341  struct tm * date_tm;
342 
343  fvframe0 = new TGVerticalFrame(this,100,60);
344  // global
345  fL1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
346  AddFrame ( fvframe0, fL1 );
347 
348  // Layout for date entry and label
349  TGLayoutHints *fL2 = new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 2, 2, 2);
350  // create entry for date debut et fin
351  fFdate[0] = new TGHorizontalFrame(fvframe0, 100, 30);
352  fvframe0->AddFrame(fFdate[0], fL2);
353 
354  // val digit id kNESDayMYear
355  fNumericEntries[0] = new TGNumberEntry(fFdate[0], ftrans_data.first, 12 ,1 , (TGNumberFormat::EStyle) 10 );
356 
357  fNumericEntries[0]->Associate(this);
358  fFdate[0]->AddFrame(fNumericEntries[0], fL2 );
359  fLabel[0] = new TGLabel(fFdate[0], "date debut" ); //, myGC(), myfont->GetFontStruct());
360  fFdate[0]->AddFrame(fLabel[0], fL2 );
361  // second field
362  fFdate[1] = new TGHorizontalFrame(fvframe0, 100, 30);
363  fvframe0->AddFrame(fFdate[1], fL2 ); //, fL2);
364  // val digit id kNESDayMYear
365  fNumericEntries[1] = new TGNumberEntry(fFdate[1], ftrans_data.last, 12 ,2 , (TGNumberFormat::EStyle) 10 );
366 
367  fNumericEntries[1]->Associate(this);
368  fFdate[1]->AddFrame(fNumericEntries[1], fL2 );
369  fLabel[1] = new TGLabel(fFdate[1], "date fin" ); //, myGC(), myfont->GetFontStruct());
370  fFdate[1]->AddFrame(fLabel[1], fL2 );
371 
372  // CheckButton
373  fCheckButton[0] = new TGCheckButton ( fvframe0, "Load data up to now", 3 );
374  fvframe0->AddFrame(fCheckButton[0], new TGLayoutHints(kLHintsLeft, 10, 2, 10, 2));
375  fCheckButton[0]->Associate(this);
376  fCheckButton[1] = new TGCheckButton ( fvframe0, "Get data intro", 4 );
377  fvframe0->AddFrame(fCheckButton[1], new TGLayoutHints(kLHintsLeft, 10, 2, 5, 2));
378  fCheckButton[1]->Associate(this);
379 
380  // set the initial dates of the numeric entries
381  date_tm = localtime( &(ftrans_data.first) );
382  //std::cout << "SetDate " << (*date_tm).tm_year << std::endl ;
383  fNumericEntries[0]->SetDate( (*date_tm).tm_year + 1900, (*date_tm).tm_mon + 1, (*date_tm).tm_mday );
384  date_tm = localtime( &(ftrans_data.last) );
385  fNumericEntries[1]->SetDate( (*date_tm).tm_year + 1900, (*date_tm).tm_mon + 1, (*date_tm).tm_mday );
386 
387  return;
388 }
389 
390 Bool_t TransDateBox::ProcessMessage(Long_t msg, Long_t parm1, Long_t /*parm2*/)
391 {
392 #ifdef DEBUG_CONT_FRAME
393  std::cout << "TransDateBox::ProcessMessage " << " " << msg << " " << parm1 << std::endl;
394 #endif
395  switch (GET_MSG(msg)) {
396  case kC_COMMAND:
397  {
398  switch (GET_SUBMSG(msg)) {
399  case kCM_BUTTON:
400  {
401  switch (parm1) {
402  // exit button
403  case 1:
404  {
405 #ifdef DEBUG_CONT_FRAME
406  std::cout << "Press button Case 1 Cancel?" << std::endl;
407 #endif
408  *bvalid = false;
409  CloseWindow();
410  break;
411  }
412  // set button
413  case 2:
414  {
415  // Valid may throw a GUIStockException
416  try {
417 
418  // here should test
419  Valid();
420  //std::cout << "After Valid() all is fine, can close and quit TransFrame" << std::endl;
421  // if fine, can quit
422  *bvalid = true;
423  CloseWindow();
424  // here ok get the exception, but cannot throw it
425  // process message not good for this !
426  } catch ( const GUIException & e ) {
427  std::cout << "TransDataBox Process Message got a GUIException " << std::endl;
428  // reset valid to false, not necessary
429  *bvalid = false;
430  }
431  // apply only if no error, otherwise allow the user to choose what to do...
432  // here should set to true
433  //*bvalid = true;
434  //std::cout << "after Valid() does not close the window" << std::endl;
435  // strange if not closed, not draw after Valid
436  //CloseWindow();
437  break;
438  }
439  }
440  break;
441  }
442 
443  case kCM_CHECKBUTTON:
444  {
445  //std::cout << "CheckButon param1=" << parm1 << std::endl;
446  switch (parm1) {
447  // case load data up to now
448  // but no data have been loaded yet,
449  // need to split, load the data and then update !
450  // GUI: nice if we can change the dates(date debut), check the button, and call valid !
451  // not running script when click the button
452  // update to now, set up the new dates, need to be checedk with Valid()
453  case 3:
454  {
455  //std::cout << "get date today" << std::endl;
456  if ( fCheckButton[0]->IsDown() ) {
457 #ifdef DEBUG_CONT_FRAME
458  std::cout << "button is down" << std::endl;
459 #endif
460 
461  // needed for UpdateCSV
463  // memorize before deleting
465  //std::cout << "make a copy of dates.last " << memo_date << " " << dates.last;
466 
467  int year, month, day;
468 
469  // set the date today
470  dates.last = Utils::GetTime_tToday();
471  //std::cout << "button is down" << std::endl;
472 
473  // get date of today. in format for ROOT
474  Utils::GetDateYMD( dates.last, year, month, day );
475  std::cout << " year " << year << " month " << month << " day " << day << std::endl;
476  fNumericEntries[1]->SetDate ( year, month, day );
477  } else {
478  std::cout << "button is up do nothing, should reverse the selection " << std::endl;
479  }
480  break;
481  }
482  // case get data intro not yet implemented in c++, beginning in python
483  case 4:
484  {
485 #ifdef DEBUG_CONT_FRAME
486  std::cout << "get date intro" << std::endl;
487 #endif
488  // to write... here best place ?? anyway need function in WrapPython
489  // block button
490  fCheckButton[1]->SetState( kButtonDisabled );
491  break;
492  }
493  //break;
494 
495  }
496  break;
497  }
498  }
499  break;
500  }
501  }
502  //std :: cout << "Return kTrue " << std::endl;
503  return kTRUE;
504 }
505 
506 // add parameter bool exit_after_valid, if used by other button ?
507 // Bool_t not used anymore, use exception, throw GUIStockException
509 {
510 #ifdef DEBUG_CONT_FRAME
511  std::cout << "Entry TransDataBox::Valid " << std::endl;
512  std::cout << "Check button update to now " << fCheckButton[0]->IsDown() << std::endl;
513  std::cout << "Check button get intro " << fCheckButton[1]->IsDown() << std::endl;
514 #endif
515 
516  Int_t year, month, day;
517  struct tm date_tm;
518  int status;
519 
520  // initiliaze correctly the structure
521  memset( (void *)&date_tm, 0, sizeof(struct tm));
522 
523  // Get the dates from the entries
524  // tricky with ROOT format, but get a standard time_t after
525  fNumericEntries[0]->GetDate( year, month, day );
526  date_tm.tm_year = year - 1900;
527  date_tm.tm_mon = month - 1;
528  date_tm.tm_mday = day;
529  //std::cout << " year " << date_tm.tm_year << " month " << date_tm.tm_mon << " day " << date_tm.tm_mday << std::endl;
530  ftrans_data.first = mktime ( &date_tm );
531  //std::cout << " date first string " << ctime( &(ftrans_data.first) ) << std::endl;
532 
533  fNumericEntries[1]->GetDate( year, month, day );
534  //std::cout << " year " << year << " " << " month " << month << " " << " day " << day << std::endl;
535  date_tm.tm_year = year - 1900;
536  date_tm.tm_mon = month - 1;
537  date_tm.tm_mday = day;
538  ftrans_data.last = mktime ( &date_tm );
539 
540 #ifdef DEBUG_CONT_FRAME
541  std::cout << "ftrans_data " << std::endl;
542  std::cout << " date first time_t " << ftrans_data.first << " " << Utils::Time_tToString( ftrans_data.first ) << std::endl;
543  std::cout << " date last time_t " << ftrans_data.last << " " << Utils::Time_tToString( ftrans_data.last ) << std::endl;
544 #endif
545 
546  // used if name is wrong CAC402 ? Not cathed before
547  // difficult to test, from dates no really checking...
548  // here dates may be wrong, past in the future, not a problem it seems
549  try {
550  if ( ftmscl == ETime::DAY ) {
552  } else {
554  }
555  // where to setup if exception not modified
556  *bvalid = true;
557  // exception throw, but GUI blocked !
558  } catch ( const StockException & e ) {
559  std::cout << "TransDataBox Caught a StockException " << std::endl;
560  std::cout << "Throw a GUIStockException " << std::endl;
561  // is it applied ? yes seems fine
562  *bvalid = false;
563  throw ( GUIStockException( e ) );
564  // maybe to close before !
565  CloseWindow();
566  }
567 
568  // download the data from the intro
569  if ( fCheckButton[1]->IsDown() ) {
570  std::cout << "Want to download the values from introduction not implemented" << std::endl;
571  }
572 
573  // download the new data from parser if needed
574  if ( fCheckButton[0]->IsDown() ) {
575 #ifdef DEBUG_CONT_FRAME
576  std::cout << "\n\t"
577  "Button update to now is down,\nNeed an other download from parser " << std::endl;
578 #endif
579  // exception usefull here, if intermediate function, difficult in wrappystock !
580  // make the update of data stock here, or not ??
581  //status = fstock->UpdateCSVFromParser( "Yahoo" );
582 
583  // add exception here.
584  try { // StockPythonException send
585  status = fstock->UpdateCSVFromWeb( "Yahoo", ftrans_data );
586  // ok, tricky, why ?
587  } catch ( const StockException & e ) {
588  std::cout << "TranscientFrame got a StockException error " << std::endl;
589  // ok working like this...
590  GUIStockException gui_except = GUIStockException( e );
591  new TransFrameError( fClient->GetRoot(), this, dynamic_cast<GUIException &>( gui_except) );
592 
593  // reset the button and the dates
594  fCheckButton[0]->SetDown( false, false );
595  // reset the date of the last date, before the failure
596  Utils::GetDateYMD( memo_date, year, month, day );
597  fNumericEntries[1]->SetDate ( year, month, day );
598  throw gui_except;
599  }
600 
601  // not working
602  //const GUIException gui_except = GUIException ( (e.what()).c_str() );
603  //new TransFrameError( fClient->GetRoot(), this, gui_except );
604 
605 
606  //} catch ( const GUIStockException & e ) {
607  /*
608  // compile but do not catch the exception, catch by global std:exception in controller
609  } catch ( const GUIException & e ) {
610  std::cout << "TranscientFrame got a GUIException error " << std::endl;
611  //std::cout << "message " << e.what() << std::endl;
612  std::cout << "Call FrameError " << std::endl;
613  // best return ??
614  new TransFrameError( fClient->GetRoot(), this, const_cast<GUIException &>(e) );
615  //new TransFrameError( fClient->GetRoot(), this, const_cast<GUIException &>(GUIStockException( e )) );
616  //new TransFrameError( fClient->GetRoot(), this, e );
617  //std::cout << "throw a GUIStockExcpetion " << std::endl;
618  //throw ( GUIStockException ( e ) );
619  }
620  */
621  /*
622  // write to the file, done in Update now ??
623  if ( status == 0 ) {
624  // block button, enum EButtonState in TGButton.h
625  fCheckButton[0]->SetState( kButtonDisabled );
626  } else {
627  std::cout << "Error in UpdateCSVFromParser status value from UpdateCSVFromParser " << status << std::endl;
628  }
629  */
630 
631  }
632 
633  return true;
634 }
635 
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
int UpdateCSVFromWeb(const std::string &source, Utils::firstlast_dates opt_dates=Utils::get_fldate_default())
Update data from the Python parser (and save into the filesystem).
TGLabel * fLabel
specific to this subclass
virtual const char * what() const noexcept
Definition: GUIException.h:37
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t)
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
Base Exception for Stock and StockManager, all src_cpp code.
TGHorizontalFrame * fValid
Button for Validation.
TGVerticalFrame * fvframe0
Main class to deal with one stock.
Definition: Stock.h:56
ClassImp(TransFrameGUI) ClassImp(TransFrameError) ClassImp(TransDateBox) TransFrameGUI
time_t GetTime_tToday()
Get the time_t of today.
Definition: Utils.cpp:74
ETime
Enumeration for the different time representation, from instantaneous (INST) to year(YEAR) ...
Definition: TimeScale.h:48
static Indicator const StockInst
Definition: Indicator.h:44
TGTextButton * fBvalid
std::string Time_tToString(const time_t &time, const bool b_hour)
Return a string representing the date All times are expressed in the localtime.
Definition: Utils.cpp:157
void GetDateYMD(time_t time_unix, int &year, int &month, int &day)
Set year, month and day given an input time.
Definition: Utils.cpp:185
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t)
virtual void CloseWindow()
static Indicator const StockCSV
Definition: Indicator.h:44
TGLabel * fLabel[2]
Base class, for all gui errors Need a real base class here, or just use directly StockException.
Definition: GUIException.h:49
TGTextButton * fBcancel
int LoadListData(const ETime &tmscl, const Indicator &indic=Indicator::StockCSV, const std::vector< int > &param=std::vector< int >(), Utils::firstlast_dates dates=Utils::get_fldate_default())
Load or/and compute an indicator in the Stock.
Definition: Stock.cpp:801
TGCheckButton * fCheckButton[2]
virtual void CreateButtons(unsigned int mode=1)
called by all sub-classes
general structure for dates in csv files
Definition: Utils.h:54
define class for transient frame, regroup message box for user entry.
int main(int argc, char *argv[])
TGNumberEntry * fNumericEntries[2]
virtual void FinalizeTransGUI()