Div.hpp

Div Widgets maintain an ordered collection of other widgets in an HTML div.

When printed to the web page, these internal widgets are presented in order.

To create a Div:

Div my_div(“name”);

To use a Div:

my_div << “Add this text!” << Image(“my_image.png”) << “<br>”;

To register a Div in a Document:

my_doc << my_div;

Todo:

Should we move all widget_dict info into Document?

Note

Formerly called Slate.h

class Div : public internal::WidgetFacet<Div>
#include <Div.hpp>

A widget to track a div in an HTML file, and all of its contents.

Subclassed by Card, CommentBox, ConfigPanel, Document, Element, Modal, ValueBox

Public Types

using INFO_TYPE = internal::DivInfo

Public Functions

inline Div(const std::string &in_name = "")
inline Div(const Div &in)
inline Div(const Widget &in)
inline ~Div()
inline double ScrollTop() const

Where is the top of the scroll region?

inline Div &ScrollTop(double in_top)

Set the scroll position.

inline void Clear()

Clear the contents of this div.

inline void ClearChildren()

Remove all child widgets from this div.

inline bool HasChild(const Widget &test_child) const

Determine if a specified widget is internal to this one.

inline void Deactivate(bool top_level) override

Remove this widget from the current document.

inline Widget &Find(const std::string &test_name)

Get an internal widget to this div, by the specified name.

inline bool HasChild(const std::string &test_name) const

Determine if a specified widget is internal to this one.

inline vector<Widget> &Children()

Get all direct child widgets to this div.

template<class ...T>
inline Animate &AddAnimation(const std::string &name, T&&... args)

Shortcut adder for animations.

inline Animate &Animate(const std::string &in_id)

Protected Functions

inline internal::DivInfo *Info()
inline const internal::DivInfo *Info() const
inline Div(internal::DivInfo *in_info)