ObjectSet...

Back to topics list To post a new topic, please log in or register
avatar
6
pete_36 2015.10.24 11:47
 

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

avatar
736
honest_knave 2015.10.24 12:06 #
 

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);   
avatar
6
pete_36 2015.10.24 20:52 #
 
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
Back to topics list  

To add comments, please log in or register