class: ewol::Widget


Description:

Widget class is the main widget interface, it hase some generic properties: :INDENT: Receive Event (keyboard / mouse / ...)

Associated Namespace:

enum:

Constructor and Destructor:

#                                                    Widget                      ();
+ virtual ~Widget ();

Synopsis:

#         void                                       init                        ();
# void init (const std::string & _name);
# vec2 m_size;
# vec2 m_minSize;
# vec2 m_maxSize;
+ virtual vec2 relativePosition (const vec2 & _pos);
+ virtual void calculateSize (const vec2 & _available);
+ virtual vec2 getSize ();
+ virtual void calculateMinMaxSize ();
+ virtual vec2 getCalculateMinSize ();
+ virtual vec2 getCalculateMaxSize ();
# vec2 m_offset;
+ virtual void setOffset (const vec2 & _newVal);
+ virtual const vec2 & getOffset ();
# float m_zoom;
+ virtual void setZoom (float _newVal);
+ virtual float getZoom ();
+ virtual void changeZoom (float _range);
# vec2 m_origin;
+ virtual void setOrigin (const vec2 & _pos);
+ virtual vec2 getOrigin ();
# ewol::object::Param<ewol::Dimension> m_userMinSize;
+ void setMinSize (const ewol::Dimension & _size);
+ void setNoMinSize ();
+ const ewol::Dimension & getMinSize ();
+ virtual void checkMinSize ();
# ewol::object::Param<ewol::Dimension> m_userMaxSize;
+ void setMaxSize (const ewol::Dimension & _size);
+ void setNoMaxSize ();
+ const ewol::Dimension & getMaxSize ();
+ virtual void checkMaxSize ();
# ewol::object::Param<bvec2> m_userExpand;
+ virtual void setExpand (const bvec2 & _newExpand);
+ virtual bvec2 getExpand ();
+ virtual bvec2 canExpand ();
# ewol::object::Param<bvec2> m_userFill;
+ virtual void setFill (const bvec2 & _newFill);
+ virtual const bvec2 & getFill ();
+ const bvec2 & canFill ();
# ewol::object::Param<bool> m_hide;
+ virtual void hide ();
+ virtual void show ();
+ virtual bool isHide ();
# ewol::object::ParamList<enumewol::gravity> m_gravity;
+ virtual void setGravity (enum ewol::gravity _gravity);
+ virtual enum ewol::gravity getGravity ();
+ virtual bool getFocus ();
+ virtual bool canHaveFocus ();
+ virtual bool setFocus ();
+ virtual bool rmFocus ();
+ virtual void setCanHaveFocus (bool _canFocusState);
+ virtual void keepFocus ();
# virtual void onGetFocus ();
# virtual void onLostFocus ();
+ virtual int32_t getMouseLimit ();
+ virtual void setMouseLimit (int32_t _numberState);
+ virtual bool getKeyboardRepeate ();
# virtual void setKeyboardRepeate (bool _state);
# virtual void showKeyboard ();
# virtual void hideKeyboard ();
# void periodicCallDisable ();
# void periodicCallEnable (float _callInSecond);
+ int64_t systemGetCallDeltaTime () const;
+ int64_t systemGetLastCallTime () const;
+ void systemSetLastCallTime (int64_t _time);
+ virtual void periodicCall (const ewol::event::Time & _event);
+ virtual std::shared_ptr<ewol::Widget> getWidgetAtPos (const vec2 & _pos);
+ virtual bool systemEventInput (ewol::event::InputSystem & _event);
# virtual bool onEventInput (const ewol::event::Input & _event);
+ virtual bool systemEventEntry (ewol::event::EntrySystem & _event);
# virtual bool onEventEntry (const ewol::event::Entry & _event);
+ virtual void onEventClipboard (enum ewol::context::clipBoard::clipboardListe _clipboardID);
+ ewol::object::Signal<std::string> signalShortcut;
# virtual void shortCutAdd (const std::string & _descriptiveString,
const std::string & _message);
# virtual void shortCutClean ();
# virtual void shortCutRemove (const std::string & _message);
+ virtual bool onEventShortCut (ewol::key::Special & _special,
char32_t _unicodeValue,
enum ewol::key::keyboard _kbMove,
bool _isDown);
# bool m_needRegenerateDisplay;
# virtual void markToRedraw ();
# virtual bool needRedraw ();
+ virtual void systemDraw (const DrawProperty & _displayProp);
# virtual void onDraw ();
+ virtual void onRegenerateDisplay ();
+ virtual void grabCursor ();
+ virtual void unGrabCursor ();
+ virtual bool getGrabStatus ();
+ virtual void setCursor (enum ewol::context::cursorDisplay _newCursor);
+ virtual enum ewol::context::cursorDisplay getCursor ();
+ virtual bool loadXML (exml::Element* _node);
# virtual void onParameterChangeValue (const ewol::object::ParameterRef & _paramPointer);
+ void requestUpdateSize ();
+ ewol::widget::Manager & getWidgetManager ();
+ std::shared_ptr<ewol::widget::Windows> getWindows ();
+ ewol::object::Signal<void> signalAnnimationStart;
+ ewol::object::Signal<float> signalAnnimationRatio;
+ ewol::object::Signal<void> signalAnnimationStop;
# float m_annimationratio;
# ewol::object::ParamList<int32_t> m_annimationTypeStart;
# ewol::object::ParamRange<float> m_annimationTimeStart;
# ewol::object::ParamList<int32_t> m_annimationTypeStop;
# ewol::object::ParamRange<float> m_annimationTimeStop;
# void addAnnimationType (enum ewol::Widget::annimationMode _mode,
const char* _type);
+ 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 ();
# virtual bool onStartAnnimation (enum ewol::Widget::annimationMode _mode);
# virtual void onStopAnnimation ();

Object Hierarchy:

+std::enable_shared_from_this<Object>
+ewol::object::ParameterList
+ewol::object::SignalList
+--> +ewol::Object
+--> ewol::Widget
+--> ewol::widget::ButtonColor
+--> ewol::widget::WidgetScrolled
+--> ewol::widget::Joystick
+--> ewol::widget::Slider
+--> ewol::widget::Spacer
+--> ewol::widget::Label
+--> ewol::widget::Container2
+--> ewol::widget::Image
+--> ewol::widget::ProgressBar
+--> ewol::widget::Windows
+--> ewol::widget::Container
+--> ewol::widget::ContainerN
+--> ewol::widget::Gird
+--> ewol::widget::Entry
+--> ewol::widget::ColorBar
+--> ege::widget::Mesh
+--> ege::widget::Scene

Detail:

Widget

#  Widget ();
Constructor of the widget classes


init

# void init ();



init

# void init (const std::string & _name);



~Widget

+ virtual  ~Widget ();
Destructor of the widget classes


m_size

# vec2 m_size;
internal : current size of the widget


m_minSize

# vec2 m_minSize;
internal : minimum size of the widget


m_maxSize

# vec2 m_maxSize;
internal : maximum size of the widget


relativePosition

+ virtual vec2 relativePosition (const vec2 & _pos);
convert the absolute position in the local Position (Relative)


calculateSize

+ virtual void calculateSize (const vec2 & _available);
Parent set the possible diplay size of the current widget whith his own possibilities By default this save the widget available size in the widget size
Note: : INTERNAL EWOL SYSTEM


getSize

+ virtual vec2 getSize ();
get the widget size
Note: : INTERNAL EWOL SYSTEM


calculateMinMaxSize

+ virtual void calculateMinMaxSize ();
calculate the minimum and maximum size (need to estimate expend properties of the widget)
Note: : INTERNAL EWOL SYSTEM


getCalculateMinSize

+ virtual vec2 getCalculateMinSize ();
get the widget minimum size calculated
Note: : INTERNAL EWOL SYSTEM


getCalculateMaxSize

+ virtual vec2 getCalculateMaxSize ();
get the widget maximum size calculated
Note: : INTERNAL EWOL SYSTEM


m_offset

# vec2 m_offset;
Offset of the display in the viewport


setOffset

+ virtual void setOffset (const vec2 & _newVal);
set the zoom property of the widget.


getOffset

+ virtual const vec2 & getOffset ();
get the offset property of the widget.


m_zoom

# float m_zoom;
generic widget zoom


setZoom

+ virtual void setZoom (float _newVal);
set the zoom property of the widget


getZoom

+ virtual float getZoom ();
get the zoom property of the widget


changeZoom

+ virtual void changeZoom (float _range);
Change Zoom property.


m_origin

# vec2 m_origin;
internal ... I do not really known how i can use it ...


setOrigin

+ virtual void setOrigin (const vec2 & _pos);
set origin at the widget (must be an parrent widget that set this parameter). This represent the absolute origin in the program windows
Note: : INTERNAL EWOL SYSTEM


getOrigin

+ virtual vec2 getOrigin ();
get the origin (obsolute position in the windows)


m_userMinSize

# ewol::object::Param<ewol::Dimension> m_userMinSize;
user define the minimum size of the widget


setMinSize

+ void setMinSize (const ewol::Dimension & _size);
User set the minimum size he want to set the display


setNoMinSize

+ void setNoMinSize ();
User set No minimum size.


getMinSize

+ const ewol::Dimension & getMinSize ();
get the current calculated min size


checkMinSize

+ virtual void checkMinSize ();
Check if the current min size is compatible with the user minimum size If it is not the user minimum size will overWrite the minimum size set.
Note: : INTERNAL EWOL SYSTEM


m_userMaxSize

# ewol::object::Param<ewol::Dimension> m_userMaxSize;
user define the maximum size of the widget


setMaxSize

+ void setMaxSize (const ewol::Dimension & _size);
User set the maximum size he want to set the display


setNoMaxSize

+ void setNoMaxSize ();
User set No maximum size.


getMaxSize

+ const ewol::Dimension & getMaxSize ();
get the current maximum size


checkMaxSize

+ virtual void checkMaxSize ();
Check if the current max size is compatible with the user maximum size If it is not the user maximum size will overWrite the maximum size set.
Note: : INTERNAL EWOL SYSTEM


m_userExpand

# ewol::object::Param<bvec2> m_userExpand;



setExpand

+ virtual void setExpand (const bvec2 & _newExpand);
set the expend capabilities (x&y)


getExpand

+ virtual bvec2 getExpand ();
get the expend capabilities (x&y) (set by the user)


canExpand

+ virtual bvec2 canExpand ();
get the expend capabilities (x&y)
Note: : INTERNAL EWOL SYSTEM


m_userFill

# ewol::object::Param<bvec2> m_userFill;



setFill

+ virtual void setFill (const bvec2 & _newFill);
set the x&y filling capacity


getFill

+ virtual const bvec2 & getFill ();
set the x&y filling capacity set by the user


canFill

+ const bvec2 & canFill ();
get the filling capabilities x&y
Note: : INTERNAL EWOL SYSTEM


m_hide

# ewol::object::Param<bool> m_hide;
hide a widget on the display


hide

+ virtual void hide ();
set the widget hidden


show

+ virtual void show ();
set the widget visible


isHide

+ virtual bool isHide ();
get the visibility of the widget


m_gravity

# ewol::object::ParamList<enumewol::gravity> m_gravity;
Gravity of the widget


setGravity

+ virtual void setGravity (enum ewol::gravity _gravity);
set the widget gravity


getGravity

+ virtual enum ewol::gravity getGravity ();
get the widget gravity


getFocus

+ virtual bool getFocus ();
get the focus state of the widget


canHaveFocus

+ virtual bool canHaveFocus ();
get the capability to have focus


setFocus

+ virtual bool setFocus ();
set focus on this widget


rmFocus

+ virtual bool rmFocus ();
remove the focus on this widget


setCanHaveFocus

+ virtual void setCanHaveFocus (bool _canFocusState);
set the capability to have the focus


keepFocus

+ virtual void keepFocus ();
keep the focus on this widget == > this remove the previous focus on all other widget


onGetFocus

# virtual void onGetFocus ();
Event of the focus has been grep by the current widget


onLostFocus

# virtual void onLostFocus ();
Event of the focus has been lost by the current widget


getMouseLimit

+ virtual int32_t getMouseLimit ();
get the number of mouse event supported


setMouseLimit

+ virtual void setMouseLimit (int32_t _numberState);
get the number of mouse event supported


getKeyboardRepeate

+ virtual bool getKeyboardRepeate ();
get the keyboard repeating event supporting.


setKeyboardRepeate

# virtual void setKeyboardRepeate (bool _state);
set the keyboard repeating event supporting.


showKeyboard

# virtual void showKeyboard ();
display the virtual keyboard (if needed)


hideKeyboard

# virtual void hideKeyboard ();
Hide the virtual keyboard (if needed)


periodicCallDisable

# void periodicCallDisable ();
disable the periodic call.


periodicCallEnable

# void periodicCallEnable (float _callInSecond);
disable the periodic call.


systemGetCallDeltaTime

+ int64_t systemGetCallDeltaTime () const;
{SYSTEM} get a reference of the periodic call delta time


systemGetLastCallTime

+ int64_t systemGetLastCallTime () const;
{SYSTEM} get a reference of the periodic call time


systemSetLastCallTime

+ void systemSetLastCallTime (int64_t _time);
{SYSTEM} get a reference of the periodic call time


periodicCall

+ virtual void periodicCall (const ewol::event::Time & _event);
periodic call of this widget


getWidgetAtPos

+ virtual std::shared_ptr<ewol::Widget> getWidgetAtPos (const vec2 & _pos);
get the widget at the specific windows absolute position
Note: : INTERNAL EWOL SYSTEM


systemEventInput

+ virtual bool systemEventInput (ewol::event::InputSystem & _event);
{SYSTEM} system event input (only meta widget might overwrite this function).


onEventInput

# virtual bool onEventInput (const ewol::event::Input & _event);
Event on an input of this Widget (finger, mouse, stilet)


systemEventEntry

+ virtual bool systemEventEntry (ewol::event::EntrySystem & _event);
{SYSTEM} Entry event (only meta widget might overwrite this function).


onEventEntry

# virtual bool onEventEntry (const ewol::event::Entry & _event);
Entry event. represent the physical event : - Keyboard (key event and move event) - Accelerometer - Joystick


onEventClipboard

+ virtual void onEventClipboard (enum ewol::context::clipBoard::clipboardListe _clipboardID);
Event on a past event == > this event is asynchronous due to all system does not support direct getting datas
Note: : need to have focus ...


signalShortcut

+ ewol::object::Signal<std::string> signalShortcut;
signal handle of the message


shortCutAdd

# virtual void shortCutAdd (const std::string & _descriptiveString,
const std::string & _message);
add a specific shortcut with his description


shortCutClean

# virtual void shortCutClean ();
remove all curent shortCut


shortCutRemove

# virtual void shortCutRemove (const std::string & _message);
remove a specific shortCut whith his event name


onEventShortCut

+ virtual bool onEventShortCut (ewol::key::Special & _special,
char32_t _unicodeValue,
enum ewol::key::keyboard _kbMove,
bool _isDown);
Event on a short-cut of this Widget (in case of return false, the event on the keyevent will arrive in the function @ref onEventKb).
Note: To prevent some error when you get an event get it if it is down and Up ... == > like this it could not generate some ununderstanding error.


m_needRegenerateDisplay

# bool m_needRegenerateDisplay;
the display might be done the next regeneration


markToRedraw

# virtual void markToRedraw ();
The widget mark itself that it need to regenerate the nest time.


needRedraw

# virtual bool needRedraw ();
get the need of the redrawing of the widget and reset it to false


systemDraw

+ virtual void systemDraw (const DrawProperty & _displayProp);
{SYSTEM} extern interface to request a draw ... (called by the drawing thread [Android, X11, ...]) This function generate a clipping with the viewport openGL system. Like this a widget draw can not draw over an other widget
Note: This function is virtual for the scrolled widget, and the more complicated openGl widget
Note: : INTERNAL EWOL SYSTEM


onDraw

# virtual void onDraw ();
Common widget drawing function (called by the drawing thread [Android, X11, ...])


onRegenerateDisplay

+ virtual void onRegenerateDisplay ();
Event generated when a redraw is needed


grabCursor

+ virtual void grabCursor ();
Grab the cursor : This get all the mouvement of the mouse in PC mode, and generate an ofset instead of a position.
Note: : the generation of the offset is due to the fact the cursor position is forced at the center of the widget.
Note: This done nothing in "Finger" or "Stylet" mode.


unGrabCursor

+ virtual void unGrabCursor ();
Un-Grab the cursor (default mode cursor offset)


getGrabStatus

+ virtual bool getGrabStatus ();
get the grabbing status of the cursor.


setCursor

+ virtual void setCursor (enum ewol::context::cursorDisplay _newCursor);
set the cursor display type.


getCursor

+ virtual enum ewol::context::cursorDisplay getCursor ();
get the currrent cursor.


loadXML

+ virtual bool loadXML (exml::Element* _node);
load properties with an XML node.


onParameterChangeValue

# virtual void onParameterChangeValue (const ewol::object::ParameterRef & _paramPointer);



requestUpdateSize

+ void requestUpdateSize ();
need to be call When the size of the current widget have change == > this force the system to recalculate all the widget positions


getWidgetManager

+ ewol::widget::Manager & getWidgetManager ();
get the current Widget Manager


getWindows

+ std::shared_ptr<ewol::widget::Windows> getWindows ();
get the curent Windows


signalAnnimationStart

+ ewol::object::Signal<void> signalAnnimationStart;
event when start annimation


signalAnnimationRatio

+ ewol::object::Signal<float> signalAnnimationRatio;
event when % of annimation change (integer)


signalAnnimationStop

+ ewol::object::Signal<void> signalAnnimationStop;
event when stop annimation


m_annimationratio

# float m_annimationratio;
Ratio of the annimation [0..1]


m_annimationTypeStart

# ewol::object::ParamList<int32_t> m_annimationTypeStart;
type of start annimation


m_annimationTimeStart

# ewol::object::ParamRange<float> m_annimationTimeStart;
time to produce start annimation


m_annimationTypeStop

# ewol::object::ParamList<int32_t> m_annimationTypeStop;
type of start annimation


m_annimationTimeStop

# ewol::object::ParamRange<float> m_annimationTimeStop;
time to produce start annimation


addAnnimationType

# void addAnnimationType (enum ewol::Widget::annimationMode _mode,
const char* _type);
Add a annimation type capabilities of this widget.


setAnnimationType

+ void setAnnimationType (enum ewol::Widget::annimationMode _mode,
const std::string & _type);
set a annimation type.


setAnnimationTime

+ void setAnnimationTime (enum ewol::Widget::annimationMode _mode,
float _time);
set a annimation time to produce.


startAnnimation

+ bool startAnnimation (enum ewol::Widget::annimationMode _mode);
Start the annimation.


stopAnnimation

+ bool stopAnnimation ();
Stop/Break the annimation.


onStartAnnimation

# virtual bool onStartAnnimation (enum ewol::Widget::annimationMode _mode);
Event when start the annimation.


onStopAnnimation

# virtual void onStopAnnimation ();
Event when Stop the annimation.