fork download
  1. #ifndef DUI_FRAME_HPP
  2. #define DUI_FRAME_HPP
  3.  
  4. //Includes
  5. #include "CloseButton.hpp"
  6.  
  7. namespace dui {
  8. class Frame : public Stencil {
  9. private:
  10. bool draggable, dragged, screenlocked, showclose;
  11. CloseButton cb;
  12. sf::Text text;
  13. sf::Color bodyColor, frameBorder, topColor, nameColor;
  14. sf::RectangleShape body, top;
  15. public:
  16. Frame(): draggable(true), dragged(false), screenlocked(false), showclose(true),
  17. bodyColor(232,232,232), topColor(102,194,255), nameColor(255,255,255) {
  18. text.setFont(defaultFont);
  19. text.setString("Frame");
  20. text.setCharacterSize(10);
  21. cb.setWindow(*window);
  22. rect.width = 300;
  23. rect.height = 150;
  24. frameBorder = borderColor;
  25. parent = this;
  26. }
  27.  
  28. void draw() {
  29. if(window == nullptr || !visible)
  30. return;
  31. //Draw the body
  32. body.setPosition(rect.left,rect.top);
  33. body.setSize(sf::Vector2f(rect.width,rect.height));
  34. body.setFillColor(bodyColor);
  35. window->draw(body);
  36.  
  37. gradientColor.r = topColor.r - 20;
  38. gradientColor.g = topColor.g - 20;
  39. gradientColor.b = topColor.b - 20;
  40.  
  41. //Draw the top.
  42. top.setPosition(rect.left,rect.top);
  43. top.setSize(sf::Vector2f(rect.width,25));
  44. top.setFillColor(topColor);
  45. window->draw(top);
  46. drawGradient(rect.left,rect.top,rect.width,25,gradientColor);
  47. drawOutlineRect(rect.left, rect.top + 25, rect.width, 1, frameBorder);
  48.  
  49. //Draw the text.
  50. text.setPosition(rect.left + 5, rect.top + 5);
  51. text.setColor(nameColor);
  52. window->draw(text);
  53.  
  54. //Draw the close button.
  55. cb.setPosition(rect.left + 55, rect.top);
  56. //cb.draw() this crashes
  57. }
  58. };
  59. } //namespace dui
  60.  
  61.  
  62. #endif //DUI_FRAME_HPP
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:5:27: fatal error: CloseButton.hpp: No such file or directory
compilation terminated.
stdout
Standard output is empty