Minor documentation improvements [ci skip]

0.8
Bruno Van de Velde 2018-09-22 15:51:03 +02:00
parent 5fd78c88ad
commit 5fff94a4cc
4 changed files with 30 additions and 26 deletions

View File

@ -38,7 +38,7 @@ namespace tgui
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Container widget
///
/// Parent class for widgets that store multiple widgets.
/// Parent class for widgets that contain child widgets.
///
/// Signals:
/// - Inherited signals from Widget
@ -97,7 +97,7 @@ namespace tgui
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Returns a list of all the widgets
/// @brief Returns a list of all the widgets in this container
///
/// @return Vector of all widget pointers
///
@ -109,7 +109,7 @@ namespace tgui
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Returns a list of the names of all the widgets
/// @brief Returns a list of the names of all the widgets in this container
///
/// @return Vector of all widget names
///
@ -124,7 +124,7 @@ namespace tgui
/// @brief Adds a widget to the container
///
/// @param widgetPtr Pointer to the widget you would like to add
/// @param widgetName If you want to access the widget later then you must do this with this name
/// @param widgetName You can give the widget a unique name to retrieve it from the container later
///
/// @warning The widget name should not contain whitespace
///
@ -133,14 +133,14 @@ namespace tgui
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Returns a pointer to an earlier created widget
/// @brief Returns a pointer to a widget that was added earlier
///
/// @param widgetName The name that was given to the widget when it was added to the container
///
/// The container will first search for widgets that are direct children of it, but when none of the child widgets match
/// the given name, a recursive search will be performed.
///
/// @return Pointer to the earlier created widget
/// @return Pointer to the earlier added widget
///
/// @warning This function will return nullptr when an unknown widget name was passed
///
@ -149,11 +149,11 @@ namespace tgui
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Returns a pointer to an earlier created widget
/// @brief Returns a pointer to a widget that was added earlier
///
/// @param widgetName The name that was given to the widget when it was added to the container
///
/// @return Pointer to the earlier created widget.
/// @return Pointer to the earlier added widget.
/// The pointer will already be casted to the desired type
///
/// The container will first search for widgets that are direct children of it, but when none of the child widgets match
@ -239,16 +239,16 @@ namespace tgui
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Loads the child widgets from a text file
///
/// @param filename Filename of the widget file
/// @throw Exception when file could not be opened or parsing failed
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void loadWidgetsFromFile(const std::string& filename);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Saves the child widgets to a text file
///
/// @param filename Filename of the widget file
/// @throw Exception when file could not be opened for writing
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void saveWidgetsToFile(const std::string& filename);

View File

@ -33,6 +33,9 @@
namespace tgui
{
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Renderer for the MenuBar widget
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class TGUI_API MenuBarRenderer : public WidgetRenderer
{
public:

View File

@ -153,7 +153,7 @@ namespace tgui
/// @param size Sets the new maximum size of the child window
///
/// This function sets the maximum size of the window excluding borders and titlebar.
/// If the window is larger than the new maximum size, it will automatically be resized down.
/// If the window is larger than the new maximum size, it will automatically be shrunk.
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void setMaximumSize(Vector2f size);
@ -176,7 +176,7 @@ namespace tgui
/// @param size Sets the new minimum size of the child window
///
/// This function sets the minimum size of the window excluding borders and titlebar.
/// If the window is smaller than the new minimum size, it will automatically be resized up.
/// If the window is smaller than the new minimum size, it will automatically be enlarged.
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void setMinimumSize(Vector2f size);
@ -249,8 +249,8 @@ namespace tgui
///
/// @param buttons Which buttons should be available in the title bar?
///
/// By default ChildWindows only display a close button. You may set the window to show a combination of buttons.
/// For example, the following will set the ChildWindow to have both a minimize and close button.
/// By default ChildWindows only display a close button.
/// The following example gives the ChildWindow both a minimize and close button.
/// @code
/// childWindow->setTitleButtons(ChildWindow::TitleButtons::Minimize | ChildWindow::TitleButtons::Close);
/// @endcode
@ -318,9 +318,7 @@ namespace tgui
/// @brief Sets the child window to be kept inside its parent
///
/// @param enabled When it's set to true, the child window will always be kept automatically inside its parent.
/// It will be fully kept on left, right and top.
/// At the bottom of the parent only the title bar will be kept inside.
/// It's set to false by default
/// It's set to false by default.
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void setKeepInParent(bool enabled = true);
@ -329,10 +327,8 @@ namespace tgui
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Tells whether the child window is kept inside its parent
///
/// @return When it's set to true, the child window will always be kept automatically inside its parent.
/// It will be fully kept on left, right and top.
/// At the bottom of the parent only the title bar will be kept inside.
/// It's set to false by default
/// @return When it's set to true, the child window will always be kept automatically inside its parent.
/// It's set to false by default.
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool isKeptInParent() const;

View File

@ -235,8 +235,8 @@ namespace tgui
/// or if hierarchy does not contain at least 2 elements.
///
/// @code
/// addMenuItem({"File", "Save"});
/// addMenuItem({"View", "Messages", "Tags", "Important"});
/// menuBar->addMenuItem({"File", "Save"});
/// menuBar->addMenuItem({"View", "Messages", "Tags", "Important"});
/// @endcode
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool addMenuItem(const std::vector<sf::String>& hierarchy, bool createParents = true);
@ -279,9 +279,11 @@ namespace tgui
/// @param hierarchy Hierarchy of the menu item, starting with the menu and ending with menu item to be deleted
/// @param removeParentsWhenEmpty Also delete the parent of the deleted menu item if it has no other children
///
/// @return True when the menu item exists, false when hierarchy was incorrect
///
/// @code
/// removeMenuItem({"File", "Save"});
/// removeMenuItem({"View", "Messages", "Tags", "Important"});
/// menuBar->removeMenuItem({"File", "Save"});
/// menuBar->removeMenuItem({"View", "Messages", "Tags", "Important"});
/// @endcode
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool removeMenuItem(const std::vector<sf::String>& hierarchy, bool removeParentsWhenEmpty = true);
@ -289,7 +291,8 @@ namespace tgui
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Enable or disable an entire menu
/// @param menu The name of the menu to enable or disable
/// @param menu The name of the menu to enable or disable
/// @param enabled Should the menu be enabled or disabled?
/// @return True when the menu exists, false when menu was not found
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool setMenuEnabled(const sf::String& menu, bool enabled);
@ -307,6 +310,7 @@ namespace tgui
/// @brief Enable or disable a menu item
/// @param menu The name of the menu in which the menu item is located
/// @param menuItem The name of the menu item to enable or disable
/// @param enabled Should the menu item be enabled or disabled?
/// @return True when the menu item exists, false when menu or menuItem was not found
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool setMenuItemEnabled(const sf::String& menu, const sf::String& menuItem, bool enabled);
@ -315,6 +319,7 @@ namespace tgui
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Enable or disable a menu item
/// @param hierarchy Hierarchy of menu items, starting with the menu and ending with the menu item to enable/disable
/// @param enabled Should the menu item be enabled or disabled?
/// @return True when the menu item exists, false when hierarchy was incorrect
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool setMenuItemEnabled(const std::vector<sf::String>& hierarchy, bool enabled);