Re: OpenControl

2014-08-06 Thread hh
jacque wrote:
 There are some geniuses here on this list who know far more than
 I do, especially in niche areas where I have either no experience
 or no skills.

Certainly there are some geniuses here, probably I know most (I read
this year's archives last week). But there are also some who believe
they are genius and being immune to feedback would others also make
believe this.

I'm well exercised in bluff detection, one hasn't to be genius for
that. And you never bluff, that's why you have this good reputation.


___
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: OpenControl

2014-08-05 Thread J. Landman Gay

On 8/4/2014, 10:24 PM, Sri wrote:

Hi Jacque:

Wilstrand's method seems to work (with a little modification). In the
following, oldCardID is a custom property of the group. The first focusOut
is issued on closeCard.

on focusOut
local tID
put the ID of this card into tID
if tID is not the oldCardID of me then
   set the oldCardID of me to tID
   -- here, change the contents of the group, as necessary
else
   send focusOut to me in 50 milliseconds
end if
end focusOut

Let me know if this doesn't serve your purpose. I am just trying to learn
from all you experts on this use group.


Very close. :) I can't set up the group until I arrive at the card, 
because the group needs to read some card properties before it changes.


That said, I've realized that no background group will work at all. Any 
group that has background behavior is going to be affected by my 
backscript, regardless of what message it responds to. Which means I 
asked a silly question.


The group works fine with openControl as long as it isn't a background 
group. But I'm glad you and Mat posted, I'm sure this technique will 
come in handy some time. I thought Mats idea was pretty clever.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: OpenControl

2014-08-05 Thread J. Landman Gay

On 8/4/2014, 10:48 PM, hh wrote:

Your words are more than landmarks


I'm very flattered, but I think you give me too much credit. There are 
some geniuses here on this list who know far more than I do, especially 
in niche areas where I have either no experience or no skills. You'll 
see who they are as you continue to read this list; many of them aren't 
in the forums.


The only difference between them and me is probably that I talk more. ;)

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: OpenControl

2014-08-04 Thread J. Landman Gay

On 8/3/2014, 4:03 PM, Mats Wilstrand wrote:

I assume you're using a background grp. If so I have used the focusOut
message to fire some action in the self-contained grp when the card changes.
The focusIn message is not received by the group on crad change. This is
kind of counter intuitive imho but it works.


That's a clever approach Mats. Unfortunately I need to set up the group 
based on the contents of the current card, and I don't think that's 
known when a focusOut message is sent.


Since a frontscript isn't practical for this stack, and openBackground 
has the same limitations as openControl, I think I'll just put copies of 
the group on the cards that need it. There aren't too many, but it would 
have been better to share it.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: OpenControl

2014-08-04 Thread hh
From your answer I understand now what's the point.

You have a (shared) backgroundGroup that should go on some or all cards and you 
wish to change some properties of the group or its members depending on the 
card you wish to go to.

Right? For this situation I use the following.

We have one (shared) background group G
1) Give the group a customProperty array f that has these properties as 
elements,
   say f[i] = the properties to set in group G before opening card i.
2) Place the group on EVERY card and add instead it's *visible property* to 
f[i].
3) Do all changes in a preOpenCard handler in the group's script.

For beginners who read this: Such a group is in the message path by default 
AFTER card and stack. The only condition is now, that this is message is not 
trapped (= writing a preopenstack handler there and not passing it before 
e.g. by card or stack). This works always for me and the group is effectively 
(in size) only once in the stack.
This is somehow close to Mark's proposition (preOpenCard as frontscript, see 
above), but one doesn't have to control the message path as this uses a 
*backscript* by default.

Please write us a short note here (or in the forum, past Craig's post, see 
Richmond's link above) if this has besides trapping some more limitations we 
don't know of.

Hermann
___
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: OpenControl

2014-08-04 Thread Sri
Will this work?

1. Create an invisible button in your group named, say, Card Change.

2. On openControl, Set the script of the current card to add in the on
closeCard handler the statement:
send mouseUp to button Card Change of group myGroup

3. When the button received the mouseUp message on closeCard of the current
card,
a) it goes into a watch mode to see if the current card has changed; and
b) when it changes, it resets the contents of the group, and
c) modifies the closeCard of the new card.

Just trying to exercise my brain cells!

Sri.



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/OpenControl-tp4681692p4681714.html
Sent from the Revolution - User mailing list archive at Nabble.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: OpenControl

2014-08-04 Thread Peter Haworth
On Mon, Aug 4, 2014 at 6:11 AM, hh h...@livecode.org wrote:

 Do all changes in a preOpenCard handler in the group's script.


I believe the original post stated that no openxxx or preopenxxx handlers
could be used.

Pete
lcSQL Software http://www.lcsql.com
Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and
SQLiteAdmin http://www.lcsql.com/sqliteadmin.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: OpenControl

2014-08-04 Thread J. Landman Gay

On 8/4/2014, 12:37 PM, Peter Haworth wrote:

On Mon, Aug 4, 2014 at 6:11 AM, hh h...@livecode.org wrote:


Do all changes in a preOpenCard handler in the group's script.



I believe the original post stated that no openxxx or preopenxxx handlers
could be used.


Right. Due to this particular setup, inserting (even more) scripts into 
front or back, or placing a group on every card whether it needs it or 
not, isn't practical. The system is already too large and the messaging 
too complex to tinker with at this late stage (going live in a week.)


In this case it isn't a big deal to use separate copies of the group on 
each card that needs it because there are only a few. I was just curious 
if there was a quick, self-contained trick that would allow sharing the 
group. It's too late now to change the messaging that is already in place.


There will be a demo of this project soon, for anyone who is curious 
about what I've been talking about for the last 20 months.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: OpenControl

2014-08-04 Thread J. Landman Gay

On 8/4/2014, 11:46 AM, Sri wrote:

Will this work?

1. Create an invisible button in your group named, say, Card Change.

2. On openControl, Set the script of the current card to add in the on
closeCard handler the statement:
send mouseUp to button Card Change of group myGroup

3. When the button received the mouseUp message on closeCard of the current
card,
a) it goes into a watch mode to see if the current card has changed; and
b) when it changes, it resets the contents of the group, and
c) modifies the closeCard of the new card.


In some cases this might work, but I can't change the card scripts, even 
temporarily.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: OpenControl

2014-08-04 Thread Paul Hibbert
Jacque stated; The group needs to be self-contained with no additional 
scripting anywhere else in the stack.

But by putting a preOpenCard (or openCard) handler in the *Group's script* 
does mean that the group is still self contained. I was curious, so I tried a 
quick experiment and this does appear to work. Not too sure if it would solve 
Jacque's problem, but may be worth a try, looking at the manual I'd expect this 
just to work for user events, system events bypass controls and groups.

Thanks to HH for suggesting it, I've learnt something new, I always expected 
preOpenCard or openCard handlers just go in card or stack scripts, I never 
considered using them in a group or a control to be valid.

Paul


On 2014-08-04, at 10:37 AM, Peter Haworth p...@lcsql.com wrote:

 On Mon, Aug 4, 2014 at 6:11 AM, hh h...@livecode.org wrote:
 
 Do all changes in a preOpenCard handler in the group's script.
 
 
 I believe the original post stated that no openxxx or preopenxxx handlers
 could be used.
 
 Pete
 lcSQL Software http://www.lcsql.com
 Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and
 SQLiteAdmin http://www.lcsql.com/sqliteadmin.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


___
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: OpenControl

2014-08-04 Thread J. Landman Gay

On 8/4/2014, 1:22 PM, Paul Hibbert wrote:

But by putting a preOpenCard (or openCard) handler in the*Group's
script*  does mean that the group is still self contained. I was
curious, so I tried a quick experiment and this does appear to work.
Not too sure if it would solve Jacque's problem, but may be worth a
try, looking at the manual I'd expect this just to work for user
events, system events bypass controls and groups.


Yes, it would work in general. In this case I have a backscript that 
will change whatever the group has already done, so it needs its own 
message. That's why I was looking at the openControl/preOpenControl 
message, which the backscript doesn't handle.


I think my setup is fairly unique; most of the suggestions posted here 
would work for most typical stacks.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: OpenControl

2014-08-04 Thread hh
Grande Dame Jacque,

 Jacque wrote
 ...The system is already too large and the messaging too complex to tinker 
 with at this late stage ...

Just let me add the following for all who reads this later on and are now a bit 
frustrated because we have learned a lot in this discussion. And just now you 
bring in criteria never mentioned before with this problem (rating indirectly 
all contributions until now as garbage):

 Jacque wrote
 ... And I was just curious if there was a quick, self-contained trick that 
 would allow sharing the group ...

This sounds as if there was no. There was one:
The handler preopenCard suggested by Mark. The only thing to talk about is 
whether to put this in a frontscript or just put it in the group's script only.

 Jacque wrote:
 ... Due to this particular setup, inserting (even more) scripts into front or 
 back, or placing a group on every card whether it needs it or not, isn't 
 practical ...

You know this and I insist on writing this down for 'beginners':
The script of a shared backGround button hasn't to be placed in the backscript. 
It's by default inserted past card and stack. Every single background group 
gets each message sent to a card (even mouseDown) if it's passed by card and 
stack.
And placing a group on every card is *once* a repeat loop of 3 lines and one 
line of 'checking' in the first line of the group's preopenCard handler to hide 
or show it or pass preopenCard.
In TOTAL: Typing effort  2 minutes. Difference in size for use on one card and 
use on 1000 cards in total  2 KByte.

We know you are stressed and the following is not only from this reason not 
meant as an affront against you. It's simply a defence for other solutions 
presented here, especially Mark's (mine is a simple variant of) and Mat's (we 
learned from that 'focus' is *the* first message), that ARE more or less 
self-contained solutions or easily convertible to such.

Take this advice from an old man:
Please be cautious with your direct or indirect rating: Your assessments have 
highest weight in the community. Don't make them careless.

I really love your contributions on other webpages, here and in the forum. And 
your scripts are a source of pure gold to digg from. Thank you VERY much for 
that.

Respectfully and kind regards,
Hermann 
___
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: OpenControl

2014-08-04 Thread hh
 Paul wrote:
 I'd expect this just to work for user events, system events bypass
 controls and groups.

YES it works. You know I'm now nearly experienced (3/2 years with LC). But 
this was *very* soon for me one of the finest things in LC (and could even 
enhanced by using 'behavior'): Using the message path by a background group.

If I have for example a stack without titlebar that has substacks and all have 
one to N cards. Then I make a backGround group and place this on every card of 
the mainstack -- invisible and containing an 16x16 image, nothing else.
Then I write ONE dragHandler (the usual one) in the group and can now drag the 
stack window on every card and on every card of every substack that passes 
mouseDown (with setting the cursor to this image while dragging).

And/or
I write ONE mouseEnter handler in that group that receives (being visible or 
not) every mouseEnter of every object that passes mouseEnter (we had a similar 
thread recently in the forum). Try this in the groups script:

-- Instead of msg and clipboard you could use a grouped (visible) field
on mouseEnter
 if the tool is pointer tool and the optionkey is up then
   if the shiftkey is down then set clipboardData[text] to the target
   put the internet date :  the target -- into fld devInfo
 end if
 pass mouseEnter
end mouseEnter

Now choose the pointer tool when going to scriptEditor.
If you need the name of a control you wish to insert as target in a script then
(read this with all parentheses or without all parentheses):

1) point the control with the cursor (with shiftKey down for copying)
2) hold (additionally) the optionKey down -- to 'fix' current info
3) move the cursor back over your script and release keys (and paste)

To block this, handle mouseEnter in the main stack's script by not passing it, 
it's not required to touch the background group's script.

Hermann


___
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: OpenControl

2014-08-04 Thread J. Landman Gay

On 8/4/2014, 2:20 PM, hh wrote:

Please be cautious with your direct or indirect rating:


Apologies if it sounded like I was giving a rating. Your method, and 
the others, will work fine for most stacks. I only meant that in this 
particular case, it won't.


I have a suite of hundreds of stacks with tens of thousands of cards. 
The stacks are created automatically by a building tool based on the 
contents of text files, and some cards require specific plugins I've 
written. The plugins need to work independently of the larger system.


That's because there is a backscript which is the main heartbeat of the 
app, and it changes the state of every card in both openCard and 
preOpenCard handlers. Whatever a group sets up is likely to be undone if 
it uses any of those messages. That's why I need a message that isn't 
included in the backscript. The same thing would apply to a frontscript, 
which would change the group state first, and then the backscript would 
undo those changes.


I didn't mean to be critical, just explanatory. As I said, any of the 
methods various people have suggested would be good solutions most of 
the time.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: OpenControl

2014-08-04 Thread Sri
Hi Jacque:

Wilstrand's method seems to work (with a little modification). In the
following, oldCardID is a custom property of the group. The first focusOut
is issued on closeCard.

on focusOut
   local tID
   put the ID of this card into tID
   if tID is not the oldCardID of me then
  set the oldCardID of me to tID
  -- here, change the contents of the group, as necessary
   else
  send focusOut to me in 50 milliseconds
   end if
end focusOut

Let me know if this doesn't serve your purpose. I am just trying to learn
from all you experts on this use group.

Sri.



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/OpenControl-tp4681692p4681736.html
Sent from the Revolution - User mailing list archive at Nabble.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: OpenControl

2014-08-04 Thread hh
This explains a lot and solves the situation perfectly. But I didn't want you 
to apologize.

This was one of the first things I noticed in this community, what you say is 
heard and has immense weight (even if it is sometimes 4.2% incorrect).

There are impressive landmarks here (or in forum), to specify some:
A Did you think about this-line of Craig, a regex-one-liner of Thierry, a 
Hm-line of Mark-W.,  a little stack of Bernd, a Hi-shortliner of 
Mark-Sch., a spikey line with two smilies of Klaus, a FWIW note of Richard, 
an opening welcome by Simon or a closing nagging by Richmond (I have to 
stop now or nobody will read to end).

Your words are more than landmarks, rather seen like a monument in front of a 
train station. I think you should be *very* proud of this. And also, let me say 
this again, be very careful with this.

 hh wrote:
  Please be cautious with your direct or indirect rating:
 
 jacque wrote:
 Apologies if it sounded like I was giving a rating. Your method, and 
 the others, will work fine for most stacks. I only meant that in this 
 particular case, it won't.
 
 I have a suite of hundreds of stacks with tens of thousands of cards. 
 The stacks are created automatically by a building tool based on the 
 contents of text files, and some cards require specific plugins I've 
 written. The plugins need to work independently of the larger system.
 
 That's because there is a backscript which is the main heartbeat of the 
 app, and it changes the state of every card in both openCard and 
 preOpenCard handlers. Whatever a group sets up is likely to be undone if 
 it uses any of those messages. That's why I need a message that isn't 
 included in the backscript. The same thing would apply to a frontscript, 
 which would change the group state first, and then the backscript would 
 undo those changes.
 
 I didn't mean to be critical, just explanatory. As I said, any of the 
 methods various people have suggested would be good solutions most of 
 the time.


___
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: OpenControl

2014-08-03 Thread Mark Schonewille

Hi,

Include a front script in your group and add a preOpenCard handler to 
that front script.


--
Best regards,

Mark Schonewille

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

Installer Maker for LiveCode:
http://qery.us/468

Buy my new book Programming LiveCode for the Real Beginner 
http://qery.us/3fi


LiveCode on Facebook:
https://www.facebook.com/groups/runrev/

On 8/3/2014 21:30, J. Landman Gay wrote:

I want to create a shared group that resets its content every time it's
displayed on a different card. The group needs to be self-contained with
no additional scripting anywhere else in the stack.

The preOpenControl and openControl messages are only sent the first time
the shared group is drawn. I need a similar message every time the card
changes. I'd rather not put a different copy of the control on every
card (which would allow those messages.)

Has anyone dealt with this?



___
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: OpenControl

2014-08-03 Thread Richmond

On 03/08/14 22:30, J. Landman Gay wrote:
I want to create a shared group that resets its content every time 
it's displayed on a different card. The group needs to be 
self-contained with no additional scripting anywhere else in the stack.


The preOpenControl and openControl messages are only sent the first 
time the shared group is drawn. I need a similar message every time 
the card changes. I'd rather not put a different copy of the control 
on every card (which would allow those messages.)


Has anyone dealt with this?



That seems to be asking quite a lot . . .

Presumably, as you want the group to be self-contained it itself has to 
detect when

the end-user hits a Go Next button?

I am not sure how this can be done.

http://forums.livecode.com/posting.php?mode=postf=8

Richmond.

___
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: OpenControl

2014-08-03 Thread Richmond

On 03/08/14 22:56, Richmond wrote:

On 03/08/14 22:30, J. Landman Gay wrote:
I want to create a shared group that resets its content every time 
it's displayed on a different card. The group needs to be 
self-contained with no additional scripting anywhere else in the stack.


The preOpenControl and openControl messages are only sent the first 
time the shared group is drawn. I need a similar message every time 
the card changes. I'd rather not put a different copy of the control 
on every card (which would allow those messages.)


Has anyone dealt with this?



That seems to be asking quite a lot . . .

Presumably, as you want the group to be self-contained it itself has 
to detect when

the end-user hits a Go Next button?

I am not sure how this can be done.

http://forums.livecode.com/posting.php?mode=postf=8

Richmond.


Whoops: http://forums.livecode.com/viewtopic.php?f=8t=21251

Richmond.

___
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: OpenControl

2014-08-03 Thread Mats Wilstrand
Hi Jaque.

I assume you're using a background grp. If so I have used the focusOut
message to fire some action in the self-contained grp when the card changes.
The focusIn message is not received by the group on crad change. This is
kind of counter intuitive imho but it works.

All the best
Mats

 -Original Message-
 From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On
 Behalf Of J. Landman Gay
 Sent: den 3 augusti 2014 21:31
 To: LiveCode Mailing List
 Subject: OpenControl
 
 I want to create a shared group that resets its content every time it's
 displayed on a different card. The group needs to be self-contained with
no
 additional scripting anywhere else in the stack.
 
 The preOpenControl and openControl messages are only sent the first time
 the shared group is drawn. I need a similar message every time the card
 changes. I'd rather not put a different copy of the control on every card
 (which would allow those messages.)
 
 Has anyone dealt with this?
 
 --
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.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