Nana C++ Library. Reference for users.
What we need to use nana
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
nana::group Class Reference
Inheritance diagram for nana::group:
nana::widget_object< category::widget_tag, drawerbase::panel::drawer, general_events, drawerbase::group::scheme > nana::detail::widget_base nana::widget

Classes

struct  implement
 

Public Types

enum  background_mode { background_mode::none, background_mode::transparent, background_mode::blending }
 
using field_reference = place::field_reference
 
- Public Types inherited from nana::widget_object< category::widget_tag, drawerbase::panel::drawer, general_events, drawerbase::group::scheme >
using scheme_type = drawerbase::group::scheme
 
using event_type = general_events
 
- Public Types inherited from nana::widget
using native_string_type = detail::native_string_type
 

Public Member Functions

 group ()
 The default construction. More...
 
 group (window parent, const rectangle &={}, bool visible=true)
 The construction that creates the widget. More...
 
 group (window parent,::std::string title, bool formatted=false, unsigned gap=2, const rectangle &r={}, bool visible=true)
 The construction that creates the widget and set the title or caption. More...
 
 ~group ()
 The destruction. More...
 
checkboxadd_option (::std::string)
 Adds an option for user selection. More...
 
groupcaption_align (align position)
 Modifies the alignment of the title. More...
 
groupcaption_background_mode (background_mode mode)
 
groupradio_mode (bool)
 Enables/disables the radio mode which is single selection. More...
 
std::size_t option () const
 Returns the index of selected option in radio_mode, it throws a logic_error if radio_mode is false. More...
 
void option_check (std::size_t pos, bool check=true)
 
bool option_checked (std::size_t pos) const
 Determines whether a specified option is checked, it throws an out_of_range if !(pos < number of options) More...
 
void typeface (const nana::paint::font &font)
 Change typeface of caption label ( does not effect child widgets ) More...
 
groupenable_format_caption (bool format)
 
groupcollocate () noexcept
 
groupdiv (const char *div_str) noexcept
 
field_reference operator[] (const char *field)
 
void field_display (const char *field_name, bool display)
 Displays/Discards an existing field. More...
 
bool field_display (const char *field_name) const
 Determines whether the specified field is displayed. More...
 
void erase (window handle)
 Erases a window from field. More...
 
template<typename Widget , typename... Args>
Widget * create_child (const char *field, Args &&...args)
 
- Public Member Functions inherited from nana::widget_object< category::widget_tag, drawerbase::panel::drawer, general_events, drawerbase::group::scheme >
 widget_object ()
 
 ~widget_object ()
 
event_typeevents () const
 
bool create (window parent_wd, bool visible)
 
bool create (window parent_wd, const rectangle &r={}, bool visible=true)
 
widget_objectborderless (bool enable)
 
bool borderless () const
 
scheme_typescheme () 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 ()
 
- Public Member Functions inherited from nana::detail::widget_base
window handle () const override
 Returns the handle of window, returns 0 if window is not created. More...
 
- Public Member Functions inherited from nana::widget
 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
 
widgetcaption (std::string utf8)
 
widgetcaption (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_eventsevents () const
 
void umake_event (event_handle eh) const
 Deletes an event callback by a handle. More...
 
widgetregister_shortkey (wchar_t)
 Registers a shortkey. To remove a registered key, pass 0. More...
 
widgettake_active (bool activated, window take_if_not_activated)
 
widgettooltip (const ::std::string &)
 
 operator dummy_bool_type () const
 
 operator window () const
 

Static Public Attributes

static constexpr const std::size_t npos = static_cast<std::size_t>(-1)
 

Additional Inherited Members

- Protected Types inherited from nana::widget_object< category::widget_tag, drawerbase::panel::drawer, general_events, drawerbase::group::scheme >
typedef drawerbase::panel::drawer drawer_trigger_t
 
- Protected Member Functions inherited from nana::widget_object< category::widget_tag, drawerbase::panel::drawer, general_events, drawerbase::group::scheme >
drawerbase::panel::drawerget_drawer_trigger ()
 
const drawerbase::panel::drawerget_drawer_trigger () const
 
- Protected Member Functions inherited from nana::widget
std::unique_ptr
<::nana::detail::widget_notifier_interface
_m_wdg_notifier ()
 
virtual nana::cursor _m_cursor () const
 
virtual void _m_cursor (nana::cursor)
 
virtual void _m_close ()
 
virtual bool _m_enabled () const
 
virtual void _m_enabled (bool)
 
virtual std::shared_ptr
< scroll_operation_interface
_m_scroll_operation ()
 
virtual bool _m_show (bool)
 
virtual bool _m_visible () const
 
virtual void _m_size (const nana::size &)
 
virtual void _m_move (int x, int y)
 
virtual void _m_move (const rectangle &)
 
virtual void _m_typeface (const nana::paint::font &font)
 
virtual nana::paint::font _m_typeface () const
 
virtual void _m_fgcolor (const nana::color &)
 
virtual nana::color _m_fgcolor () const
 
virtual void _m_bgcolor (const nana::color &)
 
virtual nana::color _m_bgcolor () const
 
- Protected Attributes inherited from nana::detail::widget_base
window handle_ { nullptr }
 

Detailed Description

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
none 
transparent 
blending 

Constructor & Destructor Documentation

nana::group::group ( )

The default construction.

nana::group::group ( window  parent,
const rectangle r = {},
bool  visible = true 
)

The construction that creates the widget.

nana::group::group ( window  parent,
::std::string  title,
bool  formatted = false,
unsigned  gap = 2,
const rectangle r = {},
bool  visible = true 
)

The construction that creates the widget and set the title or caption.

Parameters
parenta handle to the parent
titlecaption of the group
formattedEnable/disable the formatted text for the title
gapbetween the content and the external limit
nana::group::~group ( )

The destruction.

Member Function Documentation

checkbox & nana::group::add_option ( ::std::string  )

Adds an option for user selection.

Examples:
helloworld_demo.cpp.
group & nana::group::caption_align ( align  position)

Modifies the alignment of the title.

group & nana::group::caption_background_mode ( background_mode  mode)
group & nana::group::collocate ( )
noexcept
template<typename Widget , typename... Args>
Widget* nana::group::create_child ( const char *  field,
Args &&...  args 
)
inline
group & nana::group::div ( const char *  div_str)
noexcept

this will set the usr_div_str for an internal field, called the "user field". The "full" place of a group widget is internally divided into a field for the title, a field for the added "options" and a field for "user" widgets.

Examples:
group.cpp.
group & nana::group::enable_format_caption ( bool  format)
void nana::group::erase ( window  handle)

Erases a window from field.

void nana::group::field_display ( const char *  field_name,
bool  display 
)

Displays/Discards an existing field.

bool nana::group::field_display ( const char *  field_name) const

Determines whether the specified field is displayed.

group::field_reference nana::group::operator[] ( const char *  field)
std::size_t nana::group::option ( ) const

Returns the index of selected option in radio_mode, it throws a logic_error if radio_mode is false.

void nana::group::option_check ( std::size_t  pos,
bool  check = true 
)

Set check/unchecked status of specified option

Parameters
[in]poszero-based index of option to set
[in]checkstatus required, defaults to checked throws an out_of_range if !(pos < number of options)
bool nana::group::option_checked ( std::size_t  pos) const

Determines whether a specified option is checked, it throws an out_of_range if !(pos < number of options)

group & nana::group::radio_mode ( bool  enable)

Enables/disables the radio mode which is single selection.

void nana::group::typeface ( const nana::paint::font font)

Change typeface of caption label ( does not effect child widgets )

Member Data Documentation

constexpr const std::size_t nana::group::npos = static_cast<std::size_t>(-1)
static