#include "atom/browser/ui/message_box.h"
+#include "atom/browser/native_window_efl.h"
#include "base/logging.h"
+#include <Elementary.h>
+
namespace atom {
+static void _response_cb(void* data, Evas_Object* obj, void* event_info) {
+ evas_object_del(static_cast<Evas_Object*>(data));
+}
+
int ShowMessageBox(NativeWindow* parent_window,
MessageBoxType type,
const std::vector<std::string>& buttons,
const std::string& message,
const std::string& detail,
const gfx::ImageSkia& icon) {
- NOTIMPLEMENTED();
+ Evas_Object* win = static_cast<NativeWindowEfl*>(parent_window)->evas_object();
+ Evas_Object* popup = elm_popup_add(win);
+
+ elm_object_text_set(popup, message.c_str());
+ elm_popup_content_text_wrap_type_set(popup, ELM_WRAP_CHAR);
+ elm_object_part_text_set(popup, "title,text", title.c_str());
+
+ Evas_Object* btn1 = elm_button_add(popup);
+ elm_object_text_set(btn1, "OK");
+ elm_object_part_content_set(popup, "button1", btn1);
+ evas_object_smart_callback_add(btn1, "clicked", _response_cb, popup);
+
+ evas_object_show(popup);
+
return 0;
}
bool checkbox_checked,
const gfx::ImageSkia& icon,
const MessageBoxCallback& callback) {
+ LOG(INFO) << "ShowMessageBox : " << title << ", " << message;
NOTIMPLEMENTED();
}
void ShowErrorBox(const base::string16& title, const base::string16& content) {
+ LOG(INFO) << "ShowErrorBox : " << title << ", " << content;
NOTIMPLEMENTED();
}