Overriding the 'don't wrap' text option

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Overriding the 'don't wrap' text option

Post by glenn9 »

Hi everyone,

Just wanted to check if it was possible to have a field wrap text as well as at the same time having a list behaviour?

From what I've tried so far they seem to be mutually exclusive, ie if list behaviour is set in a card's properties, it doesn't seem possible to uncheck the 'don't wrap' option. I've tried to override this in script but the script seems to get ignored.

Many thanks,

Glenn
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Overriding the 'don't wrap' text option

Post by Klaus »

Hi Glenn,

I'm afraid you canonly have listfield AND dontwrap or die! :D

But here is a workaround:
Uncheck "listfield" and "downtwrap" in the inspector for your listfield and just add this script to your now EX-listfield:

Code: Select all

on mouseUp 
   select the mouseline  
   ## do something with -> the selectedtext of me 
   ## answer the selectedtext of me
end mouseUp
The user will not be able to tell the difference! 8)

Best

Klaus
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Overriding the 'don't wrap' text option

Post by Klaus »

P.S.
This will however require to script the use of arrowkeys in that field!
But -> the selectedline
will give you something like -> line 2 of fld 1
So scripting is not too difficult, drop a line if you need help with this.
glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Re: Overriding the 'don't wrap' text option

Post by glenn9 »

Thanks Klaus, the mouseLine function works a treat.

I've not needed to use arrowkeys as yet but thank you for your offer of advice.

Kind regards,

Glenn
Post Reply