24 std::string fSampleText;
30std::shared_ptr<ROOT::RWebWindow> window;
31std::unique_ptr<TestPanelModel> model;
36 printf(
"connection established %u\n", connid);
38 window->Send(connid, std::string(
"MODEL:") +
json.Data());
43 printf(
"connection closed %u\n", connid);
46void ProcessData(
unsigned connid,
const std::string &arg)
48 if (arg ==
"REFRESH") {
50 printf(
"Send model again\n");
51 model->fButtonText =
Form(
"Custom button %d", ++
sendcnt);
53 window->Send(connid, std::string(
"MODEL:") +
json.Data());
54 }
else if (arg.find(
"MODEL:") == 0) {
56 auto m = TBufferJSON::FromJSON<TestPanelModel>(arg.substr(6));
58 printf(
"New model, selected: %s\n",
m->fSelectId.c_str());
61 printf(
"Fail to decode model: %s\n", arg.c_str());
69 model = std::make_unique<TestPanelModel>();
70 model->fSampleText =
"This is openui5 widget";
71 model->fComboItems = {{
"item1",
"Text 1"}, {
"item2",
"Text 2"}, {
"item3",
"Text 3"}, {
"item4",
"Text 4"}};
72 model->fSelectId =
"item2";
73 model->fButtonText =
"Custom button";
81 window->SetPanelName(
"localapp.view.TestPanel");
91 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)