formattedwidth seems ignore return char in btn label: fixed
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
formattedwidth seems ignore return char in btn label: fixed
Hi All
First time I use a btn label with two lines.
It seems that the formattedwidth ignore return char
(LC 8.1.6 for OSX)
Best regards
Jean-Marc
First time I use a btn label with two lines.
It seems that the formattedwidth ignore return char
(LC 8.1.6 for OSX)
Best regards
Jean-Marc
Last edited by jmburnod on Mon Nov 13, 2017 3:57 pm, edited 1 time in total.
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: formattedwidth seems ignore return char in btn label
Jean-Marc
With a default button in v.6.7:
I get 143. That is what it would take to fit those "A's"
Craig
With a default button in v.6.7:
Code: Select all
on mouseUp
put "AAAAAAAAAAAAAA" & return & "BBBB" into temp
set the label of btn 1 to temp
answer the formattedWidth of btn 1
end mouseUp
Craig
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: formattedwidth seems ignore return char in btn label
Hi Craig,
I get 163 (LC 8.1.6)
Same result with return or not in btn label
Jean-Marc
I get 163 (LC 8.1.6)
Same result with return or not in btn label
Jean-Marc
https://alternatic.ch
Re: formattedwidth seems ignore return char in btn label
Jean-Marc,jmburnod wrote: Same result with return or not in btn label
Some tests on my MacSierra, LC 8.1.6
Code: Select all
on mouseUp
get "M"
set the label of me to IT
put the formattedWidth of me into v1
get "M" &cr
set the label of me to IT
put the formattedWidth of me into v2
get "M" &cr& "M"
set the label of me to IT
put the formattedWidth of me into v3
get "M" &cr& "MMMMMMMM"
set the label of me to IT
put the formattedWidth of me into v4
put v1 && v2 && v3 && v4 --> 16 22 39 157
end mouseUp
Bon week-end,
Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: formattedwidth seems ignore return char in btn label
Hi Friends,
Thank you.
I'll fill a bug report
Best
Jean-Marc
Thank you.
I'll fill a bug report
Best
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: formattedwidth seems ignore return char in btn label
Does it mean anything at all that the formattedWidth of a button with a certain text in its label is different than the formattedWidth of a field with the same text? I assume that is just how such text is displayed in the two controls.
Craig
Craig
Last edited by dunbarx on Sat Sep 16, 2017 7:15 pm, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: formattedwidth seems ignore return char in btn label
Yes, that is the case on LC 8.1.6the formattedWidth of a button with a certain text in its label is different than the formattedWidth of a field with the same text?
Jean-Marc
https://alternatic.ch
Re: formattedwidth seems ignore return char in btn label
Put together a test stack to check this out on a variety of LiveCode versions. Every one I tested on Mac exhibited the error. 9.0DP8 on Windows that gave the "expected" results.
Mac tests on Sierra, Win tests on Windows 10
6.7.11 & 7.1.4 Mac --> 17 26 35 20 29 38
6.7.11 & 7.1.4 Win --> 19 30 41 27 38 49
8.1.7RC1 Mac --> 19 30 41 22 34 45
8.1.7RC1 Win --> 19 30 41 27 38 49
9.0DP8 Mac --> 19 30 41 22 34 45
9.0DP8 Win --> 19 30 41 19 19 30
Code: Select all
put "M" into tLabel
set the label of me to tLabel
set the label of me to tLabel & tLabel
set the label of me to tLabel & tLabel & tLabel
set the label of me to tLabel & cr
set the label of me to tLabel & cr & tLabel
set the label of me to tLabel & cr & tLabel & tLabel
put space & the formattedWidth of me after field "Results" --after each "set" line above
6.7.11 & 7.1.4 Mac --> 17 26 35 20 29 38
6.7.11 & 7.1.4 Win --> 19 30 41 27 38 49
8.1.7RC1 Mac --> 19 30 41 22 34 45
8.1.7RC1 Win --> 19 30 41 27 38 49
9.0DP8 Mac --> 19 30 41 22 34 45
9.0DP8 Win --> 19 30 41 19 19 30
- Attachments
-
- FormattedWidthTest55.livecode.zip
- Test Stack (expands on Thierry's code)
- (1.33 KiB) Downloaded 180 times
Brian Milby
Script Tracker https://github.com/bwmilby/scriptTracker
Script Tracker https://github.com/bwmilby/scriptTracker
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: formattedwidth seems ignore return char in btn label
Hi All,
bug confirmed 20405
Best
Jean-Marc
bug confirmed 20405
Best
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: formattedwidth seems ignore return char in btn label: fixed
Hi All,
Comment # 4 on bug 20405 from Panos Merakos
This bug is now fixed in LiveCode 8.1.8 RC-1
Best regards
Jean-Marc
Comment # 4 on bug 20405 from Panos Merakos
This bug is now fixed in LiveCode 8.1.8 RC-1
Best regards
Jean-Marc
https://alternatic.ch