This file is indexed.

/usr/lib/Wt/examples/widgetgallery/ExtWidgets.C is in witty-examples 3.1.10-1ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
/*
 * Copyright (C) 2008 Emweb bvba
 *
 * See the LICENSE file for terms of use.
 */

#include "ExtWidgets.h"
#include "EventDisplayer.h"
#include "DeferredWidget.h"

#include <Wt/Ext/Button>
#include <Wt/Ext/LineEdit>
#include <Wt/Ext/ComboBox>
#include <Wt/Ext/CheckBox>
#include <Wt/Ext/RadioButton>
#include <Wt/Ext/Calendar>
#include <Wt/Ext/DateField>
#include <Wt/Ext/Menu>
#include <Wt/Ext/ToolBar>
#include <Wt/Ext/NumberField>
#include <Wt/WButtonGroup>
#include <Wt/WVBoxLayout>
#include <Wt/WText>

using namespace Wt;
using namespace Wt::Ext;

ExtWidgets::ExtWidgets(EventDisplayer *ed):
  ControlsWidget(ed, true)
{
  new WText(tr("ext-intro"), this);
}

void ExtWidgets::populateSubMenu(WMenu *menu)
{
  menu->addItem("Ext::Button",
		deferCreate(boost::bind(&ExtWidgets::eButton, this)));
  menu->addItem("Ext::LineEdit",
		deferCreate(boost::bind(&ExtWidgets::eLineEdit, this)));
  menu->addItem("Ext::NumberField",
		deferCreate(boost::bind(&ExtWidgets::eNumberField, this)));
  menu->addItem("Ext::CheckBox",
		deferCreate(boost::bind(&ExtWidgets::eCheckBox, this)));
  menu->addItem("Ext::ComboBox",
		deferCreate(boost::bind(&ExtWidgets::eComboBox, this)));
  menu->addItem("Ext::RadioButton",
		deferCreate(boost::bind(&ExtWidgets::eRadioButton, this)));
  menu->addItem("Ext::Calendar",
		deferCreate(boost::bind(&ExtWidgets::eCalendar, this)));
  menu->addItem("Ext::DateField",
		deferCreate(boost::bind(&ExtWidgets::eDateField, this)));
  menu->addItem("Ext::Menu/ToolBar",
		deferCreate(boost::bind(&ExtWidgets::eMenu, this)));
  menu->addItem("Ext::Dialog",
		deferCreate(boost::bind(&ExtWidgets::eDialog, this)));
  //menu->addItem("Ext::Splitter", new WText("TODO: Ext::Splitter"));
}

WWidget *ExtWidgets::eButton()
{
  WContainerWidget *result = new WContainerWidget();

  topic("Ext::Button", result);
  new WText(tr("ext-Button"), result);

  WContainerWidget *ex = new WContainerWidget(result);
  WVBoxLayout *vLayout = new WVBoxLayout();
  ex->setLayout(vLayout, AlignTop);
  vLayout->setContentsMargins(0, 0, 0, 0);
  vLayout->setSpacing(3);

  Button *button;
  vLayout->addWidget(button = new Button("Push me!"));
  ed_->showSignal(button->clicked(), "Ext::Button clicked");
  vLayout->addWidget(button = new Button("Checkable button"));
  button->setCheckable(true);
  ed_->showSignal(button->clicked(), "Ext::Button (checkable) clicked");
  vLayout->addWidget(button = new Button("Button with icon"));
  button->setIcon("icons/yellow-folder-open.png");
  ed_->showSignal(button->clicked(), "Ext::Button (with icon) clicked");

  return result;
}

WWidget *ExtWidgets::eLineEdit()
{
  WContainerWidget *result = new WContainerWidget();

  topic("Ext::LineEdit", result);

  new WText(tr("ext-LineEdit"), result);
  LineEdit *le;
  le = new LineEdit(result);
  le->setTextSize(50);
  ed_->showSignal(le->keyWentUp(), "Ext::LineEdit keyWentUp");

  return result;
}

WWidget *ExtWidgets::eNumberField()
{
  WContainerWidget *result = new WContainerWidget();

  topic("Ext::NumberField", result);

  new WText(tr("ext-NumberField"), result);
  new WText("Total amount to pay: ", result);
  NumberField *nf = new NumberField(result);
  nf->setDecimalPrecision(2);
  nf->setInline(true);
  ed_->showSignal(nf->keyPressed(), "Ext::NumberField keyPressed");

  return result;
}

WWidget *ExtWidgets::eCheckBox()
{
  WContainerWidget *result = new WContainerWidget();

  topic("Ext::CheckBox", result);
  
  new WText(tr("ext-CheckBox"), result);
  CheckBox *cb;
  cb = new CheckBox("Check me!", result);
  ed_->showSignal(cb->checked(), "Ext::CheckBox checked");
  cb = new CheckBox("Check me too!", result);
  cb->setChecked(true);
  ed_->showSignal(cb->checked(), "Ext::CheckBox too checked");

  return result;
}

WWidget *ExtWidgets::eComboBox()
{
  WContainerWidget *result = new WContainerWidget();

  topic("Ext::ComboBox", result);

  new WText(tr("ext-ComboBox"), result);
  ComboBox *cb = new ComboBox(result);
  cb->addItem("Stella");
  cb->addItem("Duvel");
  cb->addItem("Sloeber");
  cb->addItem("Westmalle");
  cb->addItem("Kwak");
  cb->addItem("Hoegaarden");
  cb->addItem("Palm");
  cb->addItem("Westvleteren");
  cb->setCurrentIndex(1);
  ed_->showSignal(cb->activated(), "Ext::ComboBox activated");

  return result;
}

WWidget *ExtWidgets::eRadioButton()
{
  WContainerWidget *result = new WContainerWidget();

  topic("Ext::RadioButton", result);

  new WText(tr("ext-RadioButton"), result);
  WButtonGroup *bg = new WButtonGroup(result);
  RadioButton *rb;
  rb = new RadioButton("Kitchen", result);
  bg->addButton(rb);
  ed_->showSignal(rb->checked(), "Ext::RadioButton Kitchen checked");
  rb = new RadioButton("Dining room", result);
  bg->addButton(rb);
  ed_->showSignal(rb->checked(), "Ext::RadioButton Dining Room checked");
  rb = new RadioButton("Garden", result);
  bg->addButton(rb);
  ed_->showSignal(rb->checked(), "Ext::RadioButton Garden checked");
  rb = new RadioButton("Attic", result);
  bg->addButton(rb);
  ed_->showSignal(rb->checked(), "Ext::RadioButton Attic checked");

  return result;
}

WWidget *ExtWidgets::eCalendar()
{
  WContainerWidget *result = new WContainerWidget();

  topic("Ext::Calendar", result);

  new WText(tr("ext-Calendar"), result);
  Calendar *c = new Calendar(false, result);
  ed_->showSignal(c->selectionChanged(), "Ext::Calendar selectionChanged");

  return result;
}

WWidget *ExtWidgets::eDateField()
{
  WContainerWidget *result = new WContainerWidget();

  topic("Ext::DateField", result);

  new WText(tr("ext-DateField"), result);
  DateField *df = new DateField(result);
  df->setFormat("ddd MMM d yyyy");
  df->setTextSize(25);

  return result;
}

WWidget *ExtWidgets::eMenu()
{
  WContainerWidget *result = new WContainerWidget();

  topic("Ext::Menu", "Ext::ToolBar", result);

  new WText(tr("ext-Menu"), result);
  Ext::Menu *menu = new Ext::Menu();
  Ext::MenuItem *item;

  item = menu->addItem("File open...");
  item->setIcon("icons/yellow-folder-open.png");

  item = menu->addItem("I dig Wt");
  item->setCheckable(true);
  item->setChecked(true);
  
  item = menu->addItem("I dig Wt too");
  item->setCheckable(true);

  menu->addSeparator();
  menu->addItem("Menu item");
  menu->addSeparator();

  // Add a sub menu

  Ext::Menu *subMenu = new Ext::Menu();
  subMenu->addItem("Do this");
  subMenu->addItem("And that");
  
  item = menu->addMenu("More ...", subMenu);
  item->setIcon("icons/yellow-folder-open.png");
  
  // Create a tool bar
  
  Ext::ToolBar *toolBar = new Ext::ToolBar(result);
  
  Ext::Button *b
    = toolBar->addButton("Button w/Menu", menu);
  b->setIcon("icons/yellow-folder-closed.png");
  
  toolBar->addButton("Button");
  
  toolBar->addSeparator();
  toolBar->addButton("Separated");
  toolBar->addSeparator();
  Ext::Button *button = toolBar->addButton("Toggle me");
  button->setCheckable(true);
  
  Ext::ComboBox *cb = new Ext::ComboBox();
  cb->addItem("Winter");
  cb->addItem("Spring");
  cb->addItem("Summer");
  cb->addItem("Autumn");
  toolBar->add(cb);

  return result;
}

WWidget *ExtWidgets::eDialog()
{
  WContainerWidget *result = new WContainerWidget();

  topic("Ext::Dialog", "Ext::MessageBox", "Ext::ProgressDialog", result);

  new WText(tr("ext-Dialog"), result);

  return result;
}