Gallery of UIs written in MQL - page 62

 
hini #:

I followed the code and tested it, and found an unexpected thing that doesn't auto-discover when the length of the random string is too long


Yeah, sure, thanks for the message. I'll have a look at it.

Generally by default the text is always shortened. This has never happened before. It may be due to the addition of new functionality.

 
hini #:

I have discovered a fatal problem for me, which is that the typed text is displayed on the GUI in the horizontal orientation ...... rotated 90 degrees, as it normally is:


I don't know. Maybe it has to do with language settings. This is probably how the standard TextOut() function inside MQL works. You should ask the developers. My code definitely does not turn the text. There is no such option.

 
hini #:

I followed the code and tested it, and found an unexpected thing that doesn't auto-discover when the length of the random string is too long

By the way, if you click on the input box after entering text programmatically and then click on another window space, the text in the box will shrink. Obviously, this is due to the new functionality, as other texts are shortened at the window construction stage. In this case, the text shortening flag is already set and therefore the function does not shorten the text. The flaw is clear.

 
hini #:

I have discovered a fatal problem for me, which is that the typed text is displayed on the GUI in the horizontal orientation ...... rotated 90 degrees, as it normally is:


I'll check the value going into the TextSetFont() parameter which is responsible for the angle of the text. But on the other hand, all texts are rendered in horizontal orientation.... I can't give you a definite answer yet. Perhaps it will become clearer later.

 
Реter Konow #:

I will check the value of the input TextSetFont() parameter, which is responsible for adjusting the angle of the text. But on the other hand, all text is rendered horizontally ..... I can't give you a clear answer right now. Maybe it will be clearer later.

It should have something to do with the language, Chinese, Japanese, and Korean all have the possibility of this happening
 
hini #:
It must be language-related: in Chinese, Japanese, and Korean this is possible.

It's quite possible. Too bad if it can't be fixed.

 
7. Set and return values of parameters and properties of elements of different types.
8. Return parameter values of one element, modify and forward to another element.

//----------------------------------------------------------------------------------------------------------

Let's summarise both topics - Setting, returning and forwarding parameter values and properties:

1.Setting values to a parameter of elements:

In most elements, setting a value to a parameter means displaying the value in numeric or text form on the surface of the control.

The previous post showed a method of programmatically setting text in an input field:

w7_s_p4_EDIT_Comment_1("Some random text");//Тип посылаемого в функцию значения string.



Let's see how this approach works with other elements:

1. An input field with buttons:

w6_d_p5_S_EDIT_Spin_the_value(423.11); //Тип посылаемого в функцию значения double.

//-------------------------------------------------------------------------------------------------------------------------------


2.

w6_i_p3_H_SLIDER_Roll_the_value(33); //Тип посылаемого значения int, потому что тип функции int. В данном случае, потому что у слайдера диапазон в целых числах.


If you enter a value outside the range of the slider, the log will receive a message warning that the numerical range has been exceeded and the new value will not be set!

//-------------------------------------------------------------------------------------------------------------------------------


3.

w6_s_p6_D_LIST_D_LIST_1("L_ITEM 5"); //Тип посылаемого значения string. Устанавливаем другую опцию элемента выпадающий список (D_LIST). 

* This option has not been fully worked out. The underlying item remains in the same state and the field accepts any text. It will be fixed in the next versions.

//-------------------------------------------------------------------------------------------------------------------------------

4.

   w8_s_p4_CELL_Account_name__Value("MyRealAccount"); //Тип посылаемого значения string. Посылаем текст в ячейку таблицы. 

   w8_s_p4_CELL_Account_number__Value("A001234647843B1");

   w8_s_p4_CELL_Account_server__Value("MyServer");

   w8_s_p4_CELL_Account_currency__Value("US Dollar");

   w8_s_p4_CELL_Leverage__Value("1:1");

   w8_s_p4_CELL_Account_balance__Value("1234567.23 $");


//------------------------------------------------------------------------------------------------------------------------------


2. Now let's send the value from the input field to the table cell:

  • Taking the value from the input field with buttons:

   double Spin_edit_value = w6_d_p5_S_EDIT_Spin_the_value();//Делаем возврат значения параметра (тип double).

And send it to the table cell:

   w8_s_p4_CELL_Account_profit__Value((string)Spin_edit_value);//При пересылке значение double приводим к типу string. Функция ячейки имеет тип string.


The value is successfully accepted by the addressee!

//-------------------------------------------------------------------------------------------------------------------------------

Now, let's send this value to a text field in another window.

w7_s_p4_EDIT_Comment_2((string)Spin_edit_value);

The value has been successfully sent!

//-------------------------------------------------------------------------------------------------------------------------------

...

We'll continue from this point tomorrow. The topic has not been exhausted yet.

 
It's really convenient.
 
The forced type conversion here, can it be put inside the function, so that the user does not need to write (string) outside the
w7_s_p4_EDIT_Comment_2((string)Spin_edit_value);
 
hini #:
Forced type conversion here, can it be put inside a function so the user doesn't have to write (string) outside the function

Didn't really understand the question, so my answer may be off-topic.

You could do it like this:

The double function makes a return to a variable of type string using a forced conversion at the value return step.

string Spin_edit_value = (string)w6_d_p5_S_EDIT_Spin_the_value();

w7_s_p4_EDIT_Comment_2(Spin_edit_value);