Navigation.C 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*
  2. * Copyright (C) 2008 Emweb bvba
  3. *
  4. * See the LICENSE file for terms of use.
  5. */
  6. #include "DeferredWidget.h"
  7. #include "Navigation.h"
  8. #include "TopicTemplate.h"
  9. #include <Wt/WText>
  10. Navigation::Navigation()
  11. : TopicWidget()
  12. {
  13. addText(tr("navigation-intro"), this);
  14. }
  15. void Navigation::populateSubMenu(Wt::WMenu *menu)
  16. {
  17. menu->addItem("Internal paths", internalPaths())->setPathComponent("");
  18. menu->addItem("Anchor",
  19. deferCreate(boost::bind
  20. (&Navigation::anchor, this)));
  21. menu->addItem("Stacked widget",
  22. deferCreate(boost::bind
  23. (&Navigation::stackedWidget, this)));
  24. menu->addItem("Menu",
  25. deferCreate(boost::bind
  26. (&Navigation::menuWidget, this)));
  27. menu->addItem("Tab widget",
  28. deferCreate(boost::bind
  29. (&Navigation::tabWidget, this)));
  30. menu->addItem("Navigation bar",
  31. deferCreate(boost::bind
  32. (&Navigation::navigationBar, this)));
  33. menu->addItem("Popup menu",
  34. deferCreate(boost::bind
  35. (&Navigation::popupMenu, this)));
  36. menu->addItem("Split button",
  37. deferCreate(boost::bind
  38. (&Navigation::splitButton, this)));
  39. menu->addItem("Toolbar",
  40. deferCreate(boost::bind
  41. (&Navigation::toolBar, this)));
  42. }
  43. #include "examples/Path.cpp"
  44. #include "examples/PathChange.cpp"
  45. Wt::WWidget *Navigation::internalPaths()
  46. {
  47. Wt::WTemplate *result = new TopicTemplate("navigation-internalPaths");
  48. result->bindWidget("Path", Path());
  49. result->bindWidget("PathChange", PathChange());
  50. return result;
  51. }
  52. #include "examples/Anchor.cpp"
  53. #include "examples/AnchorImage.cpp"
  54. Wt::WWidget *Navigation::anchor()
  55. {
  56. Wt::WTemplate *result = new TopicTemplate("navigation-anchor");
  57. result->bindWidget("Anchor", Anchor());
  58. result->bindWidget("AnchorImage", AnchorImage());
  59. return result;
  60. }
  61. #include "examples/Stack.cpp"
  62. Wt::WWidget *Navigation::stackedWidget()
  63. {
  64. Wt::WTemplate *result = new TopicTemplate("navigation-stackedWidget");
  65. result->bindWidget("Stack", Stack());
  66. return result;
  67. }
  68. #include "examples/Menu.cpp"
  69. Wt::WWidget *Navigation::menuWidget()
  70. {
  71. Wt::WTemplate *result = new TopicTemplate("navigation-menu");
  72. result->bindWidget("Menu", Menu());
  73. return result;
  74. }
  75. #include "examples/Tab.cpp"
  76. Wt::WWidget *Navigation::tabWidget()
  77. {
  78. Wt::WTemplate *result = new TopicTemplate("navigation-tabWidget");
  79. result->bindWidget("Tab", Tab());
  80. return result;
  81. }
  82. #include "examples/NavigationBar.cpp"
  83. Wt::WWidget *Navigation::navigationBar()
  84. {
  85. Wt::WTemplate *result = new TopicTemplate("navigation-navigationBar");
  86. result->bindWidget("NavigationBar", NavigationBar());
  87. return result;
  88. }
  89. #include "examples/Popup.cpp"
  90. Wt::WWidget *Navigation::popupMenu()
  91. {
  92. Wt::WTemplate *result = new TopicTemplate("navigation-popupMenu");
  93. result->bindWidget("Popup", Popup());
  94. return result;
  95. }
  96. #include "examples/SplitButton.cpp"
  97. Wt::WWidget *Navigation::splitButton()
  98. {
  99. Wt::WTemplate *result = new TopicTemplate("navigation-splitButton");
  100. result->bindWidget("SplitButton", SplitButton());
  101. return result;
  102. }
  103. #include "examples/ToolBar.cpp"
  104. Wt::WWidget *Navigation::toolBar()
  105. {
  106. Wt::WTemplate *result = new TopicTemplate("navigation-toolBar");
  107. result->bindWidget("ToolBar", ToolBar());
  108. return result;
  109. }