[Orxonox-commit 2294] orxonox r7009 - in code/branches/presentation3: data/gui/layouts data/gui/scripts src/orxonox

dafrick at orxonox.net dafrick at orxonox.net
Sun May 30 12:21:32 CEST 2010


Author: dafrick
Date: 2010-05-29 21:56:07 +0200 (Sat, 29 May 2010)
New Revision: 7009

Modified:
   code/branches/presentation3/data/gui/layouts/ChatBox.layout
   code/branches/presentation3/data/gui/scripts/ChatBox.lua
   code/branches/presentation3/src/orxonox/CMakeLists.txt
   code/branches/presentation3/src/orxonox/ChatInputHandler.h
Log:
Enabled the ChatBox to be closed by pressing the close button in the upper right corner of the frame window.


Modified: code/branches/presentation3/data/gui/layouts/ChatBox.layout
===================================================================
--- code/branches/presentation3/data/gui/layouts/ChatBox.layout	2010-05-29 19:33:33 UTC (rev 7008)
+++ code/branches/presentation3/data/gui/layouts/ChatBox.layout	2010-05-29 19:56:07 UTC (rev 7009)
@@ -5,7 +5,7 @@
         <Property Name="InheritsAlpha" Value="False" />
         <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
         <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
-        <Window Type="MenuWidgets/FrameWindow" Name="/ChatBox" >
+        <Window Type="MenuWidgets/FrameWindow" Name="orxonox/ChatBox" >
             <Property Name="Text" Value="Chat" />
             <Property Name="InheritsAlpha" Value="False" />
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
@@ -24,6 +24,7 @@
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="UnifiedAreaRect" Value="{{0.02,0},{1,-30},{0.98,0},{1,-5}}" />
             </Window>
+            <Event Name="CloseClicked" Function="ChatBox.ChatBoxCloseButton_clicked"/>
         </Window>
     </Window>
 </GUILayout>

Modified: code/branches/presentation3/data/gui/scripts/ChatBox.lua
===================================================================
--- code/branches/presentation3/data/gui/scripts/ChatBox.lua	2010-05-29 19:33:33 UTC (rev 7008)
+++ code/branches/presentation3/data/gui/scripts/ChatBox.lua	2010-05-29 19:56:07 UTC (rev 7009)
@@ -1,5 +1,10 @@
 -- ChatBox.lua
 
 local P = createMenuSheet("ChatBox")
+
+function P.ChatBoxCloseButton_clicked(e)
+    orxonox.ChatInputHandler:getInstance():deactivate()
+end
+
 return P
 

Modified: code/branches/presentation3/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/orxonox/CMakeLists.txt	2010-05-29 19:33:33 UTC (rev 7008)
+++ code/branches/presentation3/src/orxonox/CMakeLists.txt	2010-05-29 19:56:07 UTC (rev 7009)
@@ -56,6 +56,7 @@
 ORXONOX_ADD_LIBRARY(orxonox
   FIND_HEADER_FILES
   TOLUA_FILES
+    ChatInputHandler.h
     LevelManager.h
     MoodManager.h
     controllers/HumanController.h

Modified: code/branches/presentation3/src/orxonox/ChatInputHandler.h
===================================================================
--- code/branches/presentation3/src/orxonox/ChatInputHandler.h	2010-05-29 19:33:33 UTC (rev 7008)
+++ code/branches/presentation3/src/orxonox/ChatInputHandler.h	2010-05-29 19:56:07 UTC (rev 7009)
@@ -53,13 +53,12 @@
 #include "../libraries/network/Host.h"
 #include <util/Singleton.h>
 
-
-namespace orxonox
-{
+namespace orxonox // tolua_export
+{ // tolua_export
   /* class to handle chat using an InputBuffer */
-  class _OrxonoxExport ChatInputHandler : public Singleton<ChatInputHandler>,
-    public ChatListener
-  {
+  class _OrxonoxExport ChatInputHandler  // tolua_export
+    : public Singleton<ChatInputHandler>, public ChatListener
+  { // tolua_export
     private:
       /** Input buffer, to be used to catch input from the
        * keyboard 
@@ -102,6 +101,8 @@
       ChatInputHandler();
       friend class Singleton<ChatInputHandler>;
 
+      static ChatInputHandler& getInstance(void) { return Singleton<ChatInputHandler>::getInstance(); }  // tolua_export
+
       /** start listening */
       static void activate_static();
 
@@ -126,12 +127,12 @@
       void activate( bool full );
 
       /** Deactivate the chat window, meaning: hide it. */
-      void deactivate();
+      void deactivate();  // tolua_export
 
-  };
+  };  // tolua_export
 
 
-}
+}  // tolua_export
 
 
 #endif /*_ChatInputHandler_H__*/




More information about the Orxonox-commit mailing list