Wt
3.3.0
|
A navigation bar. More...
#include <Wt/WNavigationBar>
Public Member Functions | |
WNavigationBar (WContainerWidget *parent=0) | |
Constructor. | |
void | setTitle (const WString &title, const WLink &link=WLink()) |
Sets a title. | |
void | setResponsive (bool responsive) |
Sets whether the navigation bar will respond to screen size. | |
void | addMenu (WMenu *menu, AlignmentFlag alignment=AlignLeft) |
Adds a menu to the navigation bar. | |
void | addFormField (WWidget *widget, AlignmentFlag alignment=AlignLeft) |
Adds a form field to the navigation bar. | |
void | addSearch (WLineEdit *field, AlignmentFlag alignment=AlignLeft) |
Adds a search widget to the navigation bar. | |
void | addWidget (WWidget *widget, AlignmentFlag alignment=AlignLeft) |
Adds a widget to the navigation bar. |
A navigation bar.
void Wt::WNavigationBar::addFormField | ( | WWidget * | widget, |
AlignmentFlag | alignment = AlignLeft |
||
) |
Adds a form field to the navigation bar.
In some cases, one may want to add a few form fields to the navigation bar (e.g. for a compact login option).
void Wt::WNavigationBar::addMenu | ( | WMenu * | menu, |
AlignmentFlag | alignment = AlignLeft |
||
) |
Adds a menu to the navigation bar.
Typically, a navigation bar will contain at least one menu which implements the top-level navigation options allowed by the navigation bar.
The menu may be aligned to the left or to the right of the navigation bar.
void Wt::WNavigationBar::addSearch | ( | WLineEdit * | field, |
AlignmentFlag | alignment = AlignLeft |
||
) |
Adds a search widget to the navigation bar.
This is not so different from addFormField(), except that the form field may be styled differently to indicate a search function.
void Wt::WNavigationBar::addWidget | ( | WWidget * | widget, |
AlignmentFlag | alignment = AlignLeft |
||
) |
Adds a widget to the navigation bar.
Any other widget may be added to the navigation bar, although they may require special CSS style to blend well with the navigation bar style.
void Wt::WNavigationBar::setResponsive | ( | bool | responsive | ) |
Sets whether the navigation bar will respond to screen size.
For screens that are less wide, the navigation bar can be rendered different (more compact and allowing for vertical menu layouts).