Guest User

Untitled

a guest
Apr 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. window1.SetTitle("My Program")
  2. ->SetSize({ 640,480 })
  3. ->SetPosition({ 100,100 })
  4. ->SetClosesProgram(true)
  5. ->Show();
  6.  
  7. Control* Control::SetSomething(int something)
  8. {
  9. //Тут оснвной код метода
  10.  
  11. return this;
  12. }
  13.  
  14. template <class Derived>
  15. class WQUERY_API ControlBase
  16. {
  17. private:
  18. Derived * pDerived_; // Указатель на наследника
  19.  
  20. public:
  21. ControlBase(Derived * pDerived):pDerived_(pDerived)
  22.  
  23. Derived* SetText(const std::string &title)
  24. {
  25. if (this->hWnd_)
  26. {
  27. SetWindowTextA(this->hWnd_, title.c_str());
  28. }
  29.  
  30. return this->pDerived_;
  31. }
  32.  
  33. class Button;
  34. template class WQUERY_API ControlBase<Button>;
  35.  
  36. /**
  37. * brief Класс наследуется от базового шаблонного класса ControlBase
  38. */
  39. class WQUERY_API Button : public ControlBase<Button>
  40. {
  41.  
  42. Button::Button(Window * window):ControlBase(this){}
Add Comment
Please, Sign In to add comment