Minor fixes

This commit is contained in:
Jérôme Leclercq
2021-11-28 20:19:37 +01:00
parent 0c3bcf6c86
commit 01cd4986cc
20 changed files with 112 additions and 88 deletions

View File

@@ -52,24 +52,24 @@ namespace Nz
inline const Color& GetBackgroundColor() const;
inline Canvas* GetCanvas();
inline Nz::SystemCursor GetCursor() const;
inline SystemCursor GetCursor() const;
inline float GetHeight() const;
inline float GetMaximumHeight() const;
inline Nz::Vector2f GetMaximumSize() const;
inline Vector2f GetMaximumSize() const;
inline float GetMaximumWidth() const;
inline float GetMinimumHeight() const;
inline Nz::Vector2f GetMinimumSize() const;
inline Vector2f GetMinimumSize() const;
inline float GetMinimumWidth() const;
inline float GetPreferredHeight() const;
inline Nz::Vector2f GetPreferredSize() const;
inline Vector2f GetPreferredSize() const;
inline float GetPreferredWidth() const;
inline const Nz::Rectf& GetRenderingRect() const;
inline const Rectf& GetRenderingRect() const;
inline Nz::Vector2f GetSize() const;
inline Vector2f GetSize() const;
inline float GetWidth() const;
inline std::size_t GetWidgetChildCount() const;
@@ -78,26 +78,26 @@ namespace Nz
inline void Hide();
inline bool IsVisible() const;
void Resize(const Nz::Vector2f& size);
void Resize(const Vector2f& size);
void SetBackgroundColor(const Color& color);
void SetCursor(Nz::SystemCursor systemCursor);
void SetCursor(SystemCursor systemCursor);
void SetFocus();
void SetParent(BaseWidget* widget);
inline void SetFixedHeight(float fixedHeight);
inline void SetFixedSize(const Nz::Vector2f& fixedSize);
inline void SetFixedSize(const Vector2f& fixedSize);
inline void SetFixedWidth(float fixedWidth);
inline void SetMaximumHeight(float maximumHeight);
inline void SetMaximumSize(const Nz::Vector2f& maximumSize);
inline void SetMaximumSize(const Vector2f& maximumSize);
inline void SetMaximumWidth(float maximumWidth);
inline void SetMinimumHeight(float minimumHeight);
inline void SetMinimumSize(const Nz::Vector2f& minimumSize);
inline void SetMinimumSize(const Vector2f& minimumSize);
inline void SetMinimumWidth(float minimumWidth);
virtual void SetRenderingRect(const Nz::Rectf& renderingRect);
virtual void SetRenderingRect(const Rectf& renderingRect);
void Show(bool show = true);
@@ -105,32 +105,34 @@ namespace Nz
BaseWidget& operator=(BaseWidget&&) = delete;
protected:
entt::entity CreateEntity();
void DestroyEntity(entt::entity entity);
virtual void Layout();
void InvalidateNode() override;
entt::entity CreateEntity();
void DestroyEntity(entt::entity entity);
inline entt::registry& GetRegistry();
inline const entt::registry& GetRegistry() const;
Nz::Rectf GetScissorRect() const;
void InvalidateNode() override;
Rectf GetScissorRect() const;
virtual bool IsFocusable() const;
virtual void OnFocusLost();
virtual void OnFocusReceived();
virtual bool OnKeyPressed(const Nz::WindowEvent::KeyEvent& key);
virtual void OnKeyReleased(const Nz::WindowEvent::KeyEvent& key);
virtual bool OnKeyPressed(const WindowEvent::KeyEvent& key);
virtual void OnKeyReleased(const WindowEvent::KeyEvent& key);
virtual void OnMouseEnter();
virtual void OnMouseMoved(int x, int y, int deltaX, int deltaY);
virtual void OnMouseButtonPress(int x, int y, Nz::Mouse::Button button);
virtual void OnMouseButtonRelease(int x, int y, Nz::Mouse::Button button);
virtual void OnMouseButtonPress(int x, int y, Mouse::Button button);
virtual void OnMouseButtonRelease(int x, int y, Mouse::Button button);
virtual void OnMouseWheelMoved(int x, int y, float delta);
virtual void OnMouseExit();
virtual void OnParentResized(const Nz::Vector2f& newSize);
virtual void OnParentResized(const Vector2f& newSize);
virtual void OnTextEntered(char32_t character, bool repeated);
virtual void OnTextEdited(const std::array<char, 32>& characters, int length);
inline void SetPreferredSize(const Nz::Vector2f& preferredSize);
inline void SetPreferredSize(const Vector2f& preferredSize);
virtual void ShowChildren(bool show);
@@ -140,7 +142,7 @@ namespace Nz
void DestroyChild(BaseWidget* widget);
void DestroyChildren();
inline bool IsRegisteredToCanvas() const;
inline void NotifyParentResized(const Nz::Vector2f& newSize);
inline void NotifyParentResized(const Vector2f& newSize);
void RegisterToCanvas();
inline void UpdateCanvasIndex(std::size_t index);
void UnregisterFromCanvas();
@@ -149,10 +151,6 @@ namespace Nz
struct WidgetEntity
{
entt::entity handle;
bool isEnabled = true;
//NazaraSlot(Ndk::Entity, OnEntityDisabled, onDisabledSlot);
//NazaraSlot(Ndk::Entity, OnEntityEnabled, onEnabledSlot);
};
static constexpr std::size_t InvalidCanvasIndex = std::numeric_limits<std::size_t>::max();