Plutonium framework API  0.3
Simple UI framework for libnx and SDL2
elm_Toggle.hpp
Go to the documentation of this file.
1 
2 /*
3 
4  Plutonium library
5 
6  @file Toggle.hpp
7  @brief A Toggle is an Element used to switch between two options by toggling the item.
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/pu_String.hpp>
17 
18 namespace pu::ui::elm
19 {
20  class Toggle : public Element
21  {
22  public:
23  Toggle(i32 X, i32 Y, String Content, u64 Key, Color Color);
25  ~Toggle();
26 
27  i32 GetX();
28  void SetX(i32 X);
29  i32 GetY();
30  void SetY(i32 Y);
31  i32 GetWidth();
32  i32 GetHeight();
34  void SetContent(String Content);
35  void SetFont(String font_name);
36  Color GetColor();
37  void SetColor(Color General);
38  u64 GetKey();
39  void SetKey(u64 Key);
40  bool IsChecked();
41  void OnRender(render::Renderer::Ref &Drawer, i32 X, i32 Y);
42  void OnInput(u64 Down, u64 Up, u64 Held, Touch Pos);
43  private:
44  String cnt;
45  i32 x;
46  i32 y;
47  u64 key;
48  bool checked;
49  Color clr;
50  String fnt_name;
51  i32 fsize;
52  i32 togfact;
53  sdl2::Texture ntex;
54  };
55 }
Toggle(i32 X, i32 Y, String Content, u64 Key, Color Color)
Definition: elm_Button.hpp:19
Definition: pu_String.hpp:21
Definition: elm_Toggle.hpp:20
Definition: ui_Types.hpp:24
Definition: ui_Types.hpp:38
void SetColor(Color General)
void SetKey(u64 Key)
SDL_Texture * Texture
Definition: sdl2_Types.hpp:11
s32 i32
Definition: pu_Macros.hpp:17
#define PU_SMART_CTOR(type)
Definition: pu_Macros.hpp:8
void SetFont(String font_name)
void OnRender(render::Renderer::Ref &Drawer, i32 X, i32 Y)
void SetContent(String Content)
void OnInput(u64 Down, u64 Up, u64 Held, Touch Pos)
Definition: elm_Element.hpp:34