You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Don't write nonsense! Doing it through objects is doing it through the arse. You have to create a couple hundred objects just to display text on the screen, while there is a special function called Comment to display this text (I emphasize: TEXT, not labels, for which the Label object is designed). Such a heap of objects, besides being inconvenient, will waste resources, especially when Expert Advisor is running on several charts. Therefore, think a little before you give your advices here. In general, I would like to hear a response from the developers. My question was addressed to them.
As for "graphical components", I'm not sure what you mean by that term. Text editors are programs, not graphical components. Another thing is that if the program uses a component that supports multiline output, the tabulation is used there too. For example, the Memo object.
Everybody is writing silly things. But some people just don't understand it. I'm not talking about Sergeev, I'm talking about you.
What exactly do you see as silly here? I even underestimated about a couple of hundred objects, I have 10-15 columns, and 20-30 rows. In total, I need 200-400 objects on one chart. And there may be many of these charts open.
What exactly do you see as foolishness here?
Foolishness is not being able or willing to hear other people's experiences. No more than
Foolishness is not being able or willing to hear other people's experiences. No more than that.
It's all about how that experience is presented, and whether it's relevant. You read how a few posts earlier this person condescendingly suggested replacing tabs with 4 spaces. Which shows he clearly doesn't understand what tabulation is at all. And then he remembered monospace fonts, while it's not relevant to the function in question. So where do you see experience here?
Otherwise, I'm only happy if someone does share their experience.
"Do you want to drive or do you want to drive?"
Have a look here https://www.mql5.com/ru/forum/122586 . Maybe you'll find your own solution.
sergeev: Мы же вроде все здесь не глупые и понимаем что в Comment не моноширный шрифт.
Meat : Don't be silly!
OK, I was exaggerating about the not stupid ones. I take it back, it didn't apply to you.
What do you mean by that? Don't be shy, we're all on our own here.
Just to get a couple hundred objects just to display text on the screen...
Don't exaggerate. Are you saying you can fit 100 lines of Comment text on your screen? Oh, I doubt it!
All you need to do is:
- is to display the text line by line in label object format.
- use a monospaced font in those labels
- replace the tabs with spaces.
Such a pile of objects, besides being inconvenient, will also eat up resources,
Do you think the Comment function works in a sparing way? It eats resources not less than object output. Because it updates the chart. And this is not a small part of it. You can play at your leisure with the calculation of time.
PS (in a condescending way).
Thanks do not need. Tabs in Comment (especially in MT4) you will wait a long time.
So if you really need it, you will take my advice.
Who has the desire - looks for opportunities, who doesn't - looks for a reason. amen.
Whoever wants to, looks for opportunities, whoever doesn't, looks for a reason.
Whoever is looking for a reason is essentially looking for someone to blame. Not a solution at all. And that is not effective at all.
// I'll say it again and again from time to time. Again and again. Purely to improve the atmosphere of the forum. Looks like some people are getting the hang of it...
It's all a matter of how this experience is presented, and whether it's appropriate. You read how few posts earlier this man condescendingly proposed to replace the tabulation with 4 spaces. Which shows he clearly doesn't understand what tabulation is at all. And then he remembered monospace fonts, while it's not relevant to the function in question. So where do you see experience here?
Otherwise, I'm happy for someone to actually share their experience.
Patience and work will get you there! :)
It's enough to do it once as a function and use it as needed.
The fact that at the moment there are no other options apart from the Label, I myself understand it very well. I didn't ask the question "how do I make tabs?", but "why don't the developers implement it in Comment?", but I haven't heard back from them. Instead I got a bunch of suggestions like, "What do you need an orange for? Eat an apple.
But I've got another idea for non-monospaced fonts, both Comment and most of the Label fonts. We have to somehow get the width of each character in that font. Then you can easily calculate the number of spaces needed to adjust the columns to the same level. Of course the fit will not be exact, with an error of 1-3 pixels, but that's okay. If anyone has any tips on how to find out the width of the characters, I'd be very grateful. And in general, what font is used in Comment? I suspect Arial, but would like to know specifically.
I tried to find a solution using winapi functions, found a function GetTextExtentPoint32, it gives the width of any text string in pixels, and there are similar functions for the width of specific characters, the essence is the same. It seems to be OK, but the resulting width refers to the System font. As far as I understand, this font is set by default for the current display device context (DC) of our window, in which the text is displayed (I pre-set it with the GetDC function). But the text in Comment is clearly displayed in a different font, with different character sizes. This is noticeable, for example, in the proportions of the width of the letters "i" and "w". In general, the question is whether you can somehow set a different font for the current DC, or create your own DC with a specific font? Maybe someone has come across this. I've looked through everything, but haven't figured it out.