117 lines
1.9 KiB
Plaintext
117 lines
1.9 KiB
Plaintext
///////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center MQL5 Class Library
|
|
// --------------------------------------
|
|
// Name: XCObject
|
|
// Description: Base Class Of Chart Object Class
|
|
//
|
|
//
|
|
// Maintainer:
|
|
// ------------
|
|
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
|
//
|
|
//////////////////////////////////////////////////////
|
|
//
|
|
// Global Properties ...
|
|
#property library
|
|
#property copyright "Copyright 2023, SaherElm IT Center"
|
|
#property link "https://www.saherelm.ir"
|
|
#property version "1.00"
|
|
#property strict
|
|
|
|
//
|
|
#include "../x-saherelm.base.class.mq5"
|
|
|
|
//
|
|
// Definitions ...
|
|
|
|
//
|
|
// Implementation ...
|
|
|
|
//
|
|
// a Button Creation Class ...
|
|
class XCObject : XSCBase
|
|
{
|
|
//
|
|
// Public ...
|
|
public:
|
|
//
|
|
// Constructor(s) ...
|
|
void XCObject()
|
|
{
|
|
mChartID = 0;
|
|
}
|
|
|
|
//
|
|
// Deconstructor ...
|
|
void ~XCObject()
|
|
{
|
|
Destroy();
|
|
}
|
|
|
|
/**
|
|
* Destroy Class Instance ...
|
|
*/
|
|
void Destroy()
|
|
{
|
|
//
|
|
mName = NULL;
|
|
ObjectDelete(0, mName);
|
|
}
|
|
|
|
//
|
|
// Getter(s) / Setter(s) ...
|
|
|
|
/**
|
|
* Retrieve Object Name ...
|
|
*
|
|
* @return ( string )
|
|
*/
|
|
string Name()
|
|
{
|
|
return mName;
|
|
}
|
|
|
|
/**
|
|
* Retrieve Registered Chart ID ...
|
|
*
|
|
* @return ( long )
|
|
*/
|
|
long ChartID()
|
|
{
|
|
return mChartID;
|
|
}
|
|
|
|
/**
|
|
* Set Object ZOrder ...
|
|
*
|
|
* @param value: z order
|
|
*/
|
|
void ZOrder(int value)
|
|
{
|
|
ObjectSetInteger(0, mName, OBJPROP_ZORDER, value);
|
|
}
|
|
|
|
/**
|
|
* Set Object as Background ...
|
|
*
|
|
* @param value: boolean value
|
|
*/
|
|
void AsBackGround(bool value)
|
|
{
|
|
ObjectSetInteger(0, mName, OBJPROP_BACK, value);
|
|
}
|
|
|
|
//
|
|
// Protected ...
|
|
protected:
|
|
//
|
|
string mName; // Name of Object ...
|
|
long mChartID; // Chart ID ...
|
|
|
|
//
|
|
// Private ...
|
|
private:
|
|
//
|
|
};
|