103 lines
4.1 KiB
MQL5
103 lines
4.1 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 string inp_Window_Name="Panel"; // Fenster Name
|
||
|
input int inp_Window_x1=0; // Fensterecke links
|
||
|
input int inp_Window_y1=25; // Fensterecke oben
|
||
|
input int inp_Window_x2=220; // Fensterecke rechts
|
||
|
input int inp_Window_y2=80; // Fensterecke unten
|
||
|
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
class CTFGUI //: public CTFObject
|
||
|
{
|
||
|
private:
|
||
|
//---
|
||
|
CTFGUIDialog m_tfgui_dialog;
|
||
|
string s_Strategie;
|
||
|
string s_Strategie_Name;
|
||
|
int i_String_Len;
|
||
|
|
||
|
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 Strategie(const string aText) {s_Strategie=aText;}
|
||
|
virtual string Strategie(void) {return(s_Strategie);}
|
||
|
virtual void StrategieName(const string aText) {s_Strategie_Name=aText;}
|
||
|
virtual string StrategieName(void) {return(s_Strategie_Name);}
|
||
|
virtual void SetStringLen(const int aValue) {i_String_Len=aValue;}
|
||
|
virtual int GetStringLen(void) {return(i_String_Len);}
|
||
|
|
||
|
protected:
|
||
|
//---
|
||
|
|
||
|
};
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
CTFGUI::CTFGUI()
|
||
|
{
|
||
|
//---
|
||
|
s_Strategie="";
|
||
|
s_Strategie_Name="";
|
||
|
i_String_Len=0;
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
CTFGUI::~CTFGUI()
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTFGUI::OnInitEvent(void)
|
||
|
{
|
||
|
//---
|
||
|
m_tfgui_dialog.Strategie(s_Strategie);
|
||
|
m_tfgui_dialog.StrategieName(s_Strategie_Name);
|
||
|
m_tfgui_dialog.SetStringLen(i_String_Len);
|
||
|
//---
|
||
|
if(!m_tfgui_dialog.Create(0, inp_Window_Name, 0, inp_Window_x1, inp_Window_y1, inp_Window_x2, inp_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);
|
||
|
s_Strategie=m_tfgui_dialog.Strategie();
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|