353 posts
Location
Orewa, New Zealand
Posted 30 December 2014 - 09:32 AM
In my adventures of instant messaging I want a GUI that displays the messages in a list most recent at the bottom, oldest at the top, depending on the size of the message etc.. I can see problems in it, for instance how would I work out the last message, I thought maybe put all the messages in a table then display the most recent 5 or 6, but the issue of large text remains. Any help on this would be great
For reference I am aiming for something like Skypes IM UI.
Haven't got any code as I've just been messing around and cant really get very far…
1140 posts
Location
Kaunas, Lithuania
Posted 30 December 2014 - 11:42 AM
You're heading to the right direction, the best way is probably just storing messages into a table. Now about multiline messages. You could make a function which would wrap the text around the screen width. Then you would apply some math to calculate which messages and which parts of messages to show according to screen size, scroll value and the messages themselves. I hope this helps to at least get an image about how you should address this problem :)/>
Edited on 30 December 2014 - 10:43 AM
70 posts
Location
Solitude, Skyrim
Posted 03 January 2015 - 05:53 AM
1426 posts
Location
Does anyone put something serious here?
Posted 03 January 2015 - 10:30 AM
There are two implementations I can think of:
The first one is as MKlegoman357 suggested. Just store the messages in a table work out where you should start printing from. This could be harder to work with but probably would run quicker than the alternative.
The (probably) easier solution is to use a buffer of some sort. I wrote a little implementation for ElvishJerricco's ClamShell. This uses an adaptation of Lyqyd's framebuffer. The buffer is
here and example usage can be found
here.