-
Notifications
You must be signed in to change notification settings - Fork 3
/
Drive.h
67 lines (53 loc) · 1.48 KB
/
Drive.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#include <string>
#include <SFML\Graphics.hpp>
using namespace sf;
using namespace std;
#include "Control.h"
class Drive:public Control
{
public:
Drive(const string &driveLetter);
void refresh();
string getPath();
string getLabel();
string getFileSysName();
unsigned long long getCapacity();
unsigned long long getUsedSpace();
unsigned long long getFreeSpace();
void draw(RenderTarget &target, RenderStates states) const override;
virtual FloatRect getGlobalBounds() const;
virtual Control * handleEvent(Event event, Vector2f mousePos);
virtual Control * clone() const;
~Drive();
private:
//Graphical
void loadDriveResources();
void refreshGraphicalVariables();
//Non Graphical
bool loadNames();//load label, drive letter etc
void refreshStatistics();
private:
//Graphical
static bool isDriveResourcesLoaded;
static Texture driveIcon;
static Font driveFont;
//Graphical Elements Variables
string labelAndLetterTxt;
string driveFileSystemTxt;
string driveSpaceInfoTxt;
Vector2f freeSpaceRectSize;
Vector2f usedSpaceRectSize;
float verticalSpacing=10;
float horizontalSpacing = 10;
static const sf::Color flatColorConcrete;
static const sf::Color flatColorMidnightBlue;
//Non Graphical
unsigned int driveType;
string rootPath="";
string label="";
string fileSystemName="";
unsigned long long capacity = 0;
unsigned long long usedSpace = 0;
unsigned long long freeSpace = 0;
};