89 lines
3.4 KiB
MQL5
89 lines
3.4 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| TFGUI.mqh |
|
|
//| Thorsten Fischer Copyright 2020 |
|
|
//| https://mql5.tfsystem.de |
|
|
//+------------------------------------------------------------------+
|
|
#property copyright "Thorsten Fischer Copyright 2020"
|
|
#property link "https://mql5.tfsystem.de"
|
|
#property version "1.00"
|
|
#property strict
|
|
|
|
//---
|
|
#include "TFGUIDialog.mqh"
|
|
|
|
//---
|
|
input int i_Window_x1=0; // Fensterecke links
|
|
input int i_Window_y1=25; // Fensterecke oben
|
|
input int i_Window_x2=220; // Fensterecke rechts
|
|
input int i_Window_y2=80; // Fensterecke unten
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
class CTFGUI //: public CTFObject
|
|
{
|
|
private:
|
|
//---
|
|
CTFGUIDialog m_tfgui_dialog;
|
|
string c_Strategie_Open;
|
|
|
|
public:
|
|
CTFGUI();
|
|
~CTFGUI();
|
|
//---
|
|
virtual bool OnInitEvent(void);
|
|
virtual void OnDeInitEvent(const int aReason=0);
|
|
virtual void ChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam);
|
|
//---
|
|
virtual void StrategieOpen(const string aText) {c_Strategie_Open=aText;}
|
|
virtual string StrategieOpen(void) {return(c_Strategie_Open);}
|
|
|
|
|
|
};
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
CTFGUI::CTFGUI()
|
|
{
|
|
//---
|
|
c_Strategie_Open="000";
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
CTFGUI::~CTFGUI()
|
|
{
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
bool CTFGUI::OnInitEvent(void)
|
|
{
|
|
//---
|
|
m_tfgui_dialog.StrategieOpen(c_Strategie_Open);
|
|
//---
|
|
if(!m_tfgui_dialog.Create(0, "Strategie Open Panel", 0, i_Window_x1, i_Window_y1, i_Window_x2, i_Window_y2))
|
|
return(false);
|
|
//---
|
|
m_tfgui_dialog.Run();
|
|
//---
|
|
return(true);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
void CTFGUI::OnDeInitEvent(const int aReason=0)
|
|
{
|
|
//---
|
|
m_tfgui_dialog.Destroy(aReason);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
void CTFGUI::ChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam)
|
|
{
|
|
//---
|
|
m_tfgui_dialog.ChartEvent(id, lparam, dparam, sparam);
|
|
c_Strategie_Open=m_tfgui_dialog.StrategieOpen();
|
|
}
|
|
//+------------------------------------------------------------------+
|