DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Text Alignment

I have desinged a report lay out.
Using script I will add text to the text object of the report lay out. I want to align this text object in vertical center alignment with respect to page width.

How could i do this?
I tried to use "TxtRelPos" property but it is not working as per my requirement.

Thanks.
0 Kudos
Message 1 of 5
(4,243 Views)
Hi LabVIEW_Vish,

I've attached a script which shows the scriptable functions of the text object.

Hoping this will help you.

Greetings

Walter
0 Kudos
Message 2 of 5
(4,236 Views)
Thnak you, for the reply.

But in my case I am not knowing how big the string would be. Auto expanding of the text box would be help ful.(This is not happening with the TextObject). I want to align "Texts" control centerally to the page.

thanks
vishal.
0 Kudos
Message 3 of 5
(4,232 Views)
Hi,

As you already said there is no auto expanding function for the Text Object. The only way to set the position of the this object is to use the following parameter: ADDGRAOBJHEIGTH, ADDGRAOBJWIDTH, ADDGRAOBJPOSX, ADDGRAOBJPOSY

This example centers the Text Object:

Call GRAPHOBJOPEN("TextObject1")
ADDGRAOBJPOSX= (100 - ADDGRAOBJWIDTH) / 2
ADDGRAOBJPOSY=15
Call GRAPHOBJCLOSE("TextObject1")

Greetings

Walter
0 Kudos
Message 4 of 5
(4,227 Views)
Thanks Walter,

I got the answer.
Here it is.


GRAPHObjOpen("Text1")
TXTTXT ="Text data"
TXTFONT ="Arial"
TXTSIZE =4
TXTCOLOR ="black"
TXTCOLORRGB =33554432
TXTBOLD =0
TXTITAL =0
TXTUNDL =1
TXTSTROUT =0
TXTFRAME =0
TXTBACKCOLOR =""
TXTBACKRGB =0

txtrelpos = "cent"
txtposx = 50
txtposy = 95
Call GRAPHObjClose("Text1")


Previously I was doing X and Y Position first and then setting the Relative postion.
Now it is working fine.

Any way thanks for the help.
0 Kudos
Message 5 of 5
(4,222 Views)