-
1. Re: Bug: static_text alignment and truncation
John R. Ellis Oct 24, 2010 9:52 AM (in response to John R. Ellis)[Darn forum software]
On Mac OS 10.6.4:
- An "alignment" value of "right" never truncates on the left. If the text is too big to fit, the leftmost character is always displayed, regardless of whether it contains spaces.
- Truncation works properly.
Here's a test program:
local LrBinding = import 'LrBinding'
local LrDialogs = import 'LrDialogs'
local LrFunctionContext = import 'LrFunctionContext'
local LrView = import 'LrView'local bind = LrView.bind
local f = LrView.osFactory()
local share = LrView.shareLrFunctionContext.callWithContext ("", function (context)
local prop = LrBinding.makePropertyTable (context)
prop.text = "abc def ghi jkl mno pqr"
LrDialogs.presentModalDialog {title = "Test", resizable = "horizontally",
contents = f:column {fill_horizontal = 1, bind_to_object = prop,
f:edit_field {value = bind ("text"), immediate = true},
f:row {
f:static_text {title = "alignment = 'right':",
width = share ("l"), alignment = "right",
font = "<system/bold>"},
f:static_text {title = bind ("text"), width_in_chars = 8,
alignment = "right", wrap = false}},
f:row {
f:static_text {title = "alignment = 'left':",
width = share ("l"), alignment = "right",
font = "<system/bold>"},
f:static_text {title = bind ("text"), width_in_chars = 8,
alignment = "left"}},
f:row {
f:static_text {title = "truncation = 'head':",
width = share ("l"), alignment = "right",
font = "<system/bold>"},
f:static_text {title = bind ("text"), width_in_chars = 8,
truncation = "head"}},
f:row {
f:static_text {title = "truncation = 'tail':",
width = share ("l"), alignment = "right",
font = "<system/bold>"},
f:static_text {title = bind ("text"), width_in_chars = 8,
truncation = "tail"}}}}
end)

