Tree View / Custom Properties PI

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Tree View / Custom Properties PI

Clarence Martin via use-livecode
Before going too far, I'd like to get some feedback on the best way to
address one of the issues that Curry brought up.

Currently, when in the Tree View widget (which is used in the Custom
Properties PI), if you click on the "+" icon to add a new array key, the
value in the existing key is lost if it is not already an array.  My
proposal here is to migrate the value to the new key (1).  If you clicked
the "+" again, then you would get the normal new key (2) with an empty
string as the value.

Line 1514 of the treeview.lcb file:
put **tElement** into tArray[1 formatted as string]

What is probably a bigger potential issue is if you set a value on a key
that is currently an array.  If that is done in the PI, then the sub-array
is lost and replaced with the value.  Still thinking on this piece (but the
change is going to be in the PI and not the Tree widget).  I'm thinking
that a confirmation dialog is appropriate here.

Here's a fix for (much of) the text selection issue:

Mac path:   LiveCode9.app/Contents/Tools/Toolset
/palettes/inspector/behaviors/revinspectoreditorbehavior.livecodescript

add the following handler:

after openField
   select the text of the target
end openField

That will auto-select text in the PI in many cases.  There is a need for
another statement in the custom properties behavior (here are lines 69-73
in the 9.0.1 source; 72 is the new line):
/palettes/inspector/editors/com.livecode.pi.customprops.behavior.livecodescript

      if the result is empty then
         put tKey into field "value" of me
         put item -1 of tPath into field "key" of me
         **select the text of field "key" of me**
      else

I have not looked into automatically selecting the newly created key, but
with the above 2 additions when you click on a line in the tree view widget
the key is selected with focus and ready for edit.  A tab will take you to
the value field with the text selected.

So, it looks like adding 4 lines of code to the IDE and changing 1 word in
the Tree View widget source can remove a few of the irritation points.
Before submitting anything, I do want to see if I can identify where to
address the resize issue mentioned above.

Thanks,
Brian
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Tree View / Custom Properties PI

Clarence Martin via use-livecode
You would need to set the focus to the field for the key value when the + button was clicked. Unfortunately, the revInspector stack has a blank card, so apparently it is built "on the fly". I cannot discern what the field name or the + button name is.

Bob S


> On Aug 9, 2018, at 22:01 , Brian Milby via use-livecode <[hidden email]> wrote:
>
> I have not looked into automatically selecting the newly created key, but
> with the above 2 additions when you click on a line in the tree view widget
> the key is selected with focus and ready for edit.  A tab will take you to
> the value field with the text selected.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Tree View / Custom Properties PI

Clarence Martin via use-livecode
And the + button is actually an element of the treeview widget, so good luck with that. You would have to trap for an event when the + button is clicked, and I think if I understand widgets, that the event would have to be exposed to the IDE by the widget.

Bob S


> On Aug 10, 2018, at 08:19 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> You would need to set the focus to the field for the key value when the + button was clicked. Unfortunately, the revInspector stack has a blank card, so apparently it is built "on the fly". I cannot discern what the field name or the + button name is.
>
> Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Tree View / Custom Properties PI

Clarence Martin via use-livecode
Events are sent when the button is clicked, just need to verify everything. It may require a different message, but have not gotten that far. Modifying the widget is easy though.

Thanks,
Brian
On Aug 10, 2018, 10:24 AM -0500, Bob Sneidar via use-livecode <[hidden email]>, wrote:

> And the + button is actually an element of the treeview widget, so good luck with that. You would have to trap for an event when the + button is clicked, and I think if I understand widgets, that the event would have to be exposed to the IDE by the widget.
>
> Bob S
>
>
> > On Aug 10, 2018, at 08:19 , Bob Sneidar via use-livecode <[hidden email]> wrote:
> >
> > You would need to set the focus to the field for the key value when the + button was clicked. Unfortunately, the revInspector stack has a blank card, so apparently it is built "on the fly". I cannot discern what the field name or the + button name is.
> >
> > Bob S
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Tree View / Custom Properties PI

Clarence Martin via use-livecode
In reply to this post by Clarence Martin via use-livecode

Brian:

 > So, it looks like adding 4 lines of code to the IDE
 > and changing 1 word in the Tree View widget source
 > can remove a few of the irritation points.

Nice! Thanks for looking into this part of it.

Best wishes,

Curry Kenworthy

Custom Software Development
LiveCode Training and Consulting
http://livecodeconsulting.com/

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode