20 #ifndef primitiveGui_h
21 #define primitiveGui_h
23 #include <SFML\Graphics.hpp>
54 pText(
float marginLeft,
float marginRight,
bool textCentered,
int cutDirection );
61 void setParentGeom( sf::Vector2f position, sf::Vector2f size);
88 sf::Vector2f parentPos;
89 sf::Vector2f parentSize;
122 pWidget(
float x,
float y,
float width,
float height );
132 void setGeometry(
float x,
float y,
float width,
float height );
174 virtual void checkMouseEvent(sf::Vector2i&,
bool) = 0;
175 virtual void symbolEntered(sf::Uint32) = 0;
179 sf::Vector2f onWindowPos;
180 sf::RectangleShape widgetShape;
213 pButton(
float x,
float y,
float width,
float height );
228 void setText( sf::String& text );
245 virtual void checkMouseEvent(sf::Vector2i&,
bool);
246 virtual void symbolEntered(sf::Uint32){};
247 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
273 pTextEdit(
float x,
float y,
float width,
float height );
287 void setText( sf::String& text );
303 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
304 virtual void checkMouseEvent(sf::Vector2i&,
bool);
305 virtual void symbolEntered(sf::Uint32);
328 pCheckBox(
float x,
float y,
float width,
float height );
348 void setText( sf::String& text );
363 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
364 virtual void checkMouseEvent(sf::Vector2i&,
bool);
365 virtual void symbolEntered(sf::Uint32){};
367 sf::RectangleShape checkedShape;
389 pSlider(
float x,
float y,
float width,
float height );
417 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
418 virtual void checkMouseEvent(sf::Vector2i&,
bool);
419 virtual void symbolEntered(sf::Uint32){};
421 sf::RectangleShape sliderShape;
443 pProgressBar(
float x,
float y,
float width,
float height );
472 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
473 virtual void checkMouseEvent(sf::Vector2i&,
bool){};
474 virtual void symbolEntered(sf::Uint32){};
476 sf::RectangleShape inBar;
513 pWindow(
float x,
float y,
float width,
float height );
574 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
575 void updateWindow(sf::Event&,
const sf::Window&);
576 virtual void checkMouseEvent(sf::Vector2i&,
bool){};
577 virtual void symbolEntered(sf::Uint32){};
579 sf::Vector2i mousePosition;
580 sf::RectangleShape titleBar;
581 sf::RectangleShape notActiveMask;
582 sf::Vector2i mOldPos;
583 sf::Vector2f widgetToggledSize;
589 std::vector<pWidget*> widgetsList;
609 class pGui :
public sf::Drawable
635 void update( sf::Event& event,
const sf::Window& window );
644 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
647 std::vector<pWidget*> widgetsList;
650 std::vector<pWindow*> windowsList;
654 sf::Vector2i mousePosition;