DUDS
Distributed Update of Data from Something
MenuErrors.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of the DUDS project. It is subject to the BSD-style
3  * license terms in the LICENSE file found in the top-level directory of this
4  * distribution and at https://github.com/jjackowski/duds/blob/master/LICENSE.
5  * No part of DUDS, including this file, may be copied, modified, propagated,
6  * or distributed except according to the terms contained in the LICENSE file.
7  *
8  * Copyright (C) 2019 Jeff Jackowski
9  */
10 #include <boost/exception/exception.hpp>
11 #include <boost/exception/info.hpp>
12 #include <exception>
13 #include <memory>
14 
15 namespace duds { namespace ui { namespace menu {
16 
17 class Menu;
18 class MenuItem;
19 
23 struct MenuError : virtual std::exception, virtual boost::exception { };
24 
29 
34 
39 
45 
51 
57 
63 
68 
73 
79 struct MenuTooSmall : MenuError { };
80 
84 typedef boost::error_info<struct Info_MenuItemIndex, std::size_t>
86 
87 // may need to add functions to output names for menus and items to ostream
88 // for the following types to work well. also include menu size.
89 
93 typedef boost::error_info< struct Info_MenuItem, std::shared_ptr<const MenuItem> >
95 
99 typedef boost::error_info< struct Info_Menu, std::shared_ptr<const Menu> >
101 
102 } } }
A request was made to change the toggle state of a MenuItem that is not a toggle item.
Definition: MenuErrors.hpp:56
A required MenuItem object is missing.
Definition: MenuErrors.hpp:28
boost::error_info< struct Info_MenuItemIndex, std::size_t > MenuItemIndex
The index (position) of the MenuItem involved in an error.
Definition: MenuErrors.hpp:85
A request was made to change the value of a MenuItem that does not have a value.
Definition: MenuErrors.hpp:62
boost::error_info< struct Info_Menu, std::shared_ptr< const Menu > > MenuObject
The Menu object that is involved in an error.
Definition: MenuErrors.hpp:100
Attempted use of a MenuOutput object that hasn&#39;t been attached to a MenuView.
Definition: MenuErrors.hpp:72
The base exception type for all errors about menus.
Definition: MenuErrors.hpp:23
An attempt was made to inset a MenuItem beyond the bounds of the menu.
Definition: MenuErrors.hpp:33
boost::error_info< struct Info_MenuItem, std::shared_ptr< const MenuItem > > MenuItemObject
The MenuItem object that is involved in an error.
Definition: MenuErrors.hpp:94
An operation was attempted on an invisible MenuItem that requires a visible item. ...
Definition: MenuErrors.hpp:44
The specified MenuItem does not exist in the Menu.
Definition: MenuErrors.hpp:38
There is inadequate room to render the menu.
Definition: MenuErrors.hpp:79
An operation was attempted on a disabled MenuItem that requires a non-disabled item.
Definition: MenuErrors.hpp:50
MenuView::attach() was called more than once on a MenuView object.
Definition: MenuErrors.hpp:67