} // namespace
+// static variable initialize
+std::set<Popup*> Popup::opened_popups_;
+
Popup* Popup::CreatePopup(NativeWindow* window) {
Evas_Object* popup = elm_popup_add(window->evas_object());
elm_object_style_set(popup, kStyleDefault);
return new Popup(popup, grid, box);
}
+void Popup::ForceCloseAllPopup() {
+ auto backup = opened_popups_;
+ for (auto& popup : backup) {
+ // will cause modification of opened_popups_
+ popup->Hide();
+ }
+}
+
+
void Popup::SetButtonType(ButtonType type) {
enable_button_ = true;
switch (type) {
void Popup::Show() {
evas_object_show(popup_);
+ opened_popups_.insert(this);
}
void Popup::Hide() {
delete obj;
return EINA_FALSE;
}, this);
+ auto found = opened_popups_.find(this);
+ if (found != opened_popups_.end()) {
+ opened_popups_.erase(found);
+ }
}
void Popup::Result(bool is_positive) {
#include <string>
#include <vector>
#include <functional>
+#include <set>
namespace wrt {
};
static Popup* CreatePopup(NativeWindow* window);
+ static void ForceCloseAllPopup();
// button
void SetButtonType(ButtonType type);
std::string result_entry2_;
bool enable_check_box_;
bool result_check_box_;
+ static std::set<Popup*> opened_popups_;
};
} // namespace wrt
void WebApplication::ClearViewStack() {
window_->SetContent(NULL);
+ Popup::ForceCloseAllPopup();
auto it = view_stack_.begin();
for ( ; it != view_stack_.end(); ++it) {
(*it)->Suspend();