[Orxonox-commit 3856] r8530 - code/trunk/src/libraries/core

landauf at orxonox.net landauf at orxonox.net
Sun May 22 21:51:15 CEST 2011


Author: landauf
Date: 2011-05-22 21:51:15 +0200 (Sun, 22 May 2011)
New Revision: 8530

Modified:
   code/trunk/src/libraries/core/GUIManager.cc
   code/trunk/src/libraries/core/GUIManager.h
Log:
added config value to define the scroll speed in CEGUI listboxes. default 1 line.

Modified: code/trunk/src/libraries/core/GUIManager.cc
===================================================================
--- code/trunk/src/libraries/core/GUIManager.cc	2011-05-22 14:23:40 UTC (rev 8529)
+++ code/trunk/src/libraries/core/GUIManager.cc	2011-05-22 19:51:15 UTC (rev 8530)
@@ -72,6 +72,7 @@
 #include "util/Convert.h"
 #include "util/Debug.h"
 #include "util/Exception.h"
+#include "util/Math.h"
 #include "util/OrxAssert.h"
 #include "ConfigValueIncludes.h"
 #include "Core.h"
@@ -354,6 +355,7 @@
     void GUIManager::setConfigValues(void)
     {
         SetConfigValue(guiScheme_, GUIManager::defaultScheme_) .description("Changes the current GUI scheme.") .callback(this, &GUIManager::changedGUIScheme);
+        SetConfigValue(numScrollLines_, 1).description("How many lines to scroll in a list if the scroll wheel is used");
     }
 
     void GUIManager::changedGUIScheme(void)
@@ -592,7 +594,7 @@
 
     void GUIManager::mouseScrolled(int abs, int rel)
     {
-        this->protectedCall(boost::bind(&CEGUI::System::injectMouseWheelChange, _1, (float)rel));
+        this->protectedCall(boost::bind(&CEGUI::System::injectMouseWheelChange, _1, (float)sgn(rel) * this->numScrollLines_));
     }
 
     /**

Modified: code/trunk/src/libraries/core/GUIManager.h
===================================================================
--- code/trunk/src/libraries/core/GUIManager.h	2011-05-22 14:23:40 UTC (rev 8529)
+++ code/trunk/src/libraries/core/GUIManager.h	2011-05-22 19:51:15 UTC (rev 8530)
@@ -185,6 +185,8 @@
         static const std::string defaultScheme_;
         std::string guiScheme_;
 
+        int numScrollLines_; ///< How many lines to scroll in a list if the scroll wheel is used
+
     }; // tolua_export
 } // tolua_export
 




More information about the Orxonox-commit mailing list