Multiple Alignments In One Line?

André Bisseret andre.bisseret at wanadoo.fr
Thu Apr 4 03:40:30 EDT 2013


Bonjour Scott,

Before Data grids I used to use the following handler to right align (mainly numbers) in a tab stops field
Below, in order to right align the second column in a field "fData" with two columns :
---
on mouseUp
    local tData,
    -------
    set the itemDel to tab
    put fld "fData" into tData
    repeat with x = 1 to the number of lines in tData
        put format("%13s",item 2 of line x of tData) into item 2 of line x of tData
    end repeat
    put tData into fld "fData"
end mouseUp

Just in case it is not what your are already doing ;-)

Best regards from Grenoble

André

Le 4 avr. 2013 à 06:47, Scott Rossi a écrit :

> Thanks Paul.
> 
> Yes, I was hoping the new text properties might accommodate more robust alignment. I wound up using some basic tab stops and just living with the result.
> 
> Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX/UI Design
> 
> -------- Original message --------
> Subject: Re: Multiple Alignments In One Line? 
> From: Paul Hibbert <lc at pbh.on-rev.com> 
> To: How to use LiveCode <use-livecode at lists.runrev.com> 
> CC:  
> 
> Scott,
> 
> I'm sure you already know that you would usually do this with tabs in a word processor, AFAIK you can't normally apply both left and right text align on the same line.
> 
> Looking at the tabStops property in LC, there doesn't appear to be a way to control left and right alignment of the stops, it looks like they only work well with left align.
> 
> Dictionary Quote:
> Setting the field's textAlign to center or right may cause unexpected results when using tab stops.
> 
> If you use a mono-spaced font for the field, then you could just count the number of chars and just add spaces, not elegant, but could work, although I'd guess you would prefer elegant!
> 
> I had a play with scripting the tabStop to match a text selection to achieve a similar result (without resorting to mono-spaced fonts). It's not perfect, it works, but it may not be exactly what you are looking for, the test stack is here if it helps…
> 
> https://www.dropbox.com/s/twas5ofcko73r53/Tab%20Stops%20Test.livecode
> 
> Paul
> 
> 
> On 2013-04-03, at 3:05 PM, Scott Rossi wrote:
> 
>> Anybody know if it's possible to use two different text align settings on
>> the same line using the (newish) styledText property?
>> 
>> I want to have the first few words of a line aligned left in the field, and
>> the last few words aligned right.
>> 
>> Thanks & Regards,
>> 
>> Scott Rossi
>> Creative Director
>> Tactile Media, UX/UI Design
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list