Code: Select all
--> all handlers
on FillInData pData
-- This message is sent when the Data Grid needs to populate
-- this template with the column data. pData is the value to be displayed.
set the text of me to pData
SetStrikeOut
end FillInData
on LayoutControl pControlRect
-- A default column is just a field.
end LayoutControl
setprop dgHilite pBoolean
-- This custom property is set when the highlight of your column template has
-- changed. You only add script here if you want to customize the highlight.
if pBoolean then
set the foregroundcolor of me to the dgProp["hilited text color"] of the dgControl of me
else
SetStrikeOut
end if
end dgHilite
private command SetStrikeOut
if GetDataOfIndex(the dgIndex of me, "line has error") then
set the textStyle of me to strikeout
else
set the textStyle of me to plain
end if
end SetStrikeOut
getprop dgDataControl
-- Required by library so that it can locate the control.
return the long id of me
end dgDataControl
-- Data grid will call this if a user action asks to edit cell content.
command EditValue
-- word 1 to -2 because of 0001 that is added to control name
EditFieldText the long id of me, the dgIndex of me, word 1 to -2 of the short name of me
end EditValue
on mouseDoubleUp pMouseBtnNum
if pMouseBtnNum is 1 then
if the dgProps["allow editing"] of the dgControl of me \
and the dgColumnIsEditable[the dgColumn of me] of the dgControl of me then
-- Edit field contents if the user double-clicks
EditCellOfIndex the dgColumn of me, the dgIndex of me
exit mouseDoubleUp
end if
end if
pass mouseDoubleUp
end mouseDoubleUp