Resizing field with scrollbar
Posted: Mon Aug 13, 2012 4:12 pm
I am working on resizing objects to fit the user's device when a card opens. I have a field that is pulling in information from a sqlite database.
There are more items than I want to show - i.e. I want it to be a scrolling field.
When I manually set up the card, I can get it to scroll and the object stays the size I set it. But when it reloads and goes through my resizing code, the entire list shows - with a lovely scrollbar on the right that is useless because the entire list is showing. First, I tried setting it (see line in bold) to the height of group "task list".... no luck..... Then, I tried setting it to a specific size (100)... no difference.
I don't understand why you set a group height AND a field height.... But I've tried switching things around and nothing makes the list be limited in height with the remainder accessible using the scrollbar.
-- ## Size and position the task list group
set the width of group "task list" of me to tStackWidth
-- set the height of group "task list" of me to (tStackHeight *0.29)
set the top of group "task list" of me to (tStackHeight*0.31)
set the left of group "task list" of me to 0
-- ## Position the task field:
-- set the height of field "tasklist" of me to 100
answer height of field "tasklist"
set the width of field "tasklist" of me to the width of grp "task list" of me
set the topleft of field "tasklist" of me to the topleft of grp "task list" of me
-- put max(30,the height of group "task list" of me/10) into tTextHeight
-- set the textSize of field "tasklist" of me to tTextHeight/2
-- set the textHeight of field "tasklist" of me to tTextHeight
end layoutCard
What am I missing?
Thanks
There are more items than I want to show - i.e. I want it to be a scrolling field.
When I manually set up the card, I can get it to scroll and the object stays the size I set it. But when it reloads and goes through my resizing code, the entire list shows - with a lovely scrollbar on the right that is useless because the entire list is showing. First, I tried setting it (see line in bold) to the height of group "task list".... no luck..... Then, I tried setting it to a specific size (100)... no difference.
I don't understand why you set a group height AND a field height.... But I've tried switching things around and nothing makes the list be limited in height with the remainder accessible using the scrollbar.
-- ## Size and position the task list group
set the width of group "task list" of me to tStackWidth
-- set the height of group "task list" of me to (tStackHeight *0.29)
set the top of group "task list" of me to (tStackHeight*0.31)
set the left of group "task list" of me to 0
-- ## Position the task field:
-- set the height of field "tasklist" of me to 100
answer height of field "tasklist"
set the width of field "tasklist" of me to the width of grp "task list" of me
set the topleft of field "tasklist" of me to the topleft of grp "task list" of me
-- put max(30,the height of group "task list" of me/10) into tTextHeight
-- set the textSize of field "tasklist" of me to tTextHeight/2
-- set the textHeight of field "tasklist" of me to tTextHeight
end layoutCard
What am I missing?
Thanks