Re: Datagrids and Nested Behaviors

2018-07-25 Thread Brian Milby via use-livecode
You are welcome!  Of course Bernd is the one who provided the key piece of
information.

I updated my GitHub repo with a README (trying to figure out how to do
them).  So now when you go to the link, it will pull in the image and
provides links to this thread, the PR, and the individual scripts.

https://github.com/bwmilby/lc-misc/tree/master/NestedDGBehavior


On Wed, Jul 25, 2018 at 9:35 AM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks Brian. There IS no better development community in the world than
> this one. This all began with Hypercard communities and their spirit of
> sharing and mutual support. We seem to be the last bastion.
>
> Bob S
>
>
> > On Jul 24, 2018, at 16:31 , Brian Milby via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > PR submitted on Bug 21427.
> > https://github.com/livecode/livecode-ide/pull/1987
> >
> > Since it is a full PR, I went ahead and switched over to using a script
> > local everywhere and initialize it when the DG is initialized.  I also
> > looked for an object in the DG resource stack instead of hard coding the
> > stack name.  I'm thinking about posting a stack that can make the
> temporary
> > modifications necessary to allow this functionality while waiting on the
> > code to make it to production.  The temp mods will be much closer to what
> > was posted in this thread.
> >
> > On Tue, Jul 24, 2018 at 10:03 AM, Bob Sneidar via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> Never mind Brian, it works. I had the behavior of the custom button set
> >> the the behavior STACK and NOT the reDataGridLibrary stack button (now
> >> empty).
> >>
> >> Once I got the behavior of the custom button set to the old behavior
> >> button, the datagrid now works! You guys are freaking geniuses!
> >>
> >> Bob S
> >>
> >>
> >>> On Jul 24, 2018, at 07:57 , Brian Milby via use-livecode <
> >> use-livecode@lists.runrev.com> wrote:
> >>>
> >>> I’ll put something together tonight. The code in the library has to be
> >> updated before opening a card with a DG that has the adjusted behavior
> >> chain. I have an idea on how to do it in script, but need to test it
> out to
> >> verify it will work.
> >>> On Jul 24, 2018, 9:54 AM -0500, Bob Sneidar via use-livecode <
> >> use-livecode@lists.runrev.com>, wrote:
>  I did so. I get this when opening my test stack:
> 
>  91,260,123
>  62,260,123
>  77,260,123
>  456,260,57
>  534,260,123
>  253,260,123
>  241,236,1,_Initialize
>  353,0,0,stack "/Applications/LiveCode Community 9.0.1 (rc
> >> 1).app/Contents/Tools/Toolset/palettes/revdatagridlibrary/
> >> behaviorsdatagridbuttonbehavior.livecodescript"
>  573,188,1,_Initialize
> 
>  I'll poke around later.
> 
>  Bob S
> 
> 
> > On Jul 23, 2018, at 22:12 , Brian Milby via use-livecode <
> >> use-livecode@lists.runrev.com> wrote:
> >
> > local sResourceStack
> > private function _ResourceStack
> > local theStack, theCharNo
> >
> > if sResourceStack is empty then
> > put the behavior of me into theStack
> >
> > repeat
> > if trueWord -1 of theStack is "revDataGridLibrary" or theStack is
> > empty then
> > exit repeat
> > else
> > put the behavior of theStack into theStack
> > end if
> > end repeat
> >
> > if theStack is not empty then
> > put offset(" of stack", theStack) into theCharNo
> > delete char 1 to (theCharNo + 3) of theStack
> > end if
> > put theStack into sResourceStack
> > end if
> >
> > return sResourceStack
> > end _ResourceStack
> 
> 
>  ___
>  use-livecode mailing list
>  use-livecode@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@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.run

Re: Datagrids and Nested Behaviors

2018-07-25 Thread Bob Sneidar via use-livecode
Thanks Brian. There IS no better development community in the world than this 
one. This all began with Hypercard communities and their spirit of sharing and 
mutual support. We seem to be the last bastion. 

Bob S


> On Jul 24, 2018, at 16:31 , Brian Milby via use-livecode 
>  wrote:
> 
> PR submitted on Bug 21427.
> https://github.com/livecode/livecode-ide/pull/1987
> 
> Since it is a full PR, I went ahead and switched over to using a script
> local everywhere and initialize it when the DG is initialized.  I also
> looked for an object in the DG resource stack instead of hard coding the
> stack name.  I'm thinking about posting a stack that can make the temporary
> modifications necessary to allow this functionality while waiting on the
> code to make it to production.  The temp mods will be much closer to what
> was posted in this thread.
> 
> On Tue, Jul 24, 2018 at 10:03 AM, Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Never mind Brian, it works. I had the behavior of the custom button set
>> the the behavior STACK and NOT the reDataGridLibrary stack button (now
>> empty).
>> 
>> Once I got the behavior of the custom button set to the old behavior
>> button, the datagrid now works! You guys are freaking geniuses!
>> 
>> Bob S
>> 
>> 
>>> On Jul 24, 2018, at 07:57 , Brian Milby via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>> 
>>> I’ll put something together tonight. The code in the library has to be
>> updated before opening a card with a DG that has the adjusted behavior
>> chain. I have an idea on how to do it in script, but need to test it out to
>> verify it will work.
>>> On Jul 24, 2018, 9:54 AM -0500, Bob Sneidar via use-livecode <
>> use-livecode@lists.runrev.com>, wrote:
 I did so. I get this when opening my test stack:
 
 91,260,123
 62,260,123
 77,260,123
 456,260,57
 534,260,123
 253,260,123
 241,236,1,_Initialize
 353,0,0,stack "/Applications/LiveCode Community 9.0.1 (rc
>> 1).app/Contents/Tools/Toolset/palettes/revdatagridlibrary/
>> behaviorsdatagridbuttonbehavior.livecodescript"
 573,188,1,_Initialize
 
 I'll poke around later.
 
 Bob S
 
 
> On Jul 23, 2018, at 22:12 , Brian Milby via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
> 
> local sResourceStack
> private function _ResourceStack
> local theStack, theCharNo
> 
> if sResourceStack is empty then
> put the behavior of me into theStack
> 
> repeat
> if trueWord -1 of theStack is "revDataGridLibrary" or theStack is
> empty then
> exit repeat
> else
> put the behavior of theStack into theStack
> end if
> end repeat
> 
> if theStack is not empty then
> put offset(" of stack", theStack) into theCharNo
> delete char 1 to (theCharNo + 3) of theStack
> end if
> put theStack into sResourceStack
> end if
> 
> return sResourceStack
> end _ResourceStack
 
 
 ___
 use-livecode mailing list
 use-livecode@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Datagrids and Nested Behaviors

2018-07-24 Thread Brian Milby via use-livecode
Posted a demo stack showing a DG with a behavior button in front of the DG
library behavior.
https://github.com/bwmilby/lc-misc/tree/master/NestedDGBehavior

There is an image of the stack uploaded as well.  The preOpenStack handler
will update the script (LC9) which will then be available until LC restarts.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-24 Thread Brian Milby via use-livecode
PR submitted on Bug 21427.
https://github.com/livecode/livecode-ide/pull/1987

Since it is a full PR, I went ahead and switched over to using a script
local everywhere and initialize it when the DG is initialized.  I also
looked for an object in the DG resource stack instead of hard coding the
stack name.  I'm thinking about posting a stack that can make the temporary
modifications necessary to allow this functionality while waiting on the
code to make it to production.  The temp mods will be much closer to what
was posted in this thread.

On Tue, Jul 24, 2018 at 10:03 AM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Never mind Brian, it works. I had the behavior of the custom button set
> the the behavior STACK and NOT the reDataGridLibrary stack button (now
> empty).
>
> Once I got the behavior of the custom button set to the old behavior
> button, the datagrid now works! You guys are freaking geniuses!
>
> Bob S
>
>
> > On Jul 24, 2018, at 07:57 , Brian Milby via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > I’ll put something together tonight. The code in the library has to be
> updated before opening a card with a DG that has the adjusted behavior
> chain. I have an idea on how to do it in script, but need to test it out to
> verify it will work.
> > On Jul 24, 2018, 9:54 AM -0500, Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
> >> I did so. I get this when opening my test stack:
> >>
> >> 91,260,123
> >> 62,260,123
> >> 77,260,123
> >> 456,260,57
> >> 534,260,123
> >> 253,260,123
> >> 241,236,1,_Initialize
> >> 353,0,0,stack "/Applications/LiveCode Community 9.0.1 (rc
> 1).app/Contents/Tools/Toolset/palettes/revdatagridlibrary/
> behaviorsdatagridbuttonbehavior.livecodescript"
> >> 573,188,1,_Initialize
> >>
> >> I'll poke around later.
> >>
> >> Bob S
> >>
> >>
> >>> On Jul 23, 2018, at 22:12 , Brian Milby via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>>
> >>> local sResourceStack
> >>> private function _ResourceStack
> >>> local theStack, theCharNo
> >>>
> >>> if sResourceStack is empty then
> >>> put the behavior of me into theStack
> >>>
> >>> repeat
> >>> if trueWord -1 of theStack is "revDataGridLibrary" or theStack is
> >>> empty then
> >>> exit repeat
> >>> else
> >>> put the behavior of theStack into theStack
> >>> end if
> >>> end repeat
> >>>
> >>> if theStack is not empty then
> >>> put offset(" of stack", theStack) into theCharNo
> >>> delete char 1 to (theCharNo + 3) of theStack
> >>> end if
> >>> put theStack into sResourceStack
> >>> end if
> >>>
> >>> return sResourceStack
> >>> end _ResourceStack
> >>
> >>
> >> ___
> >> use-livecode mailing list
> >> use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Datagrids and Nested Behaviors

2018-07-24 Thread Bob Sneidar via use-livecode
Never mind Brian, it works. I had the behavior of the custom button set the the 
behavior STACK and NOT the reDataGridLibrary stack button (now empty). 

Once I got the behavior of the custom button set to the old behavior button, 
the datagrid now works! You guys are freaking geniuses! 

Bob S


> On Jul 24, 2018, at 07:57 , Brian Milby via use-livecode 
>  wrote:
> 
> I’ll put something together tonight. The code in the library has to be 
> updated before opening a card with a DG that has the adjusted behavior chain. 
> I have an idea on how to do it in script, but need to test it out to verify 
> it will work.
> On Jul 24, 2018, 9:54 AM -0500, Bob Sneidar via use-livecode 
> , wrote:
>> I did so. I get this when opening my test stack:
>> 
>> 91,260,123
>> 62,260,123
>> 77,260,123
>> 456,260,57
>> 534,260,123
>> 253,260,123
>> 241,236,1,_Initialize
>> 353,0,0,stack "/Applications/LiveCode Community 9.0.1 (rc 
>> 1).app/Contents/Tools/Toolset/palettes/revdatagridlibrary/behaviorsdatagridbuttonbehavior.livecodescript"
>> 573,188,1,_Initialize
>> 
>> I'll poke around later.
>> 
>> Bob S
>> 
>> 
>>> On Jul 23, 2018, at 22:12 , Brian Milby via use-livecode 
>>>  wrote:
>>> 
>>> local sResourceStack
>>> private function _ResourceStack
>>> local theStack, theCharNo
>>> 
>>> if sResourceStack is empty then
>>> put the behavior of me into theStack
>>> 
>>> repeat
>>> if trueWord -1 of theStack is "revDataGridLibrary" or theStack is
>>> empty then
>>> exit repeat
>>> else
>>> put the behavior of theStack into theStack
>>> end if
>>> end repeat
>>> 
>>> if theStack is not empty then
>>> put offset(" of stack", theStack) into theCharNo
>>> delete char 1 to (theCharNo + 3) of theStack
>>> end if
>>> put theStack into sResourceStack
>>> end if
>>> 
>>> return sResourceStack
>>> end _ResourceStack
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Datagrids and Nested Behaviors

2018-07-24 Thread Brian Milby via use-livecode
I’ll put something together tonight. The code in the library has to be updated 
before opening a card with a DG that has the adjusted behavior chain. I have an 
idea on how to do it in script, but need to test it out to verify it will work.
On Jul 24, 2018, 9:54 AM -0500, Bob Sneidar via use-livecode 
, wrote:
> I did so. I get this when opening my test stack:
>
> 91,260,123
> 62,260,123
> 77,260,123
> 456,260,57
> 534,260,123
> 253,260,123
> 241,236,1,_Initialize
> 353,0,0,stack "/Applications/LiveCode Community 9.0.1 (rc 
> 1).app/Contents/Tools/Toolset/palettes/revdatagridlibrary/behaviorsdatagridbuttonbehavior.livecodescript"
> 573,188,1,_Initialize
>
> I'll poke around later.
>
> Bob S
>
>
> > On Jul 23, 2018, at 22:12 , Brian Milby via use-livecode 
> >  wrote:
> >
> > local sResourceStack
> > private function _ResourceStack
> > local theStack, theCharNo
> >
> > if sResourceStack is empty then
> > put the behavior of me into theStack
> >
> > repeat
> > if trueWord -1 of theStack is "revDataGridLibrary" or theStack is
> > empty then
> > exit repeat
> > else
> > put the behavior of theStack into theStack
> > end if
> > end repeat
> >
> > if theStack is not empty then
> > put offset(" of stack", theStack) into theCharNo
> > delete char 1 to (theCharNo + 3) of theStack
> > end if
> > put theStack into sResourceStack
> > end if
> >
> > return sResourceStack
> > end _ResourceStack
>
>
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Datagrids and Nested Behaviors

2018-07-24 Thread Bob Sneidar via use-livecode
I did so. I get this when opening my test stack:

91,260,123
62,260,123
77,260,123
456,260,57
534,260,123
253,260,123
241,236,1,_Initialize
353,0,0,stack "/Applications/LiveCode Community 9.0.1 (rc 
1).app/Contents/Tools/Toolset/palettes/revdatagridlibrary/behaviorsdatagridbuttonbehavior.livecodescript"
573,188,1,_Initialize

I'll poke around later. 

Bob S


> On Jul 23, 2018, at 22:12 , Brian Milby via use-livecode 
>  wrote:
> 
> local sResourceStack
> private function _ResourceStack
>   local theStack, theCharNo
> 
>   if sResourceStack is empty then
>  put the behavior of me into theStack
> 
>  repeat
> if trueWord -1 of theStack is "revDataGridLibrary" or theStack is
> empty then
>exit repeat
> else
>put the behavior of theStack into theStack
> end if
>  end repeat
> 
>  if theStack is not empty then
> put offset(" of stack", theStack) into theCharNo
> delete char 1 to (theCharNo + 3) of theStack
>  end if
>  put theStack into sResourceStack
>   end if
> 
>   return sResourceStack
> end _ResourceStack


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-24 Thread BNig via use-livecode
Brian
That is a nice modification, makes it faster and is still only in one place.


>I also noticed that there are extra "stack" references in the code (stack
>_ResourceStack instead of just _ResourceStack 4/10 uses).

to my surprise both versions work.

Kind regards
Bernd


Brian Milby via use-livecode wrote
> Here is my slight modification to the suggestion:
> 
> local sResourceStack
> private function _ResourceStack
>local theStack, theCharNo
> 
>if sResourceStack is empty then
>   put the behavior of me into theStack
> 
>   repeat
>  if trueWord -1 of theStack is "revDataGridLibrary" or theStack is
> empty then
> exit repeat
>  else
> put the behavior of theStack into theStack
>  end if
>   end repeat
> 
>   if theStack is not empty then
>  put offset(" of stack", theStack) into theCharNo
>  delete char 1 to (theCharNo + 3) of theStack
>   end if
>   put theStack into sResourceStack
>end if
> 
>return sResourceStack
> end _ResourceStack
> 
> 
> I also noticed that there are extra "stack" references in the code (stack
> _ResourceStack instead of just _ResourceStack 4/10 uses).
> 
> On Mon, Jul 23, 2018 at 6:53 PM, Brian Milby <

> brian@

> > wrote:
> 
>> What OS are you using? It will be inside the IDE, but will get copied
>> into
>> your app as well. You will probably need admin rights to edit. I would do
>> it in an external editor too.
>>
>> It probably would be an enhancement request (therefore 9.1), but I would
>> be happy to submit a PR against a BZ report.
>> On Jul 23, 2018, 6:04 PM -0500, Bob Sneidar via use-livecode <
>> 

> use-livecode@.runrev

>>, wrote:
>>
>> I found and made a copy of the datagrid library stack on my desktop. I
>> still cannot save the modification you proposed to the script of the
>> datagrid button in this stack. It says it can't open stack script file.
>>
>> Well my workaround is functional, so I'm sticking with that. If the devs
>> want to take your patch and bundle it in with the next release that would
>> be great. I have no idea how to make that happen.
>>
>> Bob S
>>
>>
>> On Jul 23, 2018, at 15:46 , Bob Sneidar via use-livecode <
>> 

> use-livecode@.runrev

>> wrote:
>>
>> I tried this, I apparently don't have permission to save the file once
>> edited. It's probably in the Livecode APP bundle. I'll poke around and
>> test
>> this later.
>>
>> Bob S





--
Sent from: 
http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-23 Thread Brian Milby via use-livecode
Here is my slight modification to the suggestion:

local sResourceStack
private function _ResourceStack
   local theStack, theCharNo

   if sResourceStack is empty then
  put the behavior of me into theStack

  repeat
 if trueWord -1 of theStack is "revDataGridLibrary" or theStack is
empty then
exit repeat
 else
put the behavior of theStack into theStack
 end if
  end repeat

  if theStack is not empty then
 put offset(" of stack", theStack) into theCharNo
 delete char 1 to (theCharNo + 3) of theStack
  end if
  put theStack into sResourceStack
   end if

   return sResourceStack
end _ResourceStack


I also noticed that there are extra "stack" references in the code (stack
_ResourceStack instead of just _ResourceStack 4/10 uses).

On Mon, Jul 23, 2018 at 6:53 PM, Brian Milby  wrote:

> What OS are you using? It will be inside the IDE, but will get copied into
> your app as well. You will probably need admin rights to edit. I would do
> it in an external editor too.
>
> It probably would be an enhancement request (therefore 9.1), but I would
> be happy to submit a PR against a BZ report.
> On Jul 23, 2018, 6:04 PM -0500, Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
>
> I found and made a copy of the datagrid library stack on my desktop. I
> still cannot save the modification you proposed to the script of the
> datagrid button in this stack. It says it can't open stack script file.
>
> Well my workaround is functional, so I'm sticking with that. If the devs
> want to take your patch and bundle it in with the next release that would
> be great. I have no idea how to make that happen.
>
> Bob S
>
>
> On Jul 23, 2018, at 15:46 , Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> I tried this, I apparently don't have permission to save the file once
> edited. It's probably in the Livecode APP bundle. I'll poke around and test
> this later.
>
> Bob S
>
>
>
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-23 Thread Trevor DeVore via use-livecode
On Mon, Jul 23, 2018 at 4:51 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks for looking into this all. Leave it to me to attempt some edge case
> scenario. I'm curious how Trevor handles this in his levure framework.
> There's no way I can see to move current custom code to a stack only script
> for datagrids.
>

Well, I don't use Data Grids very often anymore so it isn't a problem. I
have a DataView control similar to a Data Grid Form. The way it is designed
you can assign a custom script to the behavior of the DataView group and
then assign the original DataView group behavior as the behavior of the
custom behavior. Using the new "with behavior" syntax the first line of my
custom behavior script only stack looks like this:

```
script "Article Editor Dataview Behavior" with behavior "DataView Group
Behavior"
...
```

-- 
Trevor DeVore
ScreenSteps
www.screensteps.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-23 Thread Brian Milby via use-livecode
What OS are you using? It will be inside the IDE, but will get copied into your 
app as well. You will probably need admin rights to edit. I would do it in an 
external editor too.

It probably would be an enhancement request (therefore 9.1), but I would be 
happy to submit a PR against a BZ report.
On Jul 23, 2018, 6:04 PM -0500, Bob Sneidar via use-livecode 
, wrote:
> I found and made a copy of the datagrid library stack on my desktop. I still 
> cannot save the modification you proposed to the script of the datagrid 
> button in this stack. It says it can't open stack script file.
>
> Well my workaround is functional, so I'm sticking with that. If the devs want 
> to take your patch and bundle it in with the next release that would be 
> great. I have no idea how to make that happen.
>
> Bob S
>
>
> > On Jul 23, 2018, at 15:46 , Bob Sneidar via use-livecode 
> >  wrote:
> >
> > I tried this, I apparently don't have permission to save the file once 
> > edited. It's probably in the Livecode APP bundle. I'll poke around and test 
> > this later.
> >
> > Bob S
>
>
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-23 Thread Bob Sneidar via use-livecode
I found and made a copy of the datagrid library stack on my desktop. I still 
cannot save the modification you proposed to the script of the datagrid button 
in this stack. It says it can't open stack script file. 

Well my workaround is functional, so I'm sticking with that. If the devs want 
to take your patch and bundle it in with the next release that would be great. 
I have no idea how to make that happen. 

Bob S


> On Jul 23, 2018, at 15:46 , Bob Sneidar via use-livecode 
>  wrote:
> 
> I tried this, I apparently don't have permission to save the file once 
> edited. It's probably in the Livecode APP bundle. I'll poke around and test 
> this later. 
> 
> Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-23 Thread Bob Sneidar via use-livecode
I tried this, I apparently don't have permission to save the file once edited. 
It's probably in the Livecode APP bundle. I'll poke around and test this later. 

Bob S


> On Jul 23, 2018, at 15:22 , Niggemann, Bernd via use-livecode 
>  wrote:
> 
> my solution would be to change private function _ResourceStack of stack 
> RevDataGridLibraryBehaviorsDataGridButtonBehavior to
> 
> private function _ResourceStack
>  local theStack, theCharNo
>  put the behavior of me into theStack
> 
>  repeat
> if trueWord - 1 of theStack is "revDataGridLibrary" or theStack is empty 
> then
>exit repeat
> else
>put the behavior of theStack into theStack
> end if
>  end repeat
> 
>  if theStack is not empty then
> put offset(" of stack", theStack) into theCharNo
> delete char 1 to (theCharNo + 3) of theStack
>  end if
> 
>  return theStack
> end _ResourceStack


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-23 Thread Niggemann, Bernd via use-livecode
my solution would be to change private function _ResourceStack of stack 
RevDataGridLibraryBehaviorsDataGridButtonBehavior to

private function _ResourceStack
  local theStack, theCharNo
  put the behavior of me into theStack

  repeat
 if trueWord - 1 of theStack is "revDataGridLibrary" or theStack is empty 
then
exit repeat
 else
put the behavior of theStack into theStack
 end if
  end repeat

  if theStack is not empty then
 put offset(" of stack", theStack) into theCharNo
 delete char 1 to (theCharNo + 3) of theStack
  end if

  return theStack
end _ResourceStack


as far as speed is concerned it is probably slower than Brian's suggestion but 
one has only to change one handler. Then again it is only during initialization 
of the dataGrid

That way one could use Bob's setup

modified behavior button
|
|
existing behavior 1
|
|
existing behavior 2

and set the behavior of group "dataGrid x" to the long id of button "modified 
behavior button"

And all other instances of the dataGrid would use their default behaviors.

Kind regards

Bernd



> Am 23.07.2018 um 23:01 schrieb Brian Milby :
> 
> So that is something that could be fixed pretty easily. I’m thinking a script 
> local to store the value which will offset the additional work to figure it 
> out the first time.
> 
> Logic would be to check for some key object and if not found then move up the 
> behavior chain a level and look. Could either decide that only one could be 
> there or just keep going until there are no more. There is no error checking 
> now, so it could fail in the same manner.
> 
> A side effect would be that the call would be faster for every other use 
> since it would only be checking that the script local wasn’t empty and 
> returning the value.
> 
> Another option would be to just initialize the variable in _Initialize and 
> use it for the 10 places the function is currently used. That would be even 
> faster since it would eliminate the function call completely.
> 
> Thanks,
> Brian
> On Jul 23, 2018, 1:24 PM -0500, Niggemann, Bernd via use-livecode 
> , wrote:
>> The problem Bob Sneidar ran into by changing the order of the behaviors of a 
>> dataGrid is due to the initialization process of the dataGrid at start-up.
>> 
>> The behavior looks for a resourceStack by means of this handler.
>> 
>> private function _ResourceStack
>> local theStack, theCharNo
>> put the behavior of me into theStack
>> if theStack is not empty then
>> put offset(" of stack", theStack) into theCharNo <-- looks only at first 
>> behavior which is in Bob's case the wrong stack
>> delete char 1 to (theCharNo + 3) of theStack
>> end if
>> 
>> return theStack
>> end _ResourceStack
>> 
>> 
>> In Bob's case the function returns the stack the button his newly assembled 
>> behavior is placed on instead of stack "revdatagridlibrary.rev".
>> Then the initialization trys to set again behaviors of specific elements of 
>> the datagrid to scripts of the "correct" _ResourceStack.
>> 
>> This fails obviously and is the reason for Bob's approach to fail.
>> 
>> Further details of this on request, I don't want to bother the list with 
>> them.
>> 
>> Kind regards
>> 
>> Bernd
>> 
>> 
>> 
>> 
>> 
>> 
>> Richard Gaskin wrote:
>> 
>> The more I've explored this the more subclassing by inserting a custom 
>> behavior in between a custom control and its original behavior should work. 
>> It's curious that it doesn't here.
>> 
>> What exactly were the errors you encountered?
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Datagrids and Nested Behaviors

2018-07-23 Thread Bob Sneidar via use-livecode
Thanks for looking into this all. Leave it to me to attempt some edge case 
scenario. I'm curious how Trevor handles this in his levure framework. There's 
no way I can see to move current custom code to a stack only script for 
datagrids. 

Bob S


> On Jul 23, 2018, at 14:01 , Brian Milby via use-livecode 
>  wrote:
> 
> So that is something that could be fixed pretty easily. I’m thinking a script 
> local to store the value which will offset the additional work to figure it 
> out the first time.
> 
> Logic would be to check for some key object and if not found then move up the 
> behavior chain a level and look. Could either decide that only one could be 
> there or just keep going until there are no more. There is no error checking 
> now, so it could fail in the same manner.
> 
> A side effect would be that the call would be faster for every other use 
> since it would only be checking that the script local wasn’t empty and 
> returning the value.
> 
> Another option would be to just initialize the variable in _Initialize and 
> use it for the 10 places the function is currently used. That would be even 
> faster since it would eliminate the function call completely.
> 
> Thanks,
> Brian
> On Jul 23, 2018, 1:24 PM -0500, Niggemann, Bernd via use-livecode 
> , wrote:
>> The problem Bob Sneidar ran into by changing the order of the behaviors of a 
>> dataGrid is due to the initialization process of the dataGrid at start-up.
>> 
>> The behavior looks for a resourceStack by means of this handler.
>> 
>> private function _ResourceStack
>> local theStack, theCharNo
>> put the behavior of me into theStack
>> if theStack is not empty then
>> put offset(" of stack", theStack) into theCharNo <-- looks only at first 
>> behavior which is in Bob's case the wrong stack
>> delete char 1 to (theCharNo + 3) of theStack
>> end if
>> 
>> return theStack
>> end _ResourceStack
>> 
>> 
>> In Bob's case the function returns the stack the button his newly assembled 
>> behavior is placed on instead of stack "revdatagridlibrary.rev".
>> Then the initialization trys to set again behaviors of specific elements of 
>> the datagrid to scripts of the "correct" _ResourceStack.
>> 
>> This fails obviously and is the reason for Bob's approach to fail.
>> 
>> Further details of this on request, I don't want to bother the list with 
>> them.
>> 
>> Kind regards
>> 
>> Bernd
>> 
>> 
>> 
>> 
>> 
>> 
>> Richard Gaskin wrote:
>> 
>> The more I've explored this the more subclassing by inserting a custom 
>> behavior in between a custom control and its original behavior should work. 
>> It's curious that it doesn't here.
>> 
>> What exactly were the errors you encountered?
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Datagrids and Nested Behaviors

2018-07-23 Thread Brian Milby via use-livecode
So that is something that could be fixed pretty easily. I’m thinking a script 
local to store the value which will offset the additional work to figure it out 
the first time.

Logic would be to check for some key object and if not found then move up the 
behavior chain a level and look. Could either decide that only one could be 
there or just keep going until there are no more. There is no error checking 
now, so it could fail in the same manner.

A side effect would be that the call would be faster for every other use since 
it would only be checking that the script local wasn’t empty and returning the 
value.

Another option would be to just initialize the variable in _Initialize and use 
it for the 10 places the function is currently used. That would be even faster 
since it would eliminate the function call completely.

Thanks,
Brian
On Jul 23, 2018, 1:24 PM -0500, Niggemann, Bernd via use-livecode 
, wrote:
> The problem Bob Sneidar ran into by changing the order of the behaviors of a 
> dataGrid is due to the initialization process of the dataGrid at start-up.
>
> The behavior looks for a resourceStack by means of this handler.
>
> private function _ResourceStack
> local theStack, theCharNo
> put the behavior of me into theStack
> if theStack is not empty then
> put offset(" of stack", theStack) into theCharNo <-- looks only at first 
> behavior which is in Bob's case the wrong stack
> delete char 1 to (theCharNo + 3) of theStack
> end if
>
> return theStack
> end _ResourceStack
>
>
> In Bob's case the function returns the stack the button his newly assembled 
> behavior is placed on instead of stack "revdatagridlibrary.rev".
> Then the initialization trys to set again behaviors of specific elements of 
> the datagrid to scripts of the "correct" _ResourceStack.
>
> This fails obviously and is the reason for Bob's approach to fail.
>
> Further details of this on request, I don't want to bother the list with them.
>
> Kind regards
>
> Bernd
>
>
>
>
>
>
> Richard Gaskin wrote:
>
> The more I've explored this the more subclassing by inserting a custom 
> behavior in between a custom control and its original behavior should work. 
> It's curious that it doesn't here.
>
> What exactly were the errors you encountered?
>
>
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Datagrids and Nested Behaviors

2018-07-23 Thread Niggemann, Bernd via use-livecode
The problem Bob Sneidar ran into by changing the order of the behaviors of a 
dataGrid is due to the initialization process of the dataGrid at start-up.

The behavior looks for a resourceStack by means of this handler.

private function _ResourceStack
   local theStack, theCharNo
   put the behavior of me into theStack
   if theStack is not empty then
  put offset(" of stack", theStack) into theCharNo  <-- looks only at first 
behavior which is in Bob's case the wrong stack
  delete char 1 to (theCharNo + 3) of theStack
   end if

   return theStack
end _ResourceStack


In Bob's case the function returns the stack the button his newly assembled 
behavior is placed on instead of stack "revdatagridlibrary.rev".
Then the initialization trys to set again behaviors of specific elements of the 
datagrid to scripts of the "correct" _ResourceStack.

This fails obviously and is the reason for Bob's approach to fail.

Further details of this on request, I don't want to bother the list with them.

Kind regards

Bernd






Richard Gaskin wrote:

The more I've explored this the more subclassing by inserting a custom behavior 
in between a custom control and its original behavior should work. It's curious 
that it doesn't here.

What exactly were the errors you encountered?


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-23 Thread Bob Sneidar via use-livecode
The Datagrid no longer behaves as such. SelectionChanged never gets triggered. 
Data doesn't populate. In short, none of the custom props messages seem to 
arrive at the datagrid library. 

Bob S


> On Jul 23, 2018, at 08:29 , Richard Gaskin via use-livecode 
>  wrote:
> 
> Was your request submitted through Support or the bug DB?  If the latter, do 
> you have the bug report ID?
> 
> The more I've explored this the more subclassing by inserting a custom 
> behavior in between a custom control and its original behavior should work.  
> It's curious that it doesn't here.
> 
> What exactly were the errors you encountered?
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-23 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:

> With a clearer head I have discovered that indeed setting the behavior
> in the way prescribed sets it GLOBALLY for ALL grids! That will not do
> for my purposes, because the grids in my substacks operate a bit
> differently than the one in the mainstack.
>
> Well my workaround before was to put the special handlers for those
> grids in the respective card or stack scripts. It looks like I will
> have to go back to that. Curious though that setting the behavior of
> a datagrid to a custom button, then setting the behavior of the button
> to the old datagrid behavior button fails. I think that is the real
> bug, and I have submitted a request to look at that. Othewise we have
> to say that nested behaviors are not presently fully supported with
> datagrids.

Was your request submitted through Support or the bug DB?  If the 
latter, do you have the bug report ID?


The more I've explored this the more subclassing by inserting a custom 
behavior in between a custom control and its original behavior should 
work.  It's curious that it doesn't here.


What exactly were the errors you encountered?

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-23 Thread Bob Sneidar via use-livecode
Hi all. 

With a clearer head I have discovered that indeed setting the behavior in the 
way prescribed sets it GLOBALLY for ALL grids! That will not do for my 
purposes, because the grids in my substacks operate a bit differently than the 
one in the mainstack. 

Well my workaround before was to put the special handlers for those grids in 
the respective card or stack scripts. It looks like I will have to go back to 
that. Curious though that setting the behavior of a datagrid to a custom 
button, then setting the behavior of the button to the old datagrid behavior 
button fails. I think that is the real bug, and I have submitted a request to 
look at that. Othewise we have to say that nested behaviors are not presently 
fully supported with datagrids. 

Bob S


> On Jul 20, 2018, at 21:26 , Brian Milby via use-livecode 
>  wrote:
> 
> @Richard,
> That is precisely what I saw when I did my test.  (And DG3 was in a
> different stack.)
> I tried manually replacing the old button with one in the stack and that
> completely broke the DG.
> 
> @Bob
> Another option to get script in front of the library would be to set the
> script of:
> button id 1005 of stack "revDataGridLibrary"
> That still wouldn't save with the stack though.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-21 Thread Niggemann, Bernd via use-livecode
Bob,

I also found that changing the behavior of group "dataGrid x" does not stick 
and after restart you have to set it again.

However if you want to use the convenience of a behavior you could set in your 
case as far as user interaction via doubleMouseUp is concerned you could set 
the behavior of group "dgListMask" of group "dataGrid x" to the button of your 
mouseDoubleUp handler. That will save the behavior with the specific group 
"dataGrid x" and you would only have to assign this  once to that group. If you 
want to go that route be careful to choose a control inside a specific dataGrid 
that has not already a behavior assigned.
e.g. group "dgList" of group "dataGrid x" already has a behavior assigned. In 
my testing this works for mouseDoubleUp

---
on mouseDoubleUp
   put the long name of the target into tTarget
   if tTarget begins with "field" then put the text of tTarget & cr & tTarget
   else put tTarget -- does not trigger
   pass mouseDoubleUp
end mouseDoubleUp
--- 

Maybe that is an easier way to solve the global scope problem you get when 
modifiying the behaviors of the group "dataGrid x" and also of "stickiness"

Kind regards
Bernd
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Brian Milby via use-livecode
@Richard,
That is precisely what I saw when I did my test.  (And DG3 was in a
different stack.)
I tried manually replacing the old button with one in the stack and that
completely broke the DG.

@Bob
Another option to get script in front of the library would be to set the
script of:
button id 1005 of stack "revDataGridLibrary"
That still wouldn't save with the stack though.



On Fri, Jul 20, 2018 at 10:12 PM, Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Bob Sneidar wrote:
>
> > This is NOT the current normal behavior.
> >
> >> On Jul 20, 2018, at 17:13 , Richard Gaskin wrote:
> >>
> >> This is a normal setup:
> >>
> >> [ DataGrid ]
> >>   |
> >>   V
> >> [ Standard DG Behavior ]
> >
> >
> > THIS is:
> >
> >> [ DataGrid ]
> >>   |
> >>   V
> >> [ Old behavior button (now empty) ]
> >>   |
> >>   V
> >> [ new behavior script only stack (now with the old script) ]
>
> Thank you, Bob. Sad to see another confusing legacy element creep into a
> system designed for ease of use, but understandable under the circumstances.
>
> With that mystery solved, I'm still at a loss to understand how attaching
> a behavior further out in the message path doesn't affect everything
> attached to the behavior before it.
>
> Given this setup with multiple data grids, in which we want custom
> behavior for DG 1 and DG 2:
>
>  [ DG 1 ][ DG 2 ][ DG 3 ]
>  \   | /
>   V  VV
>  [ Old behavior button (now empty) ]
>  |
>  V
> [ new behavior script only stack (now with the old script) ]
>  |
>  V
>   [ Custom Behavior Script ]
>
>
> ...how can the Custom Behavior Script affect only DG 1 and DG 2 but not DG
> 3?
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:

> This is NOT the current normal behavior.
>
>> On Jul 20, 2018, at 17:13 , Richard Gaskin wrote:
>>
>> This is a normal setup:
>>
>> [ DataGrid ]
>>   |
>>   V
>> [ Standard DG Behavior ]
>
>
> THIS is:
>
>> [ DataGrid ]
>>   |
>>   V
>> [ Old behavior button (now empty) ]
>>   |
>>   V
>> [ new behavior script only stack (now with the old script) ]

Thank you, Bob. Sad to see another confusing legacy element creep into a 
system designed for ease of use, but understandable under the circumstances.


With that mystery solved, I'm still at a loss to understand how 
attaching a behavior further out in the message path doesn't affect 
everything attached to the behavior before it.


Given this setup with multiple data grids, in which we want custom 
behavior for DG 1 and DG 2:


 [ DG 1 ][ DG 2 ][ DG 3 ]
 \   | /
  V  VV
 [ Old behavior button (now empty) ]
 |
 V
[ new behavior script only stack (now with the old script) ]
 |
 V
  [ Custom Behavior Script ]


...how can the Custom Behavior Script affect only DG 1 and DG 2 but not 
DG 3?


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Brian Milby via use-livecode
It is not a bug.  You can't save a behavior on a script only stack, they
much be added after they loaded.  There is a new syntax to make it
automatic, but that wouldn't help here.

In the IDE, enable "Show IDE stacks in lists", open the Project Browser.
Find revdatagridlibrarybehaviorsdatagridbuttonbehavior and notice the extra
number beside it
Open the PI for the stack and go to the advanced tab.
I'm guessing you will see the long ID of the button there.
(Or you could click on the number in the oval and see your script)

On Fri, Jul 20, 2018 at 9:15 PM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

>  belay all that. Apparently I have to get the behavior of the
> behavior of the ehavior of the datagrid. THAT seems to correctly return the
> id of the custom button. But the datagrids do not seem to work after a
> close and reopen of the stack, unless I use this workaround. So there is
> still something wrong with the nested behavior of a datagrid.
>
> Bob S
>
>
> > On Jul 20, 2018, at 19:05 , Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Okay my workaround is to have a custom property with the name of all the
> datagrids on a card in a custom property. Then in the openStack handler of
> the card I have:
> >
> > setMainCardBehaviors
> >
> > In the same script I have:
> >
> > on setMainCardBehaviors
> >   put the long id of me into tParentCard
> >   put the gridnames of this card into tGridList
> >
> >   repeat for each item tGridName in tGridList
> >  if not there is a group tGridName of tParentCard then next repeat
> >  put the long id of group tGridName of tParentCard into tGridID
> >  set the behavior of the behavior of the behavior of tGridID \
> >to the long id of button "maingrids" of card "Behaviors" of
> this stack
> >   end repeat
> > end setMainCardBehaviors
> >
> > Essentially I have to set the custom behavior of every grid on a card
> the first time I open it. I think this is a bug, but it may be the intended
> behavior. Only the LC overseers can answer that.
> >
> > Bob S
> >
> >
> >> On Jul 20, 2018, at 18:41 , Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>
> >> OKAY HUGE BUG ALERT!!!
> >>
> >> It seems that even though I save the stack after setting this behavior,
> Livecode RESETS THE DATAGRID BEHAVIOR TO THE DEFAULT!
> >>
> >> What the EFF? Of course I can get around it with a custom openCard
> handler that resets them, (and in the words of Malthesar when discovering
> that the Historical Records they have based their entire civilization on
> were all lies), but WHY?
> >>
> >> Bob S
> >>
> >>
> >> ___
> >> use-livecode mailing list
> >> use-livecode@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Bob Sneidar via use-livecode
 belay all that. Apparently I have to get the behavior of the behavior of 
the ehavior of the datagrid. THAT seems to correctly return the id of the 
custom button. But the datagrids do not seem to work after a close and reopen 
of the stack, unless I use this workaround. So there is still something wrong 
with the nested behavior of a datagrid. 

Bob S


> On Jul 20, 2018, at 19:05 , Bob Sneidar via use-livecode 
>  wrote:
> 
> Okay my workaround is to have a custom property with the name of all the 
> datagrids on a card in a custom property. Then in the openStack handler of 
> the card I have:
> 
> setMainCardBehaviors
> 
> In the same script I have:
> 
> on setMainCardBehaviors
>   put the long id of me into tParentCard
>   put the gridnames of this card into tGridList
> 
>   repeat for each item tGridName in tGridList
>  if not there is a group tGridName of tParentCard then next repeat
>  put the long id of group tGridName of tParentCard into tGridID
>  set the behavior of the behavior of the behavior of tGridID \
>to the long id of button "maingrids" of card "Behaviors" of this 
> stack
>   end repeat
> end setMainCardBehaviors
> 
> Essentially I have to set the custom behavior of every grid on a card the 
> first time I open it. I think this is a bug, but it may be the intended 
> behavior. Only the LC overseers can answer that. 
> 
> Bob S
> 
> 
>> On Jul 20, 2018, at 18:41 , Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> OKAY HUGE BUG ALERT!!! 
>> 
>> It seems that even though I save the stack after setting this behavior, 
>> Livecode RESETS THE DATAGRID BEHAVIOR TO THE DEFAULT!
>> 
>> What the EFF? Of course I can get around it with a custom openCard handler 
>> that resets them, (and in the words of Malthesar when discovering that the 
>> Historical Records they have based their entire civilization on were all 
>> lies), but WHY?
>> 
>> Bob S
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Bob Sneidar via use-livecode
Okay my workaround is to have a custom property with the name of all the 
datagrids on a card in a custom property. Then in the openStack handler of the 
card I have:

setMainCardBehaviors

In the same script I have:

on setMainCardBehaviors
   put the long id of me into tParentCard
   put the gridnames of this card into tGridList
   
   repeat for each item tGridName in tGridList
  if not there is a group tGridName of tParentCard then next repeat
  put the long id of group tGridName of tParentCard into tGridID
  set the behavior of the behavior of the behavior of tGridID \
to the long id of button "maingrids" of card "Behaviors" of this 
stack
   end repeat
end setMainCardBehaviors

Essentially I have to set the custom behavior of every grid on a card the first 
time I open it. I think this is a bug, but it may be the intended behavior. 
Only the LC overseers can answer that. 

Bob S


> On Jul 20, 2018, at 18:41 , Bob Sneidar via use-livecode 
>  wrote:
> 
> OKAY HUGE BUG ALERT!!! 
> 
> It seems that even though I save the stack after setting this behavior, 
> Livecode RESETS THE DATAGRID BEHAVIOR TO THE DEFAULT!
> 
> What the EFF? Of course I can get around it with a custom openCard handler 
> that resets them, (and in the words of Malthesar when discovering that the 
> Historical Records they have based their entire civilization on were all 
> lies), but WHY?
> 
> Bob S
> 
> 
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Bob Sneidar via use-livecode
I should have said, after closing the stack, and quitting/relaunching Livecode.

Bob S


> On Jul 20, 2018, at 18:41 , Bob Sneidar via use-livecode 
>  wrote:
> 
> It seems that even though I save the stack after setting this behavior, 
> Livecode RESETS THE DATAGRID BEHAVIOR TO THE DEFAULT!


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Bob Sneidar via use-livecode
OKAY HUGE BUG ALERT!!! 

It seems that even though I save the stack after setting this behavior, 
Livecode RESETS THE DATAGRID BEHAVIOR TO THE DEFAULT!

What the EFF? Of course I can get around it with a custom openCard handler that 
resets them, (and in the words of Malthesar when discovering that the 
Historical Records they have based their entire civilization on were all lies), 
but WHY?

Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Bob Sneidar via use-livecode
This is NOT the current normal behavior. 

> On Jul 20, 2018, at 17:13 , Richard Gaskin via use-livecode 
>  wrote:
> 
> This is a normal setup:
> 
> [ DataGrid ]
>   |
>   V
> [ Standard DG Behavior ]


THIS is:

> [ DataGrid ]
>   |
>   V
> [ Old behavior button (now empty) ]
>   |
>   V
> [ new behavior script only stack (now with the old script) ]


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Bob Sneidar via use-livecode
The first "behavior" is a reference to the script of the button to be inserted. 
The other two are because LC moved the datagrid behavior to a script only file, 
but left the old button (now empty) in the message path. I was thinking that if 
you inserted a behavior after THAT button but BEFORE the script only stack, 
THAT would be global. 

Bob S


> On Jul 20, 2018, at 17:13 , Richard Gaskin via use-livecode 
>  wrote:
> 
>   set the behavior of the behavior of the behavior of group \
> "datagrid 1" to the long id of button "myButtonName"


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Bob Sneidar via use-livecode
There are three objects including the custom behavior button. 

Bob S


> On Jul 20, 2018, at 17:13 , Richard Gaskin via use-livecode 
>  wrote:
> 
> On further consideration, there's something even odder in my understanding of 
> Bernd's script.  Let me rewrite it with line breaks for clarity:
> 
> command:set the behavior \
> obj3:  of the behavior \
> obj2:  of the behavior \
> obj1:  of group "datagrid 1" \
> value:to the long id of button "myButtonName"
> 
> That's a three-deep nesting where AFAIK there are only two objects.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:

>> On Jul 20, 2018, at 15:31 , Richard Gaskin wrote:
>>
>> IIRC Bernd's suggestion was for global scope only, yes?  That is, it
>> swaps the positions of the two bottom scripts shown below, and
>> affects all DGs running in the session.
>
> Actually no that is why I was saying the syntax was the complete
> opposite of what you'd expect. Bernd's solution actually produces the
> results you see in your diagram. The custom behavior is inserted
> between the datagrid and the default behavior. Odd, huh?

Quite, because here's what I found in Bernd's post:

   set the behavior of the behavior of the behavior of group \
 "datagrid 1" to the long id of button "myButtonName"




This is a normal setup:

 [ DataGrid ]
   |
   V
[ Standard DG Behavior ]


The behavior of grp "DataGrid 1" is the standard LC-supplied DG script.

If we set the behavior of the LC-supplied DG script, we get the opposite 
of my diagram:


 [ DataGrid ]
   |
   V
[ Standard DG Behavior ]
   |
   V
   [ Custom Behavior ]


That would produce an overloading of global scope, since the Standard DG 
behavior drives all DGs, and adding a custom behavior to it would then 
also apply to all DGs.


For reference, here's the diagram I've been using to show the desired 
outcome of limited scope:


  [ DataGrid ]
   |
   V
   [ Custom Behavior ]
   |
   V
[ Standard DG Behavior ]


What am I missing?

Are we talking about the same thing, but I'm writing this where the 
message path flows down and you're missing the arrows and 
conceptualizing this as messages flowing up?


If not that, what is it I'm not seeing?

---

On further consideration, there's something even odder in my 
understanding of Bernd's script.  Let me rewrite it with line breaks for 
clarity:


command:set the behavior \
obj3:  of the behavior \
obj2:  of the behavior \
obj1:  of group "datagrid 1" \
value:to the long id of button "myButtonName"

That's a three-deep nesting where AFAIK there are only two objects.

A group named "DataGrid 1" is obj1 there.

It's original behavior is the LC-supplied "Standard DG Behavior" - 
that's obj2.


What is obj3, the object assigned as the behavior to the "Standard DG 
Behavior"?


Can't decide if I've had too much coffee here or too little. :)

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Brian Milby via use-livecode
I just tried a simple test.  I created a stack, added a DG and a button.  I
used the example at the top of this thread to set the behavior.  I then
added another DG to the card.  Now when I double click on either DG, the
new behavior is used.  Is that what you are seeing and what you are
intending?

I saved the stack and quit / restarted LC.

I reopened the test stack.  Now, the new behavior is not applied.
I created a button to apply the behavior and did so (to make the test
easier to replicate).
Again, both DG's get the behavior.

I then created a new stack and added a DG.  It also responded to the added
behavior.  It seems like the scope of that statement is global to me.

On Fri, Jul 20, 2018 at 6:34 PM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
>
> > On Jul 20, 2018, at 15:31 , Richard Gaskin via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > IIRC Bernd's suggestion was for global scope only, yes?  That is, it
> swaps the positions of the two bottom scripts shown below, and affects all
> DGs running in the session.
>
> Actually no that is why I was saying the syntax was the complete opposite
> of what you'd expect. Bernd's solution actually produces the results you
> see in your diagram. The custom behavior is inserted between the datagrid
> and the default behavior. Odd, huh? But I've spent the better part of the
> afternoon updating each datagrid in my main form to use a one custom
> behavior with code common to each, while still preserving the default
> datagrid behavior. And, until I do that for each datagrid, it's own
> handlers are still in effect. I tested that by putting a breakpoint at the
> beginning of each selectionChanged handler, the behavior and the grid.
> Until I "inserted" the custom behavior, the datagrid verson of
> selectionChanged is what triggered.
>
> > I can't think of another way to do it, but it would be nice to be able
> to overload some DGs while leaving others alone.
>
> See above. :-)
>
> Bob S
>
>
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Bob Sneidar via use-livecode



> On Jul 20, 2018, at 15:31 , Richard Gaskin via use-livecode 
>  wrote:
> 
> IIRC Bernd's suggestion was for global scope only, yes?  That is, it swaps 
> the positions of the two bottom scripts shown below, and affects all DGs 
> running in the session. 

Actually no that is why I was saying the syntax was the complete opposite of 
what you'd expect. Bernd's solution actually produces the results you see in 
your diagram. The custom behavior is inserted between the datagrid and the 
default behavior. Odd, huh? But I've spent the better part of the afternoon 
updating each datagrid in my main form to use a one custom behavior with code 
common to each, while still preserving the default datagrid behavior. And, 
until I do that for each datagrid, it's own handlers are still in effect. I 
tested that by putting a breakpoint at the beginning of each selectionChanged 
handler, the behavior and the grid. Until I "inserted" the custom behavior, the 
datagrid verson of selectionChanged is what triggered. 

> I can't think of another way to do it, but it would be nice to be able to 
> overload some DGs while leaving others alone.

See above. :-)

Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:
> So far as I have been able to ascertain, "me" always refers to the
> original object, and NOT the behavior. As Jacques so helpfully pointed
> out, "this me" refers to the behavior's own script. So "me" might be
> thought of as a synonym for "the target" (insofar as I have been able
> to work it out).

Useful when that's what you want to do, but not something that can help 
for overloading an existing behavior script which expects to able to 
address controls relative to "me".



> I've been working with nested behaviors for a datagrid the better part
> of this day, since discovering how to do it, (thank you Bernd for your
> input on this) and the datagrid default behavior seems to be working
> as advertised, and behaving exactly as your diagram describes.

IIRC Bernd's suggestion was for global scope only, yes?  That is, it 
swaps the positions of the two bottom scripts shown below, and affects 
all DGs running in the session.


I can't think of another way to do it, but it would be nice to be able 
to overload some DGs while leaving others alone.



>> On Jul 20, 2018, at 13:26 , Richard Gaskin wrote:
>>
>> I just realized why the method most useful for controlling scope 
won't actually work.

>>
>> For scoping, we want only some DGs to have custom behavior, so this 
would seem most desirable:

>>
>>  [ DataGrid ]
>>   |
>>   V
>>   [ Custom Behavior ]
>>   |
>>   V
>> [ Standard DG Behavior ]
>>
>>
>> Useful as that it for limiting scope, the problem is that much of the
>> DG code refers to objects within "me", and in this setup "me" refers
>> to the Custom Behavior object rather than the original DG group.  No
>> subgroups, fields, or anything else the DG expects to find are
>> present in the Custom Behavior object, resulting in script errors.
>>
>> So the only way I can see this working at all is to toss scope
>> control out the door and swap the Custom Behavior to be the behavior
>> object for the Standard DG Behavior, as I believe Panos had suggested
>> earlier.

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Bob Sneidar via use-livecode
So far as I have been able to ascertain, "me" always refers to the original 
object, and NOT the behavior. As Jacques so helpfully pointed out, "this me" 
refers to the behavior's own script. So "me" might be thought of as a synonym 
for "the target" (insofar as I have been able to work it out). 

I've been working with nested behaviors for a datagrid the better part of this 
day, since discovering how to do it, (thank you Bernd for your input on this) 
and the datagrid default behavior seems to be working as advertised, and 
behaving exactly as your diagram describes.  

Bob S


> On Jul 20, 2018, at 13:26 , Richard Gaskin via use-livecode 
>  wrote:
> 
> I just realized why the method most useful for controlling scope won't 
> actually work.
> 
> For scoping, we want only some DGs to have custom behavior, so this would 
> seem most desirable:
> 
>  [ DataGrid ]
>   |
>   V
>   [ Custom Behavior ]
>   |
>   V
> [ Standard DG Behavior ]
> 
> 
> Useful as that it for limiting scope, the problem is that much of the DG code 
> refers to objects within "me", and in this setup "me" refers to the Custom 
> Behavior object rather than the original DG group.  No subgroups, fields, or 
> anything else the DG expects to find are present in the Custom Behavior 
> object, resulting in script errors.
> 
> So the only way I can see this working at all is to toss scope control out 
> the door and swap the Custom Behavior to be the behavior object for the 
> Standard DG Behavior, as I believe Panos had suggested earlier.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Mark Wieder via use-livecode

On 07/20/2018 11:43 AM, Bob Sneidar via use-livecode wrote:

I believe I may have mispoken in this thread. Setting the behavior of an object 
does NOT insert the behavior script in FRONT of the object in the message path. 
It inserts it in BACK. I know this because I have a selectionChanged handler in 
both the object and it's behavior, and a breakpoint in each handler. The 
breakpoint is triggered in the object handler, and NOT in the behavior handler, 
as you might expect!


That's the way object-oriented programming works. You set the default 
operation in the behavior script and then you can override it in the 
object if needed. I think of behavior scripts more or less as private 
backscripts of an object.


Otherwise, just follow Brian's suggestion.

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Richard Gaskin via use-livecode
I just realized why the method most useful for controlling scope won't 
actually work.


For scoping, we want only some DGs to have custom behavior, so this 
would seem most desirable:


  [ DataGrid ]
   |
   V
   [ Custom Behavior ]
   |
   V
[ Standard DG Behavior ]


Useful as that it for limiting scope, the problem is that much of the DG 
code refers to objects within "me", and in this setup "me" refers to the 
Custom Behavior object rather than the original DG group.  No subgroups, 
fields, or anything else the DG expects to find are present in the 
Custom Behavior object, resulting in script errors.


So the only way I can see this working at all is to toss scope control 
out the door and swap the Custom Behavior to be the behavior object for 
the Standard DG Behavior, as I believe Panos had suggested earlier.


Brian's suggestion of "before" and "after" handlers may help for some 
aspects of message ordering, but all handlers in the Custom Behavior 
object will affect all DGs once the Custom Behavior object is assigned 
as the behavior for the global Standard DG Behavior.


At the risk of drifting toward OOPness, I wonder if this situation may 
prompt us to consider some more refined method of having nested 
controls, so that we can insert a custom behavior script in between a 
global-scope behavior script and a subset of the controls it's assigned to.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-20 Thread Brian Milby via use-livecode
Check out “before” and “after” in the dictionary (control structure). They 
allow what you are wanting.
On Jul 20, 2018, 1:44 PM -0500, Bob Sneidar via use-livecode 
, wrote:
> I believe I may have mispoken in this thread. Setting the behavior of an 
> object does NOT insert the behavior script in FRONT of the object in the 
> message path. It inserts it in BACK. I know this because I have a 
> selectionChanged handler in both the object and it's behavior, and a 
> breakpoint in each handler. The breakpoint is triggered in the object 
> handler, and NOT in the behavior handler, as you might expect!
>
> The front would have been handier because then you could leave a duplicate 
> handler in both places, and then tested each by simply setting the behavior 
> back and forth. As is, you have to REMOVE the object's handler before you can 
> test the behavior! Oh well.
>
> 
> So this means this syntax makes absolutely no sense whatsoever!
>
> set the behavior of the behavior of the behavior of group "dgSites" to the 
> long id of button "maingrids" of card "behaviors".
>
> What *actually* happens is something like:
>
> set the behavior of the long id of button "maingrids" of card "behaviors" to 
> the behavior of group "dgSites"
> set the behavior of group "dgSites" to the long id of button "maingrids" of 
> card "behaviors"
>
> but the second method won't work. So long as people doing nested behaviors 
> are aware of this syntactical anomaly and the effect it has on the message 
> path, all is well.
> 
>
> Bob S
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Datagrids and Nested Behaviors

2018-07-20 Thread Bob Sneidar via use-livecode
I believe I may have mispoken in this thread. Setting the behavior of an object 
does NOT insert the behavior script in FRONT of the object in the message path. 
It inserts it in BACK. I know this because I have a selectionChanged handler in 
both the object and it's behavior, and a breakpoint in each handler. The 
breakpoint is triggered in the object handler, and NOT in the behavior handler, 
as you might expect! 

The front would have been handier because then you could leave a duplicate 
handler in both places, and then tested each by simply setting the behavior 
back and forth. As is, you have to REMOVE the object's handler before you can 
test the behavior! Oh well. 


So this means this syntax makes absolutely no sense whatsoever!

set the behavior of the behavior of the behavior of group "dgSites" to the long 
id of button "maingrids" of card "behaviors". 

What *actually* happens is something like:

set the behavior of the long id of button "maingrids" of card "behaviors" to 
the behavior of group "dgSites"
set the behavior of group "dgSites" to the long id of button "maingrids" of 
card "behaviors"

but the second method won't work. So long as people doing nested behaviors are 
aware of this syntactical anomaly and the effect it has on the message path, 
all is well. 


Bob S
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-19 Thread Bob Sneidar via use-livecode
Just one more note: I think this syntax would have been preferrable:

insert the script of button "myButton" {in front of | before} group 
"myDatagrid". 

The parser would have to determine what the object was that was already in 
front of the datagrid, if there was any, and "plug in" the new bahavior between 
them. That would mean however that the behaviors for all objects would have to 
be saved with each object, but I suspect it has to do that now. Another 
forseeable advantage is that you could possibly have the ability to insert a 
script BEHIND an object as well, effectively having object based front and back 
scripts. 

Not sure how handy this would be, but the syntax at least would be 
understandable. 

Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-19 Thread Bob Sneidar via use-livecode
I have been thinking about it, and if you accept that when you set a behavior 
it's like inserting the script of the behavior object in front of the target 
(or by your diagram on TOP of the target). So syntactically, it's the complete 
opposite of what *actually* happens, but in terms of the message path, it's 
correct. 

When I attempted to do this the way I suggested, the datagrid "broke" that is 
nothing about the datagrid functioned as such. Clicking a row did not halite 
the row. SelectionChanged was never sent when clicking any populated row. 

By doing it the way Bernd suggested, it worked as expected. I think there was 
some discussion about this when nested behaviors first came out. 

Bob S


> On Jul 19, 2018, at 15:44 , Richard Gaskin via use-livecode 
>  wrote:
> 
> Bob Sneidar wrote:
> > What I did (which actually makes a LOT more sense) is I set the
> > behavior of the button to the behavior of the datagrid, then I set the
> > behavior of the datagrid to the long id of the button. That broke it.
> 
> Your way sounds better to me.
> 
> If I understand correctly, what you're doing is:
> 
> [ DataGrid ]
>  |
>  V
>  [ Custom Behavior ]
>  |
>  V
> [ Standard DB Behavior ]
> 
> That seems best, because it allows you control over the scope of your custom 
> behavior.
> 
> If the last two were swapped then all DGs would inherit whatever's in your 
> custom script.
> 
> Why didn't that work?  Did you pass all relevant messages?
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-19 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:
> What I did (which actually makes a LOT more sense) is I set the
> behavior of the button to the behavior of the datagrid, then I set the
> behavior of the datagrid to the long id of the button. That broke it.

Your way sounds better to me.

If I understand correctly, what you're doing is:

 [ DataGrid ]
  |
  V
  [ Custom Behavior ]
  |
  V
[ Standard DB Behavior ]

That seems best, because it allows you control over the scope of your 
custom behavior.


If the last two were swapped then all DGs would inherit whatever's in 
your custom script.


Why didn't that work?  Did you pass all relevant messages?

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-19 Thread Bob Sneidar via use-livecode
Come to think of it, this IS backwards, but it works. 

The behavior of group datagrid 1 is by default button id 1005 of stack 
"revDataGridLibrary"
the behavior of button id 1005 of stack "revDataGridLibrary" is stack 
"RevDataGridLibraryBehaviorsDataGridButtonBehavior"

so what your statement *should* be doing is setting the behavior of stack 
"RevDataGridLibraryBehaviorsDataGridButtonBehavior" to a button in another 
stack! That is WAAAY convoluted, that it actually inserts the behavior at the 
TOP of the message path. 

What I did (which actually makes a LOT more sense) is I set the behavior of the 
button to the behavior of the datagrid, then I set the behavior of the datagrid 
to the long id of the button. That broke it. 

Bob S


> On Jul 19, 2018, at 13:44 , Bob Sneidar via use-livecode 
>  wrote:
> 
> Bernd, you are a genius. I apparently have the heirarchy of behaviors 
> backwards. I would have thought that this would set the behavior of ALL 
> datagrids to include the button script. That of course would be disasterous. 
> 
> Bob S
> 
> 
>> set the behavior of the behavior of the behavior of group "datagrid 1" to 
>> the long id of button "myButtonName"
>> 
>> 
>> this will put the "new" behavior at the top of the two behaviors of the 
>> datagrid group. Obviously that will not work with editable fields.
>> 
>> Kind regards
>> Bernd


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-19 Thread Bob Sneidar via use-livecode
Bernd, you are a genius. I apparently have the heirarchy of behaviors 
backwards. I would have thought that this would set the behavior of ALL 
datagrids to include the button script. That of course would be disasterous. 

Bob S


> On Jul 19, 2018, at 10:35 , Niggemann, Bernd via use-livecode 
>  wrote:
> 
> Bob,
> 
> if you want to use a a behavior for the datagrids make a button with 
> 
> on mouseDoubleUp
>   put the long name of the target
> end mouseDoubleUp
> 
> and then set the behavior of your datagrids like this
> 
> set the behavior of the behavior of the behavior of group "datagrid 1" to the 
> long id of button "myButtonName"
> 
> 
> this will put the "new" behavior at the top of the two behaviors of the 
> datagrid group. Obviously that will not work with editable fields.
> 
> Kind regards
> Bernd


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-19 Thread Niggemann, Bernd via use-livecode
Bob,

if you want to use a a behavior for the datagrids make a button with 

on mouseDoubleUp
   put the long name of the target
end mouseDoubleUp

and then set the behavior of your datagrids like this

set the behavior of the behavior of the behavior of group "datagrid 1" to the 
long id of button "myButtonName"


this will put the "new" behavior at the top of the two behaviors of the 
datagrid group. Obviously that will not work with editable fields.

Kind regards
Bernd
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-19 Thread Tom Glod via use-livecode
One of the many reasons I love livecode...control references and message
path work so well together ... giving us endless variety of approaches to
any task.  nice job. see ya bob

On Thu, Jul 19, 2018 at 11:09 AM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Correction the target is still the datagrid. I thought for some reason the
> target would be the sender.
>
> Bob S
>
>
> > On Jul 19, 2018, at 08:00 , Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > The only bugaboo will be when I send selectionChanged. The target will
> not be a control of the datagrid, but I can work that out easily enough.
>
>
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-19 Thread Bob Sneidar via use-livecode
Correction the target is still the datagrid. I thought for some reason the 
target would be the sender. 

Bob S


> On Jul 19, 2018, at 08:00 , Bob Sneidar via use-livecode 
>  wrote:
> 
> The only bugaboo will be when I send selectionChanged. The target will not be 
> a control of the datagrid, but I can work that out easily enough. 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-19 Thread Bob Sneidar via use-livecode
Actually Tom, I think I figured out a way around this. I've already put my 
stack scripts for the subModules into behaviors. By adding a selectionChanged 
handler in that behavior and checking to see if the dgControl of the target is 
empty, I can pass selectionChanged for fields and handle it for datagrids. Word 
5 to -1 of the dgControl is the long id of the datagrid. 

The only bugaboo will be when I send selectionChanged. The target will not be a 
control of the datagrid, but I can work that out easily enough. 

Thanks for kicking my mind in the butt. 

Bob S


> On Jul 19, 2018, at 07:38 , Bob Sneidar via use-livecode 
>  wrote:
> 
> Hi Tom. 
> 
> I usually find a way around things myself, but in this case, not. I have a 
> main form, where all the datagrids behave the same way on doubleMouseUp, 
> selectionChanged etc. I then have what I call subForms (substacks that detail 
> a given table and it's dependent tables like devices and accessories for 
> example) that behave in a different way, but all subForm datagrids have the 
> same behavior, different from the main form. 
> 
> I was hoping to be able to insert a special behavior between the datagrids 
> and the default behaviors. I also tried what apparently used to work, copying 
> the datagrid behavior to a button then setting the datagrid behavior to the 
> new button. That also does not work. 
> 
> Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-19 Thread Bob Sneidar via use-livecode
Hi Tom. 

I usually find a way around things myself, but in this case, not. I have a main 
form, where all the datagrids behave the same way on doubleMouseUp, 
selectionChanged etc. I then have what I call subForms (substacks that detail a 
given table and it's dependent tables like devices and accessories for example) 
that behave in a different way, but all subForm datagrids have the same 
behavior, different from the main form. 

I was hoping to be able to insert a special behavior between the datagrids and 
the default behaviors. I also tried what apparently used to work, copying the 
datagrid behavior to a button then setting the datagrid behavior to the new 
button. That also does not work. 

Bob S


> On Jul 18, 2018, at 17:10 , Tom Glod via use-livecode 
>  wrote:
> 
> Hi Bob, If you really wanna make things interesting . try putting a
> grid inside a grid. lol. it almost works.  Which means to me that
> "self referencing" is imperfect in the grid library.  that might pertain to
> the problems you experience and without the ability to debug the grid
> library...its tough going.  But i think I have learned that sometimes when
> i find i can't just get something righti end up finding a way easier
> way later..hope thats the case for you,


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Datagrids and Nested Behaviors

2018-07-18 Thread Tom Glod via use-livecode
Hi Bob, If you really wanna make things interesting . try putting a
grid inside a grid. lol. it almost works.  Which means to me that
"self referencing" is imperfect in the grid library.  that might pertain to
the problems you experience and without the ability to debug the grid
library...its tough going.  But i think I have learned that sometimes when
i find i can't just get something righti end up finding a way easier
way later..hope thats the case for you,

On Mon, Jul 9, 2018 at 2:11 PM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi all.
>
> I'm finally taking the plunge with nested behaviors with datagrids.
> Essentially, I have a button named "modulegrids" whose behavior is set to
> stack "RevDataGridLibraryBehaviorsDataGridButtonBehavior" (the new
> default behavior of a datagrid). I then set the behavior of a datagrid to
> the long id of that button. The behaviors are triggering alright, but
> selectionChanged is not *actually" changing the selection, and calls to the
> library such as the dgHiliedIndex of the datagrid return empty.
>
> So my question is, can behaviors be nested for datagrids?
>
> Bob S
>
>
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Datagrids and Nested Behaviors

2018-07-09 Thread Bob Sneidar via use-livecode
Hi all. 

I'm finally taking the plunge with nested behaviors with datagrids. 
Essentially, I have a button named "modulegrids" whose behavior is set to stack 
"RevDataGridLibraryBehaviorsDataGridButtonBehavior" (the new default behavior 
of a datagrid). I then set the behavior of a datagrid to the long id of that 
button. The behaviors are triggering alright, but selectionChanged is not 
*actually" changing the selection, and calls to the library such as the 
dgHiliedIndex of the datagrid return empty. 

So my question is, can behaviors be nested for datagrids? 

Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode