 |
Gorgon Game Engine
|
Go to the documentation of this file.
4 #include "../UI/ComponentStackWidget.h"
5 #include "../Property.h"
9 namespace Gorgon {
namespace Widgets {
15 template <
class T_,
void (*TW_)(const T_ &, ListItem &),
class L_>
21 template <
class ...A_>
25 List.Add(std::forward<A_>(elms)...);
47 list.SetOverscroll(0.5);
50 template <
class ...A_>
53 List.Add(std::forward<A_>(elms)...);
62 typename ListType::ListBase &
List;
89 list.Move(res.CoordinatesInExtender.X, res.CoordinatesInExtender.Y +
GetHeight());
91 list.FitHeight(res.TotalSize.Height-
list.GetLocation().Y);
92 res.Extender->Add(
list);
151 template <
class T_,
void (*TW_)(const T_ &, ListItem &),
class L_>
159 template <
class ...A_>
163 this->
list.Add(std::forward<A_>(elms)...);
176 this->
list.ChangedEvent.Register([
this]() {
177 if(this->
list.HasSelectedItem()) {
178 TW_(this->
list.GetSelectedItem(), *
this);
190 template <
class ...A_>
193 this->
list.Add(std::forward<A_>(elms)...);
199 if(this->
list.HasSelectedItem()) {
200 TW_(this->
list.GetSelectedItem(), *
this);
211 this->
list.SetSelectedItem(value);
218 this->
list.SetSelectedIndex(index);
222 operator const T_ &()
const {
223 return this->
list.GetSelectedItem();
229 return this->
list.GetSelectedItem();
236 template <
class T_,
void (*TW_)(const T_ &, ListItem &) =
internal::SetTextUsingFrom<T_, ListItem>>
239 template <
class T_,
void (*TW_)(const T_ &, ListItem &) =
internal::SetTextUsingFrom<T_, ListItem>>
This class provides event mechanism.
Definition: Event.h:134
This class stores visual information about a widget template.
Definition: Template.h:392
@ Opened
This condition is triggered when the widget is opened like a combobox showing its list part.
Definition: Template.h:213
void RemoveCondition(ComponentCondition condition, bool transition=true)
Removes a condition and its associated components.
Definition: ComponentStack.h:54
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
void SetFrameEvent(std::function< void()> handler)
Sets a function to be called before update check.
Definition: ComponentStack.h:413
@ ListTag
Definition: Template.h:879
void RemoveFrameEvent()
Removes the function that will be called before update check.
Definition: ComponentStack.h:433
void AddCondition(ComponentCondition condition, bool transition=true)
Adds a condition and its associated components to the stack.
Definition: ComponentStack.h:48
void SetClickEvent(std::function< void(ComponentTemplate::Tag, Geometry::Point, Input::Mouse::Button)> handler)
Sets the mouse down event.
Definition: ComponentStack.h:490
@ Active
This is for widgets that can be activated, like a count down timer.
Definition: Template.h:245
const Template & GetTemplate() const
Returns the template used by this stack.
Definition: ComponentStack.h:256
void NotImplemented(const std::string &what="This feature")
Definition: Assert.h:187