|
| tabbar () |
|
| tabbar (window wd, bool visible) |
|
| ~tabbar () |
|
value_type & | operator[] (std::size_t pos) const |
|
void | activated (std::size_t pos) |
| Activates a tab specified by pos. More...
|
|
std::size_t | activated () const |
|
value_type const & | at (std::size_t pos) const |
| Returns pos'th element. More...
|
|
void | close_fly (bool fly) |
| Draw or not a close button in each tab. More...
|
|
const pat::cloneable
< item_renderer > & | renderer () const |
|
void | renderer (const pat::cloneable< item_renderer > &ir) |
|
std::size_t | length () const |
| Returns the number of items. More...
|
|
tabbar & | append (std::string text, window attach_wd, value_type value={}) |
| Append a new tab. More...
|
|
tabbar & | append (std::wstring text, window attach_wd, value_type value={}) |
|
void | push_back (std::string text) |
| Append a new item. More...
|
|
void | insert (std::size_t pos, std::string text, value_type value={}) |
|
void | insert (std::size_t pos, std::wstring text, value_type value={}) |
|
window | attach (std::size_t pos, window attach_wd, bool drop_other=true) |
| Attach a window to a specified tab. When the tab is activated, tabbar shows the attached window. More...
|
|
void | erase (std::size_t pos) |
|
void | tab_bgcolor (std::size_t pos, const ::nana::color &clr) |
|
void | tab_fgcolor (std::size_t pos, const ::nana::color &clr) |
|
void | tab_image (std::size_t pos, const nana::paint::image &img) |
|
void | toolbox (kits kit, bool enable) |
| Sets buttons of the tabbar's toolbox, refer to notes for more details. More...
|
|
void | text (std::size_t pos, const std::string &str) |
| Sets the title of the specified item, If pos is invalid, the method throws an std::out_of_range object. More...
|
|
std::string | text (std::size_t pos) const |
| Returns a title of a specified item, If pos is invalid, the method throws a std::out_of_range object. More...
|
|
| widget_object () |
|
| ~widget_object () |
|
event_type & | events () const |
|
bool | create (window parent_wd, bool visible) |
|
bool | create (window parent_wd, const rectangle &r={}, bool visible=true) |
|
widget_object & | borderless (bool enable) |
|
bool | borderless () const |
|
scheme_type & | scheme () const |
|
void | filter_event (const event_code evt_code, const bool bDisabled) |
|
void | filter_event (const std::vector< event_code > evt_codes, const bool bDisabled) |
|
void | filter_event (const event_filter_status &evt_all_states) |
|
bool | filter_event (const event_code evt_code) |
|
event_filter_status | filter_event () |
|
void | clear_filter () |
|
window | handle () const override |
| Returns the handle of window, returns 0 if window is not created. More...
|
|
| widget ()=default |
|
virtual | ~widget ()=default |
|
bool | empty () const |
| Determines whether the manipulator is handling a window. More...
|
|
void | close () |
|
window | parent () const |
|
::std::string | caption () const noexcept |
|
::std::wstring | caption_wstring () const noexcept |
|
native_string_type | caption_native () const noexcept |
|
widget & | caption (std::string utf8) |
|
widget & | caption (std::wstring) |
|
template<typename... Args> |
void | i18n (std::string msgid, Args &&...args) |
|
void | i18n (i18n_eval) |
|
void | cursor (nana::cursor) |
|
nana::cursor | cursor () const |
| Retrieves the shape of cursor. More...
|
|
void | typeface (const paint::font &font) |
|
paint::font | typeface () const |
|
bool | enabled () const |
| Determines whether the window is enabled for mouse and keyboard input. More...
|
|
void | enabled (bool) |
|
void | enable_dropfiles (bool) |
| Enables/Disables a window to accept dropped files. More...
|
|
void | focus () |
|
bool | focused () const |
|
std::shared_ptr
< scroll_operation_interface > | scroll_operation () |
|
void | show () |
| Sets the window visible. More...
|
|
void | hide () |
| Sets the window invisible. More...
|
|
bool | visible () const |
|
nana::size | size () const |
|
void | size (const nana::size &) |
|
void | set_capture (bool ignore_children) |
| Enables the widget to grab the mouse input. More...
|
|
void | release_capture () |
| Disables the widget to grab the mouse input. More...
|
|
point | pos () const |
|
void | move (int x, int y) |
|
void | move (const point &) |
|
void | move (const rectangle &) |
|
void | fgcolor (const nana::color &) |
|
nana::color | fgcolor () const |
|
void | bgcolor (const nana::color &) |
|
nana::color | bgcolor () const |
|
general_events & | events () const |
|
void | umake_event (event_handle eh) const |
| Deletes an event callback by a handle. More...
|
|
widget & | register_shortkey (wchar_t) |
| Registers a shortkey. To remove a registered key, pass 0. More...
|
|
widget & | take_active (bool activated, window take_if_not_activated) |
|
widget & | tooltip (const ::std::string &) |
|
| operator dummy_bool_type () const |
|
| operator window () const |
|
template<typename T>
class nana::tabbar< T >
Analogous to dividers in a notebook or the labels in a file cabinet.
The button_container
is a member template of tabbar
. It is used to identify a button in the tabbar. The buttons of toolbox are: scrolling button, list button and close button. Only scrolling button is enabled by default. Enable the other buttons by employing the tabbar::toolbox
member function. An example:
typedef tabbar<int> tabbar_t;
tabbar_object.toolbox(tabbar_t::button_container<tabbar_t::button_list, tabbar_t::button_close>(), true);
Sets the list button and close button to be enabled.
tabbar
- The tabbar provides an
event_trigger
class for abstract event, such as selecting an item or closing an item. template<typename Tabbar>
struct ext_event_type
{
typedef Tabbar tabbar;
typedef typename tabbar::value_type value_type;
nana::functor_group<void(tabbar&, value_type&)> add_tab;
nana::functor_group<void(tabbar&, value_type&)> active;
nana::functor_group<bool(tabbar&, value_type&)> remove;
};
add_tab()
is invoked when a new item is being created.
active()
method is invoked when selects an item.
remove()
method is invoked when closes an item and to stop closing the item by returning false.
- Examples:
- widget_show.cpp, and widget_show2.cpp.