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

 
Konstantin:

By the way, there's a problem:

The highlighted string does not allow to work in the tester.

I haven't tested in the tester at all yet, as there were a lot of restrictions there before. So temporarily so far.

Have you already tried to test the GUI in the tester? What is the result? Do events work? Are all graphical objects displayed?

 
Anatoli Kazharski:

I haven't tested in the tester at all yet, as there were a lot of restrictions there before. That's why it's temporarily like this for now.

Have you already tried testing the GUI in the tester? What is the result? Do events work? Are all graphical objects displayed?


Yes, all objects are displayed, mouse events on charts won't work in the tester, but so the whole interface is alive, and actually it was like that before

In general, I'll probably give up the inbuilt timer for now, so as not to edit the library ))

 

I can not figure out how to make the form was created a certain size on X and was bound to the right border of the chart, ie, when you change the size of the chart on X, the form would not change the size would move to the right / left without changing its size.

As an option to override the ChartEventChartChange method in the CWndEvents class, this method is in the private section, maybe it makes sense to move the methods:

void ChartEventCustom(void);
void ChartEventClick(void);
void ChartEventMouseMove(void);
void ChartEventObjectClick(void);
void ChartEventEndEdit(void);
void ChartEventChartChange(void);

Move to the protected section, but again, methods from the private section are also used there? In general, if anyone has encountered such a problem, please suggest a solution

 
Konstantin:

I can not figure out how to make the form was created a certain size on X and was bound to the right border of the chart, ie, when you change the size of the chart on X, the form would not change the size would move to the right / left without changing its size.

As an option to override the ChartEventChartChange method in the CWndEvents class, this method is in the private section, maybe it makes sense to move the methods:

Move to the protected section, but again, methods from the private section are also used there? In general, if anyone has encountered such a problem, please suggest a solution

Approximately like this:

//+------------------------------------------------------------------+
//|| Creates a form for the controls |
//+------------------------------------------------------------------+
bool CProgram::CreateWindow(const string caption_text)
  {
//--- Add the window pointer to the window array
   CWndContainer::AddWindow(m_window);
//--- Dimensions
   int x_size =200;
   int y_size =200;
//--- Coordinates
   int x =m_chart.WidthInPixels()-(x_size+1);
   int y =1;
//--- Properties
...
//--- Form creation
   if(!m_window.CreateWindow(m_chart_id,m_subwin,caption_text,x,y))
      return(false);
//---
   return(true);
  }

//---

In the event handler of the MQL-application user class when processing the CHARTEVENT_CHART_CHANGE event:

//+------------------------------------------------------------------+
//| Event handler|
//+------------------------------------------------------------------+
void CProgram::OnEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
  {
   if(id==CHARTEVENT_CHART_CHANGE)
     {
      m_window.X(m_chart.WidthInPixels()-(m_window.XSize()+1));
     }
  }

//---

Result:

//---

You can also add a check if the size (width) of the chart window has changed, because the CHARTEVENT_CHART_CHANGE event is generated in different cases. For example, when scrolling the chart.

 
Anatoli Kazharski:

It goes something like this:

//---

In the event handler of a custom MQL application class when processing a CHARTEVENT_CHART_CHANGE event:

//---

Result:

//---

You can also add a check if the size (width) of the chart window has changed, because the CHARTEVENT_CHART_CHANGE event is generated in different cases. For example, when scrolling the chart.


oops, it worked ))
 

How to get in the table the index of the row on which the left mouse button was clicked, if SelectableRow(false) was set when creating the table? Parsing the sparam parameter in OnEvent does not look elegant. Of course it is possible to use SelectableRow(true) and use SelectedItem(), but the task is without selecting rows in the table.

 
Konstantin:

How to get in the table the index of the row on which the left mouse button was clicked, if SelectableRow(false) was set when creating the table? Parsing the sparam parameter in OnEvent doesn't look elegant. Of course, we can use SelectableRow(true) and use SelectedItem(), but the task is without selecting rows in the table.

So far only like this, but I will add this feature.
 
How to differentiate between the event of selecting a row in a table and selecting an item in a combo box? From the code I can see that they use the same ON_CLICK_LIST_ITEM event.
 
Konstantin:
How to differentiate between the event of selecting a row in a table and selecting an item in a combo box? From the code it is clear that they use the same ON_CLICK_LIST_ITEM event.
Why? What exactly is preventing you from doing this?
 

I display a table in a form, select a row in it, select a value in a combo-box and the data from the table row and the value from the combo-box should be written to a separate entity. Now the events are not delimited and it is necessary to make crutches that would realise the task:


maybe you can suggest some other mechanism?

Basically, the table is an array of ticker pairs, the combo-box contains types of signals, a separate entity is the objects of the array of signals. The objects themselves are not a single field, but complex custom data types, a pair of tickers from the table and a signal type are recorded in them, and then another processing is done.