#include <FileChooser.hpp>
Public Member Functions | |
DECLARE_WIDGET_FACTORY (FileChooser, "FileChooser") | |
void | onGetFocus () override |
Public Member Functions inherited from ewol::widget::Composer | |
DECLARE_WIDGET_FACTORY (Composer, "Composer") | |
virtual | ~Composer () |
bool | loadFromFile (const std::string &_fileName) |
bool | loadFromString (const std::string &_composerXmlString) |
Public Member Functions inherited from ewol::widget::Container | |
virtual | ~Container () |
ewol::WidgetShared | getSubWidget () |
void | setSubWidget (ewol::WidgetShared _newWidget) |
virtual void | subWidgetReplace (const ewol::WidgetShared &_oldWidget, const ewol::WidgetShared &_newWidget) |
void | subWidgetRemove () |
void | subWidgetUnLink () |
void | systemDraw (const ewol::DrawProperty &_displayProp) override |
void | onRegenerateDisplay () override |
void | onChangeSize () override |
void | calculateMinMaxSize () override |
ewol::WidgetShared | getWidgetAtPos (const vec2 &_pos) override |
ewol::ObjectShared | getSubObjectNamed (const std::string &_objectName) override |
bool | loadXML (const exml::Element &_node) override |
void | setOffset (const vec2 &_newVal) override |
void | requestDestroyFromChild (const ewol::ObjectShared &_child) override |
Public Member Functions inherited from ewol::Widget | |
virtual | ~Widget () |
virtual vec2 | relativePosition (const vec2 &_pos) |
virtual void | calculateSize () |
virtual vec2 | getSize () |
virtual void | setSize (const vec2 &_value) |
virtual vec2 | getCalculateMinSize () |
virtual vec2 | getCalculateMaxSize () |
virtual const vec2 & | getOffset () |
virtual void | setZoom (float _newVal) |
virtual float | getZoom () |
virtual void | changeZoom (float _range) |
virtual void | setOrigin (const vec2 &_pos) |
virtual vec2 | getOrigin () |
void | setNoMinSize () |
virtual void | checkMinSize () |
void | setNoMaxSize () |
virtual void | checkMaxSize () |
virtual bvec2 | canExpand () |
const bvec2 & | canFill () |
virtual bool | getFocus () |
virtual bool | setFocus () |
virtual bool | rmFocus () |
virtual void | keepFocus () |
virtual int32_t | getMouseLimit () |
virtual void | setMouseLimit (int32_t _numberState) |
virtual bool | getKeyboardRepeate () |
virtual bool | systemEventInput (ewol::event::InputSystem &_event) |
virtual bool | systemEventEntry (ewol::event::EntrySystem &_event) |
virtual void | onEventClipboard (enum gale::context::clipBoard::clipboardListe _clipboardID) |
virtual bool | onEventShortCut (const gale::key::Special &_special, char32_t _unicodeValue, enum gale::key::keyboard _kbMove, bool _isDown) |
virtual void | grabCursor () |
virtual void | unGrabCursor () |
virtual bool | getGrabStatus () |
virtual void | setCursor (enum gale::context::cursor _newCursor) |
virtual enum gale::context::cursor | getCursor () |
void | requestUpdateSize () |
ewol::widget::Manager & | getWidgetManager () |
ememory::SharedPtr< ewol::widget::Windows > | getWindows () |
void | setAnnimationType (enum ewol::Widget::annimationMode _mode, const std::string &_type) |
void | setAnnimationTime (enum ewol::Widget::annimationMode _mode, float _time) |
bool | startAnnimation (enum ewol::Widget::annimationMode _mode) |
bool | stopAnnimation () |
Public Member Functions inherited from ewol::Object | |
DECLARE_FACTORY (Object) | |
virtual | ~Object () |
bool | objectHasBeenCorectlyInit () |
virtual void | destroy () |
bool | isDestroyed () const |
virtual void | setParent (const ewol::ObjectShared &_newParent) |
virtual void | removeParent () |
const char *const | getObjectType () const |
std::string | getTypeDescription () const |
bool | isTypeCompatible (const std::string &_type) const |
bool | getStatic () |
int32_t | getId () |
bool | propertySetOnWidgetNamed (const std::string &_objectName, const std::string &_config, const std::string &_value) |
virtual bool | storeXML (exml::Element &_node) const |
void | setStatusResource (bool _val) |
bool | getStatusResource () const |
Public Member Functions inherited from ememory::EnableSharedFromThis< Object > | |
ememory::SharedPtr< EMEMORY_TYPE > | sharedFromThis () |
const ememory::SharedPtr< EMEMORY_TYPE > | sharedFromThis () const |
ememory::WeakPtr< EMEMORY_TYPE > | weakFromThis () |
const ememory::WeakPtr< EMEMORY_TYPE > | weakFromThis () const |
Protected Member Functions | |
void | init () override |
virtual void | onChangePropertyPath () |
virtual void | onChangePropertyFile () |
virtual void | onChangePropertyLabelTitle () |
virtual void | onChangePropertyLabelValidate () |
virtual void | onChangePropertyLabelCancel () |
Protected Member Functions inherited from ewol::widget::Composer | |
Composer () | |
Protected Member Functions inherited from ewol::widget::Container | |
Container () | |
Protected Member Functions inherited from ewol::Widget | |
Widget () | |
virtual void | onLostFocus () |
virtual void | setKeyboardRepeate (bool _state) |
virtual void | showKeyboard () |
virtual void | hideKeyboard () |
virtual bool | onEventInput (const ewol::event::Input &_event) |
virtual bool | onEventEntry (const ewol::event::Entry &_event) |
virtual void | shortCutAdd (const std::string &_descriptiveString, const std::string &_message="") |
virtual void | shortCutClean () |
virtual void | shortCutRemove (const std::string &_message) |
virtual void | markToRedraw () |
virtual bool | needRedraw () |
virtual void | onDraw () |
void | addAnnimationType (enum ewol::Widget::annimationMode _mode, const char *_type) |
virtual bool | onStartAnnimation (enum ewol::Widget::annimationMode _mode) |
virtual void | onStopAnnimation () |
virtual void | onChangePropertyCanFocus () |
virtual void | onChangePropertyGravity () |
virtual void | onChangePropertyHide () |
virtual void | onChangePropertyFill () |
virtual void | onChangePropertyExpand () |
virtual void | onChangePropertyMaxSize () |
virtual void | onChangePropertyMinSize () |
Protected Member Functions inherited from ewol::Object | |
Object () | |
virtual void | autoDestroy () |
void | addObjectType (const char *_type) |
Additional Inherited Members | |
Static Public Member Functions inherited from ewol::Object | |
static ewol::object::Manager & | getObjectManager () |
static ewol::Context & | getContext () |
static ewol::ObjectShared | getObjectNamed (const std::string &_objectName) |
Protected Types inherited from ewol::Widget | |
enum | annimationMode { annimationModeEnableAdd, annimationModeEnableRemove, annimationModeDisable } |
Protected Attributes inherited from ewol::widget::Container | |
ewol::WidgetShared | m_subWidget |
Protected Attributes inherited from ewol::Widget | |
vec2 | m_size |
vec2 | m_minSize |
vec2 | m_maxSize |
vec2 | m_offset |
float | m_zoom |
vec2 | m_origin |
bool | m_needRegenerateDisplay |
enum annimationMode | m_annimationMode |
float | m_annimationratio |
eproperty::List< int32_t > | propertyAnnimationTypeStart |
eproperty::Range< float > | propertyAnnimationTimeStart |
eproperty::List< int32_t > | propertyAnnimationTypeStop |
eproperty::Range< float > | propertyAnnimationTimeStop |
Protected Attributes inherited from ewol::Object | |
ewol::ObjectWeak | m_parent |
bool | m_destroy |
bool | m_static |
Detailed Description
File Chooser is a simple selector of file for opening, saving, and what you want ...
As all other pop-up methode ( wost case we can have) the creating is simple , but event back is not all the time simple:
Fist global static declaration and inclusion: [code style=c++] #include <ewol/widget/meta/FileChooser.h> [/code]
The first step is to create the file chooser pop-up : (never in the constructor!!!) [code style=c++] ewol::widget::FileChooserShared tmpWidget = ewol::Widget::FileChooser::create(); if (tmpWidget == nullptr) { APPL_ERROR("Can not open File chooser !!! "); return -1; } // register on the Validate event: tmpWidget->signalValidate.connect(sharedFromThis(), &****::onCallbackOpenFile); // no need of this event watching ... tmpWidget->signalCancel.connect(sharedFromThis(), &****::onCallbackClosePopUp); // set the title: tmpWidget->propertyLabelTitle.set("Open files ..."); // Set the validate Label: tmpWidget->propertyLabelValidate.set("Open"); // simply set a folder (by default this is the home folder) //tmpWidget->propertyPath.set("/home/me"); // add the widget as windows pop-up ... ewol::widget::WindowsShared tmpWindows = getWindows(); if (tmpWindows == nullptr) { APPL_ERROR("Can not get the current windows !!! "); return -1; } tmpWindows->popUpWidgetPush(tmpWidget); [/code]
Now we just need to wait the the open event message.
[code style=c++] void ****::onCallbackOpenFile(const std::string& _value) { APPL_INFO("Request open file : '" << _value << "'"); } void ****::onCallbackClosePopUp() { APPL_INFO("The File chooser has been closed"); } [/code] This is the best example of a Meta-widget.
Member Function Documentation
§ onGetFocus()
|
overridevirtual |
Event of the focus has been grep by the current widget.
Reimplemented from ewol::Widget.
Member Data Documentation
§ propertyFile
eproperty::Value<std::string> ewol::widget::FileChooser::propertyFile |
Selected file.
§ propertyLabelCancel
eproperty::Value<std::string> ewol::widget::FileChooser::propertyLabelCancel |
Label of cancel/close button of the pop-up (can use translation)
§ propertyLabelTitle
eproperty::Value<std::string> ewol::widget::FileChooser::propertyLabelTitle |
Label of the pop-up (can use translation)
§ propertyLabelValidate
eproperty::Value<std::string> ewol::widget::FileChooser::propertyLabelValidate |
Label of validate button of the pop-up (can use translation)
§ propertyPath
eproperty::Value<std::string> ewol::widget::FileChooser::propertyPath |
Current path to explore.
§ signalCancel
esignal::Signal ewol::widget::FileChooser::signalCancel |
abort the display of the pop-up or press cancel button
§ signalValidate
esignal::Signal<std::string> ewol::widget::FileChooser::signalValidate |
select file(s)
The documentation for this class was generated from the following file:
- framework/atria-soft/ewol/ewol/widget/meta/FileChooser.hpp