[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Miniwindows
. . -> [Subject]  Miniwindows OOP Approach

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Miniwindows OOP Approach
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date 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
[Go to top] top

Posted by Grek   Sweden  (12 posts)  [Biography] bio
Date 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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date 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
[Go to top] top

Posted by Grek   Sweden  (12 posts)  [Biography] 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 :))
[Go to top] 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,445 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]