1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/apps/openmw/mwgui/tooltips.hpp

57 lines
1.4 KiB
C++
Raw Normal View History

2012-04-14 17:47:44 +02:00
#ifndef MWGUI_TOOLTIPS_H
#define MWGUI_TOOLTIPS_H
#include <openengine/gui/layout.hpp>
#include "../mwworld/ptr.hpp"
2012-04-14 17:47:44 +02:00
namespace MWGui
{
2012-04-15 21:14:14 +02:00
class WindowManager;
2012-04-14 17:47:44 +02:00
class ToolTips : public OEngine::GUI::Layout
{
public:
2012-04-15 21:14:14 +02:00
ToolTips(WindowManager* windowManager);
2012-04-14 17:47:44 +02:00
void onFrame(float frameDuration);
void enterGameMode();
void enterGuiMode();
void setFocusObject(const MWWorld::Ptr& focus);
2012-04-14 17:47:44 +02:00
void adjustScreen(int screenWidth, int screenHeight);
private:
MyGUI::EditBox* mTextToolTip;
MyGUI::Widget* mTextToolTipBox;
MyGUI::Widget* mDynamicToolTipBox;
2012-04-15 21:14:14 +02:00
WindowManager* mWindowManager;
MWWorld::Ptr mFocusObject;
2012-04-15 21:14:14 +02:00
void findImageExtension(std::string& image);
MyGUI::IntSize getToolTipViaPtr ();
///< @return requested tooltip size
MyGUI::IntSize createImageToolTip(const std::string& caption, const std::string& image, const std::string& text);
///< @return requested tooltip size
MyGUI::IntSize createToolTip(const std::string& caption, const std::string& text);
///< @return requested tooltip size
std::string getValueString(const int value);
///< get "Value: X" string or "" if value is 0
std::string toString(const float value);
std::string toString(const int value);
2012-04-14 17:47:44 +02:00
bool mGameMode;
};
}
#endif