Show Truncated list of values and NumProgressBar
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Show Truncated list of values and NumProgressBar
Hi All,
i needed one « stShowTruncNumProgress » (others name are welcome) to show progress trough a list of number with progressBar and one truncated list if needs.
I use a function getMyref(nbMax,CurNum)
put getMyref(2134,7) return "1…678…2134" and "7" looks textstyle "Box"
put getMyref(2134,2133) return "1 … 2132 2133 2134" and "2133" looks textstyle "Box"
put getMyref(2134,3)return « 1 2 3 4 … 2134 » and "3" looks textstyle "Box"
We can refresh progressbar and line of numbers with
1. clic on btn "bSetNumElementBar" or type return
2. clic on "…" or a number of numbers line
3. clic on progressbar (this works fine, except that it is not easy to select nbMax if nbMax > 200)
I feel that we can find simpler way to do the same
Here is the stack
Best regards
Jean-Marc
i needed one « stShowTruncNumProgress » (others name are welcome) to show progress trough a list of number with progressBar and one truncated list if needs.
I use a function getMyref(nbMax,CurNum)
put getMyref(2134,7) return "1…678…2134" and "7" looks textstyle "Box"
put getMyref(2134,2133) return "1 … 2132 2133 2134" and "2133" looks textstyle "Box"
put getMyref(2134,3)return « 1 2 3 4 … 2134 » and "3" looks textstyle "Box"
We can refresh progressbar and line of numbers with
1. clic on btn "bSetNumElementBar" or type return
2. clic on "…" or a number of numbers line
3. clic on progressbar (this works fine, except that it is not easy to select nbMax if nbMax > 200)
I feel that we can find simpler way to do the same
Here is the stack
Best regards
Jean-Marc
- Attachments
-
- stNbPageProgresBar001.livecode.zip
- (2.88 KiB) Downloaded 176 times
https://alternatic.ch
Re: Show Truncated list of values and NumProgressBar
I think that It's better to create 3 different labels, then work on item 2 of center field.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Show Truncated list of values and NumProgressBar
Hi Max,
Thanks for reply.
I thought the same but using only one fld seems easier. With three labels we have to manage width of each label.
Best regards
Jean-Marc
Thanks for reply.
I thought the same but using only one fld seems easier. With three labels we have to manage width of each label.
Best regards
Jean-Marc
https://alternatic.ch
Re: Show Truncated list of values and NumProgressBar
Well,
then just use (item or word, it depends if you want to use commas to separate numbers)
then just use (item or word, it depends if you want to use commas to separate numbers)
Code: Select all
lock screen
set the textStyle of word 1 to -1 of field "myField" to "plain"
set the backgroundcolor of word 1 to -1 of field "myField" to empty
set the textstyle of item 2 of field "myField" to "box"
set the backgroundcolor of item 2 of field "myField" to orange
unlock screen
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Show Truncated list of values and NumProgressBar
Sorry Max,
I was not clear.
Colorising is not a problem.
Did you try the stack ?
The stack contains a large script that i want simplify
I was not clear.
Colorising is not a problem.
Did you try the stack ?
The stack contains a large script that i want simplify
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Show Truncated list of values and NumProgressBar
Hi Jean-Marc,
this is a very nice idea.
You ask for options to shorten the script. Here is a function that may be an option for creating the same truncated text:
To avoid the click problems with the graphic, TMHO a scrollbar would be more appropriate. With that you can increase the value by one also at the "ends" by clicking the bar.
To see what I mean, find attached your stack with a changed script of totally < 70 lines (which moreover uses "textChanged" for the "number-input-control").
Hermann
this is a very nice idea.
You ask for options to shorten the script. Here is a function that may be an option for creating the same truncated text:
Code: Select all
-- x is the current Number, mx is the maximal number
function setNumElementBar x, mx
if mx <= 10 then return word 1 to mx of "1 2 3 4 5 6 7 8 9 10"
put max(1,x-1) into x0; put min(mx,x+1) into x1
put x0 into m
repeat with i=x0+1 to x1
put space & i after m
end repeat
if x0 > 2 then put "1 ... " before m
else if x0 > 1 then put "1 " before m
if x1 < mx-1 then put " ... " & mx after m
else if x1 < mx then put " " & mx after m
return m
end setNumElementBar
To see what I mean, find attached your stack with a changed script of totally < 70 lines (which moreover uses "textChanged" for the "number-input-control").
Hermann
- Attachments
-
- stNbPageProgresBar001c.livecode.zip
- (2.27 KiB) Downloaded 186 times
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Show Truncated list of values and NumProgressBar
Hi Hermann,
Thank you
When i coded it I thougt that is a stuff for hh.
I'll leave early tomorow morning. I'll study it tomorrow evening
Jean-Marc
Thank you
When i coded it I thougt that is a stuff for hh.
I'll leave early tomorow morning. I'll study it tomorrow evening
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Show Truncated list of values and NumProgressBar
Guten morgen Hermann,
Thanks again, it works fine
I learn a lot each time you suggest something.
I need this for cards "Listes de pictos" and "Mes phrases" of EcrireEnPictos to make more visible the progress between pages
Yes. For "ordinary people" whose are able to maintains the mouse button to down and move and good capacity to point with finger for mobile version.
Best regards
Jean-Marc
Thanks again, it works fine
I learn a lot each time you suggest something.
I need this for cards "Listes de pictos" and "Mes phrases" of EcrireEnPictos to make more visible the progress between pages
Code: Select all
scrollbar would be more appropriate
Best regards
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Show Truncated list of values and NumProgressBar
Hi Jean-Marc.
I forgot that you are serving *all* platforms. May be at the end of this year even a HTML5 standalone is (easier) possible for your great (yes, great!) work?
For the current subject I like most your idea to have that field where all displayed numbers (first, prev, current, next, last) are clickable/touchable.
This approach alone is a main tool for going in row forth and back through a list of pictures.
I'll put this into my "object library".
What do you think of using "<<" and ">>" instead of "...", and a mouseDown on these in the field steps faster in direction of the first or last object? Say by stepping -4 down or 4 up respectively?
Hermann
I forgot that you are serving *all* platforms. May be at the end of this year even a HTML5 standalone is (easier) possible for your great (yes, great!) work?
For the current subject I like most your idea to have that field where all displayed numbers (first, prev, current, next, last) are clickable/touchable.
This approach alone is a main tool for going in row forth and back through a list of pictures.
I'll put this into my "object library".
What do you think of using "<<" and ">>" instead of "...", and a mouseDown on these in the field steps faster in direction of the first or last object? Say by stepping -4 down or 4 up respectively?
Hermann
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Show Truncated list of values and NumProgressBar
Hi Hermann,
I'll do that.
It should be useful for others and I think to publish it to revOnline.
Do you have an idea how call this stuff ?
Jean-Marc
A good suggest againWhat do you think of using "<<" and ">>" instead of "...", and a mouseDown on these in the field steps faster in direction of the first or last object? Say by stepping -4 down or 4 up respectively?
I'll do that.
It should be useful for others and I think to publish it to revOnline.
Do you have an idea how call this stuff ?
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Show Truncated list of values and NumProgressBar
Perhaps "progress field" is a descriptive name?
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Show Truncated list of values and NumProgressBar
Here is a stack "ProgressField001" with "<<" and ">>" for -4 +4. I add a mousedown to hilite the choosed word and mouserelease script to unhilite choosed word.
Jean-Marc
Jean-Marc
- Attachments
-
- ProgressField001.zip
- (2.47 KiB) Downloaded 175 times
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Show Truncated list of values and NumProgressBar
Hi Jean-Marc.
I like it and it really should be better visible (livecodeshare/revOnline).
One more proposal:
You hard-code the "4". It could also be a local variable tStep or somehow derived from the maximal number (fld "fNumElement") or editable in an additional field?
For example
put max(3, fld "fNumElement" div 32) into tStep
put max(3, fld "tStepElement") into tStep
Hermann
I like it and it really should be better visible (livecodeshare/revOnline).
One more proposal:
You hard-code the "4". It could also be a local variable tStep or somehow derived from the maximal number (fld "fNumElement") or editable in an additional field?
For example
put max(3, fld "fNumElement" div 32) into tStep
put max(3, fld "tStepElement") into tStep
Hermann
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Show Truncated list of values and NumProgressBar
Hi Hermann,
Jean-Marc
Here is a stack "FieldProgress002" with an editable field "fStep". It seems that is the best way to let the control to the userYou hard-code the "4". It could also be a local variable tStep or somehow derived from the maximal number (fld "fNumElement") or editable in an additional field?
Jean-Marc
- Attachments
-
- ProgressField002.zip
- (2.76 KiB) Downloaded 182 times
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 474
- Joined: Thu Sep 04, 2008 6:23 am
- Location: Melbourne Australia
Re: Show Truncated list of values and NumProgressBar
missing from the max value field...
else setting the value here to more than 100 is not reflected in the values of the scroller.
Of course this could be moved to the card script somewhere.
Code: Select all
on closeField
set the endvalue of scrollbar "sbCurElement" to me
end closeField
Of course this could be moved to the card script somewhere.