74 lines
2.3 KiB
MQL5
74 lines
2.3 KiB
MQL5
|
//+------------------------------------------------------------------+
|
||
|
//| eIncGUI_v2_Test_CDialer.mq5 |
|
||
|
//| Copyright 2011, MetaQuotes Software Corp. |
|
||
|
//| http://www.mql5.com |
|
||
|
//+------------------------------------------------------------------+
|
||
|
#property copyright "Copyright 2011, MetaQuotes Software Corp."
|
||
|
#property link "http://www.mql5.com"
|
||
|
#property version "1.00"
|
||
|
|
||
|
#include <IncGUI_v2.mqh>
|
||
|
|
||
|
enum eColorScheme
|
||
|
{
|
||
|
DefaultScheme=0,
|
||
|
YellowBrownScheme=1,
|
||
|
BlueScheme=2,
|
||
|
GreenScheme=3,
|
||
|
YellowBlackScheme=4,
|
||
|
LimeBlackScheme=5,
|
||
|
AquaBlackScheme=6
|
||
|
};
|
||
|
|
||
|
input eColorScheme ColorScheme=DefaultScheme;
|
||
|
|
||
|
CDialer d;
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Expert initialization function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
int OnInit()
|
||
|
{
|
||
|
ClrScheme.SetScheme(ColorScheme);
|
||
|
|
||
|
//--- CDialer
|
||
|
d.Init("CDiler");
|
||
|
d.SetPos(10,20);
|
||
|
d.SetSubWindow("TestSubWindow");
|
||
|
d.Show();
|
||
|
|
||
|
return(0);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Expert deinitialization function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnDeinit(const int reason)
|
||
|
{
|
||
|
d.Hide();
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Expert tick function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnTick()
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| ChartEvent function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnChartEvent(const int id,
|
||
|
const long &lparam,
|
||
|
const double &dparam,
|
||
|
const string &sparam)
|
||
|
{
|
||
|
int ev;
|
||
|
ev=d.Event(id,lparam,dparam,sparam);
|
||
|
if(ev==1)
|
||
|
{
|
||
|
Alert("CDealer. Dialed: "+DoubleToString(d.Value()));
|
||
|
}
|
||
|
if(CHARTEVENT_CHART_CHANGE)
|
||
|
{
|
||
|
d.SetSubWindow("TestSubWindow");
|
||
|
}
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|