Sdk/BaseWidget: Add HasFocus method

This commit is contained in:
Jérôme Leclercq
2017-11-23 13:23:11 +01:00
parent 6c8b3eb319
commit 1601849a00
4 changed files with 23 additions and 2 deletions

View File

@@ -56,6 +56,8 @@ namespace Ndk
inline const Nz::Vector2f& GetContentSize() const;
inline Nz::Vector2f GetSize() const;
bool HasFocus() const;
inline bool IsVisible() const;
virtual void ResizeToContent() = 0;

View File

@@ -35,7 +35,9 @@ namespace Ndk
protected:
inline void ClearKeyboardOwner(std::size_t canvasIndex);
inline bool IsKeyboardOwner(std::size_t canvasIndex) const;
inline void NotifyWidgetBoxUpdate(std::size_t index);
inline void NotifyWidgetCursorUpdate(std::size_t index);

View File

@@ -52,6 +52,11 @@ namespace Ndk
SetKeyboardOwner(InvalidCanvasIndex);
}
inline bool Canvas::IsKeyboardOwner(std::size_t canvasIndex) const
{
return m_keyboardOwner == canvasIndex;
}
inline void Canvas::NotifyWidgetBoxUpdate(std::size_t index)
{
WidgetBox& entry = m_widgetBoxes[index];