File: text.xml

package info (click to toggle)
witty 3.3.3%2Bdfsg-4.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 28,228 kB
  • ctags: 26,694
  • sloc: cpp: 147,809; ansic: 77,999; xml: 16,331; sh: 1,303; makefile: 198; java: 86; sql: 14
file content (5012 lines) | stat: -rw-r--r-- 178,273 bytes parent folder | download
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
<?xml version="1.0" encoding="UTF-8" ?>
<messages xmlns:if="Wt.WTemplate.conditions">

<!--LAYOUT message blocks-->
  <message id="layout-intro">
    <p class="lead">Layout &#8212; building blocks for organizing your
    application as a tree of widgets</p>
  </message>

  <message id="layout-Containers">
    <h2 id="containers">Containers</h2>
    <p>
      The primary method for combining a number of widgets in a composite
      widget is a ${doc-link WContainerWidget}. This widget corresponds to an
      HTML <tt>&lt;span&gt;</tt> or <tt>&lt;div&gt;</tt> element (depending on
      whether it is inline or not). It can contain any number of children, and
      these children may be added or removed dynamically.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Container}
      ${src Container}
    </fieldset>

    <p>
      Alternative to consider are a <a
      href="#/layout/html-templates">WTemplate</a>, which puts widgets
      inside an HTML fragment using placeholder substitution, or a <a
      href="#/trees-tables/table">WTable</a> for organizing children
      in a table (without using a layout manager).
    </p>
    ${<if:cpp>}
    <p>
      The container takes ownership of its children: when the parent
      is deleted, the children will be deleted as well. This does not
      stop you from deleting a child widget, as this also automatically
      removes it from the parent.
    </p>
    ${</if:cpp>}
    <p>
      As a fundamental building block of Wt, a container widget itself
      usually does not have any visual aspect (although it can very
      well be styled to give it for example margin and borders). The
      widgets that are contained can be positioned using <a
      href="#/layout/CSS">Cascading StyleSheets (CSS)</a> or a <a
      href="#/layout/layout-managers">Layout Manager</a>. CSS, which
      to most C++ developers will be a new technology, is worthwile
      learning as it will allow you to push many layout and style
      aspects of your application into a declarative text file. It
      also works irrespective of JavaScript, which is a clear benefit
      over layout managers. The latter are however the superior (and
      only) choice in case vertical fitting or stretching of children
      to the height of the container is needed.
    </p>
    <p>
      There are several specialized container classes that have
      additional markup or behaviour:
      <ul>
        <li><a href="#/layout/grouping-widgets">WGroupBox</a> adds a title and
          a frame
        </li>
        <li><a href="#/layout/grouping-widgets#panel">WPanel</a> adds
        a title and a collapsible frame</li>
        <li><a href="#/navigation/anchor">WAnchor</a> links to a URL
        </li>
        <li><a href="#/navigation/stacked-widget">WStackedWidget</a> displays
          only one of its children at a time</li>
      </ul>
    </p>

  </message>

  <message id="layout-Text">
    <h2 id="text">Text</h2>
    <p>
      Text provides a primary means for displaying information in the user
      interface. The ${doc-link WText} class provides a simple way to add plain
      or markup text to the user interface.
    </p>
    <p>
      The <tt>WText</tt> widget displays text using an HTML <tt>&lt;span&gt;
      </tt> or <tt>&lt;div&gt;</tt> element (depending on whether it is inline
      or not). It can display either XHTML formatted text or plain text.
    </p>
    <p>
      The text contents is contained in a ${doc-link WString}. This string
      class provides at the same time support for localization and
      internationalization:
      <ul>
        <li>It is a unicode string (internally store as UTF-8) with an
        API to interact with plain C++ strings.
        </li>
        <li>It supports localization, when created using <a href=
        "${doc-url}classWt_1_1WString.html#0afc7dc0f9897456d71b569a86ca26c1"
        target="_blank">WString::tr()</a>. The actual value
        corresponding to a key is retrieved from a ${doc-link
        WLocalizedStrings} instance, taking into account the current
        locale. The default implementation of this interface class
        uses XML files, which are convenient for specifying XHTML
        snippets.</li>
      </ul>
    </p>
    <p>
      In its most simple form, the <tt>WText</tt> widget displays plain text
      (escaping special characters as needed).
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${TextPlain}
      ${src TextPlain}
    </fieldset>
    
    <p>
      Of course, a <tt>WText</tt> widget may also display XHTML formatted text.
    </p>
    
    <fieldset class="example">
      <legend>Example</legend>
      ${TextXHTML}
      ${src TextXHTML}
    </fieldset>

    <p>
      XHTML text that is not read from a localized strings interface (which is
      considered inherently safe), is protected against unwanted side effects
      from Cross-Site Scripting (XSS) attacks. The text of an XHTML-formatted
      <tt>WText</tt> is filtered using an XML parser and all malicious tags are
      removed (unless this feature is explicitly by-passed by using the
      <tt>XHTMLUnsafeText</tt> text format).
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${TextXSS}
      ${src TextXSS}
    </fieldset>

    <p>
      If you want to display a text label associated with a form field then a
      ${doc-link WLabel} is more suitable as it can be linked to the input
      field, relaying focus to it when clicked.
    </p>
    <p>
      If you want to display an HTML fragment which contains widgets or other
      bound contents, then a <a href="#/layout/html-templates">WTemplate</a>
      widget is probably what you are looking for.
    </p>

    <p><a href="#text">Top</a></p>

    <h3>Events</h3>
    <p>
      The functionality of <tt>WText</tt> is very basic. As this widget derives
      - like many widgets - from ${doc-link WInteractWidget} it may respond to
      to mouse events and also keyboard events if it can be given keyboard
      focus. A few mouse events are demonstrated below.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${TextEvents}
      ${src TextEvents}
    </fieldset>

    <h3>ToolTip</h3>
    <p>
      You may add a tooltip or deferred tooltip to <tt>WText</tt> 
    </p>

    <fieldset class="example">
      <legend>Tooltip example</legend>
      ${TextToolTip}
      ${src TextToolTip}
    </fieldset>

    <fieldset class="example">
      <legend>Deferred tooltip example</legend>
      ${TextDeferredToolTip}
      ${src TextDeferredToolTip}
    </fieldset>

    <p><a href="#text">Top</a></p>

  </message>

  <message id="layout-Template">
    <h2 id="templates">HTML Templates</h2>
    <p>
      A ${doc-link WTemplate} can be used to format a number of widgets within
      an XHTML fragment. This is especially useful as an alternative to a
      container widget if you want to use CSS for style and layout, and when
      the contents is relatively static: for each placeholder you must bind a
      widget or a string (which can be empty).
    </p>
    <p>
      In a template text, a <tt>$${<i>var</i>}</tt> indicates a place holder
      named <strong>var</strong> which is substituted with a widget or string
      that is bound to that variable. Other syntactical constructs are:
      <dl class="dl-horizontal">
        <dt>arguments</dt>
        <dd><tt>$${<i>var arg1 arg2</i>}</tt></dd>
        <dt>conditions</dt>
        <dd><tt>$${&lt;<i>condition</i>&gt;} ...
        $${&lt;/<i>condition</i>&gt;}</tt>
        </dd>
        <dt>functions</dt>
        <dd><tt>$${<i>fun:arg1 arg2</i>}</tt></dd>
      </dl>
    </p>
    <p>
      The template text can be provided by a <tt>WString</tt> and is thus
      easily localized and internalitionalized using a message resource bundle.
    </p>
    <p>
      Below is an example of a template text, illustrating the use of place
      holders for a line edit and two buttons.
    </p>

    <fieldset class="src">
      <legend>source</legend>
      <pre>${template-text}</pre>
    </fieldset>

    <p>
      This template text, made available as a string in a resource bundle with
      the id "WTemplate-example", is used by the following example:
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Template}
      ${src Template}
    </fieldset>

    <p>
      If you want to simply display an HTML fragment without binding
      any widgets within it, then the <a href="#/layout/text">WText</a>
      widget is probably what you are looking for.
    </p>

    <p><a href="#templates">Top</a></p>

  </message>

  <message id="WTemplate-example">
    <div class="form">
      <p>
        <label>Please enter your name: ${name-edit}</label>
      </p>
      <p>
        ${save-button} ${cancel-button}
      </p>
    </div>
  </message>

  <message id="layout-Grouping">
    <h2 id="grouping">Group box</h2>
    <p>
      A ${doc-link WGroupBox} corresponds to an HTML
      <tt>&lt;fieldset&gt;</tt> element, and provides a frame and
      title around a group of widgets.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${GroupBox}
      ${src GroupBox}
    </fieldset>

    <p>
      It is usually styled using the CSS stylesheet which provides many
      options for layout of the legend (title) and the box contents.
    </p>

    <h2 id="panel">Panel</h2>
    <p>
      A ${doc-link WPanel} is similar to a group box, but provides
      optional functionality to collapse or expand its contents, and a
      theme-based style.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PanelNoTitle}
      ${src PanelNoTitle}
    </fieldset>

    <fieldset class="example">
      <legend>Example</legend>
      ${Panel}
      ${src Panel}
    </fieldset>

    <fieldset class="example">
      <legend>Example</legend>
      ${PanelCollapsible}
      ${src PanelCollapsible}
    </fieldset>

    <p><a href="#grouping">Top</a></p>

  </message>

  <message id="layout-Managers">
    <h2 id="managers">Layout Managers</h2>
    <p>
      Usually, CSS is a sufficient and convenient way to indicate how to
      layout widgets within a container widget, and we recommend to get
      accustomed with CSS for basic layout and styling.
    </p>
    <p>
      There are however several situations when CSS is not effective
      to create a layout, especially for complex web applications. In
      particular, when placing contents within a dialog it is often
      necessary to adjust its contents to available vertical space,
      and it is often desirable to distribute excess space to a
      particular widget while keeping other widgets to their preferred
      size. It is for these reasons that Wt has a comprehensive set of
      layout managers that use JavaScript to compute and apply layout
      managent to children of a <a
      href="#/layout/containers">WContainerWidget</a>.
    </p>
    <p>
      Wt provides the typical box, grid or border layout management
      options and layout managers and CSS can safely be intermixed.
    </p>

    <h3 id="layout-box">Box Layout</h3>
    <p>
      ${doc-link WVBoxLayout} and ${doc-link WHBoxLayout} provide
      respectively vertical and horizontal layout of widgets inside a
      <a href="#/layout/containers"><tt>WContainerWidget</tt></a>.
    </p>
    <p>
      In a horizontal box layout, widgets are given an appropriate
      width based on available space in the container and layout
      rules, while all widgets get the same height. Similarly, in a
      vertical box layout, widgets are given appropriate heights based
      on available space in the container and layout rules, while all
      widgets get the same width.
    </p>
    <p>
      In the example below, a <tt>WHBoxLayout</tt> with default
      padding (9 pixels) and spacing (6 pixels) is used to manage two
      child widgets. If no stretch factors have been specified, space
      is evenly distributed to all widgets.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${HBoxLayout}
      ${src HBoxLayout}
      <p>
	The coloring for this and the following examples are provided
	by a stylesheet that you need to load using
	<tt>WApplication::useStyleSheet()</tt>:
      </p>
      <fieldset class="src">
	<legend>CSS</legend>
	${tr:src-layout}
      </fieldset>
    </fieldset>

    <p>
      By giving <strong>Item 1</strong> a non-zero stretch factor value of 1,
      <strong>Item 2</strong> will only use its preferred width, and
      <i>Item 1</i> consumes all excess space, as illustrated below.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${HBoxLayoutStretch}
      ${src HBoxLayoutStretch}
    </fieldset>

    <p>
      The preferred width of a widget is either based on its contents
      (which for text is the in some cases inpractical assumption of
      putting all text on a single line), but can be further
      controlled using <tt>widget->setWidth()</tt> or CSS
      <tt>width</tt> settings.
    </p>
    <p>
      The <tt>WVBoxLayout</tt> works in exactly the same way, but
      stacks children vertically.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${VBoxLayout}
      ${src VBoxLayout}
    </fieldset>

    <fieldset class="example">
      <legend>Example</legend>
      ${VBoxLayoutStretch}
      ${src VBoxLayoutStretch}
    </fieldset>

    <p>
      Layout managers may be arbitrarily nested, either directly, or
      indirectly through widget composition, to create complex
      layouts. Layout managers fully cooperate with CSS, honoring the
      CSS margins and paddings of children, but also those of
      intermediate widgets in complex layouts.
    </p>
    <p>
      In the example below we nest a <tt>WHBoxLayout</tt> containing
      two items in a <tt>WVBoxLayout</tt> containing one other item.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${NestedLayout}
      ${src NestedLayout}
    </fieldset>

    <p><a href="#managers">Top</a></p>

    <h3 id="layout-grid">Grid Layout</h3>
    <p>
      This layout manager organizes the contents of a <a
      href="#/basics/wcontainerwidget"><tt>WContainerWidget</tt></a>
      in a grid.
    </p>
    <p>
      Like <a
      href="#/style-and-layout/wboxlayout"><tt>WBoxLayout</tt></a>, a
      stretch factor defined for rows or columns is used to distribute
      excess space. In the example below, row 1 and columns 1 and 2
      are given a non-zero stretch factor.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${GridLayout}
      ${src GridLayout}
    </fieldset>

    <p><a href="#managers">Top</a></p>

    <h3 id="layout-border">Border Layout</h3>
    <p>
      This is a layout manager that organizes the container space in up to 5
      regions, with a central region consuming any excess space.
    </p>
    <p>
      Any of the regions can be omitted.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${BorderLayout}
      ${src BorderLayout}
    </fieldset>

    <p><a href="#managers">Top</a></p>

  </message>

  <message id="borderlayout-item">
    <div>
      {1} item
    </div>
  </message>

  <message id="layout-Dialogs">
    <h2 id="dialogs">Dialogs</h2>
    <p>
      A dialog is a window used to communicate information to the user
      and/or prompt the user for a response. Use the class ${doc-link
      WDialog} to show a dialog. A specialized dialog is also
      available to alert the user with a message then use the simple
      <a href="#message-box">WMessageBox</a> dialog.
    </p>
    <p>
      By default, a <tt>WDialog</tt> is modal. A modal window blocks
      the user interface, and does not allow the user to interact with
      any other part of the user interface until the dialog is
      closed. With a modeless dialog the window can be left open while
      the user continues in another window of the application. Use
      <tt>setModal(false)</tt> to create a non-modal dialog.  In the
      <a href="#message-box">Message box</a> section below you can
      find an example of a modeless window.
    </p>
    <p>
      Unlike other widgets, a dialog does not need to be added to a parent
      widget, and it is hidden by default. You must use the method
      <tt>show()</tt> or <tt>setHidden(false)</tt> to show the dialog. The
      dialog may be closed by calling <tt>accept()</tt>, <tt>reject()</tt> or
      <tt>done()</tt> (or connecting a signal to one of these methods). This
      will hide the dialog and emit the <tt>finished()</tt> signal, which you
      then can listen for to process the dialog result${<if:cpp>} and delete
      the dialog${</if:cpp>}.
      Typically, an OK button will be connected to <tt>accept()</tt>, and in
      some cases a Cancel button to <tt>reject()</tt>.
      You can add content to the dialog by adding the content to its container.
      You can get the container with the <tt>contents()</tt> method.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Dialog}
      ${src Dialog}
    </fieldset>

    <p>
      A modal dialog can be instantiated in two ways &#8212;
      synchronously or asynchronously &#8212; while a non-modal dialog
      can only be instantiated asynchronously. By preference
      instantiate a dialog asynchronously. The synchronous use of a
      dialog is what is commonly done in desktop applications to show
      a modal dialog, and involves a call to <tt>exec()</tt> that
      starts a local event loop, and returns only when the dialog is
      closed. The draw-back of synchronous use is that the application
      is not scalable to many concurrent sessions, since it blocks a
      thread. This means it is only suitable for applications with
      restricted access or applications that are deployed on an
      intranet or extranet. When using a dialog asynchronously, there
      is no API call that waits for the dialog to be closed. In this
      case, the usage is similar to instantiating any other
      widget.
    </p>

    <p><a href="#dialogs">Top</a></p>

    <h3 id="message-box">Message box</h3>
    <p>
      A message box is a simple dialog to alert the user with a message. It may
      require an acknowledgment that the message has been read (usually by
      clicking an "OK" button), or a decision as to whether or not an action
      should proceed (by clicking an "OK" or "Cancel" button).
    </p>
    <p>
      The usage is similar to instantiating a <tt>WDialog</tt> (or any other
      widget). You need to connect to the <tt>buttonClicked</tt> signal with a
      method that interpretes the result${<if:cpp>} and deletes the message
      box${</if:cpp>}.
      You can get the resulting standard button with <tt>buttonResult()</tt>.
    </p>
    <p>
      The buttons of a ${doc-link WMessageBox} may be standard or customized
      type of buttons. Customized buttons should be dealt with using
      the <tt>result()</tt> method from the parent <tt>WDialog</tt>.
      The strings used in standard buttons can be translated by overriding the
      default values of localization keys.
    </p>
<!--    <p>
      You can include an icon in a <tt>WMessageBox</tt>. You can choose from
      the following types:
      <dl class="dl-horizontal">
        <dt>Information</dt>
        <dd>An information icon</dd>
        <dt>Warning</dt>
        <dd>A warning icon</dd>
        <dt>Critical</dt>
        <dd>An critical icon</dd>
        <dt>Question</dt>
        <dd>An question icon</dd>
      </dl>
    </p>-->

    <fieldset class="example">
      <legend>Example</legend>
      ${MessageBox}
      ${src MessageBox}
    </fieldset>

    <p>
      The following example is much more compact but it has a big disadvantage
      because the messagebox is instantiated synchronously. The <tt>show()</tt>
      method is used statically; this involves the static use of the
      <tt>exec()</tt> method which blocks the current thread until the user has
      clicked a button and the result of the messagebox is processed.
      It is highly recommended to use a messagebox asynchronously because there
      is no API call that waits for the messagebox to be processed in that
      case.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${MessageBoxSync}
      ${src MessageBoxSync}
    </fieldset>

    <p>
      A <tt>WMessageBox</tt> can be styled using the <tt>Wt-dialog</tt> and
      <tt>Wt-outset</tt> style classes from it's superclass <tt>WDialog</tt>.
      Its buttons can be styled using the <tt>Wt-msgbox-buttons</tt> style
      class.
    </p>

    <p><a href="#dialogs">Top</a></p>

  </message>

  <message id="layout-Images">
    <h2 id="images">Images</h2>
    <p>
      A ${doc-link WImage} is a widget that displays an image. The image may be
      specified either as a URL, or may be dynamically generated by a
      <a href="#/media/resources">WResource</a>.
    </p>
    <p>
      You can set an alternate text using the method
      <tt>setAlternateText()</tt>. The alternate text should provide a
      fallback for browsers that do not display an image, and are also
      important for accessibility. If no sensible fallback text can be
      provided, an empty text is preferred over nonsense.
    </p>
    <p>
      You may listen to events by attaching event listeners to signals such as
      <tt>clicked()</tt>. Since mouse events pass the coordinates through a
      A ${doc-link WMouseEvent} object, it is possible to react to clicks in
      specific parts of the image.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Image}
      ${src Image}
    </fieldset>

    <p>
      Image also supports a more structural approach to listening for
      events depending on the image location. One can define
      interactive areas on the image using <tt>addArea()</tt>, which
      also allows to define a custom tool tip (using
      <tt>WAbstractArea::setToolTip()</tt>) or a different cursor
      image (using <tt>WAbstractArea::setCursor</tt>) for a certain
      image area.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${ImageArea}
      ${src ImageArea}
    </fieldset>

    <p>
      In contrast to the image, which displays typically a static
      image resource, Wt are also includes several options for
      dynamically <a href="#/graphics-charts">painted graphics</a>.
    </p>
    <p>
      <tt>WImage</tt> is an inline widget. The widget corresponds to the HTML
      <tt>&lt;img&gt;</tt> tag and doesn't provide styling. It can be styled
      using inline or external CSS as appropriate.
    </p>

    <p><a href="#images">Top</a></p>

  </message>

  <message id="layout-CSS">
    <h2 id="CSS">Styling (and Layout) with CSS</h2>
    <p>
      There are different techniques and technologies available to
      determine the size (width and height) of a rendered widget.
      <dl class="dl-horizontal">
        <dt>CSS</dt>
        <dd>The browser uses CSS (Cascading Style Sheets) as a
        technology for defining visual aspects, such as fonts, colors,
        border styles, but also for geometry.</dd>
        <dt>Layout Managers</dt>
        <dd>Whereas CSS (and browsers) were originally designed for
        the markup of documents, the requirements for web applications
        are in many ways different. <a
        href="#/layout/layout-managers">Layout Managers</a> are a
        common technique in desktop applications to layout a UI, and
        this is also available in Wt.</dd>
        <dt>CSS Grids</dt>
        <dd>A practical alternative to plain CSS, and to overcome some
        of its deficiencies which, are CSS frameworks which allow one
        to place widgets using a generic tag system. These typically
        divide the page in a virtual grid. When using Wt with the Bootstrap
        theme, such a CSS grid framework is included.</dd>
      </dl>
    </p>

    <h3>Introduction to CSS</h3>
    <p>
      Cascading Style Sheets (CSS) group rules that specify both
      markup and layout properties of widgets. These rules are linked
      to certain widgets (or more correctly, DOM nodes in the browser
      that render these widgets) using selectors. Selectors may match
      widgets based on the style class or widget id of the widget or
      one of its ancestors, or even more advanced combinations.
    </p>

    <p>
      Primer + reference here.
    </p>

    <p>
      Three ways to use CSS in Wt.
      <dl class="dl-horizontal">
        <dt>Inline CSS</dt>
        <dd>A single widget's style properties can be modified directly using
        C++ API</dd>

        <dt>Internal StyleSheet</dt>
        <dd>The internal stylesheet allows to use a C++ API to create,
        modify and remove CSS style rules that typically impact
        multiple widgets.</dd>

        <dt>External StyleSheets</dt>
        <dd>By far the most practical approach is to use external CSS
        stylesheets that define styling rules, and apply them to Wt widgets
        using style classes.</dd>
      </dl>
    </p>

    <h3>API for inline CSS style</h3>
    <p>
      A subset of CSS properties are available in the Wt API, and thus
      allow to influence the layout or visual appearance of a widget
      directly, from C++. This is useful if you want programmatic
      control over these properties; for other situations we recommend
      to use a n external CSS stylesheet.
    </p>

    <p>
      CSS properties that impact layout aspects are made available directly
      in the <tt>WWidget</tt> API, whereas decorative aspects are available
      from <tt>WWidget::cssDecorationStyle()</tt>, which returns a reference
      to a <tt>WCssDecorationStyle</tt> class.
    </p>

    <p>
      The following table gives an overview of properties that can be
      directly modified from C++.

      <table class="table table-bordered table-striped">
        <thead>
          <tr>
            <th>Class</th>
            <th>Property</th>
            <th>Description</th>
         </tr>
        </thead>
        <tbody>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setPositionScheme()</tt></td>
            <td>CSS <tt>position</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setOffsets()</tt></td>
            <td>CSS <tt>top, right, bottom, left</tt> properties.</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>resize()</tt></td>
            <td>CSS <tt>width, height</tt> properties.</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setMinimumSize()</tt></td>
            <td>CSS <tt>min-width, min-height</tt> properties.</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setMaximumSize()</tt></td>
            <td>CSS <tt>max-width, max-height</tt> properties.</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setLineHeight()</tt></td>
            <td>CSS <tt>line-height</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setFloatSide()</tt></td>
            <td>CSS <tt>float</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setClearSides()</tt></td>
            <td>CSS <tt>clear</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setMargin()</tt></td>
            <td>CSS <tt>margin</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setVerticalAlignment()</tt></td>
            <td>CSS <tt>vertical-align</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setInline(), setHidden()</tt></td>
            <td>CSS <tt>display</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WCssDecorationStyle}</td>
            <td><tt>setCursor()</tt></td>
            <td>CSS <tt>cursor</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WCssDecorationStyle}</td>
            <td><tt>setBackgroundColor(), setBackgroundImage()</tt></td>
            <td>CSS <tt>background</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WCssDecorationStyle}</td>
            <td><tt>setForegroundColor()</tt></td>
            <td>CSS <tt>color</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WCssDecorationStyle}</td>
            <td><tt>setBorder()</tt></td>
            <td>CSS <tt>border</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WCssDecorationStyle}</td>
            <td><tt>setFont()</tt></td>
            <td>CSS <tt>font</tt> property.</td>
          </tr>
          <tr>
            <td>${doc-link WCssDecorationStyle}</td>
            <td><tt>setTextDecoration()</tt></td>
            <td>CSS <tt>text-decoration</tt> property.</td>
          </tr>
        </tbody>
      </table>
    </p>

    <h3>The Internal Style Sheet</h3>

    <p>
      The method <tt>WApplication::styleSheet()</tt> returns a
      reference to the embedded stylesheet (an instance of
      <tt>WCssStyleSheet</tt>), which can be manipulated dynamically
      to add, modify or removing rules. This is used primarily in some
      advanced composite widgets within Wt (such as <a
      href="#/trees-tables/mvc-table-views">WTableView</a>,
      <a href="#//trees-tables/mvc-tree-views">WTreeView</a>)
      since it allows to modify certain properties of a group of
      widgets using a minimum of DOM manipulations.
    </p>

    <h3>Using External Style Sheets</h3>

    <p>
      Widgets may allow configuration of their look and feel through style
      classes. These may be defined in an embedded stylesheet or in external
      style sheets. Preferably use external stylesheets because of the strict
      separation between style and widget. It provides the broadest application
      of style as it allows you to manage the presentational aspects of all
      widgets from a handful of style sheets.
    </p>

    <p>
      These are API classes and methods for working with CSS external
      stylesheets:
      <table class="table table-bordered table-striped">
        <thead>
          <tr>
            <th>Class</th>
            <th>Method</th>
            <th>Description</th>
         </tr>
        </thead>
        <tbody>
          <tr>
            <td>${doc-link WApplication}</td>
            <td><tt>useStyleSheet()</tt></td>
            <td>Adds an external style sheet</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>setStyleClass()</tt></td>
            <td>Sets (one or more) CSS style classes</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>styleClass()</tt></td>
            <td>Returns the CSS style class</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>addStyleClass()</tt></td>
            <td>Adds a CSS style class</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>removeStyleClass</tt></td>
            <td>Removes a CSS style class</td>
          </tr>
          <tr>
            <td>${doc-link WWidget}</td>
            <td><tt>toggleStyleClass</tt></td>
            <td>Toggles a CSS style class</td>
          </tr>
        </tbody>
      </table>
    </p>

    <p>
      The following example shows how to refer to add an external style sheet
      to the application and how to add/remove classes to a widget like
      ${doc-link WTable}.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${CSS}
      ${src CSS}
      <p>
        Here is the corresponding style sheet (CSSexample.css).
      </p>
      ${src CSSexample}
    </fieldset>

    <p><a href="#CSS">Top</a></p>

  </message>

  <message id="layout-Themes">
    <h2 id="theme">Styling with a theme</h2>
    <p>
      A theme provides the look and feel of several built-in widgets, using CSS
      style rules. The rules for each CSS theme are defined in the folder
      <tt>resources/themes/</tt>. There each theme is organized in a subfolder.
    </p>
    <p>
      You can choose from three themes:
      <dl class="dl-horizontal">
        <dt>default</dt>
        <dd>You don't have to do anything to use this theme from the
          ${doc-link WCssTheme} class as it is the default theme.
        </dd>
        <dt>polished</dt>
        <dd>This theme is also implemented by the ${doc-link WCssTheme} class.
          You can change to this CSS theme with <tt>setCssTheme("polished")</tt>
          in your ${doc-link WApplication}.
        </dd>
        <dt>bootstrap</dt>
        <dd>
	  <p>
	    This theme is implemented by the ${doc-link WBootstrapTheme}
	    class, and relies on <a
	    href="http://getbootstrap.com/">Twitter's Bootstrap CSS
	    framework</a>. Use <tt>setTheme(new WBootstrapTheme())</tt>
	    to use this theme.
	  </p>
	  <p>
	    As of version 3.3.2, Bootstrap 2 and Bootstrap 3 versions
	    are supported. The widget gallery has been restyled to use
	    Bootstrap 3. While the theme makes sure that Wt's widgets
	    are rendered with the markup expected by bootstrap, there
	    are many features that are particular to the layout system
	    of bootstrap (and chaned from version 2 to version
	    3). Thus you need to know how bootstrap expects you to
	    layout widgets in order to effectivily use this theme, for
	    which we refer to the <a
	    href="http://getbootstrap.com/">Bootstrap
	    documentation</a>.
	  </p>
        </dd>
      </dl>
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${src theme}
    </fieldset>

    <h3>Remark</h3>
    <p>
      Setting an empty theme (with parameter "") will result in a stub CSS theme
      that does not load any stylesheets.
    </p>

    <p><a href="#theme">Top</a></p>

  </message>

<!--FORMS message blocks-->

  <message id="formwidgets-intro">
    <p class="lead">Forms &#8212; widgets and support classes for capturing user information</p>
  </message>

  <message id="forms-introduction">
    <h2 id="forms">Introduction</h2>
    <p>
      There are two ways in which you can compose a form:
      <ul>
        <li><a href="#form-simple">using a simple form</a></li>
        <li><a href="#form-model">using a Model-View concept</a></li>
      </ul>
    </p>

    <h3 id="form-simple">Simple form</h3>
    <p>
      You can create a simple form by using one or more input widgets like
      ${doc-link WLineEdit} in addition to a ${doc-link WPushButton} to
      process the input.
      You can add <tt>Validation</tt> to filter the user's input (See also the
      menu <a href="#/forms/validation">Validation</a>).
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${SimpleForm}
      ${src SimpleForm}
      <p>
        Here is the corresponding XML template (with
        <tt>message id="simpleForm-template"</tt>) using style classes from the
        <a href="http://twitter.github.com/bootstrap/base-css.html"
        target="blank">Bootstrap theme</a>.
        In order to apply validation style to any widget with invalid input,
        you should group the widgets in a div or span section and apply the
        style <tt>form-group </tt> to it.
      </p>
      <fieldset class="src">
        <legend>source</legend>
        <pre>${simpleForm-template}</pre>
      </fieldset>
    </fieldset>

    <p><a href="#forms">Top</a></p>

    <h3 id="form-model">Model/view concept</h3>
    <p>
      It is more convenient to create a form using a model/view concept. The
      model is a specialisation of ${doc-link WFormModel} while the
      complementary template-based view class is a specialisation of
      ${doc-link WTemplateFormView}. The main advantage is that forms based on
      this concept are structured in a uniform way.
    </p>
    <p>
      The form model implements field data and validation handling for (simple)
      form-based views. It provides a standard way for views to perform field
      validation, and react to validation results.
      Each field has a string literal assigned to it. The string literal
      uniquely identifies the field. For each field, its value, the visibility,
      whether the field is read-only, and its current validation status is
      managed by the model.
      In addition, you will typically specialize the class to customize the
      validation and application logic. Although it can be setup to use <tt>
      WValidator</tt> objects for individual fields, you could also create a
      validator to simultaneously validate interdependent fields.
    </p>
    <p>
      A model is typically used by a view (<tt>WTemplateFormView</tt>) which
      renders the fields configured in the model, updates the model values,
      invokes and reflects the validation status. For each model field, the
      view uses a number of conventional variable names to represent the
      label, editor, and validation messages in the template:
      <dl class="dl-horizontal">
        <dt>field</dt>
        <dd>
          This variable name refers to the <strong>form widget</strong> which
          contains the value. It is used by <tt>createFormWidget()</tt> at the
          moment that the form is created.
        </dd>
        <dt>field-label</dt>
        <dd>
          This variable name refers to the <strong>label</strong>. It is used
          by <tt>label()</tt>.
        </dd>
        <dt>field-info</dt>
        <dd>
          This variable name refers to <strong>details</strong> on the field. This
          could be input advice (e.g. the format or the range) or a validation
          message. It is used by <tt>addField()</tt> and <tt>validate()</tt>.
        </dd>
        <dt>if:field</dt>
        <dd>
          This variable name refers to a condition for the
          <strong>visibility</strong> of the field. It is used by
          <tt>isVisible()</tt>.
        </dd>
      </dl>
    </p>
    <p>
      For a field with the name 'field', a typical template contains a block in
      the following format:
      <fieldset class="src">
        <legend>source</legend>
        <pre>${form-field}</pre>
      </fieldset>
    </p>
    <p>
      The view can update the form using several methods. The <tt>updateView()
      </tt> method updates the view based on a model (e.g. to propagate changed
      values or validation), while the <tt>updateModel()</tt> method updates a
      model with values entered in the view.
      The view doesn't have to render all fields of a model. You can call
      <tt>updateViewField()</tt> and <tt>updateModelField()</tt> to update
      individual model fields.
    </p>
    <p>
      The view is passive. It will not perform any updates by itself if either
      the view or model has changed. To update the form, each view method uses
      a service method from the model; either <tt>setValue()</tt> to update the
      model or <tt>value()</tt> to update the view. You will typically bind a
      method to a button in order to process the form (i.e. update and validate
      the model).
    </p>
    <p>
      <img src="/pics/model-view.png" alt="model-view picture"></img>
    </p>
    <p>
      The view may render fields of more than one model. Note that there are
      still other models like ${doc-link WStandardItemModel} which can be used
      to represent tables, trees and tree tables.
    </p>
    <p>
      The form below is composed of input fields which are implemented with
      different controls like a line edit, a combo box, a date picker, a spin
      box, a text area. The push button at the end is used to start the
      validation of the values in the input fields.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${FormModel}
    </fieldset>

    <p>
      This menu continues with controls (widgets) which you can use to assemble
      a form. At the end the above form is explained in detail with the source
      code.
    </p>

    <p><a href="#forms">Top</a></p>

  </message>

  <message id="simpleForm-template">
    <div class="form-inline">
      <div class="form-group">
          ${name}
      </div>
      <div class="form-group">
          ${button}
      </div>
      <div class="form-group">
           ${out}
      </div>
    </div>
  </message>

  <message id="form-field">
    <div class="form-group">
      <label class="control-label col-sm-2" for="${id:{2}}"> ${1} </label>
      <div class="col-sm-5"> ${2} </div>
      <div class="help-block col-sm-5"> ${3} </div>
    </div>
  </message>

  <message id="userForm-template">
    <legend>${title}</legend>
    <div class="form-horizontal">
      <div class="form-group">
        <label class="control-label col-sm-2"  for="${id:first-name}">
          First name
        </label>
        <div class="col-sm-5">
          ${first-name}
        </div>
        <div class="help-block col-sm-5">
          ${first-name-info}
        </div>
      </div>

      <div class="form-group">
        <label class="control-label col-sm-2"  for="${id:first-name}">
          Last name
        </label>
        <div class="col-sm-5">
          ${last-name}
        </div>
        <div class="help-block col-sm-5">
          ${last-name-info}
        </div>
      </div>

      <div class="form-group">
        <label class="control-label col-sm-2"  for="${id:first-name}">
          Country
        </label>
        <div class="col-sm-5">
          ${country}
        </div>
        <div class="help-block col-sm-5">
          ${country-info}
        </div>
      </div>

      <div class="form-group">
        <label class="control-label col-sm-2"  for="${id:first-name}">
          City
        </label>
        <div class="col-sm-5">
          ${city}
        </div>
        <div class="help-block col-sm-5">
          ${city-info}
        </div>
      </div>

      <div class="form-group">
        <label class="control-label col-sm-2"  for="${id:first-name}">
          Birth date
        </label>
        <div class="col-sm-5">
          ${birth}
        </div>
        <div class="help-block col-sm-5">
          ${birth-info}
        </div>
      </div>

      <div class="form-group">
        <label class="control-label col-sm-2"  for="${id:first-name}">
          Children
        </label>
        <div class="col-sm-5">
          ${children}
        </div>
        <div class="help-block col-sm-5">
          ${children-info}
        </div>
      </div>

      <div class="form-group">
        <label class="control-label col-sm-2"  for="${id:first-name}">
          Remarks
        </label>
        <div class="col-sm-5">
          ${remarks}
        </div>
        <div class="help-block col-sm-5">
          ${remarks-info}
        </div>
      </div>

      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          ${submit-button} <span class="help-inline">${submit-info}</span>
        </div>
      </div>
    </div>
  </message>

  <message id="form-field">
    ${<if:field>}
      <label class="control-label col-sm-2"  for="${id:field}">${field-label}</label>
      ${field} ${field-info}
    ${</if:field>}
  </message>

  <message id="forms-textEditors">
    <h2 id="text-editors">Text editors</h2>
    <p>
      Wt provides different kinds of text entry widgets:
      <a href="#line-edit"><tt>WLineEdit</tt></a>,
      <a href="#text-area"><tt>WTextArea</tt></a>,
      <a href="#text-edit"><tt>WTextEdit</tt></a> and
      <a href="#spin-box"><tt>WSpinBox</tt></a>.
    </p>

    <h3 id="line-edit">Line edit</h3>
    <p>
      The ${doc-link WLineEdit} class is an inline widget that provides a
      single line edit.
    </p>
    <p>
      A <tt>&lt;WLineEdit&gt;</tt> corresponds to an HTML
      <tt>&lt;input type="text"&gt;</tt> element.
    </p>
    <p>
      You can restrict its input using a validator providing immediate
      client-side feedback. In the example below characters that aren't
      numbers are not accepted. If you enter a number out of the
      predefined range (0..130) then the widget colour is changed.
      See <a href="#/forms/validation">Forms > Validation</a> for more details.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${LineEdit}
      ${src LineEdit}
      <p>
        Here is the corresponding XML template (with
        <tt>message id="lineEdit-template"</tt>) using style classes from the
        <a href="http://twitter.github.com/bootstrap/base-css.html"
        target="blank">Bootstrap theme</a>.
      </p>
      <fieldset class="src">
      <legend>source</legend>
        <pre>${lineEdit-template}</pre>
      </fieldset>
    </fieldset>

    <p>
      The line edit below reacts on every 'key pressed' event. It also shows
      how you can embed the label within the control (when empty).
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${LineEditEvent}
      ${src LineEditEvent}
    </fieldset>

    <p><a href="#text-editors">Top</a></p>

    <h3 id="text-area">Text area</h3>
    <p>
      ${doc-link WTextArea} is an inline widget that provides a multi-line edit.
    </p>
    <p>
      A <tt>WTextArea</tt> corresponds to an HTML <tt>&lt;textarea&gt;</tt> element.
    </p>
    <p>
      Form validators can be used to validate the user's input with immediate
      client-side feedback.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${TextArea}
      ${src TextArea}
    </fieldset>

    <p><a href="#text-editors">Top</a></p>

    <h3 id="text-edit">Text edit</h3>
    <p>
      ${doc-link WTextEdit} is a full-featured editor for rich text editing. It
      is based on the TinyMCE editor, which must be downloaded separately from
      its author's website. The TinyMCE toolbar layout and plugins can be
      configured through Wt's interface. The default layout - as shown below -
      covers only a small portion of TinyMCE's capabilities.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      <div class="text-edit-example">
        ${TextEdit}
      </div>
      ${src TextEdit}
    </fieldset>

    <p>
      You could also render the XHTML text to pdf using the
      ${doc-link Render-WPdfRenderer} class.
      See <a href="#/media/pdf-output">Media > Pdf output</a> for more details.
    </p>

    <p><a href="#text-editors">Top</a></p>

    <h3 id="spin-box">Spin box</h3>
    <p>
      A spin box is an inline widget to enter a number; ${doc-link WSpinBox} is
      an input control for integer numbers, while ${doc-link WDoubleSpinBox} is
      an input control for fixed point numbers. A spin box consists of a line
      edit, and buttons which allow to increase or decrease the value.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${SpinBox}
      ${src SpinBox}
    </fieldset>

    <p><a href="#text-editors">Top</a></p>

    <h3 id="spin-box">Input masks</h3>
    <p>
      A user may be steered to providing correct input by providing an
      input mask. The input mask indicates the expected format and
      constrains the user to provide data only in the expected format.
    </p>
    <p>
      In the example below we use an input mask to ask the user to
      enter an IP address.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${InputMask}
      ${src InputMask}
    </fieldset>

    <h3 id="edit-options">Prepended and appended inputs</h3>
    <p>
      Adding on top of the standard input controls, the
      <a href="http://twitter.github.com/bootstrap/base-css.html"
      target="blank">Bootstrap theme</a> includes other useful form components
      like prepended/appended inputs. You can add text or buttons before and/or
      after any text-based input using the <tt>.input-prepend</tt> and
      <tt>.input-prepend</tt> classes respectively. Note that select elements
      are not supported.
    </p>

    <h4>Adding text</h4>
    <p>
      Wrap an <tt>.add-on</tt> and an input control with one of two classes to
      prepend or append text to an input. You could also use both classes and
      two instances of <tt>.add-on</tt> to prepend and append an input at once.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${TextSide}
      ${src TextSide}
      <p>
        Here is the corresponding XML template (with
        <tt>message id="editSide-template"</tt>) using style classes from
        the <a href="http://twitter.github.com/bootstrap/base-css.html"
        target="blank">Bootstrap theme</a>.
      </p>
      <fieldset class="src">
      <legend>source</legend>
        <pre>${editSide-template}</pre>
      </fieldset>
    </fieldset>

    <h4>Adding drop down buttons</h4>

    <p>
      See <a href="#/forms/push-button#dropdown">Push buttons</a>.
    </p>

    <p><a href="#text-editors">Top</a></p>

  </message>

  <message id="dateEdit-template">
    <p>When do you want to take your holiday?</p>

    <div class="form-horizontal">
      <div class="form-group">
        <label class="control-label col-sm-3" for="${id:from}">From</label>
        <div class="col-sm-4">${from}</div>
      </div>

      <div class="form-group">
        <label class="control-label col-sm-3" for="${id:to}">
          To (format dd MM yyyy)
        </label>
        <div class="col-sm-4">${to}</div>
      </div>

      <div class="form-group">
        <div class="col-sm-offset-3 col-sm-4">
          ${save}
        </div>
      </div>
    </div>

    ${out class="help-block"}

  </message>

  <message id="lineEdit-template">
    <div class="form-inline">
      <div class="form-group">
        <label for="${id:edit}">${label}</label>
        ${edit}
      </div>
    </div>
  </message>

  <message id="editSide-template">
    <div class="form-group">
      <div class="input-group">
        <span class="input-group-addon">@</span>
        ${name}
      </div>
    </div>      
    <div class="form-group">
      <div class="input-group">
        ${amount1}
        <span class="input-group-addon">.00</span>
      </div>
    </div>      
    <div class="form-group">
      <div class="input-group">
        <span class="input-group-addon">$</span>
        ${amount2}
        <span class="input-group-addon">.00</span>
        </div>
    </div>
  </message>

  <message id="forms-checkBox">
    <h2 id="check-boxes">Check boxes</h2>
    <p>
      Wt provides different kinds of button widgets. The ${doc-link WCheckBox}
      class provides independent on/off options in contrast to
      ${doc-link WRadioButton}s which are usually mutually exclusive.
    </p>
    <p>
      An instance of <tt>WCheckBox</tt> corresponds to an HTML
      <tt>&lt;input type="checkbox"&gt;</tt> element.
    </p>
    <p>
      Next to being checked or unchecked, a checkbox can be configured
      to allow a third state, <tt>Wt::PartiallyChecked</tt>, which can
      be used to indicate that it isn't <i>entirely</i> checked,
      e.g. if only some of the files in a folder are selected, then
      the checkbox for that folder would be partially checked. In the
      example below, the third checkbox demonstrates this tristate
      behaviour.
    </p>

    <h3>Inline check boxes</h3>
    <p>
      By default, check boxes will appear on the same line.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${CheckBoxInline}
      ${src CheckBoxInline}
    </fieldset>

    <h3>Stacked check boxes</h3>
    <p>
      Since by default, check boxes are inline, you will need to use
      <tt>setInline(false)</tt> to let them stack vertically.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${CheckBoxStack}
      ${src CheckBoxStack}
    </fieldset>

    <p><a href="#check-boxes">Top</a></p>

  </message>

  <message id="forms-radioButton">
    <h2 id="radio-buttons">Radio buttons</h2>
    <p>
      Wt provides different kinds of button widgets. The
      ${doc-link WRadioButton} class provides options which are usually
      mutually exclusive in contrast to ${doc-link WCheckBox}s which provide
      independent on/off options.
    </p>
    <p>
      An instance of <tt>WRadioButton</tt> corresponds to an HTML
      <tt>&lt;input type="radio"&gt;</tt> element.
    </p>
    <p>
      Use a <a href="#radio-group">WButtonGroup</a> to group together radio
      buttons that reflect options that are mutually exclusive.
      With <a href="#radio-events">event handling</a> you can follow up any
      change in the selection.
    </p>
    <p>
      By default, radio buttons are inline. You will need to use
      <tt>setInline(false)</tt> to let them stack vertically.
    </p>

    <h3 id="radio-loose">Loose buttons</h3>

    <fieldset class="example">
      <legend>Example</legend>
      ${RadioButtonsLoose}
      ${src RadioButtonsLoose}
    </fieldset>

    <h3 id="radio-group">Button group</h3>
    <p>
      Usually, you'll group a set of radio buttons together in a
      ${doc-link WButtonGroup}, so that only one can be selected at a time.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${RadioButtonGroup}
      ${src RadioButtonGroup}
    </fieldset>

    <p><a href="#radio-buttons">Top</a></p>

    <h3 id="radio-stack">Stacked buttons</h3>
    <p>
      Since by default, radio buttons are inline, you will need to use
      <tt>setInline(false)</tt> to let them stack vertically.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${RadioButtonStack}
      ${src RadioButtonStack}
    </fieldset>

    <p><a href="#radio-buttons">Top</a></p>

    <h3 id="radio-events">Events</h3>
    <p>
      You can process a new selection with a signal/slot mechanism. In the
      example below the signal <tt>checkedChanged()</tt> of the
      <tt>WButtonGroup</tt> is passed to an inner function passing a
      ${doc-link WPushButton}.
      You can see that there are two ways to get the id assigned to a button,
      namely <tt>group->id(selection)</tt> and <tt>group->checkedId()</tt>.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${RadioButtonsActivated}
      ${src RadioButtonsActivated}
    </fieldset>

    <p>
      <a href="#/events" target="blank">More details on events</a>
    </p>

    <p><a href="#radio-buttons">Top</a></p>

  </message>

  <message id="forms-comboBox">
    <h2 id="combo-boxes">Combo box</h2>
    <p>
      A combo box is a drop-down list allowing you to choose one option from a
      list of options.
    </p>
    <p>
      A ${doc-link WComboBox} corresponds to an HTML <tt>&lt;select&gt;</tt>
      element.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${ComboBox}
      ${src ComboBox}
    </fieldset>

    <p>
      <tt>WComboBox</tt> is a View widget (see also
      <a href="http://www.webtoolkit.eu/widgets/mvc-widgets/" target="_blank">
      Model-View-Controller</a>) which instantiates its own
      <tt>WStringListModel</tt> by default. You can use this widget also in
      conjunction with another model.
    </p>

    <h3>Events</h3>
    <p>
      You can capture the selected item and deal with it using a signal/slot
      mechanism.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${ComboBoxActivated}
      ${src ComboBoxActivated}
    </fieldset>

    <p><a href="#combo-boxes">Top</a></p>

    <h3 id="model">Model</h3>
    <p>
      WComboBox is a MVC class (model-view-controller). By default a
      ${doc-link WStringListModel} is used. With this model you can associate a
      single column of data to the displayed items. The member methods
      <tt>addItem()</tt>, <tt>insertItem()</tt> and <tt>removeItem()</tt>
      manipulate the model. You can set the model with <tt>setModel()</tt>.
    </p>
    <p>
      Item models support different roles like
      <tt>Wt::ItemDataRole::DisplayRole </tt> and
      <tt>Wt::ItemDataRole::UserRole</tt>. The text for an item in the
      drop-down box is associated with a
      <tt>Wt::ItemDataRole::DisplayRole</tt>. Typically, you will associate the
      underlying "value" with a <tt>Wt::ItemDataRole::UserRole</tt>). In this
      way, you can also add additional user roles.
    </p>
    <p>
      Note that there are still other models like ${doc-link WFormModel} which
      and can be used to represent fields in a form.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${ComboBoxModel}
      ${src ComboBoxModel}
    </fieldset>

    <p><a href="#combo-boxes">Top</a></p>

  </message>

  <message id="forms-selectionBox">
    <h2 id="selection-boxes">Selection box</h2>
    <p>
      A selection box shows an immediately visible list allowing you to choose
      one (by default) or <a href="#selection-multiple">more</a> options.
    </p>
    <p>
      A ${doc-link WSelectionBox} corresponds to an HTML <tt>&lt;select&gt;</tt>
      element.
    </p>
    <p>
      <tt>WSelectionBox</tt> is a View widget (see also
      <a href="http://www.webtoolkit.eu/widgets/mvc-widgets/" target="_blank">
      Model-View-Controller</a>). By default a ${doc-link
      WStringListModel} is used. With this model you can associate a
      single column of data to the displayed items. The member
      methods <tt>addItem()</tt>, <tt>insertItem()</tt> and <tt>
      removeItem()</tt> manipulate the model. You can set the model
      with <tt>setModel()</tt>. See the Combo box section for an <a
      href="#/forms/combo-boxes">example</a>.
    </p>
    <p>
      A model supports different roles like
      <tt>Wt::ItemDataRole::DisplayRole </tt> and
      <tt>Wt::ItemDataRole::UserRole</tt>.  The suggestion text for an
      item in the drop-down box is associated with a
      <tt>Wt::ItemDataRole::DisplayRole</tt>. The value, which will be
      inserted in the line-edit, corresponding with a suggestion, is
      stored as <tt> Wt::ItemDataRole::UserRole</tt>) data. If no
      UserRole data is available, the behaviour defaults to inserting
      the suggestion text iteself.
    </p>
    <p>
      If you want to associate multiple data columns with an item from the
      combo box then you should assign another model to this control like
      ${doc-link WStandardItemModel} or an implemention of
      ${doc-link WAbstractTableModel}.
    </p>
    <p>
      Note that there are still other models like ${doc-link WFormModel} which
      and can be used to represent fields in a form.
    </p>

    <h3>Single option selection box</h3>

    <fieldset class="example">
      <legend>Example</legend>
      ${SelectionBoxSimple}
      ${src SelectionBoxSimple}
    </fieldset>

    <p><a href="#selection-boxes">Top</a></p>

    <h3 id="selection-multiple">Multiple option selection box</h3>
    <p>Use shift and/or ctrl-click to select your pizza toppings...</p>

    <fieldset class="example">
      <legend>Example</legend>
      ${SelectionBoxExtended}
      ${src SelectionBoxExtended}
    </fieldset>

    <p><a href="#selection-boxes">Top</a></p>

  </message>

  <message id="forms-autoComplete">
    <h2 id="auto-complete">Auto complete</h2>
    <p>
      The ${doc-link WSuggestionPopup} class is a widget which pops up to
      assist in editing a text area or line edit through auto completion.
      This widget may be associated with one or more ${doc-link WFormWidgets}
      (typically a ${doc-link WLineEdit} or a ${doc-link WTextArea}).    </p>
    <p>
      The popup provides the user with suggestions to enter input. The popup
      can be used by one or more text editors, using <tt>forEdit()</tt>. The
      popup will show when the user starts editing the edit field, or when the
      user opens the suggestions explicitly using a drop down icon or with the
      down key. In the example below, the popup positions itself on top of the
      edit field.
    </p>
    <p>
      The class is initialized with an <tt>Options</tt> struct which configures
      how suggestion filtering and result editing is done. Alternatively, you
      can provide two <a href="#auto-complete-javascript">JavaScript functions
      </a>.
    </p>
    <p>
      To style the suggestions, you should style the &lt;span&gt; element
      inside this widget, and the &lt;span&gt;."sel" element to style the
      current selection.
    </p>
    <p>
      You can also limit the maximum height of the popup by using <tt>
      setMaximumSize()</tt>. In this case, scrolling is supported (similar to a
      combo-box).
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${AutoComplete}
        ${src AutoComplete}
    </fieldset>

    <h3>Model</h3>
    <p>
      WSuggestionPopup is a MVC class (model-view-controller). By
      default a ${doc-link WStringListModel} is used. The member
      methods <tt>clearSuggestions()</tt> and <tt>addSuggestion()</tt>
      manipulate this model. You can set another model with
      <tt>setModel()</tt>. See the Combo box section for an <a
      href="#/forms/combo-boxes">example</a>.
    </p>

    <h3>Server-side filtering</h3>
    <p>
      By default, the popup implements all filtering client-side. To support
      large datasets, you may enable server-side filtering of suggestions based
      on the input. The server-side filtering may provide a coarse filtering
      using a fixed size prefix of the entered text, and complement the
      client-side filtering. To enable server-side filtering, use <tt>
      setFilterLength()</tt> and listen to filter notification using the <tt>
      modelFilter()</tt> signal. Whenever a filter event is generated you can
      adjust the model's content according to the filter (e.g. using a
      ${doc-link WSortFilterProxyModel}).
    </p>

    <h3 id="auto-complete-javascript">Initializing Options with JavaScript
      functions</h3>
    <p>
      Usually, the popup class is initialized with an <tt>Options</tt> struct
      which configures how suggestion filtering and result editing is done.
      Alternatively, you can provide two JavaScript functions, one for
      filtering the suggestions (<tt>generateMatcherJS()</tt>), and one for
      editing the value of the textarea when a suggestion is selected (<tt>
      generateReplacerJS()</tt>).
      The matcher function must have the following JavaScript signature:
      ${src matcher}
    </p>
    <p>
      The replacerJS function that edits the value has the following JavaScript
      signature.
      ${src replacer}
    </p>

    <h3>Remark</h3>
    <p>
      You can find several more advanced examples in the Wt distribution
      directory <tt>examples/feature/suggestionpopup/</tt>. In the <tt>
      SuggestionPopup.C</tt> class you can explore different functions.
    </p>

    <p><a href="#auto-complete">Top</a></p>

  </message>

  <message id="forms-dateEntry">
    <h2 id="date-entry">Date entry</h2>
    <p>
      Wt provides to kinds of widgets to enter a date, namely
      <a href="#date-calendar">WCalendar</a> and <a href="#date-picker">
      WDatePicker</a>.
    </p>

    <h3 id="date-calendar">Date entry using a calendar</h3>
    <p>
      The ${doc-link WCalendar} widget provides navigation by month and year,
      and indicates the current day.
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${CalendarSimple}
        ${src CalendarSimple}
    </fieldset>

    <p>
      You can select multiple dates after passing the flag <tt>
      ExtendedSelection</tt> to the method <tt>setSelectionMode()</tt>.
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${CalendarExtended}
        ${src CalendarExtended}
    </fieldset>

    <p><a href="#date-entry">Top</a></p>

    <h3 id="date-picker">Date entry using a date edit</h3>
    <p>
      The ${doc-link WDateEdit} widget is a line edit with support for
      date entry, using a <tt>WCalendar</tt> in a popup for editing
      the date. In the future, it is foreseen that this widget can evolve to
      use browser support for easy date entry.
    </p>
    <p>
      By default the selected date is shown in the format "dd/MM/yyyy" as in
      the first example. In the second example the format is set to
      "dd MM yyyy".
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${DateEdit}
        ${src DateEdit}
    </fieldset>
    <p><a href="#date-entry">Top</a></p>

    <h3 id="date-edit">Date entry using a date picker</h3>
    <p>
      The date picker offers about the same functionality as the newer
      <tt>WDateEdit</tt>, but with a slightly different API. Most
      importantly, the date editor is a form widget, and integrates
      better with other parts in Wt. It is in general more convenient
      to use the newer WDateEdit class instead.
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${DatePicker}
        ${src DatePicker}
    </fieldset>

    <p><a href="#date-entry">Top</a></p>
  </message>

  <message id="forms-inPlaceEdit">
    <h2 id="in-place-edit">In place edit</h2>
    <p>
      The ${doc-link WInPlaceEdit} widget provides in-place-editable text. The
      text that may be edited in place by clicking on it.
    </p>

    <h3>In place edit with buttons</h3>
    <p>
      By default, the Save and Cancel buttons are shown. To prevent losing the
      widget, always use <tt>setEmptyText()</tt> in addition to <tt>setText()
      </tt> or initially setting the text by the constructor.
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${InPlaceEditButtons}
        ${src InPlaceEditButtons}
    </fieldset>

    <h3>In place edit without buttons</h3>
    <p>
      To show the line edit only, call <tt>setButtonsEnabled()</tt> with
      parameter <tt>enabled</tt> set to false; this hides the buttons. In this
      mode, any event that causes focus to be lost saves the value while the
      escape key cancels the editing.
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${InPlaceEdit}
        ${src InPlaceEdit}
    </fieldset>

    <p><a href="#in-place-edit">Top</a></p>

  </message>

  <message id="forms-slider">
    <h2 id="slider">Slider</h2>
    <p>
      A ${doc-link WSlider} is a horizontal or vertical linear control with
      which you can set an integer value by moving an indicator within a
      particular range. You can also click on a point on the slider to change
      the value.
    </p>
    <p>
      The default size is 150 x 50 pixels for a horizontal slider, and 50 x 150
      pixels for a vertical slider. The slider size cannot be set explicitly by
      a CSS style sheet. You should use <tt>resize()</tt> or a layout manager
      for that purpose.
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${Slider}
        ${src Slider}
    </fieldset>

    <p><a href="#slider">Top</a></p>

    <h3>Vertical slider</h3>
    <p>
      You can create a vertical slider using <tt>setOrientation()</tt> with the
      parameter <tt>orientation</tt> set to Vertical on a default horizontal
      slider like in the above example or using a more specialized constructor.
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${SliderVertical}
        ${src SliderVertical}
    </fieldset>

    <p><a href="#slider">Top</a></p>

  </message>

  <message id="forms-progressBar">
    <h2 id="progress-bar">Progress bar</h2>
    <p>
      The ${doc-link WProgressBar} can be used to indicate the progress of a
      certain operation. The text displayed in the progress bar can be
      customized by specializing <tt>text()</tt>.
    </p>
    <p>
      To use the progress bar widget, you need to give it a range (either by
      <tt>setRange()</tt> or by using <tt>setMinimum()</tt> and
      <tt>setMaximum()</tt>), and update the progress using <tt>setValue()</tt>.
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${ProgressBar}
        ${src ProgressBar}
    </fieldset>

    <h3>Remark</h3>
    <p>
      With the advent of HTML5, this widget will be implemented using the
      native HTML5 control when available.
    </p>

    <p><a href="#progress-bar">Top</a></p>

  </message>

  <message id="forms-fileUpload">
    <h2 id="file-upload">File upload</h2>
    <p>
      The ${doc-link WFileUpload} widget allows you to upload a local file to
      the server.
    </p>

    <h3>Signals</h3>
    <p>
      To properly use this widget you need to handle the <tt>uploaded()</tt>
      or <tt>fileTooLarge()</tt> signals; even when <tt>upload()</tt> was not
      called.
    </p>
    <p>
      An oversized file will result in a <tt>fileTooLarge()</tt> signal. The
      default threshold value (128) for this signal is defined in the general
      application settings file <tt>wt_config.xml</tt> by the parameter <tt>
      max-request-size</tt> (Kb). See the <a href=
      "http://www.webtoolkit.eu/wt/doc/reference/html/overview.html#config_general"
      target="blank">Library overview</a> for more details.
      You can change this value with the function <tt>setFileTextSize()</tt>;
    </p>
    <p>
      Also check using <tt>canUpload()</tt> if <tt>upload()</tt> will schedule
      a new upload.
      <ul>
        <li>
          If (!canUpload()) then <tt>upload()</tt> will not have any effect.
        </li>
        <li>
          If (canUpload()), then <tt>upload()</tt> will start a new file
          upload.
          <br />
          If the upload completes succesfully then an <tt>uploaded()
          </tt>signal will be emitted. Otherwise a <tt>fileTooLarge()</tt>
          signal will be emitted.
        </li>
      </ul>
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${FileUpload}
        ${src FileUpload}
    </fieldset>

    <p><a href="#file-upload">Top</a></p>

  </message>

  <message id="forms-pushButton">
    <h2 id="push-button">Push buttons</h2>
    <p>
      Wt provides different kinds of button widgets. With a
      ${doc-link WPushButton} a user can execute a command by a click action,
      e.g. an OK button is generally used for confirming actions and closing
      the window while a Cancel button is used for canceling actions and
      closing the window.
    </p>
    <p>
      A <tt>WPushButton</tt> corresponds to an HTML <tt>&lt;button&gt;</tt>
      element.
    </p>
    <p>
      A push button typically responds to <tt>clicked()</tt> events.
    </p>
    <p>
      You may decorate a push button with a background image to create a
      clickable image. As a descendant of class ${doc-link WFormWidget}, push
      buttons can be disabled or enabled.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PushButton}
      ${src PushButton}
    </fieldset>

    <p><a href="#push-button">Top</a></p>

    <h3 id="one-time">One-time hit button</h3>
    <p>
      A push button can be designated to be pushed only once and as a result
      execute a command only once.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PushButtonOnce}
      ${src PushButtonOnce}
    </fieldset>

    <p><a href="#push-button">Top</a></p>

    <h3 id="navigation">Navigation button</h3>
    <p>
      You can also associate navigation with a button using
      <tt>WPushButton::setLink()</tt>. With this method you can change the
      internal path of the application. As a result the button behaves as an
      <a href="#/navigation/anchor">anchor</a>. This is similar to how a
      ${doc-link WMenuWidget} or a ${doc-link WTabWidget} works. See the menu
      <a href="#/navigation">Navigation</a> for more details.
    </p>
    <p>
      With a push button you can execute an action while navigating to a
      hyperlink target at the same time using <tt>WPushButton::setLink()</tt>.
      This method accepts a ${doc-link WLink} as parameter.
    </p>
    <p>
      In the example below, the internal path is changed from
      <tt>/forms/button</tt> (the path associated with the current web page) to
      <tt>/navigation/anchor</tt>.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PushButtonLink}
      ${src PushButtonLink}
    </fieldset>

    <p><a href="#push-button">Top</a></p>

    <h3 id="dropdown">Drop down button</h3>
    <p>
      A drop down button is a button with a drop down menu. It could be used to
      extend a line edit with possible actions on the input. Usually the menu
      items are links.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PushButtonDropdownAppended}
      ${src PushButtonDropdownAppended}
      <p>
        Here is the corresponding XML template (with
        <tt>message id= "appendedDropdownButton-template"</tt>) using style
        classes from the
        <a href= "http://twitter.github.com/bootstrap/base-css.html"
        target="blank">Bootstrap theme</a>.
      </p>
      <fieldset class="src">
        <legend>source</legend>
        <pre>${appendedDropdownButton-template}</pre>
      </fieldset>
    </fieldset>

    <p><a href="#push-button">Top</a></p>

    <h3 id="style">Button style</h3>
    <p>
      You can add different styles to buttons to change the color, the size,
      the positioning, etc. using style classes from the
      <a href="http://twitter.github.com/bootstrap/base-css.html"
      target="blank">Bootstrap theme</a>.
      Button styles can be applied to anything with the <tt>.btn</tt> class
      applied. However, for the best rendering, apply these to hyperlinks
      (<tt>&lt;a&gt;</tt>) and button controls (<tt>&lt;button&gt;</tt>) only.
    </p>

    <h4 id="color">Button color</h4>
    <p>
      The following table provides an overview of the standard color classes
      and visualizes the effect on a button. The <tt>.btn</tt> class is applied
      to a button control by default; you only have to set additional classes.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PushButtonColor}
      <p>
        Here is the underlying program showing how to assign the appropriate
        color style class to a button.
      </p>
      ${src PushButtonColor}
      <p>
        Here is the corresponding XML template
        (with <tt>message id="pushButtonColor-template"</tt>). Note that there
        is no style applied to the buttons here; this is dealt with in the
        program. As a result it's easy to change the style on-the-fly.
      </p>
      <fieldset class="src">
        <legend>source</legend>
        <pre>${pushButtonColor-template}</pre>
      </fieldset>
    </fieldset>

    <p><a href="#push-button">Top</a></p>

    <h4 id="size">Button size</h4>
    <p>
      Instead of using the default size, you can apply a larger or smaller size
      to a button. Add the style class <tt>.btn-large</tt>,
      <tt>.btn-small</tt>,or <tt>.btn-mini</tt> to change the size.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PushButtonSize}
      <p>
        Here is the underlying program showing how to assign the appropriate
        size style class to a button.
      </p>
      ${src PushButtonSize}
      <p>
        Here is the corresponding XML template
        (with <tt>message id="pushButtonSize-template"</tt>). Note that there
        is no style applied to the buttons here; this is dealt with in the
        program.
      </p>
      <fieldset class="src">
        <legend>source</legend>
        <pre>${pushButtonSize-template}</pre>
      </fieldset>
    </fieldset>

    <p><a href="#push-button">Top</a></p>

    <h4 id="primary">Primary button</h4>
    <p>
      You can create a primary button - one that is more striking - by adding
      the <tt>.btn-primary</tt> style to it.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PushButtonPrimary}
      ${src PushButtonPrimary}
    </fieldset>

    <p><a href="#push-buttonn">Top</a></p>

    <h4 id="action">Buttons in a form</h4>
    <p>
      Usually, a form ends with a group of actions (buttons). You can make the
      action section more striking compared to the upper input field section by
      adding the style class <tt>.form-actions</tt>. When placed within a
      <tt>.form-horizontal</tt>, the buttons will automatically indent to line
      up with the form controls (See the example at
      <a href="#/forms/forms">Forms &gt; Form model</a>).
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PushButtonAction}
      ${src PushButtonAction}
      <p>
        Here is the corresponding XML template
        (with <tt>message id="pushButtonAction-template"</tt>) showing how to
        assign the appropriate style class to the action section.
      </p>
      <fieldset class="src">
        <legend>source</legend>
        <pre>${pushButtonAction-template}</pre>
      </fieldset>
    </fieldset>

    <p><a href="#push-button">Top</a></p>

  </message>

  <message id="appendedDropdownButton-template">
  <div class="form-inline">
    <div class="form-group">
      ${input}
    </div>
    <div class="form-group">
        ${appendedButton}
    </div>
  </div>
  </message>

  <message id="pushButtonColor-template">
      <table class="table table-bordered table-striped">
        <thead>
          <tr>
            <th>Button</th>
            <th>Class</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>${button-default}</td>
            <td><tt></tt></td>
            <td>Default style configured by the library (gray, with gradient)</td>
          </tr>
          <tr>
            <td>${button-primary}</td>
            <td><tt>btn-primary</tt></td>
            <td>Provides extra visual weight and identifies the primary action
                in a set of buttons</td>
          </tr>
          <tr>
            <td>${button-info}</td>
            <td><tt>btn-info</tt></td>
            <td>Used as an alternative to the default styles</td>
          </tr>
          <tr>
            <td>${button-success}</td>
            <td><tt>btn-success</tt></td>
            <td>Indicates a successful or positive action</td>
          </tr>
          <tr>
            <td>${button-warning}</td>
            <td><tt>btn-warning</tt></td>
            <td>Indicates caution should be taken with this action</td>
          </tr>
          <tr>
            <td>${button-danger}</td>
            <td><tt>btn-danger</tt></td>
            <td>Indicates a dangerous or potentially negative action</td>
          </tr>
          <tr>
            <td>${button-inverse}</td>
            <td><tt>btn-inverse</tt></td>
            <td>Alternate dark gray button, not tied to a semantic action or
                use</td>
          </tr>
          <tr>
            <td>${button-link}</td>
            <td><tt>btn-link</tt></td>
            <td>Deemphasize a button by making it look like a link while
                maintaining button behavior</td>
          </tr>
        </tbody>
      </table>
  </message>

  <message id="pushButtonSize-template">
    <div>
      ${button-large}
      <p>${button-default}</p>
      <p>${button-small}</p>
      ${button-mini}
    </div>
  </message>

  <message id="pushButtonAction-template">
    <div class="form-actions">
      ${button-save} ${button-cancel}
    </div>
  </message>

  <message id="forms-validation">
    <h2 id="validation">Validation</h2>
    <p>
      A validator is used to validate user input according to pre-defined rules.
    </p>
    <p>
      A validator may have a split implementation to provide both validation at
      the client-side (which gives instant feed-back to the user while
      editing), and server-side validation (to be sure that the client was not
      tampered with). The feed-back given by (client-side and server-side)
      validation is reflected in the style class of the form field: a style
      class of <tt>Wt-invalid</tt> is set for a field that is invalid.
    </p>
    <p>
      The ${doc-link WValidator} only checks that mandatory fields are not
      empty. Validated input can have one of the following states:
      <ul>
        <li><strong>Valid</strong>, if the input data is valid.</li>
        <li><strong>Invalid</strong>, if the input data is invalid.</li>
        <li><strong>InvalidEmpty</strong>, if the input field is empty while it
            is configured as mandatory.</li>
      </ul>
      This class is reimplemented in ${doc-link WDateValidator},
      ${doc-link WIntValidator}, ${doc-link WDoubleValidator},
      ${doc-link WLengthValidator} and ${doc-link WRegExpValidator}. All these
      validators provide both client-side and server-side validation.
    </p>
    <p>
      If these validators are not suitable, you can inherit from this class,
      and provide a suitable implementation to <tt>validate()</tt> which does
      the server-side validation. If you want to provide client-side validation
      for your own validator, you may also reimplement <tt>javaScriptValidate()
      </tt>.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Validation}
      ${src Validation}
      <p>
        Here is the corresponding XML template (with
        <tt>message id= "validation-template"</tt>) using style classes from
        the <a href= "http://twitter.github.com/bootstrap/base-css.html"
        target="blank">Bootstrap theme</a>.
        In order to apply validation style if the input is not valid, you
        should surround the input widget in a div or span section and apply the
        style <tt>form-group </tt> to it.
      </p>
      <fieldset class="src">
        <legend>source</legend>
        <pre>${validation-template}</pre>
      </fieldset>
    </fieldset>

    <p><a href="#validation">Top</a></p>

    <h3>Date validation</h3>
    <p>
      In entirely the same way, a date validator can be used to
      validate date input with a <tt>WDateEdit</tt> or
      <tt>WDatePicker</tt>. You can limit the date range of the
      calendar using <tt> setBottom()</tt> and <tt>setTop()</tt>.
    </p>

    <fieldset class="example">
        <legend>Example</legend>
        ${ValidationDate}
        ${src ValidationDate}
    </fieldset>

    <p><a href="#validation">Top</a></p>

    <h3>Server-side validation using a form model</h3>
    <p>
      A more convenient way to perform validation is to implement a form model
      (a specialisation of ${doc-link WFormModel}) and a complementary
      template-based view (a specialisation of ${doc-link WTemplateFormView}).
      In this way you can validate the values entered at the server-side.
    </p>
    <p>
      The form model implements field data and validation handling for (simple)
      form-based views. It provides a standard way for views to perform field
      validation, and react to validation results.
      Each field has a string literal assigned to it. The string literal
      uniquely identifies the field. For each field, its value, the visibility,
      whether the field is read-only, and its current validation status is
      managed by the model.
      In addition, you will typically specialize the class to customize the
      validation and application logic. Although it can be setup to use <tt>
      WValidator</tt> objects for individual fields, you could also create a
      validator to simultaneously validate interdependent fields.
    </p>
    <p>
      A model is typically used by a view which renders the fields configured
      in the model, updates the model values, invokes and reflects the
      validation status. See <a href="#/forms/forms">Forms</a> for more details
      on implementing forms.
    </p>
    <p>
      Here is an example with the same behavior as the previous example. It
      also uses the same XML template. The contents of the variable name
      'age-info' in the template depends on the outcome of the method
      <tt>validate()</tt> of the model.
      <ul>
        <li>It holds a confirmation that the value is saved if the input is
          valid.
        </li>
        <li>It holds a validation message if the input is not valid.</li>
      </ul>
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${ValidationModel}
      ${src ValidationModel}
    </fieldset>

    <p><a href="#validation">Top</a></p>

  </message>

  <message id="validation-template">
    <div class="form-horizontal">
      <div class="form-group">
        <label class="control-label col-sm-3" for="${id:age}">
          Please enter your age:
        </label>
        <div class="col-sm-2">${age}</div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-3 col-sm-7">
          ${button}
        </div>
      </div>
      ${age-info}
    </div>
  </message>

  <message id="date-template">
    <div class="form-horizontal">
      <div class="form-group">
        <label class="control-label col-sm-3" for="${id:birth-date}">
          Enter your birth-date:
        </label>
        <div class="col-sm-2">${birth-date}</div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-3 col-sm-7">
          ${button}
        </div>
      </div>
      ${info}
    </div>
  </message>

  <message id="forms-integration-example">
    <h2 id="forms-integration">Integration example</h2>
    <p>
      There are two ways in which you can compose a form:
      <ul>
        <li>using a simple form</li>
        <li>using a Model-View concept</li>
      </ul>
      In the introduction you can find an example using a simple form. Here you
      can find a detailed example using a model/view concept.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${FormModel}
      <p>
        The underlying XML template (with
        <tt>message id="userForm-template"</tt>) uses style classes from the
        <a href="http://twitter.github.com/bootstrap/base-css.html"
        target="blank">Bootstrap theme</a>.
        In order to apply validation style to any widget with invalid input,
        you should group the widgets in a div or span section and apply the
        style <tt>form-group </tt> to it.
      </p>
      <fieldset class="src">
        <legend>source</legend>
        <pre>${userForm-template}</pre>
      </fieldset>
      <p>
        Here is the implementation of <tt>WFormModel</tt> and <tt>
        WTemplateFormView</tt>.
      </p>
      <p>
        There are created validators for several fields. See the section
        <a href="#/forms/validation">Validation</a> for more details on
        validators, especially a more elaborated example on a
        <tt>WDateValidator</tt> for a <tt>WDatePicker</tt>.
      </p>
      ${src FormModel}
    </fieldset>

    <p><a href="#forms-integration">Top</a></p>

  </message>

<!--NAVIGATION message blocks-->

  <message id="navigation-intro">
    <p class="lead">Navigation &#8212; interacting with a browser's navigation model</p>
  </message>

  <message id="navigation-internalPaths">
    <h2>Internal paths</h2>

    <p>
      Out of the box a Wt application is a <i>single page</i>
      application: regardless of what the user does, the URL displayed
      in the location bar does not change. Single page applications
      are typically implemented in JavaScript and use Ajax to pull
      data from the server, while multi-page applications typically
      require full page refreshes.
    </p>

    <p>Single page appliations have a number of draw-backs:

      <dl>
        <dt>Usability</dt>
        <dd><p>The usability of your web application may suffer because
        users lose the ability to use browser history to navigate
        through the application, and bookmarks to bookmark particular
        content (or application state). Whether this is an actual
        usability problem will depend on the type of application: only
        when a user's intuition is deceived in trying to use browser
        navigation buttons to navigate through the pages in your
        application, you should be concerned.</p>

        <p>
          For example, an interactive web application that mimicks a
          desktop application with a single window whose content is
          manipulated might be conceptually considered a single page for
          the user.
        </p>

        <p>
          On the other hand, applications such as web shops, CMS systems, or
          online email readers, all have a need for the user to be able to
          bookmark certain content pages.
        </p>
        </dd>

        <dt>Deep linking</dt>
        <dd>
          <p>There is no possibility for deep linking to content within
          your application from other websites. This is to some extent
          related to the previous point. For example a web shop will
          want its products pages to be linked to from product review
          websites. But for other applications which have no public
          information such as email applications, this might not be a
          motivation for internal paths.</p>
        </dd>

        <dt>Search engine indexing</dt>
        <dd>
          <p>Content in your web application cannot be indexed properly
          by search engines. A related problem, which might be more
          serious for certain types of applications, is how search
          engines will perceive your web application. Web robots index
          the web by retrieving pages and following anchors to other
          pages. When your application is presented as only a single
          page, only the content on your initial page is accessible to
          these search engines.
          </p>
        </dd>
      </dl>
    </p>

    <p>
      Wt allows the application to define internal paths and handle
      changes of internal paths. Because a Wt application is not
      composed of pages, a URL does not define to particular page, but
      rather a particular application state. An internal path is a
      link to a page in a web application.
    </p>

    <p>
      The widget gallery makes extensive use of internal paths: the
      top-level menu provides the first level, and the menu to the
      left a second level.
    </p>

    <blockquote>
      <p>
        With the help of HTML5's History API, Wt provides a perfect
        illusion of a multi-page application, but within a single page!
      </p>
    </blockquote>

    <p>
      The recommended method to integrate internal path support in
      your application is to use internal path links (defined by
      ${doc-link WLink}) in anchors or menu items, for people to
      navigate to a different 'page' in the application, and respond
      to internal path change events, to show the new page in
      response. thus instead of directly listening to a click event,
      the click results in an internal path change.
    </p>

    <p>
      The main benefit of this approach is that internal path changes
      may also originate from a user navigating using the brower's
      back and forward buttons, may follow such a link in a new window
      (and thus a new session) or may arrive at the internal path
      following a deep link from elsewhere, and this approach
      decouples the origin of the event from the handling of the
      event.
    </p>

    <p>
      As a corner stone feature in Wt, internal paths are entirely
      supported both in Ajax and plain HTML sessions. For browsers
      without support for the HTML5 History API, Ajax sesion will fall
      back to <i>named anchors</i>. This effectively makes internal
      paths the perfect tool for search engine accessibility of your
      application.
    </p>

    <h3>Creating Internal Path Links</h3>

    <p>
      For the following widgets you can associate an internal path
      with the method <tt>setLink()</tt>:
      <ul>
        <li>an <a href="#/navigation/anchor">anchor</a> (${doc-link WAnchor})
        or a pushbutton (${doc-link WPushButton}), or</li>
        <li>a menu item (${doc-link WMenuItem}) from within menus or
        popup menus,</li>
        <li>any ${doc-link WAbstractArea} implementation (like a rectangle,
          circle or polygon) which define interactive areas on images.</li>
      </ul>
      In addition, standard item views such as ${doc-link WTableView}
      will render links for <tt>LinkRole</tt> data.
    </p>

    <p>
      In the example below, the push button is configured to navigate
      to the internal path <tt>/navigation/anchor</tt>; the next item
      in the menu bar. The button behaves as an <a
      href="#/navigation/anchor">anchor</a>. This is similar to how a
      ${doc-link WMenuWidget} or a ${doc-link WTabWidget} works.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Path}
      ${src Path}
    </fieldset>

    <p>
      In this example, the <a href="#/navigation/menu">menu</a> reacts
      to the internal path event and selects the corresponding menu
      item. One can also catch the navigation event directly.
    </p>

    <h3>Reacting to internal path changes</h3>

    <p>
      Whereas in traditional page-based frameworks, a
      <i>controller</i> or <i>request router</i> is a central
      component that decides what page content needs to be rendered in
      response to a particular request, Wt employs a quite different
      model. Instead, you can react to internal path changes, by
      listening to the <tt>WApplication::internalPathChanged()</tt>
      signal, as you would react to any other event. At any time,
      including when the application is started, the current internal
      path is available through <tt>WApplication::internalPath()</tt>.
    </p>

    <p>
      The following example shows the basic mechanism to react to an
      internal path event.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PathChange}
      ${src PathChange}
    </fieldset>

    <p>
      Notice how the same function is used to react to an actual event
      but also to the initial state. This will be a common pattern in
      widgets that support internal path navigation, as they also need
      to initialize to the initial internal path.
    </p>

  </message>

  <message id="navigation-anchor">
    <h2 id="anchor">Anchor</h2>
    <p>
      An ${doc-link WAnchor} is a widget that represents an HTML
      <tt>&lt;a&gt;</tt> element, and provides a link to an URL. So, you can
      use an anchor to provide link to another web page, document, internal
      application path or a resource. The anchor may contain a label text, an
      image, or any other widget (as it inherits from
      ${doc-link WContainerWidget}).
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Anchor}
      ${src Anchor}
    </fieldset>

    <fieldset class="example">
      <legend>Example</legend>
      ${AnchorImage}
      ${src AnchorImage}
    </fieldset>

    <p>
      When an anchor is activated, by default the browser will replace the Wt
      application with the targeted document or external url. This could
      terminate the application. This may be changed to suggest the browser to
      follow the link in a new window, using the <tt>setTarget()</tt> method
      with parameter <tt>Wt::TargetNewWindow</tt>.
      Even for non-HTML documents, this may be important since pending Ajax
      requests are cancelled if documents are not served within the browser
      window in certain browsers.
    </p>
    <p>
      <tt>WAnchor</tt> plays an important role for navigation within your
      application, using Wt's internal paths, since they provide support for
      bookmarks, the browser back/forward buttons, and following links in new
      windows. For example, the <a href="#/navigation/menu">WMenu</a> widget
      (used here to navigate Wt widgets) uses anchors for its items by default.
    </p>
    <p>
      You may specify the anchor's target URL directly, but anchors can also
      refer to a <a href="#/media/resources">WResource</a>. A resource
      specifies application-dependent content that may be generated by your
      application on demand. This allows you to serve auxiliary files related
      to a particular application session, and perhaps dynamically generate the
      content. Wt includes ${doc-link WFileResource} to stream a file and
      ${doc-link WMemoryResource} to stream a data vector. When linking to a
      resource, the anchor does not assume ownership of the resource. As a
      result, you may share the same resources for several anchors.
    </p>
    <p>
      Note that if you set a text or image using one of the API methods like
      <tt>setText()</tt> or <tt>setImage()</tt> or a constructor, you should
      not attempt to remove all contents (using <tt>clear()</tt>, or provide a
      layout (using <tt>setLayout()</tt>), as this will result in undefined
      behaviour. The text or image are simply inserted as widgets into the
      container.
    </p>
    <p>
      The widget corresponds to the HTML <tt>&lt;a&gt;</tt> tag and does not
      provide styling. It can be styled using inline or external CSS as
      appropriate.
    </p>

    <p><a href="#anchor">Top</a></p>

  </message>

  <message id="navigation-stackedWidget">
    <h2 id="stacked-widget">Stacked widget</h2>
    <p>
      A stacked widget is a container widget that stacks its child widgets on
      top of each other and displays a single child at any time.
    </p>
    <p>
      The ${doc-link WStackedWidget} accomplishes this using
      <tt>setHidden(bool)</tt> on the children. Using <tt>currentIndex()</tt>
      and <tt>setCurrentIndex(int index)</tt> you can retrieve or set the
      visible widget.
    </p>
    <p>
      Like its parent ${doc-link WContainerWidget}, <tt>WStackedWidget</tt> is
      by default not inline. The widget is rendered using an HTML
      <tt>&lt;div&gt;</tt> tag and does not provide styling. It can be styled
      using inline or external CSS as appropriate.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Stack}
      ${src Stack}
    </fieldset>

  </message>

  <message id="navigation-menu">
    <h2 id="navigation-menu">Menu</h2>
    <p>
      A menu widget provides a list of items which are associated with some
      contents. At any time one item is selected from the list.
    </p>
    <p>
      A ${doc-link WMenu} works in conjunction with a
      <a href="#/navigation/stacked-widget">WStackedWidget</a>,
      which manages the contents.
    </p>
    <p>
      The panel at the left is implemented using a <tt>WMenu</tt>.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Menu}
      ${src Menu}
    </fieldset>

    <p>
      You can create items with submenus by using the <tt>WSubMenuItem</tt>
      rather than the default <tt>WMenuItem</tt>.
    </p>
    <p>
      A menu has full support for bookmarks and the back button, by rendering
      its items using <a href="#/navigation/anchor">WAnchor</a> and making use
      of internal paths.
    </p>
    <p>
      By default, the menu does not provide any styling. It can be rendered
      using HTML <tt>&lt;ul&gt;</tt> and <tt>&lt;li&gt;</tt> elements. It
      should be styled using CSS. The look and behaviour of menu
      items can be customized by just reimplementing the styling. For example,
      the <a href="#/navigation/tab-widget">WTabWidget</a> is merely a
      specialized menu. By default the <tt>nav</tt> class from the
      <a href="http://twitter.github.com/bootstrap/components.html#navs"
      target="blank">Bootstrap theme</a> is applied.
    </p>

    <p><a href="#navigation-menu">Top</a></p>

  </message>

  <message id="navigation-tabWidget">
    <h2 id="navigation-tab">Tab widget</h2>
    <p>
      A tab widget is a widget that organizes contents in tab panes.
    </p>
    <p>
      A ${doc-link WTabWidget} combines a horizontal
      <a href="#/navigation/menu">WMenu</a> with a
      <a href="#/navigation/stacked-widget">WStackedWidget</a> in a tab-like look.
      A tab widget will place the tab bar on top of the contents, and fit the
      contents below it. It is similar to a
      <a href="#/navigation/navigation-bar">WNavigationBar</a> but with less
      options like a title or multiple menus.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Tab}
      ${src Tab}
    </fieldset>

    <p>
      The tab widget is styled by the current CSS theme. The look (of the
      header) can be overridden using the <tt>Wt-tabs</tt> CSS class and
      addition to selectors like <tt>ul</tt>, <tt>li</tt> and <tt>span</tt>.
    </p>

    <p><a href="#navigation-tab">Top</a></p>

  </message>

  <message id="navigation-navigationBar">
    <h2 id="navigation-bar">Navigation bar</h2>
    <p>
      A navigation bar is a widget that organizes contents in window- or
      application-specific drop down menus which are grouped in a parent menu.
      Usually, it is anchored to the top of the screen or a window.
    </p>
    <p>
      A ${doc-link WNavigationBar} consists of one ore more
      <a href="#/navigation/menu">WMenu</a> controls - each working in
      conjunction with a <a href="#/navigation/stacked-widget">WStackedWidget</a> to
      manage its contents.
      You can still add other kind of widgets to the navigation bar with
      <tt>addWidget()</tt>.
      It is similar to <a href="#/navigation/tab-widget">WTabWidget</a> but
      it has more features like a title and multiple menus in addition to
      a more extensive style class.
    </p>
    <p>
      In the example below, the title and an optional link is set with the
      method <tt>setTitle()</tt>.
    </p>
    <p>
      Especially for mobile applications, you can make the navigation bar
      responsive to the available screen size with <tt>setResponsive()</tt>.
      You can see the effect by resizing the window size of your browser.
    </p>
    <p>
      Use <tt>addMenu()</tt> to add a menu to the navigation bar, e.g. a menu
      for contents at the left side of the navigation bar and a right menu for
      help. You could also add a search widget with <tt>addSearch()</tt>. Note
      that if you add several widgets to the right then they are placed from
      right to left.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${NavigationBar}
      ${src NavigationBar}
    </fieldset>

    <h3>Remark</h3>
    <p>
      In some cases, you may want to add a form field to the navigation bar
      (e.g. for a compact login option) with <tt>addFormField()</tt>.
    </p>

    <p><a href="#navigation-bar">Top</a></p>

  </message>

  <message id="navigation-popupMenu">
    <h2 id="popup-menu">Popup menu</h2>
    <p>
      A popup menu is a menu presented in a popup window. The menu implements a
      typical context menu, with support for submenu's.
    </p>
    <p>
      ${doc-link WPopupMenu} is not to be confused with
      <a href="#/navigation/menu">WMenu</a> which implements an always-visible
      navigation menu for a web application.
    </p>
    <p>
      When initially created, the menu is invisible, until <tt>popup()</tt> or
      <tt>exec()</tt> is called. Then, the menu will remain visible until an
      item is selected, or the user cancels the menu (by pressing the Escape
      key or clicking elsewhere).
    </p>
    <p>
      The implementation assumes availability of JavaScript to position the
      menu at the current mouse position and provide feed-back of the currently
      selected item.
    </p>
    <p>
      <tt>WPopupMenu</tt> is similar in use to
      <a href="#/layout/dialogs">WDialog</a>. So there are two ways of using
      the menu. The simplest way is to use one of the <tt>exec()</tt> methods,
      apply a reentrant event loop and wait until the user selected an item or
      cancelled the popup menu (by pressing Escape or clicking elsewhere).
    </p>
    <p>
      Preferably, use one of the <tt>popup()</tt> methods to show the menu and
      listen to the <tt>aboutToHide</tt> signal where you read the
      <tt>result()</tt> (the last triggered menu item). If you listen to the
      <tt>aboutToHide</tt> signal of a parent popup it will also be triggered
      by its child popups.
    </p>
    <p>
      You have several options to react to the selection of an item:
      <ul>
        <li>
          You can use the ${doc-link WMenuItem} itself to identify the action,
          perhaps by specialization or by simply by binding custom data using
          <tt>WMenuItem::setData()</tt>.
        </li>
        <li>
          You can use a lambda function to connect to each of the listeners.
          In C++, you can use boost::bind() to bind parameters that identify the
          selected item.
        </li>
        <li>
          You can bind a separate method to each item's
          <tt>WMenuItem::triggered</tt> signal.
        </li>
      </ul>
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Popup}
      ${src Popup}
    </fieldset>

    <p><a href="#popup-menu">Top</a></p>

  </message>

  <message id="navigation-splitButton">
    <h2 id="split-button">Split button</h2>
    <p>
      A split button is a widget composed of an action button in addition to
      a drop down button which are shown beside each other.
    </p>
    <p>
      The action button of a ${doc-link WSplitButton} is implemented as a
      ${doc-link WPushButton} while the drop down button is implemented as a
      push button with a <a href="#/navigation/popup">WPopupMenu</a>.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${SplitButton}
      ${src SplitButton}
    </fieldset>

  </message>

  <message id="navigation-toolBar">
    <h2 id="toolbar">Toolbar</h2>
    <p>
      A toolbar is a widget composed of child widgets which are shown beside
      each other.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${ToolBar}
      ${src ToolBar}
    </fieldset>

  </message>

<!--TREES & TABLES message blocks-->

  <message id="mvc-intro">
    <p class="lead">Trees &amp; Tables &#8212; widgets for tabular and
    tree-like data</p>
  </message>

  <message id="treestables-Tables">
    <h2 id="tables">Tables</h2>
    <p>
      The most direct way to organize widgets in a tabular grid is
      using ${doc-link WTable}. This widget renders as an HTML
      <tt>&lt;table&gt;</tt> element.
    </p>

    <p>
      Each table cell is a <a href="#/layout/">Container</a> to which
      ontents can be added. The table will grow as necessary while you
      add data to it.
    </p>

    <p>
      Our first example shows a plain table, with default browser
      styling.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PlainTable}
      ${src PlainTable}
    </fieldset>

    <p>
      If you only need to display a <strong>static</strong> table
      (with a fixed number of rows and columns), then you might just
      as well consider using a <a
      href="#/layout/html-templates">WTemplate</a> containing the HTML
      markup for a table, and providing the contents (widgets or
      strings) by substituting place holders.
    </p>

    <p>
      In contrast, the <tt>WTable</tt> class is suitable when the
      table is to be constructed dynamically, based on information
      that may be variable in size.
    </p>

    <p>
      Finally, you may want to consider using a <a
      href="#/trees-tables/mvc-table-views">WTableView</a> if you
      would like to display large amounts of data (more than could fit
      in memory!), or if you would like the user to be able to resort
      the data or resize columns.
    </p>

    <p><a href="#tables">Top</a></p>

    <h3>Bootstrap styling</h3>

    <p>
      The bootstrap theme provides optional markup for the
      table. These styles are enabled by adding the <tt>"table"</tt>
      style class, and other optional style classes. The other styling
      options are enabled by adding one of the following classes:
      <dl class="dl-horizontal">
        <dt>table-bordered</dt>
        <dd>Adds borders</dd>
        <dt>table-hover</dt>
        <dd>Enables a row hover effect</dd>
        <dt>table-condensed</dt>
        <dd>Makes the table more compact</dd>
        <dt>table-striped</dt>
        <dd>Adds alternating row colors</dd>
      </dl>
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${StyledTable}
      ${src StyledTable}
    </fieldset>

    <p><a href="#tables">Top</a></p>

  </message>

  <message id="treestables-Trees">
    <h2 id="tree">Trees</h2>
    <p>
      A ${doc-link WTree} displays a tree widget.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Tree}
      ${src Tree}
    </fieldset>

    <p><a href="#tree">Top</a></p>

  </message>

  <message id="treestables-TreeTables">
    <h2 id="treetable">Trees</h2>
    <p>
      A ${doc-link WTreeTable} displays a tree widget.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${TreeTable}
      ${src TreeTable}
    </fieldset>

    <p><a href="#treetable">Top</a></p>

  </message>

  <message id="treestables-TableViews">
    <h2 id="mvc-table-view">MVC Table Views</h2>
    <p>
      A ${doc-link WTableView} displays tabular data. The data is
      provided by a separate ${doc-link WAbstractItemModel}. This is a
      variation of the classical MVC strategy, where the
      <strong>View</strong> displays data provided by a
      <strong>Model</strong>. The View delegates the rendering of each
      individual item (i.e. table cell) to an <strong>Item
      Delegate</strong> (${doc-link WItemDelegate} to render an item
      as a widget, allowing this aspect to be customized without
      needing to deal with the rest of the complexity of the view.
    </p>
    <p>
      A more direct approach to showing a table of data is to use a
      ${doc-link WTable} which allows you to directly specify a widget
      that renders each cell. Compared to this, a <tt>WTableView</tt>
      support virtual scrolling (for both rows and columns !), column
      sorting and resize handles, and the ability to define row
      headers which allow you to scroll through many columns of
      additional data while keeping the first header column(s) within
      view. Its main restriction is that every item must have the same
      height.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${SmallTableView}
      ${src SmallTableView}
    </fieldset>

    <p><a href="#mvc-table-view">Top</a></p>

    <h3>Virtual scrolling</h3>
    <p>
      A tableview has the capbility todisplay large datasets, by
      implementing virtual scrolling both horizontally and vertically.
    </p>

    <p>
      The example below shows how one can scroll through data in a
      virtual model with 10000 rows and 50 columns.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${LargeTableView}
      <p>
      ${src LargeTableView}
      </p>
      <span class="label label-info">Note</span>
      The implementation of <tt>VirtualModel</tt> is shown
      <a href="#/trees-tables/mvc-item-models">in the section on item
      models</a>
    </fieldset>

    <p><a href="#mvc-table-view">Top</a></p>

    <h3>Customizing cell rendering</h3>

    <p>
      The rendering of each cell is handled by a ${doc-link
      WAbstractItemDelegate}. An item delegate will typically query
      various properties of an item, which are provided by the model for
      different <a
      href="${doc-url}group__modelview.html#ga0ae864e12320f9f89172735e075ed068"
      target="_blank">data roles</a> (which one can consider pretty
      much like a 3rd dimension for what otherwise corresponds to
      two-dimensional model organized in rows and columns). The default
      implementation (${doc-link WItemDelegate}) will
      <ul>
        <li>render <strong>text</strong>,
            using the data role<tt>DisplayRole</tt>,</li>
        <li>render <strong>icons</strong>,
            using the data role <tt>DecorationRole</tt>,</li>
        <li>render <strong>check boxes</strong>,
            using the data role <tt>CheckStateRole</tt>,</li>
        <li>render <strong>links</strong>,
            using the data role <tt>LinkRole</tt>,</li>
        <li>render <strong>tool tips</strong>,
            using the data role <tt>ToolTipRole</tt>,</li>
        <li>render <strong>style classes</strong>,
            using the data role <tt>StyleClassRole</tt>.</li>
      </ul>
      If the default item delegate doesn't satisfy, you can reimplement it to
      tailor the rendering, and you can extend models with data for additional
      data roles.
    </p>

    <p><a href="#mvc-table-view">Top</a></p>

    <h3>Editing</h3>
    <p>
      MVC Views will automaticlly react to changes to the underlying
      model, be it in the form of data updates, or the insertion of
      new rows or columns.
    </p>
    <p>
      But an MVC View may also actively participate in editing the
      data. You can define editing triggers (such as a double click)
      and the model can indicate to the view which data can be
      edited. The default item delegate (<tt>WItemDelegate</tt>) will
      use a line edit for editing, but this can be customized by
      providing your own item delegate implementation.
    </p>

    <h3>Row headers</h3>
    <p>
      Especially when displaying datasets with many columns, it may be
      convenient to define a number of columns as row headers (using
      <tt>WAbstractItemView::setRowHeaderCount()</tt>), which are kept
      in view while scrolling to the columns.
    </p>

    <p><a href="#mvc-table-view">Top</a></p>

  </message>

  <message id="treestables-TreeViews">
    <h2 id="mvc-tree-view">MVC Tree Views</h2>
    <p>
      A ${doc-link WTreeView} displays tree data (with additional
      properties available in extra columns). The archetypical
      application is a file system browser: the filesystem tree is
      displayed in the first column, and additional columns annotate
      properties of files.
    </p>
    <p>
      As with other MVC item views, the actual data is provided by a
      ${doc-link WAbstractItemModel}. This is a variation of the
      classical MVC strategy, where the <strong>View</strong> displays
      data provided by a <strong>Model</strong>. The View delegates
      the rendering of each individual item (i.e. table cell) to an
      <strong>Item Delegate</strong> to render (as a widget) the
      individual items, allowing this to be easily customized.
    </p>
    <p>
      A more direct approach to showing a tree is to use the <a
      href="#/trees-tables/trees">WTree</a> or <a
      href="#/trees-tables/tree-tables">WTreeTable</a> widgets which
      do not enforce this Model/View separation and allow you to directly
      specify the widgets that renders each cell. Compared to this, a
      <tt>WTreeView</tt> supports virtual scrolling (have you ever
      seen that for a tree ?), column sorting and resize handles, and
      row headers which allow you to scroll through many columns of
      additional data while keeping the first column within view. Its
      main restriction is that each row must have the same height.
    </p>

    <p>
      The example below shows a treeview that is seeded with a custom
      hierarhical model which displays a revision in a git repository.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${TreeView}
      <p>
      ${src TreeView}
      </p>
      <span class="label label-info">Note</span> The implementation of
      <tt>GitModel</tt> is discussed in <a
      href="#/trees-tables/mvc-item-models">Item Models</a>
    </fieldset>

    <h3>Other Features</h3>
    <p>
      The tree view shares a great deal of functionality with its
      sibling table view (which both reimplement
      ${doc-link WAbstractItemView}), such as customizing cell rendering,
      editing and row headers. See <a href="#/trees-tables/mvc-table-views">
      MVC Table Views</a>.
    </p>

    <p><a href="#mvc-tree-view">Top</a></p>

  </message>

  <message id="treestables-ItemModels">
    <h2 id="mvc-item-models">MVC Item Models</h2>

    <p>A common data model involves lists, tables and trees of more or
    less uniform items. Several standard widgets provided by the
    library use such a model. The abstract #{doc-link
    WAbstractItemModel} base class provides the interface which is
    used by these view classes.</p>

    <p>Not only <a href="#/trees-tables/mvc-table-views">Table
    Views</a> and <a href="#/trees-tables/mvc-tree-views">Tree
    Views</a> display (and interact with) data from an item model, but
    so do also the list-oriented widgets such as <a
    href="#/forms/combo-box">Combo box</a>, <a
    href="#/forms/selection-box">Selection box</a>, <a
    href="#/forms/autocomplete">Auto complete</a>, and charting
    widgets such as <a
    href="#/graphics-charts/category-chart">Cartesian Chart, Scatter
    Plot</a> and <a
    href="#/graphics-charts/pie-chart">Pie Chart</a>.
    </p>

    <div>
      <img src="/pics/modelview.png"
           style="max-width: none; margin: 5px auto; display: block"/>
    </div>

    <h3>The model</h3>

    <blockquote>
      <p>An item model is essentially a table of items, where each
      item can be a parent to a nested table of items.</p>
    </blockquote>

    <p>Since recursive statements like the one above can confuse even
    a seasoned programmer, let's start from a simple model, and extend
    it to more complex instances.</p>

    <h4>Lists</h4>

    <img src="/pics/list-models.png" style="max-width: none; float: right; margin: 30px"/>

    <p>In its most simple and perhaps most common form, an item model
    simply stores a list of items. Such a model has only one column.
    </p>

    <p>
      Each item may holds different facets of the data, stored as
      different <strong>Item Data Roles</strong>. If a table has two
      dimensions (rows an columns), then data roles could be considered
      as a third dimension.
    </p>
    
    <p>
      The common use-case for item data roles is that for a single
      item, there may be a textual representation, but also an icon, a
      customized style class, a link, etc... 
    </p>

    <p>
      The built-in views will thus interpret
      subsets of this data to render a single item. In particular, the
      following data roles are commonly supported:
      <dl class="dl-horizontal">
        <dt>DisplayRole</dt>
        <dd>Rendered as text</dd>
        <dt>DecorationRole</dt>
        <dd>Rendered as icons</dd>
        <dt>CheckStateRole</dt>
        <dd>Rendered as check box state</dd>
        <dt>LinkRole</dt>
        <dd>Rendered as links</dd>
        <dt>ToolTipRole</dt>
        <dd>Rendered as tool tips</dd>
        <dt>StyleClassRole</dt>
        <dd>Rendered as style classes</dd>
      </dl>

      See the <a
      href="${doc-url}group__modelview.html#ga0ae864e12320f9f89172735e075ed068"
      target="_blank">WItemDataRole</a> enumeration for a more complete
      list of standard roles, whose use may depend on the View.
    </p>

    <h4 style="clear: both">Tables</h4>

    <img src="/pics/table-models.png" style="max-width: none; float: right; margin: 30px"/>

    As a straight forward generalization to lists, tables may include
    more than one more column, and each item can be identified by a
    <i>(row, column)</i> pair.
      
    <h4 style="clear: both">Trees</h4>

    <img src="/pics/tree-models.png" style="max-width: none; float: right; margin: 30px"/>

    <p>
      A tree model is - like a list - a model with a single column. In addition
      each item may be parent to another list.
    </p>

    <p>
      At this point it becomes necessary to introduce the concept of
      a ${doc-link WModelIndex} to uniquely identify an item. A model
      index is a data structucre containing:

      <dl class="dl-horizontal no-clear">
        <dt>row</dt>
        <dd>The row number</dd>
        <dt>column</dt>
        <dd>The column number</dd>
        <dt>parent</dt>
        <dd>The parent model index</dd>
      </dl>
    </p>

    <p>
      The recursion is thus achieved by associating a parent index
      with each item index. By convention, top-level items have an
      <strong>Invalid</strong> index (which is a default constructed
      <tt>WModelIndex</tt>). To make the recursive definition
      consistent, one can also imagine an invisible root item
      (corresponding to the "invalid" index) which is the parent of
      the top-level items.
    </p>

    <h4>Tree Tables</h4>

    <p>
      Finally, a tree table extends the list model by allow additional
      columns of data to be associated with each item row.
    </p>

    <p>
      None of the standard Views render hierarchical data that is not
      present in the first column ! While such data structures can
      indeed be defined by item models, this will effectively be
      ignored by the standard View classes.
    </p>

    <p><a href="#mvc-item-models">Top</a></p>

    <h3>Standard model implementations</h3>

    <p>
      To get you going, and more than sufficient for simple needs, the
      library provides a number of standard and generic models, which
      store the data in memory.
      <ul>
        <li>${doc-link WStandardItemModel} can implement any kind of
        item model, being composed of a table of ${doc-link
        WStandardItem}'s, which each can contain itself a nested table
        of <tt>WStandardItem</tt> items.</li>
        <li>${doc-link WStringListModel} only supports lists with a
        single column, and is thus optimized for list-oriented widgets
        (combo-boxes and the like).</li>
      </ul>

      One particarly useful standard model is the ${doc-link
      Dbo-QueryModel} which is a tabular model backed by database
      data.
    </p>

    <h3>Custom models</h3>

    <p>
      Separating models from views would be not very useful, if it were
      not of the ablity to implement customized models. These could be
      models that compute some or all data on the fly, or fetch this
      information from a underlying database or file system, or simply
      display information from an existing data structure in a
      tabular/tree-like way.
    </p>

    <h4>Table models</h4>

    <p>
      As a minimum, a custom table model should reimplement the
      following methods from ${doc-link WAbstractTableModel}:
      <dl class="dl-horizontal">
        <dt>int rowCount()</dt>
        <dd>Returns the table row count (only for the invalid parent!)</dd>
        <dt>int columnCount()</dt>
        <dd>Returns the table column count (only for the invalid parent!)</dd>
        <dt>boost::any data()</dt>
        <dd>Returns the data for an item, and a particular role</dd>
        <dt>boost::any headerData()</dt>
        <dd>Returns the header data for a column</dd>
      </dl>
    </p>

    <p>
      As an example of a custom table model, consider the following
      (non-sensical) model that simply displays row/column information
      for each item.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${LargeTableView}
      <p>
      ${src VirtualModel}
      </p>
      <span class="label label-info">Note</span> The instantiation of
      this model with a Table View is discussed in <a
      href="#/trees-tables/mvc-table-views">MVC Table Views</a>.
    </fieldset>

    <h4>Tree models</h4>

    <p>
      A custom tree model involves considerably more work. Each
      internal item (in the first column) which has children, needs to
      be identified by a unique 64-bit value (which may thus be a
      <tt>long long</tt> or a <tt>void *</tt> pointer). Depending on
      the source data, a suitable choice must be made for this data.
    </p>

    <p>
      The following methods must be implemented for a minimally
      compliant hierarchical model:
      <dl class="dl-horizontal">
        <dt>int rowCount()</dt>
        <dd>Returns the item children count</dd>
        <dt>int columnCount()</dt>
        <dd>Returns the column count (which is usually the same for
          each item in the first column)</dd>
        <dt>boost::any data()</dt>
        <dd>Returns the data for an item, and a particular role</dd>
        <dt>boost::any headerData()</dt>
        <dd>Returns the header data for a column</dd>
        <dt>WModelIndex child()</dt>
        <dd>Creates a child index</dd>
        <dt>WModelIndex parent()</dt>
        <dd>Creates a parent index</dd>
      </dl>
    </p>

    <p>
      As an example of a tree table model, consider the following
      model that loads information from a git repository (in this
      case, Wt's git). Only a minimum of information is kept in
      memory: we allocate a data structure only for folders that are
      being expanded, for use as internal pointer data in model
      indexes.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${TreeView}
      <p>
      ${src GitModel}
      </p>
      <span class="label label-info">Note</span> The instantiation of
      this model with a Tree View is discussed in <a
      href="#/trees-tables/mvc-tree-views">MVC Tree Views</a>.
    </fieldset>

    <p><a href="#mvc-item-models">Top</a></p>

    <h3>Sorting</h3>

    <p>
      A model may support sorting by one of its columns. This sorting
      can be implemented within the model itself.
    </p>

    <dl class="dl-horizontal">
      <dt>void sort()</dt>
      <dd>Sorts the model according to one of its columns.</dd>
    </dl>
    
    <p>
      Sorting may be bolted onto a source model using the <a
      href="#/trees-tables/proxy-models">WSortFilterProxyModel</a>,
      which is one of the standard proxy models.
    </p>

    <h3>Model Changes</h3>

    <p>
      A model does not necessarily need to be a static data source, but
      its data can also change, and data (rows/columns) can be added or
      removed. A model needs to generate events to inform Views of these
      modifications (for the events to which a View is subscribed). When
      implementing a custom model which is dynamic in nature, it is
      therefore important to emit these signals when making the
      modifications.
    </p>

    <!-- TODO List the relevant events here, in a table ? -->

    <h3>Editing</h3>

    <p>
      The model API also provides a standard interface to perform
      editing of the data, and some Views (such as the Tree View and
      Table Views) can be configured to allow editing of the data.
    </p>

    <p>
      If a custom wants to support this editing API, it needs to reimplement the
      following methods from ${doc-link WAbstractTableModel}:
      <dl class="dl-horizontal">
        <dt>bool setData()</dt>
        <dd>Updates data. Views typically use the <tt>EditRole</tt>
        for the data used in editing</dd>
        <dt>bool insertColumns()</dt>
        <dd>Inserts one or more columns</dd>
        <dt>bool insertRows()</dt>
        <dd>Inserts one or more rows</dd>
        <dt>bool removeColumns()</dt>
        <dd>Removes one or more columns</dd>
        <dt>bool removeRows()</dt>
        <dd>Removes one or more rows</dd>
      </dl>
    </p>

    <p><a href="#mvc-item-models">Top</a></p>

  </message>

<!--GRAPHICS & CHARTS message blocks-->

  <message id="graphics-intro">
    <p class="lead">Graphics &amp; Charts &#8212; generic and specialized painting
    infrastructure</p>
  </message>

  <message id="graphics-Painting2D">
    <h2 id="painting2D">2D Painting</h2>
    <h3>The painting system</h3>
    <p>
      Wt provides a vector graphics painting system, which depending on the
      browser support, uses inline SVG, inline VML, HTML5 &lt;canvas&gt; or a
      raster image to paint the graphics.
    </p>
    <p>
      The Wt API provides different classes that provide support for vector
      graphics painting. To use the paint system, you need to specialize
      ${doc-link WPaintedWidget} and use a ${doc-link WPainter} to paint the
      contents of the widget inside its <tt>WPaintedWidget::paintEvent()</tt>.
    </p>
    <p>
      In addition, a PDF backend is included in the library, which can be used
      <ul>
        <li>to <strong>make a PDF version</strong> of a painting, or</li>
        <li>to <strong>embed a painting</strong> in a PDF document.</li>
      </ul>
    </p>
    <p>
      To use inline SVG, you need to enable XHTML support in your configuration
      file (<tt>wt_config.xml</tt>) by enabling send-xhtml-mimetype .
    </p>

    <h3>Vector graphics painting class</h3>
    <p>
      The painter class ${doc-link WPainter} provides a vector graphics
      interface for painting. It has to be used in conjunction with a
      ${doc-link WPaintDevice}, onto which it paints:
      <ul>
        <li>Use ${doc-link WSvgImage} to render with SVG (Scalable Vector
            Graphics).</li>
        <li>Use ${doc-link WVmlImage} to render with the VML pseudo-standard.
            </li>
        <li>Use ${doc-link WCanvasPaintDevice} to render with HTML5 &lt;canvas&gt;
            element.</li>
        <li>Use ${doc-link WRasterImage} to render to a raster image.</li>
        <li>Use ${doc-link WPdfImage} to render to PDF.</li>
      </ul>
      WSvgImage and WVmlImage are paint devices for rendering using native
      vector graphics. The benefit of vector graphics is a lower bandwidth
      usage compared to raster images; indepedent of the image size.
      To start painting on a device, either pass the device through the
      constructor, or use <tt>begin()</tt>.
    </p>
    <p>
      A typical use is to instantiate a <tt>WPainter</tt> from within a
      specialized <tt>WPaintedWidget::paintEvent()</tt> implementation, to
      paint on the given paint device, but you can also use a painter to paint
      directly to a particular paint device of choice, for example to create
      SVG, PDF or PNG images (as resources). A painted widget can dynamically
      be updated as shown in the following example.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PaintingEvent}
      ${src PaintingEvent}
    </fieldset>

    <p><a href="#painting2D">Top</a></p>

    <p>
      The painter maintains the state such a...
      <ul>
        <li>the current <strong>pen</strong>, which you can define with
            <tt>setPen()</tt>,</li>
        <li>the current <strong>brush</strong>, which you can define with
            <tt>setBrush()</tt>,
        </li>
        <li>the current <strong>font</strong>, which you can define with
            <tt>setFont()</tt>,
        </li>
        <li>the current <strong>world transformation matrix</strong>, which you
            can get with <tt>worldTransform()</tt>,</li>
        <li>the <strong>clipping settings</strong> (See <tt>setClipping()</tt>
            and <tt>setClipPath()</tt>).</li>
      </ul>
      A particular state can be saved using <tt>save()</tt> and later restored
      using <tt>restore()</tt>.
    </p>
    <p>
      The painting system distinguishes between different coordinate types:
      <ul>
        <li>device coordinates,</li>
        <li>logical coordinates, and</li>
        <li>local coordinates.</li>
      </ul>
      Each coordinate type corresponds to a coordinate system:
      <dl>
        <dt>The device coordinate system</dt>
        <dd>ranges from (0, 0) in the top left corner of the device, to
        <tt>device->width().toPixels(), device->height().toPixels()</tt> for
            the bottom right corner.</dd>
        <dt>The logical coordinate system</dt>
        <dd>defines a coordinate system that may be chosen independent of the
            geometry of the device, which is convenient to make abstraction of
            the actual device size. </dd>
        <dt>The local coordinate system</dt>
        <dd>may be different from the logical coordinate system because of a
            transformation (which you can set with <tt>translate()</tt>,
            <tt>rotate()</tt>, and <tt>scale()</tt>).</dd>
      </dl>
      Initially, the local coordinate system coincides with the logical
      coordinate system, which coincides with the device coordinate system.
    </p>
    <p>
      The device coordinates are defined in terms of pixels. Even though most
      underlying devices are actual vector graphics formats, when used in
      conjunction with a <tt>WPaintedWidget</tt>, these vector graphics are
      rendered by the browser onto a pixel-based canvas (like the rest of the
      user-interface). The coordinates are defined such that integer values
      correspond to an imaginary raster which separates the individual pixels,
      as in the figure below.
    </p>
    <p class="centered">
      <img alt="The device coordinate system for a 6x5 pixel device"
           src="/pics/WPainter.png"></img> <br/>
      <strong>The device coordinate system for a 6x5 pixel device</strong>
    </p>
    <p>
      As a consequence, to avoid anti-aliasing effects when drawing straight
      lines of width one pixel, you will need to use vertices that indicate the
      middle of a pixel to get a crisp one-pixel wide line, as shown in the
      above picture.
    </p>
    <p>
      You can map logical coordinates onto device coordinates by setting a
      <tt>viewPort()</tt> and a <tt>window()</tt>; this defines a viewPort
      transformation.
    </p>
    <p>
      You can define how the current local coordinates map onto
      logical coordinates by changing the world transformation using
      <tt>translate()</tt>, <tt>rotate()</tt>, <tt>scale()</tt> and
      <tt>setWorldTransform()</tt> operations.
    </p>
    <p>
      The painter provides support for clipping using an arbitrary
      ${doc-link WPainterPath}. Please note that the ${doc-link WVmlImage}
      paint device only has limited support for clipping.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PaintingShapes}
      ${src PaintingShapes}
    </fieldset>

    <p><a href="#painting2D">Top</a></p>

    <h3>Transformations</h3>

    <h4>Introduction</h4>
    <p>
      Besides the different transformation methods which you can apply to a
      drawing (i.e. translate, rotate, and scale), there are also two other
      methods which are indispensable once you start generating more complex
      drawings:
      <ul>
        <li>
          <tt>WPainter::save()</tt> to save the current painter state on a
          stack, and
        </li>
        <li>
          <tt>WPainter::restore()</tt> to restore a painter state from the
          stack.
        </li>
      </ul>
      The <strong>painter state</strong> that is saved is the current pen,
      brush, font, shadow, transformation and clipping settings (See
      <tt>WPainter::setClipping()</tt> and
      <tt>WPainter::setClipPath()</tt>).
    </p>

    <h4>Translate the origin</h4>
    <p>
      The method <tt>WPainter::translate()</tt> translates the origin of the
      logical coordinate system to a new location relative to the current
      logical coordinate system. It's a good practice to save the painter
      state before doing any transformations because usually, it's easier to
      call <tt>restore()</tt> compared to a reverse translation to return to
      the oiginal state. In addition, if you're translating in a loop you might
      end up missing a part of your drawing because it was drawn outside the
      the paint device's edge.
    </p>

    <h4>Rotate to the paint device</h4>
    <p>
      The method <tt>WPainter::rotate()</tt> rotates the logical coordinate
      system around its origin by an angle. The angle is specified in degrees,
      and positive values are clockwise. Use this method to rotate an object
      around its origin before it is drawn on the paint device.
    </p>

    <h4>Scale to the paint device</h4>
    <p>
      The method <tt>WPainter::scale()</tt> scales the logical coordinate
      system around its origin, by a factor in the X and Y directions.
      Use this method to scale what you draw on the paint device.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PaintingTransformations}
      ${src PaintingTransformations}
    </fieldset>

    <h4>Reset the transformations</h4>
    <p>
      Use the method <tt>WPainter::resetTransform()</tt> to reset the current
      transformation to the identity transformation matrix, so that the logical
      coordinate system coincides with the device coordinate system.
    </p>

    <p><a href="#painting2D">Top</a></p>

    <h3>Clipping paths</h3>
    <p>
      A clipping path is like a normal ${doc-link WPainterPath} but it acts as
      mask to hide unwanted parts of shapes. The path is specified in local
      coordinates.
    </p>
    <p>
      You can set a clipping path with the method <tt>setClipPath()</tt>.
      To apply clipping you still have to enable clipping using
      <tt>setClipping(true)</tt>.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PaintingClipping}
      ${src PaintingClipping}
    </fieldset>

    <p><a href="#painting2D">Top</a></p>

    <h3>Style</h3>
    <p>
      Until now we used a limited number of line and fill styles. Now we will
      explore other options to make a drawing more attractive by examples.
      <ul>
        <li>
          the difference between <strong>filling</strong> with a brush and
          <strong>stroking</strong> with a pen
        </li>
        <li>
          <strong>transparency</strong> - drawing semi-transparent shapes using
          a color with lower opacity
        </li>
        <li>
          painting with a <strong>gradient brush</strong>
        </li>
        <li>
          rendering <strong>line ends</strong> with the line style
          <tt>PenCapStyle</tt> (flat, square or round)
        </li>
        <li>
          rendering <strong>line joins</strong> using the style
          <tt>PenJoinStyle</tt> (miter, bevel or round)
        </li>
        <li>
          drawing thicker lines using <tt>strokePath()</tt>
        </li>
        <li>
          drawing crisp lines - even if the line thickness is an odd integer
        </li>
      </ul>
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PaintingStyle}
      ${src PaintingStyle}
    </fieldset>

    <p><a href="#painting2D">Top</a></p>

    <h3>Images</h3>
    <p>
      One of the more fun features of ${doc-link WPainter} is that you can
      render one or more images on a painting using the method
      <tt>drawImage()</tt>. Images can be used for dynamic photo compositing or
      as a background for a drawing (e.g. with shapes, graphs, etc.).
      An image is specified in terms of a URL, and the width and height.
    </p>
    <p>
      An image can be drawn in different ways:
      <ul>
        <li>Draw an image at a starting point.</li>
        <li>Draw a part of an image at a starting point.</li>
        <li>
          Draw an image in a rectangle and scale it to the width and heigth of
          it.
        </li>
        <li>
          Draw a part of an image in a rectangle and scale it to the width and
          heigth of it.
        </li>
      </ul>
      Please note that the image can become blurry when scaling up or grainy
      when scaling down too much.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PaintingImages}
      ${src PaintingImages}
    </fieldset>

    <p><a href="#painting2D">Top</a></p>

  </message>

  <message id="graphics-Paintbrush">
    <h2 id="paintbrush">Paintbrush</h2>
    <p>
      Here is an example showing a more dynamic use of Wt's vector
      graphics API.
    </p>
    <p>
      Wt's ${doc-link WPaintedWidget} renders as SVG, VML or HTML5
      graphics depending on the capabilities of the browser. The
      backend decides how to render the graphics, the application
      programmer has to draw his graphics using the available methods
      in the ${doc-link WPainter} API. The drawing primitives include
      points, lines, arcs, cubic splines, text, etc.
    </p>
    <p>
      The <tt>update()</tt> method of <tt>WPaintedWidget</tt> is called with
      the <tt>PaintUpdate</tt> rendering flag to update the canvas without
      clearing the previously painted contents (which is the default behavior).
    </p>
    <p>
      Every mouse drag operation on the simple painting device is sent to the
      server, which in turn updates the canvas. You could imagine more
      interesting use cases, such as a multi-user white board, or interactive
      visualizations.
    </p>
    <p>
      You can use a custom cursor image (pencil) by providing a cursor image to
      ${doc-link WCssDecorationStyle}.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Paintbrush}
      ${src Paintbrush}
    </fieldset>

    <p><a href="#">Top</a></p>

  </message>

  <message id="graphics-CategoryChart">
    <h2 id="category-chart">Category chart</h2>
    <h3>The Charting library</h3>
    <p>
      The examples in this menu and the other charting menus
      <a href="#/graphics/scatter-plot">Scatter plot</a> and
      <a href="#/graphics/pie-chart">Pie chart</a> demonstrate some of the
      capabilities of the
      <a href="http://www.webtoolkit.eu/wt/doc/reference/html/namespaceWt_1_1Chart.html"
      target="_new">Wt charting widgets</a>. These widgets are implemented using
      the Wt painting API ${doc-link WPaintedWidget} which provides
      cross-browser native painting, using VML, SVG, or the HTML5 canvas tag.
    </p>
    <p>
      The two main chart widgets are
      <ul>
        <li>
          ${doc-link WCartesianChart}, which provides charts with a X and a Y
          axis to show data, and
        </li>
        <li>
          ${doc-link WPieChart} which provides pie charts.
        </li>
      </ul>
      These widgets are based on the MVC mechanism, and retrieve their data
      from a ${doc-link WAbstractItemModel}.
    </p>
    <p>
      A cartesian chart is either a CategoryChart or a ScatterPlot.
      <ul>
        <li>
          A <strong>CategoryChart</strong> shows data in categories.
        </li>
        <li>
          A <strong>ScatterPlot</strong> shows the data according to a
          numerical X scale.
        </li>
      </ul>
      It can display one or multiple data series which may be rendered
      individually using bars, lines, areas, or points.
      To use a cartesian chart, the minimum you need to do is to set a model
      using <tt>setModel()</tt>, set the model column that holds the X data
      using <tt>setXSeriesColumn(int modelColumn)</tt>, and add one or more
      series using <tt>addSeries(const WDataSeries&amp;)</tt>. Each series
      corresponds to one data column that holds Y data.
    </p>
    <p>
      Many aspects of the charts may be customized. By default, style
      information for rendering data series are taken from a
      ${doc-link WChartPalette}. It is straightforward to specialize this class
      to provide different styles from the standard styles provided by
      ${doc-link WStandardPalette}.
    </p>
    <p>
      The cartesian chart has support for dual Y axes. Each data series may be
      bound to one of the two Y axes. By default, only the first Y axis is
      displayed. To show the second Y axis you will need to call
      <tt>chart->axis(Y2Axis).setVisible(true)</tt>
      By default a chart has a horizontal X axis and a vertical Y axis, which
      corresponds to a <tt>Vertical</tt> orientation. The orientation may be
      changed to <tt>Horizontal</tt> using <tt>setOrientation()</tt>.
      The styling of the data series are defined by a palette which may be set
      using <tt>setPalette(WChartPalette *)</tt>, but may be overridden by
      settings in each data series.
    </p>

    <h3>What is a category chart?</h3>
    <p>
      A category chart has different categories on the X axis, and displays
      values of one or more data series on the Y axes as a series of bars. The
      values corresponding to each category are plotted consecutively in model
      row order. Each data series corresponds to a column from the model and
      may be rendered differently (This is configured in the data series - See
      ${doc-link WDataSeries} for more information).
    </p>
    <p>
      As a cartesian chart it provides automatic configuration of the axes, and
      support for a second Y axis. In addition, you may use a simple built-in
      legend, or extend the class to provide a specialized legend. In the
      example below, we use a manual Y axis configuration, with a break as
      would be commonly used when your data has a few outliers.
    </p>
    <p>
      The table view allows editing of the model, which is automatically
      reflected in the chart.
    </p>
    <p>
      By the way, would you expect this example to work when Ajax/JavaScript
      are not available or disabled?
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${CategoryChart}
      ${src CategoryChart}
    </fieldset>

    <p><a href="#category-chart">Top</a></p>

  </message>

  <message id="graphics-ScatterPlot">
    <h2 id="scatter-plot">Scatter Plot</h2>
    <h3>The Charting library</h3>
    <p>
      See <a href="#graphics/category-chart">Category chart</a> for an
      introduction to the charting library.
    </p>

    <h3>What is a scatter plot?</h3>
    <p>
      A scatter plot is very much like a category chart, but uses numerical
      data on the X axis. By default, these numerical data are mapped linearly
      on the X axis, but may also be log transformed (This can also be
      configured for the Y axes). In addition, there is special support for
      displaying date series, by means of smart heuristics for chosing the
      labels on the X axis.
    </p>
    <p>
      In a ScatterPlot, the X series data are interpreted as numbers on a
      linear scale. The scale for the X axis defaults to a
      <strong>LinearScale</strong>, but this may be changed to a
      <strong>DateScale</strong> when the X series contains dates (of type
      <tt>WDate</tt>) to create a time series chart, or to a
      <strong>LogScale</strong>. A ScatterPlot supports the same types of data
      series as a CategoryChart, but does not support stacking. In a scatter
      plot, the X series do not need to be ordered in increasing values, and it
      may be set differently for each dataseries using
      <tt>WDataSeries::setXSeriesColumn(int modelColumn)</tt>.
    </p>

    <h3>Scatter plot of a time series</h3>
    <p>
      The table below shows an extract from historical financial market data.
      The scatter plot shows the second and the third column as line series.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${ScatterPlotData}
      ${src ScatterPlotData}
    </fieldset>

    <p><a href="#scatter-plot">Top</a></p>

    <h3>Scatter plot of a function</h3>
    <p>
      Below we plot a single sine curve. We use 'curve' data series, which
      creates a smooth spline curve that interpolates the data points. As is
      typical when showing mathematical functions, we let the axes cross each
      other at the origin (0, 0).
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${ScatterPlotCurve}
      ${src ScatterPlotCurve}
    </fieldset>

    <h3>Remark</h3>
    <p>
      Missing data in a model series Y values is interpreted as a break. For
      curve-like series, this breaks the curve (or line).
    </p>

    <p><a href="#scatter-plot">Top</a></p>

  </message>

  <message id="graphics-PieChart">
    <h2 id="pie-chart">Pie Chart</h2>
    <h3>The Charting library</h3>
    <p>
      See <a href="#graphics/category-chart">Category chart</a> for an
      introduction to the charting library.
    </p>

    <h3>What is a pie chart?</h3>
    <p>
      A pie chart is a circular visualization of a single data series. The pie
      chart is provided by the ${doc-link WPieChart} widget. The class supports
      both plain 2D pies, as well as a 3D effect (as used below). In the
      example the first segment is separated from the pie for emphasis.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PieChart}
      ${src PieChart}
    </fieldset>

    <p><a href="#pie-chart">Top</a></p>

  </message>

  <message id="graphics-GoogleMap">
    <h2 id="google-map">Google Maps</h2>
    <p>
      The ${doc-link WGoogleMap} widget displays a google map. It implements a
      Wt wrapper around the Google Maps functionality.
    </p>
    <p>
      This widget uses the online Google Maps server to display a map. It
      exposes a part of the google maps API; both version 2 and version 3 are
      supported. The version 2 API is used by default, to enable the version 3
      API, use the constructor's version argument.
    </p>
    <p>
      To use the map on a public server you will need to obtain a key. The
      widget will look for this key as the configuration property
      <tt>google_api_key</tt>. If this configuration property has not been
      set, it will use a key that is suitable for localhost.
    </p>
    <p>
      The ${doc-link WGoogleMap} widget displays a google map. It implements a
      Wt wrapper around the Google Maps functionality. The following example
      demonstrates multiple controls and shows a polyline representing a road
      description from the Emweb office to the old market of Leuven. We also
      added a marker to Koen's favourite bar!
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${GoogleMap}
      ${src GoogleMap}
      <p>
        Here is the corresponding XML template (with
        <tt>message id="media-GoogleMap-controls"</tt>) for the controls.
      </p>
      <fieldset class="src">
        <legend>source</legend>
        <pre>${GoogleMap-controls}</pre>
      </fieldset>
    </fieldset>

    <p><a href="#google-map">Top</a></p>

  </message>

  <message id="graphics-GoogleMap-controls">
    <table class="googlemaps-controls">
      <tr>
        <td>Zoom:</td>
        <td>
          ${zoom-in} ${zoom-out}
        </td>
      </tr>
      <tr>
        <td>Pan to:</td>
        <td>
          ${Brussels} ${Lisbon} ${Paris} ${emweb}
        </td>
      </tr>
      <tr>
        <td>Control menu type: </td>
        <td>
          ${control-menu-combo}
        </td>
      </tr>
      <tr>
        <td colspan="2">${dragging-cb}</td>
      </tr>
      <tr>
        <td colspan="2">${double-click-zoom-cb}</td>
      </tr>
      <tr>
        <td colspan="2">${scroll-wheel-zoom-cb}</td>
      </tr>
      <tr>
        <td colspan="2">${save-position} ${return-to-saved-position}</td>
      </tr>
    </table>
  </message>

  <message id="graphics-Painting3D">
    <h2 id="painting3D">3D Graphics</h2>
    <h3>WebGL</h3>
    <p>
      Wt uses WebGL to render 3D graphics in the browser. The class ${doc-link WGLWidget} provides an interface for a 3D widget. Most of the functions provided by this class are a simple one-to-one map of the WebGL functions available in the browser.
    </p>
    <p>
      The rendering process consists of four major parts, which should be implemented by overriding four virtual functions:
    </p>
    <ul>
      <li><tt>initializeGL()</tt>: This function is executed only once, when the widget is created.</li>
      <li><tt>resizeGL()</tt>: This function is called whenever the widget is resized</li>
      <li><tt>updateGL()</tt>: This function allows you to make state changes (e.g. to VBO's, shaders ...).</li>
      <li><tt>paintGL()</tt>: This function contains all necessary calls to do the actual painting. The effect of <tt>paintGL()</tt> is recorded on the server, but the generated JavaScript is repeatedly executed on the client without requiring client/server requests. This is for example used to rerender a scene client-side after changing the camera position</li>
    </ul>

    <h3>Server-side Fallback</h3>
    <p>
      When a browser does not support WebGL (e.g. IE10 or less, mobile browsers ...), ${doc-link WGLWidget} provides a server-side fall-back. The image will then be rendered in the server an sent to the browser as an PNG. Interaction is still possible, but the performance will be determined by the network latency. Also note that for practical scenarios this requires a server with hardware 3D acceleration.
    </p>
  </message>

  <message id="graphics-NumCharts3D">
    <h2>3D Numerical Chart</h2>
    <h3>The chart</h3>
    <p>
      The 3D charting API is built on top of Wt's 3D painting API. A chart is represented by a ${doc-link WCartesian3DChart}, which derives from ${doc-link WGLWidget}.
    </p>
    <p>
      Based on the sort of data that will be shown, a chart is one of two types (the same as for 2D charts):
      <ul>
        <li>a <strong>CategoryChart</strong> for categorized data</li>
        <li>a <strong>ScatterPlot</strong> for numerical data</li>
      </ul>
    </p>

    <h3>Types of data</h3>
    <p>
      All data that can be shown in a 3D chart, has to derive from ${doc-link WAbstractdataSeries3D}. Instances of this class include a model containing the actual data and all logic to draw themselves on the chart. This means all graphical features of the data (color, pointsize ...) are also part of this class.
    </p>
    <p>
      Wt provides three built-in classes representing data:
      <ul>
        <li><strong>WGridData</strong>: data lying on a grid specified by an x- and y-axis</li>
        <li><strong>WEquidistantGridData</strong>: data lying on a grid with an equidistant x- and y-axis</li>
        <li><strong>WScatterData</strong>: data containing a collection of unconstrained points</li>
      </ul>
    </p>
    <p>
      Each instance of these dataseries has a ${doc-link WAbstractItemModel} backing them. The model for all these dataseries has to be provided as a table. <br />
      In ${doc-link WGridData}, the table must contain one column representing the x-axis values and one row representing the y-axis values. All other values then specify the z-axis value belonging to the corresponding (x, y) pair. <br />
      The backing model for ${doc-link WEquidistantGridData} is similar, with the difference that no x- and y-axis values are required. These can be specified directly to the class instance using <tt>setXAbscis(double XMinimum, double deltaX)</tt> and <tt>setYAbscis(double YMinimum, double deltaY)</tt>. <br />
      The model for ${doc-link WScatterData} must have three columns containing (x, y, z) values for every point.
    </p>
    <p>
      All grid-based data has the additional feature that the visualization of the data is determined by its <tt>Series3DType</tt>, which can be either of three values:
      <ul>
        <li>PointSeries3D</li>
        <li>SurfaceSeries3D</li>
        <li>BarSeries3D</li>
      </ul>
      Note that PointSeries3D and SurfaceSeries3D only apply to a chart of type ScatterPlot and BarSeries3D only applies to a CategoryChart.
    </p>

    <fieldset class="example">
      ${NumericalCharts3D}
      ${src NumericalCharts3D}
    </fieldset>
  </message>

  <message id="graphics-CatCharts3D">
    <h2>3D Category Chart</h2>
    <p>
      General info on how to use the 3D Charting API can be found under '3D numerical chart'.
    </p>
    <h3>The data</h3>
    <p>
      A categorical representation is only possible for grid-based data. In terms of the API this means any class deriving ${doc-link WAbstractGridData}. Wt already provides two implementations: ${doc-link WGridData} and ${doc-link WEquidistantGridData}. To create a categorical chart, the chart must be configured as such (by setting the type to <tt>CategoryChart</tt>) and the data which is added to this chart must be of the type <tt>BarSeries3D</tt>.
    </p>
    <p>
      A categorical chart also allows multiple dataseries to be shown if the dimensions are the same. The different bar-series are then stacked on top of each other.
    </p>
    <fieldset class="example">
      ${CategoryCharts3D}
      ${src CategoryCharts3D}
    </fieldset>
  </message>

  <message id="dataconfig.x-axisMin">Minimum X:</message>
  <message id="dataconfig.x-axisMax">Maximum X:</message>
  <message id="dataconfig.y-axisMin">Minimum Y:</message>
  <message id="dataconfig.y-axisMax">Maximum Y:</message>
  <message id="dataconfig.nbXPoints">Datapoints in X-axis:</message>
  <message id="dataconfig.nbYPoints">Datapoints in Y-axis:</message>
  <message id="dataconfig.meshEnabled">Enable mesh:</message>
  <message id="dataconfig.hiddenEnabled">Hide data:</message>
  <message id="dataconfig.typeSelection">Chart type:</message>

  <message id="bs-controlgroup">
    <div class="form-group">
      <label class="control-label" for="${id:{1}}">${tr:dataconfig.{1}}</label>
      <div class="controls">
        ${{1}}
      </div>
    </div>
  </message>

  <message id="chartconfig-template">
    <table class="table table-bordered">
      <tr><td>X-axis range (${xAuto} auto):</td><td>${xAxisMin}</td><td>${xAxisMax}</td></tr>
      <tr><td>Y-axis range (${yAuto} auto):</td><td>${yAxisMin}</td><td>${yAxisMax}</td></tr>
      <tr><td>Z-axis range (${zAuto} auto):</td><td>${zAxisMin}</td><td>${zAxisMax}</td></tr>
    </table>
  </message>

  <message id="dataconfig-template">
    <table class="table table-bordered">
      <tr><td>X range min/max</td><td>${x-axisMin}</td><td>${x-axisMax}</td></tr>
      <tr><td>Y range min/max</td><td>${y-axisMin}</td><td>${y-axisMax}</td></tr>
      <tr><td>number of points X/Y</td><td>
      <div class="form-group"><div class="controls">${nbXPoints}</div></div>
      </td><td>
      <div class="form-group"><div class="controls">${nbYPoints}</div></div>
      </td></tr>
      <tr><td>pointsize</td><td>${pointSize}</td><td></td></tr>
    </table>
    <form class="form-horizontal">
      ${block:bs-controlgroup typeSelection}
      ${block:bs-controlgroup meshEnabled}
      ${block:bs-controlgroup hiddenEnabled}
    </form>
  </message>

  <message id="scatterdata-config">
    <table class="table">
      <tr><td>Scatterdata:</td></tr>
      <tr><td>pointsize</td><td>${pointSize}</td></tr>
      <tr><td>Enable droplines</td><td>${enableDroplines}</td></tr>
      <tr><td>Hide data</td><td>${hide}</td></tr>
    </table>
  </message>

  <message id="categorydata-config">
    <table class="table">
      <tr><td>Categoric dataset 1:</td></tr>
      <tr><td>Bar width X/Y</td><td>${barWidthX}</td><td>${barWidthY}</td></tr>
      <tr><td>Hide data</td><td>${hide}</td></tr>
    </table>
  </message>

<!--EVENTS message blocks-->

  <message id="events-intro">
    <p class="lead">Events &#8212; making your application dynamic with the signal/slot concept</p>
  </message>

  <message id="events-Introduction">
    <h2 id="events">Introduction</h2>
    <h3></h3>
    <p>

    </p>

    <h3></h3>
    <p>

    </p>

    <p><a href="#events">Top</a></p>

  </message>


<!--MEDIA message blocks-->

  <message id="specialpurposewidgets-intro">
    <p class="lead">Media &#8212; video, audio, PDF and other resources</p>
  </message>

  <message id="media-MediaPlayer">
    <h2 id="media-player">Media Player</h2>
    <p>
      This widget implements a media player with a customizable user-interface,
      suitable to play video or audio.
    </p>
    <p>
      This widget relies on a third-party JavaScript component
      <a href="http://www.jplayer.org" target="blank">jPlayer</a>, which is
      distributed together with Wt.
    </p>
    <p>
      To support cross-browser playing of video or audio content, you may need
      to provide appropriately encoded contents. For audio, at least an MP3 or
      MP4 audio (M4A) encoding should be supplied, while for video the M4V
      encoding should be provided. Additional encodings are beneficial since
      they increase the chance that native HTML <tt>&lt;video&gt;</tt> or
      <tt>&lt;audio</tt>&gt; elements can be used (which may be hardware
      accelerated), instead of the flash player. See <a href=
      "http://www.jplayer.org/latest/developer-guide/#reference-html5-media"
      target="blank">HTML5 browser media support</a>.
    </p>
    <p>
      You need to specify the encoding types you are going to use when
      instantiating the media player, since based on the chosen encodings, a
      particular suitable implementation will be used. Thus, you need to call
      <tt>addSource()</tt> immediately, but you may pass empty URLs if you do
      not yet want to load media.
    </p>
    <p>
      The player provides a user-interface to control the playback which may be
      freely customized, and which is independent of the underlying media
      technology (HTML video or Flash player). The controls user-interface may
      be implemented as a Wt widget, where the controls (buttons, progress bars,
      and text widgets) are bound directly to the video player component
      (client-side).
    </p>
    <p>
      The default user-interface can be themed using jPlayer themes. The theme
      is global (it applies to all media player instances), and is configured
      by loading a CSS stylesheet, e.g. <tt>Wt::WApplication::instance()->
      useStyleSheet(WApplication::resourcesUrl() +
      "jPlayer/skin/jplayer.blue.monday.css"</tt>.
    </p>
    <p>
      The following examples show a video and audio player using the default
      controls.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${MediaPlayerVideo}
      ${src MediaPlayerVideo}
    </fieldset>

    <fieldset class="example">
      <legend>Example</legend>
      ${MediaPlayerAudio}
      ${src MediaPlayerAudio}
    </fieldset>

    <p>
      Alternatively, a custom widget may be set which implements the controls,
      using <tt>setControlsWidget()</tt>. In this case, you should add to this
      widget the buttons, text place holders, and progress bars and bind them
      to the media player using the <tt>setButton()</tt>, <tt>setText()</tt>
      and <tt>setProgressBar()</tt> methods. The controls widget is integrated
      in the media player, and this has as unique benefit (for a video player)
      that they may also be shown when the video player is maximized.
    </p>
    <p>
      Finally, you may want to control the media player only through widgets
      external to the media player. This may be configured by setting 0 as
      controlsWidget. In this case however, full screen mode should not be used
      since there is no way to restore the original size.
    </p>

    <p><a href="#media-player">Top</a></p>

  </message>

  <message id="media-Sound">
    <h2>Sound</h2>
    <p>
      ${doc-link WSound} is a value class to play a sound effect. It provides a
      way to play an MP3 sound asynchonously (if the browser supports this). It
      is intended as a simple way to play event sounds (not quite a media
      center).
    </p>
    <p>
      The <tt>WSound</tt> class uses a
      <a href="#/media/wmediaplayer">WMediaPlayer</a> to play the sound (using
      HTML <tt>&lt;audio&gt;</tt> or a flash player).
    </p>

    <p>
      The following example creates a beep sound that will be repeated 3 times.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Sound}
      ${src Sound}
    </fieldset>

  </message>

  <message id="media-Audio">
    <h2 id="audio">Audio</h2>
    <p>
      ${doc-link WAudio} is a widget to play audio. It is a low-level widget,
      mapping directly onto a <tt>&lt;audio&gt;</tt> element available in HTML5
      compliant browsers.
    </p>
    <p>
      In almost every situation you should use
      <ul>
        <li>
          the <a href="#/media/wmediaplayer">WMediaPlayer</a> widget if you
          want the user to be able to interact with the audio, or
        </li>
        <li>
          the <a href="#/media/wsound">WSound</a> widget for simple sound
          feedback.
        </li>
      </ul>
    </p>
    <p>
      Usage of the audio element consists of adding one or more audio sources
      and setting some options.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Audio}
      ${src Audio}
    </fieldset>

    <p>
      Use the method <tt>setAlternativeContent()</tt> to show alternative
      content if the audio cannot be played. The alternative content can be any
      widget; you can set it to an alternative media player (QuickTime, Flash,
      ...), show a Flash movie, an animated gif, a text, a poster image, ... .
      There are two reasons why the a browser may use the alternative content:
      <ul>
        <li>
          either because the browser does not support the HTML5 audio tag
          (alternative content is displayed even when JavaScript is not
          available), or
      </li>
      <li>
        because none of the specified sources contain an audio format that is
        understood by the browser (requires JavaScript to display the
        alternative content).
        </li>
      </ul>
    </p>

    <p>
      The <tt>addSource()</tt> and <tt>setAlternativeContent()</tt> may not be
      called after the widget is rendered.
    </p>

    <p><a href="#audio">Top</a></p>

  </message>

  <message id="media-Video">
    <h2 id="video">Video</h2>
    <p>
      Although the <a href="#/media/wmediaplayer">WMediaPlayer</a> widget
      implements a cross-browser video player, in some cases, you may need
      direct access to a native HTML <tt>&lt;video&gt;</tt> element. This is
      provided by the ${doc-link WVideo} widget.
    </p>
    <p>
      The trailer used in the examples below is
      <a href="http://durian.blender.org/" target="blank">Sintel</a>, &#169;
      copyright Blender Foundation | durian.blender.org
    </p>

    <h3>Native video</h3>
    <p>
      In the example below the <tt>WVideo</tt> class is used with a
      ${doc-link WImage} (a static JPEG image) as fallback. The video will play
      on browsers (like Firefox, Chrome and Safari) that support MP4 or OGV
      video streams natively (using HTML <tt>&lt;video&gt;</tt>), but the video
      control will show the image on other browsers (Internet Explorer, Opera,
      ...).
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Video}
      ${src Video}
    </fieldset>

    <p><a href="#video">Top</a></p>

    <h3>Native video with fallback</h3>
    <p>
      For browsers that support HTML <tt>&lt;video&gt;</tt>, the video below
      looks exactly like the one above. On other browsers, the player below
      falls back to a Flash player to play the video. If flash is not supported
      on your system, a static image is shown.
    </p>
    <p>
      Any Flash-based video player can do the job. In the example below the FLV
      Player is used as fallback for HTML5 video.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${VideoFallback}
      ${src VideoFallback}
    </fieldset>

    <h3>Flash</h3>
    <p>
      You may also choose to simply rely on Flash to play the video. In the
      menu item <a href="#/media/wflashobject">WFlashObject</a> you can find an
      example.
    </p>

    <p><a href="#video">Top</a></p>

  </message>

  <message id="media-FlashObject">
    <h2>Flash object</h2>
    <p>
      Although a media player like
      <a href="#/media/wmediaplayer">WMediaPlayer</a> is usually used to play
      video, you may also choose a ${doc-link WFlashObject} to play video. In the
      example below the YouTube flash player is used. If flash is not supported
      on your system, a static image is shown.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${Flash}
      ${src Flash}
    </fieldset>

  </message>

  <message id="media-Resources">
    <h2 id="resources">Resources</h2>
    <p>
      A ${doc-link WResource} is a target for a HTTP request. It specifies
      application-dependent content that may be generated by your
      application on demand. This allows you to serve auxiliary objects
      related to a particular application or application session, and perhaps
      dynamically generate the content. There are different type of resources
      which can serve a HTTP request:
      <ul>
        <li><strong>a file</strong>, using ${doc-link WFileResource},</li>
        <li>other <strong>streaming data</strong>, using ${doc-link WStreamResource},</li>
        <li><strong>a memory map</strong>, using ${doc-link WMemoryResource},</li>
        <li><strong>a web service</strong> (e.g. REST), by specializing
            ${doc-link WResource}</li>
      </ul>
    </p>
    <p>
      You can deploy a resource depending on the scope:
      <ul>
        <li>
          Deploy a <strong>private resource</strong> if access should be limited
          to a session (single user access).
        </li>
        <li>
          Deploy a <strong>global resource</strong> if access should always be
          possible (e.g. a web service).
        </li>
      </ul>
    </p>
    <p>
      By default, a resource is private to an application; access to it is
      protected by same secret session Id that protects any other access to the
      application.
    </p>
    <p>
      You can help the browser to start a suitable helper application to handle
      the downloaded resource, or suggest to the user a suitable filename for
      saving the resource, by setting an appropriate file name using
      <tt>suggestFileName()</tt>.
    </p>
    <p>
      To serve resources that you create on the fly, you need to specialize
      the <tt>WResource</tt> class and implement <tt>handleRequest()</tt>.
    </p>
    <p>
      Because of the nature of the web, a resource may be requested one time or
      multiple times at the discretion of the browser, and therefore your
      resource should in general not have any side-effects except for what is
      needed to render its own contents. Unlike event notifications to a Wt
      application, resource requests are not serialized, but are
      <strong>handled concurrently</strong>. You need to grab the application
      lock if you want to access or modify other widget state from within the
      resource.
    </p>
    ${<if:cpp>}
    <p>
      When deleting a resource, any pending request is cancelled
      first. For this mechanism to work you need to specialize the destructor
      and call <tt>beingDeleted()</tt>. This method may safely be called
      multiple times (i.e. from within each destructor in the hierachy).
    </p>
    ${</if:cpp>}

    <fieldset class="example">
      <legend>Example</legend>
      ${ResourceCustom}
      ${src ResourceCustom}
    </fieldset>

    <p><a href="#resources">Top</a></p>

    <h3>Static resources</h3>
    <p>
      Static resources are global which means that they are available as long
      as the application is running. A web service (e.g. REST, SOAP, WSDL) is a
      typical example of a resource that should always be available. This could
      be needed for machine-to-machine communication, etc.
    </p>
    <p>
      Use <tt>WServer::addResource()</tt> to deploy static resources.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${ResourceStatic}
      ${src ResourceStatic}
    </fieldset>

    <p>
      Classes such as <tt>WAnchor</tt> or <tt>WImage</tt> can use a resource
      instead of a URL to provide their contents. So, in any widget where you
      pass a WLink, you can refer to a resource. You can find several examples
      in the widget gallery:
      <ul>
        <li><a href="#/media/wmediaplayer">WMediaPlayer</a></li>
        <li><a href="#/media/wsound">WSound</a></li>
        <li><a href="#/media/wimage">WImage</a></li>
        <li><a href="#/media/wvideo">WVideo</a></li>
        <li><a href="#/media/pdf-output">WPdfImage</a></li>
        <li><a href="#/media/pdf-output">WPdfRenderer</a></li>
      </ul>
    </p>

    <p><a href="#resources">Top</a></p>

  </message>

  <message id="media-PDF">
    <h2 id="pdf">PDF output</h2>
    <p>
      Wt provides two classes for rendering to PDF:
      <ul>
        <li>
          <a href="#media/pdf-images">WPdfImage</a> is a paint device for
          rendering to PDF
        </li>
        <li>
          <a href="#media/pdf-renderer">WPdfRenderer</a> to render XHTML to a
          multi-page PDF.
        </li>
      </ul>
    </p>

    <h3 id="media/pdf-images">PDF Images</h3>
    <p>
      The class ${doc-link WPdfImage} is a paint device for rendering
      to PDF. It supports two main use-cases:
      <ul>
        <li>as any other paint device, it can be used to create a PDF
        output of the painting (which could e.g. be a chart or your
        own painted widget), or</li>
        <li>it can be used to embed Wt-generated contents into a larger PDF
        document, e.g. to generate a report</li>
      </ul>
    </p>
    <p>
      A <tt>WPdfImage</tt> paint device is typically used in
      conjunction with a ${doc-link WPainter}, which provides a
      high-level unified painting API.
    </p>
    ${<if:cpp>}
      <p>
        The PDF is generated using
        <a href="http://libharu.org/">The Haru Free PDF Library</a>. This class
        is included in the library only if <tt>libharu</tt> was found during the
        build of the library.
      </p>
    ${</if:cpp>}
    ${<if:java>}
      <p>
        The PDF is generated using the <a
        href="http://pdfjet.com">PDFjet library</a>, and Wt can use
        either the open source or commercial version.
      </p>
    ${</if:java>}

    <p>The following example shows how to use a <tt>WPdfImage</tt> directly in
    conjunction with <tt>WPainter</tt>.</p>
    
    <fieldset class="example">
      <legend>Example</legend>
      ${PdfImage}
      ${src PdfImage}
    </fieldset>

    ${<if:cpp>}
      <p>Another common use-case is to paint the contents of a
      <tt>WPaintedWidget</tt>, such as a chart, to a PDF :
      </p>

      <fieldset class="example">
        ${src pdfImageWrite}
      </fieldset>
    ${</if:cpp>}

    <p>
      When you want to embed a PDF image into a larger document, you
      need to use its constructor which passes an existing PDF
      document and page for it to paint on.  This approach is used for
      example by the <a href="#media/pdf-renderer">WPdfRenderer</a> to
      render XHTML to multi-page PDF files.
    </p>
    <p>
      Font information is embedded in the PDF. Fonts supported are native
      PostScript fonts (Base-14) (only ASCII-7), or true type fonts
      (Unicode). See <tt>addFontCollection()</tt> for more information on how
      fonts are located and matched to ${doc-link WFont} descriptions.
    </p>
    <p>
      The paint device has the following limitations:
      <ul>
        <li>
          Images (cf. <tt>WPainter::drawImage()</tt>) can only be included
          from local files, and only JPG or PNG images can be embedded.
        </li>
        <li>
          Drop shadows are not supported.
        </li>
      </ul>
    </p>

    <p><a href="#pdf">Top</a></p>

    <h3 id="media/pdf-renderer">Rendering HTML to PDF</h3>
    <p>
      The class ${doc-link Render-WPdfRenderer} implements a XHTML to
      PDF renderer. It can be used to create mult-page reports,
      without the need for programming tedious layouting using a
      low-level drawing API.
    </p>
    <p>
      The rendering engine supports only a subset of XHTML. See the
      documentation of ${doc-link Render-WTextRenderer} for more information.
    </p>
    <p>
      Although the rendering class itself can render to any
      <tt>WPaintDevice</tt> (with font-metris), by far the most common
      use-case is to render to a PDF document using
      <tt>WPdfImage</tt>. Typically, you will want to adapt the pixel
      resolution By default it uses a pixel resolution of 72 DPI,
      which is a common default for printed documents, but differs
      from the default used by most browsers (which is 96 DPI and has
      nothing to do with the actual screen resolution). The resolution
      can be changed using <tt>setDpi()</tt> and has the effect of
      scaling down (or up) the rendering. This can be used in
      conjunction with <tt>setFontScale()</tt> to scale the font size
      differently than other content.
    </p>

    <fieldset class="example">
      <legend>Example</legend>
      ${PdfRenderer}
      ${src PdfRenderer}
    </fieldset>

    <p><a href="#pdf">Top</a></p>
  </message>
</messages>