Hilited Line- How to un-hilite it quickly???

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

Post Reply
Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm

Hilited Line- How to un-hilite it quickly???

Post by Youks » Tue Jun 12, 2012 2:31 pm

Hi All,

It's been quite some time now hoping you're all well!!!

I am having a little stupid problem...............does anyone have found a "very fast" way of "Un-Hilite or De-Hilite" a line that has previously hilited with the clickline function??

I tried selecting line 0 of the field but kind of very slow on iOS!!!

Many thx for help!!

Rgds :)

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Hilited Line- How to un-hilite it quickly???

Post by Klaus » Tue Jun 12, 2012 2:37 pm

Hi Youks,

...
set the hilitedlines of fld "xyz" zo 0
...

Best

Klaus

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm

Re: Hilited Line- How to un-hilite it quickly???

Post by Youks » Tue Jun 12, 2012 3:30 pm

Hi Klaus,

Thx for your fast reply, but actually this what i did on my code but it can take up to 1s or + before the line become dehilited on iOS!!

If there's no other method i will have to improve my code....

on mouseUp
select the clickLine
put the value of the clickLine into textOfClickedLine
answer textOfClickedLine with "No" or "Yes"

if it is "No" then
set the hilitedLine of field "Contacts" to 0
else
--do something else...etc....

Thanks!

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Hilited Line- How to un-hilite it quickly???

Post by Klaus » Tue Jun 12, 2012 3:36 pm

Hi Youks,

is this a "list" field?

"hilitedlines" will only work with listfields.
Or why are you dealing with (value) "the clickline"?

Is the "mouseup" in the fields script?


Best

Klaus

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm

Re: Hilited Line- How to un-hilite it quickly???

Post by Youks » Tue Jun 12, 2012 3:47 pm

Hi Klaus,

Actually i am using a field containing a list of items, all running under scroller.
The "Mouse Up" hdlr is relative to field containing the list.When i user clicks on an item of the list it triggers an Answer msg with "No" or "yes". If the answer is "No" then i return to the list an dehilite the line , if "Yes" a move to another card.

That's what i am trying to achieve but on iOS sometimes the dehilite process is not immediate!

Thx! :?

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm

Re: Hilited Line- How to un-hilite it quickly???

Post by Youks » Tue Jun 12, 2012 3:50 pm

Hi Klaus,

Maybe it has to do with the "Delay touches" property of the scroller?

Rgds :?

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Hilited Line- How to un-hilite it quickly???

Post by Klaus » Tue Jun 12, 2012 4:17 pm

Hi Youks,

maybe, I have no experience with iOS yet.


Best

Klaus

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Hilited Line- How to un-hilite it quickly???

Post by sturgis » Tue Jun 12, 2012 4:32 pm

Since i can't test on IOS there isn't a way for me to help directly, but wanted to point out something klaus hinted at.

You don't need to use value to get the value of the clicked line. Since it sounds like you are correctly using a field with the listbehavior property, you also don't need to "select the clickline"

Code: Select all

-- simple script in the list field
on mouseUp
    put the clicktext into tText -- puts the text of the clicked line into variable tText
    answer tText with "No" or "Yes" -- your answer dialog
    if it is "no" then
        set the hilitedline of me to empty -- empty and 0 both work. Can use the "of me" form since the field is referencing itself. 
    else
        put tText into field "outField" 
    end if
end mouseUp
Like Klaus, I have no IOS experience yet (though this works on android)

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm

Re: Hilited Line- How to un-hilite it quickly???

Post by Youks » Tue Jun 12, 2012 4:52 pm

Thx Klaus & Sturgis for your Help, looks like (my impression!) the code of Sturgis and using "empty" instead of "0" run a little faster!

Again even if "0" & "empty" is the same!!


Regards. :D

Post Reply