class: ewol::widget::Button


Description:

a composed button is a button with an inside composed with the specify XML element ==> this permit to generate standard element simple

enum:

Constructor and Destructor:

+                                   Button               (const std::string & _shaperName);
+ virtual ~Button (void );

Synopsis:

+         void                      init                 (ewol::widget::Manager & _widgetManager);
+ const char* const eventPressed;
+ const char* const eventDown;
+ const char* const eventUp;
+ const char* const eventEnter;
+ const char* const eventLeave;
+ const char* const eventValue;
+ const char* const configToggle;
+ const char* const configLock;
+ const char* const configValue;
+ const char* const configShaper;
+ void setShaperName (const std::string & _shaperName);
# ewol::Widget* m_subWidget;
+ void setSubWidget (ewol::Widget* _subWidget);
+ void setSubWidgetToggle (ewol::Widget* _subWidget);
+ ewol::Widget* getSubWidget (void ) const;
+ ewol::Widget* getSubWidgetToggle (void ) const;
# bool m_value;
+ void setValue (bool _val);
+ bool getValue (void ) const;
+ void setLock (enum buttonLock _lock);
+ enum buttonLock getLock (void ) const;
# bool m_toggleMode;
+ void setToggleMode (bool _togg);
+ bool getToggleMode (void ) const;
# virtual void onDraw (void );
# virtual bool onSetConfig (const ewol::object::Config & _conf);
# virtual bool onGetConfig (const char* _config,
std::string & _result) const;
+ virtual void calculateMinMaxSize (void );
+ virtual void calculateSize (const vec2 & _availlable);
+ virtual void onRegenerateDisplay (void );
+ virtual void systemDraw (const ewol::DrawProperty & _displayProp);
+ virtual bool onEventInput (const ewol::event::Input & _event);
+ virtual bool onEventEntry (const ewol::event::Entry & _event);
+ virtual bool loadXML (exml::Element* _node);
+ virtual ewol::Widget* getWidgetNamed (const std::string & _widgetName);

Object Hierarchy:

+ewol::Object
+--> +ewol::Widget
+--> ewol::widget::Button

Detail:

init

+ void init (ewol::widget::Manager & _widgetManager);



eventPressed

+ const char* const eventPressed;



eventDown

+ const char* const eventDown;



eventUp

+ const char* const eventUp;



eventEnter

+ const char* const eventEnter;



eventLeave

+ const char* const eventLeave;



eventValue

+ const char* const eventValue;



configToggle

+ const char* const configToggle;



configLock

+ const char* const configLock;



configValue

+ const char* const configValue;



configShaper

+ const char* const configShaper;



Button

+  Button (const std::string & _shaperName);
Constructor


~Button

+ virtual  ~Button (void );
Destructor


setShaperName

+ void setShaperName (const std::string & _shaperName);
set the shaper name (use the contructer one this permit to not noad unused shaper)


m_subWidget

# ewol::Widget* m_subWidget;
subwidget of the button


setSubWidget

+ void setSubWidget (ewol::Widget* _subWidget);
Specify the current widget


setSubWidgetToggle

+ void setSubWidgetToggle (ewol::Widget* _subWidget);
Specify the current widget


getSubWidget

+ ewol::Widget* getSubWidget (void ) const;
get the current displayed composition


getSubWidgetToggle

+ ewol::Widget* getSubWidgetToggle (void ) const;
get the current displayed composition


m_value

# bool m_value;
Current state of the button.


setValue

+ void setValue (bool _val);
set the currentValue of the Button (pressed or not)
Note: Work only in toggle mode


getValue

+ bool getValue (void ) const;
get the current button value.


setLock

+ void setLock (enum buttonLock _lock);
set the button lock state.


getLock

+ enum buttonLock getLock (void ) const;
get the current button lock value.


m_toggleMode

# bool m_toggleMode;
The button is able to toggle.


setToggleMode

+ void setToggleMode (bool _togg);
change the toggle mode.


getToggleMode

+ bool getToggleMode (void ) const;
get the current toggle mode.


onDraw

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


onSetConfig

# virtual bool onSetConfig (const ewol::object::Config & _conf);
Configuration requested to the curent Object


onGetConfig

# virtual bool onGetConfig (const char* _config,
std::string & _result) const;
Receive a configuration message from an other element system or from the curent Object


calculateMinMaxSize

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


calculateSize

+ virtual void calculateSize (const vec2 & _availlable);
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


onRegenerateDisplay

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


systemDraw

+ virtual void systemDraw (const ewol::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


onEventInput

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


onEventEntry

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


loadXML

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


getWidgetNamed

+ virtual ewol::Widget* getWidgetNamed (const std::string & _widgetName);
get the widget if it have this name or one of the subwidget with the same name