Public Types | Public Member Functions | Public Attributes | Friends | List of all members
pWidget Class Referenceabstract

Abstract class. Every widget class inherits from this class. More...

#include <primitiveGui.h>

Inheritance diagram for pWidget:
pButton pCheckBox pProgressBar pSlider pTextEdit pWindow

Public Types

enum  widgetTypeEnum {
  Button =0, TextEdit, CheckBox, Slider,
  ProgressBar, Window
}
 Enumeration of the different types of widgets. More...
 
enum  widgetEventType { NoEvent =0, WidgetClicked }
 Enumeration of the different types of widgets. More...
 

Public Member Functions

 pWidget (float x, float y, float width, float height)
 
void setGeometry (float x, float y, float width, float height)
 
void setVisiblity (bool visiblity)
 
virtual void updateWidget ()=0
 

Public Attributes

int widgetId
 Widget unique index.
 
int widgetOnWindowId
 If widget is on some window this is a unique index of this window ( it's widgetId of this window ) else it is -1.
 
bool visiblity
 visibility of widget
 
widgetTypeEnum widgetType
 Type of the widget.
 
widgetEventType widgetEvent
 Type of the event.
 
sf::Vector2f widgetPosition
 Position of widget.
 
sf::Vector2f widgetSize
 Size of widget.
 

Friends

class pGui
 
class pButton
 
class pTextEdit
 
class pCheckBox
 
class pSlider
 
class pProgressBar
 
class pWindow
 

Detailed Description

Abstract class. Every widget class inherits from this class.

This class inherits of sf::Drawable class from SFML. It's a base class for all widgets.

Member Enumeration Documentation

Enumeration of the different types of widgets.

Enumerator
NoEvent 

Widget have no event.

WidgetClicked 

Widget is clicked.

Enumeration of the different types of widgets.

Enumerator
Button 

Widget type is button.

TextEdit 

Widget type is text edit.

CheckBox 

Widget type is check box.

Slider 

Widget type is slider.

ProgressBar 

Widget type is progress bar.

Window 

Widget type is window.

Constructor & Destructor Documentation

pWidget::pWidget ( float  x,
float  y,
float  width,
float  height 
)

Default constructor.

Parameters
x
y
width
height

Member Function Documentation

void pWidget::setGeometry ( float  x,
float  y,
float  width,
float  height 
)

Set window geometry - position and size If widget is in some pWindow widget you must set position ( x and y ) relative to this window

Parameters
x
y
width
height
void pWidget::setVisiblity ( bool  visiblity)

Set visiblity of widget. If vidget visiblity is false widget isn't shown and isn't recive any event's.

Parameters
visiblity
virtual void pWidget::updateWidget ( )
pure virtual

Update widget. Every widget have own impementation of this function, because some widgets have more elements to draw.

Implemented in pWindow, pProgressBar, pSlider, pCheckBox, pTextEdit, and pButton.


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