View previous topic :: View next topic |
Author |
Message |
HenryEx Advanced Cheater Reputation: 1
Joined: 18 Dec 2011 Posts: 76
|
Posted: Fri Jul 17, 2015 8:21 am Post subject: Can't change AutoSize on a Label |
|
|
I'm trying to build my GUI entirely in LUA and have hit a problem:
I want to use labels of a certain size with word wrap, and for that i need to disable AutoSize which is on by default. It's easy in the form designer - switch it from True to False.
But there's no setAutoSize for the label class, and using setProperty( label, "AutoSize", "False" ) does nothing.
I tested getProperty( label, AutoSize ) and it apparently returns nil.
Is there no way to set AutoSize off without the form designer?
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Fri Jul 17, 2015 12:31 pm Post subject: |
|
|
Try label.AutoSize = false ?
Try set its control color or alignment to easier see the effect.
Code: | local b = createLabel(UDF1)
b.AutoSize,b.Name,b.Caption=false,'test','Hello'
b.Top,b.Width,b.Height,b.Alignment,b.Color,b.Font.Color=30,100,50,'taCenter',0x886644,0xffffff
|
_________________
- Retarded. |
|
Back to top |
|
|
HenryEx Advanced Cheater Reputation: 1
Joined: 18 Dec 2011 Posts: 76
|
Posted: Fri Jul 17, 2015 3:06 pm Post subject: |
|
|
Thanks, that works.
Is there any rhyme or reason as to when i can just use Object.Property to assign values (like with AutoSize here) and when i have to use setProperty( Object, Property, value )?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Fri Jul 17, 2015 3:52 pm Post subject: |
|
|
setProperty is obsolete and shouldn't be used, so when possible, use Object.Propertyname
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
HenryEx Advanced Cheater Reputation: 1
Joined: 18 Dec 2011 Posts: 76
|
Posted: Sat Jul 18, 2015 7:52 am Post subject: |
|
|
As a counter example, i wanted to center some text on a panel.
panel.Alignment = "taCenter" didn't work, it was still left-aligned.
setProperty(panel, "Alignment", "taCenter") DID work, on the other hand.
Or is there some third option i`can use when Object.Propertyname doesn't work?
|
|
Back to top |
|
|
|