-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileItem.h
51 lines (43 loc) · 1.37 KB
/
FileItem.h
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
#ifndef SFMLSET_FILEITEM_H
#define SFMLSET_FILEITEM_H
#include <list>
#include <iostream>
#include "LinkedList.h"
#include "Item.h"
#include "Image.h"
#include "MouseEvent.h"
#include "State.h"
class FileItem : public Item{
public:
//Constructors
FileItem();
// FileItem():
FileItem(Image::image icon, std::string text, sf::Vector2f size, sf::Vector2f position);
//GUIComponent pure virtual functions, refer to the TextInput Project for Info
virtual void draw(sf::RenderTarget& window, sf::RenderStates states) const;
//I use this function to highlight the item when clicked, and unhighlight when something
//else is clicked
virtual void addEventHandler(sf::RenderWindow& window, sf::Event event);
//Returns the bounds of the item
sf::FloatRect getGlobalBounds() const;
//returns the size of the item
sf::Vector2f getSize() const;
//returns the size of the item
sf::Vector2f getPosition() const;
//sets the position of the item
void setPosition(const sf::Vector2f pos) ;
//uses an enum to change the icon to a folder or file
// void setIcon(Image::image icon);
sf::Color GetFillColor();
bool stateChange();
string ClickData();
string Getstring();
private:
//this is the folder or file icon
Item item;
sf::Sprite Icon;
float padding = 5;
bool state;
string data;
};
#endif