Tree View Values

Brian Milby brian at milby7.com
Thu Aug 30 14:04:52 EDT 2018


There is already a PR merged into 9.1 that will auto select the text of any
field in the PI when you enter it via tab.  This also selects the key field
in the Custom Properties inspector when the highlight changes.  If you tab
into the value, then the value is selected.

Changing the logic to select a non-empty value field in the PI probably
wouldn't be that hard, but would then introduce a difference in behavior
that may not always be desirable.

Having a new key when added get selected is the next thing I'm working on,
but that is proving to be a little bit more of a challenge.  Having the
tree widget highlight a new sub-key was easy.  Top level keys are proving
to be a little more difficult.  The current PI code doesn't like the
highlight change though.

Brian

On Thu, Aug 30, 2018 at 11:50 AM Bob Sneidar via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Hi Brian.
>
> Actually for my purposes I need the last key of the array node. For
> example, if I have an array:
>
> myArray [level1] [level2] [level3]
>
> and the value is "Test1"
>
> then I need to return an array:
>
> aArrayNode [level3]
>
> I worked it out using my method so I'm not asking for a modification to
> your method, this for informational purposes only. What I am actually
> creating is an XML editor using a tree view, and also I am creating a
> method for solving the Property Inspector issue some have raised, where
> clicking a tree node does not hilite the node name or the value if there is
> one.
>
> What I am doing is almost identical to what the the property inspector
> does. I've worked it out so that hiliting a tree node whose value is an
> array puts the name of the hilited node into the Key field, selects the
> text of the key field, and puts empty into the Value field. If however the
> value of the hilited node is a value, it puts the value into the Value
> field and selects the text of the value field. This IMHO is the way the
> property inspector *ought* to work.
>
> Bob S
>
>
> > On Aug 30, 2018, at 07:41 , Bob Sneidar via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >
> > Oh there you go! That works.
> >
> > Bob S
> >
> >
> >> On Aug 29, 2018, at 13:58 , Brian Milby via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >>
> >> Here is another way to do it:
> >>
> >> function getHilightedValue pTreeWidgetReference
> >>  local tElement, tArray
> >>  put the arrayData of pTreeWidgetReference into tArray
> >>  put the hilitedElement of pTreeWidgetReference into tElement
> >>  split tElement by comma
> >>  return tArray[tElement]
> >> end getHilightedValue
>
> _______________________________________________
> 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