From 161d519206ded42f41c3a9a35f83e62a9bb6075d Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 22 Mar 2012 15:01:37 +0100 Subject: [PATCH] fixed the dialogue history topic selection --- apps/openmw/mwgui/dialogue.cpp | 11 +++++++++-- apps/openmw/mwgui/dialogue_history.hpp | 2 +- .../openmw_dialogue_window_layout.xml | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index 8083b3174e..64336cfe00 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -49,8 +49,15 @@ DialogueWindow::DialogueWindow(WindowManager& parWindowManager,MWWorld::Environm //History view getWidget(history, "History"); history->setOverflowToTheLeft(true); - history->getClient()->eventMouseButtonClick += MyGUI::newDelegate(this, &DialogueWindow::onHistoryClicked); history->setMaxTextLength(1000000); + Widget* eventbox; + + //An EditBox cannot receive mouse click events, so we use an + //invisible widget on top of the editbox to receive them + /// \todo scrolling the dialogue history with the mouse wheel doesn't work using this solution + getWidget(eventbox, "EventBox"); + eventbox->eventMouseButtonClick += MyGUI::newDelegate(this, &DialogueWindow::onHistoryClicked); + //Topics list getWidget(topicsList, "TopicsList"); topicsList->setScrollVisible(true); @@ -68,7 +75,7 @@ DialogueWindow::DialogueWindow(WindowManager& parWindowManager,MWWorld::Environm void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender) { - ISubWidgetText* t = history->getSubWidgetText(); + ISubWidgetText* t = history->getClient()->getSubWidgetText(); if(t == nullptr) return; diff --git a/apps/openmw/mwgui/dialogue_history.hpp b/apps/openmw/mwgui/dialogue_history.hpp index ec41678e60..aa4aa1c7cd 100644 --- a/apps/openmw/mwgui/dialogue_history.hpp +++ b/apps/openmw/mwgui/dialogue_history.hpp @@ -5,7 +5,7 @@ namespace MWGui { using namespace MyGUI; - class DialogeHistory : public MyGUI::Edit + class DialogeHistory : public MyGUI::EditBox { MYGUI_RTTI_DERIVED( DialogeHistory ) public: diff --git a/extern/mygui_3.0.1/openmw_resources/openmw_dialogue_window_layout.xml b/extern/mygui_3.0.1/openmw_resources/openmw_dialogue_window_layout.xml index 4a4f8a4ffa..3a0556e01b 100644 --- a/extern/mygui_3.0.1/openmw_resources/openmw_dialogue_window_layout.xml +++ b/extern/mygui_3.0.1/openmw_resources/openmw_dialogue_window_layout.xml @@ -15,6 +15,8 @@ + +