Discussion of article "Graphical Interfaces X: The Multiline Text box control (build 8)"

 

New article Graphical Interfaces X: The Multiline Text box control (build 8) has been published:

The Multiline Text box control is discussed. Unlike the graphical objects of the OBJ_EDIT type, the presented version will not have restrictions on the number of input characters. It also adds the mode for turning the text box into a simple text editor, where the cursor can be moved using the mouse or keys.

The keyboard keys can be divided into several groups (see notation in Fig. 1):

  • Control keys (orange)
  • Function keys (purple)
  • Alphanumeric keys (blue)
  • Navigation keys (green)
  • Numeric keypad (red)

 Fig. 1. Key groups (QWERTY keyboard layout).

Fig. 1. Key groups (QWERTY keyboard layout).


Author: Anatoli Kazharski

Graphical Interfaces X: The Multiline Text box control (build 8)
Graphical Interfaces X: The Multiline Text box control (build 8)
  • 2017.03.09
  • Anatoli Kazharski
  • www.mql5.com
The Multiline Text box control is discussed. Unlike the graphical objects of the OBJ_EDIT type, the presented version will not have restrictions on the number of input characters. It also adds the mode for turning the text box into a simple text editor, where the cursor can be moved using the mouse or keys.
 

First of all, thank you for the article.

Very big request - please make a gif animation. It is impossible to get an objective idea of how the element works. You need to see with your eyes.

If not difficult.

Thank you.

 
Реter Konow:

...

A very big request - please make a gif animation. It is impossible to get an objective idea of the work of the element. You need to see with your eyes.

Download the files to your computer and test it yourself, please. It will be better than gif-animation.
 
Anatoli Kazharski:
Download the files to your computer and test it yourself, please. It will be better than a gif animation.

Here's how I envisage it:

1. Finish learning OOP.

2. Finish studying all the interrelationships of the library - its classes, functions, variables....

3. Write an EA that implements the element described in the article. However, even with this I may have difficulties and I will have to correspond here with you to help you solve them.


Of course, this option is better, but I will be able to implement it only in a few weeks, or maybe months....

And here, a few tens of minutes and the result will be seen by all...

Well, come on...

 
Реter Konow:

Here's how I envisage it:

1. Finish learning OOP.

2. To study all the interrelationships of the library to the end - its classes, functions, variables....

3. Write an Expert Advisor implementing the element described in the article. However, even with this I may have difficulties and I will have to correspond here with you to help you solve them.


Of course, this option is better, but I will be able to implement it only in a few weeks, or maybe months....

And here, a few tens of minutes and the result will be seen by all...

Well, come on...

All you need to do is to download the files from the archive at the end of the article and compile the Expert Advisor for the test. It will take you no more than one minute.
 
 
Anatoli Kazharski:

Thank you.

The cursor runs perfectly over the text. It transfers with the mouse and keys. The text scrolls. That's what I figured out.

But what I don't understand is how the text gets on the canvas. You didn't show it in the video.

 
Реter Konow:

...

But I don't understand how the text gets on the canvas. You didn't show it in the video.

The same way you enter text from the keyboard, it also gets there on the canvas. And the video shows it too (entering the text 'Hello world!').

Download the files for the test and try it yourself.

 
Anatoli Kazharski:

Just as you enter it on the keyboard, it also gets there on the canvas. The video shows this too.

Download the test files and try it yourself.

In the video you enter text in the input field at the top. "Hello world!" doesn't get on the canvas. That's why I'm asking.


Added:

I downloaded the library, but honestly have no idea how to do all this. There are no instructions.

 
Реter Konow:
In the video, you enter text in the input box at the top. "Hello world!" doesn't make it onto the canvas. That's why I'm asking.

In the video there are two input fields created using the CTextBox class implemented in the article.

The first input field is in single-line mode. The second input field is in multi-line mode. The article talks about this in the section:

For the test, let's create an MQL application with a graphical interface, where there will be two text input fields. One will be single-line and the other will be multi-line.

Maybe before asking questions and making statements, you should first read the article and test the provided files for tests? This is the bare minimum necessary to get to a discussion.

 
Anatoli Kazharski:

The video shows two input fields created using the CTextBox class implemented in the article.

The first input field is in single-line mode. The second input field is in multi-line mode. This is described in the article in the section:

Maybe before asking questions and making statements, you should first read the article and test the provided test files? This is a necessary minimum to get to the discussion.

By the way, I did not make any statements. I read the article, but I didn't understand the main things (there is a lot of code and my eyes get lost).

If you can, please answer a few questions:

1. In the item test application, an array initialised with strings is declared. Does this mean that the strings go to the canvas from it, or can they be printed directly to the canvas?

2. The top input field is independent and has no relation to the bottom canvas? So the text is not transferred from it to the web? Is its purpose to increase the number of input characters?

3. If the canvas text is initialised inside the program and not written on the canvas, why do you need a running cursor?

4. Is it possible to erase the text on the web with the cursor and add from the keyboard?


Thanks.