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
#21
2005-03-10, 02:07 PM
[b Wrote:Quote[/b] (reven @ Mar. 10 2005,08:01)]...i just threw the source code in with the myvideos source, just in a sub folders, cant be bothered creating a dll myself.
That's a good plan. Then all you should need to do once the library is released is add a reference to the assembly, and then get rid of the widget source code from your project.
JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#22
2005-03-10, 08:51 PM
ok i got the scrolling text box working, i did have to modify the code a little, with the methods available in gbpvr concerning skinning, its not really easy to get a font colour, you can easily get a font brush however (from composite images i mean), so i had to add a property to get/set the fontbrush, and use that brush in the drawstring method. but other than that, its working great, thanks jasonf.
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#23
2005-03-10, 10:48 PM
True, the abstract Brush class does not have a color property, but a SolidBrush does:

(brush as SolidBrush).Color

Just FYI (since there's no documentation yet): Another thing that you could have done is used the SetElement(string) method to set different style properties individually, or Apply(string) to set multiple style properties all at once.  The expected string adheres more-so to HTML/CSS than to the corresponding properties of the controls and/or Style.  This is all part of the work that I'm trying to wrap up on the framework-side of the library.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
       scrollingTextbox.Style.Apply("color:white; border-color:black; border-style:rounded; border-radius: 10;");
       scrollingTextbox.Style.SetElement("font:Arial,14,bold italic");
[/QUOTE]
JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#24
2005-03-10, 11:54 PM
[b Wrote:Quote[/b] ](brush as SolidBrush).Color
ok, yeah i thought it was weird that brush didnt define colour.

whats the memory management like on this, i didnt really look at the code all that much, just wondering if you dispose the images etc in the .Text set property, im using the same textbox, just with different text for a lot of things (well every single movie, just changing the text), also using it for every single actor (ie just 2 different textboxes).
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#25
2005-03-11, 01:32 AM
The image is not cached--it's created during the Render() method, drawn to the graphics object, and then disposed.

Oh, and you probably saw this, but there's a OnKeyDown() method that you can pass the KeyEventArg to from the plugin to handle scrolling when the textbox has focus. In addition, you can &quot;manually&quot; control scrolling using the CursorUp(), CursorDown(), CursorLeft(), and CursorRight() methods.
JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#26
2005-03-11, 01:35 AM
yeah the cursorup/down was to slow, i just manually increment it by 10 pixels when the user pushes page up/down, its not as smooth, but a much quicker.
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#27
2005-03-11, 01:39 AM
i just usedthis
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">/// <summary>
/// Gets or sets the current vertical scroll position, in pixels, of the full rendered string.
/// </summary>
public int CurrentScrollY
{
get { return currentScrollY; }
set { currentScrollY = value; }
}[/QUOTE]
i changed it to this, just as a safety test (you might have already taken care of this, but i didnt want it to crash, or produce weird results
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">/// <summary>
/// Gets or sets the current vertical scroll position, in pixels, of the full rendered string.
/// </summary>
public int CurrentScrollY
{
get { return currentScrollY; }
set { currentScrollY = value;
if(currentScrollY <0)
currentScrollY = 0;
}
}[/QUOTE]
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#28
2005-03-11, 01:40 AM
Did you see the ScrollPercentage property? That's where you adjust the &quot;jump&quot;.

By default, it scrolls 1% of the window size. You can set it to any value from 1-100, with 100 meaning that each scroll will jump the height/width of the window (depending on the scrolldirection).

Where did you manually change it to 10 pixels?
JasonF
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#29
2005-03-11, 01:41 AM
textBox.CurrentScrollY += 10;
textBox.CurrentScrollY -= 10;
jasonf
Offline

Member

Posts: 121
Threads: 7
Joined: Oct 2004
#30
2005-03-11, 01:47 AM
Ah. You can do that, but the better way would be to use CursorUp() and CursorDown(). If the jump is too small, set the ScrollPercentage to maybe 33 (so each scroll will be 1/3 of the control height).

And you would be right to put safety code in the CurrentScrollY property--that's something that I'll need to add.
JasonF
« 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,362 2022-04-11, 04:30 PM
Last Post: mandai
  Replace characters in strings bgowland 5 2,583 2013-07-06, 03:42 AM
Last Post: mvallevand
  Multiple genres in npvr.db3 bgowland 5 2,902 2013-04-16, 09:53 PM
Last Post: ACTCMS
  Multiple lists like in Search Screen cncb 7 3,396 2012-08-08, 09:11 PM
Last Post: cncb
  Multiple views for a single list imilne 18 5,816 2011-04-22, 11:06 PM
Last Post: sub
  Run Multiple File Conversions On Your 4 Core -Burn Your Processor luttrell1962 12 4,801 2010-03-25, 07:33 AM
Last Post: luttrell1962
  Multiple Instance Conversion Program luttrell1962 0 1,170 2010-02-24, 08:16 PM
Last Post: luttrell1962
  Tunging string question. whurlston 3 1,903 2009-01-02, 04:51 PM
Last Post: whurlston
  multiple instances of a plugin idkpmiller 8 2,876 2008-09-06, 01:48 AM
Last Post: psycik
  How to draw a string in PVRX2? alibert 8 2,836 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