Charmed Quark Systems
Google
WWW CharmedQuark.com

Go Back   Charmed Quark Systems > General Discussion > Beta Driver Development
Register FAQ Members List Calendar Mark Forums Read

Beta Driver Development Discussion of new drivers, finding someone to write a new driver, etc...

Reply
 
Thread Tools Display Modes
  #1  
Old 03-17-2010, 04:31 PM
jkish jkish is offline
 
Join Date: May 2007
Posts: 1,689
Default TextPager Driver

I mentioned in an earlier thread that I had an idea for a partial solution to the need for scrolling text boxes. I've built a driver that will break a text string into pages based on a given number of characters per page and let you page through them.

The driver has just a few fields:

Text: String RW - This is the whole string that you wish to break into pages
Page: String R - This is the contents of the current page
CurrentPageNumber: Card R/W - The current page number
PageCount: Card R - Total Number of pages
CharactersPerPage: Card R/W - Number of characters per page
Scroll: (Next, Prev, Beginning, End) - Action command to move through the pages

The driver attempts to break pages at white space when it can.

To use this, set the CharactersPerPage to the amount that will fit in your TextField Widget given its width, height, and font settings. This probably requires some experimentation. Then, set the Text field with the text contents that you want to break into pages.

This should then result in PageCount reflecting the total number of pages and Page containing the first page. If your TextField widget is then associated with the Page field of the TextPager, the Scroll command will move you through the pages of the text. You can also set the value of CurrentPageNumber to move to a given page.

I've done some limited testing and all seems well, but let me know if you find any problems.
Attached Files
File Type: cqcdrvpack TextPager.CQCDrvPack (3.6 KB, 22 views)
Reply With Quote
  #2  
Old 03-17-2010, 07:14 PM
DaveB DaveB is offline
 
Join Date: Mar 2005
Location: Mays Landing, NJ
Posts: 1,464
Default

Perfect! I will give it a good test and let you know.
__________________
Thanks,

Dave
Reply With Quote
  #3  
Old 03-18-2010, 04:51 AM
SamVimes2 SamVimes2 is offline
 
Join Date: Oct 2005
Location: New York, New York
Posts: 1,291
Default

This seems perfect for the smaller screens I've been working with. Will test and comment.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:29 AM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.