last ...
This commit is contained in:
@@ -28,168 +28,8 @@
|
||||
|
||||
enum ENUM_X121SMC_CHARTOBJECTS
|
||||
{
|
||||
X_XPVPIVOT_OBJ, // XPVPivot Object ...
|
||||
X_121_NONE_OBJ
|
||||
};
|
||||
|
||||
//
|
||||
// Implementations ...
|
||||
|
||||
//
|
||||
// XPVPivot Object ...
|
||||
class XCXPVPivotObject : public XCBaseObject
|
||||
{
|
||||
//
|
||||
public:
|
||||
//
|
||||
|
||||
/**
|
||||
* Creator ...
|
||||
*
|
||||
* @param chart_id: Long, Specified Chart ID ...
|
||||
* @param window: Integer, Specified Chart Window ID ...
|
||||
* @param pivot: XPVPivot instance ...
|
||||
* @param prefix: String ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool Create(
|
||||
long chart_id,
|
||||
int window,
|
||||
XPVPivot &pivot,
|
||||
string prefix = NULL //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = pivot.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
string name = pivot.GetTag();
|
||||
if (IsValid(prefix))
|
||||
{
|
||||
name = prefix + "_" + name;
|
||||
}
|
||||
|
||||
//
|
||||
result = mRect.Create(
|
||||
chart_id,
|
||||
name,
|
||||
window,
|
||||
pivot.from,
|
||||
pivot.upper,
|
||||
pivot.to,
|
||||
pivot.lower //
|
||||
);
|
||||
|
||||
//
|
||||
if (result)
|
||||
{
|
||||
ObjName(name);
|
||||
}
|
||||
|
||||
//
|
||||
string mTrendName = "MID_" + name;
|
||||
double mid = pivot.CalculateMid();
|
||||
result = mTrend.Create(
|
||||
chart_id,
|
||||
mTrendName,
|
||||
window,
|
||||
pivot.from,
|
||||
mid,
|
||||
pivot.to,
|
||||
mid //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
mRect.Delete();
|
||||
mRect.Detach();
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Getter(s) / Setter(s) ...
|
||||
|
||||
/**
|
||||
* Set Pivot Width ...
|
||||
*
|
||||
* @param value: Integer ...
|
||||
*/
|
||||
void PivotWidth(int value)
|
||||
{
|
||||
//
|
||||
if (value < 1)
|
||||
{
|
||||
value = 1;
|
||||
}
|
||||
|
||||
//
|
||||
mRect.Width(value);
|
||||
mTrend.Width(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Pivot Color ...
|
||||
*
|
||||
* @param value: Color ...
|
||||
*/
|
||||
void PivotColor(color value)
|
||||
{
|
||||
//
|
||||
mRect.Color(value);
|
||||
mTrend.Color(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Pivot Style ...
|
||||
*
|
||||
* @param value: ENUM_LINE_STYLE member ...
|
||||
*/
|
||||
void PivotStyle(ENUM_LINE_STYLE value)
|
||||
{
|
||||
//
|
||||
mRect.Style(value);
|
||||
mTrend.Style(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Pivot Fill ...
|
||||
*
|
||||
* @param value: Boolean ...
|
||||
*/
|
||||
void PivotFill(bool value)
|
||||
{
|
||||
mRect.Fill(value);
|
||||
}
|
||||
|
||||
//
|
||||
// Virtual ...
|
||||
|
||||
/**
|
||||
* Retrieve Object Type ...
|
||||
*
|
||||
* @return ( ENUM_X121SMC_CHARTOBJECTS )
|
||||
*/
|
||||
virtual ENUM_X121SMC_CHARTOBJECTS Type()
|
||||
{
|
||||
return X_XPVPIVOT_OBJ;
|
||||
}
|
||||
|
||||
//
|
||||
private:
|
||||
//
|
||||
|
||||
//
|
||||
// Props ...
|
||||
CChartObjectRectangle mRect;
|
||||
CChartObjectTrend mTrend;
|
||||
};
|
||||
Reference in New Issue
Block a user