Re: use-revolution Digest, Vol 80, Issue 81

2010-05-25 Thread Peter Haworth
I'm glad to gear such a simple solution!  My concerns were all based  
on the following in the dictionary entry for behavior:


The behavior property is a reference to a button containing the  
script to use. It is in the format of a long ID.


I guess I need to be more careful about believing what the dictionary  
says!


Pete Haworth


On May 25, 2010, at 12:57 AM, use-revolution-requ...@lists.runrev.com  
wrote:



Hi Peter,

No, you don't need to include the operating system's path to the stack
file. For example, the following is a correct reference for a
behavior: button id 1015 of stack Untitled 1

You can keep one copy of your stack with parent objects on your hard
disk and add this stack to the stackfiles property of the mainstack of
your project. When you build the standalone, the stack will be copied
into your standalone and above reference will still work.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer

Economy-x-Talk is always looking for new projects. Contact me for a
quote http://economy-x-talk.com/contact.html
Download Clipboard Link http://clipboardlink.economy-x-talk.com and
share the clipboard of your computer over the local network.

On 24 mei 2010, at 22:03, Peter Haworth wrote:


I'm trying to figure out the best way to make a library of behavior
buttons available to multiple applications.

I originally developed the library as a substack of my application
but would now like to move it to a separate .rev file and refer to
it from other applications.  Seems like that gives me a single
maintenance point - fix any behavior problems in the library and
it's automatically fixed in all applications.

However, it's feeling like this isn't a practical solution.  As I
understand it, the behavior property of an object uses the long id
of the button it refers to and I think the long id includes the
operating system path to the .rev file that the button is in.

Just for development purposes, I have three different folders I use
- one for code and test, another for QA, and anther for the final
application.  SO if I set the behavior to point to my library of
behaviors in the code and test folder, then move the app's .rev file
to the QA folder, the behavior properties will still point to the
behavior library of in the code and test folder.  And so on.

I'm sure there much more experienced users than me out there who
have run into this problem and hoping they can share how they dealt
with it.  Only thing I can think of is a script that runs during
installtion to go find all controls with a behavior property set and
change it to the correct one.

Pete Haworth




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


Re: use-revolution Digest, Vol 80, Issue 81

2010-05-25 Thread Richard Gaskin

Peter Haworth wrote:


I'm glad to gear such a simple solution!  My concerns were all based
on the following in the dictionary entry for behavior:

The behavior property is a reference to a button containing the
script to use. It is in the format of a long ID.

I guess I need to be more careful about believing what the dictionary
says!

Pete Haworth


The docs are kinda correct, but just don't tell the whole story (I'm 
cc'ing support here so the Dictionary entry can be updated to reflect 
the full story):


You can use the long ID of a button to set the value of the behavior 
property for an object, but once it's set it gets stored using only the 
short name of the stack the behavior button is in.


This is explained more fully in the ParentScriptNotes.txt document 
included with the Rev install:



   PARENT SCRIPTS - RESOLUTION

   A control's parent script reference is saved in the stackfile
   as three pieces of information:
 1) button id
 2) stack name
 3) mainstack name (if stack is substack)
   This is the minimum required information to uniquely identify
   a button within a running Revolution environment.

   Immediately after loading a stack file, an attempt is made to
   resolve all parentScript references - the engine acts as if
   it constructs a control reference:
 button id id of stack stack name [ of stack mainstack name ]
   And attempts to access it. Thus, the stackFiles property will be
   searched as appropriate and any needed stacks will be loaded.

--
 Richard Gaskin
 Fourth World
 Rev training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
 revJournal blog: http://revjournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution