From 5973bf89c8b925aec51c6e8f2cb2447bde0260a0 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Thu, 3 Oct 2024 12:31:55 +0330 Subject: [PATCH] Fix XCLabel Background Color issue on Volume Panel by Using XCEdit Object and Set ReadOnly Flag ... --- Classes/XCObjects/x-saherelm.x-edit.class.mq5 | 10 ++++++++++ Experts/x-saherelm.x121.ea.mq5 | 8 ++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Classes/XCObjects/x-saherelm.x-edit.class.mq5 b/Classes/XCObjects/x-saherelm.x-edit.class.mq5 index a60e4fba..dab9ffea 100644 --- a/Classes/XCObjects/x-saherelm.x-edit.class.mq5 +++ b/Classes/XCObjects/x-saherelm.x-edit.class.mq5 @@ -166,6 +166,16 @@ class XCEdit : public XCObject ObjectSetString(mChartID, mName, OBJPROP_FONT, value); } + /** + * Set ReadOnly State of Object ... + * + * @param value: boolean value + */ + void ReadOnly(bool value) + { + ObjectSetInteger(mChartID, mName, OBJPROP_READONLY, value); + } + // // Protected ... protected: diff --git a/Experts/x-saherelm.x121.ea.mq5 b/Experts/x-saherelm.x121.ea.mq5 index 0e995c2e..6cecfedb 100644 --- a/Experts/x-saherelm.x121.ea.mq5 +++ b/Experts/x-saherelm.x121.ea.mq5 @@ -234,7 +234,7 @@ bool eaUseForceMomentumProtecting = eaUseForceMomentumsInProtection; XCPanel eaVolumePanel; XCButton eaDynamicVolumeBtn; XCEdit eaStaticVolumeTb; -XCLabel eaStaticVolumeLbl; +XCEdit eaStaticVolumeLbl; XCButton eaSetStaticVolumeBtn; XCButton eaResetStaticVolumeBtn; double eaAppliedStaticVolume = eaVolume; @@ -2112,15 +2112,19 @@ bool InitVolumeGUI() result = eaStaticVolumeLbl.Create( eaStaticVolumeLblName, 10, - 275 // + 275, + 150, + 25 // ); if (!result) { return result; } eaStaticVolumeLbl.FontSize(10); + eaStaticVolumeLbl.ReadOnly(true); eaStaticVolumeLbl.Color(clrWhite); eaStaticVolumeLbl.Text("Static Volume: "); + eaStaticVolumeLbl.BGColor(clrMediumSlateBlue); eaVolumePanel.Add(eaStaticVolumeLblName); //