Discussion of article "Graphical Interfaces X: Text selection in the Multiline Text box (build 13)" - page 12

 

While performing the task of dynamically adding/removing tabs and adding/removing charts to the array of tabs, I encountered the problem of impossibility to get the name of tabs in the CTabs class. In this regard, I suggest the developer to supplement this class with a method to get the tab name:

   //--- Sets (1) the text (tab name) to the specified index (2) получает текст (имя вкладки) по указанному индексу
   void              Text(const uint index,const string text);                     // this method is
   string            Text(const uint index) { return m_tab[index].text; }  // that's not enough
Adding this method is necessary due to the fact that even inheriting from the CTabs class in order to complement the missing methods, it will be impossible to implement the overloaded Text method, because the m_tab[] object is in the protected area of the class. And to edit the class to suit yourself violates the OOP principle.
 
Konstantin:

...

Will do everything you wrote about in previous posts.
 
Add images to the EasyAndFastGUI/MQL5/Images/EasyAndFastGUI/Icons/bmp16 library. For "two-legged" arbitrageurs will be useful not only for me ))
Files:
 
Anatoli Kazharski:
@Pavel Kolchin, to prevent arrows from deals from hanging above the panel use CWndEvents::ResetWindow() method.
where to insert it?
 
Pavel Kolchin:
where to put it?
Try OnTrade().
 
Anatoli Kazharski:
Try OnTrade().


I can't, it fails.

There is no such event in the menu file, but if you insert it into the main file, it fails.

 
Pavel Kolchin:


I can't, it fails

There is no such event in the menu file, but if you paste it into the main file, it fails.

You need to create a CProgram::OnTradeEvent() method in the custom application class.

And in the main file it should be called in the OnTrade() function:

//+------------------------------------------------------------------+
//| Trade function|
//+------------------------------------------------------------------+
void OnTrade(void)
  {
   program.OnTradeEvent();
  }

//---

For example, I have this content of the CProgram::OnTradeEvent() method:

//+------------------------------------------------------------------+
//| Trade transaction event|
//+------------------------------------------------------------------+
void CProgram::OnTradeEvent(void)
  {
//--- Sending a trade event to all charts
   m_events.SendEventToAllCharts(0,ON_TRADE_EVENT,0,0.0,m_program_name);
//--- Set the transactions of the last position
   if(m_show_deals.CheckButtonState())
      if(m_vdeals.ShowDealsLastPosition())
         ResetWindow();
//--- Checking the stop loss distance
   if(m_trailing_stop.CheckButtonState())
      m_ctrade.CheckStopLossSize(::Symbol());
//--- Zeroing of variables for trade operations
   m_ctrade.ZeroCalcPositionVariables();
//--- Initialisation of the balance array and updating of the series on the chart
   InitBalanceArray();
   m_line_chart.SeriesUpdate(0,m_balance_data,"Balance",clrCornflowerBlue);
  }
 
Anatoli Kazharski:


Add a little more on top
public:
   //--- Trade
   void              OnTradeEvent(void);
and everything works )
 
I can't figure out how to bind element_2, e.g. a table to the lower edge of element_1, e.g. the same table, i.e. element_1 is above element_2. As a result, it is necessary that when the size of the chart changes, the lower boundary of element_1 would be shifted and the upper boundary of element_2 would be shifted after it. The library has the AutoYResizeMode and AutoYResizeBottomOffset methods, but I can't figure out how to implement the displacement of upper borders.
 
Konstantin:
I can't figure out how to bind element_2, e.g. a table to the lower edge of element_1, e.g. the same table, i.e. element_1 is above element_2. As a result, it is necessary that when the size of the chart changes, the lower boundary of element_1 would be shifted and the upper boundary of element_2 would be shifted after it. There are methods AutoYResizeMode and AutoYResizeBottomOffset in the library, but I can't figure out how to implement the displacement of the upper boundaries.

There are also methods for binding elements:

   //--- Mode (get/set) of binding an element to (1) right and (2) bottom edge of the window
   bool              AnchorRightWindowSide(void)               const { return(m_anchor_right_window_side);   }
   void              AnchorRightWindowSide(const bool flag)          { m_anchor_right_window_side=flag;      }
   bool              AnchorBottomWindowSide(void)              const { return(m_anchor_bottom_window_side);  }
   void              AnchorBottomWindowSide(const bool flag)         { m_anchor_bottom_window_side=flag;     }

//---

Try to solve the problem in combination with these properties.