[DEV] end of rework the main widget class ** it will be finish now
This commit is contained in:
parent
2d209cd37e
commit
3bb4c6a700
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
||||
Subproject commit f9951e9f5566eca104348a1bbf84f5721f5ce63d
|
||||
Subproject commit 2b19ef4bc89e82906865244e056a138c937f88de
|
@ -79,7 +79,7 @@ ewol::Dimension::~Dimension(void)
|
||||
// nothing to do ...
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::Get(ewol::Dimension::distance_te type)
|
||||
vec2 ewol::Dimension::Get(ewol::Dimension::distance_te type) const
|
||||
{
|
||||
switch(m_type) {
|
||||
case ewol::Dimension::Pourcent:
|
||||
@ -101,8 +101,11 @@ vec2 ewol::Dimension::Get(ewol::Dimension::distance_te type)
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::Dimension::Set(const vec2& size, ewol::Dimension::distance_te type)
|
||||
void ewol::Dimension::Set(const vec2& _size, ewol::Dimension::distance_te type)
|
||||
{
|
||||
// Set min max on input to limit error :
|
||||
vec2 size(etk_avg(0,_size.x(),999999999999999.0),
|
||||
etk_avg(0,_size.y(),999999999999999.0));
|
||||
switch(type) {
|
||||
case ewol::Dimension::Pourcent:
|
||||
m_data = vec2(size.x()*0.01f, size.y()*0.01f);
|
||||
@ -132,7 +135,7 @@ void ewol::Dimension::Set(const vec2& size, ewol::Dimension::distance_te type)
|
||||
m_type = type;
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::GetPixel(void)
|
||||
vec2 ewol::Dimension::GetPixel(void) const
|
||||
{
|
||||
if (m_type!=ewol::Dimension::Pourcent) {
|
||||
return m_data;
|
||||
@ -141,43 +144,119 @@ vec2 ewol::Dimension::GetPixel(void)
|
||||
return vec2(windDim.x()*m_data.x(), windDim.y()*m_data.y());
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::GetPourcent(void)
|
||||
vec2 ewol::Dimension::GetPourcent(void) const
|
||||
{
|
||||
if (m_type!=ewol::Dimension::Pourcent) {
|
||||
vec2 windDim = windowsSize.GetPixel();
|
||||
return vec2(m_data.x()/windDim.x()*100.0f, m_data.y()/windDim.y()*100.0f);
|
||||
}
|
||||
return m_data*100.0f;
|
||||
return vec2(m_data.x()*100.0f, m_data.y()*100.0f);;
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::GetMeter(void)
|
||||
vec2 ewol::Dimension::GetMeter(void) const
|
||||
{
|
||||
return ewol::Dimension::GetMillimeter()*millimeterToMeter;
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::GetCentimeter(void)
|
||||
vec2 ewol::Dimension::GetCentimeter(void) const
|
||||
{
|
||||
return ewol::Dimension::GetMillimeter()*millimeterToMeter;
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::GetMillimeter(void)
|
||||
vec2 ewol::Dimension::GetMillimeter(void) const
|
||||
{
|
||||
return ewol::Dimension::GetPixel()*invRatio;
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::GetKilometer(void)
|
||||
vec2 ewol::Dimension::GetKilometer(void) const
|
||||
{
|
||||
return ewol::Dimension::GetMillimeter()*millimeterToKilometer;
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::GetInch(void)
|
||||
vec2 ewol::Dimension::GetInch(void) const
|
||||
{
|
||||
return ewol::Dimension::GetMillimeter()*millimeterToInch;
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::GetFoot(void)
|
||||
vec2 ewol::Dimension::GetFoot(void) const
|
||||
{
|
||||
return ewol::Dimension::GetMillimeter()*millimeterToFoot;
|
||||
}
|
||||
|
||||
etk::UString ewol::Dimension::GetString(void)
|
||||
{
|
||||
etk::UString ret;
|
||||
vec2 size = Get(GetType());
|
||||
ret += etk::UString(size.x());
|
||||
ret += ",";
|
||||
ret += etk::UString(size.y());
|
||||
switch(m_type) {
|
||||
case ewol::Dimension::Pourcent:
|
||||
ret += "%";
|
||||
break;
|
||||
case ewol::Dimension::Pixel:
|
||||
ret += "px";
|
||||
break;
|
||||
case ewol::Dimension::Meter:
|
||||
ret += "m";
|
||||
break;
|
||||
case ewol::Dimension::Centimeter:
|
||||
ret += "cm";
|
||||
break;
|
||||
case ewol::Dimension::Millimeter:
|
||||
ret += "mm";
|
||||
break;
|
||||
case ewol::Dimension::Kilometer:
|
||||
ret += "km";
|
||||
break;
|
||||
case ewol::Dimension::Inch:
|
||||
ret += "in";
|
||||
break;
|
||||
case ewol::Dimension::foot:
|
||||
ret += "ft";
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
void ewol::Dimension::SetString(const etk::UString& value)
|
||||
{
|
||||
EWOL_TODO(" not done yet ...");
|
||||
}
|
||||
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout &os, const ewol::Dimension::distance_te& obj)
|
||||
{
|
||||
switch(obj) {
|
||||
case ewol::Dimension::Pourcent:
|
||||
os << "%";
|
||||
break;
|
||||
case ewol::Dimension::Pixel:
|
||||
os << "px";
|
||||
break;
|
||||
case ewol::Dimension::Meter:
|
||||
os << "m";
|
||||
break;
|
||||
case ewol::Dimension::Centimeter:
|
||||
os << "cm";
|
||||
break;
|
||||
case ewol::Dimension::Millimeter:
|
||||
os << "mm";
|
||||
break;
|
||||
case ewol::Dimension::Kilometer:
|
||||
os << "km";
|
||||
break;
|
||||
case ewol::Dimension::Inch:
|
||||
os << "in";
|
||||
break;
|
||||
case ewol::Dimension::foot:
|
||||
os << "ft";
|
||||
break;
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout &os, const ewol::Dimension& obj)
|
||||
{
|
||||
os << obj.Get(obj.GetType()) << obj.GetType();
|
||||
return os;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ namespace ewol
|
||||
* @param[in] type Type of unit requested.
|
||||
* @return dimention requested.
|
||||
*/
|
||||
vec2 Get(ewol::Dimension::distance_te type);
|
||||
vec2 Get(ewol::Dimension::distance_te type) const;
|
||||
/**
|
||||
* @brief Set the current dimention in requested type
|
||||
* @param[in] size Dimention to set
|
||||
@ -54,44 +54,68 @@ namespace ewol
|
||||
* @brief Get the current dimention in pixel
|
||||
* @return dimention in Pixel
|
||||
*/
|
||||
vec2 GetPixel(void);
|
||||
vec2 GetPixel(void) const;
|
||||
/**
|
||||
* @brief Get the current dimention in Pourcent
|
||||
* @return dimention in Pourcent
|
||||
*/
|
||||
vec2 GetPourcent(void);
|
||||
vec2 GetPourcent(void) const;
|
||||
/**
|
||||
* @brief Get the current dimention in Meter
|
||||
* @return dimention in Meter
|
||||
*/
|
||||
vec2 GetMeter(void);
|
||||
vec2 GetMeter(void) const;
|
||||
/**
|
||||
* @brief Get the current dimention in Centimeter
|
||||
* @return dimention in Centimeter
|
||||
*/
|
||||
vec2 GetCentimeter(void);
|
||||
vec2 GetCentimeter(void) const;
|
||||
/**
|
||||
* @brief Get the current dimention in Millimeter
|
||||
* @return dimention in Millimeter
|
||||
*/
|
||||
vec2 GetMillimeter(void);
|
||||
vec2 GetMillimeter(void) const;
|
||||
/**
|
||||
* @brief Get the current dimention in Kilometer
|
||||
* @return dimention in Kilometer
|
||||
*/
|
||||
vec2 GetKilometer(void);
|
||||
vec2 GetKilometer(void) const;
|
||||
/**
|
||||
* @brief Get the current dimention in Inch
|
||||
* @return dimention in Inch
|
||||
*/
|
||||
vec2 GetInch(void);
|
||||
vec2 GetInch(void) const;
|
||||
/**
|
||||
* @brief Get the current dimention in Foot
|
||||
* @return dimention in Foot
|
||||
*/
|
||||
vec2 GetFoot(void);
|
||||
|
||||
vec2 GetFoot(void) const;
|
||||
/*****************************************************
|
||||
* = assigment
|
||||
*****************************************************/
|
||||
const Dimension& operator= (const Dimension& obj ) {
|
||||
m_data = obj.m_data;
|
||||
m_type = obj.m_type;
|
||||
return *this;
|
||||
}
|
||||
/**
|
||||
* @breif get the dimension type
|
||||
* @return the type
|
||||
*/
|
||||
ewol::Dimension::distance_te GetType(void) const { return m_type; };
|
||||
/**
|
||||
* @get the descriptive string
|
||||
* @return string describe the dimention
|
||||
*/
|
||||
etk::UString GetString(void);
|
||||
/**
|
||||
* @brief Set the descriptive string in this dimention
|
||||
* @param[in] value String describe the dimention
|
||||
*/
|
||||
void SetString(const etk::UString& value);
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout &os, const ewol::Dimension::distance_te& obj);
|
||||
etk::CCout& operator <<(etk::CCout &os, const ewol::Dimension& obj);
|
||||
|
||||
namespace dimension
|
||||
{
|
||||
|
@ -124,6 +124,20 @@ namespace ewol {
|
||||
* @param[in] data Data registered by this class
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data) { };
|
||||
|
||||
protected:
|
||||
etk::UString m_name; //!< name of the element ...
|
||||
public:
|
||||
/**
|
||||
* @brief Get the eObject name
|
||||
* @return The requested name
|
||||
*/
|
||||
const etk::UString& GetName(void) { return m_name; };
|
||||
/**
|
||||
* @brief Get the Widget name
|
||||
* @param[in] name The new name
|
||||
*/
|
||||
void SetName(const etk::UString& name) { m_name=name; };
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -138,11 +138,11 @@ void widget::Button::CalculateSize(const vec2& availlable)
|
||||
|
||||
vec2 minimumSizeBase(0,0);
|
||||
vec2 minimumSizeToggle(0,0);
|
||||
// Checking the expend properties :
|
||||
if (m_userExpend.x() == true) {
|
||||
// Checking the expand properties :
|
||||
if (m_userExpand.x() == true) {
|
||||
m_size.setX(availlable.x());
|
||||
}
|
||||
if (m_userExpend.y() == true) {
|
||||
if (m_userExpand.y() == true) {
|
||||
m_size.setY(availlable.y());
|
||||
}
|
||||
// Checkin the filling properties ==> for the subElements:
|
||||
@ -170,18 +170,18 @@ void widget::Button::CalculateSize(const vec2& availlable)
|
||||
}
|
||||
|
||||
|
||||
void widget::Button::CalculateMinSize(void)
|
||||
void widget::Button::CalculateMinMaxSize(void)
|
||||
{
|
||||
vec2 padding = m_shaper.GetPadding();
|
||||
vec2 minimumSizeBase(0,0);
|
||||
vec2 minimumSizeToggle(0,0);
|
||||
if (NULL!=m_subWidget[0]) {
|
||||
m_subWidget[0]->CalculateMinSize();
|
||||
minimumSizeBase = m_subWidget[0]->GetMinSize();
|
||||
m_subWidget[0]->CalculateMinMaxSize();
|
||||
minimumSizeBase = m_subWidget[0]->GetCalculateMinSize();
|
||||
}
|
||||
if (NULL!=m_subWidget[1]) {
|
||||
m_subWidget[1]->CalculateMinSize();
|
||||
minimumSizeToggle = m_subWidget[1]->GetMinSize();
|
||||
m_subWidget[1]->CalculateMinMaxSize();
|
||||
minimumSizeToggle = m_subWidget[1]->GetCalculateMinSize();
|
||||
}
|
||||
// get the maxixmum min size of the 2 sub-widget (if they are present indeed):
|
||||
m_minSize.setX(etk_max(minimumSizeBase.x(), minimumSizeToggle.x()) );
|
||||
@ -259,7 +259,7 @@ void widget::Button::SetToggleMode(bool togg)
|
||||
}
|
||||
}
|
||||
|
||||
bool widget::Button::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::Button::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
bool previousHoverState = m_mouseHover;
|
||||
if( ewol::keyEvent::statusLeave == typeEvent
|
||||
|
@ -110,11 +110,11 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "widget::Button"; };
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData);
|
||||
private:
|
||||
// derived function
|
||||
|
@ -71,7 +71,7 @@ void widget::ButtonColor::SetShaperName(etk::UString shaperName)
|
||||
}
|
||||
|
||||
|
||||
void widget::ButtonColor::CalculateMinSize(void)
|
||||
void widget::ButtonColor::CalculateMinMaxSize(void)
|
||||
{
|
||||
vec2 padding = m_shaper.GetPadding();
|
||||
etk::UString label = draw::GetString(m_textColorFg);
|
||||
@ -154,7 +154,7 @@ void widget::ButtonColor::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
bool widget::ButtonColor::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::ButtonColor::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
bool previousHoverState = m_mouseHover;
|
||||
if(ewol::keyEvent::statusLeave == typeEvent) {
|
||||
|
@ -63,11 +63,11 @@ namespace widget {
|
||||
void SetValue(draw::Color color);
|
||||
public:
|
||||
// Derived function
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual const char * const GetObjectType(void) { return "widget::ButtonColor"; };
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data);
|
||||
private:
|
||||
/**
|
||||
|
@ -49,7 +49,7 @@ widget::CheckBox::~CheckBox(void)
|
||||
}
|
||||
|
||||
|
||||
void widget::CheckBox::CalculateMinSize(void)
|
||||
void widget::CheckBox::CalculateMinMaxSize(void)
|
||||
{
|
||||
vec3 minSize = m_oObjectText.CalculateSize(m_label);
|
||||
float boxSize = etk_max(20, minSize.y()) + 5;
|
||||
@ -115,7 +115,7 @@ void widget::CheckBox::OnRegenerateDisplay(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool widget::CheckBox::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::CheckBox::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
//EWOL_DEBUG("Event on checkbox ...");
|
||||
if (1 == IdInput) {
|
||||
|
@ -39,10 +39,10 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "Ewol::CheckBox"; };
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData);
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,7 @@ widget::ColorBar::~ColorBar(void)
|
||||
}
|
||||
|
||||
|
||||
void widget::ColorBar::CalculateMinSize(void)
|
||||
void widget::ColorBar::CalculateMinMaxSize(void)
|
||||
{
|
||||
m_minSize.setValue(160, 80);
|
||||
MarkToRedraw();
|
||||
@ -170,7 +170,7 @@ void widget::ColorBar::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
bool widget::ColorBar::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::ColorBar::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
vec2 relativePos = RelativePosition(pos);
|
||||
//EWOL_DEBUG("Event on BT ...");
|
||||
|
@ -32,10 +32,10 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "widget::ColorBar"; };
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -168,10 +168,10 @@ void widget::Composer::CalculateSize(const vec2& availlable)
|
||||
m_hide = m_subWidget->IsHide();
|
||||
}
|
||||
}
|
||||
void widget::Composer::CalculateMinSize(void)
|
||||
void widget::Composer::CalculateMinMaxSize(void)
|
||||
{
|
||||
if (NULL!=m_subWidget) {
|
||||
m_subWidget->CalculateMinSize();
|
||||
m_subWidget->CalculateMinMaxSize();
|
||||
// copy all sub parameters :
|
||||
m_hide = m_subWidget->IsHide();
|
||||
m_userFill = m_subWidget->CanFill();
|
||||
|
@ -81,7 +81,7 @@ namespace widget
|
||||
public:// Derived function
|
||||
virtual void OnObjectRemove(ewol::EObject* removeObject);
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
// TODO : Call all sub element getter an setter ==> this object might be transparent ...
|
||||
};
|
||||
};
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
widget::ContextMenu::ContextMenu(void)
|
||||
{
|
||||
m_userExpend.setValue(true,true);
|
||||
m_userExpand.setValue(true,true);
|
||||
|
||||
m_padding.setValue(4,4);
|
||||
m_offset = 20;
|
||||
@ -46,7 +46,7 @@ void widget::ContextMenu::CalculateSize(const vec2& availlable)
|
||||
if (NULL != m_subWidget) {
|
||||
vec2 subWidgetSize;
|
||||
vec2 subWidgetOrigin;
|
||||
subWidgetSize = m_subWidget->GetMinSize();
|
||||
subWidgetSize = m_subWidget->GetCalculateMinSize();
|
||||
if (true == m_subWidget->CanExpand().x()) {
|
||||
subWidgetSize.setX(m_size.x());
|
||||
}
|
||||
@ -105,14 +105,14 @@ void widget::ContextMenu::CalculateSize(const vec2& availlable)
|
||||
}
|
||||
|
||||
|
||||
void widget::ContextMenu::CalculateMinSize(void)
|
||||
void widget::ContextMenu::CalculateMinMaxSize(void)
|
||||
{
|
||||
EWOL_DEBUG("CalculateMinSize");
|
||||
m_userExpend.setValue(false,false);
|
||||
m_userExpand.setValue(false,false);
|
||||
m_minSize.setValue(50,50);
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->CalculateMinSize();
|
||||
m_minSize = m_subWidget->GetMinSize();
|
||||
m_subWidget->CalculateMinMaxSize();
|
||||
m_minSize = m_subWidget->GetCalculateMinSize();
|
||||
}
|
||||
EWOL_DEBUG("CalculateMinSize=>>" << m_minSize);
|
||||
MarkToRedraw();
|
||||
@ -123,9 +123,9 @@ void widget::ContextMenu::SetMinSize(const vec2& size)
|
||||
EWOL_ERROR("Pop-up can not have a user Minimum size (herited from under elements)");
|
||||
}
|
||||
|
||||
void widget::ContextMenu::SetExpand(const bvec2& newExpend)
|
||||
void widget::ContextMenu::SetExpand(const bvec2& newExpand)
|
||||
{
|
||||
EWOL_ERROR("Pop-up can not have a user expend settings X (herited from under elements)");
|
||||
EWOL_ERROR("Pop-up can not have a user expand settings X (herited from under elements)");
|
||||
}
|
||||
|
||||
|
||||
@ -226,7 +226,7 @@ void widget::ContextMenu::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
ewol::Widget * widget::ContextMenu::GetWidgetAtPos(vec2 pos)
|
||||
ewol::Widget * widget::ContextMenu::GetWidgetAtPos(const vec2& pos)
|
||||
{
|
||||
// calculate relative position
|
||||
vec2 relativePos = RelativePosition(pos);
|
||||
@ -244,7 +244,7 @@ ewol::Widget * widget::ContextMenu::GetWidgetAtPos(vec2 pos)
|
||||
}
|
||||
|
||||
|
||||
bool widget::ContextMenu::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::ContextMenu::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
//EWOL_INFO("Event ouside the context menu");
|
||||
if (IdInput > 0) {
|
||||
|
@ -32,7 +32,7 @@ namespace widget {
|
||||
virtual const char * const GetObjectType(void) { return "EwolContextMenu"; };
|
||||
public:
|
||||
virtual void CalculateSize(const vec2& availlable); // this generate the current size ...
|
||||
virtual void CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
|
||||
virtual void CalculateMinMaxSize(void); //update the min Size ... and the expend parameters for the sizer
|
||||
virtual void SetMinSize(const vec2& size);
|
||||
virtual void SetExpand(const bvec2& newExpend);
|
||||
private:
|
||||
@ -53,8 +53,8 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual ewol::Widget* GetWidgetAtPos(vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual ewol::Widget* GetWidgetAtPos(const vec2& pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -81,7 +81,7 @@ widget::Entry::~Entry(void)
|
||||
}
|
||||
|
||||
|
||||
void widget::Entry::CalculateMinSize(void)
|
||||
void widget::Entry::CalculateMinMaxSize(void)
|
||||
{
|
||||
vec2 padding = m_shaper.GetPadding();
|
||||
|
||||
@ -168,7 +168,7 @@ void widget::Entry::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
void widget::Entry::UpdateCursorPosition(vec2& pos, bool selection)
|
||||
void widget::Entry::UpdateCursorPosition(const vec2& pos, bool selection)
|
||||
{
|
||||
vec2 padding = m_shaper.GetPadding();
|
||||
|
||||
@ -244,7 +244,7 @@ void widget::Entry::CopySelectionToClipBoard(ewol::clipBoard::clipboardListe_te
|
||||
}
|
||||
|
||||
|
||||
bool widget::Entry::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::Entry::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
//EWOL_DEBUG("Event on Entry ... type=" << (int32_t)type << " id=" << IdInput);
|
||||
if (1 == IdInput) {
|
||||
|
@ -66,13 +66,13 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData);
|
||||
virtual bool OnEventKbMove(ewol::keyEvent::status_te typeEvent, ewol::keyEvent::keyboard_te moveTypeEvent);
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data);
|
||||
virtual void OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID);
|
||||
virtual const char * const GetObjectType(void) { return "EwolEntry"; };
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
protected:
|
||||
// Derived function
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
@ -82,7 +82,7 @@ namespace widget {
|
||||
* @note The display is automaticly requested when change apear.
|
||||
* @return ---
|
||||
*/
|
||||
virtual void UpdateCursorPosition(vec2& pos, bool Selection=false);
|
||||
virtual void UpdateCursorPosition(const vec2& pos, bool Selection=false);
|
||||
/**
|
||||
* @brief Update the display position start ==> depending of the position of the Cursor and the size of the Data inside
|
||||
* @param ---
|
||||
|
@ -101,7 +101,7 @@ void widget::Gird::CalculateSize(const vec2& availlable)
|
||||
MarkToRedraw();
|
||||
}
|
||||
|
||||
void widget::Gird::CalculateMinSize(void)
|
||||
void widget::Gird::CalculateMinMaxSize(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_sizeCol.Size(); iii++ ){
|
||||
if (m_sizeCol[iii] <= 0) {
|
||||
@ -109,13 +109,8 @@ void widget::Gird::CalculateMinSize(void)
|
||||
}
|
||||
}
|
||||
//EWOL_DEBUG("Update minimum Size");
|
||||
m_minSize.setValue(0,0);
|
||||
if (m_userMinSize.x()>0) {
|
||||
m_minSize.setX(m_userMinSize.x());
|
||||
}
|
||||
if (m_userMinSize.y()>0) {
|
||||
m_minSize.setY(m_userMinSize.y());
|
||||
}
|
||||
m_minSize = m_userMinSize.GetPixel();
|
||||
m_maxSize = m_userMaxSize.GetPixel();
|
||||
m_uniformSizeRow = 0;
|
||||
m_minSize += m_borderSize*2;
|
||||
int32_t lastLineID = 0;
|
||||
@ -125,8 +120,8 @@ void widget::Gird::CalculateMinSize(void)
|
||||
lastLineID = m_subWidget[iii].row;
|
||||
}
|
||||
if (NULL != m_subWidget[iii].widget) {
|
||||
m_subWidget[iii].widget->CalculateMinSize();
|
||||
vec2 tmpSize = m_subWidget[iii].widget->GetMinSize();
|
||||
m_subWidget[iii].widget->CalculateMinMaxSize();
|
||||
vec2 tmpSize = m_subWidget[iii].widget->GetCalculateMinSize();
|
||||
EWOL_DEBUG(" [" << iii << "] subWidgetMinSize=" << tmpSize);
|
||||
// for all we get the max Size :
|
||||
m_uniformSizeRow = etk_max(tmpSize.y(), m_uniformSizeRow);
|
||||
@ -150,7 +145,7 @@ void widget::Gird::CalculateMinSize(void)
|
||||
|
||||
EWOL_DEBUG("Calculate min size : " << m_minSize);
|
||||
|
||||
//EWOL_DEBUG("Vert Result : expend="<< m_userExpend << " minSize="<< m_minSize);
|
||||
//EWOL_DEBUG("Vert Result : expand="<< m_userExpand << " minSize="<< m_minSize);
|
||||
}
|
||||
|
||||
void widget::Gird::SetColNumber(int32_t colNumber)
|
||||
@ -385,7 +380,7 @@ void widget::Gird::OnRegenerateDisplay(void)
|
||||
}
|
||||
}
|
||||
|
||||
ewol::Widget * widget::Gird::GetWidgetAtPos(vec2 pos)
|
||||
ewol::Widget * widget::Gird::GetWidgetAtPos(const vec2& pos)
|
||||
{
|
||||
if (true == IsHide()) {
|
||||
return NULL;
|
||||
|
@ -136,11 +136,11 @@ namespace widget {
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
public: // Derived function
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual ewol::Widget* GetWidgetAtPos(vec2 pos);
|
||||
virtual ewol::Widget* GetWidgetAtPos(const vec2& pos);
|
||||
virtual void OnObjectRemove(ewol::EObject* removeObject);
|
||||
virtual const char * const GetObjectType(void) { return "Ewol::Sizer"; };
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -66,7 +66,7 @@ void widget::Image::SetPadding(vec2 newPadding)
|
||||
m_padding = newPadding;
|
||||
}
|
||||
|
||||
void widget::Image::CalculateMinSize(void)
|
||||
void widget::Image::CalculateMinMaxSize(void)
|
||||
{
|
||||
m_minSize.setValue(m_padding.x()*2 + m_imageSize,
|
||||
m_padding.y()*2 + m_imageSize );
|
||||
@ -126,7 +126,7 @@ void widget::Image::OnRegenerateDisplay(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool widget::Image::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::Image::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
//EWOL_DEBUG("Event on BT ...");
|
||||
if (1 == IdInput) {
|
||||
|
@ -35,9 +35,9 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "Ewol::Image"; };
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -118,7 +118,7 @@ Sine Function: sin(teta) = Opposite / Hypotenuse
|
||||
Cosine Function: cos(teta) = Adjacent / Hypotenuse
|
||||
Tangent Function: tan(teta) = Opposite / Adjacent
|
||||
*/
|
||||
bool widget::Joystick::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::Joystick::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
/*
|
||||
if (1 == IdInput) {
|
||||
|
@ -46,7 +46,7 @@ namespace widget {
|
||||
virtual const char * const GetObjectType(void) { return "Ewol::Joystick"; };
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
|
||||
void SetLockMode(bool lockWhenOut) { m_lock = lockWhenOut; };
|
||||
void SetDisplayMode(joystickMode_te newMode) { m_displayMode = newMode; };
|
||||
|
@ -48,22 +48,16 @@ widget::Label::~Label(void)
|
||||
|
||||
}
|
||||
|
||||
void widget::Label::CalculateMinSize(void)
|
||||
void widget::Label::CalculateMinMaxSize(void)
|
||||
{
|
||||
if (m_userMaxSize.x() != -1) {
|
||||
m_text.SetTextAlignement(0, m_userMaxSize.x()-4, ewol::Text::alignLeft);
|
||||
vec2 tmpMax = m_userMaxSize.GetPixel();
|
||||
if (tmpMax.x() <= 999999) {
|
||||
m_text.SetTextAlignement(0, tmpMax.x()-4, ewol::Text::alignLeft);
|
||||
}
|
||||
vec3 minSize = m_text.CalculateSizeDecorated(m_label);
|
||||
if (m_userMaxSize.x()!=-1) {
|
||||
m_minSize.setX(etk_min(4 + minSize.x(), m_userMaxSize.x()));
|
||||
} else {
|
||||
m_minSize.setX(4 + minSize.x());
|
||||
}
|
||||
if (m_userMaxSize.y()!=-1) {
|
||||
m_minSize.setY(etk_min(4 + minSize.y(), m_userMaxSize.y()));
|
||||
} else {
|
||||
m_minSize.setY(4 + minSize.y());
|
||||
}
|
||||
|
||||
m_minSize.setX(etk_min(4 + minSize.x(), tmpMax.x()));
|
||||
m_minSize.setY(etk_min(4 + minSize.y(), tmpMax.y()));
|
||||
}
|
||||
|
||||
|
||||
@ -93,11 +87,11 @@ void widget::Label::OnRegenerateDisplay(void)
|
||||
m_text.Clear();
|
||||
int32_t paddingSize = 2;
|
||||
|
||||
|
||||
vec2 tmpMax = m_userMaxSize.GetPixel();
|
||||
// to know the size of one Line :
|
||||
vec3 minSize = m_text.CalculateSize('A');
|
||||
if (m_userMaxSize.x() != -1) {
|
||||
m_text.SetTextAlignement(0, m_userMaxSize.x()-2*paddingSize, ewol::Text::alignLeft);
|
||||
if (tmpMax.x() <= 999999) {
|
||||
m_text.SetTextAlignement(0, tmpMax.x()-2*paddingSize, ewol::Text::alignLeft);
|
||||
}
|
||||
vec3 curentTextSize = m_text.CalculateSizeDecorated(m_label);
|
||||
|
||||
@ -137,7 +131,7 @@ void widget::Label::OnRegenerateDisplay(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool widget::Label::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::Label::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
//EWOL_DEBUG("Event on Label ...");
|
||||
if (1 == IdInput) {
|
||||
|
@ -48,10 +48,10 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "Ewol::Label"; };
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
virtual bool LoadXML(TiXmlNode* node);
|
||||
};
|
||||
|
||||
|
@ -32,7 +32,7 @@ void widget::Layer::UnInit(void)
|
||||
widget::Layer::Layer(void)
|
||||
{
|
||||
// set contamination enable
|
||||
LockExpendContamination();
|
||||
LockExpandContamination();
|
||||
}
|
||||
|
||||
widget::Layer::~Layer(void)
|
||||
@ -56,20 +56,20 @@ void widget::Layer::CalculateSize(const vec2& availlable)
|
||||
}
|
||||
|
||||
|
||||
void widget::Layer::CalculateMinSize(void)
|
||||
void widget::Layer::CalculateMinMaxSize(void)
|
||||
{
|
||||
m_userExpend.setValue(false, false);
|
||||
m_userExpand.setValue(false, false);
|
||||
m_minSize.setValue(0,0);
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->CalculateMinSize();
|
||||
m_subWidget[iii]->CalculateMinMaxSize();
|
||||
if (true == m_subWidget[iii]->CanExpand().x()) {
|
||||
m_userExpend.setX(true);
|
||||
m_userExpand.setX(true);
|
||||
}
|
||||
if (true == m_subWidget[iii]->CanExpand().y()) {
|
||||
m_userExpend.setY(true);
|
||||
m_userExpand.setY(true);
|
||||
}
|
||||
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
|
||||
m_minSize.setValue( etk_max(tmpSize.x(), m_minSize.x()),
|
||||
etk_max(tmpSize.y(), m_minSize.y()) );
|
||||
}
|
||||
@ -84,15 +84,15 @@ void widget::Layer::SetMinSize(const vec2& size)
|
||||
|
||||
bvec2 widget::Layer::CanExpand(void)
|
||||
{
|
||||
if (true == m_lockExpendContamination) {
|
||||
if (true == m_lockExpandContamination) {
|
||||
return bvec2(false,false);
|
||||
}
|
||||
return m_userExpend;
|
||||
return m_userExpand;
|
||||
}
|
||||
|
||||
void widget::Layer::LockExpendContamination(bool lockExpend)
|
||||
void widget::Layer::LockExpandContamination(bool lockExpand)
|
||||
{
|
||||
m_lockExpendContamination = lockExpend;
|
||||
m_lockExpandContamination = lockExpand;
|
||||
}
|
||||
|
||||
//etk::Vector<ewol::Widget*> m_SubWidget;
|
||||
@ -175,7 +175,7 @@ void widget::Layer::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
ewol::Widget * widget::Layer::GetWidgetAtPos(vec2 pos)
|
||||
ewol::Widget * widget::Layer::GetWidgetAtPos(const vec2& pos)
|
||||
{
|
||||
// for all element in the sizer ...
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
|
@ -22,9 +22,9 @@ namespace widget {
|
||||
public:
|
||||
Layer(void);
|
||||
virtual ~Layer(void);
|
||||
void LockExpendContamination(bool lockExpend=false);
|
||||
void LockExpandContamination(bool lockExpend=false);
|
||||
private:
|
||||
bool m_lockExpendContamination;
|
||||
bool m_lockExpandContamination;
|
||||
etk::Vector<ewol::Widget*> m_subWidget;
|
||||
public:
|
||||
virtual void SubWidgetRemoveAll(void);
|
||||
@ -38,10 +38,10 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
|
||||
virtual ewol::Widget * GetWidgetAtPos(const vec2& pos);
|
||||
virtual void OnObjectRemove(ewol::EObject * removeObject);
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual void SetMinSize(const vec2& size);
|
||||
virtual bvec2 CanExpand(void);
|
||||
virtual const char * const GetObjectType(void) { return "EwolLayer"; };
|
||||
|
@ -43,7 +43,7 @@ widget::List::~List(void)
|
||||
}
|
||||
|
||||
|
||||
void widget::List::CalculateMinSize(void)
|
||||
void widget::List::CalculateMinMaxSize(void)
|
||||
{
|
||||
/*int32_t fontId = GetDefaultFontId();
|
||||
int32_t minWidth = ewol::GetWidth(fontId, m_label);
|
||||
@ -200,7 +200,7 @@ void widget::List::OnRegenerateDisplay(void)
|
||||
}
|
||||
}
|
||||
|
||||
bool widget::List::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::List::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
vec2 relativePos = RelativePosition(pos);
|
||||
|
||||
|
@ -24,7 +24,7 @@ namespace widget {
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "ewol::List"; };
|
||||
virtual ~List(void);
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
void SetLabel(etk::UString newLabel);
|
||||
// Drawing capabilities ....
|
||||
private:
|
||||
@ -46,7 +46,7 @@ namespace widget {
|
||||
// Derived function
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
// Derived function
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
protected:
|
||||
// function call to display the list :
|
||||
virtual draw::Color GetBasicBG(void) {
|
||||
|
@ -164,7 +164,7 @@ void widget::Menu::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
|
||||
widget::Button * myButton = NULL;
|
||||
|
||||
mySizer = new widget::Sizer(widget::Sizer::modeVert);
|
||||
mySizer->LockExpendContamination(vec2(true,true));
|
||||
mySizer->LockExpandContamination(vec2(true,true));
|
||||
// set it in the pop-up-system :
|
||||
m_widgetContextMenu->SubWidgetSet(mySizer);
|
||||
|
||||
@ -180,7 +180,7 @@ void widget::Menu::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
|
||||
// set the image if one is present ...
|
||||
myButton->SetImage(m_listElement[jjj]->m_image);
|
||||
myButton->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventButtonPressed);
|
||||
myButton->SetExpendX(true);
|
||||
myButton->SetExpandX(true);
|
||||
myButton->SetFillX(true);
|
||||
// add it in the widget list
|
||||
mySizer->SubWidgetAdd(myButton);
|
||||
|
@ -102,7 +102,7 @@ void widget::Mesh::PeriodicCall(int64_t localTime)
|
||||
m_lastTime = localTime;
|
||||
}
|
||||
|
||||
bool widget::Mesh::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::Mesh::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
//EWOL_DEBUG("Event on BT ...");
|
||||
if (1 == IdInput) {
|
||||
|
@ -37,7 +37,7 @@ namespace widget {
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual void GenDraw(ewol::DrawProperty displayProp);
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
virtual void PeriodicCall(int64_t localTime);
|
||||
public:
|
||||
/**
|
||||
|
@ -16,7 +16,7 @@
|
||||
widget::PopUp::PopUp(void) :
|
||||
m_subWidgetNext(NULL)
|
||||
{
|
||||
m_userExpend.setValue(true, true);
|
||||
m_userExpand.setValue(true, true);
|
||||
|
||||
m_colorBackGroung = draw::color::white;
|
||||
|
||||
@ -44,7 +44,7 @@ void widget::PopUp::CalculateSize(const vec2& availlable)
|
||||
if (NULL != m_subWidget) {
|
||||
vec2 subWidgetSize;
|
||||
vec2 subWidgetOrigin;
|
||||
subWidgetSize = m_subWidget->GetMinSize();
|
||||
subWidgetSize = m_subWidget->GetCalculateMinSize();
|
||||
if (true == m_subWidget->CanExpand().x()) {
|
||||
subWidgetSize.setX(m_size.x());
|
||||
}
|
||||
@ -68,14 +68,14 @@ void widget::PopUp::CalculateSize(const vec2& availlable)
|
||||
}
|
||||
|
||||
|
||||
void widget::PopUp::CalculateMinSize(void)
|
||||
void widget::PopUp::CalculateMinMaxSize(void)
|
||||
{
|
||||
//EWOL_DEBUG("CalculateMinSize");
|
||||
m_userExpend.setValue(false,false);
|
||||
//EWOL_DEBUG("CalculateMinMaxSize");
|
||||
m_userExpand.setValue(false,false);
|
||||
m_minSize.setValue(50, 50);
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->CalculateMinSize();
|
||||
vec2 tmpSize = m_subWidget->GetMinSize();
|
||||
m_subWidget->CalculateMinMaxSize();
|
||||
vec2 tmpSize = m_subWidget->GetCalculateMinSize();
|
||||
m_minSize = tmpSize;
|
||||
}
|
||||
//EWOL_DEBUG("CalculateMinSize(" << m_minSize.x << "," << m_minSize.y << ")");
|
||||
@ -87,9 +87,9 @@ void widget::PopUp::SetMinSize(const vec2& size)
|
||||
EWOL_ERROR("Pop-up can not have a user Minimum size (herited from under elements)");
|
||||
}
|
||||
|
||||
void widget::PopUp::SetExpand(const bvec2& newExpend)
|
||||
void widget::PopUp::SetExpand(const bvec2& newExpand)
|
||||
{
|
||||
EWOL_ERROR("Pop-up can not have a user expend settings X (herited from under elements)");
|
||||
EWOL_ERROR("Pop-up can not have a user expand settings X (herited from under elements)");
|
||||
}
|
||||
|
||||
void widget::PopUp::SubWidgetSet(ewol::Widget* newWidget)
|
||||
@ -154,7 +154,7 @@ void widget::PopUp::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
ewol::Widget * widget::PopUp::GetWidgetAtPos(vec2 pos)
|
||||
ewol::Widget * widget::PopUp::GetWidgetAtPos(const vec2& pos)
|
||||
{
|
||||
// calculate relative position
|
||||
vec2 relativePos = RelativePosition(pos);
|
||||
|
@ -26,7 +26,7 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual void SetMinSize(const vec2& size);
|
||||
virtual void SetExpand(const bvec2& newExpend);
|
||||
void SetDisplayRatio(float ratio);
|
||||
@ -47,7 +47,7 @@ namespace widget {
|
||||
// Derived function
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
// Derived function
|
||||
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
|
||||
virtual ewol::Widget * GetWidgetAtPos(const vec2& pos);
|
||||
// Derived function
|
||||
virtual void OnObjectRemove(ewol::EObject * removeObject);
|
||||
};
|
||||
|
@ -51,10 +51,11 @@ widget::ProgressBar::~ProgressBar(void)
|
||||
}
|
||||
|
||||
|
||||
void widget::ProgressBar::CalculateMinSize(void)
|
||||
void widget::ProgressBar::CalculateMinMaxSize(void)
|
||||
{
|
||||
m_minSize.setValue( etk_max(m_userMinSize.x(), 40),
|
||||
etk_max(m_userMinSize.y(), dotRadius*2) );
|
||||
vec2 tmpMin = m_userMinSize.GetPixel();
|
||||
m_minSize.setValue( etk_max(tmpMin.x(), 40),
|
||||
etk_max(tmpMin.y(), dotRadius*2) );
|
||||
MarkToRedraw();
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace widget {
|
||||
virtual ~ProgressBar(void);
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "EwolProgressBar"; };
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
void ValueSet(float val);
|
||||
float ValueGet(void);
|
||||
void SetColor(draw::Color newColor) { m_textColorFg = newColor; };
|
||||
|
@ -1131,7 +1131,7 @@ vec2 widget::Scene::RelativePosition(vec2 pos)
|
||||
};
|
||||
|
||||
|
||||
bool widget::Scene::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te statusEvent, vec2 pos)
|
||||
bool widget::Scene::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te statusEvent, const vec2& pos)
|
||||
{
|
||||
//EWOL_DEBUG("type : " << type << " IdInput=" << IdInput << " " << "status=" << statusEvent << " RelPos=" << relativePos);
|
||||
|
||||
@ -1143,10 +1143,10 @@ bool widget::Scene::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput,
|
||||
}
|
||||
if (true == GetGrabStatus() ) {
|
||||
if (ewol::keyEvent::statusMove == statusEvent) {
|
||||
pos *= M_PI/(360.0f*6);
|
||||
vec2 tmpPos = pos * M_PI/(360.0f*6);
|
||||
vec3 oldAngles = m_camera.GetAngle();
|
||||
oldAngles.setZ(oldAngles.z() + pos.x());
|
||||
oldAngles.setY(oldAngles.y() + pos.y());
|
||||
oldAngles.setZ(oldAngles.z() + tmpPos.x());
|
||||
oldAngles.setY(oldAngles.y() + tmpPos.y());
|
||||
m_camera.SetAngle(oldAngles);
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ namespace widget {
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
|
||||
// Derived function
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te statusEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te statusEvent, const vec2& pos);
|
||||
// Derived function
|
||||
virtual bool OnEventKb(ewol::keyEvent::status_te statusEvent, uniChar_t unicodeData);
|
||||
// Derived function
|
||||
|
@ -32,7 +32,7 @@ void widget::Sizer::UnInit(void)
|
||||
|
||||
widget::Sizer::Sizer(widget::Sizer::displayMode_te mode):
|
||||
m_mode(mode),
|
||||
m_lockExpendContamination(false,false),
|
||||
m_lockExpandContamination(false,false),
|
||||
m_borderSize(0,0)
|
||||
{
|
||||
|
||||
@ -77,22 +77,22 @@ void widget::Sizer::CalculateSize(const vec2& availlable)
|
||||
//EWOL_DEBUG("Update Size");
|
||||
m_size = availlable;
|
||||
m_size -= m_borderSize*2;
|
||||
// calculate unExpendable Size :
|
||||
float unexpendableSize=0.0;
|
||||
// calculate unExpandable Size :
|
||||
float unexpandableSize=0.0;
|
||||
int32_t nbWidgetFixedSize=0;
|
||||
int32_t nbWidgetNotFixedSize=0;
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
|
||||
if (m_mode==widget::Sizer::modeVert) {
|
||||
unexpendableSize += tmpSize.y();
|
||||
unexpandableSize += tmpSize.y();
|
||||
if (false == m_subWidget[iii]->CanExpand().y()) {
|
||||
nbWidgetFixedSize++;
|
||||
} else {
|
||||
nbWidgetNotFixedSize++;
|
||||
}
|
||||
} else {
|
||||
unexpendableSize += tmpSize.x();
|
||||
unexpandableSize += tmpSize.x();
|
||||
if (false == m_subWidget[iii]->CanExpand().x()) {
|
||||
nbWidgetFixedSize++;
|
||||
} else {
|
||||
@ -101,14 +101,14 @@ void widget::Sizer::CalculateSize(const vec2& availlable)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 2 cases : 1 or more can Expend, or all is done ...
|
||||
// 2 cases : 1 or more can Expand, or all is done ...
|
||||
float sizeToAddAtEveryOne = 0;
|
||||
// 2 cases : 1 or more can Expend, or all is done ...
|
||||
// 2 cases : 1 or more can Expand, or all is done ...
|
||||
if (0 != nbWidgetNotFixedSize) {
|
||||
if (m_mode==widget::Sizer::modeVert) {
|
||||
sizeToAddAtEveryOne = (m_size.y() - unexpendableSize) / nbWidgetNotFixedSize;
|
||||
sizeToAddAtEveryOne = (m_size.y() - unexpandableSize) / nbWidgetNotFixedSize;
|
||||
} else {
|
||||
sizeToAddAtEveryOne = (m_size.x() - unexpendableSize) / nbWidgetNotFixedSize;
|
||||
sizeToAddAtEveryOne = (m_size.x() - unexpandableSize) / nbWidgetNotFixedSize;
|
||||
}
|
||||
if (sizeToAddAtEveryOne<0.0) {
|
||||
sizeToAddAtEveryOne=0;
|
||||
@ -117,7 +117,7 @@ void widget::Sizer::CalculateSize(const vec2& availlable)
|
||||
vec2 tmpOrigin = m_origin + m_borderSize;
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
|
||||
// Set the origin :
|
||||
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
|
||||
m_subWidget[iii]->SetOrigin(tmpOrigin);
|
||||
@ -146,28 +146,23 @@ void widget::Sizer::CalculateSize(const vec2& availlable)
|
||||
}
|
||||
|
||||
|
||||
void widget::Sizer::CalculateMinSize(void)
|
||||
void widget::Sizer::CalculateMinMaxSize(void)
|
||||
{
|
||||
//EWOL_DEBUG("Update minimum Size");
|
||||
m_userExpend.setValue(false, false);
|
||||
m_minSize.setValue(0,0);
|
||||
if (m_userMinSize.x()>0) {
|
||||
m_minSize.setX(m_userMinSize.x());
|
||||
}
|
||||
if (m_userMinSize.y()>0) {
|
||||
m_minSize.setY(m_userMinSize.y());
|
||||
}
|
||||
m_userExpand.setValue(false, false);
|
||||
m_minSize = m_userMinSize.GetPixel();
|
||||
|
||||
m_minSize += m_borderSize*2;
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->CalculateMinSize();
|
||||
m_subWidget[iii]->CalculateMinMaxSize();
|
||||
if (true == m_subWidget[iii]->CanExpand().x()) {
|
||||
m_userExpend.setX(true);
|
||||
m_userExpand.setX(true);
|
||||
}
|
||||
if (true == m_subWidget[iii]->CanExpand().y()) {
|
||||
m_userExpend.setY(true);
|
||||
m_userExpand.setY(true);
|
||||
}
|
||||
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
|
||||
//EWOL_DEBUG("VERT : NewMinSize=" << tmpSize);
|
||||
//EWOL_DEBUG(" Get minSize[" << iii << "] "<< tmpSize);
|
||||
if (m_mode==widget::Sizer::modeVert) {
|
||||
@ -192,24 +187,24 @@ void widget::Sizer::SetMinSize(const vec2& size)
|
||||
|
||||
void widget::Sizer::SetExpand(const bvec2& newExpand)
|
||||
{
|
||||
EWOL_ERROR("[" << GetId() << "] Sizer can not have a user expend settings (herited from under elements)");
|
||||
EWOL_ERROR("[" << GetId() << "] Sizer can not have a user expand settings (herited from under elements)");
|
||||
}
|
||||
|
||||
bvec2 widget::Sizer::CanExpand(void)
|
||||
{
|
||||
bvec2 res = m_userExpend;
|
||||
if (true == m_lockExpendContamination.x()) {
|
||||
bvec2 res = m_userExpand;
|
||||
if (true == m_lockExpandContamination.x()) {
|
||||
res.setX(false);
|
||||
}
|
||||
if (true == m_lockExpendContamination.y()) {
|
||||
if (true == m_lockExpandContamination.y()) {
|
||||
res.setY(false);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
void widget::Sizer::LockExpendContamination(const bvec2& lockExpend)
|
||||
void widget::Sizer::LockExpandContamination(const bvec2& lockExpand)
|
||||
{
|
||||
m_lockExpendContamination = lockExpend;
|
||||
m_lockExpandContamination = lockExpand;
|
||||
}
|
||||
|
||||
void widget::Sizer::SubWidgetRemoveAll(void)
|
||||
@ -307,7 +302,7 @@ void widget::Sizer::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
ewol::Widget * widget::Sizer::GetWidgetAtPos(vec2 pos)
|
||||
ewol::Widget * widget::Sizer::GetWidgetAtPos(const vec2& pos)
|
||||
{
|
||||
if (true == IsHide()) {
|
||||
return NULL;
|
||||
|
@ -48,13 +48,13 @@ namespace widget {
|
||||
*/
|
||||
displayMode_te GetMode(void);
|
||||
private:
|
||||
bvec2 m_lockExpendContamination; //!< If some sub-widget request the expend==> this permit to unpropagate the problem
|
||||
bvec2 m_lockExpandContamination; //!< If some sub-widget request the expand==> this permit to unpropagate the problem
|
||||
public:
|
||||
/**
|
||||
* @brief Change state of the expend contatmination (if some sub-widget request the expent this permit to not propagate if at this widget)
|
||||
* @param[in] lockExpend New expend state in vertical and horisantal
|
||||
* @brief Change state of the expand contatmination (if some sub-widget request the expent this permit to not propagate if at this widget)
|
||||
* @param[in] lockExpand New expand state in vertical and horisantal
|
||||
*/
|
||||
void LockExpendContamination(const bvec2& lockExpend);
|
||||
void LockExpandContamination(const bvec2& lockExpand);
|
||||
public:
|
||||
/**
|
||||
* @brief Remove all sub element from the widget.
|
||||
@ -97,13 +97,13 @@ namespace widget {
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
public: // Derived function
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual ewol::Widget* GetWidgetAtPos(vec2 pos);
|
||||
virtual ewol::Widget* GetWidgetAtPos(const vec2& pos);
|
||||
virtual void OnObjectRemove(ewol::EObject* removeObject);
|
||||
virtual const char * const GetObjectType(void) { return "Ewol::Sizer"; };
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual void SetMinSize(const vec2& size);
|
||||
virtual void SetExpand(const bvec2& newExpend);
|
||||
virtual void SetExpand(const bvec2& newExpand);
|
||||
virtual bvec2 CanExpand(void);;
|
||||
};
|
||||
|
||||
|
@ -62,10 +62,11 @@ widget::Slider::~Slider(void)
|
||||
}
|
||||
|
||||
|
||||
void widget::Slider::CalculateMinSize(void)
|
||||
void widget::Slider::CalculateMinMaxSize(void)
|
||||
{
|
||||
m_minSize.setValue(etk_max(m_userMinSize.x(), 40),
|
||||
etk_max(m_userMinSize.y(), dotRadius*2) );
|
||||
vec2 minTmp = m_userMinSize.GetPixel();
|
||||
m_minSize.setValue(etk_max(minTmp.x(), 40),
|
||||
etk_max(minTmp.y(), dotRadius*2) );
|
||||
MarkToRedraw();
|
||||
}
|
||||
|
||||
@ -126,7 +127,7 @@ void widget::Slider::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
bool widget::Slider::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::Slider::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
vec2 relativePos = RelativePosition(pos);
|
||||
//EWOL_DEBUG("Event on Slider ...");
|
||||
|
@ -39,9 +39,9 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "Ewol::Slider"; } ;
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -45,7 +45,7 @@ widget::Spacer::~Spacer(void)
|
||||
}
|
||||
|
||||
|
||||
void widget::Spacer::CalculateMinSize(void)
|
||||
void widget::Spacer::CalculateMinMaxSize(void)
|
||||
{
|
||||
m_minSize.setValue(m_localSize, m_localSize);
|
||||
}
|
||||
|
@ -47,8 +47,8 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "Ewol::Spacer"; };
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual ewol::Widget * GetWidgetAtPos(vec2 pos) { return NULL; };
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual ewol::Widget * GetWidgetAtPos(const vec2& pos) { return NULL; };
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
};
|
||||
|
@ -18,7 +18,7 @@
|
||||
widget::WSlider::WSlider(void)
|
||||
{
|
||||
// set contamination enable
|
||||
LockExpendContamination(bvec2(false,false));
|
||||
LockExpandContamination(bvec2(false,false));
|
||||
m_windowsDestination = 0;
|
||||
m_slidingProgress = 0;
|
||||
m_windowsSources = 0;
|
||||
@ -64,21 +64,21 @@ void widget::WSlider::CalculateSize(const vec2& availlable)
|
||||
}
|
||||
|
||||
|
||||
void widget::WSlider::CalculateMinSize(void)
|
||||
void widget::WSlider::CalculateMinMaxSize(void)
|
||||
{
|
||||
EWOL_DEBUG("Calculate MinSize");
|
||||
m_underExpand.setValue(false,false);
|
||||
m_minSize.setValue(0,0);
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->CalculateMinSize();
|
||||
m_subWidget[iii]->CalculateMinMaxSize();
|
||||
if (true == m_subWidget[iii]->CanExpand().x()) {
|
||||
m_underExpand.setX(true);
|
||||
}
|
||||
if (true == m_subWidget[iii]->CanExpand().y()) {
|
||||
m_underExpand.setY(true);
|
||||
}
|
||||
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
|
||||
m_minSize.setValue(etk_max(tmpSize.x(), m_minSize.x()),
|
||||
etk_max(tmpSize.y(), m_minSize.y()));
|
||||
}
|
||||
@ -92,25 +92,25 @@ void widget::WSlider::SetMinSize(const vec2& size)
|
||||
|
||||
bvec2 widget::WSlider::CanExpand(void)
|
||||
{
|
||||
bvec2 res = m_userExpend;
|
||||
bvec2 res = m_userExpand;
|
||||
if (true == m_underExpand.x()) {
|
||||
res.setX(true);
|
||||
}
|
||||
if (true == m_underExpand.y()) {
|
||||
res.setY(true);
|
||||
}
|
||||
if (true == m_lockExpendContamination.x()) {
|
||||
if (true == m_lockExpandContamination.x()) {
|
||||
res.setX(false);
|
||||
}
|
||||
if (true == m_lockExpendContamination.y()) {
|
||||
if (true == m_lockExpandContamination.y()) {
|
||||
res.setY(false);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
void widget::WSlider::LockExpendContamination(const bvec2& lockExpand)
|
||||
void widget::WSlider::LockExpandContamination(const bvec2& lockExpand)
|
||||
{
|
||||
m_lockExpendContamination = lockExpand;
|
||||
m_lockExpandContamination = lockExpand;
|
||||
}
|
||||
|
||||
//etk::Vector<ewol::Widget*> m_SubWidget;
|
||||
@ -258,7 +258,7 @@ void widget::WSlider::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
ewol::Widget * widget::WSlider::GetWidgetAtPos(vec2 pos)
|
||||
ewol::Widget * widget::WSlider::GetWidgetAtPos(const vec2& pos)
|
||||
{
|
||||
// TODO : Review this ...
|
||||
if (m_windowsDestination<0 || m_windowsDestination > m_subWidget.Size()) {
|
||||
|
@ -22,16 +22,16 @@ namespace widget {
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "EwolWSlider"; };
|
||||
private:
|
||||
bvec2 m_underExpand; // expend of the uner elements ...
|
||||
bvec2 m_underExpand; // expand of the uner elements ...
|
||||
public:
|
||||
// Derived function
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
virtual void SetMinSize(const vec2& size);
|
||||
virtual bvec2 CanExpand(void);
|
||||
void LockExpendContamination(const bvec2& lockExpend);
|
||||
void LockExpandContamination(const bvec2& lockExpand);
|
||||
private:
|
||||
bvec2 m_lockExpendContamination;
|
||||
bvec2 m_lockExpandContamination;
|
||||
etk::Vector<ewol::Widget*> m_subWidget;
|
||||
int32_t m_windowsSources; // widget source viewed
|
||||
int32_t m_windowsDestination; // widget destinated viewed
|
||||
@ -50,11 +50,8 @@ namespace widget {
|
||||
public:
|
||||
// Derived function
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
// Derived function
|
||||
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
|
||||
// Derived function
|
||||
virtual ewol::Widget * GetWidgetAtPos(const vec2& pos);
|
||||
virtual void OnObjectRemove(ewol::EObject * removeObject);
|
||||
// Derived function
|
||||
virtual void PeriodicCall(int64_t localTime);
|
||||
};
|
||||
|
||||
|
@ -14,19 +14,20 @@
|
||||
#include <ewol/renderer/os/eSystem.h>
|
||||
#include <ewol/renderer/os/gui.h>
|
||||
|
||||
|
||||
#define ULTIMATE_MAX_SIZE (99999999)
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Widget"
|
||||
|
||||
ewol::Widget::Widget(void) :
|
||||
m_size(10,10),
|
||||
m_minSize(-1,-1),
|
||||
m_minSize(0,0),
|
||||
m_maxSize(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE)),
|
||||
m_zoom(1.0f),
|
||||
m_origin(0,0),
|
||||
m_userMinSize(-1,-1),
|
||||
m_userMaxSize(-1,-1),
|
||||
m_userExpend(false,false),
|
||||
m_userMinSize(vec2(0,0),ewol::Dimension::Pixel),
|
||||
m_userMaxSize(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),ewol::Dimension::Pixel),
|
||||
m_userExpand(false,false),
|
||||
m_userFill(false,false),
|
||||
m_hide(false),
|
||||
m_hasFocus(false),
|
||||
@ -196,7 +197,7 @@ void ewol::Widget::MarkToRedraw(void)
|
||||
|
||||
void ewol::Widget::SetZoom(float newVal)
|
||||
{
|
||||
m_zoom = newVal;
|
||||
m_zoom = etk_avg(0.0000001,newVal,1000000.0);
|
||||
MarkToRedraw();
|
||||
}
|
||||
|
||||
@ -215,33 +216,19 @@ vec2 ewol::Widget::GetOrigin(void)
|
||||
return m_origin;
|
||||
}
|
||||
|
||||
vec2 ewol::Widget::RelativePosition(vec2 pos)
|
||||
vec2 ewol::Widget::RelativePosition(const vec2& pos)
|
||||
{
|
||||
return pos - m_origin;
|
||||
}
|
||||
|
||||
void ewol::Widget::CalculateMinSize(void)
|
||||
void ewol::Widget::CalculateMinMaxSize(void)
|
||||
{
|
||||
m_minSize = m_userMinSize;
|
||||
m_minSize = m_userMinSize.GetPixel();
|
||||
m_maxSize = m_userMaxSize.GetPixel();
|
||||
MarkToRedraw();
|
||||
}
|
||||
|
||||
void ewol::Widget::SetMinSize(const vec2& size)
|
||||
{
|
||||
m_userMinSize = size;
|
||||
}
|
||||
|
||||
void ewol::Widget::CheckMinSize(void)
|
||||
{
|
||||
if (m_userMinSize.x() > 0) {
|
||||
m_minSize.setX(etk_max(m_minSize.x(), m_userMinSize.x()));
|
||||
}
|
||||
if (m_userMinSize.y() > 0) {
|
||||
m_minSize.setY(etk_max(m_minSize.y(), m_userMinSize.y()));
|
||||
}
|
||||
}
|
||||
|
||||
vec2 ewol::Widget::GetMinSize(void)
|
||||
vec2 ewol::Widget::GetCalculateMinSize(void)
|
||||
{
|
||||
if (false==IsHide()) {
|
||||
return m_minSize;
|
||||
@ -249,15 +236,76 @@ vec2 ewol::Widget::GetMinSize(void)
|
||||
return vec2(0,0);
|
||||
}
|
||||
|
||||
void ewol::Widget::SetMaxSize(vec2 size)
|
||||
vec2 ewol::Widget::GetCalculateMaxSize(void)
|
||||
{
|
||||
if (false==IsHide()) {
|
||||
return m_maxSize;
|
||||
}
|
||||
return vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE);
|
||||
}
|
||||
|
||||
void ewol::Widget::SetMinSize(const ewol::Dimension& size)
|
||||
{
|
||||
vec2 pixelMin = size.GetPixel();
|
||||
vec2 pixelMax = m_userMaxSize.GetPixel();
|
||||
// check minimum & maximum compatibility :
|
||||
bool error=false;
|
||||
if (pixelMin.x()>pixelMax.x()) {
|
||||
error=true;
|
||||
}
|
||||
if (pixelMin.y()>pixelMax.y()) {
|
||||
error=true;
|
||||
}
|
||||
if (error==true) {
|
||||
EWOL_ERROR("Can not set a 'min Size' > 'max size' set nothing ...");
|
||||
return;
|
||||
}
|
||||
m_userMinSize = size;
|
||||
ewol::RequestUpdateSize();
|
||||
}
|
||||
|
||||
void ewol::Widget::SetNoMinSize(void)
|
||||
{
|
||||
m_userMinSize.Set(vec2(0,0),ewol::Dimension::Pixel);
|
||||
}
|
||||
|
||||
void ewol::Widget::CheckMinSize(void)
|
||||
{
|
||||
vec2 pixelSize = m_userMinSize.GetPixel();
|
||||
m_minSize.setX(etk_max(m_minSize.x(), pixelSize.x()));
|
||||
m_minSize.setY(etk_max(m_minSize.y(), pixelSize.y()));
|
||||
}
|
||||
|
||||
void ewol::Widget::SetMaxSize(const ewol::Dimension& size)
|
||||
{
|
||||
vec2 pixelMin = m_userMinSize.GetPixel();
|
||||
vec2 pixelMax = size.GetPixel();
|
||||
// check minimum & maximum compatibility :
|
||||
bool error=false;
|
||||
if (pixelMin.x()>pixelMax.x()) {
|
||||
error=true;
|
||||
}
|
||||
if (pixelMin.y()>pixelMax.y()) {
|
||||
error=true;
|
||||
}
|
||||
if (error==true) {
|
||||
EWOL_ERROR("Can not set a 'min Size' > 'max size' set nothing ...");
|
||||
return;
|
||||
}
|
||||
m_userMaxSize = size;
|
||||
ewol::RequestUpdateSize();
|
||||
}
|
||||
|
||||
vec2 ewol::Widget::GetMaxSize(void)
|
||||
void ewol::Widget::SetNoMaxSize(void)
|
||||
{
|
||||
return m_userMaxSize;
|
||||
m_userMaxSize.Set(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),ewol::Dimension::Pixel);
|
||||
}
|
||||
|
||||
void ewol::Widget::CheckMaxSize(void)
|
||||
{
|
||||
vec2 pixelSize = m_userMaxSize.GetPixel();
|
||||
m_maxSize.setX(etk_min(m_maxSize.x(), pixelSize.x()));
|
||||
m_maxSize.setY(etk_min(m_maxSize.y(), pixelSize.y()));
|
||||
}
|
||||
|
||||
vec2 ewol::Widget::GetSize(void)
|
||||
@ -268,11 +316,11 @@ vec2 ewol::Widget::GetSize(void)
|
||||
return vec2(0,0);
|
||||
}
|
||||
|
||||
void ewol::Widget::SetExpand(const bvec2& newExpend)
|
||||
void ewol::Widget::SetExpand(const bvec2& newExpand)
|
||||
{
|
||||
if( m_userExpend.x() != newExpend.x()
|
||||
|| m_userExpend.y() != newExpend.y()) {
|
||||
m_userExpend = newExpend;
|
||||
if( m_userExpand.x() != newExpand.x()
|
||||
|| m_userExpand.y() != newExpand.y()) {
|
||||
m_userExpand = newExpand;
|
||||
ewol::RequestUpdateSize();
|
||||
MarkToRedraw();
|
||||
}
|
||||
@ -281,7 +329,7 @@ void ewol::Widget::SetExpand(const bvec2& newExpend)
|
||||
bvec2 ewol::Widget::CanExpand(void)
|
||||
{
|
||||
if (false==IsHide()) {
|
||||
return m_userExpend;
|
||||
return m_userExpand;
|
||||
}
|
||||
return bvec2(false,false);
|
||||
}
|
||||
@ -493,7 +541,7 @@ bool ewol::Widget::LoadXML(TiXmlNode* node)
|
||||
bool ret = true;
|
||||
const char *tmpAttributeValue = node->ToElement()->Attribute("name");
|
||||
if (NULL != tmpAttributeValue) {
|
||||
m_widgetName = tmpAttributeValue;
|
||||
SetName(tmpAttributeValue);
|
||||
}
|
||||
tmpAttributeValue = node->ToElement()->Attribute("fill");
|
||||
if (NULL != tmpAttributeValue) {
|
||||
@ -539,23 +587,11 @@ bool ewol::Widget::LoadXML(TiXmlNode* node)
|
||||
}
|
||||
tmpAttributeValue = node->ToElement()->Attribute("min-size");
|
||||
if (NULL != tmpAttributeValue) {
|
||||
float x,y;
|
||||
if (2!=sscanf(tmpAttributeValue, "%f,%f", &x, &y)) {
|
||||
SetMinSize(vec2(x,y));
|
||||
} else {
|
||||
EWOL_ERROR("(l "<<node->Row()<<") An error occured when parsing element min-size : " << tmpAttributeValue);
|
||||
ret = false;
|
||||
}
|
||||
m_userMinSize.SetString(tmpAttributeValue);
|
||||
}
|
||||
tmpAttributeValue = node->ToElement()->Attribute("max-size");
|
||||
if (NULL != tmpAttributeValue) {
|
||||
float x,y;
|
||||
if (2!=sscanf(tmpAttributeValue, "%f,%f", &x, &y)) {
|
||||
SetMaxSize(vec2(x,y));
|
||||
} else {
|
||||
EWOL_ERROR("(l "<<node->Row()<<") An error occured when parsing element max-size : " << tmpAttributeValue);
|
||||
ret = false;
|
||||
}
|
||||
m_userMaxSize.SetString(tmpAttributeValue);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -573,19 +609,18 @@ bool ewol::Widget::StoreXML(TiXmlNode* node)
|
||||
}
|
||||
node->LinkEndChild(element);
|
||||
*/
|
||||
if (m_widgetName.Size()!=0) {
|
||||
node->ToElement()->SetAttribute("name", m_widgetName.c_str() );
|
||||
if (GetName().Size()!=0) {
|
||||
node->ToElement()->SetAttribute("name", GetName().c_str() );
|
||||
}
|
||||
if (m_userMinSize != vec2(-1,-1)) {
|
||||
etk::UString tmpVal = etk::UString(m_userMinSize.x()) + "," + etk::UString(m_userMinSize.y());
|
||||
node->ToElement()->SetAttribute("min-size", tmpVal.c_str() );
|
||||
|
||||
if (m_userMinSize.GetPixel() != vec2(0,0)) {
|
||||
node->ToElement()->SetAttribute("min-size", m_userMinSize.GetString().c_str() );
|
||||
}
|
||||
if (m_userMaxSize != vec2(-1,-1)) {
|
||||
etk::UString tmpVal = etk::UString(m_userMaxSize.x()) + "," + etk::UString(m_userMaxSize.y());
|
||||
node->ToElement()->SetAttribute("max-size", tmpVal.c_str() );
|
||||
if (m_userMaxSize.GetPixel() != vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE)) {
|
||||
node->ToElement()->SetAttribute("max-size", m_userMaxSize.GetString().c_str() );
|
||||
}
|
||||
if (m_userExpend != bvec2(false,false)) {
|
||||
etk::UString tmpVal = etk::UString(m_userExpend.x()) + "," + etk::UString(m_userExpend.y());
|
||||
if (m_userExpand != bvec2(false,false)) {
|
||||
etk::UString tmpVal = etk::UString(m_userExpand.x()) + "," + etk::UString(m_userExpand.y());
|
||||
node->ToElement()->SetAttribute("expand", tmpVal.c_str() );
|
||||
}
|
||||
if (m_userFill != bvec2(false,false)) {
|
||||
|
@ -10,6 +10,7 @@
|
||||
#define __EWOL_WIDGET_H__
|
||||
|
||||
#include <ewol/eObject/EObject.h>
|
||||
#include <ewol/Dimension.h>
|
||||
#include <tinyXML/tinyxml.h>
|
||||
|
||||
namespace ewol {
|
||||
@ -50,7 +51,6 @@ namespace ewol {
|
||||
};
|
||||
~EventShortCut(void) { };
|
||||
};
|
||||
|
||||
class Widget : public EObject {
|
||||
public:
|
||||
/**
|
||||
@ -67,30 +67,51 @@ namespace ewol {
|
||||
* @param[in] objectType type description
|
||||
* @return true if the object is compatible, otherwise false
|
||||
*/
|
||||
virtual const char * const GetObjectType(void) { return "EwolWidget"; };
|
||||
virtual const char * const GetObjectType(void) { return "Ewol::Widget"; };
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
// -- Widget Size:
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
protected:
|
||||
vec2 m_size; //!< internal : current size of the widget
|
||||
vec2 m_minSize; //!< user define the minimum size of the widget
|
||||
vec2 m_minSize; //!< internal : minimum size of the widget
|
||||
vec2 m_maxSize; //!< internal : maximum size of the widget
|
||||
public:
|
||||
/**
|
||||
* @brief Convert the absolute position in the local Position (Relative)
|
||||
* @param[in] pos Absolute position that you request convertion
|
||||
* @return the relative position
|
||||
*/
|
||||
virtual vec2 RelativePosition(vec2 pos);
|
||||
virtual vec2 RelativePosition(const vec2& pos);
|
||||
/**
|
||||
* @brief Parrent set the possible diplay size of the current widget whith his own possibilities
|
||||
* By default this save the widget availlable size in the widget size
|
||||
* @param[in] availlable Availlable x&y pixel size
|
||||
* @note : INTERNAL EWOL SYSTEM
|
||||
*/
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
/**
|
||||
* @brief Calculate the minimum size of the widget that is needed to display or the user requested)
|
||||
* @brief Get the widget size
|
||||
* @return Requested size
|
||||
* @note : INTERNAL EWOL SYSTEM
|
||||
*/
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual vec2 GetSize(void);
|
||||
/**
|
||||
* @brief Calculate the minimum and maximum size (need to estimate expend properties of the widget)
|
||||
* @note : INTERNAL EWOL SYSTEM
|
||||
*/
|
||||
virtual void CalculateMinMaxSize(void);
|
||||
/**
|
||||
* @brief Get the widget minimum size calculated
|
||||
* @return Requested size
|
||||
* @note : INTERNAL EWOL SYSTEM
|
||||
*/
|
||||
virtual vec2 GetCalculateMinSize(void);
|
||||
/**
|
||||
* @brief Get the widget maximum size calculated
|
||||
* @return Requested size
|
||||
* @note : INTERNAL EWOL SYSTEM
|
||||
*/
|
||||
virtual vec2 GetCalculateMaxSize(void);
|
||||
protected:
|
||||
// internal element calculated by the system
|
||||
float m_zoom; //!< generic widget zoom
|
||||
@ -112,6 +133,7 @@ namespace ewol {
|
||||
* @brief Set origin at the widget (must be an parrent widget that set this parameter).
|
||||
* This represent the absolute origin in the program windows
|
||||
* @param[in] pos Position of the origin
|
||||
* @note : INTERNAL EWOL SYSTEM
|
||||
*/
|
||||
virtual void SetOrigin(const vec2& pos);
|
||||
/**
|
||||
@ -120,57 +142,68 @@ namespace ewol {
|
||||
*/
|
||||
virtual vec2 GetOrigin(void);
|
||||
protected:
|
||||
vec2 m_userMinSize; //!< user define the minimum size of the widget
|
||||
ewol::Dimension::Dimension m_userMinSize; //!< user define the minimum size of the widget
|
||||
public:
|
||||
/**
|
||||
* @brief User set the minimum size he want to set the display
|
||||
* @param[in] size Set minimum size (none : 0)
|
||||
*/
|
||||
virtual void SetMinSize(const vec2& size);
|
||||
void SetMinSize(const ewol::Dimension::Dimension& size);
|
||||
/**
|
||||
* @brief User set No minimum size.
|
||||
*/
|
||||
void SetNoMinSize(void);
|
||||
/**
|
||||
* @brief Get the current calculated min size
|
||||
* @return the size requested
|
||||
*/
|
||||
virtual vec2 GetMinSize(void);
|
||||
const ewol::Dimension::Dimension& GetMinSize(void) { return m_userMinSize; };
|
||||
/**
|
||||
* @brief Check if the current min size is compatible wit hte user minimum size
|
||||
* @brief 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
|
||||
*/
|
||||
virtual void CheckMinSize(void);
|
||||
protected:
|
||||
vec2 m_userMaxSize; //!< user define the maximum size of the widget
|
||||
ewol::Dimension::Dimension m_userMaxSize; //!< user define the maximum size of the widget
|
||||
public:
|
||||
/**
|
||||
* @brief User set the maximum size he want to set the display
|
||||
* @param[in] size The new maximum size requested (vec2(0,0) to unset)
|
||||
*/
|
||||
virtual void SetMaxSize(vec2 size);
|
||||
void SetMaxSize(const ewol::Dimension::Dimension& size);
|
||||
/**
|
||||
* @brief User set No maximum size.
|
||||
*/
|
||||
void SetNoMaxSize(void);
|
||||
/**
|
||||
* @brief Get the current maximum size
|
||||
* @return the size requested
|
||||
*/
|
||||
virtual vec2 GetMaxSize(void);
|
||||
const ewol::Dimension::Dimension& GetMaxSize(void) { return m_userMaxSize; };
|
||||
/**
|
||||
* @brief Get the widget size
|
||||
* @return Requested size
|
||||
* @brief 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
|
||||
*/
|
||||
virtual vec2 GetSize(void);
|
||||
virtual void CheckMaxSize(void);
|
||||
protected:
|
||||
bvec2 m_userExpend; // TODO : Rename expand ... :p
|
||||
bvec2 m_userExpand;
|
||||
public:
|
||||
/**
|
||||
* @brief Set the expend capabilities (x&y)
|
||||
* @param[in] newExpend 2D boolean repensent the capacity to expend
|
||||
*/
|
||||
virtual void SetExpand(const bvec2& newExpend);
|
||||
virtual void SetExpand(const bvec2& newExpand);
|
||||
/**
|
||||
* @brief Get the expend capabilities (x&y) (set by the user)
|
||||
* @return 2D boolean repensent the capacity to expend
|
||||
*/
|
||||
virtual bvec2 GetExpand(void) { return m_userExpend; };
|
||||
virtual bvec2 GetExpand(void) { return m_userExpand; };
|
||||
/**
|
||||
* @brief Get the expend capabilities (x&y)
|
||||
* @return 2D boolean repensent the capacity to expend
|
||||
* @note : INTERNAL EWOL SYSTEM
|
||||
*/
|
||||
virtual bvec2 CanExpand(void);
|
||||
protected:
|
||||
@ -189,6 +222,7 @@ namespace ewol {
|
||||
/**
|
||||
* @brief Get the filling capabilities x&y
|
||||
* @return bvec2 repensent the capacity to x&y filling
|
||||
* @note : INTERNAL EWOL SYSTEM
|
||||
*/
|
||||
const bvec2& CanFill(void);
|
||||
protected:
|
||||
@ -310,8 +344,9 @@ namespace ewol {
|
||||
* @param[in] pos gAbsolute position of the requested widget knowledge
|
||||
* @return NULL No widget found
|
||||
* @return pointer on the widget found
|
||||
* @note : INTERNAL EWOL SYSTEM
|
||||
*/
|
||||
virtual ewol::Widget * GetWidgetAtPos(vec2 pos) { if (false==IsHide()) { return this; } return NULL; };
|
||||
virtual ewol::Widget* GetWidgetAtPos(const vec2& pos) { if (false==IsHide()) { return this; } return NULL; };
|
||||
/**
|
||||
* @brief Event on an input of this Widget
|
||||
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
|
||||
@ -321,7 +356,7 @@ namespace ewol {
|
||||
* @return true the event is used
|
||||
* @return false the event is not used
|
||||
*/
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { return false; };
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos) { return false; };
|
||||
/**
|
||||
* @brief Event on the keybord (if no shortcut has been detected before).
|
||||
* @param[in] type of the event (ewol::EVENT_KB_TYPE_DOWN or ewol::EVENT_KB_TYPE_UP)
|
||||
@ -392,6 +427,7 @@ namespace ewol {
|
||||
* 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
|
||||
* @param[in] displayProp properties of the current display
|
||||
* @note : INTERNAL EWOL SYSTEM
|
||||
*/
|
||||
virtual void GenDraw(DrawProperty displayProp);
|
||||
protected:
|
||||
@ -424,7 +460,6 @@ namespace ewol {
|
||||
* @return true if the cursor is curently grabbed
|
||||
*/
|
||||
virtual bool GetGrabStatus(void);
|
||||
// DisplayCursorType
|
||||
private:
|
||||
ewol::cursorDisplay_te m_cursorDisplay;
|
||||
public:
|
||||
@ -438,8 +473,6 @@ namespace ewol {
|
||||
* @return the type of the cursor.
|
||||
*/
|
||||
virtual ewol::cursorDisplay_te GetCursor(void);
|
||||
private:
|
||||
etk::UString m_widgetName;
|
||||
public:
|
||||
/**
|
||||
* @brief Load properties with an XML node.
|
||||
@ -455,7 +488,6 @@ namespace ewol {
|
||||
* @return false : An error occured.
|
||||
*/
|
||||
virtual bool StoreXML(TiXmlNode* node);
|
||||
|
||||
}; // end of the class Widget declaration
|
||||
|
||||
};// end of namespace
|
||||
|
@ -78,7 +78,7 @@ void widget::WidgetScrooled::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
bool widget::WidgetScrooled::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::WidgetScrooled::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
vec2 relativePos = RelativePosition(pos);
|
||||
// corection due to the open Gl invertion ...
|
||||
|
@ -56,7 +56,7 @@ namespace widget {
|
||||
// Derived function
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
// Derived function
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
// Derived function
|
||||
virtual void GenDraw(ewol::DrawProperty displayProp);
|
||||
protected:
|
||||
|
@ -52,24 +52,24 @@ ewol::Windows::~Windows(void)
|
||||
|
||||
void ewol::Windows::CalculateSize(const vec2& availlable)
|
||||
{
|
||||
//EWOL_DEBUG("calculateMinSize on : " << m_currentCreateId);
|
||||
//EWOL_DEBUG("calculateSize on : " << m_currentCreateId);
|
||||
m_size = availlable;
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->CalculateMinSize();
|
||||
m_subWidget->CalculateMinMaxSize();
|
||||
// TODO : Check if min Size is possible ...
|
||||
// TODO : Herited from MinSize .. and expand ???
|
||||
m_subWidget->CalculateSize(m_size);
|
||||
}
|
||||
for(int32_t iii=0; iii<m_popUpWidgetList.Size(); iii++) {
|
||||
if (NULL != m_popUpWidgetList[iii]) {
|
||||
m_popUpWidgetList[iii]->CalculateMinSize();
|
||||
m_popUpWidgetList[iii]->CalculateMinMaxSize();
|
||||
m_popUpWidgetList[iii]->CalculateSize(m_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ewol::Widget * ewol::Windows::GetWidgetAtPos(vec2 pos)
|
||||
ewol::Widget * ewol::Windows::GetWidgetAtPos(const vec2& pos)
|
||||
{
|
||||
// calculate relative position
|
||||
vec2 relativePos = RelativePosition(pos);
|
||||
|
@ -38,7 +38,7 @@ namespace ewol {
|
||||
// Derived function
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
// Derived function
|
||||
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
|
||||
virtual ewol::Widget * GetWidgetAtPos(const vec2& pos);
|
||||
private:
|
||||
bool m_hasDecoration;
|
||||
public:
|
||||
|
@ -44,7 +44,7 @@ widget::ColorChooser::ColorChooser(void) :
|
||||
m_widgetBlue = NULL;
|
||||
m_widgetAlpha = NULL;
|
||||
|
||||
LockExpendContamination(bvec2(true,true));
|
||||
LockExpandContamination(bvec2(true,true));
|
||||
m_widgetColorBar = new widget::ColorBar();
|
||||
m_widgetColorBar->RegisterOnEvent(this, ewolEventColorBarChange, eventColorBarHasChange);
|
||||
m_widgetColorBar->SetFill(bvec2(true,true));
|
||||
|
@ -81,7 +81,7 @@ widget::FileChooser::FileChooser(void)
|
||||
if (NULL == mySizerVert) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySizerVert->LockExpendContamination(bvec2(true,true));
|
||||
mySizerVert->LockExpandContamination(bvec2(true,true));
|
||||
// set it in the pop-up-system :
|
||||
SubWidgetSet(mySizerVert);
|
||||
|
||||
|
@ -48,7 +48,7 @@ widget::Parameter::Parameter(void) :
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
EWOL_INFO("add widget");
|
||||
mySizerVert->LockExpendContamination(bvec2(true,true));
|
||||
mySizerVert->LockExpandContamination(bvec2(true,true));
|
||||
// set it in the pop-up-system :
|
||||
SubWidgetSet(mySizerVert);
|
||||
|
||||
|
@ -184,7 +184,7 @@ void widget::ParameterList::OnRegenerateDisplay(void)
|
||||
}
|
||||
|
||||
|
||||
bool widget::ParameterList::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
|
||||
bool widget::ParameterList::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos)
|
||||
{
|
||||
if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
|
||||
ewol::widgetManager::FocusKeep(this);
|
||||
|
@ -67,7 +67,7 @@ namespace widget {
|
||||
// Derived function
|
||||
void OnRegenerateDisplay(void);
|
||||
// Derived function
|
||||
bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, const vec2& pos);
|
||||
protected:
|
||||
// Derived function
|
||||
void OnGetFocus(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user