123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #ifndef CHATWINDOW_H
- #define CHATWINDOW_H
- //===========================================================================//
- //ChatWindow.h : Interface for the ChatWindow component.
- //---------------------------------------------------------------------------//
- // Copyright (C) Microsoft Corporation. All rights reserved. //
- //===========================================================================//
- #ifndef LOGISTICSSCREEN_H
- #include "LogisticsScreen.h"
- #endif
- //*************************************************************************************************
- /**************************************************************************************************
- CLASS DESCRIPTION
- ChatWindow:
- **************************************************************************************************/
- #ifndef ALISTBOX_H
- #include "aListBox.h"
- #endif
- class ChatMessageItem : public aListItem
- {
- public:
- ChatMessageItem();
- void setPlayerColor(long color);
- void setTextColor( long color );
- void setPlayerName( const char* name );
- int setText( const char* text ); // returns number of lines
- long getLineCount() { return lineCount; }
- private:
- aText name;
- aText playerText;
- aRect playerRect;
- long lineCount;
- };
- class ChatWidget : public LogisticsScreen // the one that obscures....
- {
- public:
- ChatWidget();
- virtual ~ChatWidget();
- void init();
- private:
- friend class ChatWindow;
- aListBox listBox;
- ChatMessageItem listItems[128];
- long curItem;
- };
- class ChatWindow: public LogisticsScreen
- {
- public:
- ChatWindow();
- virtual ~ChatWindow();
- static void init();
- static void destroy();
- static ChatWindow* instance() { return s_instance; }
- int initInstance();
- virtual void update();
- virtual void render( int xOffset, int yOffset );
- int handleMessage( unsigned long, unsigned long );
- virtual bool pointInside( long xPos, long yPos );
- bool isExpanded();
- private:
- static ChatWindow* s_instance;
- aListBox listBox;
- aEdit chatEdit;
- ChatWidget chatWidget;
- ChatMessageItem listItems[4];
- long curItem;
- long maxItems;
- static void refillListBox( aListBox& listBox, char** chatTexts, long* playerIDs, ChatMessageItem* pItems,
- long& curItem, long itemCount, long maxCount );
- };
- //*************************************************************************************************
- #endif // end of file ( ChatWindow.h )
|