Hi,
This is how you should do, if you want to place a text in the upper left corner of the chart. Nothing more, nothing less.
placeText("Example", "Text in upper left corner", clRed, 15);
int placeText(char *label, char *text, int color, int y)
{
if (ObjectExists(label) != true)
{
if (ObjectCreate(label, obj_Text, 0, 11, y) == true)
{
ObjectSet(label,OBJPROP_SCREENCOORDS,1);
ObjectSet(label, OBJPROP_VALIGNMENT, 0);
ObjectSet(label, OBJPROP_HALIGNMENT, 0);
}
else
{
return (1);
}
}
ObjectSetText(label, text, 10, "Arial", color);
return (0);
}
How to place a text in the upper left corner
-
- Posts: 26
- Joined: Thu Jun 21, 2012 12:03 am
How to place a text in the upper left corner
- Attachments
-
- Have you ever thought about the ObjectSet(label, OBJPROP_VALIGNMENT and OBJPROP_HALIGNMENT?
In this picture you can se the values used. - objecttext.png (46.63 KiB) Viewed 7492 times
- Have you ever thought about the ObjectSet(label, OBJPROP_VALIGNMENT and OBJPROP_HALIGNMENT?
-
- Posts: 26
- Joined: Thu Jun 21, 2012 12:03 am
If you look at a textlabel in a templates file (found i folder forextester2\templates), you will see a cryptic text like this:
tool_TextLabel "<some label>" "<some text>" 1900.01.10 00:00:00 15.000000 1 1 0 "Arial" FF 10 0 0 0 1 "1 3 5 15 30 60 240 1440 10080 43200"
look at the attached picture, to see what the above numbers and strings mean.
tool_TextLabel "<some label>" "<some text>" 1900.01.10 00:00:00 15.000000 1 1 0 "Arial" FF 10 0 0 0 1 "1 3 5 15 30 60 240 1440 10080 43200"
look at the attached picture, to see what the above numbers and strings mean.
- Attachments
-
- objtext.png (25.98 KiB) Viewed 7484 times
Return to “Programming lessons”
Who is online
Users browsing this forum: No registered users and 11 guests