[Bugfix] EditorFramework\ListBoxDataControl

Transporter

31-07-2012 15:32:25

There is a fundamental error in rev 5043:

2>------ Build started: Project: EditorFramework, Configuration: Debug x64 ------
2>Build started 31.07.2012 16:04:44.
2>InitializeBuildStatus:
2> Touching "EditorFramework.dir\Debug\EditorFramework.unsuccessfulbuild".
2>CustomBuild:
2> All outputs are up-to-date.
2>ClCompile:
2> All outputs are up-to-date.
2> ListBoxDataControl.cpp
2>c:\work\ogre\addons\mygui\tools\editorframework\Control.h(18): warning C4275: non dll-interface class 'wraps::BaseLayout' used as base for dll-interface class 'tools::Control'
2> C:\Work\OGRE\Addons\MyGUI\Common\BaseLayout/BaseLayout.h(18) : see declaration of 'wraps::BaseLayout'
2> c:\work\ogre\addons\mygui\tools\editorframework\Control.h(17) : see declaration of 'tools::Control'
2>C:\Work\OGRE\Addons\MyGUI\Tools\EditorFramework\ListBoxDataControl.cpp(183): error C2039: 'getViewHeight' : is not a member of 'MyGUI::Gui'
2> c:\work\ogre\addons\mygui\myguiengine\include\MyGUI_Gui.h(38) : see declaration of 'MyGUI::Gui'
2>C:\Work\OGRE\Addons\MyGUI\Tools\EditorFramework\ListBoxDataControl.cpp(185): error C2039: 'getViewWidth' : is not a member of 'MyGUI::Gui'
2> c:\work\ogre\addons\mygui\myguiengine\include\MyGUI_Gui.h(38) : see declaration of 'MyGUI::Gui'
2>
2>Build FAILED.
2>
2>Time Elapsed 00:00:00.77

ListBoxDataControl::notifyItem
MyGUI::IntPoint point = MyGUI::IntPoint(_info.x, _info.y);
if ((_info.y + mContextMenu->getHeight()) >= MyGUI::Gui::getInstance().getViewHeight())
point.top -= mContextMenu->getHeight();
if ((_info.x + mContextMenu->getWidth()) >= MyGUI::Gui::getInstance().getViewWidth())
point.left -= mContextMenu->getWidth();

The solution:
MyGUI::IntPoint point = MyGUI::IntPoint(_info.x, _info.y);
if ((_info.y + mContextMenu->getHeight()) >= MyGUI::RenderManager::getInstance().getViewSize().height)
point.top -= mContextMenu->getHeight();
if ((_info.x + mContextMenu->getWidth()) >= MyGUI::RenderManager::getInstance().getViewSize().width)
point.left -= mContextMenu->getWidth();


I can't append the patch file:
Sorry, the board attachment quota has been reached.
Index: Tools/EditorFramework/ListBoxDataControl.cpp
===================================================================
--- Tools/EditorFramework/ListBoxDataControl.cpp (Revision 5043)
+++ Tools/EditorFramework/ListBoxDataControl.cpp (Arbeitskopie)
@@ -180,9 +180,9 @@
if (mContextMenu->getChildCount() != 0)
{
MyGUI::IntPoint point = MyGUI::IntPoint(_info.x, _info.y);
- if ((_info.y + mContextMenu->getHeight()) >= MyGUI::Gui::getInstance().getViewHeight())
+ if ((_info.y + mContextMenu->getHeight()) >= MyGUI::RenderManager::getInstance().getViewSize().height)
point.top -= mContextMenu->getHeight();
- if ((_info.x + mContextMenu->getWidth()) >= MyGUI::Gui::getInstance().getViewWidth())
+ if ((_info.x + mContextMenu->getWidth()) >= MyGUI::RenderManager::getInstance().getViewSize().width)
point.left -= mContextMenu->getWidth();

mContextMenu->setPosition(point.left, point.top);

Altren

31-07-2012 18:55:39

Thank you. Fixed.