Repeating a hilite command over several cards

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Mon Jun 15, 2009 12:31 am

Thanks for that Bern.
I'll give it a shot.

Cheers
Bidge

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Mon Jun 15, 2009 7:26 am

Hi

Something strange is happening???
I put some buttons in a scrolling group and now when I load a button list all the names come in out of sequence?

Help please :(
Cheers
Bidge

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Mon Jun 15, 2009 9:11 am

Bidge,

did you sort the buttons after loading them into a button list like
suppose the name ends with a space and than a number, and the names are in a comma dellimited list:

Code: Select all

sort items numeric of tButtonListCard by last word of each
I tried to put buttons in a scrolling group and it works.

regards
bernd

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Mon Jun 15, 2009 9:42 am

Hi Bernd.
Yes...I had the buttons sorted perfectly. All of a sudden the sorting order went out the window??? I had changed nothing at all, just imported a library. So I closed down Runrev and opened an older version I had saved and it worked perfectly?? Really strange eh?

Oh well. Things are working well again now... (crossed fingers :)

Cheers
Bidge

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Mon Jun 15, 2009 2:13 pm

Bidge,

the stack you sent me had an old button script of the chebox buttons "track XX" It did not clear a selection if the user unselected the checkbox.
here is the script that did just that:

Code: Select all

on mouseUp
   if the hilite of me then 
      put last word of the short name of me into myLine
      put line myLine of field "AudioNamesAndPathes" into line (the number of lines of field "userChoices")+1 of field "userChoices" 
   else ## not hilited = the user deselected it
      put last word of the short name of me into myLine
      put line myLine of field "AudioNamesAndPathes" into myTest
      filter field "userChoices" without myTest
   end if
end mouseUp
I dont remember when that got lost.
regards
Bernd

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Mon Jun 15, 2009 2:35 pm

Hello Bernd.

I am learning a lot thanks to you.
I did a modification of the checkbox behaviour. When a checkbox is deselected, all of the checkboxes will deselect, making you reselect a new group rather than deleting unwanted lines from the text field. It works well.

Code: Select all

end repeat on mouseUp
   if the hilite of me is true then 
      put last word of the short name of me into myLine
      put line myLine of field "AudioNamesAndPathes" into line (the number of lines of field "userChoices")+1 of field "userChoices" 
      else
         put empty into fld "userChoices"
      end if
       if the hilite of me is false then 
      repeat with k = 1 to the number of cards 
repeat with i = 1 to the number of buttons of card k 
if the short name of button i of card k contains "Track" then 
set the hilite of button i of card k to false 
end if
end repeat
end if   
end mouseUp
What do you think?
Cheers
Bidge

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Mon Jun 15, 2009 2:42 pm

What do you think?
Looks good.

regards
Bernd

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Mon Jun 15, 2009 2:53 pm

A bit cruder than yours though I must admit :oops:
but it shows you I am learning and trying hard!!!

Many thanks again for your help!
Bidge

Post Reply