blob: bd9dd8e6b386e9279b786dadc99ad22212353380 (
plain)
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
76
77
78
79
80
81
|
#pragma once
#include "widget.h"
#include "button.h"
#include "listbox.h"
#include "lineedit.h"
#include "label.h"
#include "image.h"
#include "directory.h"
#include "notifier.h"
namespace GUI {
class FileBrowser : public Widget {
public:
FileBrowser(Widget *parent);
~FileBrowser();
void setPath(const std::string& path);
Notifier<const std::string&> fileSelectNotifier;
bool isFocusable() override { return true; }
virtual void repaintEvent(RepaintEvent* repaintEvent) override;
virtual void resize(int w, int h) override;
private:
void listSelectionChanged();
void selectButtonClicked();
void cancelButtonClicked();
void handleKeyEvent();
Directory dir;
#ifdef WIN32
bool above_root;
bool in_root;
#endif
void cancel();
void changeDir();
Label lbl_path;
LineEdit lineedit;
ListBox listbox;
Button btn_sel;
Button btn_esc;
Image back;
};
}
|