Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
menu_view_layout.h
Go to the documentation of this file.
1#ifndef MENU_VIEW_LAYOUT_H
2#define MENU_VIEW_LAYOUT_H
3
4#include "menu_view_item.h"
5#include "screen_rect.h"
6#include "layout.h"
7
8#include <vector>
9
63{
64public:
65 explicit menu_view_layout(
67 const int margin_width = get_default_margin_width()
68 );
69
71 const screen_rect& get_selectable_rect(const menu_view_item item) const noexcept;
72
74 const auto& get_menu_panel() const noexcept { return m_menu_panel; }
75
77 const auto& get_title() const noexcept { return m_title; }
78 const auto& get_subtitle() const noexcept { return m_subtitle; }
79 const auto& get_background_image() const noexcept { return m_background_image; }
80 const auto& get_start() const noexcept { return m_start; }
81 const auto& get_about() const noexcept { return m_about; }
82 const auto& get_options() const noexcept { return m_options; }
83 const auto& get_quit() const noexcept { return m_quit; }
84
85private:
86
88 screen_rect m_menu_panel;
89
90 screen_rect m_title;
91 screen_rect m_subtitle;
92 screen_rect m_background_image;
93 screen_rect m_start;
94 screen_rect m_options;
95 screen_rect m_about;
96 screen_rect m_quit;
97};
98
100std::vector<screen_rect> get_panels(const menu_view_layout& layout);
101
104
105#endif // MENU_VIEW_LAYOUT_H
The layout of the Menu dialog.
Definition menu_view_layout.h:63
const auto & get_menu_panel() const noexcept
The rectangle around the buttons.
Definition menu_view_layout.h:74
const auto & get_title() const noexcept
The screen area where the frames per seconds are displayed.
Definition menu_view_layout.h:77
const screen_rect & get_selectable_rect(const menu_view_item item) const noexcept
Get a screen rect.
Definition menu_view_layout.cpp:84
const auto & get_quit() const noexcept
Definition menu_view_layout.h:83
const auto & get_subtitle() const noexcept
Definition menu_view_layout.h:78
const auto & get_start() const noexcept
Definition menu_view_layout.h:80
const auto & get_about() const noexcept
Definition menu_view_layout.h:81
const auto & get_options() const noexcept
Definition menu_view_layout.h:82
const auto & get_background_image() const noexcept
Definition menu_view_layout.h:79
A rectangle-shaped area on the screen.
Definition screen_rect.h:15
constexpr int get_default_margin_width() noexcept
Get the default margin width/size, in pixels.
Definition layout.h:7
menu_view_item
The items in the Menu dialog.
Definition menu_view_item.h:8
void test_menu_view_layout()
Test the menu_view_layout class.
Definition menu_view_layout.cpp:98
std::vector< screen_rect > get_panels(const menu_view_layout &layout)
Get the panels in the layout.
Definition menu_view_layout.cpp:69
screen_rect get_default_screen_rect() noexcept
Get the default screen rectangle.
Definition screen_rect.cpp:140