Making a crowdsourced project on Canvas - page 5

 
Реter Konow:

In my implementation, points A and B are represented by the location of two objects - the X coordinate of the slider track (its start) and the X coordinate of the slider slide.

the same in the drawn version.

you are thinking narrowly, arguing about some ObjectGet/Set
at least three models merge in the control - graphics, events, data.
it does not matter where or how it is drawn. it can be in text form like [.......|...]. it can also appear on the canvas, or two MT rectangle objects can be shown.

The model of events or data doesn't suffer from this.

 
o_O:

it's the same in the drawn version.

you are thinking narrowly, talking about some ObjectGet/Set
The control merges at least three models - graphics, events, data.
It does not matter where and how it is drawn. It can also be in text form like [.......|...]. It can also appear on the canvas, or two MT objects can be shown as rectangle.

The model of events or data does not suffer from this.


Still, the mechanism is not clear to me. If you can explain in more detail, for a general idea, it will help me a lot in understanding. thanks.
 

There is a fundamental question.

Let's say there are two applications, panels, indicators, on one chart. Should each of them draw on its own canvas or both of them on a common one?

There are questions in both cases.

 
o_O:

not just less, but none at all (except bitmap_label, which is where everything is drawn).

I'm just curious how you implement text handling (text label, text input field ). A short list of problems you have to solve:

  • Working with national alphabets (In fonts, for example, the same Times New Roman has an outline for almost all alphabets from English to the great mighty and some Hindi).
  • Text scaling: 6-8-10-12...72 points - the same font size can be set without any problems. Vectoral typeface is kind of what it was created for.
  • Italics, bold, underline - what will you create for each of these types of font or outline algorithm?
  • Typing/editing, cursor control - making it all in the form of a drawing is a hell of a task. To be honest, I can't even begin to imagine how you will implement it.

And all this on the background of already working controls "text label" and "text label with text editing". The only problems are the 32 character size limit and the inability to use integrated fonts.

You will take a lot of time to solve all these problems but you will solve at best 30% of them. Hundreds of kilobytes of your code will at best be a bit out of standard elements, but it will have its own illnesses, glitches and various unpleasant limitations. Do you really need it?

 
Vasiliy Sokolov:
Документация по MQL5: Графические объекты / TextOut
Документация по MQL5: Графические объекты / TextOut
  • www.mql5.com
Графические объекты / TextOut - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
o_O:

Not just less, but none at all (except bitmap_label, which is where everything is drawn).

Also don't forget about event model. It is not designed to handle events on canvas. All you will have is keystrokes in a certain area of the screen + mouse coordinates. Yes, you can get out of this darkness with OOP, but the exit will be hard and very long.

 
Реter Konow:

I still don't understand the mechanism. If you can explain in more detail, for a general idea, it would help me a lot in understanding. thanks.
run the kanvas example from the xo. zip archive https://www.mql5.com/ru/forum/92113#comment_2672543
 
Vasiliy Sokolov:

I'm just wondering how you implement the text work

as already shown - let's use TextOut

You will kill a lot of time to solve all these problems

We won't bang our heads over insurmountable obstacles. If the MC doesn't provide a solution to these problems, all this will stop.

I'm still waiting to hear back from them in SR.

Also, don't forget about the event model. It isn't designed to handle events on the canvas.

Remember, I showed you the analog of your panel for netting order trading? Well, CHARTEVENY_MOUSE_MOVE is not used there, everything is analyzed by itself.

Believe me, there's no problem with events or input carriage display.

Now the question is only about keyboard events.

 
o_O:

Now the issue has only come down to keyboard events.

With the keyboard, everything is more or less clear. There is the event of pressing a key and there is the code for this key. What more do you want?
 
o_O:

We will ask the SR for a refinement.

By the way, if you ask me, it would make life a lot easier in terms of a normal DND by introducing the OnMouseDown event.