Polyphase Game Engine
Loading...
Searching...
No Matches
ListViewItemWidget.h
Go to the documentation of this file.
1#pragma once
2
4
6
8{
9public:
10
12
13 virtual void Create() override;
14 virtual void Tick(float deltaTime) override;
15
16 // Index in parent ListView
17 void SetIndex(int32_t index);
18 int32_t GetIndex() const;
19
20 // Parent ListView reference
21 void SetListView(ListViewWidget* listView);
22 ListViewWidget* GetListView() const;
23
24 // Content widget (the instantiated template)
25 void SetContentWidget(Widget* widget);
26 Widget* GetContentWidget() const;
27
28 // Selection state
29 void SetSelected(bool selected);
30 bool IsSelected() const;
31
32 // Hover state
33 bool IsHovered() const;
34
35protected:
36
37 void HandlePointerEvents();
38
39 int32_t mIndex = -1;
40 ListViewWidget* mListView = nullptr;
41 Widget* mContentWidget = nullptr;
42 bool mSelected = false;
43 bool mHovered = false;
44 bool mWasHovered = false;
45};
#define POLYPHASE_API
Definition PolyphaseAPI.h:31
Definition ListViewItemWidget.h:8
DECLARE_NODE(ListViewItemWidget, Widget)
Definition ListViewWidget.h:13
virtual void Create()
Definition Node.cpp:220
virtual void Tick(float deltaTime)
Definition Node.cpp:558
Definition Widget.h:53