My datagrid deviates from the tutorial in that the images available on disk are quite large being approximately 500 pixels on the long edge. My aim is to have them displayed at 180 by 180 pixels but so far I have failed.
I note that the boiler plate comments mention a resizecontrol handler but I am unclear where this is or should be.
Code: Select all
on FillInData pDataArray
-- This message is sent when the Data Grid needs to populate
-- this template with the data from a record. pDataArray is an
-- an array containing the records data.
-- You do not need to resize any of your template's controls in
-- this message. All resizing should be handled in resizeControl.
-- Example:
set the text of field "Title" of me to pDataArray["Title"]
set the text of field "Caption" of me to pDataArray["Caption"]
set the filename of image "Rowimage" of me to pDataArray["Folderpath"] & "/" & pDataArray["ThumbnailFile"]
##set the width of image "Rowimage" to 180 -- Does not work
##set the height of image "Rowimage" to 180 -- Does not work
end FillInData
on LayoutControl pControlRect, pWorkingRect
local theFieldRect
-- This message is sent when you should layout your template's controls.
-- This is where you resize the 'Background' graphic, resize fields and
-- position objects.
-- For fixed height data grid forms you can use items 1 through 4 of pControlRect as
-- boundaries for laying out your controls.
-- For variable height data grid forms you can use items 1 through 3 of pControlRect as
-- boundaries, expanding the height of your control as needed.
-- The working rect is defined area of the control you can safelt use.
-- Use this rect to make sure your controls don't overlap with any edit mode controls.
-- Example:
set the width of image "Rowimage" to 180 -- does not work
set the height of image "Rowimage" to 180 -- does not work
set the right of image "RowImage" of me to item 3 of pControlRect - 5
put the left of image "RowImage" of me into theLeft
put the rect of field "Title" of me into theRect
put theLeft - 10 into item 3 of theRect
set the rect of field "Title" of me to theRect
put the rect of field "Caption" of me into theRect
put theLeft - 10 into item 3 of theRect
set the rect of field "Caption" of me to theRect
set the rect of graphic "Background" of me to pControlRect
end LayoutControl
best wishes
S