2016-04-27 10:30:11 +00:00
|
|
|
#ifndef __SKIZZLE_ACTION_TOOLBAR_HPP__
|
|
|
|
#define __SKIZZLE_ACTION_TOOLBAR_HPP__
|
|
|
|
|
|
|
|
#include <SFGUI/Widgets.hpp>
|
|
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
#include "../objects/object.hpp"
|
2016-04-28 12:27:48 +00:00
|
|
|
#include "../utility.hpp"
|
2016-04-27 10:30:11 +00:00
|
|
|
|
|
|
|
/**
|
2016-04-28 12:27:48 +00:00
|
|
|
* Barre d'outils pour les boutons d'actions en jeu
|
2016-04-27 10:30:11 +00:00
|
|
|
*/
|
|
|
|
class ActionToolbar {
|
|
|
|
private:
|
|
|
|
// widgets de la barre
|
|
|
|
sfg::Window::Ptr toolbar_window;
|
|
|
|
sfg::Box::Ptr toolbar_box;
|
2016-04-28 19:11:51 +00:00
|
|
|
|
2016-04-28 12:27:48 +00:00
|
|
|
sfg::Label::Ptr timer_label;
|
2016-04-28 19:11:51 +00:00
|
|
|
sfg::Box::Ptr timer_buttons_box;
|
|
|
|
sfg::Button::Ptr timer_button_up;
|
|
|
|
sfg::Button::Ptr timer_button_down;
|
2016-04-28 12:27:48 +00:00
|
|
|
|
|
|
|
int left_buttons_count;
|
|
|
|
int time;
|
2016-04-27 10:30:11 +00:00
|
|
|
|
2016-04-28 19:11:51 +00:00
|
|
|
/**
|
|
|
|
* Crée un bouton icône avec l'icône donnée
|
|
|
|
*/
|
|
|
|
sfg::Button::Ptr createButton(std::string name);
|
|
|
|
|
2016-04-27 10:30:11 +00:00
|
|
|
public:
|
|
|
|
ActionToolbar();
|
|
|
|
|
|
|
|
/**
|
2016-04-28 12:27:48 +00:00
|
|
|
* Ajoute un nouveau bouton d'action à gauche ou
|
|
|
|
* à droite de la barre d'action d'outils
|
2016-04-27 10:30:11 +00:00
|
|
|
*/
|
2016-04-27 17:58:22 +00:00
|
|
|
sfg::Button::Ptr addButton(
|
2016-04-28 12:27:48 +00:00
|
|
|
std::string name, Utility::Direction direction,
|
|
|
|
int position, std::function<void()> callback = std::function<void()>()
|
2016-04-27 17:58:22 +00:00
|
|
|
);
|
2016-04-27 17:44:40 +00:00
|
|
|
|
2016-04-27 10:30:11 +00:00
|
|
|
/**
|
|
|
|
* Récupère la fenêtre de la barre d'outils
|
|
|
|
*/
|
|
|
|
sfg::Window::Ptr getWindow();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Récupère la taille désirée par la barre d'outils
|
|
|
|
*/
|
|
|
|
float getHeight();
|
2016-04-28 12:27:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Récupère le temps restant
|
|
|
|
*/
|
|
|
|
int getTime();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Modifie le temps restant
|
|
|
|
*/
|
|
|
|
void setTime(int set_time);
|
2016-04-28 19:11:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Configure les boutons de modification du temps
|
|
|
|
*/
|
|
|
|
void setTimeEditable(
|
|
|
|
std::function<void()> up_callback = std::function<void()>(),
|
|
|
|
std::function<void()> down_callback = std::function<void()>()
|
|
|
|
);
|
2016-04-27 10:30:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|