Ways to get the IDs of two already scripted buttons?

2012-01-04 Thread Kresten Bjerg
Thanks to all of you for questions and suggestions.
Bob : unfortunately no, user shall not have to specify names of buttons
Craig: no, button scripts shall not have to be pre-modified, they are of 
several kinds, scripted by stack handlers
Mike: I have been experimenting a lot with your script, it works with 
unscripted buttons, but not with scripted buttons. Also demands button name to 
be specific. Placement in  card script awkward: a diary with new card every day.
Mark: suggestion of front-script goes far over my head. If it were something 
which could enable a lineconnect-handler to select two arbitrary (grouped) 
buttons and lineconnect them, avoiding activating their scripts it sounds 
interesting, but I guess such front-script should be both inserted and removed 
by the lineconnect handler.
But I am still wondering why getting two (grouped and scripted) button IDs 
through ALT-clicking shall be so complicated ???
___
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: Ways to get the IDs of two already scripted buttons?

2012-01-03 Thread Bob Sneidar
on mouseup pButtonNum
  if pButtonNum is 3 then
select me
-- do some stuff
select empty
  end if
end mouseUp

Is that what you meant?

Bob


On Jan 1, 2012, at 3:55 PM, Kresten Bjerg wrote:

 I am trying to script a handler guiding (through Answer dialogue) user of 
 standalone to select first one arbitrary existing  button, to put its ID in a 
 variable and (new answer-dialogue) then another existing button, to collect 
 its Id into another variable,  - for(new answer-dialogue) connecting them 
 with a line/ or erase line between them.
 As these buttons are already scripted, and mouseups to them must be avoided, 
 I hope that Alt clicking them might be a way to have them selected enough to 
 get their IDs. But I cannot find my way to make it work. I have thought that 
 there might be a way perhaps  through a Wait until condition, but don't 
 know how to formulate such script. I am also uncertain: Is the use of the 
 ALT-click a realistic strategy to get hold of the button-IDs?
 I cannot imagine that something like this should be impossible in livecode
 Happy New Year
 From
 Kresten Bjerg
 ___
 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


Ways to get the IDs of two already scripted buttons?

2012-01-02 Thread Kresten Bjerg
Thanks for replies
John: if a mouseenter can do the job, I guess that would be OK, -does this 
suggestion imply, that Altclick cannot be used ?
Craig: Unfortunately modifying button scripts is out of the question
I am afraid, that I need a step by step, line by line, guidance in this
I paste my latest naïve attempt as a starting point -which evidently doesn't 
achieve anything 
on lineconnect
Answer select the first textbutton of a pair by holding alt- button down and 
click it.  with  Yes or Escape titled Step one in establishing a line 
connecting two buttons
wait 10 seconds
wait until object is selected
put the ID of  the selectedobject into firstbuttonID
(continued in next posting)


___
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: Ways to get the IDs of two already scripted buttons?

2012-01-02 Thread Mike Bonner
I put this into the card. It doesn't account for LOTS of things (such as
multiple copies of the line if you just keep alt-clicking buttons) but does
demonstrate a way to draw lines between 2 consecutively chosen buttons. If
there are scripts in the button, they must pass mouseUp to work. If they're
empty then its a non-issue.  This script goes in the card script. Don't
know if it'll help or if its too simplistic but perhaps it's a start.

local sLastClick
on mouseUp
   if the altkey is down then
  if the name of the target contains button then
 if sLastClick is empty then
put the id of the target into sLastClick
answer information first button chosesn
 else
create grc connectLine
set the style of grc connectLine to line
set the points of grc connectLine to (the loc of the target)
 return  (the loc of button id sLastClick)
put the id of the target into sLastClick
 end if
  end if
   end if
end mouseUp
On Mon, Jan 2, 2012 at 3:45 PM, Kresten Bjerg kresten.bj...@psy.ku.dkwrote:

 Thanks for replies
 John: if a mouseenter can do the job, I guess that would be OK, -does this
 suggestion imply, that Altclick cannot be used ?
 Craig: Unfortunately modifying button scripts is out of the question
 I am afraid, that I need a step by step, line by line, guidance in this
 I paste my latest naïve attempt as a starting point -which evidently
 doesn't achieve anything 
 on lineconnect
 Answer select the first textbutton of a pair by holding alt- button down
 and click it.  with  Yes or Escape titled Step one in establishing a
 line connecting two buttons
 wait 10 seconds
 wait until object is selected
 put the ID of  the selectedobject into firstbuttonID
 (continued in next posting)


 ___
 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: Ways to get the IDs of two already scripted buttons?

2012-01-02 Thread dunbarx
Why is modifying button scripts out of the question?


You have good instincts, but need work learning the language. (wait until the 
object is selected)


This can work out. Keep posting. You will be amazed how much help will come.


Craig Newman



-Original Message-
From: Kresten Bjerg kresten.bj...@psy.ku.dk
To: use-livecode use-livecode@lists.runrev.com
Sent: Mon, Jan 2, 2012 12:47 pm
Subject: Ways to get the IDs of two already scripted buttons?


Thanks for replies
John: if a mouseenter can do the job, I guess that would be OK, -does this 
suggestion imply, that Altclick cannot be used ?
Craig: Unfortunately modifying button scripts is out of the question
I am afraid, that I need a step by step, line by line, guidance in this
I paste my latest naïve attempt as a starting point -which evidently doesn't 
achieve anything 
on lineconnect
Answer select the first textbutton of a pair by holding alt- button down and 
click it.  with  Yes or Escape titled Step one in establishing a line 
connecting two buttons
wait 10 seconds
wait until object is selected
put the ID of  the selectedobject into firstbuttonID
(continued in next posting)


___
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

Ways to get the IDs of two already scripted buttons?

2012-01-01 Thread Kresten Bjerg
I am trying to script a handler guiding (through Answer dialogue) user of 
standalone to select first one arbitrary existing  button, to put its ID in a 
variable and (new answer-dialogue) then another existing button, to collect its 
Id into another variable,  - for(new answer-dialogue) connecting them with a 
line/ or erase line between them.
As these buttons are already scripted, and mouseups to them must be avoided, I 
hope that Alt clicking them might be a way to have them selected enough to get 
their IDs. But I cannot find my way to make it work. I have thought that there 
might be a way perhaps  through a Wait until condition, but don't know how to 
formulate such script. I am also uncertain: Is the use of the ALT-click a 
realistic strategy to get hold of the button-IDs?
I cannot imagine that something like this should be impossible in livecode
Happy New Year
From
Kresten Bjerg
___
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: Ways to get the IDs of two already scripted buttons?

2012-01-01 Thread John Dixon

Would it work for you if you got the ID of the button on a mouseEnter ?

 I am trying to script a handler guiding (through Answer dialogue) user of 
 standalone to select first one arbitrary existing  button, to put its ID in a 
 variable and (new answer-dialogue) then another existing button, to collect 
 its Id into another variable,  - for(new answer-dialogue) connecting them 
 with a line/ or erase line between them.
 As these buttons are already scripted, and mouseups to them must be avoided, 
 I hope that Alt clicking them might be a way to have them selected enough to 
 get their IDs. But I cannot find my way to make it work. I have thought that 
 there might be a way perhaps  through a Wait until condition, but don't 
 know how to formulate such script. I am also uncertain: Is the use of the 
 ALT-click a realistic strategy to get hold of the button-IDs?
 I cannot imagine that something like this should be impossible in livecode
 Happy New Year
 From
 Kresten Bjerg
 ___
 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: Ways to get the IDs of two already scripted buttons?

2012-01-01 Thread dunbarx
Since you need to start a process that sets up the selection process, why not 
set a custom property as well? You would modify the button scripts so that they 
only proceed if the correct value of that property is read.


In that way, the new button handlers would check the property at the outset, 
and exit if they found it was not allowed. You need to reset somehow, of course.


I think this is better than requiring odd click combinations.


Craig Newman



-Original Message-
From: Kresten Bjerg kresten.bj...@psy.ku.dk
To: use-livecode use-livecode@lists.runrev.com
Sent: Sun, Jan 1, 2012 1:56 pm
Subject: Ways to get the IDs of two already scripted  buttons?


I am trying to script a handler guiding (through Answer dialogue) user of 
standalone to select first one arbitrary existing  button, to put its ID in a 
variable and (new answer-dialogue) then another existing button, to collect its 
Id into another variable,  - for(new answer-dialogue) connecting them with a 
line/ or erase line between them.
As these buttons are already scripted, and mouseups to them must be avoided, I 
hope that Alt clicking them might be a way to have them selected enough to get 
their IDs. But I cannot find my way to make it work. I have thought that there 
might be a way perhaps  through a Wait until condition, but don't know how to 
formulate such script. I am also uncertain: Is the use of the ALT-click a 
realistic strategy to get hold of the button-IDs?
I cannot imagine that something like this should be impossible in livecode
Happy New Year
From
Kresten Bjerg
___
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: Ways to get the IDs of two already scripted buttons?

2012-01-01 Thread Mark Wieder
Kresten-

Sunday, January 1, 2012, 3:55:07 PM, you wrote:

 I cannot imagine that something like this should be impossible in livecode

This seems like a prime candidate for a frontscript. The simplest way
might be to use a global variable (warning - untested):

global gSelectedID
put empty into gSelectedID
insert the script of button xyzzy into front
answer ...
remove the script of button xyzzy from front
if abc is not empty then ...

in button xyzzy's script:

on mouseUp
  global gSelectedID
  put the id of the target into gSelectedID
  if Answer is not in the long name of the target then
-- *don't pass mouseUp
  else
-- allow mouseUp events in the Answer dialog buttons
pass mouseUp
  end if
end mouseUp

-- 
-Mark Wieder
 mwie...@ahsoftware.net


___
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