Flexbox layout engine. More...
#include <Flexbox.hpp>
Public Member Functions | |
virtual | ~Flexbox (void) |
Destructor. More... | |
Flexbox (void) | |
Constructor. More... | |
virtual Flexbox & | set (const EDirection d) |
virtual Flexbox & | set (const EWrap w) |
virtual Flexbox & | set (const EJustifyContent j) |
virtual Flexbox & | set (const EAlignItems a) |
virtual Flexbox & | set (const EAlignContent a) |
virtual Flexbox & | add_child (const FlexItem &item) |
Make a copy of item and pushes it into the vector items. More... | |
virtual Flexbox & | perform_layout (const int width, const int height) |
virtual | operator GtkLayout * (void) const |
Convert an instance of nocl::Layout to GtkLayout* . More... | |
virtual Layout & | add_child (GUIComponent &child) override |
Inherited from Container. More... | |
virtual Layout & | add_child (GUIComponent &child, const int x, const int y) |
virtual Layout & | move_child (GUIComponent &child, const int x, const int y) |
virtual | operator GtkContainer * (void) const |
Convert an instance of Container to GtkContainer* . More... | |
virtual Container & | remove_child (GUIComponent &child) |
Remove a child component from this container. More... | |
virtual | operator GtkWidget * (void) const |
Convert an instance of GUIComponent to GtkWidget* . More... | |
virtual GUIComponent & | move_to (const Point &p) |
Move to the specified coordinates. More... | |
virtual Size | natural_size (void) |
Get the natural size of a widget. More... | |
virtual Size | minimum_size (void) |
Get the minimum size of a widget. More... | |
virtual GUIComponent & | minimum_size (const Size &s) |
Set the minimum size of a widget. More... | |
virtual GUIComponent & | minimum_size (const int width, const int height) |
Set the minimum size of a widget. More... | |
virtual GUIComponent & | show (const bool toggle=true) |
Make the immediate component visible. More... | |
virtual GUIComponent & | show_all (const bool toggle=true) |
Make the component and all child components visible. More... | |
virtual GUIComponent & | hide (void) |
Hide a single component. More... | |
virtual bool | is_visible (void) const |
Determine if the widget is shown. More... | |
Static Public Member Functions | |
static WidgetToGUIComponentMap & | widget_to_gui_component_map (void) |
There are times when we have a pointer to a Gtk+ widget, and we need to map it back to the corresponding NOCL GUI component. More... | |
Public Attributes | |
EDirection | direction |
EWrap | wrap |
EJustifyContent | justify_content |
EAlignItems | align_items |
EAlignContent | align_content |
MMFlexItems | items |
std::set< GUIComponent * > | children |
Keep track of all children that have been added to this container. More... | |
Container * | parent |
Pointer to the parent to which we've been added. Will be nullptr if this object hasn't been added to a parent container. More... | |
GtkWidget * | gtk_widget |
Pointer to the underlying GTK framework. More... | |
Protected Member Functions | |
virtual Flexbox & | add_children_to_parent (GUIComponent *child) |
Flexbox layout engine.
|
strong |
From https://css-tricks.com/snippets/css/a-guide-to-flexbox/.
Enumerator | |
---|---|
kRow | Left to right (default value). |
kRowReverse | Right to left. |
kColumn | Top to bottom. |
kColumnReverse | Bottom to top. |
|
strong |
From https://css-tricks.com/snippets/css/a-guide-to-flexbox/.
|
strong |
From https://css-tricks.com/snippets/css/a-guide-to-flexbox/.
|
strong |
From https://css-tricks.com/snippets/css/a-guide-to-flexbox/.
|
strong |
From https://css-tricks.com/snippets/css/a-guide-to-flexbox/.
|
virtual |
Destructor.
nocl::Flexbox::Flexbox | ( | void | ) |
Constructor.
|
virtual |
References direction.
|
virtual |
References wrap.
|
virtual |
References justify_content.
|
virtual |
References align_items.
|
virtual |
References align_content.
|
virtual |
Make a copy of item
and pushes it into the vector items.
item
after this call will be ignored since Flexbox
makes a copy and does not store a reference to the original object.At the time the layout is performed, the items will be processed in the order described by FlexItem::order.
References add_children_to_parent(), nocl::FlexItem::child, items, and nocl::FlexItem::order.
|
virtual |
|
protectedvirtual |
References nocl::Layout::add_child(), and items.
Referenced by add_child().
|
virtualinherited |
Convert an instance of nocl::Layout to GtkLayout*
.
nocl::Exception | Object was not created correctly and cannot be converted to GtkLayout*. |
References nocl::GUIComponent::gtk_widget, and NOCL_WHERE.
|
overridevirtualinherited |
Inherited from Container.
Reimplemented from nocl::Container.
Referenced by add_children_to_parent().
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
Convert an instance of Container to GtkContainer*
.
nocl::Exception | Object was not created correctly and cannot be converted to GtkContainer*. |
References nocl::GUIComponent::gtk_widget, and NOCL_WHERE.
|
virtualinherited |
Remove a child component from this container.
References nocl::Container::children, and nocl::GUIComponent::parent.
Referenced by nocl::Container::add_child(), nocl::Grid::add_child(), nocl::Container::~Container(), and nocl::GUIComponent::~GUIComponent().
|
virtualinherited |
Convert an instance of GUIComponent to GtkWidget*
.
References nocl::GUIComponent::gtk_widget.
|
virtualinherited |
Move to the specified coordinates.
|
virtualinherited |
Get the natural size of a widget.
References nocl::GUIComponent::minimum_size().
Referenced by nocl::GUIComponent::minimum_size().
|
virtualinherited |
Get the minimum size of a widget.
References nocl::GUIComponent::natural_size().
Referenced by nocl::GUIComponent::minimum_size(), and nocl::GUIComponent::natural_size().
|
virtualinherited |
Set the minimum size of a widget.
References nocl::Size::height, nocl::GUIComponent::minimum_size(), and nocl::Size::width.
|
virtualinherited |
Set the minimum size of a widget.
|
virtualinherited |
Make the immediate component visible.
[in] | toggle | Set to true to show the widget, or to false to hide the widget. |
References nocl::GUIComponent::gtk_widget, and nocl::GUIComponent::hide().
|
virtualinherited |
Make the component and all child components visible.
[in] | toggle | Set to true to show the widget and all children, or to false to hide the widget. |
References nocl::GUIComponent::gtk_widget, and nocl::GUIComponent::hide().
|
virtualinherited |
Hide a single component.
References nocl::GUIComponent::gtk_widget.
Referenced by nocl::GUIComponent::show(), and nocl::GUIComponent::show_all().
|
virtualinherited |
Determine if the widget is shown.
References nocl::GUIComponent::gtk_widget.
|
staticinherited |
There are times when we have a pointer to a Gtk+ widget, and we need to map it back to the corresponding NOCL GUI component.
For example, during event handling, Gtk+ tells us which Gtk+ widget generated the event, but we need the corresponding NOCL object so we can call the event handler with a reference to the correct object.
Referenced by nocl::ButtonHandler::handle_button_events_for(), and nocl::GUIComponent::~GUIComponent().
EDirection nocl::Flexbox::direction |
Referenced by set().
EJustifyContent nocl::Flexbox::justify_content |
Referenced by set().
EAlignItems nocl::Flexbox::align_items |
Referenced by set().
EAlignContent nocl::Flexbox::align_content |
Referenced by set().
MMFlexItems nocl::Flexbox::items |
Referenced by add_child(), and add_children_to_parent().
|
inherited |
Keep track of all children that have been added to this container.
Referenced by nocl::Container::add_child(), nocl::Grid::add_child(), nocl::Container::remove_child(), and nocl::Container::~Container().
|
inherited |
Pointer to the parent to which we've been added. Will be nullptr
if this object hasn't been added to a parent container.
Referenced by nocl::Container::add_child(), nocl::Grid::add_child(), nocl::Container::remove_child(), and nocl::GUIComponent::~GUIComponent().
|
inherited |
Pointer to the underlying GTK framework.
Referenced by nocl::Box::Box(), nocl::ButtonBox::ButtonBox(), nocl::Grid::Grid(), nocl::ButtonHandler::handle_button_events_for(), nocl::GUIComponent::hide(), nocl::FrameWindow::initialize(), nocl::Window::is_resizable(), nocl::GUIComponent::is_visible(), nocl::Label::Label(), nocl::FrameWindow::operator GtkApplicationWindow *(), nocl::Box::operator GtkBox *(), nocl::Button::operator GtkButton *(), nocl::ButtonBox::operator GtkButtonBox *(), nocl::Container::operator GtkContainer *(), nocl::TextField::operator GtkEntry *(), nocl::Fixed::operator GtkFixed *(), nocl::Grid::operator GtkGrid *(), nocl::Label::operator GtkLabel *(), nocl::Layout::operator GtkLayout *(), nocl::SpinButton::operator GtkSpinButton *(), nocl::ToggleSwitch::operator GtkSwitch *(), nocl::TextEditor::operator GtkTextView *(), nocl::GUIComponent::operator GtkWidget *(), nocl::Window::operator GtkWindow *(), nocl::Window::resizable(), nocl::GUIComponent::show(), nocl::GUIComponent::show_all(), nocl::SpinButton::SpinButton(), nocl::TextButton::TextButton(), nocl::TextEditor::TextEditor(), nocl::TextField::TextField(), nocl::ToggleSwitch::ToggleSwitch(), and nocl::GUIComponent::~GUIComponent().