Hi Jim
Normally I want the text to be editable most of the time, so it needs to be
in the field, but just hidden. But i can definitely see uses for your
suggestion of having different "views" instantly available.
Regards
Kaveh
On Sat, 8 Dec 2018 at 20:42, Jim Lambert via use-livecode <
use-livec
> So I am looking to hide any line that contains no textcolor anywhere.
You might save into a variable the HTMLTEXT of all the lines that contain the
textcolor.
Also save the HTMLTEXT of the whole field into another variable.
Then in a blink of an eye you can instantly switch between the entire
On 03/12/2018 14:51, Håkan Liljegren via use-livecode
wrote:
and you can also shave off some milliseconds in the styledText version by using
foreach:
…
It is a bit strange though that the foreach always seams to be faster. If we
try to sum an array with 100 000 element like:
I know yo
Sorry, the styledText method of my last post had a logic fault
(style-runs without textcolor are ignored).
The following works now for me.
-- styledText method
on mouseUp
put the millisecs into m1
lock screen; lock messages
put the styledText of field "text" into tTextA
repeat for each ke
> Hakan wrote:
> The code will not work if you have htmltext containing the text "color=" like:
> To set the color you can use color="#fa3b42"
Oh yes, was rather silly of me not to keep this in mind. There is a simple
remedy:
put ("color=" is in fld 1) into isInField
if isInField then replace "c
The code will not work if you have htmltext containing the text "color=" like:
To set the color you can use color="#fa3b42"
and you can also shave off some milliseconds in the styledText version by using
foreach:
…
repeat for each key aKey in tTextA
# Check if first run has textcolor set
J. Landman Gay wrote:
> Right, and accessing a field is one of the most expensive operations
> in LC.
>
> Maybe Richard will post his analogy to the maintenance worker again. I
> found it both amusing and informative.
http://lists.runrev.com/pipermail/use-livecode/2005-May/057144.html
:)
--
R
Right, and accessing a field is one of the most expensive operations in LC.
Maybe Richard will post his analogy to the maintenance worker again. I
found it both amusing and informative.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On
So the first form populates the field only oncesince its a single
command so no other states of the field will exist.
Makes perfect sense.
Thanks
On Sat, Dec 1, 2018 at 7:45 PM Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:
> Tom Glod wrote:
>
> > Can someone expla
Tom Glod wrote:
> Can someone explain the seemingly extraordinary performance
> improvement in using apparently its "split second" vs "over a minute"
>
> set the hidden of line 1 to - 1 of field 1 to false
>
> vs.
>
> repeat with i = 1 the number of lines of fld 1
> set the hidden of line i
Can someone explain the seemingly extraordinary performance improvement in
using apparently its "split second" vs "over a minute"
set the hidden of line 1 to - 1 of field 1 to false
vs.
repeat with i = 1 the number of lines of fld 1
set the hidden of line i of fld 1 to false
end repeat
it
> Kaveh wrote:
> I can confirm that the htmltext method works beautifully and blindingly fast.
So we have here two methods:
The htmlText-method and the styledText-method.
There is an interesting result in the speed comparison of the two methods.
Here the htmlText-method is significantly faster w
Apologies hh. I can confirm that the htmltext method works beautifully and
blindingly fast. I was going to try it to understand fully first. I now do
and am grateful for the amazing tricks I have learned here. :-)
On Sat, 1 Dec 2018 at 13:46, hh via use-livecode <
use-livecode@lists.runrev.com> wr
> Kaveh wrote:
> I am looking to hide any line that contains no textcolor anywhere.
I already gave you one that hides *exactly* these lines
(as you already wished in your first post).
> Hermann wrote:
> Here yet another fast method.
>
> on mouseUp
> put the millisecs into m1
> lock screen;
Hi all
I have learned a lot here, especially the hint of using styledText. But
there might be a misunderstanding. In my case, it is not necessarily the
whole line that is styled, but a line might *contain* a chunk of text that
is styled, e.g. one word in the middle of the line has textcolor set. S
Kaveh wrote:
> Now how many lines of JavaScript would that be? ;-)
The equivalent of chunk expressions are ridiculously verbose in JS, but
this one's not bad:
getElementById("id").removeAttribute("style");
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Deskt
Why do you need to simulate non-contiguous selections? Set the
listBehavior, multipleHilites, and noncontiguousHilites of the field to
true and then you can do things like:
set the hilitedLines of fld 1 to 1,3,5
But to your original question, you should use:
repeat for each line L in the htmlTex
In jQuery it’d be something like $j(‘div #id’).text(); selecting the field’s
enclosing div by ID or class.
Best,
Keith
> On 30 Nov 2018, at 17:43, Bob Sneidar via use-livecode
> wrote:
>
> And how much would the Javascript training and certification cost be to learn
> how to do it? ;-)
>
>
And how much would the Javascript training and certification cost be to learn
how to do it? ;-)
Bob S
> On Nov 30, 2018, at 09:17 , Kaveh Bazargan via use-livecode
> wrote:
>
>> FWIW, the fastest way that I know to remove all text stylings from a field
>> of text is this:
>>
>> put fld 1 in
On Fri, 30 Nov 2018 at 17:12, Dan Friedman wrote:
> Kaveh,
>
> Well, you learn something every day! I didn't know you could hide a line
> of text. Pretty cool!
>
>
Really nice. Working on speeding it up which will be great.
> FWIW, the fastest way that I know to remove all text stylings from
Kaveh,
Well, you learn something every day! I didn't know you could hide a line of
text. Pretty cool!
FWIW, the fastest way that I know to remove all text stylings from a field of
text is this:
put fld 1 into fld 1
-Dan
On 11/30/18, 8:37 AM, "use-livecode on behalf of Kaveh Bazargan v
I am simulating a non-contiguous selection of text with a "Find all" button
that sets the style of all found items of text.
Then I want to inspect those "selections" only but showing the paras that
contain them and hiding all other lines. So I have a full view and a
"compact" view that the user ca
I was wondering at what stage or how the lines get chosen to be hidden or
not?
___
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/m
Did not know about textStyle which has opened a whole new world! Thank you
so much for ruining my weekend Trevor. ;-)
hh, I love the first solution, which shows the beauty of LiveCode. But the
speed is the same as before...
i will try htmltext too. A while since I worked with it.
Thanks again.
If showing *only* lines with colored text means that all others
are hidden then you could use:
...
set hidden of line i of fld "text" to \
(the textcolor of line i of fld "text" is empty)
...
Trevor's script would then read:
...
put (tTextA[i]["runs"][1]["style"]["textcolor"] is empty) \
On Fri, Nov 30, 2018 at 7:08 AM Kaveh Bazargan via use-livecode <
use-livecode@lists.runrev.com> wrote:
> But here is a follow-up: Now I want to hide all lines that have no text
> style and only show lines with colored text. I use:
>
> repeat with i = 1 to the number of lines of fld 1
> if t
Kaveh,
I would work which lines should be shown and hidden inside a variable
and then replace the whole field...
On 30/11/2018 13:07, Kaveh Bazargan wrote:
Yes Andre, that is the line that fixed it, in a split second :-)
But here is a follow-up: Now I want to hide all lines that have no
tex
Yes Andre, that is the line that fixed it, in a split second :-)
But here is a follow-up: Now I want to hide all lines that have no text
style and only show lines with colored text. I use:
repeat with i = 1 to the number of lines of fld 1
if the textcolor of line i of fld "text" is not empt
There is another tip here in this thread about
set the hidden of line 1 to -1 of field "the field" to false
As a single command, it might be better.
On 30/11/2018 12:07, Kaveh Bazargan via use-livecode wrote:
Thank you guys. I am always embarrassed to ask here as I know the answer is
a one lin
Thank you guys. I am always embarrassed to ask here as I know the answer is
a one liner!!
And Andre the screen was locked already. :-)
On Fri, 30 Nov 2018 at 11:56, Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:
> Hi Andre,
>
> > Am 30.11.2018 um 12:48 schrieb Andre Alves
Klaus,
uhahuahuahuaahuauhahuhuahuahua it took me a while to notice.
On 30/11/2018 11:56, Klaus major-k via use-livecode wrote:
Hi Andre,
Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via use-livecode
:
tied locking the screen first?
tied AND locked?
Andre, you are hardcore! :-D
On 30
Hi Andre,
> Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via use-livecode
> :
>
> tied locking the screen first?
tied AND locked?
Andre, you are hardcore! :-D
> On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
>> I have a text field with some 3500 lines of text. I want to ensu
tied locking the screen first?
On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
I have a text field with some 3500 lines of text. I want to ensure all
lines are visible, as I have hidden some before. I use:
repeat with i = 1 the number of lines of fld 1
set the hidden of line
Try
set the hidden of line 1 to - 1 of field 1 to false
Kind regards
Bernd
From: Kaveh Bazargan
I have a text field with some 3500 lines of text. I want to ensure all
lines are visible, as I have hidden some before. I use:
repeat with i = 1 the number of lines of fld 1
set the hidden o
I have a text field with some 3500 lines of text. I want to ensure all
lines are visible, as I have hidden some before. I use:
repeat with i = 1 the number of lines of fld 1
set the hidden of line i of fld 1 to false
end repeat
This is taking over 1 minute to complete. I have tried removing
35 matches
Mail list logo