Changeset 9671 for code/branches/libs/src/orxonox
- Timestamp:
- Sep 8, 2013, 7:30:20 PM (11 years ago)
- Location:
- code/branches/libs/src/orxonox/chat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/libs/src/orxonox/chat/ChatInputHandler.cc
r8858 r9671 31 31 #include <cassert> 32 32 #include <string> 33 #include <CEGUIWindow.h> 34 #include <CEGUIWindowManager.h> 35 #include <elements/CEGUIListbox.h> 36 #include <elements/CEGUIListboxItem.h> 37 #include <elements/CEGUIListboxTextItem.h> 33 34 #if CEGUI_VERSION >= 0x000800 35 # include <CEGUI/Window.h> 36 # include <CEGUI/WindowManager.h> 37 # include <CEGUI/widgets/Listbox.h> 38 # include <CEGUI/widgets/ListboxItem.h> 39 # include <CEGUI/widgets/ListboxTextItem.h> 40 #else 41 # include <CEGUIWindow.h> 42 # include <CEGUIWindowManager.h> 43 # include <elements/CEGUIListbox.h> 44 # include <elements/CEGUIListboxItem.h> 45 # include <elements/CEGUIListboxTextItem.h> 46 #endif 38 47 39 48 #include "util/ScopedSingletonManager.h" … … 118 127 119 128 /* GET WINDOW POINTERS */ 129 #if CEGUI_VERSION >= 0x000800 130 input = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/input" ); 131 inputonly = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox-inputonly/input" ); 132 CEGUI::Window *history = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/history" ); 133 #else 120 134 input = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/input" ); 121 135 inputonly = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox-inputonly/input" ); 122 123 /* get pointer to the history window */124 136 CEGUI::Window *history = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/history" ); 137 #endif 125 138 126 139 /* cast it to a listbox */ … … 141 154 // reds 142 155 for( i = 0; i < NumberOfColors/3; ++i ) 143 { this->text_colors[ i ] = CEGUI ::colour( red, green, blue );156 { this->text_colors[ i ] = CEGUIColour( red, green, blue ); 144 157 green += 0.2f, blue += 0.2f; 145 158 } … … 148 161 red = 0.5, green = 1, blue = 0.5; 149 162 for( ; i < NumberOfColors*2/3; ++i ) 150 { this->text_colors[ i ] = CEGUI ::colour( red, green, blue );163 { this->text_colors[ i ] = CEGUIColour( red, green, blue ); 151 164 red += 0.2f, blue += 0.2f; 152 165 } … … 155 168 red = 0.5, green = 0.5, blue = 1; 156 169 for( ; i < NumberOfColors; ++i ) 157 { this->text_colors[ i ] = CEGUI ::colour( red, green, blue );170 { this->text_colors[ i ] = CEGUIColour( red, green, blue ); 158 171 red += 0.2f, green += 0.2f; 159 172 } … … 272 285 { 273 286 /* adjust curser position - magic number 5 for font width */ 274 sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().getWidth()/6), 275 cursorpos, assembled.length() ); 287 #if CEGUI_VERSION >= 0x000800 288 sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().get().getWidth()/6), cursorpos, assembled.length() ); 289 #else 290 sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().getWidth()/6), cursorpos, assembled.length() ); 291 #endif 276 292 this->input->setProperty( "Text", assembled.substr( disp_offset ) ); 277 293 } … … 279 295 { 280 296 /* adjust curser position - magic number 5 for font width */ 281 sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().getWidth()/6), 282 cursorpos, assembled.length() ); 297 #if CEGUI_VERSION >= 0x000800 298 sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().get().getWidth()/6), cursorpos, assembled.length() ); 299 #else 300 sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().getWidth()/6), cursorpos, assembled.length() ); 301 #endif 283 302 this->inputonly->setProperty( "Text", assembled.substr( disp_offset) ); 284 303 } -
code/branches/libs/src/orxonox/chat/ChatInputHandler.h
r8858 r9671 33 33 34 34 #include <string> 35 #include <CEGUIForwardRefs.h> 36 #include <CEGUIcolour.h> 35 36 #if CEGUI_VERSION >= 0x000800 37 # include <CEGUI/ForwardRefs.h> 38 # include <CEGUI/Colour.h> 39 #else 40 # include <CEGUIForwardRefs.h> 41 # include <CEGUIcolour.h> 42 #endif 37 43 38 44 #include "util/Singleton.h" … … 41 47 namespace orxonox // tolua_export 42 48 { // tolua_export 49 50 #if CEGUI_VERSION >= 0x000800 51 typedef CEGUI::Colour CEGUIColour; 52 #else 53 typedef CEGUI::colour CEGUIColour; 54 #endif 55 43 56 /* class to handle chat using an InputBuffer */ 44 57 class _OrxonoxExport ChatInputHandler // tolua_export … … 55 68 /* colors for nickname coloring */ 56 69 static const int NumberOfColors = 10; 57 CEGUI ::colour text_colors[ NumberOfColors ];70 CEGUIColour text_colors[ NumberOfColors ]; 58 71 59 72 /** input state */
Note: See TracChangeset
for help on using the changeset viewer.