Plutonium framework API  0.1
Simple UI framework for libnx and SDL2
Dialog.hpp
Go to the documentation of this file.
1 
2 /*
3 
4  Plutonium library
5 
6  @file Dialog.hpp
7  @brief A Dialog is an easy way to ask the user to choose between several options.
8  @author XorTroll
9 
10  @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
11 
12 */
13 
14 #pragma once
15 #include <pu/render.hpp>
16 #include <vector>
17 
18 namespace pu
19 {
20  class Dialog
21  {
22  public:
23  Dialog(std::string Title, std::string Content);
24  ~Dialog();
25  void AddOption(std::string Name);
26  void SetCancelOption(std::string Name = "Cancel");
27  void RemoveCancelOption();
28  bool HasCancelOption();
29  void SetIcon(std::string Icon);
30  bool Hasicon();
31  u32 Show(render::Renderer *Drawer, void *App);
32  bool UserCancelled();
33  bool IsOk();
34  private:
35  bool hcancel;
36  std::string scancel;
37  render::NativeFont tfont;
38  render::NativeFont cfont;
39  render::NativeFont ofont;
42  std::vector<std::string> sopts;
43  std::vector<render::NativeTexture> opts;
44  u32 osel;
45  bool cancel;
46  bool hicon;
48  u32 prevosel;
49  s32 pselfact;
50  s32 selfact;
51  };
52 }
Dialog(std::string Title, std::string Content)
Definition: Renderer.hpp:22
Definition: Dialog.hpp:20
Definition: Application.hpp:20
TTF_Font * NativeFont
Definition: SDL2.hpp:17
u32 Show(render::Renderer *Drawer, void *App)
bool Hasicon()
bool IsOk()
void SetIcon(std::string Icon)
void SetCancelOption(std::string Name="Cancel")
void RemoveCancelOption()
void AddOption(std::string Name)
bool UserCancelled()
SDL_Texture * NativeTexture
Definition: SDL2.hpp:16
bool HasCancelOption()