NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 75 76 77 78 79 … 93 Next »
splitting a long string into multiple strings

 
  • 0 Vote(s) - 0 Average
splitting a long string into multiple strings
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#31
2005-03-11, 01:53 AM
not a fan of using percentage, rather define a fixed number of pixels. so doesnt matter how big or small the textbox is defined (since its fully skinnable) it will always move up and down the same amount.

is there anyway to calculate how many pages there are? well say how many times the text fills the textbox, would be nice to show
1/3 [pgup][pgdwn]
like i do for the rest. also the percent would come in handy there, just set percent to 100% to jump to next page (which was how i wanted it orginally, but i like the scroll). if couse if there are 2.0000001 pages, it should be rounded up to 3 pages etc.
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#32
2005-03-11, 02:05 AM
You'd have to add this functionality.  

The data is readily available, just not publically exposed.  If you look at the code, the following gets set during render():

vscrollbar.ItemCount = bm.Height;
vscrollbar.ItemsDisplayed = (int)renderArea.Height;
vscrollbar.ScrollIndex = currentScrollY;

So all you need to do is look the these properties of the scrollbar for the current scrolldirection (either the VScrollBar or the HScrollBar).

# of pages: 1 + (int) (itemcount / itemsdisplayed)
current page: 1 + (int) (scrollindex / itemsdisplayed)



JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#33
2005-03-11, 04:57 AM
ok ill add them, and then post the methods i use, so you can update the original source. also ill look into doing a horizontal scrolling textbox, for news tickers or for things that dont completely fit on one line.

theory goes.
create image of text
if width <= maxwidth
>then ok
elseif width>maxwidth
>create two images, one with text another with text with a starting and ending " | ", then just move the position imgA at x=0, imgB at imgA.x+imgA.Width, if imgA.x+imgA.Width <0 imgA.x= imgB.x+imgB.Width, and then repeat for imgB.

should be simple enough, given the source code for the scrollingtextbox.
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#34
2005-03-11, 11:52 AM
Uh, you lost me.

Maybe you didn't realize that this is already a horizontal scrolling textbox too? That's what the ScrollDirection property does (either Horizontal or Vertical).
JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#35
2005-03-11, 12:03 PM
yeah i was thinking something a little lighter, just a one line display that if is longer than the bounds, will just scroll left, and loop with a "|" at the end of the string.
[gbpvr is coo]  (so 4chars max) 1st time
[bpvr is cool] 2nd
[pvr is cool ] 3rd
[vr is cool |] 4th
[r is cool | g] etc. (not defined by char length, but image width, hard to explain).

good for a news ticker on the main menu, or to display filenames, no need for for scroll bars, just repainted every second (or well as often as possible) constantly ticking away.  

only things that need to be defined are
text.Text
text.Font
text.FontColor
text.Shadow = false
text.Scroll = true (
text.ScrollSize (how many pixels it should move)
text.ScrollDirection (left/right).
text.Render(g).
text.Size/Bound/Err whatever you called it before.

now is it more clear? if you want to have a stab at it, let me know, you'd do a much better job at it than me (never actually made a control before).



jrockintuitive
Offline

Senior Member

Posts: 292
Threads: 19
Joined: Dec 2004
#36
2005-03-11, 12:42 PM
Just like a single line text box
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#37
2005-03-11, 12:44 PM
Got it. I'll think about that for a bit--seems like a minor modification to the existing control.
JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#38
2005-03-11, 12:59 PM
might want to rename textbox to textarea and use textbox as the single line one, java does this, i have no idea why c# never did, one thing i prefer in java.
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#39
2005-03-11, 02:52 PM
[b Wrote:Quote[/b] ]
might want to rename textbox to textarea and use textbox as the single line one, java does this, i have no idea why c# never did, one thing i prefer in java.

Ahh...the young Jedi has started his journey to the Dark Side of the Force.
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#40
2005-03-11, 03:04 PM
yes java does have a few good things, but in general c# is better. Tongue

i prefer the java way of doing implements and extends aswell.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (5): « Previous 1 2 3 4 5 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  is there a service?method which returns listings for multiple channels? reven 16 7,309 2022-04-11, 04:30 PM
Last Post: mandai
  Replace characters in strings bgowland 5 2,556 2013-07-06, 03:42 AM
Last Post: mvallevand
  Multiple genres in npvr.db3 bgowland 5 2,887 2013-04-16, 09:53 PM
Last Post: ACTCMS
  Multiple lists like in Search Screen cncb 7 3,378 2012-08-08, 09:11 PM
Last Post: cncb
  Multiple views for a single list imilne 18 5,762 2011-04-22, 11:06 PM
Last Post: sub
  Run Multiple File Conversions On Your 4 Core -Burn Your Processor luttrell1962 12 4,780 2010-03-25, 07:33 AM
Last Post: luttrell1962
  Multiple Instance Conversion Program luttrell1962 0 1,162 2010-02-24, 08:16 PM
Last Post: luttrell1962
  Tunging string question. whurlston 3 1,894 2009-01-02, 04:51 PM
Last Post: whurlston
  multiple instances of a plugin idkpmiller 8 2,861 2008-09-06, 01:48 AM
Last Post: psycik
  How to draw a string in PVRX2? alibert 8 2,814 2007-07-21, 04:41 PM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode