-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.h
67 lines (55 loc) · 1.66 KB
/
window.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 <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Box.H>
class MainWindow
{
public:
MainWindow() {}
Fl_Window *window;
Fl_Button *host_button, *transfer_button, *select_file_button;
Fl_Input *address_input, *java_prefix;
Fl_Box *path_display;
void configure()
{
//window
window = new Fl_Window(510, 100, "Fast Data Transfer Gui v1.1");
window->begin();
//buttons
host_button = new Fl_Button(10, 10, 100, 20, "Host Server");
transfer_button = new Fl_Button(10, 40, 100, 20, "Transfer File");
select_file_button = new Fl_Button(10, 70, 100, 20, "Select File");
//inputs
path_display = new Fl_Box(300, 10, 200, 20, "No File Selected");
path_display->box(FL_ENGRAVED_BOX);
address_input = new Fl_Input(300, 40, 200, 20, "Remote Address");
address_input->value("192.168.");
java_prefix = new Fl_Input(300, 70, 200, 20, "Java Prefix");
java_prefix->value("java -jar fdt.jar");
//image
// Fl_Box *img_box = new Fl_Box(550, 60, 0, 0, "");
// img_box->image(new Fl_JPEG_Image("img.jpg"));
// img_box->redraw();
}
int run(int argc, char **argv)
{
//show
window->end();
window->show(argc, argv);
return Fl::run();
}
void block_all()
{
transfer_button->deactivate();
address_input->deactivate();
java_prefix->deactivate();
}
void allow_all()
{
transfer_button->activate();
address_input->activate();
java_prefix->activate();
}
};