[DEV] widget back to work on test woft ==> not ended (some mistake to correct)
This commit is contained in:
parent
36dbd60e19
commit
2d209cd37e
@ -40,9 +40,9 @@ void ewol::dimension::UnInit(void)
|
||||
windowsSize.Set(vec2(9999999,88888), ewol::Dimension::Pixel);
|
||||
}
|
||||
|
||||
void ewol::dimension::SetPixelRatio(const vec2& ratio, ewol::Dimension::distance_te type)
|
||||
void ewol::dimension::SetPixelRatio(const vec2& _ratio, ewol::Dimension::distance_te type)
|
||||
{
|
||||
ewol::Dimension conversion(ratio, type);
|
||||
ewol::Dimension conversion(_ratio, type);
|
||||
ratio = conversion.GetMillimeter();
|
||||
invRatio.setValue(1.0f/ratio.x(),1.0f/ratio.y());
|
||||
EWOL_INFO("Set a new screen ratio for the screen : ratioMm=" << ratio);
|
||||
@ -105,28 +105,28 @@ void ewol::Dimension::Set(const vec2& size, ewol::Dimension::distance_te type)
|
||||
{
|
||||
switch(type) {
|
||||
case ewol::Dimension::Pourcent:
|
||||
m_data = size*0.01f;
|
||||
m_data = vec2(size.x()*0.01f, size.y()*0.01f);
|
||||
break;
|
||||
case ewol::Dimension::Pixel:
|
||||
m_data = size;
|
||||
break;
|
||||
case ewol::Dimension::Meter:
|
||||
m_data = (size*meterToMillimeter)*ratio;
|
||||
m_data = vec2(size.x()*meterToMillimeter*ratio.x(), size.y()*meterToMillimeter*ratio.y());
|
||||
break;
|
||||
case ewol::Dimension::Centimeter:
|
||||
m_data = (size*centimeterToMillimeter)*ratio;
|
||||
m_data = vec2(size.x()*centimeterToMillimeter*ratio.x(), size.y()*centimeterToMillimeter*ratio.y());
|
||||
break;
|
||||
case ewol::Dimension::Millimeter:
|
||||
m_data = size*ratio;
|
||||
m_data = vec2(size.x()*ratio.x(), size.y()*ratio.y());
|
||||
break;
|
||||
case ewol::Dimension::Kilometer:
|
||||
m_data = (size*kilometerToMillimeter)*ratio;
|
||||
m_data = vec2(size.x()*kilometerToMillimeter*ratio.x(), size.y()*kilometerToMillimeter*ratio.y());
|
||||
break;
|
||||
case ewol::Dimension::Inch:
|
||||
m_data = (size*inchToMillimeter)*ratio;
|
||||
m_data = vec2(size.x()*inchToMillimeter*ratio.x(), size.y()*inchToMillimeter*ratio.y());
|
||||
break;
|
||||
case ewol::Dimension::foot:
|
||||
m_data = (size*footToMillimeter)*ratio;
|
||||
m_data = vec2(size.x()*footToMillimeter*ratio.x(), size.y()*footToMillimeter*ratio.y());
|
||||
break;
|
||||
}
|
||||
m_type = type;
|
||||
@ -134,16 +134,18 @@ void ewol::Dimension::Set(const vec2& size, ewol::Dimension::distance_te type)
|
||||
|
||||
vec2 ewol::Dimension::GetPixel(void)
|
||||
{
|
||||
if (type!=ewol::Dimension::Pourcent) {
|
||||
if (m_type!=ewol::Dimension::Pourcent) {
|
||||
return m_data;
|
||||
}
|
||||
return windowsSize*m_data;
|
||||
vec2 windDim = windowsSize.GetPixel();
|
||||
return vec2(windDim.x()*m_data.x(), windDim.y()*m_data.y());
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::GetPourcent(void)
|
||||
{
|
||||
if (type!=ewol::Dimension::Pourcent) {
|
||||
return m_data/windowsSize*100.0f;
|
||||
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;
|
||||
}
|
||||
|
@ -6,8 +6,8 @@
|
||||
* @license BSD v3 (see license file)
|
||||
*/
|
||||
|
||||
#ifndef __DIMENSION_H__
|
||||
#define __DIMENSION_H__
|
||||
#ifndef __EWOL_DIMENSION_H__
|
||||
#define __EWOL_DIMENSION_H__
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <etk/UString.h>
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <etk/MessageFifo.h>
|
||||
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/DisplayConv.h>
|
||||
#include <ewol/Dimension.h>
|
||||
#include <ewol/debug.h>
|
||||
|
||||
#include <ewol/config.h>
|
||||
@ -135,7 +135,7 @@ void ewolProcessEvents(void)
|
||||
case THREAD_RESIZE:
|
||||
//EWOL_DEBUG("Receive MSG : THREAD_RESIZE");
|
||||
windowsSize = data.dimention;
|
||||
ewol::SetPixelWindowsSize(vec2(windowsSize.x(),windowsSize.y()));
|
||||
ewol::dimension::SetPixelWindowsSize(vec2(windowsSize.x(),windowsSize.y()));
|
||||
eSystem::ForceRedrawAll();
|
||||
break;
|
||||
case THREAD_INPUT_MOTION:
|
||||
@ -329,7 +329,7 @@ void eSystem::RequestUpdateSize(void)
|
||||
void eSystem::Resize(int w, int h )
|
||||
{
|
||||
// TODO : Better in the thread ... ==> but generate some init error ...
|
||||
ewol::SetPixelWindowsSize(vec2(w,h));
|
||||
ewol::dimension::SetPixelWindowsSize(vec2(w,h));
|
||||
if (true == isGlobalSystemInit) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_RESIZE;
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include <ewol/renderer/ResourceManager.h>
|
||||
#include <ewol/renderer/os/eSystem.h>
|
||||
#include <ewol/DisplayConv.h>
|
||||
#include <ewol/Dimension.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
@ -170,8 +170,9 @@ bool CreateX11Context(void)
|
||||
}
|
||||
int Xscreen = DefaultScreen(m_display);
|
||||
// set the DPI for the current screen :
|
||||
ewol::SetPixelPerMillimeter(vec2((float)DisplayWidth(m_display, Xscreen)/(float)DisplayWidthMM(m_display, Xscreen),
|
||||
(float)DisplayHeight(m_display, Xscreen)/(float)DisplayHeightMM(m_display, Xscreen)));
|
||||
ewol::dimension::SetPixelRatio(vec2((float)DisplayWidth(m_display, Xscreen)/(float)DisplayWidthMM(m_display, Xscreen),
|
||||
(float)DisplayHeight(m_display, Xscreen)/(float)DisplayHeightMM(m_display, Xscreen)),
|
||||
ewol::Dimension::Millimeter);
|
||||
// get an appropriate visual
|
||||
m_visual = glXChooseVisual(m_display, Xscreen, attrListDbl);
|
||||
if (NULL == m_visual) {
|
||||
|
@ -43,7 +43,6 @@ namespace widget {
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void SetMinSize(const vec2& size);
|
||||
virtual void SetExpand(const bvec2& newExpend);
|
||||
virtual bvec2 CanExpand(void);
|
||||
virtual const char * const GetObjectType(void) { return "EwolLayer"; };
|
||||
};
|
||||
|
@ -61,8 +61,8 @@ void widget::PopUp::CalculateSize(const vec2& availlable)
|
||||
subWidgetOrigin.setValue((int32_t)(m_size.x() - m_origin.x() - subWidgetSize.x())/2 + m_origin.x(),
|
||||
(int32_t)(m_size.y() - m_origin.y() - subWidgetSize.y())/2 + m_origin.y());
|
||||
|
||||
m_subWidget->SetOrigin(subWidgetOrigin.x(), subWidgetOrigin.y());
|
||||
m_subWidget->CalculateSize(subWidgetSize.x(), subWidgetSize.y());
|
||||
m_subWidget->SetOrigin(subWidgetOrigin);
|
||||
m_subWidget->CalculateSize(subWidgetSize);
|
||||
}
|
||||
MarkToRedraw();
|
||||
}
|
||||
|
@ -86,14 +86,14 @@ void widget::Sizer::CalculateSize(const vec2& availlable)
|
||||
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
if (m_mode==widget::Sizer::modeVert) {
|
||||
unexpendableSize += tmpSize.y();
|
||||
if (false == m_subWidget[iii]->CanExpentY()) {
|
||||
if (false == m_subWidget[iii]->CanExpand().y()) {
|
||||
nbWidgetFixedSize++;
|
||||
} else {
|
||||
nbWidgetNotFixedSize++;
|
||||
}
|
||||
} else {
|
||||
unexpendableSize += tmpSize.x();
|
||||
if (false == m_subWidget[iii]->CanExpentX()) {
|
||||
if (false == m_subWidget[iii]->CanExpand().x()) {
|
||||
nbWidgetFixedSize++;
|
||||
} else {
|
||||
nbWidgetNotFixedSize++;
|
||||
@ -120,22 +120,22 @@ void widget::Sizer::CalculateSize(const vec2& availlable)
|
||||
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
// Set the origin :
|
||||
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
|
||||
m_subWidget[iii]->SetOrigin(tmpOrigin.x(), tmpOrigin.y());
|
||||
m_subWidget[iii]->SetOrigin(tmpOrigin);
|
||||
// Now Update his Size his size in X and the curent sizer size in Y:
|
||||
if (m_mode==widget::Sizer::modeVert) {
|
||||
if (true == m_subWidget[iii]->CanExpentY()) {
|
||||
m_subWidget[iii]->CalculateSize(m_size.x(), tmpSize.y()+sizeToAddAtEveryOne);
|
||||
if (true == m_subWidget[iii]->CanExpand().y()) {
|
||||
m_subWidget[iii]->CalculateSize(vec2(m_size.x(), tmpSize.y()+sizeToAddAtEveryOne));
|
||||
tmpOrigin.setY(tmpOrigin.y() + tmpSize.y()+sizeToAddAtEveryOne);
|
||||
} else {
|
||||
m_subWidget[iii]->CalculateSize(m_size.x(), tmpSize.y());
|
||||
m_subWidget[iii]->CalculateSize(vec2(m_size.x(), tmpSize.y()));
|
||||
tmpOrigin.setY(tmpOrigin.y() + tmpSize.y());
|
||||
}
|
||||
} else {
|
||||
if (true == m_subWidget[iii]->CanExpentX()) {
|
||||
m_subWidget[iii]->CalculateSize(tmpSize.x()+sizeToAddAtEveryOne, m_size.y());
|
||||
if (true == m_subWidget[iii]->CanExpand().x()) {
|
||||
m_subWidget[iii]->CalculateSize(vec2(tmpSize.x()+sizeToAddAtEveryOne, m_size.y()));
|
||||
tmpOrigin.setX(tmpOrigin.x() + tmpSize.x()+sizeToAddAtEveryOne);
|
||||
} else {
|
||||
m_subWidget[iii]->CalculateSize(tmpSize.x(), m_size.y());
|
||||
m_subWidget[iii]->CalculateSize(vec2(tmpSize.x(), m_size.y()));
|
||||
tmpOrigin.setX(tmpOrigin.x() + tmpSize.x());
|
||||
}
|
||||
}
|
||||
@ -161,10 +161,10 @@ void widget::Sizer::CalculateMinSize(void)
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->CalculateMinSize();
|
||||
if (true == m_subWidget[iii]->CanExpentX()) {
|
||||
if (true == m_subWidget[iii]->CanExpand().x()) {
|
||||
m_userExpend.setX(true);
|
||||
}
|
||||
if (true == m_subWidget[iii]->CanExpentY()) {
|
||||
if (true == m_subWidget[iii]->CanExpand().y()) {
|
||||
m_userExpend.setY(true);
|
||||
}
|
||||
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
@ -190,17 +190,21 @@ void widget::Sizer::SetMinSize(const vec2& size)
|
||||
EWOL_ERROR("[" << GetId() << "] Sizer can not have a user Minimum size (herited from under elements)");
|
||||
}
|
||||
|
||||
void widget::Sizer::SetExpand(const bvec2& newExpend)
|
||||
void widget::Sizer::SetExpand(const bvec2& newExpand)
|
||||
{
|
||||
EWOL_ERROR("[" << GetId() << "] Sizer can not have a user expend settings (herited from under elements)");
|
||||
}
|
||||
|
||||
bvec2 widget::Sizer::CanExpentY(void)
|
||||
bvec2 widget::Sizer::CanExpand(void)
|
||||
{
|
||||
if (true == m_lockExpendContamination)) {
|
||||
return bvec2(false,false);
|
||||
bvec2 res = m_userExpend;
|
||||
if (true == m_lockExpendContamination.x()) {
|
||||
res.setX(false);
|
||||
}
|
||||
return m_userExpend;
|
||||
if (true == m_lockExpendContamination.y()) {
|
||||
res.setY(false);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
void widget::Sizer::LockExpendContamination(const bvec2& lockExpend)
|
||||
|
@ -104,7 +104,7 @@ namespace widget {
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void SetMinSize(const vec2& size);
|
||||
virtual void SetExpand(const bvec2& newExpend);
|
||||
virtual bvec2 CanExpent(void);;
|
||||
virtual bvec2 CanExpand(void);;
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -18,11 +18,11 @@
|
||||
widget::WSlider::WSlider(void)
|
||||
{
|
||||
// set contamination enable
|
||||
LockExpendContamination();
|
||||
LockExpendContamination(bvec2(false,false));
|
||||
m_windowsDestination = 0;
|
||||
m_slidingProgress = 0;
|
||||
m_windowsSources = 0;
|
||||
m_underExpend.setValue(false,false);
|
||||
m_underExpand.setValue(false,false);
|
||||
}
|
||||
|
||||
widget::WSlider::~WSlider(void)
|
||||
@ -31,92 +31,86 @@ widget::WSlider::~WSlider(void)
|
||||
}
|
||||
|
||||
|
||||
bool widget::WSlider::CalculateSize(float availlableX, float availlableY)
|
||||
void widget::WSlider::CalculateSize(const vec2& availlable)
|
||||
{
|
||||
//EWOL_DEBUG("Update Size");
|
||||
m_size.setValue(availlableX, availlableY);
|
||||
m_size = availlable;
|
||||
|
||||
if (m_windowsDestination == m_windowsSources) {
|
||||
int32_t iii = m_windowsDestination;
|
||||
if (iii < m_subWidget.Size()) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->SetOrigin(m_origin.x(), m_origin.y());
|
||||
m_subWidget[iii]->CalculateSize(m_size.x(), m_size.y());
|
||||
m_subWidget[iii]->SetOrigin(m_origin);
|
||||
m_subWidget[iii]->CalculateSize(m_size);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int32_t iii = m_windowsSources;
|
||||
if (iii < m_subWidget.Size()) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->SetOrigin(m_origin.x() - (m_size.x()*(float)m_slidingProgress/1000.0), m_origin.y());
|
||||
m_subWidget[iii]->CalculateSize(m_size.x(), m_size.y());
|
||||
m_subWidget[iii]->SetOrigin(vec2(m_origin.x() - (m_size.x()*(float)m_slidingProgress/1000.0), m_origin.y()));
|
||||
m_subWidget[iii]->CalculateSize(m_size);
|
||||
}
|
||||
}
|
||||
iii = m_windowsDestination;
|
||||
if (iii < m_subWidget.Size()) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->SetOrigin(m_origin.x() - (m_size.x()*((float)m_slidingProgress/1000.0) - m_size.x()), m_origin.y());
|
||||
m_subWidget[iii]->CalculateSize(m_size.x(), m_size.y());
|
||||
m_subWidget[iii]->SetOrigin(vec2(m_origin.x() - (m_size.x()*((float)m_slidingProgress/1000.0) - m_size.x()), m_origin.y()));
|
||||
m_subWidget[iii]->CalculateSize(m_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
MarkToRedraw();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool widget::WSlider::CalculateMinSize(void)
|
||||
void widget::WSlider::CalculateMinSize(void)
|
||||
{
|
||||
EWOL_DEBUG("Calculate MinSize");
|
||||
m_underExpend.setValue(false,false);
|
||||
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();
|
||||
if (true == m_subWidget[iii]->CanExpentX()) {
|
||||
m_underExpend.setX(true);
|
||||
if (true == m_subWidget[iii]->CanExpand().x()) {
|
||||
m_underExpand.setX(true);
|
||||
}
|
||||
if (true == m_subWidget[iii]->CanExpentY()) {
|
||||
m_underExpend.setY(true);
|
||||
if (true == m_subWidget[iii]->CanExpand().y()) {
|
||||
m_underExpand.setY(true);
|
||||
}
|
||||
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
|
||||
m_minSize.setValue(etk_max(tmpSize.x(), m_minSize.x()),
|
||||
etk_max(tmpSize.y(), m_minSize.y()));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void widget::WSlider::SetMinSise(float x, float y)
|
||||
void widget::WSlider::SetMinSize(const vec2& size)
|
||||
{
|
||||
EWOL_ERROR("Layer can not have a user Minimum size (herited from under elements)");
|
||||
}
|
||||
|
||||
bool widget::WSlider::CanExpentX(void)
|
||||
bvec2 widget::WSlider::CanExpand(void)
|
||||
{
|
||||
if (m_userExpend.x() == true) {
|
||||
return true;
|
||||
bvec2 res = m_userExpend;
|
||||
if (true == m_underExpand.x()) {
|
||||
res.setX(true);
|
||||
}
|
||||
if (true == m_lockExpendContamination) {
|
||||
return false;
|
||||
if (true == m_underExpand.y()) {
|
||||
res.setY(true);
|
||||
}
|
||||
return m_underExpend.x();
|
||||
if (true == m_lockExpendContamination.x()) {
|
||||
res.setX(false);
|
||||
}
|
||||
if (true == m_lockExpendContamination.y()) {
|
||||
res.setY(false);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
bool widget::WSlider::CanExpentY(void)
|
||||
void widget::WSlider::LockExpendContamination(const bvec2& lockExpand)
|
||||
{
|
||||
if (m_userExpend.y() == true) {
|
||||
return true;
|
||||
}
|
||||
if (true == m_lockExpendContamination) {
|
||||
return false;
|
||||
}
|
||||
return m_underExpend.y();
|
||||
}
|
||||
|
||||
void widget::WSlider::LockExpendContamination(bool lockExpend)
|
||||
{
|
||||
m_lockExpendContamination = lockExpend;
|
||||
m_lockExpendContamination = lockExpand;
|
||||
}
|
||||
|
||||
//etk::Vector<ewol::Widget*> m_SubWidget;
|
||||
@ -197,7 +191,7 @@ void widget::WSlider::PeriodicCall(int64_t localTime)
|
||||
m_slidingProgress += 30;
|
||||
m_slidingProgress = etk_avg(0, m_slidingProgress, 1000);
|
||||
}
|
||||
CalculateSize(m_size.x(), m_size.y());
|
||||
CalculateSize(m_size);
|
||||
MarkToRedraw();
|
||||
}
|
||||
|
||||
|
@ -22,33 +22,28 @@ namespace widget {
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "EwolWSlider"; };
|
||||
private:
|
||||
bvec2 m_underExpend; // expend of the uner elements ...
|
||||
bvec2 m_underExpand; // expend of the uner elements ...
|
||||
public:
|
||||
// Derived function
|
||||
virtual bool CalculateSize(float availlableX, float availlableY);
|
||||
// Derived function
|
||||
virtual bool CalculateMinSize(void);
|
||||
// Derived function
|
||||
virtual void SetMinSise(float x=-1, float y=-1);
|
||||
// Derived function
|
||||
virtual bool CanExpentX(void);
|
||||
// Derived function
|
||||
virtual bool CanExpentY(void);
|
||||
void LockExpendContamination(bool lockExpend=false);
|
||||
virtual void CalculateSize(const vec2& availlable);
|
||||
virtual void CalculateMinSize(void);
|
||||
virtual void SetMinSize(const vec2& size);
|
||||
virtual bvec2 CanExpand(void);
|
||||
void LockExpendContamination(const bvec2& lockExpend);
|
||||
private:
|
||||
bool m_lockExpendContamination;
|
||||
etk::Vector<ewol::Widget*> m_subWidget;
|
||||
int32_t m_windowsSources; // widget source viewed
|
||||
int32_t m_windowsDestination; // widget destinated viewed
|
||||
int32_t m_slidingProgress; // ratio progression of a sliding
|
||||
bvec2 m_lockExpendContamination;
|
||||
etk::Vector<ewol::Widget*> m_subWidget;
|
||||
int32_t m_windowsSources; // widget source viewed
|
||||
int32_t m_windowsDestination; // widget destinated viewed
|
||||
int32_t m_slidingProgress; // ratio progression of a sliding
|
||||
public:
|
||||
virtual void SubWidgetRemoveAll(void);
|
||||
virtual void SubWidgetAdd(ewol::Widget* newWidget);
|
||||
virtual void SubWidgetRemove(ewol::Widget* newWidget);
|
||||
virtual void SubWidgetUnLink(ewol::Widget* newWidget);
|
||||
void SubWidgetSelectSet(int32_t id);
|
||||
int32_t SubWidgetSelectGet(void) { return (int32_t)m_slidingProgress; };
|
||||
int32_t SubWidgetNumber(void) { return m_subWidget.Size(); };
|
||||
virtual void SubWidgetRemoveAll(void);
|
||||
virtual void SubWidgetAdd(ewol::Widget* newWidget);
|
||||
virtual void SubWidgetRemove(ewol::Widget* newWidget);
|
||||
virtual void SubWidgetUnLink(ewol::Widget* newWidget);
|
||||
void SubWidgetSelectSet(int32_t id);
|
||||
int32_t SubWidgetSelectGet(void) { return (int32_t)m_slidingProgress; };
|
||||
int32_t SubWidgetNumber(void) { return m_subWidget.Size(); };
|
||||
protected:
|
||||
// Derived function
|
||||
virtual void OnDraw(ewol::DrawProperty& displayProp);
|
||||
|
@ -142,7 +142,7 @@ namespace ewol {
|
||||
public:
|
||||
/**
|
||||
* @brief User set the maximum size he want to set the display
|
||||
* @param[in] size The new maximum size requested (vec2(-1,-1) to unset)
|
||||
* @param[in] size The new maximum size requested (vec2(0,0) to unset)
|
||||
*/
|
||||
virtual void SetMaxSize(vec2 size);
|
||||
/**
|
||||
@ -163,6 +163,11 @@ namespace ewol {
|
||||
* @param[in] newExpend 2D boolean repensent the capacity to expend
|
||||
*/
|
||||
virtual void SetExpand(const bvec2& newExpend);
|
||||
/**
|
||||
* @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; };
|
||||
/**
|
||||
* @brief Get the expend capabilities (x&y)
|
||||
* @return 2D boolean repensent the capacity to expend
|
||||
@ -176,6 +181,11 @@ namespace ewol {
|
||||
* @param[in] newFill new x&y fill state
|
||||
*/
|
||||
virtual void SetFill(const bvec2& newFill);
|
||||
/**
|
||||
* @brief Set the x&y filling capacity set by the user
|
||||
* @return bvec2 repensent the capacity to x&y filling (set by the user)
|
||||
*/
|
||||
virtual const bvec2& GetFill(void) { return m_userFill; };
|
||||
/**
|
||||
* @brief Get the filling capabilities x&y
|
||||
* @return bvec2 repensent the capacity to x&y filling
|
||||
|
@ -44,11 +44,10 @@ widget::ColorChooser::ColorChooser(void) :
|
||||
m_widgetBlue = NULL;
|
||||
m_widgetAlpha = NULL;
|
||||
|
||||
LockExpendContamination(true);
|
||||
LockExpendContamination(bvec2(true,true));
|
||||
m_widgetColorBar = new widget::ColorBar();
|
||||
m_widgetColorBar->RegisterOnEvent(this, ewolEventColorBarChange, eventColorBarHasChange);
|
||||
m_widgetColorBar->SetFillY(true);
|
||||
m_widgetColorBar->SetFillX(true);
|
||||
m_widgetColorBar->SetFill(bvec2(true,true));
|
||||
/*
|
||||
m_widgetColorBar->SetWidth(200);
|
||||
m_widgetColorBar->SetHeigh(200);
|
||||
@ -60,8 +59,8 @@ widget::ColorChooser::ColorChooser(void) :
|
||||
|
||||
m_widgetRed = new widget::Slider();
|
||||
m_widgetRed->RegisterOnEvent(this, ewolEventSliderChange, eventColorSpecificHasChange);
|
||||
m_widgetRed->SetExpendX(true);
|
||||
m_widgetRed->SetFillX(true);
|
||||
m_widgetRed->SetExpand(bvec2(true,false));
|
||||
m_widgetRed->SetFill(bvec2(true,false));
|
||||
m_widgetRed->SetMin(0);
|
||||
m_widgetRed->SetMax(255);
|
||||
sliderColor = 0xFF0000FF;
|
||||
@ -69,8 +68,8 @@ widget::ColorChooser::ColorChooser(void) :
|
||||
SubWidgetAdd(m_widgetRed);
|
||||
m_widgetGreen = new widget::Slider();
|
||||
m_widgetGreen->RegisterOnEvent(this, ewolEventSliderChange, eventColorSpecificHasChange);
|
||||
m_widgetGreen->SetExpendX(true);
|
||||
m_widgetGreen->SetFillX(true);
|
||||
m_widgetGreen->SetExpand(bvec2(true,false));
|
||||
m_widgetGreen->SetFill(bvec2(true,false));
|
||||
m_widgetGreen->SetMin(0);
|
||||
sliderColor = 0x00FF00FF;
|
||||
m_widgetGreen->SetColor(sliderColor);
|
||||
@ -78,8 +77,8 @@ widget::ColorChooser::ColorChooser(void) :
|
||||
SubWidgetAdd(m_widgetGreen);
|
||||
m_widgetBlue = new widget::Slider();
|
||||
m_widgetBlue->RegisterOnEvent(this, ewolEventSliderChange, eventColorSpecificHasChange);
|
||||
m_widgetBlue->SetExpendX(true);
|
||||
m_widgetBlue->SetFillX(true);
|
||||
m_widgetBlue->SetExpand(bvec2(true,false));
|
||||
m_widgetBlue->SetFill(bvec2(true,false));
|
||||
m_widgetBlue->SetMin(0);
|
||||
sliderColor = 0x0000FFFF;
|
||||
m_widgetBlue->SetColor(sliderColor);
|
||||
@ -87,8 +86,8 @@ widget::ColorChooser::ColorChooser(void) :
|
||||
SubWidgetAdd(m_widgetBlue);
|
||||
m_widgetAlpha = new widget::Slider();
|
||||
m_widgetAlpha->RegisterOnEvent(this, ewolEventSliderChange, eventColorSpecificHasChange);
|
||||
m_widgetAlpha->SetExpendX(true);
|
||||
m_widgetAlpha->SetFillX(true);
|
||||
m_widgetAlpha->SetExpand(bvec2(true,false));
|
||||
m_widgetAlpha->SetFill(bvec2(true,false));
|
||||
m_widgetAlpha->SetMin(0);
|
||||
m_widgetAlpha->SetMax(255);
|
||||
SubWidgetAdd(m_widgetAlpha);
|
||||
|
@ -30,19 +30,19 @@ namespace widget {
|
||||
// Derived function
|
||||
virtual const char * const GetObjectType(void) { return "widget::ColorChooser"; };
|
||||
// Derived function
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data);
|
||||
virtual void OnReceiveMessage(ewol::EObject* CallerObject, const char * eventId, const etk::UString& data);
|
||||
// Derived function
|
||||
virtual void OnObjectRemove(ewol::EObject * removeObject);
|
||||
virtual void OnObjectRemove(ewol::EObject* removeObject);
|
||||
|
||||
void SetColor(draw::Color newColor);
|
||||
void SetColor(draw::Color newColor);
|
||||
draw::Color GetColor(void);
|
||||
private:;
|
||||
widget::ColorBar* m_widgetColorBar;
|
||||
widget::Slider* m_widgetRed;
|
||||
widget::Slider* m_widgetGreen;
|
||||
widget::Slider* m_widgetBlue;
|
||||
widget::Slider* m_widgetAlpha;
|
||||
draw::Color m_currentColor;
|
||||
widget::ColorBar* m_widgetColorBar;
|
||||
widget::Slider* m_widgetRed;
|
||||
widget::Slider* m_widgetGreen;
|
||||
widget::Slider* m_widgetBlue;
|
||||
widget::Slider* m_widgetAlpha;
|
||||
draw::Color m_currentColor;
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -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(true);
|
||||
mySizerVert->LockExpendContamination(bvec2(true,true));
|
||||
// set it in the pop-up-system :
|
||||
SubWidgetSet(mySizerVert);
|
||||
|
||||
@ -102,7 +102,7 @@ widget::FileChooser::FileChooser(void)
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetExpendX(true);
|
||||
mySpacer->SetExpand(bvec2(true,false));
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
}
|
||||
// TODO : set if back :
|
||||
@ -145,8 +145,8 @@ widget::FileChooser::FileChooser(void)
|
||||
m_widgetListFolder->SetShowFiles(false);
|
||||
m_widgetListFolder->SetShowHiddenFiles(false);
|
||||
m_widgetListFolder->RegisterOnEvent(this, ewolEventFSFolderValidate, ewolEventFileChooserListFolder);
|
||||
m_widgetListFolder->SetExpendY(true);
|
||||
m_widgetListFolder->SetFillY(true);
|
||||
m_widgetListFolder->SetExpand(bvec2(false,true));
|
||||
m_widgetListFolder->SetFill(bvec2(false,true));
|
||||
mySizerHori->SubWidgetAdd(m_widgetListFolder);
|
||||
}
|
||||
mySpacer = new widget::Spacer();
|
||||
@ -165,10 +165,8 @@ widget::FileChooser::FileChooser(void)
|
||||
m_widgetListFile->SetShowHiddenFiles(false);
|
||||
m_widgetListFile->RegisterOnEvent(this, ewolEventFSFileSelect, ewolEventFileChooserListFile);
|
||||
m_widgetListFile->RegisterOnEvent(this, ewolEventFSFileValidate, ewolEventFileChooserListFileValidate);
|
||||
m_widgetListFile->SetExpendX(true);
|
||||
m_widgetListFile->SetFillX(true);
|
||||
m_widgetListFile->SetExpendY(true);
|
||||
m_widgetListFile->SetFillY(true);
|
||||
m_widgetListFile->SetExpand(bvec2(true,true));
|
||||
m_widgetListFile->SetFill(bvec2(true,true));
|
||||
mySizerHori->SubWidgetAdd(m_widgetListFile);
|
||||
}
|
||||
mySpacer = new widget::Spacer();
|
||||
@ -188,7 +186,7 @@ widget::FileChooser::FileChooser(void)
|
||||
if (NULL == myImage) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
myImage->SetFillY(true);
|
||||
myImage->SetFill(bvec2(false,true));
|
||||
mySizerHori->SubWidgetAdd(myImage);
|
||||
}
|
||||
m_widgetCurrentFileName = new widget::Entry(m_file);
|
||||
@ -197,8 +195,8 @@ widget::FileChooser::FileChooser(void)
|
||||
} else {
|
||||
m_widgetCurrentFileName->RegisterOnEvent(this, ewolEventEntryModify, ewolEventFileChooserEntryFile);
|
||||
m_widgetCurrentFileName->RegisterOnEvent(this, ewolEventEntryEnter, ewolEventFileChooserEntryFileEnter);
|
||||
m_widgetCurrentFileName->SetExpendX(true);
|
||||
m_widgetCurrentFileName->SetFillX(true);
|
||||
m_widgetCurrentFileName->SetExpand(bvec2(true,false));
|
||||
m_widgetCurrentFileName->SetFill(bvec2(true,false));
|
||||
m_widgetCurrentFileName->SetWidth(200);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCurrentFileName);
|
||||
}
|
||||
@ -212,7 +210,7 @@ widget::FileChooser::FileChooser(void)
|
||||
if (NULL == myImage) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
myImage->SetFillY(true);
|
||||
myImage->SetFill(bvec2(false,true));
|
||||
mySizerHori->SubWidgetAdd(myImage);
|
||||
}
|
||||
|
||||
@ -222,8 +220,8 @@ widget::FileChooser::FileChooser(void)
|
||||
} else {
|
||||
m_widgetCurrentFolder->RegisterOnEvent(this, ewolEventEntryModify, ewolEventFileChooserEntryFolder);
|
||||
m_widgetCurrentFolder->RegisterOnEvent(this, ewolEventEntryEnter, ewolEventFileChooserEntryFolderEnter);
|
||||
m_widgetCurrentFolder->SetExpendX(true);
|
||||
m_widgetCurrentFolder->SetFillX(true);
|
||||
m_widgetCurrentFolder->SetExpand(bvec2(true,false));
|
||||
m_widgetCurrentFolder->SetFill(bvec2(true,false));
|
||||
m_widgetCurrentFolder->SetWidth(200);
|
||||
mySizerHori->SubWidgetAdd(m_widgetCurrentFolder);
|
||||
}
|
||||
@ -232,7 +230,7 @@ widget::FileChooser::FileChooser(void)
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
myImage->RegisterOnEvent(this, ewolEventImagePressed, ewolEventFileChooserHome);
|
||||
myImage->SetFillY(true);
|
||||
myImage->SetFill(bvec2(false,true));
|
||||
mySizerHori->SubWidgetAdd(myImage);
|
||||
}
|
||||
}
|
||||
|
@ -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(true);
|
||||
mySizerVert->LockExpendContamination(bvec2(true,true));
|
||||
// set it in the pop-up-system :
|
||||
SubWidgetSet(mySizerVert);
|
||||
|
||||
@ -62,7 +62,7 @@ widget::Parameter::Parameter(void) :
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetExpendX(true);
|
||||
mySpacer->SetExpand(bvec2(true,false));
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
@ -91,15 +91,15 @@ widget::Parameter::Parameter(void) :
|
||||
} else {
|
||||
|
||||
m_paramList->RegisterOnEvent(this, ewolEventParameterListSelect, l_eventMenuSelected);
|
||||
m_paramList->SetFillY(true);
|
||||
m_paramList->SetExpendY(true);
|
||||
m_paramList->SetFill(bvec2(false,true));
|
||||
m_paramList->SetExpand(bvec2(false,true));
|
||||
mySizerHori->SubWidgetAdd(m_paramList);
|
||||
}
|
||||
mySpacer = new widget::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetExpendY(true);
|
||||
mySpacer->SetFill(bvec2(false,true));
|
||||
mySpacer->SetSize(5);
|
||||
mySpacer->SetColor(0x000000BF);
|
||||
mySizerHori->SubWidgetAdd(mySpacer);
|
||||
@ -115,7 +115,7 @@ widget::Parameter::Parameter(void) :
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetExpendX(true);
|
||||
mySpacer->SetExpand(bvec2(true,false));
|
||||
mySpacer->SetSize(5);
|
||||
mySpacer->SetColor(0x000000BF);
|
||||
mySizerVert2->SubWidgetAdd(mySpacer);
|
||||
@ -125,8 +125,7 @@ widget::Parameter::Parameter(void) :
|
||||
if (NULL == m_wSlider) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_wSlider->SetExpendX(true);
|
||||
m_wSlider->SetExpendY(true);
|
||||
m_wSlider->SetExpand(bvec2(true,true));
|
||||
mySizerVert2->SubWidgetAdd(m_wSlider);
|
||||
}
|
||||
}
|
||||
@ -136,7 +135,7 @@ widget::Parameter::Parameter(void) :
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
mySpacer->SetExpendX(true);
|
||||
mySpacer->SetExpand(bvec2(true,false));
|
||||
mySpacer->SetSize(5);
|
||||
mySpacer->SetColor(0x000000BF);
|
||||
mySizerVert->SubWidgetAdd(mySpacer);
|
||||
@ -146,7 +145,7 @@ widget::Parameter::Parameter(void) :
|
||||
if (NULL == m_widgetTitle) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
m_widgetTitle->SetExpendX(true);
|
||||
m_widgetTitle->SetExpand(bvec2(true,false));
|
||||
mySizerVert->SubWidgetAdd(m_widgetTitle);
|
||||
}
|
||||
}
|
||||
@ -225,8 +224,7 @@ void widget::Parameter::MenuAdd(etk::UString label, etk::UString image, ewol::Wi
|
||||
if (NULL == myLabel) {
|
||||
EWOL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
myLabel->SetExpendY(true);
|
||||
myLabel->SetExpendX(true);
|
||||
myLabel->SetExpand(bvec2(true,true));
|
||||
m_wSlider->SubWidgetAdd(myLabel);
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ widget::ParameterList::~ParameterList(void)
|
||||
}
|
||||
|
||||
|
||||
bool widget::ParameterList::CalculateMinSize(void)
|
||||
void widget::ParameterList::CalculateMinSize(void)
|
||||
{
|
||||
/*int32_t fontId = GetDefaultFontId();
|
||||
int32_t minWidth = ewol::GetWidth(fontId, m_label);
|
||||
@ -60,7 +60,6 @@ bool widget::ParameterList::CalculateMinSize(void)
|
||||
m_minSize.y = 3+minHeight;
|
||||
*/
|
||||
m_minSize.setValue(150, 150);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace widget {
|
||||
class ParameterList :public widget::WidgetScrooled
|
||||
{
|
||||
private:
|
||||
int32_t m_idSelected;
|
||||
int32_t m_idSelected;
|
||||
etk::Vector<widget::elementPL *> m_list;
|
||||
public:
|
||||
ParameterList(void);
|
||||
@ -46,26 +46,26 @@ namespace widget {
|
||||
virtual const char * const GetObjectType(void) { return "EwolParameterList"; };
|
||||
virtual ~ParameterList(void);
|
||||
// Derived function
|
||||
virtual bool CalculateMinSize(void);
|
||||
void SetLabel(etk::UString newLabel);
|
||||
virtual void CalculateMinSize(void);
|
||||
void SetLabel(etk::UString newLabel);
|
||||
// Drawing capabilities ....
|
||||
private:
|
||||
etk::Vector<ewol::Compositing*> m_listOObject; //!< generic element to display...
|
||||
public:
|
||||
void AddOObject(ewol::Compositing* newObject, int32_t pos=-1);
|
||||
void ClearOObjectList(void);
|
||||
void AddOObject(ewol::Compositing* newObject, int32_t pos=-1);
|
||||
void ClearOObjectList(void);
|
||||
protected:
|
||||
// Derived function
|
||||
void OnDraw(ewol::DrawProperty& displayProp);
|
||||
// list properties ...
|
||||
private:
|
||||
int32_t m_paddingSizeX;
|
||||
int32_t m_paddingSizeY;
|
||||
int32_t m_displayStartRaw; //!< Current starting diaplayed raw
|
||||
int32_t m_displayCurrentNbLine; //!< Number of line in the display
|
||||
int32_t m_paddingSizeX;
|
||||
int32_t m_paddingSizeY;
|
||||
int32_t m_displayStartRaw; //!< Current starting diaplayed raw
|
||||
int32_t m_displayCurrentNbLine; //!< Number of line in the display
|
||||
public:
|
||||
// Derived function
|
||||
void OnRegenerateDisplay(void);
|
||||
void OnRegenerateDisplay(void);
|
||||
// Derived function
|
||||
bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
|
||||
protected:
|
||||
|
Loading…
x
Reference in New Issue
Block a user