hello traders,
In this indicator i tried to add an edit box and bmp file in dialog box
The edit box m_edit can be added in the dialog box with the instruction :
I want to do the same for the bmp file m_pic
How to add bmp file in dialog box ?
Regards
In this indicator i tried to add an edit box and bmp file in dialog box
Inserted Code
#property indicator_chart_window
#include <Controls\Dialog.mqh>
#include <ChartObjects\ChartObjectsBmpControls.mqh>
class myClass : public CAppDialog{
private:
CEdit m_edit;
CChartObjectBmpLabel m_pic;
protected:
public:
void myClass();
void ~myClass();
virtual void initEdit();
virtual void initPics();
virtual void show(long c,int subwin);
};
//+------------------------------------------------------------------+
myClass::myClass(){}
//+------------------------------------------------------------------+
myClass::~myClass(){}
//+------------------------------------------------------------------+
myClass::initEdit(){
m_edit.Create(m_chart_id, "Eb_" , m_subwin, 1, 25, 25 ,50);
m_edit.Text("20");
m_edit.ReadOnly(TRUE);
m_edit.TextAlign(ALIGN_CENTER);
Add(m_edit);
}
//+------------------------------------------------------------------+
myClass::initPics(){
m_pic.Create(m_chart_id,"2",m_subwin,0,0);
m_pic.Corner(CORNER_LEFT_UPPER);
m_pic.X_Distance(30);
m_pic.Y_Distance(40);
m_pic.BmpFileOn("sun.bmp");
//Add(m_pic);
}
//+------------------------------------------------------------------+
myClass::show(long c,int subwin){
this.Create(c, "monitor", subwin, 0, 0, 200, 200);
this.initEdit();
this.initPics();
}
//+------------------------------------------------------------------+
myClass myMonitor;
//+------------------------------------------------------------------+
int OnInit(){
myMonitor.show(ChartID(),0);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[],const double &open[],const double &high[],const double &low[],const double &close[],const long &tick_volume[],const long &volume[],const int &spread[]){
return(rates_total);
}
//+------------------------------------------------------------------+
void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam){
myMonitor.OnEvent(id,lparam,dparam,sparam);
}
//+------------------------------------------------------------------+ The edit box m_edit can be added in the dialog box with the instruction :
Inserted Code
Add(m_edit);
How to add bmp file in dialog box ?
Regards