25 std::string fSampleText;
31std::shared_ptr<ROOT::RWebWindow> window;
32std::unique_ptr<TestPanelModel> model;
37 printf(
"connection established %u\n", connid);
39 window->Send(connid, std::string(
"MODEL:") +
json.Data());
44 printf(
"connection closed %u\n", connid);
47void ProcessData(
unsigned connid,
const std::string &arg)
49 if (arg ==
"REFRESH") {
51 printf(
"Send model again\n");
52 model->fButtonText =
Form(
"Custom button %d", ++
sendcnt);
54 window->Send(connid, std::string(
"MODEL:") +
json.Data());
55 }
else if (arg.find(
"MODEL:") == 0) {
57 auto m = TBufferJSON::FromJSON<TestPanelModel>(arg.substr(6));
59 printf(
"New model, selected: %s\n",
m->fSelectId.c_str());
62 printf(
"Fail to decode model: %s\n", arg.c_str());
70 model = std::make_unique<TestPanelModel>();
71 model->fSampleText =
"This is openui5 widget";
72 model->fComboItems = {{
"item1",
"Text 1"}, {
"item2",
"Text 2"}, {
"item3",
"Text 3"}, {
"item4",
"Text 4"}};
73 model->fSelectId =
"item2";
74 model->fButtonText =
"Custom button";
82 window->SetPanelName(
"localapp.view.TestPanel");
92 window->SetGeometry(400, 500);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
static std::shared_ptr< RWebWindow > Create()
Create new RWebWindow Using default RWebWindowsManager.
static TString ToJSON(const T *obj, Int_t compact=0, const char *member_name=nullptr)