Update the access of the widget File chooser
This commit is contained in:
parent
f01fe14d8a
commit
63bcc65e0e
23
jni/Main.cpp
23
jni/Main.cpp
@ -37,6 +37,7 @@
|
|||||||
#include <ewol/widget/PopUp.h>
|
#include <ewol/widget/PopUp.h>
|
||||||
#include <ewol/widget/Spacer.h>
|
#include <ewol/widget/Spacer.h>
|
||||||
#include <ewol/widgetMeta/FileChooser.h>
|
#include <ewol/widgetMeta/FileChooser.h>
|
||||||
|
#include <ewol/WidgetManager.h>
|
||||||
|
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
|
|
||||||
@ -119,8 +120,9 @@ class MaListExemple : public ewol::List
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const char * const drawerEventRequestOpenFile = "Drawer Request Open File";
|
const char * const drawerEventRequestOpenFile = "Drawer Request Open File";
|
||||||
const char * const drawerEventRequestOpenFileClosed = "Drawer Close Open File";
|
const char * const drawerEventRequestOpenFileClosed = "Drawer Close Open File";
|
||||||
|
const char * const drawerEventRequestOpenFileSelected = "Drawer Open Selected File";
|
||||||
|
|
||||||
|
|
||||||
class Plop :public ewol::Windows
|
class Plop :public ewol::Windows
|
||||||
@ -206,13 +208,28 @@ class Plop :public ewol::Windows
|
|||||||
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
||||||
tmpWidget->SetTitle("Open Files ...");
|
tmpWidget->SetTitle("Open Files ...");
|
||||||
tmpWidget->SetValidateLabel("Open");
|
tmpWidget->SetValidateLabel("Open");
|
||||||
tmpWidget->SetFolder("/home/");
|
tmpWidget->SetFolder("/");
|
||||||
PopUpWidgetPush(tmpWidget);
|
PopUpWidgetPush(tmpWidget);
|
||||||
if (false == tmpWidget->ExternLinkOnEvent("ewol event file chooser cancel", GetWidgetId(), drawerEventRequestOpenFileClosed) ) {
|
if (false == tmpWidget->ExternLinkOnEvent("ewol event file chooser cancel", GetWidgetId(), drawerEventRequestOpenFileClosed) ) {
|
||||||
DRAW_CRITICAL("link with an entry event");
|
DRAW_CRITICAL("link with an entry event");
|
||||||
}
|
}
|
||||||
|
if (false == tmpWidget->ExternLinkOnEvent("ewol event file chooser validate", GetWidgetId(), drawerEventRequestOpenFileSelected) ) {
|
||||||
|
DRAW_CRITICAL("link with an entry event");
|
||||||
|
}
|
||||||
} else if (eventExternId == drawerEventRequestOpenFileClosed) {
|
} else if (eventExternId == drawerEventRequestOpenFileClosed) {
|
||||||
PopUpWidgetPop();
|
PopUpWidgetPop();
|
||||||
|
} else if (eventExternId == drawerEventRequestOpenFileSelected) {
|
||||||
|
// get widget:
|
||||||
|
ewol::FileChooser * tmpWidget = (ewol::FileChooser*)ewol::widgetManager::Get(widgetID);
|
||||||
|
if (NULL == tmpWidget) {
|
||||||
|
DRAW_ERROR("impossible to get pop_upWidget " << widgetID);
|
||||||
|
PopUpWidgetPop();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// get the filename :
|
||||||
|
etk::String tmpData = tmpWidget->GetCompleateFileName();
|
||||||
|
DRAW_DEBUG("Request opening the file : " << tmpData);
|
||||||
|
PopUpWidgetPop();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
@ -8,4 +8,4 @@
|
|||||||
# project structure.
|
# project structure.
|
||||||
|
|
||||||
# Project target.
|
# Project target.
|
||||||
target=android-10
|
target=Google Inc.:Google APIs:13
|
||||||
|
Loading…
x
Reference in New Issue
Block a user