Refactor XCObjects and Extends them from Base XCObject Class and also Implement GUI Features on EA Class and Refactor Inputs ...

This commit is contained in:
2024-09-28 19:30:51 +03:30
parent d91c7967c2
commit d3e0d74d31
7 changed files with 981 additions and 395 deletions
+48 -15
View File
@@ -30,16 +30,13 @@
// Implementation ...
//
class XCPanel : XSCBase
class XCPanel : XCObject
{
public:
//
// Constructor(s) ...
void XCPanel()
{
//
// Enables mouse move events on the chart
ChartSetInteger(0, CHART_EVENT_MOUSE_MOVE, true);
}
//
@@ -78,6 +75,8 @@ class XCPanel : XSCBase
int xSize,
int ySize,
//
long chartID = 0,
//
// Title Bar ...
ENUM_BORDER_TYPE titleBarBorderType = BORDER_FLAT,
color titleBarBGColor = clrBlueViolet,
@@ -96,6 +95,10 @@ class XCPanel : XSCBase
//
bool result = false;
//
// Enables mouse move events on the chart
ChartSetInteger(chartID, CHART_EVENT_MOUSE_MOVE, true);
//
result = IsValid(name);
if (!result)
@@ -132,8 +135,8 @@ class XCPanel : XSCBase
Destroy();
return result;
}
mTitleBar.SetBorderType(titleBarBorderType);
mTitleBar.SetBGColor(titleBarBGColor);
mTitleBar.BorderType(titleBarBorderType);
mTitleBar.BGColor(titleBarBGColor);
//
// Body ...
@@ -150,9 +153,9 @@ class XCPanel : XSCBase
Destroy();
return result;
}
mBody.SetBorderType(bodyBorderType);
mBody.SetBGColor(bodyBGColor);
mBody.SetAsBackGround(true);
mBody.BorderType(bodyBorderType);
mBody.BGColor(bodyBGColor);
mBody.AsBackGround(true);
//
// Caption ...
@@ -163,10 +166,10 @@ class XCPanel : XSCBase
Destroy();
return result;
}
mCaptionLbl.SetText(caption);
mCaptionLbl.SetAnchor(captionAnchor);
mCaptionLbl.SetTextColor(captionColor);
mCaptionLbl.SetFontSize(captionontSize);
mCaptionLbl.Text(caption);
mCaptionLbl.Color(captionColor);
mCaptionLbl.Anchor(captionAnchor);
mCaptionLbl.FontSize(captionontSize);
//
// Adding Child Objects ...
@@ -233,7 +236,7 @@ class XCPanel : XSCBase
*/
string Caption()
{
return mCaptionLbl.GetText();
return mCaptionLbl.Text();
}
/**
@@ -243,7 +246,37 @@ class XCPanel : XSCBase
*/
void Caption(string value)
{
mCaptionLbl.SetText(value);
mCaptionLbl.Text(value);
}
/**
* Set Caption Color ...
*
* @param value: Color
*/
void CptionColor(color value)
{
mCaptionLbl.Color(value);
}
/**
* Set Panel Body BG Color ...
*
* @param value: Color
*/
void BodyColor(color value)
{
mBody.BGColor(value);
}
/**
* Set Panel Titlebar BG Color ...
*
* @param value: Color
*/
void TitleBarBGColor(color value)
{
mTitleBar.BGColor(value);
}
//