Direct editing of polygrid text cells and polylist text elements

panagiotis merakos merakosp at gmail.com
Thu Nov 2 10:56:11 EDT 2023


Hello all,

You can write a script for that. Just add a PolyGrid and a field, set the
name of the field to "Edit" and add this code:

Add this in the script of the field "edit":

on enterinfield
   hide me
end enterinfield

on returninfield
   hide me
end returninfield

on textChanged
   set the pgInternalPointer of widget "PolyGrid" to the cCoordinate of me
   set the pgTextOfCell of widget "PolyGrid" to the text of me
end textChanged

Add this to the script of the PolyGrid:

on cellDoubleClick pCol, pRow, pRect
   set the rect of field "edit" to pRect
   set the text of field "edit" to the pgmousecelltext of me
   set the cCoordinate of field "edit" to  pCol, pRow
   show  field "edit"
   --focus on field "edit"
   select after  field "edit"
end cellDoubleClick

on cellClick
   hide  field "edit"
end cellClick

Now just double-click on a cell to edit it.

Kind regards,
Panos

On Thu, 2 Nov 2023 at 00:01, Paul Dupuis via use-livecode <
use-livecode at lists.runrev.com> wrote:

> +1
>
> I'd like to know this too as I can see no way in the Property Inspector
> or the pgColumns property to indicate a column is 'editable'. Nor can I
> find any property, message, etc. in the polygrid Dictionary entry that
> seems to suggest cell editing.
>
>
> On 11/1/2023 5:28 PM, Peter Thirkell via use-livecode wrote:
> > I am enjoying both the polygrid and polylist add-ons to Livecode. They
> are infinitely flexible to use once you get to know them, and most
> importantly they render beautifully across all platforms.
> >
> > I have one question which doesn’t seem to be addressed in the
> documentation. The polygrid widget specifications say that it supports
> “direct cell editing” but I am not able to find any way to do this. Has
> anyone found a way?
> >
> > More generally, do we have any multi-line input field options for
> Livecode which render well across all platforms? Polygrid and polylist work
> beautifully in displaying already existing data from some sort of data
> repository ... but it would be awesome to provide the ability for users to
> input information as well as display it using the brilliant polygrid and
> polylist tools.
> >
> > Providing truly cross-platform inputting of data and information in an
> easy way would provide the final puzzle piece for many of us wanting to
> provide a modern and beautiful user interface for our apps.
> >
> > Many thanks 😊
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list