ObjectSet...

 

Hi all,


I am a newbie trying to build my EA working around with Labels and Text messages to create a dashboard. It takes a lot of lines to create a text with a rectangle background.

I was wondering if there is a function for positioning the Label, similar to ObjectSetText where you can input the size, font and color on one line. Isn't there a function to set the object label position by inputting the Corner, X & YDistance ie: ObjectSetPosition(name, Corner, Xdistance, Ydistance)... 3 lines in one!


Cheers!

pete

 

You need to make you own.

Example:

void SetPosition(string name, int corner, int x, int y)
  {
   ObjectSetInteger(0, name, OBJPROP_CORNER,    corner);
   ObjectSetInteger(0, name, OBJPROP_XDISTANCE, x);
   ObjectSetInteger(0, name, OBJPROP_YDISTANCE, y);
  }  

 

Then call it like so: 

   SetPosition("MyObject1", CORNER_RIGHT_UPPER, 10, 10);   
   SetPosition("MyObject2", CORNER_LEFT_UPPER , 15, 15);   
   SetPosition("MyObject3", CORNER_RIGHT_LOWER, 20, 20);   
 
honest_knave:

You need to make you own.

Example:

 

Then call it like so: 

Wow, you just saved the day!! I was about to give up... Thank you
Reason: