Skip to content

Instantly share code, notes, and snippets.

@stephen-maina
Created August 18, 2015 11:32
Show Gist options
  • Save stephen-maina/959f9d897b6b01854459 to your computer and use it in GitHub Desktop.
Save stephen-maina/959f9d897b6b01854459 to your computer and use it in GitHub Desktop.
global type gr_resize_objects from function_object
end type
forward prototypes
global function integer gr_resize_objects (any str_array_objects, integer workspace_width, integer workspace_height)
end prototypes
global function integer gr_resize_objects (any str_array_objects, integer workspace_width, integer workspace_height);
str_resize_objects objects []
objects=str_array_objects
integer index_o
integer index
for index_o=1 to upperbound(objects)
str_resize_objects ob
ob=objects[index_o]
integer const []
const=ob.constant_array
integer vars []
vars=ob.variable_array
choose case typeOf(ob.base_object )
case UserObject!
UserObject uo
uo=ob.base_object
for index=1 to upperbound(const)
choose case typeOf(uo.control[const[index]] )
case CommandButton!
CommandButton obb
obb=uo.control[const[index]]
obb.move(obb.x,workspace_height -200 )
case CheckBox!
CheckBox chb
chb=uo.control[const[index]]
chb.move(chb.x,workspace_height -200 )
end choose
next
for index=1 to UpperBound(vars)
choose case typeOf(uo.control[vars[index]])
case DataWindow!
DataWindow dw
dw=uo.control[vars[index]]
dw.resize(uo.width - 100,workspace_height - 800)
end choose
next
case Window!
Window win
win=ob.base_object
for index=1 to upperbound(const)
choose case typeOf(win.control[const[index]] )
case CommandButton!
CommandButton obb1
obb1=uo.control[const[index]]
obb1.move(obb1.x,workspace_height -200 )
case CheckBox!
CheckBox chb1
chb1=uo.control[const[index]]
chb1.move(chb1.x,workspace_height -200 )
end choose
next
for index=1 to UpperBound(vars)
choose case typeOf(win.control[vars[index]])
case DataWindow!
DataWindow dw1
dw1=win.control[vars[index]]
dw1.resize(win.width - 100,workspace_height - 800)
end choose
next
end choose
next
return 1
end function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment