fixed the dialogue history topic selection

pull/21/head
scrawl 13 years ago
parent 3b76f6dcf4
commit 161d519206

@ -49,8 +49,15 @@ DialogueWindow::DialogueWindow(WindowManager& parWindowManager,MWWorld::Environm
//History view //History view
getWidget(history, "History"); getWidget(history, "History");
history->setOverflowToTheLeft(true); history->setOverflowToTheLeft(true);
history->getClient()->eventMouseButtonClick += MyGUI::newDelegate(this, &DialogueWindow::onHistoryClicked);
history->setMaxTextLength(1000000); 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 //Topics list
getWidget(topicsList, "TopicsList"); getWidget(topicsList, "TopicsList");
topicsList->setScrollVisible(true); topicsList->setScrollVisible(true);
@ -68,7 +75,7 @@ DialogueWindow::DialogueWindow(WindowManager& parWindowManager,MWWorld::Environm
void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender) void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender)
{ {
ISubWidgetText* t = history->getSubWidgetText(); ISubWidgetText* t = history->getClient()->getSubWidgetText();
if(t == nullptr) if(t == nullptr)
return; return;

@ -5,7 +5,7 @@
namespace MWGui namespace MWGui
{ {
using namespace MyGUI; using namespace MyGUI;
class DialogeHistory : public MyGUI::Edit class DialogeHistory : public MyGUI::EditBox
{ {
MYGUI_RTTI_DERIVED( DialogeHistory ) MYGUI_RTTI_DERIVED( DialogeHistory )
public: public:

@ -15,6 +15,8 @@
<Property key="Text_FontHeight" value="18"/> <Property key="Text_FontHeight" value="18"/>
<Property key="Edit_MultiLine" value="1" /> <Property key="Edit_MultiLine" value="1" />
<Property key="Edit_VisibleVScroll" value="1" /> <Property key="Edit_VisibleVScroll" value="1" />
<!-- invisible box for receiving mouse events -->
<Widget type="Widget" skin="" position="0 0 400 375" name="EventBox" align="ALIGN_LEFT ALIGN_TOP STRETCH"/>
</Widget> </Widget>
<!-- The disposition bar--> <!-- The disposition bar-->

Loading…
Cancel
Save