Maximum Acyclic Subgraph - Multiple Sequence Alignment
MaximumAcyclicSubgraph
Public Member Functions | List of all members
Button Class Reference

This class generate a button for the GUI. More...

#include <Button.h>

Public Member Functions

 Button (std::string texturename, unsigned int x_pos, unsigned int y_pos, std::string nextStatus, std::string myStatus)
 
void load_Texture (std::string name)
 
sf::Sprite get_Button_Sprite ()
 
void eventHandler (const sf::Event &event, std::string &status, const sf::Vector2f &mouse_pos)
 
void setFunction (std::function< void()> func)
 
void setPosition (float x_pos, float y_pos)
 

Detailed Description

This class generate a button for the GUI.

Constructor & Destructor Documentation

Button::Button ( std::string  texturename,
unsigned int  x_pos,
unsigned int  y_pos,
std::string  nextStatus,
std::string  myStatus 
)
Parameters
texturenameis the name of the texture of the button
x_posis the x coordinate of the sprite in the window
y_posis the y coordinate of the sprite in the window
nextStatusis the status of the GUI after the Button was clicked
Returns
a Button with a texture on a specific position

Member Function Documentation

void Button::eventHandler ( const sf::Event &  event,
std::string &  status,
const sf::Vector2f &  mouse_pos 
)

This function handle events

Parameters
eventa Event which will describe the event that will happen
statusis the status of the current GUI
mouse_posthe current mouse position
sf::Sprite Button::get_Button_Sprite ( )
Returns
Button_Sprite
void Button::load_Texture ( std::string  name)

This function load a new texture for the Button.

Parameters
nameis the name of the new texture
void Button::setFunction ( std::function< void()>  func)

set the function of the Button

void Button::setPosition ( float  x_pos,
float  y_pos 
)

set a new position for the Button

Parameters
x_posis the new x-coordinate
y_posis the new y-coordinate

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