1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
/*
special thanks to:
cire
naraku9333
*/
#include <TGUI/TGUI.hpp>
int main()
{
sf::RenderWindow App (sf::VideoMode(800, 600), "Fuck it. Uploads Happen.");
tgui::Gui Gui (App);
tgui::Picture::Ptr Background (Gui, "BackgroundImage");
tgui::EditBox::Ptr Picture (Gui, "PictureFolder"),
Status (Gui, "StatusList");
tgui::Label::Ptr PictureLabel (Gui);
tgui::Label::Ptr StatusLabel (Gui);
tgui::Button::Ptr Button (Gui);
if(!Gui.setGlobalFont("font/Exo-Light.otf")) return -1;
App.setPosition (sf::Vector2i(125, 75));
Background ->load ("Background.jpg");
Picture ->load ("widgets/EditBox/BabyBlue");
Picture ->setSize (400, 40);
Picture ->setPosition (200, 140);
Status ->load ("widgets/EditBox/BabyBlue");
Status ->setSize (400, 40);
Status ->setPosition (200, 290);
PictureLabel ->setText ("Pictures:");
PictureLabel ->setPosition (200, 100);
StatusLabel ->setText ("Status:");
StatusLabel ->setPosition (200, 250);
Button ->load ("widgets/Black.conf");
Button ->setSize (260, 60);
Button ->setPosition (270, 440);
Button ->setText ("Start");
Button ->bindCallback (tgui::Button::LeftMouseClicked);
Button ->setCallbackId (1);
while(App.isOpen())
{
sf::Event Event;
while(App.pollEvent(Event))
{
if(Event.type == sf::Event::Closed) App.close();
if(Event.type == sf::Event::KeyPressed && Event.key.code == sf::Keyboard::Escape) App.close();
Gui.handleEvent(Event);
}
tgui::Callback Callback;
while(Gui.pollCallback(Callback))
{
if (Callback.id == 1)
{
tgui::EditBox::Ptr PicturesBox = Gui.get("PictureFolder");
tgui::EditBox::Ptr StatusBox = Gui.get("StatusList");
sf::String PictureFolder = PicturesBox ->getText();
sf::String StatusList = StatusBox ->getText();
}
}
App.clear();
Gui.draw();
App.display();
}
return 0;
}
|