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
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#41
2005-03-11, 03:17 PM
I think Java went with 2 separate controls simply because HTML did. Microsoft "visual" languages have always only had 1 textbox control, and it used a Multiline property to switch modes.

Anyways, reven, I'll PM you the improved code for the scrolling textbox with a "UseWrapping" property. I only implemented wrapping at the end of text, not the beginning (so you can scroll down or to the right all that you want, but if you scroll to the left or up, it will stop at the beginning of text).
JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#42
2005-03-12, 04:16 AM
ok scrolling works great with strings that are wider than the screenarea, but for strings that are less, there are weird results. is there anyway to check if the string is longer than the screen area and thus needs to be scrolled?

on a side note i had to setup a seperate thread to calll a forcerepaint 5 times a second, otherwise the scrolling looked all jerky, gbpvrs fault, not the scrollingtextbox, i have no idea how this will effect the mvp.
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#43
2005-03-12, 11:57 AM
Subtle jerkiness is one side effect that you're not going to be able to get away from, even if you write a standalone program with scrolling. Ever see a <marquee> tag in IE? Or the scrolling text screensaver? It's jerky because you can't stop other threads in Windows from message handling, which gets a higher priority than screen refreshing.

And using a separate thread to force a refresh (not sure how you even did that) probably violates Sub's plugin architecture design. He only provides the needsRendering() method for 1-second updates and the requiresMoreRendering output parameter to have render called again immediately (but that's not intended for endless rendering loops).

So, you're likely stuck with the 1-second updates (big jerkiness), or having the user manually scroll that control.


As for text that's too short for the control--never anticipated that from happening, especially if the rendered width is, say, less than half of the control width, where you'll end up with 3 or more images that would have to be displayed at the same time.
JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#44
2005-03-12, 12:48 PM
some tag lines are like
a. [Every superhero has a beginning...] (Smallville)
b. [The world's super hero in his toughest adventure yet!] (Superman III)
and the text width is about
[_._._._._._._._._._._._._._._._._._._._._._._.]
so (a) shouldnt scroll at all, just display the whole thing, but (b) should scroll.  also is it possible to set a split char inbetween the repeating string eg
The world's super hero in his toughest adventure yet! | The world's super hero in his toughest adventure yet!


theres a ForceRepaint method in the pluginHelper factory, i just created a thread to that called that every 200ms (well called, slept for 200).  didnt like the results, scrolling was good, but to many variables to keep track of, the thread could run forever, and every time the ForceRepaint method is called, a line is printed out in the gbpvr.exe.log file.



jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#45
2005-03-12, 02:10 PM
The easiest way I can think of is during render(), after the bitmap is created and the size is calculated, to turn off wrapping if the size is smaller than the renderarea.

In the external code that sets the text, you just simply always enable wrapping whenever the text changes. If the text is too small, then wrapping will be automatically disabled.
JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#46
2005-03-12, 02:18 PM
yeah i thought it would have to be placed in there, since thats where the image is created and the size is calculated, the best thing would be then if the image is large, when the second image is created start and end it with the split char. eg
first image = "abcdef"
2nd image = " | abcdef | "


just wondering what will happen in the cursorright method, since this is being drawn once every second, what happens if the image doesnt need to scroll? will it just not scroll?
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  is there a service?method which returns listings for multiple channels? reven 16 6,793 2022-04-11, 04:30 PM
Last Post: mandai
  Replace characters in strings bgowland 5 2,395 2013-07-06, 03:42 AM
Last Post: mvallevand
  Multiple genres in npvr.db3 bgowland 5 2,811 2013-04-16, 09:53 PM
Last Post: ACTCMS
  Multiple lists like in Search Screen cncb 7 3,216 2012-08-08, 09:11 PM
Last Post: cncb
  Multiple views for a single list imilne 18 5,374 2011-04-22, 11:06 PM
Last Post: sub
  Run Multiple File Conversions On Your 4 Core -Burn Your Processor luttrell1962 12 4,520 2010-03-25, 07:33 AM
Last Post: luttrell1962
  Multiple Instance Conversion Program luttrell1962 0 1,108 2010-02-24, 08:16 PM
Last Post: luttrell1962
  Tunging string question. whurlston 3 1,803 2009-01-02, 04:51 PM
Last Post: whurlston
  multiple instances of a plugin idkpmiller 8 2,674 2008-09-06, 01:48 AM
Last Post: psycik
  How to draw a string in PVRX2? alibert 8 2,635 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