9 #include "../src_cpp/Stock.h"
20 fValid(0),fBcancel(0),fBvalid(0),fBretry(0)
22 #ifdef DEBUG_CONT_FRAME
23 std::cout <<
"Constructor base class TransFrameGUI " << std::endl;
28 SetCleanup(kDeepCleanup);
34 TGLayoutHints *fLB =
new TGLayoutHints(kLHintsCenterX,10,10,10,10);
46 fValid->AddFrame(
fBcancel,
new TGLayoutHints(kLHintsCenterX,5,5,3,4 ) );
52 fValid->AddFrame(
fBcancel,
new TGLayoutHints(kLHintsCenterX,5,5,3,4 ) );
57 fValid->AddFrame(
fBvalid ,
new TGLayoutHints(kLHintsCenterX,5,5,3,4 ) );
64 #ifdef DEBUG_CONT_FRAME
65 std::cout <<
"TransFrameGUI::ProcessMessage " <<
" " << msg <<
" " << parm1 << std::endl;
70 switch (GET_MSG(msg)) {
73 switch (GET_SUBMSG(msg)) {
108 UInt_t width = GetDefaultWidth();
109 UInt_t height = GetDefaultHeight();
110 Resize(width, height);
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);
125 fClient->WaitFor(
this);
175 #ifdef DEBUG_CONT_FRAME
176 std::cout <<
"Constructor TransFrameError with GUIException " << std::endl;
180 std::cout <<
"TransFrame: No cast GUIStockException.what() " << fError.
what() << std::endl;
184 SetCleanup(kDeepCleanup);
195 SetWindowName(
"ErrorFrame");
196 SetIconName(
"ErrorFrame");
197 SetClassHints(
"ErrorFrame",
"ErrorFrame");
205 #ifdef DEBUG_CONT_FRAME
206 std::cout <<
"Build interface of TransFrameError from constructor" << std::endl;
211 fL1 =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
215 fLabel =
new TGLabel(
this,
"toto should make a message longer");
233 #ifdef DEBUG_CONT_FRAME
235 std::cout <<
"Constructor TransDateBox default, shoud not be used" << std::endl;
239 SetCleanup(kDeepCleanup);
306 #ifdef DEBUG_CONT_FRAME
307 std::cout <<
"Constructor TransDateBox with all arguments " << std::endl;
310 SetCleanup(kDeepCleanup);
328 #ifdef DEBUG_CONT_FRAME
329 std::cout <<
"Entry TransDateBox::CloseWindow()" << std::endl;
336 #ifdef DEBUG_CONT_FRAME
337 std::cout <<
"TransDateBox::BuiltInterface " << std::endl;
345 fL1 =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
349 TGLayoutHints *fL2 =
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 2, 2, 2);
383 fNumericEntries[0]->SetDate( (*date_tm).tm_year + 1900, (*date_tm).tm_mon + 1, (*date_tm).tm_mday );
385 fNumericEntries[1]->SetDate( (*date_tm).tm_year + 1900, (*date_tm).tm_mon + 1, (*date_tm).tm_mday );
392 #ifdef DEBUG_CONT_FRAME
393 std::cout <<
"TransDateBox::ProcessMessage " <<
" " << msg <<
" " << parm1 << std::endl;
395 switch (GET_MSG(msg)) {
398 switch (GET_SUBMSG(msg)) {
405 #ifdef DEBUG_CONT_FRAME
406 std::cout <<
"Press button Case 1 Cancel?" << std::endl;
427 std::cout <<
"TransDataBox Process Message got a GUIException " << std::endl;
443 case kCM_CHECKBUTTON:
457 #ifdef DEBUG_CONT_FRAME
458 std::cout <<
"button is down" << std::endl;
467 int year, month, day;
475 std::cout <<
" year " << year <<
" month " << month <<
" day " << day << std::endl;
478 std::cout <<
"button is up do nothing, should reverse the selection " << std::endl;
485 #ifdef DEBUG_CONT_FRAME
486 std::cout <<
"get date intro" << std::endl;
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;
516 Int_t year, month, day;
521 memset( (
void *)&date_tm, 0,
sizeof(
struct tm));
526 date_tm.tm_year = year - 1900;
527 date_tm.tm_mon = month - 1;
528 date_tm.tm_mday = day;
535 date_tm.tm_year = year - 1900;
536 date_tm.tm_mon = month - 1;
537 date_tm.tm_mday = day;
540 #ifdef DEBUG_CONT_FRAME
541 std::cout <<
"ftrans_data " << std::endl;
559 std::cout <<
"TransDataBox Caught a StockException " << std::endl;
560 std::cout <<
"Throw a GUIStockException " << std::endl;
570 std::cout <<
"Want to download the values from introduction not implemented" << std::endl;
575 #ifdef DEBUG_CONT_FRAME
577 "Button update to now is down,\nNeed an other download from parser " << std::endl;
588 std::cout <<
"TranscientFrame got a StockException error " << std::endl;
TGLayoutHints * fL1
Layout for global, date entry and label.
Stock * fstock
internal use
"Clever" enumeration of the ListDataStock type : StockCSV, Volume, EMA, BOLL,...
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
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.
ClassImp(TransFrameGUI) ClassImp(TransFrameError) ClassImp(TransDateBox) TransFrameGUI
time_t GetTime_tToday()
Get the time_t of today.
ETime
Enumeration for the different time representation, from instantaneous (INST) to year(YEAR) ...
static Indicator const StockInst
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.
void GetDateYMD(time_t time_unix, int &year, int &month, int &day)
Set year, month and day given an input time.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t)
virtual void CloseWindow()
static Indicator const StockCSV
Base class, for all gui errors Need a real base class here, or just use directly StockException.
int LoadListData(const ETime &tmscl, const Indicator &indic=Indicator::StockCSV, const std::vector< int > ¶m=std::vector< int >(), Utils::firstlast_dates dates=Utils::get_fldate_default())
Load or/and compute an indicator in the Stock.
TGCheckButton * fCheckButton[2]
virtual void CreateButtons(unsigned int mode=1)
called by all sub-classes
general structure for dates in csv files
define class for transient frame, regroup message box for user entry.
TGNumberEntry * fNumericEntries[2]
virtual void FinalizeTransGUI()