How to change the coordinate anchor point for the Dialog window?

 
Have a nice day. I use a Dialog (Panel) object derived from the CAppDialog class, whose position on the chart is measured by default from the top and left side of the chart. I am trying to change the "anchor point" (left, top) so that its position is measured from the top and RIGHT side of the graph.
I've looked through all the classes that CAppDialog derives from and the only thing I've found is the Alignment() function in the CWnd class. But with that I am only able to right-align various elements inside the given panel, but not the main window of the panel itself. I don't know what to do.

I need the entire dialog box to be measured from the right side of the graph. Please help.

I am attaching the code. thanks very much


#property copyright "Copyright 2023, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

#include <Controls/Dialog.mqh>

 CAppDialog   Panel;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

   Panel.Create(0,"Panel",0,0,0,300,300);

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
  
   Panel.Destroy(WRONG_VALUE);
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---

  // Panel.ChartEvent(id,lparam,dparam,sparam);
   
  }
//+------------------------------------------------------------------+

Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Methods of Object Binding
Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Methods of Object Binding
  • www.mql5.com
Methods of Object Binding - Objects Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

One solution to make it anchor to the right is:

replacing x==> chart_width-x