| 123456789101112131415161718192021222324252627282930313233 |
- #pragma once
- #ifndef VIEW_H
- #define VIEW_H
- #include <iostream>
- #include <string>
- class View {
- public:
- void displayButton(const std::string& label) {
- std::cout << "[Button: " << label << "] (Click to interact)\n";
- }
- void displaySlider(int value) {
- std::cout << "[Slider: " << value << "] (Move to adjust)\n";
- }
- void displayProgressBar(int value) {
- std::cout << "[ProgressBar: " << value << "%]\n";
- }
- void onButtonClick(const std::function<void()>& action) {
- std::cout << "Button clicked!\n";
- action();
- }
- void onSliderMove(const std::function<void(int)>& action, int newValue) {
- std::cout << "Slider moved to: " << newValue << "\n";
- action(newValue);
- }
- };
- #endif // VIEW_H
|