Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Grek
Sweden (12 posts) bio
|
| Date |
Fri 08 Aug 2008 11:54 PM (UTC) [ quote
] Amended on Fri 08 Aug 2008 11:55 PM (UTC) by Grek
|
| Message |
This is what I've managed to produce so far, I'm pretty
satisfied with it.
http://paste.servut.us/tyuk
Still plenty of potential in it I think.
(2am, first night working on this, some stuff still not perfect :)) | top |
|
| Posted by |
Nick Gammon
Australia (18,772 posts) bio
Forum Administrator |
| Date |
Reply #1 on Sat 09 Aug 2008 04:52 AM (UTC) [ quote
] |
| Message |
Looks good, you might want to make helper functions to draw a nice button inside a round rectangle, that shift slightly when you click it, and so on.
A good idea to modularize this stuff. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Grek
Sweden (12 posts) bio
|
| Date |
Reply #2 on Sat 09 Aug 2008 09:34 AM (UTC) [ quote
] |
| Message |
Yeah, lots of work to do :)
A little sample of what I've done so far, http://i34.tinypic.com/rh5qtv.png
Redirecting tells to that window.
TextWindows are created by specifying top and left distance, it's possible to put them in a container window and have the position relatively calculated. thus by moving the container window you automatically move the content as well, will probably be more useful when creating gauges and buttons.
Adding new text is done with the writeline(line) method. | top |
|
| Posted by |
Nick Gammon
Australia (18,772 posts) bio
Forum Administrator |
| Date |
Reply #3 on Sat 09 Aug 2008 09:50 PM (UTC) [ quote
] |
| Message |
You shouldn't have to use a container window. See the way I did help displays here:
http://www.gammon.com.au/forum/?id=8819
To display a lot of text, you just need to cache the text in a table. Then to display a particular page you simply index into the table (eg. if there are 20 lines per page and you want page 3, that is line 60). Then draw the next 20 lines from that point.
The forwards and back arrows, however you draw them (I used a Next and Prev hyperlink, but it could have been arrows on a "scroll bar" on the side) simply add or subtract a page-size from the current position variable.
This method lets you handle massive amounts of text without having to set up large extra windows.
I haven't had time to do it yet, but I envisaged you could make each line a hotspot, and if you clicked on it, it could be selected (ie drawn in inverse) and then copied to the clipboard if wanted.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
1,449 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )