View.h 773 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #ifndef VIEW_H
  3. #define VIEW_H
  4. #include <iostream>
  5. #include <string>
  6. class View {
  7. public:
  8. void displayButton(const std::string& label) {
  9. std::cout << "[Button: " << label << "] (Click to interact)\n";
  10. }
  11. void displaySlider(int value) {
  12. std::cout << "[Slider: " << value << "] (Move to adjust)\n";
  13. }
  14. void displayProgressBar(int value) {
  15. std::cout << "[ProgressBar: " << value << "%]\n";
  16. }
  17. void onButtonClick(const std::function<void()>& action) {
  18. std::cout << "Button clicked!\n";
  19. action();
  20. }
  21. void onSliderMove(const std::function<void(int)>& action, int newValue) {
  22. std::cout << "Slider moved to: " << newValue << "\n";
  23. action(newValue);
  24. }
  25. };
  26. #endif // VIEW_H