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 simpleenum:
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
Parameter [input]: _shaperName Shaper file properties
~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)
Parameter [input]: _shaperName The new shaper filename
m_subWidget
# ewol::Widget* m_subWidget;
subwidget of the button
setSubWidget
+ void setSubWidget (ewol::Widget* _subWidget);
Specify the current widget
Parameter [input]: _subWidget Widget to add normal
setSubWidgetToggle
+ void setSubWidgetToggle (ewol::Widget* _subWidget);
Specify the current widget
Parameter [input]: _subWidget Widget to add Toggle
getSubWidget
+ ewol::Widget* getSubWidget (void ) const;
get the current displayed composition
Return: The base widget
getSubWidgetToggle
+ ewol::Widget* getSubWidgetToggle (void ) const;
get the current displayed composition
Return: The toggle widget
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
Parameter [input]: _val New value of the button
getValue
+ bool getValue (void ) const;
get the current button value.
Return: True : The button is pressed.<br/>false : The button is released.
setLock
+ void setLock (enum buttonLock _lock);
set the button lock state.
Parameter [input]: _lock New lock mode of the button
getLock
+ enum buttonLock getLock (void ) const;
get the current button lock value.
Return: The requested lock mode
m_toggleMode
# bool m_toggleMode;
The button is able to toggle.
setToggleMode
+ void setToggleMode (bool _togg);
change the toggle mode.
Parameter [input]: _togg New toggle mode
getToggleMode
+ bool getToggleMode (void ) const;
get the current toggle mode.
Return: 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
Parameter [input]: _conf Configuration handle.
Return: true if the parametere has been used
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
Parameter [input]: _config Configuration name.
Parameter [output]: _result Result of the request.
Return: true if the config is set
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
Parameter [input]: _available Available x&y pixel size
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
Parameter [input]: _displayProp properties of the current display
onEventInput
+ virtual bool onEventInput (const ewol::event::Input & _event);
Event on an input of this Widget (finger, mouse, stilet)
Parameter [input]: _event Event properties
Return: true the event is used<br/>false the event is not used
onEventEntry
+ virtual bool onEventEntry (const ewol::event::Entry & _event);
Entry event.
represent the physical event :
- Keyboard (key event and move event)
- Accelerometer
- Joystick
Parameter [input]: _event Event properties
Return: true if the event has been used<br/>false if the event has not been used
loadXML
+ virtual bool loadXML (exml::Element* _node);
load properties with an XML node.
Parameter [input]: _node Pointer on the tinyXML node.
Return: true : All has been done corectly.<br/>false : An error occured.
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
Parameter [input]: _widgetName name of the widget
Return: the requested pointer on the node (or NULL pointer)
+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
Parameter [input]: | _shaperName | Shaper file properties |
~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)
Parameter [input]: | _shaperName | The new shaper filename |
m_subWidget
# ewol::Widget* m_subWidget;subwidget of the button
setSubWidget
+ void setSubWidget (ewol::Widget* _subWidget);Specify the current widget
Parameter [input]: | _subWidget | Widget to add normal |
setSubWidgetToggle
+ void setSubWidgetToggle (ewol::Widget* _subWidget);Specify the current widget
Parameter [input]: | _subWidget | Widget to add Toggle |
getSubWidget
+ ewol::Widget* getSubWidget (void ) const;get the current displayed composition
Return: | The base widget |
getSubWidgetToggle
+ ewol::Widget* getSubWidgetToggle (void ) const;get the current displayed composition
Return: | The toggle widget |
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
Parameter [input]: | _val | New value of the button |
getValue
+ bool getValue (void ) const;get the current button value.
Return: | True : The button is pressed.<br/>false : The button is released. |
setLock
+ void setLock (enum buttonLock _lock);set the button lock state.
Parameter [input]: | _lock | New lock mode of the button |
getLock
+ enum buttonLock getLock (void ) const;get the current button lock value.
Return: | The requested lock mode |
m_toggleMode
# bool m_toggleMode;The button is able to toggle.
setToggleMode
+ void setToggleMode (bool _togg);change the toggle mode.
Parameter [input]: | _togg | New toggle mode |
getToggleMode
+ bool getToggleMode (void ) const;get the current toggle mode.
Return: | 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
Parameter [input]: | _conf | Configuration handle. |
Return: | true if the parametere has been used |
onGetConfig
# virtual bool onGetConfig (const char* _config,Receive a configuration message from an other element system or from the curent Object
std::string & _result) const;
Parameter [input]: | _config | Configuration name. | Parameter [output]: | _result | Result of the request. |
Return: | true if the config is set |
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
Parameter [input]: | _available | Available x&y pixel size |
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
Parameter [input]: | _displayProp | properties of the current display |
onEventInput
+ virtual bool onEventInput (const ewol::event::Input & _event);Event on an input of this Widget (finger, mouse, stilet)
Parameter [input]: | _event | Event properties |
Return: | true the event is used<br/>false the event is not used |
onEventEntry
+ virtual bool onEventEntry (const ewol::event::Entry & _event);Entry event. represent the physical event : - Keyboard (key event and move event) - Accelerometer - Joystick
Parameter [input]: | _event | Event properties |
Return: | true if the event has been used<br/>false if the event has not been used |
loadXML
+ virtual bool loadXML (exml::Element* _node);load properties with an XML node.
Parameter [input]: | _node | Pointer on the tinyXML node. |
Return: | true : All has been done corectly.<br/>false : An error occured. |
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
Parameter [input]: | _widgetName | name of the widget |
Return: | the requested pointer on the node (or NULL pointer) |