1 // Aseprite UI Library 2 // Copyright (C) 2001-2018 David Capello 3 // 4 // This file is released under the terms of the MIT license. 5 // Read LICENSE.txt for more information. 6 7 #ifndef UI_ALERT_H_INCLUDED 8 #define UI_ALERT_H_INCLUDED 9 #pragma once 10 11 #include "base/shared_ptr.h" 12 #include "ui/window.h" 13 14 #include <string> 15 #include <vector> 16 17 namespace ui { 18 19 class Box; 20 class CheckBox; 21 class Slider; 22 23 class Alert; 24 typedef base::SharedPtr<Alert> AlertPtr; 25 26 class Alert : public Window { 27 public: 28 Alert(); 29 30 void addProgress(); 31 void setProgress(double progress); 32 33 CheckBox* addCheckBox(const std::string& text); 34 35 int show(); 36 37 static AlertPtr create(const std::string& msg); 38 static int show(const std::string& msg); 39 40 private: 41 void processString(std::string& buf); 42 43 Slider* m_progress; 44 Box* m_progressPlaceholder; 45 std::vector<Widget*> m_labels; 46 std::vector<Widget*> m_buttons; 47 }; 48 49 } // namespace ui 50 51 #endif 52