-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInputTargetChoicesView.cpp
38 lines (30 loc) · 1.62 KB
/
InputTargetChoicesView.cpp
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
#include "InputTargetChoicesView.hpp"
InputTargetChoicesView::InputTargetChoicesView(ViewController &vc) : vc{vc},
serialChoiceButtonView{this->make_child<SerialChoiceButtonView>(vc)},
serialTypeButtonView{this->make_child<SerialTypeButtonView>(vc)},
autoScrollToggle(this->make_child<cppurses::Push_button>("Toggle Autoscroll")),
saveButton(this->make_child<cppurses::Push_button>("Save Input Buffer")),
echoButton(this->make_child<cppurses::Push_button>("Toggle Local Echo"))
{
autoScrollToggle.height_policy.maximum(4);
autoScrollToggle.width_policy.maximum(30);
autoScrollToggle.brush.set_background(cppurses::Color::Light_blue);
autoScrollToggle.set_brush_paints_wallpaper(false);
saveButton.height_policy.maximum(4);
saveButton.width_policy.maximum(30);
saveButton.brush.set_background(cppurses::Color::Light_blue);
saveButton.set_brush_paints_wallpaper(false);
echoButton.height_policy.maximum(4);
echoButton.width_policy.maximum(30);
echoButton.brush.set_background(cppurses::Color::Light_blue);
echoButton.set_brush_paints_wallpaper(false);
autoScrollToggle.clicked.connect([this] {
this->vc.toggleAutoScroll();
});
saveButton.clicked.connect([this] {
this->vc.saveFile();
});
echoButton.clicked.connect([this] {
this->vc.toggleLocalEcho();
});
}