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
|
/////////////////////////////////////////////////////////////////////////////
// Name: wwizard.cpp
// Purpose:
// Author: Cesar Mauri Loba
// Modified by:
// Created: Mon 18 Oct 2010 09:57:22 CEST
// RCS-ID:
// Copyright: (C) 2008-14 Cesar Mauri from CREA Sistemes Informatics
// Licence:
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
////@begin includes
////@end includes
#include "wwizard.h"
#include "viacamcontroller.h"
#include "configmanager.h"
#include <wx/timer.h>
#include "crvcamera.h"
#include "eviacamapp.h"
#include "cautostart.h"
#include "pointeraction.h"
#include "dwellclick.h"
#include "paths.h"
////@begin XPM images
////@end XPM images
#define SINGLE 1
#define SECONDARY 2
#define DOUBLE 3
#define DRAG 4
#define THIRD 5
/*!
* WWizard type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WWizard, wxWizard )
/*!
* WWizard event table definition
*/
BEGIN_EVENT_TABLE( WWizard, wxWizard )
////@begin WWizard event table entries
EVT_WIZARD_CANCEL( ID_WWIZARD, WWizard::OnWwizardCancel )
EVT_WIZARD_FINISHED( ID_WWIZARD, WWizard::OnWwizardFinished )
////@end WWizard event table entries
END_EVENT_TABLE()
/*!
* WWizard constructors
*/
WWizard::WWizard()
{
Init();
}
WWizard::WWizard( wxWindow* parent, wxWindowID id, const wxPoint& pos )
{
Init();
Create(parent, id, pos);
}
/*!
* WWizard creator
*/
bool WWizard::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos )
{
////@begin WWizard creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxBitmap wizardBitmap(wxNullBitmap);
wxWizard::Create( parent, id, _("Enable Viacam configuration wizard"), wizardBitmap, pos, wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxCLOSE_BOX );
CreateControls();
////@end WWizard creation
return true;
}
/*!
* WWizard destructor
*/
WWizard::~WWizard()
{
////@begin WWizard destruction
////@end WWizard destruction
}
/*!
* Member initialisation
*/
void WWizard::Init()
{
////@begin WWizard member initialisation
////@end WWizard member initialisation
m_performCalibration = true;
}
/*!
* Control creation for WWizard
*/
void WWizard::CreateControls()
{
////@begin WWizard content construction
WWizard* itemWizard1 = this;
WizardPage* itemWizardPageSimple2 = new WizardPage( itemWizard1 );
itemWizard1->GetPageAreaSizer()->Add(itemWizardPageSimple2);
WizardPage5* itemWizardPageSimple9 = new WizardPage5( itemWizard1 );
itemWizard1->GetPageAreaSizer()->Add(itemWizardPageSimple9);
WizardPage8* itemWizardPageSimple23 = new WizardPage8( itemWizard1 );
itemWizard1->GetPageAreaSizer()->Add(itemWizardPageSimple23);
WizardPage1* itemWizardPageSimple33 = new WizardPage1( itemWizard1 );
itemWizard1->GetPageAreaSizer()->Add(itemWizardPageSimple33);
WizardPage2* itemWizardPageSimple42 = new WizardPage2( itemWizard1 );
itemWizard1->GetPageAreaSizer()->Add(itemWizardPageSimple42);
WizardPage6* itemWizardPageSimple46 = new WizardPage6( itemWizard1 );
itemWizard1->GetPageAreaSizer()->Add(itemWizardPageSimple46);
WizardPage3* itemWizardPageSimple61 = new WizardPage3( itemWizard1 );
itemWizard1->GetPageAreaSizer()->Add(itemWizardPageSimple61);
WizardPage4* itemWizardPageSimple75 = new WizardPage4( itemWizard1 );
itemWizard1->GetPageAreaSizer()->Add(itemWizardPageSimple75);
wxWizardPageSimple* lastPage = NULL;
if (lastPage)
wxWizardPageSimple::Chain(lastPage, itemWizardPageSimple2);
lastPage = itemWizardPageSimple2;
if (lastPage)
wxWizardPageSimple::Chain(lastPage, itemWizardPageSimple9);
lastPage = itemWizardPageSimple9;
if (lastPage)
wxWizardPageSimple::Chain(lastPage, itemWizardPageSimple23);
lastPage = itemWizardPageSimple23;
if (lastPage)
wxWizardPageSimple::Chain(lastPage, itemWizardPageSimple33);
lastPage = itemWizardPageSimple33;
if (lastPage)
wxWizardPageSimple::Chain(lastPage, itemWizardPageSimple42);
lastPage = itemWizardPageSimple42;
if (lastPage)
wxWizardPageSimple::Chain(lastPage, itemWizardPageSimple46);
lastPage = itemWizardPageSimple46;
if (lastPage)
wxWizardPageSimple::Chain(lastPage, itemWizardPageSimple61);
lastPage = itemWizardPageSimple61;
if (lastPage)
wxWizardPageSimple::Chain(lastPage, itemWizardPageSimple75);
lastPage = itemWizardPageSimple75;
////@end WWizard content construction
}
/*!
* Runs the wizard.
*/
bool WWizard::Run()
{
wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
while (node)
{
wxWizardPage* startPage = wxDynamicCast(node->GetData(), wxWizardPage);
if (startPage)
{
FinishLayout();
ShowPage(startPage);
Show(true);
return true;
}
node = node->GetNext();
}
return false;
}
/*!
* Should we show tooltips?
*/
bool WWizard::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WWizard::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WWizard bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WWizard bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WWizard::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WWizard icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WWizard icon retrieval
}
void WWizard::UpdateToggleButtonStatus (wxToggleButton& toggle)
{
if (wxGetApp().GetController().GetEnabled()) {
toggle.SetValue(true);
toggle.SetLabel(_("Disable pointer control"));
}
else {
toggle.SetValue(false);
toggle.SetLabel(_("Enable pointer control"));
}
}
void WWizard::OnToggleHeadTrackingClick (wxCommandEvent& event, wxToggleButton& toggle)
{
bool isEnabled= wxGetApp().GetController().GetEnabled();
wxGetApp().GetController().SetEnabled(!isEnabled, !isEnabled, this);
UpdateToggleButtonStatus (toggle);
event.Skip(false);
}
void WWizard::OnToggleHeadTrackingUpdate(wxUpdateUIEvent& event, wxToggleButton& toggle)
{
if (wxGetApp().GetController().GetEnabled()!= toggle.GetValue()) {
UpdateToggleButtonStatus (toggle);
}
event.Skip(false);
}
/*!
* WizardPage type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WizardPage, wxWizardPageSimple )
/*!
* WizardPage event table definition
*/
BEGIN_EVENT_TABLE( WizardPage, wxWizardPageSimple )
////@begin WizardPage event table entries
////@end WizardPage event table entries
END_EVENT_TABLE()
/*!
* WizardPage constructors
*/
WizardPage::WizardPage()
{
Init();
}
WizardPage::WizardPage( wxWizard* parent )
{
Init();
m_wizardParent = (WWizard*) parent;
Create( parent );
}
/*!
* WizardPage creator
*/
bool WizardPage::Create( wxWizard* parent )
{
////@begin WizardPage creation
wxBitmap wizardBitmap(wxNullBitmap);
wxWizardPageSimple::Create( parent, NULL, NULL, wizardBitmap );
CreateControls();
if (GetSizer())
GetSizer()->Fit(this);
////@end WizardPage creation
return true;
}
/*!
* WizardPage destructor
*/
WizardPage::~WizardPage()
{
////@begin WizardPage destruction
////@end WizardPage destruction
}
/*!
* Member initialisation
*/
void WizardPage::Init()
{
////@begin WizardPage member initialisation
m_eviacamLogo = NULL;
////@end WizardPage member initialisation
}
/*!
* Control creation for WizardPage
*/
void WizardPage::CreateControls()
{
////@begin WizardPage content construction
WizardPage* itemWizardPageSimple2 = this;
wxFlexGridSizer* itemFlexGridSizer3 = new wxFlexGridSizer(0, 1, 0, 0);
itemWizardPageSimple2->SetSizer(itemFlexGridSizer3);
wxStaticText* itemStaticText4 = new wxStaticText( itemWizardPageSimple2, wxID_STATIC, _("Welcome to the eViacam configuration wizard"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText4->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Sans")));
itemFlexGridSizer3->Add(itemStaticText4, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxStaticLine* itemStaticLine5 = new wxStaticLine( itemWizardPageSimple2, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
itemFlexGridSizer3->Add(itemStaticLine5, 0, wxGROW|wxALIGN_TOP|wxALL, 5);
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL);
itemFlexGridSizer3->Add(itemBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_eviacamLogo = new wxStaticBitmap( itemWizardPageSimple2, wxID_STATIC, wxNullBitmap, wxDefaultPosition, wxSize(303, 100), 0 );
itemBoxSizer6->Add(m_eviacamLogo, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticText* itemStaticText8 = new wxStaticText( itemWizardPageSimple2, wxID_STATIC, _("Click Next to continue."), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer3->Add(itemStaticText8, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemFlexGridSizer3->AddGrowableRow(2);
itemFlexGridSizer3->AddGrowableCol(0);
////@end WizardPage content construction
wxString logoPath= eviacam::GetDataDir();
logoPath+= _T("/eviacam_logo.png");
m_eviacamLogo->SetBitmap(wxBitmap(logoPath, wxBITMAP_TYPE_PNG));
//m_eviacamLogo = new wxStaticBitmap( itemWizardPageSimple2, wxID_STATIC, itemWizardPageSimple2->GetBitmapResource(wxT("../doc/eviacam_logo.png")), wxDefaultPosition, wxSize(303, 100), 0 );
}
/*!
* Should we show tooltips?
*/
bool WizardPage::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WizardPage::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WizardPage bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WizardPage bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WizardPage::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WizardPage icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WizardPage icon retrieval
}
/*!
* WizardPage1 type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WizardPage1, wxWizardPageSimple )
/*!
* WizardPage1 event table definition
*/
BEGIN_EVENT_TABLE( WizardPage1, wxWizardPageSimple )
////@begin WizardPage1 event table entries
EVT_WIZARD_PAGE_CHANGED( -1, WizardPage1::OnWizardpage1Changed )
EVT_CHECKBOX( ID_CHECKBOX_PERFORM_CALIBRATION, WizardPage1::OnCheckboxPerformCalibrationClick )
////@end WizardPage1 event table entries
END_EVENT_TABLE()
/*!
* WizardPage1 constructors
*/
WizardPage1::WizardPage1()
{
Init();
}
WizardPage1::WizardPage1( wxWizard* parent )
{
Init();
m_wizardParent = (WWizard*) parent;
Create( parent );
}
/*!
* WizardPage1 creator
*/
bool WizardPage1::Create( wxWizard* parent )
{
////@begin WizardPage1 creation
wxBitmap wizardBitmap(wxNullBitmap);
wxWizardPageSimple::Create( parent, NULL, NULL, wizardBitmap );
CreateControls();
if (GetSizer())
GetSizer()->Fit(this);
////@end WizardPage1 creation
return true;
}
/*!
* WizardPage1 destructor
*/
WizardPage1::~WizardPage1()
{
////@begin WizardPage1 destruction
////@end WizardPage1 destruction
}
/*!
* Member initialisation
*/
void WizardPage1::Init()
{
////@begin WizardPage1 member initialisation
m_chkPerformCalibration = NULL;
////@end WizardPage1 member initialisation
}
/*!
* Control creation for WizardPage1
*/
void WizardPage1::CreateControls()
{
////@begin WizardPage1 content construction
WizardPage1* itemWizardPageSimple33 = this;
wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
itemWizardPageSimple33->SetSizer(itemBoxSizer34);
wxStaticText* itemStaticText35 = new wxStaticText( itemWizardPageSimple33, wxID_STATIC, _("Pointer calibration"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText35->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Sans")));
itemBoxSizer34->Add(itemStaticText35, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticLine* itemStaticLine36 = new wxStaticLine( itemWizardPageSimple33, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
itemBoxSizer34->Add(itemStaticLine36, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer37 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer34->Add(itemBoxSizer37, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText38 = new wxStaticText( itemWizardPageSimple33, wxID_STATIC, _("The assisted calibration procedure will ask you to move your head in order to automatically configure the appropriate motion parameters.\n\nAfter this calibration stage, you can manually adjust the motion parameters.\n\nNOTE: the calibration assistant will enable the pointer control so that you can test your configuration."), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText38->Wrap(450);
itemBoxSizer37->Add(itemStaticText38, 0, wxGROW|wxALL, 5);
itemBoxSizer37->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer37->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_chkPerformCalibration = new wxCheckBox( itemWizardPageSimple33, ID_CHECKBOX_PERFORM_CALIBRATION, _("Perform assisted calibration"), wxDefaultPosition, wxDefaultSize, 0 );
m_chkPerformCalibration->SetValue(false);
if (WizardPage1::ShowToolTips())
m_chkPerformCalibration->SetToolTip(_("If checked the next window will allow\nyou to calibrate the speed of the pointer."));
itemBoxSizer37->Add(m_chkPerformCalibration, 0, wxALIGN_LEFT|wxALL, 5);
////@end WizardPage1 content construction
}
/*!
* Should we show tooltips?
*/
bool WizardPage1::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WizardPage1::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WizardPage1 bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WizardPage1 bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WizardPage1::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WizardPage1 icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WizardPage1 icon retrieval
}
/*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_PERFORM_CALIBRATION
*/
void WizardPage1::OnCheckboxPerformCalibrationClick( wxCommandEvent& event )
{
m_wizardParent->SetPerformCalibration(m_chkPerformCalibration->GetValue());
event.Skip(false);
}
/*!
* WizardPage2 type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WizardPage2, wxWizardPageSimple )
/*!
* WizardPage2 event table definition
*/
BEGIN_EVENT_TABLE( WizardPage2, wxWizardPageSimple )
////@begin WizardPage2 event table entries
EVT_WIZARD_PAGE_CHANGED( -1, WizardPage2::OnWizardpage2Changed )
////@end WizardPage2 event table entries
END_EVENT_TABLE()
/*!
* WizardPage2 constructors
*/
WizardPage2::WizardPage2()
{
Init();
}
WizardPage2::WizardPage2( wxWizard* parent )
{
Init();
m_wizardParent = (WWizard*) parent;
Create( parent );
}
/*!
* WizardPage2 creator
*/
bool WizardPage2::Create( wxWizard* parent )
{
////@begin WizardPage2 creation
wxBitmap wizardBitmap(wxNullBitmap);
wxWizardPageSimple::Create( parent, NULL, NULL, wizardBitmap );
CreateControls();
if (GetSizer())
GetSizer()->Fit(this);
////@end WizardPage2 creation
return true;
}
/*!
* WizardPage2 destructor
*/
WizardPage2::~WizardPage2()
{
////@begin WizardPage2 destruction
////@end WizardPage2 destruction
}
/*!
* Member initialisation
*/
void WizardPage2::Init()
{
////@begin WizardPage2 member initialisation
////@end WizardPage2 member initialisation
}
/*!
* Control creation for WizardPage2
*/
void WizardPage2::CreateControls()
{
////@begin WizardPage2 content construction
WizardPage2* itemWizardPageSimple42 = this;
wxBoxSizer* itemBoxSizer43 = new wxBoxSizer(wxVERTICAL);
itemWizardPageSimple42->SetSizer(itemBoxSizer43);
wxStaticText* itemStaticText44 = new wxStaticText( itemWizardPageSimple42, wxID_STATIC, _("Pointer calibration "), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText44->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Sans")));
itemBoxSizer43->Add(itemStaticText44, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticLine* itemStaticLine45 = new wxStaticLine( itemWizardPageSimple42, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
itemBoxSizer43->Add(itemStaticLine45, 0, wxGROW|wxALL, 5);
////@end WizardPage2 content construction
}
/*!
* Should we show tooltips?
*/
bool WizardPage2::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WizardPage2::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WizardPage2 bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WizardPage2 bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WizardPage2::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WizardPage2 icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WizardPage2 icon retrieval
}
/*!
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_WIZARDPAGE2
*/
void WizardPage2::OnWizardpage2Changed( wxWizardEvent& event )
{
if (m_wizardParent->GetPerformCalibration() && event.GetDirection())
{
bool isEnabled= wxGetApp().GetController().GetEnabled();
wxGetApp().GetController().StartMotionCalibration();
wxGetApp().GetController().SetEnabled(isEnabled);
}
if (event.GetDirection())
m_wizardParent->ShowPage(GetNext());
else
m_wizardParent->ShowPage(GetPrev());
event.Skip(false);
}
/*!
* WizardPage3 type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WizardPage3, wxWizardPageSimple )
/*!
* WizardPage3 event table definition
*/
BEGIN_EVENT_TABLE( WizardPage3, wxWizardPageSimple )
////@begin WizardPage3 event table entries
EVT_WIZARD_PAGE_CHANGED( -1, WizardPage3::OnWizardpage3Changed )
EVT_RADIOBUTTON( ID_RADIOBUTTON_DWELL_CLICK, WizardPage3::OnRadiobuttonDwellClickSelected )
#if defined(__WXGTK__)
EVT_RADIOBUTTON( ID_RADIOBUTTON_GESTURE_CLICK, WizardPage3::OnRadiobuttonGestureClickSelected )
#endif
EVT_RADIOBUTTON( ID_RADIOBUTTON_NONE_CLICK, WizardPage3::OnRadiobuttonNoneClickSelected )
EVT_TOGGLEBUTTON( ID_TOGGLE_HEAD_TRACKING_PAGE3, WizardPage3::OnToggleHeadTrackingPage3Click )
EVT_UPDATE_UI( ID_TOGGLE_HEAD_TRACKING_PAGE3, WizardPage3::OnToggleHeadTrackingPage3Update )
////@end WizardPage3 event table entries
END_EVENT_TABLE()
/*!
* WizardPage3 constructors
*/
WizardPage3::WizardPage3()
{
Init();
}
WizardPage3::WizardPage3( wxWizard* parent )
{
Init();
m_wizardParent = (WWizard*) parent;
Create( parent );
}
/*!
* WizardPage3 creator
*/
bool WizardPage3::Create( wxWizard* parent )
{
////@begin WizardPage3 creation
wxBitmap wizardBitmap(wxNullBitmap);
wxWizardPageSimple::Create( parent, NULL, NULL, wizardBitmap );
CreateControls();
if (GetSizer())
GetSizer()->Fit(this);
////@end WizardPage3 creation
return true;
}
/*!
* WizardPage3 destructor
*/
WizardPage3::~WizardPage3()
{
////@begin WizardPage3 destruction
////@end WizardPage3 destruction
}
/*!
* Member initialisation
*/
void WizardPage3::Init()
{
////@begin WizardPage3 member initialisation
m_toggleTest = NULL;
m_rbDwellClick = NULL;
#if defined(__WXGTK__)
m_rbGestureClick = NULL;
#endif
m_rbNoneClick = NULL;
m_toggleHeadTrackingPage3 = NULL;
////@end WizardPage3 member initialisation
m_isLeftDown= false;
m_isDoubleClick= false;
}
/*!
* Control creation for WizardPage3
*/
void WizardPage3::CreateControls()
{
////@begin WizardPage3 content construction
WizardPage3* itemWizardPageSimple61 = this;
wxBoxSizer* itemBoxSizer62 = new wxBoxSizer(wxVERTICAL);
itemWizardPageSimple61->SetSizer(itemBoxSizer62);
wxStaticText* itemStaticText63 = new wxStaticText( itemWizardPageSimple61, wxID_STATIC, _("Click mode"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText63->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Sans")));
itemBoxSizer62->Add(itemStaticText63, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticLine* itemStaticLine64 = new wxStaticLine( itemWizardPageSimple61, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
itemBoxSizer62->Add(itemStaticLine64, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer65 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer62->Add(itemBoxSizer65, 0, wxGROW|wxALL, 5);
m_toggleTest = new wxToggleButton( itemWizardPageSimple61, ID_TOGGLE_TEST, _("Click here to test"), wxDefaultPosition, wxSize(-1, 50), 0 );
m_toggleTest->SetValue(false);
itemBoxSizer65->Add(m_toggleTest, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer65->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_rbDwellClick = new wxRadioButton( itemWizardPageSimple61, ID_RADIOBUTTON_DWELL_CLICK, _("Dwell Click (default)"), wxDefaultPosition, wxDefaultSize, 0 );
m_rbDwellClick->SetValue(true);
itemBoxSizer65->Add(m_rbDwellClick, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticText* itemStaticText69 = new wxStaticText( itemWizardPageSimple61, wxID_STATIC, _("The click is generated automatically when you hover the mouse pointer momentarily. The Click the Window lets you choose between different actions."), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText69->Wrap(450);
itemBoxSizer65->Add(itemStaticText69, 0, wxGROW|wxALL, 5);
#if defined(__WXGTK__)
m_rbGestureClick = new wxRadioButton( itemWizardPageSimple61, ID_RADIOBUTTON_GESTURE_CLICK, _("Gesture click"), wxDefaultPosition, wxDefaultSize, 0 );
m_rbGestureClick->SetValue(false);
itemBoxSizer65->Add(m_rbGestureClick, 0, wxALIGN_LEFT|wxALL, 5);
#endif
#if defined(__WXGTK__)
wxStaticText* itemStaticText71 = new wxStaticText( itemWizardPageSimple61, wxID_STATIC, _("The click is automatically generated by stopping the pointer for a moment and then moving the pointer to one of the 4 directions to choose the action."), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText71->Wrap(450);
itemBoxSizer65->Add(itemStaticText71, 0, wxGROW|wxALL, 5);
#endif
m_rbNoneClick = new wxRadioButton( itemWizardPageSimple61, ID_RADIOBUTTON_NONE_CLICK, _("No click. Click function disabled."), wxDefaultPosition, wxDefaultSize, 0 );
m_rbNoneClick->SetValue(false);
itemBoxSizer65->Add(m_rbNoneClick, 0, wxALIGN_LEFT|wxALL, 5);
itemBoxSizer65->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_toggleHeadTrackingPage3 = new wxToggleButton( itemWizardPageSimple61, ID_TOGGLE_HEAD_TRACKING_PAGE3, _("Enable head tracking"), wxDefaultPosition, wxDefaultSize, 0 );
m_toggleHeadTrackingPage3->SetValue(false);
itemBoxSizer65->Add(m_toggleHeadTrackingPage3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
// Connect events and objects
m_toggleTest->Connect(ID_TOGGLE_TEST, wxEVT_LEFT_DOWN, wxMouseEventHandler(WizardPage3::OnLeftDownTest), NULL, this);
m_toggleTest->Connect(ID_TOGGLE_TEST, wxEVT_LEFT_UP, wxMouseEventHandler(WizardPage3::OnLeftUpTest), NULL, this);
m_toggleTest->Connect(ID_TOGGLE_TEST, wxEVT_LEFT_DCLICK, wxMouseEventHandler(WizardPage3::OnLeftDClickTest), NULL, this);
m_toggleTest->Connect(ID_TOGGLE_TEST, wxEVT_MIDDLE_UP, wxMouseEventHandler(WizardPage3::OnMiddleUpTest), NULL, this);
m_toggleTest->Connect(ID_TOGGLE_TEST, wxEVT_RIGHT_UP, wxMouseEventHandler(WizardPage3::OnRightUpTest), NULL, this);
////@end WizardPage3 content construction
}
/*!
* Should we show tooltips?
*/
bool WizardPage3::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WizardPage3::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WizardPage3 bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WizardPage3 bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WizardPage3::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WizardPage3 icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WizardPage3 icon retrieval
}
void WizardPage3::UpdateRadioButtons()
{
// Set radio buttons according to the current configuration
m_rbDwellClick->SetValue(false);
#if defined(__WXGTK__)
m_rbGestureClick->SetValue(false);
m_rbNoneClick->SetValue(false);
#endif
switch (wxGetApp().GetController().GetPointerAction().GetClickMode()) {
case CPointerAction::DWELL:
m_rbDwellClick->SetValue(true);
// Force open click window
wxGetApp().GetController().GetPointerAction().GetDwellClick().SetUseClickWindow(true);
break;
#if defined(__WXGTK__)
case CPointerAction::GESTURE:
m_rbGestureClick->SetValue(true);
break;
#endif
case CPointerAction::NONE:
m_rbNoneClick->SetValue(true);
break;
default:
assert (false);
}
}
/*!
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON_NONE_CLICK
*/
void WizardPage3::OnRadiobuttonNoneClickSelected( wxCommandEvent& event )
{
wxGetApp().GetController().GetPointerAction().SetClickMode(CPointerAction::NONE, false);
UpdateRadioButtons();
event.Skip(false);
}
/*!
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_WIZARDPAGE3
*/
void WizardPage3::OnWizardpage3Changed( wxWizardEvent& event )
{
UpdateRadioButtons();
event.Skip(false);
}
/*!
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON_DWELL_CLICK
*/
void WizardPage3::OnRadiobuttonDwellClickSelected( wxCommandEvent& event )
{
wxGetApp().GetController().GetPointerAction().SetClickMode(CPointerAction::DWELL, false);
UpdateRadioButtons();
event.Skip(false);
}
/*!
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON_GESTURE_CLICK
*/
#if defined(__WXGTK__)
void WizardPage3::OnRadiobuttonGestureClickSelected( wxCommandEvent& event )
{
wxGetApp().GetController().GetPointerAction().SetClickMode(CPointerAction::GESTURE, false);
UpdateRadioButtons();
event.Skip(false);
}
#endif
/*!
* wxEVT_LEFT_DOWN event handler for ID_TOGGLEBUTTON1
*/
void WizardPage3::OnLeftDownTest( wxMouseEvent& event )
{
m_toggleTest->SetLabel(_("Drag"));
m_lastLeftDown= wxGetLocalTimeMillis();
m_isLeftDown= true;
event.Skip(false);
}
/*!
* wxEVT_LEFT_UP event handler for ID_TOGGLEBUTTON1
*/
void WizardPage3::OnLeftUpTest( wxMouseEvent& event )
{
if (m_isDoubleClick) m_isDoubleClick= false;
else {
if (wxGetLocalTimeMillis() - m_lastLeftDown > 200)
m_toggleTest->SetLabel(_("Drop"));
else
m_toggleTest->SetLabel(_("Left click"));
}
m_isLeftDown= false;
event.Skip(false);
}
/*!
* wxEVT_RIGHT_UP event handler for ID_TOGGLEBUTTON1
*/
void WizardPage3::OnRightUpTest( wxMouseEvent& event )
{
m_toggleTest->SetLabel(_("Right click"));
event.Skip(false);
}
/*!
* wxEVT_LEFT_DCLICK event handler for ID_TOGGLEBUTTON1
*/
void WizardPage3::OnLeftDClickTest( wxMouseEvent& event )
{
m_toggleTest->SetLabel(_("Double click"));
m_isDoubleClick= true;
event.Skip(false);
}
/*!
* wxEVT_MIDDLE_UP event handler for ID_TOGGLE_TEST
*/
void WizardPage3::OnMiddleUpTest( wxMouseEvent& event )
{
m_toggleTest->SetLabel(_("Middle click"));
event.Skip(false);
}
/*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_TOGGLE_HEAD_TRACKING_PAGE3
*/
void WizardPage3::OnToggleHeadTrackingPage3Click( wxCommandEvent& event )
{
m_wizardParent->OnToggleHeadTrackingClick (event, *m_toggleHeadTrackingPage3);
}
/*!
* wxEVT_UPDATE_UI event handler for ID_TOGGLE_HEAD_TRACKING_PAGE3
*/
void WizardPage3::OnToggleHeadTrackingPage3Update( wxUpdateUIEvent& event )
{
m_wizardParent->OnToggleHeadTrackingUpdate(event, *m_toggleHeadTrackingPage3);
}
/*!
* WizardPage4 type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WizardPage4, wxWizardPageSimple )
/*!
* WizardPage4 event table definition
*/
BEGIN_EVENT_TABLE( WizardPage4, wxWizardPageSimple )
////@begin WizardPage4 event table entries
EVT_WIZARD_PAGE_CHANGED( -1, WizardPage4::OnWizardpageFinalPageChanged )
EVT_CHECKBOX( ID_CHECKBOX1, WizardPage4::OnCheckboxRunWizardAtStartupClick )
#if defined(__WXGTK__)
EVT_CHECKBOX( ID_CHECKBOX3, WizardPage4::OnCheckboxStartupClick )
#endif
EVT_CHECKBOX( ID_CHECKBOX4, WizardPage4::OnCheckboxEnabledAtStartupClick )
////@end WizardPage4 event table entries
END_EVENT_TABLE()
/*!
* WizardPage4 constructors
*/
WizardPage4::WizardPage4()
{
Init();
}
WizardPage4::WizardPage4( wxWizard* parent )
{
Init();
m_wizardParent = (WWizard*) parent;
Create( parent );
}
/*!
* WizardPage4 creator
*/
bool WizardPage4::Create( wxWizard* parent )
{
////@begin WizardPage4 creation
wxBitmap wizardBitmap(wxNullBitmap);
wxWizardPageSimple::Create( parent, NULL, NULL, wizardBitmap );
CreateControls();
if (GetSizer())
GetSizer()->Fit(this);
////@end WizardPage4 creation
return true;
}
/*!
* WizardPage4 destructor
*/
WizardPage4::~WizardPage4()
{
////@begin WizardPage4 destruction
////@end WizardPage4 destruction
}
/*!
* Member initialisation
*/
void WizardPage4::Init()
{
////@begin WizardPage4 member initialisation
m_chkRunWizardAtStartup = NULL;
#if defined(__WXGTK__)
m_chkStartup = NULL;
#endif
m_chkEnabledAtStartup = NULL;
////@end WizardPage4 member initialisation
}
/*!
* Control creation for WizardPage4
*/
void WizardPage4::CreateControls()
{
////@begin WizardPage4 content construction
WizardPage4* itemWizardPageSimple75 = this;
wxFlexGridSizer* itemFlexGridSizer76 = new wxFlexGridSizer(0, 1, 0, 0);
itemWizardPageSimple75->SetSizer(itemFlexGridSizer76);
wxStaticText* itemStaticText77 = new wxStaticText( itemWizardPageSimple75, wxID_STATIC, _("Wizard completed"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText77->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Sans")));
itemFlexGridSizer76->Add(itemStaticText77, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxStaticLine* itemStaticLine78 = new wxStaticLine( itemWizardPageSimple75, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
itemFlexGridSizer76->Add(itemStaticLine78, 0, wxGROW|wxALL, 5);
wxFlexGridSizer* itemFlexGridSizer79 = new wxFlexGridSizer(0, 1, 0, 0);
itemFlexGridSizer76->Add(itemFlexGridSizer79, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_chkRunWizardAtStartup = new wxCheckBox( itemWizardPageSimple75, ID_CHECKBOX1, _("Run this wizard at startup"), wxDefaultPosition, wxDefaultSize, 0 );
m_chkRunWizardAtStartup->SetValue(false);
if (WizardPage4::ShowToolTips())
m_chkRunWizardAtStartup->SetToolTip(_("If checked the wizard automatically appears at startup."));
itemFlexGridSizer79->Add(m_chkRunWizardAtStartup, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
#if defined(__WXGTK__)
m_chkStartup = new wxCheckBox( itemWizardPageSimple75, ID_CHECKBOX3, _("Start eViacam at user logon"), wxDefaultPosition, wxDefaultSize, 0 );
m_chkStartup->SetValue(false);
itemFlexGridSizer79->Add(m_chkStartup, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
#endif
m_chkEnabledAtStartup = new wxCheckBox( itemWizardPageSimple75, ID_CHECKBOX4, _("Enable eViacam at startup"), wxDefaultPosition, wxDefaultSize, 0 );
m_chkEnabledAtStartup->SetValue(false);
if (WizardPage4::ShowToolTips())
m_chkEnabledAtStartup->SetToolTip(_("If checked the program automatically \nenables cursor control at startup."));
itemFlexGridSizer79->Add(m_chkEnabledAtStartup, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemFlexGridSizer79->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxStaticText* itemStaticText84 = new wxStaticText( itemWizardPageSimple75, wxID_STATIC, _("You may change the settings through Configuration -> Options"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText84->Wrap(450);
itemFlexGridSizer79->Add(itemStaticText84, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
itemFlexGridSizer76->AddGrowableCol(0);
////@end WizardPage4 content construction
m_chkEnabledAtStartup->SetValue(wxGetApp().GetController().GetEnabledAtStartup());
#if defined(__WXGTK__)
m_chkStartup->SetValue(wxGetApp().GetController().GetAutostart().IsEnabled());
#endif
}
/*!
* Should we show tooltips?
*/
bool WizardPage4::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WizardPage4::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WizardPage4 bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WizardPage4 bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WizardPage4::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WizardPage4 icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WizardPage4 icon retrieval
}
/*!
* wxEVT_WIZARD_FINISHED event handler for ID_WWIZARD
*/
void WWizard::OnWwizardFinished( wxWizardEvent& event )
{
wxGetApp().GetController().GetConfigManager().WriteAll();
event.Skip(false);
}
/*!
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_WIZARDPAGE1
*/
void WizardPage1::OnWizardpage1Changed( wxWizardEvent& event )
{
m_wizardParent->SetPerformCalibration(false);
m_chkPerformCalibration->SetValue(false);
event.Skip(false);
}
/*!
* WizardPage5 type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WizardPage5, wxWizardPageSimple )
/*!
* WizardPage5 event table definition
*/
BEGIN_EVENT_TABLE( WizardPage5, wxWizardPageSimple )
////@begin WizardPage5 event table entries
EVT_WIZARD_PAGE_CHANGED( -1, WizardPage5::OnWizardpageCameraPageChanged )
EVT_BUTTON( ID_BUTTON5, WizardPage5::OnButtonCameraSettingsClick )
////@end WizardPage5 event table entries
END_EVENT_TABLE()
/*!
* WizardPage5 constructors
*/
WizardPage5::WizardPage5()
{
Init();
}
WizardPage5::WizardPage5( wxWizard* parent )
{
Init();
m_wizardParent = (WWizard*) parent;
Create( parent );
}
/*!
* WizardPage5 creator
*/
bool WizardPage5::Create( wxWizard* parent )
{
////@begin WizardPage5 creation
wxBitmap wizardBitmap(wxNullBitmap);
wxWizardPageSimple::Create( parent, NULL, NULL, wizardBitmap );
CreateControls();
if (GetSizer())
GetSizer()->Fit(this);
////@end WizardPage5 creation
return true;
}
/*!
* WizardPage5 destructor
*/
WizardPage5::~WizardPage5()
{
////@begin WizardPage5 destruction
////@end WizardPage5 destruction
}
/*!
* Member initialisation
*/
void WizardPage5::Init()
{
////@begin WizardPage5 member initialisation
m_staticCameraName = NULL;
m_staticFramerate = NULL;
m_staticCameraInstructions = NULL;
m_btnCameraSettings = NULL;
////@end WizardPage5 member initialisation
}
/*!
* Control creation for WizardPage5
*/
void WizardPage5::CreateControls()
{
////@begin WizardPage5 content construction
WizardPage5* itemWizardPageSimple9 = this;
wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL);
itemWizardPageSimple9->SetSizer(itemBoxSizer10);
wxStaticText* itemStaticText11 = new wxStaticText( itemWizardPageSimple9, wxID_STATIC, _("Camera setup"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText11->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Sans")));
itemBoxSizer10->Add(itemStaticText11, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticLine* itemStaticLine12 = new wxStaticLine( itemWizardPageSimple9, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
itemBoxSizer10->Add(itemStaticLine12, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer10->Add(itemBoxSizer13, 0, wxGROW|wxALL, 5);
wxFlexGridSizer* itemFlexGridSizer14 = new wxFlexGridSizer(0, 2, 0, 0);
itemBoxSizer13->Add(itemFlexGridSizer14, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticText* itemStaticText15 = new wxStaticText( itemWizardPageSimple9, wxID_STATIC, _("Detected camera:"), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_staticCameraName = new wxStaticText( itemWizardPageSimple9, wxID_STATIC, _("camera_name"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticCameraName->SetFont(wxFont(wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL, false, wxT("")));
itemFlexGridSizer14->Add(m_staticCameraName, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxStaticText* itemStaticText17 = new wxStaticText( itemWizardPageSimple9, wxID_STATIC, _("Framerate:"), wxDefaultPosition, wxDefaultSize, 0 );
itemFlexGridSizer14->Add(itemStaticText17, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_staticFramerate = new wxStaticText( itemWizardPageSimple9, wxID_STATIC, _("framerate"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticFramerate->SetFont(wxFont(wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL, false, wxT("")));
itemFlexGridSizer14->Add(m_staticFramerate, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemBoxSizer13->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_staticCameraInstructions = new wxStaticText( itemWizardPageSimple9, wxID_STATIC, _("For best performance possible, the frame rate should be equal to or greater than 25 fps. eViacam tries to automatically configure your camera, but If this value is below this threshold you may need to manually adjust the camera settings."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticCameraInstructions->Wrap(450);
itemBoxSizer13->Add(m_staticCameraInstructions, 0, wxGROW|wxALL, 5);
itemBoxSizer13->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_btnCameraSettings = new wxButton( itemWizardPageSimple9, ID_BUTTON5, _("Camera settings..."), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer13->Add(m_btnCameraSettings, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
////@end WizardPage5 content construction
m_staticCameraName->SetLabel(wxGetApp().GetController().GetCameraName());
m_staticFramerate->SetLabel(wxString::Format(wxT("%.1f"), wxGetApp().GetController().GetCamera().GetRealFrameRate()));
}
/*!
* Should we show tooltips?
*/
bool WizardPage5::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WizardPage5::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WizardPage5 bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WizardPage5 bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WizardPage5::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WizardPage5 icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WizardPage5 icon retrieval
}
/*!
* WizardPage6 type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WizardPage6, wxWizardPageSimple )
/*!
* WizardPage6 event table definition
*/
BEGIN_EVENT_TABLE( WizardPage6, wxWizardPageSimple )
////@begin WizardPage6 event table entries
EVT_WIZARD_PAGE_CHANGED( -1, WizardPage6::OnWizardpageCalib3PageChanged )
EVT_SPINCTRL( ID_SPINCTRL, WizardPage6::OnSpinctrlXSpeedUpdated )
EVT_SPINCTRL( ID_SPINCTRL1, WizardPage6::OnSpinctrlYSpeedUpdated )
EVT_TOGGLEBUTTON( ID_TOGGLE_HEAD_TRACKING_PAGE6, WizardPage6::OnToggleHeadTrackingPage6Click )
EVT_UPDATE_UI( ID_TOGGLE_HEAD_TRACKING_PAGE6, WizardPage6::OnToggleHeadTrackingPage6Update )
////@end WizardPage6 event table entries
END_EVENT_TABLE()
/*!
* WizardPage6 constructors
*/
WizardPage6::WizardPage6()
{
Init();
}
WizardPage6::WizardPage6( wxWizard* parent )
{
Init();
m_wizardParent = (WWizard*) parent;
Create( parent );
}
/*!
* WizardPage6 creator
*/
bool WizardPage6::Create( wxWizard* parent )
{
////@begin WizardPage6 creation
wxBitmap wizardBitmap(wxNullBitmap);
wxWizardPageSimple::Create( parent, NULL, NULL, wizardBitmap );
CreateControls();
if (GetSizer())
GetSizer()->Fit(this);
////@end WizardPage6 creation
return true;
}
/*!
* WizardPage6 destructor
*/
WizardPage6::~WizardPage6()
{
////@begin WizardPage6 destruction
////@end WizardPage6 destruction
}
/*!
* Member initialisation
*/
void WizardPage6::Init()
{
////@begin WizardPage6 member initialisation
m_spinXSpeed = NULL;
m_spinYSpeed = NULL;
m_toggleHeadTrackingPage6 = NULL;
////@end WizardPage6 member initialisation
}
/*!
* Control creation for WizardPage6
*/
void WizardPage6::CreateControls()
{
////@begin WizardPage6 content construction
WizardPage6* itemWizardPageSimple46 = this;
wxBoxSizer* itemBoxSizer47 = new wxBoxSizer(wxVERTICAL);
itemWizardPageSimple46->SetSizer(itemBoxSizer47);
wxStaticText* itemStaticText48 = new wxStaticText( itemWizardPageSimple46, wxID_STATIC, _("Pointer calibration"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText48->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Sans")));
itemBoxSizer47->Add(itemStaticText48, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticLine* itemStaticLine49 = new wxStaticLine( itemWizardPageSimple46, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
itemBoxSizer47->Add(itemStaticLine49, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer50 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer47->Add(itemBoxSizer50, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText51 = new wxStaticText( itemWizardPageSimple46, wxID_STATIC, _("You can adjust motion speed manually and enable head tracking to test how it works."), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText51->Wrap(450);
itemBoxSizer50->Add(itemStaticText51, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer52 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer50->Add(itemBoxSizer52, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticText* itemStaticText53 = new wxStaticText( itemWizardPageSimple46, wxID_STATIC, _("X axis speed"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer52->Add(itemStaticText53, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_spinXSpeed = new wxSpinCtrl( itemWizardPageSimple46, ID_SPINCTRL, wxT("0"), wxDefaultPosition, wxSize(75, -1), wxSP_ARROW_KEYS, 0, 30, 0 );
itemBoxSizer52->Add(m_spinXSpeed, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer55 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer50->Add(itemBoxSizer55, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxStaticText* itemStaticText56 = new wxStaticText( itemWizardPageSimple46, wxID_STATIC, _("Y axis speed"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer55->Add(itemStaticText56, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_spinYSpeed = new wxSpinCtrl( itemWizardPageSimple46, ID_SPINCTRL1, wxT("0"), wxDefaultPosition, wxSize(75, -1), wxSP_ARROW_KEYS, 0, 30, 0 );
itemBoxSizer55->Add(m_spinYSpeed, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
itemBoxSizer50->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
itemBoxSizer50->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_toggleHeadTrackingPage6 = new wxToggleButton( itemWizardPageSimple46, ID_TOGGLE_HEAD_TRACKING_PAGE6, _("Enable pointer control"), wxDefaultPosition, wxDefaultSize, 0 );
m_toggleHeadTrackingPage6->SetValue(false);
itemBoxSizer50->Add(m_toggleHeadTrackingPage6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
////@end WizardPage6 content construction
}
/*!
* Should we show tooltips?
*/
bool WizardPage6::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WizardPage6::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WizardPage6 bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WizardPage6 bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WizardPage6::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WizardPage6 icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WizardPage6 icon retrieval
}
/*!
* wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL
*/
void WizardPage6::OnSpinctrlXSpeedUpdated( wxSpinEvent& event )
{
wxGetApp().GetController().GetPointerAction().SetXSpeed(event.GetInt());
event.Skip(false);
}
/*!
* wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_SPINCTRL1
*/
void WizardPage6::OnSpinctrlYSpeedUpdated( wxSpinEvent& event )
{
wxGetApp().GetController().GetPointerAction().SetYSpeed(event.GetInt());
event.Skip(false);
}
/*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_TOGGLE_HEAD_TRACKING_PAGE6
*/
void WizardPage6::OnToggleHeadTrackingPage6Click( wxCommandEvent& event )
{
m_wizardParent->OnToggleHeadTrackingClick (event, *m_toggleHeadTrackingPage6);
}
/*!
* wxEVT_UPDATE_UI event handler for ID_TOGGLE_HEAD_TRACKING_PAGE6
*/
void WizardPage6::OnToggleHeadTrackingPage6Update( wxUpdateUIEvent& event )
{
m_wizardParent->OnToggleHeadTrackingUpdate(event, *m_toggleHeadTrackingPage6);
}
/*!
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_WIZARDPAGE6
*/
void WizardPage6::OnWizardpageCalib3PageChanged( wxWizardEvent& event )
{
m_spinXSpeed->SetValue(wxGetApp().GetController().GetPointerAction().GetXSpeed());
m_spinYSpeed->SetValue(wxGetApp().GetController().GetPointerAction().GetYSpeed());
event.Skip(false);
}
/*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX1
*/
void WizardPage4::OnCheckboxRunWizardAtStartupClick( wxCommandEvent& event )
{
wxGetApp().GetController().SetRunWizardAtStartup(event.IsChecked());
event.Skip(false);
}
/*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX3
*/
#if defined(__WXGTK__)
void WizardPage4::OnCheckboxStartupClick( wxCommandEvent& event )
{
#if defined(__WXGTK__)
wxGetApp().GetController().GetAutostart().Enable(event.IsChecked());
#endif
event.Skip(false);
}
#endif
/*!
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_WIZARDPAGE4
*/
void WizardPage4::OnWizardpageFinalPageChanged( wxWizardEvent& event )
{
m_chkEnabledAtStartup->SetValue(false);
wxGetApp().GetController().SetRunWizardAtStartup (false);
event.Skip(false);
}
/*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX4
*/
void WizardPage4::OnCheckboxEnabledAtStartupClick( wxCommandEvent& event )
{
wxGetApp().GetController().SetEnabledAtStartup (m_chkEnabledAtStartup->GetValue());
event.Skip(false);
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON5
*/
void WizardPage5::OnButtonCameraSettingsClick( wxCommandEvent& event )
{
wxGetApp().GetController().ShowCameraSettingsDialog();
event.Skip(false);
}
/*!
* wxEVT_WIZARD_PAGE_CHANGED event handler for ID_WIZARDPAGE_CAMERA
*/
void WizardPage5::OnWizardpageCameraPageChanged( wxWizardEvent& event )
{
float fr= wxGetApp().GetController().GetCamera().GetRealFrameRate();
m_staticFramerate->SetLabel(wxString::Format(wxT("%.1f"), fr));
if (fr>= 25.0f) {
m_staticCameraInstructions->SetLabel(_("The frame rate is appropriate."));
m_btnCameraSettings->Hide();
}
event.Skip(false);
}
/*!
* WizardPage8 type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WizardPage8, wxWizardPageSimple )
/*!
* WizardPage8 event table definition
*/
BEGIN_EVENT_TABLE( WizardPage8, wxWizardPageSimple )
////@begin WizardPage8 event table entries
EVT_CHECKBOX( ID_CHECKBOX_LOCATE_FACE, WizardPage8::OnCheckboxLocateFaceClick )
EVT_CHECKBOX( ID_CHECKBOX_ENABLE_WHEN_FACE_DETECTED, WizardPage8::OnCheckboxEnableWhenFaceDetectedClick )
////@end WizardPage8 event table entries
END_EVENT_TABLE()
/*!
* WizardPage8 constructors
*/
WizardPage8::WizardPage8()
{
Init();
}
WizardPage8::WizardPage8( wxWizard* parent )
{
Init();
Create( parent );
}
/*!
* WizardPage8 creator
*/
bool WizardPage8::Create( wxWizard* parent )
{
////@begin WizardPage8 creation
wxBitmap wizardBitmap(wxNullBitmap);
wxWizardPageSimple::Create( parent, NULL, NULL, wizardBitmap );
CreateControls();
if (GetSizer())
GetSizer()->Fit(this);
////@end WizardPage8 creation
return true;
}
/*!
* WizardPage8 destructor
*/
WizardPage8::~WizardPage8()
{
////@begin WizardPage8 destruction
////@end WizardPage8 destruction
}
/*!
* Member initialisation
*/
void WizardPage8::Init()
{
////@begin WizardPage8 member initialisation
m_chkLocateFace = NULL;
m_chkEnableWhenFaceDetected = NULL;
////@end WizardPage8 member initialisation
}
/*!
* Control creation for WizardPage8
*/
void WizardPage8::CreateControls()
{
////@begin WizardPage8 content construction
WizardPage8* itemWizardPageSimple23 = this;
wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxVERTICAL);
itemWizardPageSimple23->SetSizer(itemBoxSizer24);
wxStaticText* itemStaticText25 = new wxStaticText( itemWizardPageSimple23, wxID_STATIC, _("Face detection setup"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText25->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Sans")));
itemBoxSizer24->Add(itemStaticText25, 0, wxALIGN_LEFT|wxALL, 5);
wxStaticLine* itemStaticLine26 = new wxStaticLine( itemWizardPageSimple23, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
itemBoxSizer24->Add(itemStaticLine26, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer24->Add(itemBoxSizer27, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText28 = new wxStaticText( itemWizardPageSimple23, wxID_STATIC, _("eViacam will try to detect your face automatically. But, if necessary, you can disable this feature and manually adjust the tracking area (blue rectangle) around your face.\n"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText28->Wrap(450);
itemBoxSizer27->Add(itemStaticText28, 0, wxGROW|wxALL, 5);
itemBoxSizer27->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_chkLocateFace = new wxCheckBox( itemWizardPageSimple23, ID_CHECKBOX_LOCATE_FACE, _("Locate face automatically (recommended)"), wxDefaultPosition, wxDefaultSize, 0 );
m_chkLocateFace->SetValue(false);
itemBoxSizer27->Add(m_chkLocateFace, 0, wxALIGN_LEFT|wxALL, 5);
itemBoxSizer27->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
m_chkEnableWhenFaceDetected = new wxCheckBox( itemWizardPageSimple23, ID_CHECKBOX_ENABLE_WHEN_FACE_DETECTED, _("Disable eViacam if no face is found"), wxDefaultPosition, wxDefaultSize, 0 );
m_chkEnableWhenFaceDetected->SetValue(false);
itemBoxSizer27->Add(m_chkEnableWhenFaceDetected, 0, wxALIGN_LEFT|wxALL, 5);
////@end WizardPage8 content construction
m_chkLocateFace->SetValue(wxGetApp().GetController().GetVisionPipeline().GetTrackFace());
m_chkEnableWhenFaceDetected->Enable (m_chkLocateFace->GetValue());
m_chkEnableWhenFaceDetected->SetValue(wxGetApp().GetController().GetVisionPipeline().GetEnableWhenFaceDetected());
}
/*!
* Should we show tooltips?
*/
bool WizardPage8::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WizardPage8::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
////@begin WizardPage8 bitmap retrieval
wxUnusedVar(name);
return wxNullBitmap;
////@end WizardPage8 bitmap retrieval
}
/*!
* Get icon resources
*/
wxIcon WizardPage8::GetIconResource( const wxString& name )
{
// Icon retrieval
////@begin WizardPage8 icon retrieval
wxUnusedVar(name);
return wxNullIcon;
////@end WizardPage8 icon retrieval
}
/*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_LOCATE_FACE
*/
void WizardPage8::OnCheckboxLocateFaceClick( wxCommandEvent& event )
{
wxGetApp().GetController().GetVisionPipeline().SetTrackFace (m_chkLocateFace->GetValue());
wxGetApp().GetController().GetVisionPipeline().SetDegradation(0);
m_chkEnableWhenFaceDetected->Enable (m_chkLocateFace->GetValue());
event.Skip();
}
/*!
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_ENABLE_WHEN_FACE_DETECTED
*/
void WizardPage8::OnCheckboxEnableWhenFaceDetectedClick( wxCommandEvent& event )
{
wxGetApp().GetController().GetVisionPipeline().SetEnableWhenFaceDetected (m_chkEnableWhenFaceDetected->GetValue());
event.Skip();
}
/*!
* wxEVT_WIZARD_CANCEL event handler for ID_WWIZARD
*/
void WWizard::OnWwizardCancel( wxWizardEvent& event )
{
wxGetApp().GetController().SetRunWizardAtStartup(false);
wxGetApp().GetController().GetConfigManager().WriteAll();
event.Skip();
}
|