Hi.
Working with table fields, in 6.7.10. Never found it reliable to edit directly inside the table - so many ways the beloved user can mess up the data! And the "phantom field"s working (cRevTable/ cell editing) was ever beyond my intuition. Besides, I need validation/ sanitizing for changed fields contents.
So I rolled my own, using basically vanilla locked fields with grid & tabStops. When populating the table:
Code: Select all
repeat with i = 1 to the number of items in fld "My_fld"
set the textstyle of item i of line o of fld "My_fld" to "link"
end repeat
This separates the single fields, and setting the diff. colors (link, linkhilite ...) gives a nice "responsive" table. In the field script:
Code: Select all
-- ### Must be polished still!
on mousedoubleup
put word 2 of the clickline into MyLine -- number of clicked line
put the clickchunk into MyLoc -- desc. of that was clicked
put item 1 of the clickloc - the left of me into MyHorz
put the tabstops of me into MyTSt
if MyLoc is empty then -- click was not within text
beep
exit mousedoubleup
end if
repeat with i = 1 to the number of items of MyTsT -- find the number of the clicked item:
if MyHorz >= item i of MyTst then
next repeat
else
put i into MyItem
set itemdel to tab
select item i of line MyLine of the target
put the selectedtext of me into MyOld
exit repeat
end if
end repeat
-- Custom ASK dialog, you may ignore the cryptic syntax: (# => return ...) --
get cDialog("ask", "question", B2H("#" & MyOld & "###Change to:"), MyOld, "OK","Cancel" ,)
if line 1 of it is not 1 then exit mousedoubleup -- line 1 returns the button pressed, 1=OK here
get line 2 of it -- line 2 returns the (possibly changed) tablefield
get CheckData(it, MyItem) -- validation/ sani. function, returns "good" data
if it is not empty then
do "put it into item " & MyItem & " of line " & MyLine & " of me"
do "set the textstyle of item " & MyItem & " of line " & MyLine & " of me to link"
else exit mousedoubleUp
if MyOld is not item MyItem of line MyLine of me then -- data has changed, color it
set the backcolor of me to "155,225,225"
end if
select empty
end mousedoubleup
By the way - this works fine in 6.7.10, in a table field,
but only as long as you omit cRevTable/ cell editing:
Code: Select all
on mouseUp
put the clickfield
end mouseUp
Fun fact (Win 10): If left mousebtn, it only works with filled lines in locked tables.
If right mousebtn, it works always ;-)
Finally:
dunbarx wrote:I want to migrate, but will not. I do not feel at home in any way with v8, for many reasons, though mostly cosmetic.
Where can I sign?
I experience LC 8 as slow, bloated & very ugly, compared to LC 6. A lot of fancy gadgets has been stuffed in, just - I don't make shiny multimedia apps for iThingies, I'm coding boring tools for people that make their living with 'em. They don't expect integrated youpron functionality nor bells, whistles or fancy visual effects. They expect me to deliver rock solid working horses, as lean, fast and versatile as possible. And since LC 6.7.10 nothing new has been added that would help me.
Besides, from my view all of LC 8 is at best a public beta. The amounts of bugs reported (and experienced) is astonishing, even for the versions marked as "stable". Thus I remain at 6.7, there at least the amount of bugs is tolerable, and most are known already ...
I don't think the way RunRev goes now is a good one. Sometimes I wish somebody would fork LC 6.
Have fun!