mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-08-04 07:46:40 -04:00
Add scrollbar override to capture mouse hover events
This commit is contained in:
parent
5e7761bef1
commit
b2620c861a
@ -84,6 +84,8 @@ namespace MWGui
|
|||||||
trackFocusEvents(mUntilHealedButton);
|
trackFocusEvents(mUntilHealedButton);
|
||||||
trackFocusEvents(mWaitButton);
|
trackFocusEvents(mWaitButton);
|
||||||
trackFocusEvents(mCancelButton);
|
trackFocusEvents(mCancelButton);
|
||||||
|
for (MyGUI::Widget* widget : mHourSlider->getAllWidgets())
|
||||||
|
trackFocusEvents(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaitDialog::setPtr(const MWWorld::Ptr& ptr)
|
void WaitDialog::setPtr(const MWWorld::Ptr& ptr)
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "timeadvancer.hpp"
|
#include "timeadvancer.hpp"
|
||||||
#include "windowbase.hpp"
|
#include "windowbase.hpp"
|
||||||
#include <components/esm/refid.hpp>
|
#include <components/esm/refid.hpp>
|
||||||
|
#include <components/widgets/scrollbar.hpp>
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
@ -53,7 +54,7 @@ namespace MWGui
|
|||||||
MyGUI::Button* mUntilHealedButton;
|
MyGUI::Button* mUntilHealedButton;
|
||||||
MyGUI::Button* mWaitButton;
|
MyGUI::Button* mWaitButton;
|
||||||
MyGUI::Button* mCancelButton;
|
MyGUI::Button* mCancelButton;
|
||||||
MyGUI::ScrollBar* mHourSlider;
|
Gui::ScrollBar* mHourSlider;
|
||||||
|
|
||||||
TimeAdvancer mTimeAdvancer;
|
TimeAdvancer mTimeAdvancer;
|
||||||
bool mSleeping;
|
bool mSleeping;
|
||||||
|
@ -353,7 +353,7 @@ add_component_dir (myguiplatform
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_component_dir (widgets
|
add_component_dir (widgets
|
||||||
box fontwrapper imagebutton tags list numericeditbox sharedstatebutton windowcaption widgets
|
box fontwrapper imagebutton tags list numericeditbox scrollbar sharedstatebutton windowcaption widgets
|
||||||
)
|
)
|
||||||
|
|
||||||
add_component_dir (fontloader
|
add_component_dir (fontloader
|
||||||
|
17
components/widgets/scrollbar.cpp
Normal file
17
components/widgets/scrollbar.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#include "scrollbar.hpp"
|
||||||
|
|
||||||
|
#include <MyGUI_Button.h>
|
||||||
|
|
||||||
|
namespace Gui
|
||||||
|
{
|
||||||
|
std::vector<MyGUI::Widget*> ScrollBar::getAllWidgets()
|
||||||
|
{
|
||||||
|
std::vector<MyGUI::Widget*> widgets;
|
||||||
|
widgets.push_back(mWidgetStart);
|
||||||
|
widgets.push_back(mWidgetEnd);
|
||||||
|
widgets.push_back(mWidgetTrack);
|
||||||
|
widgets.push_back(mWidgetFirstPart);
|
||||||
|
widgets.push_back(mWidgetSecondPart);
|
||||||
|
return widgets;
|
||||||
|
}
|
||||||
|
}
|
18
components/widgets/scrollbar.hpp
Normal file
18
components/widgets/scrollbar.hpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef OPENMW_COMPONENTS_WIDGETS_SCROLLBAR_H
|
||||||
|
#define OPENMW_COMPONENTS_WIDGETS_SCROLLBAR_H
|
||||||
|
|
||||||
|
#include <MyGUI_ScrollBar.h>
|
||||||
|
|
||||||
|
namespace Gui
|
||||||
|
{
|
||||||
|
/// @brief A scrollbar that can return all its widgets for binding hover listeners.
|
||||||
|
class ScrollBar : public MyGUI::ScrollBar
|
||||||
|
{
|
||||||
|
MYGUI_RTTI_DERIVED(ScrollBar)
|
||||||
|
|
||||||
|
public:
|
||||||
|
std::vector<MyGUI::Widget*> getAllWidgets();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -6,6 +6,7 @@
|
|||||||
#include "imagebutton.hpp"
|
#include "imagebutton.hpp"
|
||||||
#include "list.hpp"
|
#include "list.hpp"
|
||||||
#include "numericeditbox.hpp"
|
#include "numericeditbox.hpp"
|
||||||
|
#include "scrollbar.hpp"
|
||||||
#include "sharedstatebutton.hpp"
|
#include "sharedstatebutton.hpp"
|
||||||
#include "windowcaption.hpp"
|
#include "windowcaption.hpp"
|
||||||
|
|
||||||
@ -26,6 +27,7 @@ namespace Gui
|
|||||||
MyGUI::FactoryManager::getInstance().registerFactory<Gui::Button>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<Gui::Button>("Widget");
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<Gui::ImageButton>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<Gui::ImageButton>("Widget");
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<Gui::NumericEditBox>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<Gui::NumericEditBox>("Widget");
|
||||||
|
MyGUI::FactoryManager::getInstance().registerFactory<Gui::ScrollBar>("Widget");
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<Gui::SharedStateButton>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<Gui::SharedStateButton>("Widget");
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<Gui::WindowCaption>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<Gui::WindowCaption>("Widget");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user