The following script was lifted from learn alpha.com. When placed on the on_init event of a form it will expand a form designed in 640x480 to 800x600 or 1024x768. It works with all objects except the tabbed subform.
When the script reaches a tabbed subform, the beginning values for f.object.width and f.object.heighth are increased by an unknown factor. Then those values are multiplied by percnth and percntw. I can see it happen in the debugger, but can't figure out why it happens. Interestingly, the tabs on the tabbed subform are expanded properly.
Any thoughts are appreciated.
''XBasic
dim number as n
dim i as n
dim f as p
dim percntw as n
dim percnth as n
dim SizeH as n
dim SizeW as n
dim name as c
sizeH=UI_info(1)
sizeW=ui_info(0)
percntH = ((sizeH - 480) / 480)+1
percntW = ((sizeW - 640) / 640)+1
number = topparent.children()
for i = 1 to number
f = topparent.child(i)
if eval_valid("f.object.top") = .f. then
goto skip
end if
f.object.top = f.object.top * percnth
f.object.height = f.object.height * percnth
f.object.left = f.object.left * percntw
f.object.width = f.object.width * percntw
if f.class() = "text" .or. f.class() ="field"
.or.f.class() = "Button" .or. f.class() = "Radio"
.or.f.class()="twostbtn".or.f.class()="multistbtn" then
f.font.size = f.font.size * percnth
end if
if f.class() = "Browse" then
f.title.font.size = f.title.font.size * percnth
end if
if f.class() = "Tabbed" then
f.tabs.font.size = f.tabs.font.size * percnth
f.tabs.height = f.tabs.height * percnth
f.tabs.width = f.tabs.width * percntw
end if
skip:
next i
end
When the script reaches a tabbed subform, the beginning values for f.object.width and f.object.heighth are increased by an unknown factor. Then those values are multiplied by percnth and percntw. I can see it happen in the debugger, but can't figure out why it happens. Interestingly, the tabs on the tabbed subform are expanded properly.
Any thoughts are appreciated.
''XBasic
dim number as n
dim i as n
dim f as p
dim percntw as n
dim percnth as n
dim SizeH as n
dim SizeW as n
dim name as c
sizeH=UI_info(1)
sizeW=ui_info(0)
percntH = ((sizeH - 480) / 480)+1
percntW = ((sizeW - 640) / 640)+1
number = topparent.children()
for i = 1 to number
f = topparent.child(i)
if eval_valid("f.object.top") = .f. then
goto skip
end if
f.object.top = f.object.top * percnth
f.object.height = f.object.height * percnth
f.object.left = f.object.left * percntw
f.object.width = f.object.width * percntw
if f.class() = "text" .or. f.class() ="field"
.or.f.class() = "Button" .or. f.class() = "Radio"
.or.f.class()="twostbtn".or.f.class()="multistbtn" then
f.font.size = f.font.size * percnth
end if
if f.class() = "Browse" then
f.title.font.size = f.title.font.size * percnth
end if
if f.class() = "Tabbed" then
f.tabs.font.size = f.tabs.font.size * percnth
f.tabs.height = f.tabs.height * percnth
f.tabs.width = f.tabs.width * percntw
end if
skip:
next i
end
Comment