/*
 MENUBAR.DOX

 License CC0 PUBLIC DOMAIN

 To the extent possible under law, Mark J. Olesen has waived all copyright
 and related or neighboring rights to FDOSTUI Library. This work is published
 from: United States.
*/

/*! \file menubar.hpp
\brief contains menu bar class
*/

/*! \class menubar menubar.hpp
\brief Allows a user to choose a menu item from a horizontal list
*/

/*!
\fn menubar::menubar(
        int const                       i_pos_x,
        int const                       i_pos_y,
        unsigned int const              i_len_x,
        unsigned int const              i_len_y)
\brief constructor 
\param[in] i_pos_x x position to place widget
\param[in] i_pos_y y position to place widget
\param[in] i_len_x x length of widget
\param[in] i_len_y y length of widget
\returns none
*/

    
/*!
\fn virtual menubar::~menubar()
\brief destructor
\returns none
*/

/*!
\fn virtual void menubar::draw() const
\brief draws the widget

This method should not be called directly. 
\see widget::draw for details.
*/

/*!
\fn virtual enum event_response menubar::event_key_default(
        enum scancodes const            i_scan)
\brief default scan code event handler
\param[in] i_scan scan code to handle
\returns response how event was handled

This routine will scan the menubar in order, for accelerator keys.
The first one encountered will get activated (either a menu is popped
up or the signal is emitted).
*/

/*!
\fn virtual enum event_response menubar::event_key(
        struct event_key const&         i_event)
\brief handle key event
\param[in] i_event key event to handle    
\returns response how event was handled
*/

/*!
\fn virtual enum event_response menubar::event_mouse(
        struct event_mouse const&       i_event)
\brief handle mouse event
\param[in] i_event mouse event to handle
\returns response how event was handled
*/

/*!
\fn void menubar::set_menu(
        struct menuitembar const*       i_menu)
\brief sets the menu
\param[in] i_menu reference to menu items

\a i_menu must be a valid reference to a menu data structure. 
This widget does not make a local copy. So, the life time
of the object should survive the menu widget.
*/

/*!
\struct menubar::item
\brief convenience container to hold a menu item

\var item::m_menu
	reference to the menu item

\var item::m_pos_x
	precalculated x position of menu item

\var item::m_len_x
	precalculated y position of menu item
*/

/*!
\var menubar::m_selected
	index of selected item
*/

/*!
\var menubar::m_item
	array of menu items
*/

/*!
\var menubar::m_item_count
	number of elements in array
*/

/*!
\fn void menubar::draw_item(
        struct item const&              i_item) const
\brief draw a menu item to the display
\returns none
*/

/*!
\fn void popup(
        struct item&                    i_item)
\brief popup a menu
\param[in,out] i_item item containing menu to popup
\returns none
*/
