Public Member Functions | Public Attributes | Friends | List of all members
pGui Class Reference

Main class of gui. More...

#include <primitiveGui.h>

Inheritance diagram for pGui:

Public Member Functions

 pGui ()
 
void addWidget (pWidget *widget)
 
void addWindow (pWindow *window)
 
void update (sf::Event &event, const sf::Window &window)
 
void changeOnTopWindow (pWindow *window)
 

Public Attributes

int windowOnTopId
 Index of window on top.
 

Friends

class pWindow
 

Detailed Description

Main class of gui.

This class inherits of sf::Drawable class from SFML.

This class contains all widgets, set it's unique index, handles events and draw widgets on main window.

Method update(...) must be call in event loop otherwise widgets will not be able to recive events:

while(mainWindow.isOpen())
while(mainWindow.pollEvent(event))
ourGui.update(event, mainWindow);

After clear main window you must draw gui

mainWindow.draw( ourGui );

Constructor & Destructor Documentation

pGui::pGui ( )

Default constructor.

Member Function Documentation

void pGui::addWidget ( pWidget widget)

Add widget to gui.

Parameters
*widget
void pGui::addWindow ( pWindow window)

Add window widget to gui.

Parameters
*window
void pGui::changeOnTopWindow ( pWindow window)

If you use windows you can set the window on top.

Parameters
*window
void pGui::update ( sf::Event &  event,
const sf::Window &  window 
)

Update gui, check widgets events

Parameters
event
window

The documentation for this class was generated from the following files: