Chat box

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Chat box

Postby CrazyEddie » Wed Aug 04, 2004 04:50

Hi,

If the confirmation emails are not being sent, it must be a sourceforge oddity. If you email your details I should be able to manually set up your account.

There has been a bit of discussion about chat box style widgets. You could use a MultiLineEditbox in Read-only mode. Possibly your best bet is to use the Listbox for displaying the chat history and an edit box (obviously) for text entry. The basic Listbox text item provided does not word-wrap but it's a trivial thing to write a sub-class that does this.

Static text is due to get multi-line support shortly.

All widgets should work with default construction. Anything else is a bug :shock:

HTH

CE.

User avatar
Injector
Just popping in
Just popping in
Posts: 18
Joined: Wed Jan 12, 2005 12:06

Chat box

Postby Injector » Wed Aug 04, 2004 15:47

Possibly your best bet is to use the Listbox for displaying the chat history


That's what I am doing and it works perfect!. Nice thing is that you can set every text line (i.e. listbox entry) to have a different text color, very handy for a console system (errors display red, warnings orange, infos grey, etc.), or maybe a chatbox? :D

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Chat box

Postby CrazyEddie » Wed Aug 04, 2004 17:47

There are many powerful possibilities, especially if you think outside the (list)box a little (terrible pun, I know :roll:).

You could devise a new ListboxItem that allows you to have more than just a single item of text, and / or colours etc. This way, in a chat system, you can set the name of the player and the chat text for an item, have player names different colours, or whatever. With a tiny bit of effort, there's plenty of variations on what can be achieved, and basically that simple Listbox ends up being something entirely different. I guess the best advice is that you should not be afraid to experiment :)

User avatar
Emmeran
Quite a regular
Quite a regular
Posts: 46
Joined: Wed Jan 12, 2005 12:06
Location: Germany, near Nuremberg
Contact:

Chat box

Postby Emmeran » Wed Oct 27, 2004 18:34

I like the idea of a listbox as a chatbox, because I can change the color of each row... but how can I disable the frame?

btw: is it anyhow possible to change the color of single parts of a line? If not, is it planned for future?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Chat box

Postby CrazyEddie » Thu Oct 28, 2004 09:11

Disabling the frame: This depends :) There's no actual method to disable the frame on a per-control basis at the moment, though if you want to disable the frame on all instances of the widget you could edit the imageset definition and/or image file. Antoher alternative is to copy the copy the code for the listbox widget and create a new version that doesn't draw a frame.

To have multiple colours in an item, you need to create your own ListboxItem based class. Within this class you can do anything you need to, including multiple colours. If I were to need such a thing, and say I wanted the name of the person speaking to be different from the actual chat text, what I would do is have an item with two separate strings; one for the name of the person and the other for the chat text. Then just render these with different colours. There are as many ways of doing this are there are programmers, it's a bit more work than having everything done for you, but it does give the programmer "ultimate power" ;)

CE.

User avatar
Emmeran
Quite a regular
Quite a regular
Posts: 46
Joined: Wed Jan 12, 2005 12:06
Location: Germany, near Nuremberg
Contact:

Chat box

Postby Emmeran » Thu Oct 28, 2004 10:00

well I made a class with color

Code: Select all

class MyListItem : public CEGUI::ListboxTextItem
{
public:
   MyListItem(const CEGUI::String& text, CEGUI::colour color = CEGUI::colour(1,1,1)) : ListboxTextItem(text)
   {
      setSelectionBrushImage((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MultiListSelectionBrush");
      setTextColours(color);
   }
};


wasn't that difficult ;) but now that u said it is possible, I'll search the api, how to color single words best... thx!


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 2 guests