Code: Select all
-- Data grid will call this if a user action asks to edit cell content.
command EditValue
put the dgColumn of me into tCol
if offset(tCol,"Shares To Sell,Price/Share,Commission,Amount,Sell Date") > 0 then
EditFieldText the long id of me, the dgIndex of me, the dgColumn of me
end if
end EditValue
on mouseDoubleUp pMouseBtnNum
if pMouseBtnNum is 1 then
put the dgColumn of me into tCol
if offset(tCol,"Shares To Sell,Price/Share,Commission,Amount,Sell Date") > 0 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
end if
pass mouseDoubleUp
end mouseDoubleUp
The other behavior I would like to have is that when a user modifies one of the columns 'Shares To Sell', 'Price/Share' or 'Commission' then the Amount would automatically be calculated (provided all the necessary values were present). This is all compounded by the fact that I am working in a window that is modal so tracing and message watching is not very easy to do.
Does anyone have any suggestions for getting these behaviors working?
Thanks in advance,
Larry