last works on GUI Panel Developing ...
This commit is contained in:
@@ -13,7 +13,12 @@
|
||||
CTrade trade;
|
||||
|
||||
//
|
||||
XCPanel panel;
|
||||
string mTag;
|
||||
XCPanel eaPanel;
|
||||
XCButton eaStateBtn;
|
||||
string eaStateBtnName;
|
||||
bool eaEnableLongs = true;
|
||||
bool eaEnableShorts = true;
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| Expert initialization function |
|
||||
@@ -21,7 +26,7 @@ XCPanel panel;
|
||||
int OnInit()
|
||||
{
|
||||
//
|
||||
panel.Create("XPanel", 100, 100, 200, 100);
|
||||
// panel.Create("XPanel", 100, 100, 300, 200);
|
||||
|
||||
//
|
||||
// Enables mouse move events on the chart
|
||||
@@ -70,6 +75,9 @@ int OnInit()
|
||||
// TitleBar.Add("BuyButton");
|
||||
// TitleBar.Add("SellButton");
|
||||
|
||||
//
|
||||
mTag = "XPanel";
|
||||
InitialPanel();
|
||||
ChartRedraw(0); // Redraws the chart
|
||||
return (INIT_SUCCEEDED);
|
||||
}
|
||||
@@ -87,6 +95,9 @@ void OnDeinit(const int reason)
|
||||
// LotSize.Destroy();
|
||||
// BuyButton.Destroy();
|
||||
// SellButton.Destroy();
|
||||
|
||||
//
|
||||
eaPanel.Destroy();
|
||||
}
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -113,6 +124,50 @@ void OnChartEvent(const int id, const long &lparam, const double &dparam, const
|
||||
// TitleBar.OnEvent(id, lparam, dparam, sparam);
|
||||
|
||||
//
|
||||
panel.OnEvent(id, lparam, dparam, sparam);
|
||||
eaPanel.OnEvent(id, lparam, dparam, sparam);
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
|
||||
//
|
||||
bool InitialPanel()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// Create a Panel ...
|
||||
result = eaPanel.Create(
|
||||
mTag,
|
||||
100,
|
||||
100,
|
||||
300,
|
||||
200 //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Create Activation Button ...
|
||||
string eaStatePrefix = mTag + "_State_";
|
||||
eaStateBtnName = eaStatePrefix + "lbl";
|
||||
result = eaStateBtn.Create(
|
||||
eaStateBtnName,
|
||||
100,
|
||||
120,
|
||||
100,
|
||||
25 //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
eaStateBtn.SetZOrder(100);
|
||||
|
||||
//
|
||||
eaPanel.Add(eaStateBtnName);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user