PeriDyno 1.0.0
Loading...
Searching...
No Matches
WFileWidget.h
Go to the documentation of this file.
1#pragma once
2#include <Wt/WContainerWidget.h>
3#include <Wt/WLineEdit.h>
4#include <Wt/WFileUpload.h>
5#include <Wt/WPushButton.h>
6#include <Wt/WString.h>
7#include <Wt/WVBoxLayout.h>
8#include <Wt/WMessageBox.h>
9
10#include <WParameterDataNode.h>
11
12#include <fstream>
13#include <filesystem>
14
15class WFileWidget : public Wt::WContainerWidget
16{
17public:
20
21 static Wt::WContainerWidget* WFileWidgetConstructor(dyno::FBase* field)
22 {
23 return new WFileWidget(field);
24 };
25
26 void setValue(dyno::FBase*);
27
28 //Called when the widget is updated
29 void updateField();
30 Wt::Signal<int>& changeValue()
31 {
32 return changeValue_;
33 }
34
35private:
37 Wt::WVBoxLayout* layout;
38 Wt::WLineEdit* mfilename;
39 //Wt::WPushButton* uploadButton;
40 Wt::WFileUpload* upload;
41 Wt::Signal<int> changeValue_;
42
43 void uploadFile();
44 void fileTooLarge();
45 bool hasFile(std::string);
46 std::string shortFilePath(std::string str);
47};
std::string shortFilePath(std::string str)
void setValue(dyno::FBase *)
dyno::FBase * mfield
Definition WFileWidget.h:36
WFileWidget(dyno::FBase *)
static Wt::WContainerWidget * WFileWidgetConstructor(dyno::FBase *field)
Definition WFileWidget.h:21
Wt::Signal< int > & changeValue()
Definition WFileWidget.h:30
void updateField()
Wt::WLineEdit * mfilename
Definition WFileWidget.h:38
bool hasFile(std::string)
Wt::WVBoxLayout * layout
Definition WFileWidget.h:37
Wt::Signal< int > changeValue_
Definition WFileWidget.h:41
void uploadFile()
void fileTooLarge()
Wt::WFileUpload * upload
Definition WFileWidget.h:40