FreeRDP
SDL2/dialogs/sdl_button.hpp
1 #pragma once
2 
3 #include <string>
4 
5 #include "sdl_widget.hpp"
6 
7 class SdlButton : public SdlWidget
8 {
9  public:
10  SdlButton(SDL_Renderer* renderer, std::string label, int id, SDL_Rect rect);
11  SdlButton(const SdlButton& other) = delete;
12  SdlButton(SdlButton&& other) noexcept;
13  ~SdlButton() override;
14 
15  SdlButton& operator=(const SdlButton& other) = delete;
16  SdlButton& operator=(SdlButton&& other) = delete;
17 
18  bool highlight(SDL_Renderer* renderer);
19  bool mouseover(SDL_Renderer* renderer);
20  bool update(SDL_Renderer* renderer);
21 
22  [[nodiscard]] int id() const;
23 
24  private:
25  std::string _name;
26  int _id;
27 };