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: Data Persistence

2018-07-23 Thread Tom Glod via use-livecode
welcome john.just as a tiparrayencode is very handy for saving
whatever you needyou can always also use a sqlite database to store
data and load / refresh whenever you needit also also works as
in-memory database.

On Mon, Jul 23, 2018 at 6:21 PM, Brian Milby via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I built a time tracking app that had the same type of persistence
> requirement. I used a text file for the data store. Each time any field had
> a change, the data was saved again. When loading the app it would import
> the current data. Data was only cleared on request (and I would only allow
> that after it was emailed). When cleared, I deleted the file.
>
> As you have discovered, on mobile your app can be terminated at any time
> and you may not be given a chance to save data before then.
>
> My test was on iOS but it should work the same on Android.
>
> Thanks,
> Brian
> On Jul 23, 2018, 4:58 PM -0500, John McKenzie via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
> >
> >
> > Hello, all.
> >
> > I am new to Livecode development but not computing. When I heard of
> > something that was inspired by Hypercard I had to know more. Used
> > Livecode to make a little app on my phone for work but the level of
> > interest this app generated now make me want to finish it, and maybe
> > even share and/or sell it. Livecode is pretty cool and I am looking
> > forward to learning how to use it and do stuff with it.
> >
> > So my first (and I sadly suspect not last) question to the list is
> > about persistence on the Android platform.
> >
> > My job is in the aviation industry. For now I want to get it working.
> > Then I will polish it off, beta test it, etc. One airline rep gave me
> > his card and said to call him about it if I wanted to sell it.
> >
> > The get it working part is where I need your help. I was unclear on
> > what Livecode could and could not do so I emailed them and a very
> > helpful person named Heather educated me a bit. Now that I know it
> > might work for my application I would appreciate your help in getting
> > it working.
> >
> > Right now it will be an Android app. iOS app later probably.
> >
> > The app is to help me record times and other facts about plane
> > landings (like when the plane landed and how much fuel is requested by
> > the Captain). At the end of a flight I can press a button and an email
> > addressed to our operations centre is auto-populated in the body of the
> > text with these numbers. For example if I press the button labelled
> > "ATA" (actual time of arrival) it places the current time in the text
> > field next to the ATA button. I can touch the text field and edit the
> > time if need be.
> >
> > What I need help with is the issue of persistence. If I get an SMS
> > message, a phone call or an alarm goes off the data will be wiped out
> > when I return to the app. Sometimes if I leave the app to check
> > something else and come back the data is there and other times the text
> > fields are all blank. Tried saving the data in a text file and having
> > the app load it up each time it starts. Most of the time this does not
> > work. Usually when I start the app up again at the beginning of the
> > next shift it starts up with the times of yesterday's flight.
> >
> >
> > So I would like to know how to properly hold the data so the entries
> > in the text fields are still there when I go to another app then come
> > back to mine. looking to have basic persistence in my app.
> >
> > Guidance on the (or one of the) proper way(s) to accomplish this
> > would be most appreciated.
> >
> >
> > ___
> > 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: drawing a Barcode without a Barcode font

2018-07-23 Thread Jim Lambert via use-livecode
> Matthias wrote:
> 
> If we print the labels with a thermo printer (203 dpi) then the code cannot 
> be scanned with the values i posted before.
> We  had set the line thickness of the rectangles to 0 and had to increase the 
> width of the black bars and decrease the width of the clear ones.


I wonder if it would make a difference to print snapshots of the graphic group 
rather then the group itself?

Jim Lambert
___
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: Data Persistence

2018-07-23 Thread Brian Milby via use-livecode
I built a time tracking app that had the same type of persistence requirement. 
I used a text file for the data store. Each time any field had a change, the 
data was saved again. When loading the app it would import the current data. 
Data was only cleared on request (and I would only allow that after it was 
emailed). When cleared, I deleted the file.

As you have discovered, on mobile your app can be terminated at any time and 
you may not be given a chance to save data before then.

My test was on iOS but it should work the same on Android.

Thanks,
Brian
On Jul 23, 2018, 4:58 PM -0500, John McKenzie via use-livecode 
, wrote:
>
>
> Hello, all.
>
> I am new to Livecode development but not computing. When I heard of
> something that was inspired by Hypercard I had to know more. Used
> Livecode to make a little app on my phone for work but the level of
> interest this app generated now make me want to finish it, and maybe
> even share and/or sell it. Livecode is pretty cool and I am looking
> forward to learning how to use it and do stuff with it.
>
> So my first (and I sadly suspect not last) question to the list is
> about persistence on the Android platform.
>
> My job is in the aviation industry. For now I want to get it working.
> Then I will polish it off, beta test it, etc. One airline rep gave me
> his card and said to call him about it if I wanted to sell it.
>
> The get it working part is where I need your help. I was unclear on
> what Livecode could and could not do so I emailed them and a very
> helpful person named Heather educated me a bit. Now that I know it
> might work for my application I would appreciate your help in getting
> it working.
>
> Right now it will be an Android app. iOS app later probably.
>
> The app is to help me record times and other facts about plane
> landings (like when the plane landed and how much fuel is requested by
> the Captain). At the end of a flight I can press a button and an email
> addressed to our operations centre is auto-populated in the body of the
> text with these numbers. For example if I press the button labelled
> "ATA" (actual time of arrival) it places the current time in the text
> field next to the ATA button. I can touch the text field and edit the
> time if need be.
>
> What I need help with is the issue of persistence. If I get an SMS
> message, a phone call or an alarm goes off the data will be wiped out
> when I return to the app. Sometimes if I leave the app to check
> something else and come back the data is there and other times the text
> fields are all blank. Tried saving the data in a text file and having
> the app load it up each time it starts. Most of the time this does not
> work. Usually when I start the app up again at the beginning of the
> next shift it starts up with the times of yesterday's flight.
>
>
> So I would like to know how to properly hold the data so the entries
> in the text fields are still there when I go to another app then come
> back to mine. looking to have basic persistence in my app.
>
> Guidance on the (or one of the) proper way(s) to accomplish this
> would be most appreciated.
>
>
> ___
> 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: drawing a Barcode without a Barcode font

2018-07-23 Thread Bob Sneidar via use-livecode
Out of curiosity, does printed barcodes from the laserwriter still work with 
these settings?

Bob S


> On Jul 22, 2018, at 14:18 , Matthias Rebbe via use-livecode 
>  wrote:
> 
> I have to add something.
> 
> As I wrote, we were able to successfully scan the labels. This is true as 
> long as we print the labels with a laser printer.
> 
> If we print the labels with a thermo printer (203 dpi) then the code cannot 
> be scanned with the values i posted before.
> We  had set the line thickness of the rectangles to 0 and had to increase the 
> width of the black bars and decrease the width of the clear ones.
> 
> So the code below shows the settings which allow us to scan the labels with a 
> Toshiba B-EV4D and a Zebra LP 2844.
> 
> put “3" into tNarrow
> put “6" into tWide
> set the width of grc "narrowC" to (tNarrow - 2)
> set the width of grc "narrowB" to (tNarrow -3)
> set the width of grc "wideC" to tWide
> set the width of grc "wideB" to tWide
> 
> Regards,
> 
> Matthias Rebbe

___
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

Data Persistence

2018-07-23 Thread John McKenzie via use-livecode



 Hello, all.

 I am new to Livecode development but not computing. When I heard of
something that was inspired by Hypercard I had to know more. Used
Livecode to make a little app on my phone for work but the level of
interest this app generated now make me want to finish it, and maybe
even share and/or sell it. Livecode is pretty cool and I am looking
forward to learning how to use it and do stuff with it.

 So my first (and I sadly suspect not last) question to the list is
about persistence on the Android platform.

 My job is in the aviation industry. For now I want to get it working.
Then I will polish it off, beta test it, etc. One airline rep gave me
his card and said to call him about it if I wanted to sell it.

 The get it working part is where I need your help. I was unclear on
what Livecode could and could not do so I emailed them and a very
helpful person named Heather educated me a bit. Now that I know it
might work for my application I would appreciate your help in getting
it working.

 Right now it will be an Android app. iOS app later probably.

 The app is to help me record times and other facts about plane
landings (like when the plane landed and how much fuel is requested by
the Captain). At the end of a flight I can press a button and an email
addressed to our operations centre is auto-populated in the body of the
text with these numbers. For example if I press the button labelled
"ATA" (actual time of arrival) it places the current time in the text
field next to the ATA button. I can touch the text field and edit the
time if need be.

 What I need help with is the issue of persistence. If I get an SMS
message, a phone call or an alarm goes off the data will be wiped out
when I return to the app. Sometimes if I leave the app to check
something else and come back the data is there and other times the text
fields are all blank. Tried saving the data in a text file and having
the app load it up each time it starts. Most of the time this does not
work. Usually when I start the app up again at the beginning of the
next shift it starts up with the times of yesterday's flight.


 So I would like to know how to properly hold the data so the entries
in the text fields are still there when I go to another app then come
back to mine. looking to have basic persistence in my app.

 Guidance on the (or one of the) proper way(s) to accomplish this
would be most appreciated.


___
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: drawing a Barcode without a Barcode font

2018-07-23 Thread Phil Davis via use-livecode
I wonder what would happen if you turned the bar code by 90 degrees and 
then printed it? Could it be scanned then?


Just a wild thought...

Phil Davis


On 7/22/18 2:43 PM, Matthias Rebbe via use-livecode wrote:

Of course i meant

So the code below shows the settings which allow us to scan the labels when 
printed with a Toshiba B-EV4D and a Zebra LP 2844.


Am 22.07.2018 um 23:18 schrieb Matthias Rebbe via use-livecode 
:

I have to add something.

As I wrote, we were able to successfully scan the labels. This is true as long 
as we print the labels with a laser printer.

If we print the labels with a thermo printer (203 dpi) then the code cannot be 
scanned with the values i posted before.
We  had set the line thickness of the rectangles to 0 and had to increase the 
width of the black bars and decrease the width of the clear ones.

So the code below shows the settings which allow us to scan the labels with a 
Toshiba B-EV4D and a Zebra LP 2844.

put “3" into tNarrow
put “6" into tWide
set the width of grc "narrowC" to (tNarrow - 2)
set the width of grc "narrowB" to (tNarrow -3)
set the width of grc "wideC" to tWide
set the width of grc "wideB" to tWide

Regards,

Matthias Rebbe



Am 20.07.2018 um 13:31 schrieb Matthias Rebbe via use-livecode 
:

We tried here with iPhone and also with an USB scanner. Both devices scanned 
the code successfully.

I have just finished a program for shipment. It fetches customer and invoice 
data from the accounting software and creates then the shipment labels 
including a Code25i barcode and a QR code. The carrier is Trans-o-Flex. I need 
to send some sample labels to their IT department. They will check if the 
labels are readable by their scanners. But i am now confident, that this will 
work on their side also.

Thanks again.

Matthias




Am 20.07.2018 um 11:31 schrieb Mike Bonner via use-livecode 
:

Very cool!  Does it actually produce a code that can be scanned?

On Fri, Jul 20, 2018 at 3:25 AM Matthias Rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:


Mike

you´re awesome. That is already an almost complete solution to my
question. Never had expected that. Thank you very much.
I´ve made some little changes. One among of them is:
To have all the separate bars of the barcode in a group, i changed the
lines where the grc is cloned
to for examplecopy grc “narrowB” to grp “barcode2of5”

Here´s now my code to convert the nNnNN…. string to Barcode

local tLast
on mouseup
if there is a grp "barcode2of5" then delete grp "barcode2of5"
-- now change the width of the template graphics
put "2" into tNarrow
put "4" into tWide
set the width of grc "narrowC" to tNarrow
set the width of grc "narrowB" to tNarrow
set the width of grc "wideC" to tWide
set the width of grc "wideB" to tWide
put "0" into tHorAdjust -- allows to put a gap beween the separate bars.
put "60,286" into tBarTopLeft -- defines where the first bar is placed
put empty into tLast
put fld "2of5" into tChars -- the field with your wNnnW string
set the casesensitive to true -- to differentiate case of course
create grp "barcode2of5"
repeat for each char tChar in tChars
switch tChar
   case "N"
  -- checks the char, and clones the matching bar.
  --if its the first time through, places it at astart location
  -- then uses the id of the most recent bar forplacement
purposes
  --clone grc "narrowB"
  copy grc "narrowB" to grp "barcode2of5"
  if tLast is empty then
 set the topleft of the last grc to tBarTopLeft
  else
 set the topleft of the last grc to horAdjust(tHorAdjust)
  end if
  break
   case "n"
  --clone grc "narrowC"
  copy grc "narrowC" to grp "barcode2of5"
  if tLast is empty then
 set the topleft of the last grc to tBarTopLeft
  else
 set the topleft of the last grc to horAdjust(tHorAdjust)
  end if
  break
   case "W"
  --clone grc "wideB"
  copy grc "wideB" to grp "barcode2of5"
  if tLast is empty then
 set the topleft of the last grc to tBarTopLeft
  else
 set the topleft of the last grc to horAdjust(tHorAdjust)
  end if
  break
   case "w"
  --clone grc "widec"
  copy grc "widec" to grp "barcode2of5"
  if tLast is empty then
 set the topleft of the last grc to tBarTopLeft
  else
 set the topleft of the last grc to horAdjust(tHorAdjust)
  end if
  break
end switch
put the short id of the last grc into tLast -- the id of the most
recently placed bar
end repeat
set the height of grp "barcode2of5" to 69
set the width of grp "barcode2of5" to 360
end mouseup

--This function allows a horizontal adjustment of the single bars.
function horAdjust tHorAdjust
put the topright of grc id tLast into tTMP
set the itemdelimiter to ","
add tHorAdjust to item

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


LCARS controls as LC widget - Is it possible?

2018-07-23 Thread Eller, Roger via use-livecode


http://lcarssdk.org

LCARS SDK
lcarssdk.org
LCARS SDK | A Functional Implementation of the LCARS Methodology.






___
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


[ANN] This Week in LiveCode 138

2018-07-23 Thread panagiotis merakos via use-livecode
Hi all,

Read about new developments in LiveCode open source and the open source
community in today's edition of the "This Week in LiveCode" newsletter!

Read issue #138 here: https://goo.gl/TpJVrX

This is a weekly newsletter about LiveCode, focussing on what's been
going on in and around the open source project. New issues will be
released weekly on Mondays. We have a dedicated mailing list that will
deliver each issue directly to you e-mail, so you don't miss any!

If you have anything you'd like mentioned (a project, a discussion
somewhere, an upcoming event) then please get in touch.


-- 
Panagiotis Merakos 
LiveCode Software Developer

Everyone Can Create Apps 
___
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