Page 1 of 1

Broken table field in v8.1

Posted: Tue Sep 27, 2016 10:53 pm
by dunbarx
On a new card make a table field. A handful of columns wide will do. A handful of rows would be nice.

If I click in a "cell" on the left side of the table field, whatever I type will go into that cell. If I click on a cell on the right side somewhere, the data goes into a cell somewhere on one of the leftmost columns, usually column 2, and several rows down. Oh yes, whatever I type will append, not replace any data already in the (unknowable) target cell. No problem duplicating this in new sessions. I bet anyone can do it.

I cannot even smugly say I am going back to v6, because over there, if I have the following handler in the field script:

Code: Select all

on mouseUp
   put the clickfield
end mouseUp
I can reliably crash v.6.9. Anyone can do it. No handler, no problem.

I happen to like table fields. Anyone else see this before I file a report?

Oh yes, at least in v6, the phantom field that opens for editing overlies the "cell" of interest. As I expected, in v8, the phantom is offset, overlarge, and clunky. I want to migrate, but will not. I do not feel at home in any way with v8, for many reasons, though mostly cosmetic.

Craig Newman

Re: Broken table field in v8

Posted: Tue Sep 27, 2016 11:31 pm
by FourthWorld
FWIW that recipe doesn't crash in v8.1 on Ubuntu 14.04. If you're seeing a crash in v8.1 please file a report with the recipe.

Re: Broken table field in v8.1

Posted: Wed Sep 28, 2016 1:10 pm
by AxWald
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!

Re: Broken table field in v8.1

Posted: Wed Sep 28, 2016 7:50 pm
by FourthWorld
AxWald wrote: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.
Reverting to v6 would kill Mac use, as Apple has been deprecating an ever larger number of Carbon APIs, a trend which will only continue. Similarly, updating the text engine to handle modern Unicode is a must-have for most of us, even those of us working exclusively in US English, since many of our apps exchange data with the outside world all using Unicode encodings.

As the Python community and others have experienced, Unicode adoption is complex and will sometimes impact performance. It took Python a few versions to bring performance back closer to pre-Unicode levels, and we see a similar pattern with LiveCode, where v8 is much faster than v7 in many operations, and a few may even exceed v6.

But with the changes there are bound to be occasional regressions. I've had good luck, in which the only changes I've seen have been things like needing to update my layouts to take advantage of the much smarter OS themes in v8.

If you've found issues in v8.1 which have affected previously-working code, please note your bug report numbers here and I'll be happy to help triage those if I can reproduce them.

Re: Broken table field in v8.1

Posted: Wed Sep 28, 2016 8:07 pm
by dunbarx
Richard.

I want to thank you for being the ombudsman for LC.

Craig

Re: Broken table field in v8.1

Posted: Fri Sep 30, 2016 12:07 pm
by AxWald
Hi,

I started to write a long reply here, but then decided it would hopelessly off topic & unpolite. So I put it aside. Maybe some day I'll find time & space to vent my unhappiness with the situation, elsewhere.

Have fun!