Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. /*
  2. Syn's AyyWare Framework 2015
  3. */
  4.  
  5. #pragma once
  6.  
  7. #include "GUI.h"
  8.  
  9. class CCheckBox : public CControl
  10. {
  11. public:
  12. CCheckBox();
  13. void SetState(bool s);
  14. bool GetState();
  15. protected:
  16. bool Checked;
  17. void Draw(bool hover);
  18. void OnUpdate();
  19. void OnClick();
  20. };
  21.  
  22. class CLabel : public CControl
  23. {
  24. public:
  25. CLabel();
  26. void SetText(std::string text);
  27. protected:
  28. std::string Text;
  29. void Draw(bool hover);
  30. void OnUpdate();
  31. void OnClick();
  32. };
  33.  
  34. class CGroupBox : public CControl
  35. {
  36. public:
  37. CGroupBox();
  38. void SetText(std::string text);
  39. void PlaceLabledControl(std::string Label, CTab *Tab, CControl* control);
  40. protected:
  41. int Items;
  42. std::string Text;
  43. void Draw(bool hover);
  44. void OnUpdate();
  45. void OnClick();
  46. };
  47.  
  48. class CSlider : public CControl
  49. {
  50. public:
  51. CSlider();
  52. float GetValue();
  53. void SetValue(float v);
  54. void SetBoundaries(float min, float max);
  55. protected:
  56. float Value;
  57. float Min;
  58. float Max;
  59. bool DoDrag;
  60. void Draw(bool hover);
  61. void OnUpdate();
  62. void OnClick();
  63. };
  64.  
  65. class CKeyBind : public CControl
  66. {
  67. public:
  68. CKeyBind();
  69. int GetKey();
  70. void SetKey(int key);
  71. protected:
  72. int Key;
  73. bool IsGettingKey;
  74. void Draw(bool hover);
  75. void OnUpdate();
  76. void OnClick();
  77. };
  78.  
  79. class CButton : public CControl
  80. {
  81. public:
  82. typedef void(*ButtonCallback_t)(void);
  83. CButton();
  84. void SetCallback(ButtonCallback_t callback);
  85. void SetText(std::string text);
  86. protected:
  87. ButtonCallback_t CallBack;
  88. std::string Text;
  89. void Draw(bool hover);
  90. void OnUpdate();
  91. void OnClick();
  92. };
  93.  
  94. class CComboBox : public CControl
  95. {
  96. public:
  97. CComboBox();
  98. void AddItem(std::string text);
  99. void SelectIndex(int idx);
  100. int GetIndex();
  101. std::string GetItem();
  102. protected:
  103. std::vector<std::string> Items;
  104. int SelectedIndex;
  105. bool IsOpen;
  106. void Draw(bool hover);
  107. void OnUpdate();
  108. void OnClick();
  109. };
  110.  
  111. class CTextField : public CControl
  112. {
  113. public:
  114. CTextField();
  115. std::string getText();
  116. void SetText(std::string);
  117. private:
  118. std::string text;
  119. bool IsGettingKey;
  120. void Draw(bool hover);
  121. void OnUpdate();
  122. void OnClick();
  123. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement