[DEV] remove unneded debug log

This commit is contained in:
Edouard DUPIN 2013-05-17 21:00:37 +02:00
parent 13802b799c
commit 90ca5367e8
16 changed files with 244 additions and 164 deletions

2
external/etk vendored

@ -1 +1 @@
Subproject commit 7dca8979c6548a6d0f355c2c33535c3a553ef8a0 Subproject commit 8acac8918b8899a4ededb35e99469ac7227465fe

View File

@ -121,7 +121,7 @@ void ewol::Dimension::Set(etk::UString _config)
} }
vec2 tmp = _config; vec2 tmp = _config;
Set(tmp, type); Set(tmp, type);
EWOL_ERROR(" config dimention : \"" << _config << "\" ==> " << *this ); EWOL_VERBOSE(" config dimention : \"" << _config << "\" ==> " << *this );
} }
ewol::Dimension::~Dimension(void) ewol::Dimension::~Dimension(void)
@ -309,8 +309,8 @@ etk::CCout& ewol::operator <<(etk::CCout &os, const ewol::Dimension::distance_te
return os; return os;
} }
etk::CCout& ewol::operator <<(etk::CCout &os, const ewol::Dimension& obj) etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::Dimension& _obj)
{ {
os << obj.Get(obj.GetType()) << obj.GetType(); _os << _obj.Get(_obj.GetType()) << _obj.GetType();
return os; return _os;
} }

View File

@ -215,9 +215,9 @@ void ewol::Text::Clear(void)
void ewol::Text::Reset(void) void ewol::Text::Reset(void)
{ {
m_position = vec3(0.0, 0.0, 0.0); m_position = vec3(0,0,0);
m_clippingPosStart = vec3(0.0, 0.0, 0.0); m_clippingPosStart = vec3(0,0,0);
m_clippingPosStop = vec3(0.0, 0.0, 0.0); m_clippingPosStop = vec3(0,0,0);
m_sizeDisplayStart = m_position; m_sizeDisplayStart = m_position;
m_sizeDisplayStop = m_position; m_sizeDisplayStop = m_position;
m_nbCharDisplayed = 0; m_nbCharDisplayed = 0;
@ -470,8 +470,12 @@ void ewol::Text::ParseHtmlNode(void* element2)
{ {
// get the static real pointer // get the static real pointer
TiXmlNode* element = static_cast<TiXmlNode*>(element2); TiXmlNode* element = static_cast<TiXmlNode*>(element2);
if (NULL != element) { if (NULL == element) {
for (TiXmlNode * child = element->FirstChild(); NULL != child ; child = child->NextSibling() ) { EWOL_ERROR( "Error Input node does not existed ...");
}
for( TiXmlNode * child = element->FirstChild() ;
NULL != child ;
child = child->NextSibling() ) {
if (child->Type()==TiXmlNode::TINYXML_COMMENT) { if (child->Type()==TiXmlNode::TINYXML_COMMENT) {
// nothing to do ... // nothing to do ...
} else if (child->Type()==TiXmlNode::TINYXML_TEXT) { } else if (child->Type()==TiXmlNode::TINYXML_TEXT) {
@ -553,19 +557,18 @@ void ewol::Text::ParseHtmlNode(void* element2)
EWOL_ERROR("(l "<< child->Row() << ") node not suported type : " << child->Type() << " val=\""<< child->Value() << "\"" ); EWOL_ERROR("(l "<< child->Row() << ") node not suported type : " << child->Type() << " val=\""<< child->Value() << "\"" );
} }
} }
}
} }
void ewol::Text::PrintDecorated(etk::UString& text) void ewol::Text::PrintDecorated(const etk::UString& _text)
{ {
etk::UString tmpData("<html><body>\n"); etk::UString tmpData("<html><body>\n");
tmpData+=text; tmpData+=_text;
tmpData+="\n</body></html>\n"; tmpData+="\n</body></html>\n";
//EWOL_DEBUG("plop : " << tmpData); //EWOL_DEBUG("plop : " << tmpData);
PrintHTML(tmpData); PrintHTML(tmpData);
} }
void ewol::Text::PrintHTML(etk::UString text) void ewol::Text::PrintHTML(const etk::UString& _text)
{ {
TiXmlDocument XmlDocument; TiXmlDocument XmlDocument;
@ -574,20 +577,24 @@ void ewol::Text::PrintHTML(etk::UString text)
m_htmlDecoTmp.m_colorFg = draw::color::black; m_htmlDecoTmp.m_colorFg = draw::color::black;
m_htmlDecoTmp.m_mode = ewol::font::Regular; m_htmlDecoTmp.m_mode = ewol::font::Regular;
etk::Char tmpChar = _text.c_str();
// load the XML from the memory // load the XML from the memory
bool loadError = XmlDocument.Parse((const char*)text.c_str(), 0, TIXML_ENCODING_UTF8); bool loadError = XmlDocument.Parse(tmpChar, 0, TIXML_ENCODING_UTF8);
if (false == loadError) { if (false == loadError) {
EWOL_ERROR( "can not load Hightlight XML: PARSING error: Decorated text "); EWOL_ERROR( "can not load XML: PARSING error: Decorated text ");
return; return;
} }
TiXmlElement* root = XmlDocument.FirstChildElement( "html" ); TiXmlElement* root = XmlDocument.FirstChildElement( "html" );
if (NULL == root) { if (NULL == root) {
EWOL_ERROR( "can not load Hightlight XML: main node not find: \"html\""); EWOL_ERROR( "can not load XML: main node not find: \"html\"");
return; return;
} }
TiXmlElement* bodyNode = root->FirstChildElement( "body" ); TiXmlElement* bodyNode = root->FirstChildElement( "body" );
if (NULL == root) {
EWOL_ERROR( "can not load XML: main node not find: \"body\"");
return;
}
(void)ParseHtmlNode(bodyNode); (void)ParseHtmlNode(bodyNode);
HtmlFlush(); HtmlFlush();
} }
@ -601,6 +608,8 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
draw::Color tmpFg(m_color); draw::Color tmpFg(m_color);
draw::Color tmpBg(m_colorBg); draw::Color tmpBg(m_colorBg);
if (m_alignement == ewol::Text::alignDisable) { if (m_alignement == ewol::Text::alignDisable) {
//EWOL_DEBUG(" 1 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position);
// display the cursor if needed (if it is at the start position...)
if (true == m_needDisplay) { if (true == m_needDisplay) {
if (0==m_cursorPos) { if (0==m_cursorPos) {
m_vectorialDraw.SetPos(m_position); m_vectorialDraw.SetPos(m_position);
@ -610,11 +619,13 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
} }
// note this is faster when nothing is requested ... // note this is faster when nothing is requested ...
for(int32_t iii=0; iii<text.Size(); iii++) { for(int32_t iii=0; iii<text.Size(); iii++) {
// check if ve have decoration
if (iii<decoration.Size()) { if (iii<decoration.Size()) {
tmpFg = decoration[iii].m_colorFg; tmpFg = decoration[iii].m_colorFg;
tmpBg = decoration[iii].m_colorBg; tmpBg = decoration[iii].m_colorBg;
SetFontMode(decoration[iii].m_mode); SetFontMode(decoration[iii].m_mode);
} }
// if real display : ( not display is for size calculation)
if (true == m_needDisplay) { if (true == m_needDisplay) {
if( ( m_selectionStartPos-1<iii if( ( m_selectionStartPos-1<iii
&& iii <=m_cursorPos-1) && iii <=m_cursorPos-1)
@ -639,6 +650,7 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
Print(text[iii]); Print(text[iii]);
m_nbCharDisplayed++; m_nbCharDisplayed++;
} }
// display the cursor if needed (if it is at the other position...)
if (true == m_needDisplay) { if (true == m_needDisplay) {
if (iii==m_cursorPos-1) { if (iii==m_cursorPos-1) {
m_vectorialDraw.SetPos(m_position); m_vectorialDraw.SetPos(m_position);
@ -647,7 +659,9 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
} }
} }
} }
//EWOL_DEBUG(" 2 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position);
} else { } else {
//EWOL_DEBUG(" 3 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position);
// special start case at the right of the endpoint : // special start case at the right of the endpoint :
if (m_stopTextPos < m_position.x()) { if (m_stopTextPos < m_position.x()) {
ForceLineReturn(); ForceLineReturn();
@ -773,11 +787,12 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
currentId = stop; currentId = stop;
} }
} }
//EWOL_DEBUG(" 4 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position);
} }
} }
void ewol::Text::Print(const uniChar_t charcode) void ewol::Text::Print(const uniChar_t& charcode)
{ {
if (NULL==m_font) { if (NULL==m_font) {
EWOL_ERROR("Font Id is not corectly defined"); EWOL_ERROR("Font Id is not corectly defined");
@ -793,11 +808,11 @@ void ewol::Text::Print(const uniChar_t charcode)
int32_t fontHeigh = m_font->GetHeight(m_mode); int32_t fontHeigh = m_font->GetHeight(m_mode);
// Get the kerning ofset : // Get the kerning ofset :
float kerningOffset = 0.0; float kerningOffset = 0;
if (true==m_kerning) { if (true==m_kerning) {
kerningOffset = myGlyph->KerningGet(m_previousCharcode); kerningOffset = myGlyph->KerningGet(m_previousCharcode);
if (kerningOffset != 0) { if (kerningOffset != 0) {
//EWOL_DEBUG("Kerning between : '" << (char)m_previousCharcode << "'&'" << (char)myGlyph->m_UVal << "' value : " << kerningOffset); //EWOL_DEBUG("Kerning between : '" << m_previousCharcode << "'&'" << myGlyph->m_UVal << "' value : " << kerningOffset);
} }
} }
// 0x01 == 0x20 == ' '; // 0x01 == 0x20 == ' ';
@ -941,7 +956,9 @@ void ewol::Text::Print(const uniChar_t charcode)
} }
} }
// move the position : // move the position :
//EWOL_DEBUG(" 5 pos=" << m_position << " advance=" << myGlyph->m_advance.x() << " kerningOffset=" << kerningOffset);
m_position.setX(m_position.x() + myGlyph->m_advance.x() + kerningOffset); m_position.setX(m_position.x() + myGlyph->m_advance.x() + kerningOffset);
//EWOL_DEBUG(" 6 print '" << charcode << "' : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position);
// Register the previous character // Register the previous character
m_previousCharcode = charcode; m_previousCharcode = charcode;
return; return;
@ -981,13 +998,16 @@ vec3 ewol::Text::CalculateSizeHTML(const etk::UString& text)
{ {
// remove intermediate result // remove intermediate result
Reset(); Reset();
//EWOL_DEBUG(" 0 size for=\n" << text);
// disable display system // disable display system
m_needDisplay = false; m_needDisplay = false;
SetPos(vec3(0,0,0) ); SetPos(vec3(0,0,0) );
// same as print without the end display ... // same as print without the end display ...
PrintHTML(text); PrintHTML(text);
//EWOL_DEBUG(" 1 Start pos=" << m_sizeDisplayStart);
//EWOL_DEBUG(" 1 Stop pos=" << m_sizeDisplayStop);
// get the last elements // get the last elements
m_sizeDisplayStop.setValue(etk_max(m_position.x(), m_sizeDisplayStop.x()) , m_sizeDisplayStop.setValue(etk_max(m_position.x(), m_sizeDisplayStop.x()) ,
etk_max(m_position.y(), m_sizeDisplayStop.y()) , etk_max(m_position.y(), m_sizeDisplayStop.y()) ,
@ -996,6 +1016,8 @@ vec3 ewol::Text::CalculateSizeHTML(const etk::UString& text)
etk_min(m_position.y(), m_sizeDisplayStart.y()) , etk_min(m_position.y(), m_sizeDisplayStart.y()) ,
0); 0);
//EWOL_DEBUG(" 2 Start pos=" << m_sizeDisplayStart);
//EWOL_DEBUG(" 2 Stop pos=" << m_sizeDisplayStop);
// set back the display system // set back the display system
m_needDisplay = true; m_needDisplay = true;
@ -1006,6 +1028,9 @@ vec3 ewol::Text::CalculateSizeHTML(const etk::UString& text)
vec3 ewol::Text::CalculateSizeDecorated(const etk::UString& text) vec3 ewol::Text::CalculateSizeDecorated(const etk::UString& text)
{ {
if (text.Size()==0) {
return vec3(0,0,0);
}
etk::UString tmpData("<html><body>\n"); etk::UString tmpData("<html><body>\n");
tmpData+=text; tmpData+=text;
tmpData+="\n</body></html>\n"; tmpData+="\n</body></html>\n";

View File

@ -254,7 +254,7 @@ namespace ewol
* @param[in] text The string to display. * @param[in] text The string to display.
* @TODO : implementation not done .... * @TODO : implementation not done ....
*/ */
void PrintDecorated(etk::UString& text); void PrintDecorated(const etk::UString& text);
/** /**
* @brief Display a compleat string in the current element with the generic decoration specification. (basic html data) * @brief Display a compleat string in the current element with the generic decoration specification. (basic html data)
* <pre> * <pre>
@ -286,7 +286,7 @@ namespace ewol
* @param[in] text The string to display. * @param[in] text The string to display.
* @TODO : implementation not done .... * @TODO : implementation not done ....
*/ */
void PrintHTML(etk::UString text); void PrintHTML(const etk::UString& text);
/** /**
* @brief Display a compleat string in the current element whith specific decorations (advence mode). * @brief Display a compleat string in the current element whith specific decorations (advence mode).
* @param[in] text The string to display. * @param[in] text The string to display.
@ -297,7 +297,7 @@ namespace ewol
* @brief Display the current char in the current element (note that the kerning is availlable if the position is not changed) * @brief Display the current char in the current element (note that the kerning is availlable if the position is not changed)
* @param[in] char that might be dispalyed * @param[in] char that might be dispalyed
*/ */
void Print(const uniChar_t charcode); void Print(const uniChar_t& charcode);
/** /**
* @brief This Generate the line return ==> it return to the alignement position start and at the correct line position ==> it might be use to not know the line height * @brief This Generate the line return ==> it return to the alignement position start and at the correct line position ==> it might be use to not know the line height
*/ */

View File

@ -16,6 +16,29 @@
#include <ewol/renderer/resources/font/FontBase.h> #include <ewol/renderer/resources/font/FontBase.h>
#include <ewol/renderer/resources/TexturedFont.h> #include <ewol/renderer/resources/TexturedFont.h>
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::font::mode_te& _obj)
{
switch(_obj) {
default :
_os << "error";
break;
case ewol::font::Regular:
_os << "Regular";
break;
case ewol::font::Italic:
_os << "Italic";
break;
case ewol::font::Bold:
_os << "Bold";
break;
case ewol::font::BoldItalic:
_os << "BoldItalic";
break;
}
return _os;
}
#undef __class__ #undef __class__
#define __class__ "TexturedFont" #define __class__ "TexturedFont"
@ -154,13 +177,14 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) :
// try to find the reference mode : // try to find the reference mode :
ewol::font::mode_te refMode = ewol::font::Regular; ewol::font::mode_te refMode = ewol::font::Regular;
for(int32_t iii=3; iii>=0; iii--) { for(int32_t iii=3; iii>=0; iii--) {
if (m_fileName[iii] != "") { if (m_fileName[iii].IsEmpty()==false) {
refMode = (ewol::font::mode_te)iii; refMode = (ewol::font::mode_te)iii;
} }
} }
EWOL_DEBUG(" Set reference mode : " << refMode);
// generate the wrapping on the preventing error // generate the wrapping on the preventing error
for(int32_t iii=3; iii>=0; iii--) { for(int32_t iii=3; iii>=0; iii--) {
if (m_fileName[iii] != "") { if (m_fileName[iii].IsEmpty()==false) {
m_modeWraping[iii] = (ewol::font::mode_te)iii; m_modeWraping[iii] = (ewol::font::mode_te)iii;
} else { } else {
m_modeWraping[iii] = refMode; m_modeWraping[iii] = refMode;
@ -168,8 +192,8 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) :
} }
for (int32_t iiiFontId=0; iiiFontId<4 ; iiiFontId++) { for (int32_t iiiFontId=0; iiiFontId<4 ; iiiFontId++) {
if (m_fileName[iiiFontId] == "") { if (m_fileName[iiiFontId].IsEmpty()==false) {
EWOL_CRITICAL("can not load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" ==> size=" << m_size ); EWOL_DEBUG("can not load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" ==> size=" << m_size );
m_font[iiiFontId] = NULL; m_font[iiiFontId] = NULL;
continue; continue;
} }
@ -275,6 +299,11 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) :
EWOL_DEBUG("End generation of the Fond bitmap, start adding texture"); EWOL_DEBUG("End generation of the Fond bitmap, start adding texture");
//m_data.DistanceField(); //m_data.DistanceField();
Flush(); Flush();
EWOL_DEBUG("Wrapping properties : ");
EWOL_DEBUG(" " << ewol::font::Regular << "==>" << GetWrappingMode(ewol::font::Regular));
EWOL_DEBUG(" " << ewol::font::Italic << "==>" << GetWrappingMode(ewol::font::Italic));
EWOL_DEBUG(" " << ewol::font::Bold << "==>" << GetWrappingMode(ewol::font::Bold));
EWOL_DEBUG(" " << ewol::font::BoldItalic << "==>" << GetWrappingMode(ewol::font::BoldItalic));
} }
ewol::TexturedFont::~TexturedFont(void) ewol::TexturedFont::~TexturedFont(void)
@ -298,7 +327,7 @@ bool ewol::TexturedFont::HasName(const etk::UString& fileName)
} }
int32_t ewol::TexturedFont::GetIndex(const uniChar_t charcode, const ewol::font::mode_te displayMode) const int32_t ewol::TexturedFont::GetIndex(const uniChar_t& charcode, const ewol::font::mode_te displayMode) const
{ {
if (charcode < 0x20) { if (charcode < 0x20) {
return 0; return 0;
@ -306,7 +335,7 @@ int32_t ewol::TexturedFont::GetIndex(const uniChar_t charcode, const ewol::font:
return charcode.Get() - 0x1F; return charcode.Get() - 0x1F;
} else { } else {
for (int32_t iii=0x80-0x20; iii < m_listElement[displayMode].Size(); iii++) { for (int32_t iii=0x80-0x20; iii < m_listElement[displayMode].Size(); iii++) {
if ((m_listElement[displayMode])[iii].m_UVal == charcode) { if (charcode == (m_listElement[displayMode])[iii].m_UVal) {
return iii; return iii;
} }
} }
@ -315,8 +344,22 @@ int32_t ewol::TexturedFont::GetIndex(const uniChar_t charcode, const ewol::font:
} }
ewol::GlyphProperty* ewol::TexturedFont::GetGlyphPointer(const uniChar_t charcode, const ewol::font::mode_te displayMode) ewol::GlyphProperty* ewol::TexturedFont::GetGlyphPointer(const uniChar_t& _charcode, const ewol::font::mode_te _displayMode)
{ {
int32_t index = GetIndex(charcode, displayMode); //EWOL_DEBUG("Get glyph property for mode: " << _displayMode << " ==> wrapping index : " << m_modeWraping[_displayMode]);
return &((m_listElement[displayMode])[index]); int32_t index = GetIndex(_charcode, _displayMode);
if( index <0
|| index >=m_listElement[_displayMode].Size() ) {
EWOL_ERROR(" Try to get glyph index inexistant ... ==> return the index 0 ... id=" << index);
if (m_listElement[_displayMode].Size()>=0) {
return &((m_listElement[_displayMode])[0]);
}
return NULL;
}
//EWOL_ERROR(" index=" << index);
//EWOL_ERROR(" m_UVal=" << m_listElement[_displayMode][index].m_UVal);
//EWOL_ERROR(" m_glyphIndex=" << m_listElement[_displayMode][index].m_glyphIndex);
//EWOL_ERROR(" m_advance=" << m_listElement[_displayMode][index].m_advance);
//EWOL_ERROR(" m_bearing=" << m_listElement[_displayMode][index].m_bearing);
return &((m_listElement[_displayMode])[index]);
} }

View File

@ -25,6 +25,8 @@ namespace ewol
BoldItalic, BoldItalic,
} mode_te; } mode_te;
}; };
etk::CCout& operator <<(etk::CCout& _os, const ewol::font::mode_te& _obj);
class TexturedFont : public ewol::Texture { class TexturedFont : public ewol::Texture {
private: private:
@ -65,14 +67,14 @@ namespace ewol
* @param[in] displayMode Mode to display the currrent font * @param[in] displayMode Mode to display the currrent font
* @return The ID in the table (if it does not exist : return 0) * @return The ID in the table (if it does not exist : return 0)
*/ */
int32_t GetIndex(const uniChar_t charcode, const ewol::font::mode_te displayMode) const; int32_t GetIndex(const uniChar_t& charcode, const ewol::font::mode_te displayMode) const;
/** /**
* @brief Get the pointer on the coresponding glyph * @brief Get the pointer on the coresponding glyph
* @param[in] charcode The unicodeValue * @param[in] charcode The unicodeValue
* @param[in] displayMode Mode to display the currrent font * @param[in] displayMode Mode to display the currrent font
* @return The pointer on the glyph ==> never NULL * @return The pointer on the glyph ==> never NULL
*/ */
ewol::GlyphProperty* GetGlyphPointer(const uniChar_t charcode, const ewol::font::mode_te displayMode); ewol::GlyphProperty* GetGlyphPointer(const uniChar_t& charcode, const ewol::font::mode_te displayMode);
/** /**
* @brief The wrapping mode is used to prevent the non existance of a specific mode. * @brief The wrapping mode is used to prevent the non existance of a specific mode.
* For exemple when a blod mode does not exist, this resend a regular mode. * For exemple when a blod mode does not exist, this resend a regular mode.

View File

@ -62,6 +62,15 @@ namespace ewol
private: private:
etk::Vector<ewol::Kerning> m_kerning; //!< kerning values of link of all elements etk::Vector<ewol::Kerning> m_kerning; //!< kerning values of link of all elements
public: public:
GlyphProperty(void) :
m_UVal(0),
m_glyphIndex(0),
m_sizeTexture(0,0),
m_bearing(0,0),
m_advance(0,0),
m_texturePosStart(0,0),
m_texturePosStop(0,0)
{ };
float KerningGet(const uniChar_t charcode) float KerningGet(const uniChar_t charcode)
{ {
for(int32_t iii=0; iii<m_kerning.Size(); iii++ ) { for(int32_t iii=0; iii<m_kerning.Size(); iii++ ) {

View File

@ -135,10 +135,12 @@ void widget::Button::CalculateSize(const vec2& _availlable)
// set minimal size // set minimal size
m_size = m_minSize; m_size = m_minSize;
/*
if (m_origin.x()<0) { if (m_origin.x()<0) {
EWOL_ERROR("[" << GetId() << "] position error ori=" << m_origin << " size=" << m_size); EWOL_ERROR("[" << GetId() << "] position error ori=" << m_origin << " size=" << m_size);
etk::DisplayBacktrace(); etk::DisplayBacktrace();
} }
*/
vec2 minimumSizeBase(0,0); vec2 minimumSizeBase(0,0);
vec2 minimumSizeToggle(0,0); vec2 minimumSizeToggle(0,0);
@ -195,6 +197,7 @@ void widget::Button::CalculateMinMaxSize(void)
m_minSize += padding*2.0f; m_minSize += padding*2.0f;
// verify the min max of the min size ... // verify the min max of the min size ...
CheckMinSize(); CheckMinSize();
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Result min size : " << m_minSize);
MarkToRedraw(); MarkToRedraw();
} }

View File

@ -44,22 +44,22 @@ bool widget::Composer::LoadFromFile(const etk::UString& _fileName)
// open the curent File // open the curent File
etk::FSNode fileName(_fileName); etk::FSNode fileName(_fileName);
if (false == fileName.Exist()) { if (false == fileName.Exist()) {
EWOL_ERROR("File Does not exist : " << fileName); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} File Does not exist : " << fileName);
return false; return false;
} }
int32_t fileSize = fileName.FileSize(); int32_t fileSize = fileName.FileSize();
if (0==fileSize) { if (0==fileSize) {
EWOL_ERROR("This file is empty : " << fileName); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} This file is empty : " << fileName);
return false; return false;
} }
if (false == fileName.FileOpenRead()) { if (false == fileName.FileOpenRead()) {
EWOL_ERROR("Can not open the file : " << fileName); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Can not open the file : " << fileName);
return false; return false;
} }
// allocate data // allocate data
char * fileBuffer = new char[fileSize+5]; char * fileBuffer = new char[fileSize+5];
if (NULL == fileBuffer) { if (NULL == fileBuffer) {
EWOL_ERROR("Error Memory allocation size=" << fileSize); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Error Memory allocation size=" << fileSize);
return false; return false;
} }
memset(fileBuffer, 0, (fileSize+5)*sizeof(char)); memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
@ -93,7 +93,7 @@ bool widget::Composer::CommonLoadXML(const char* data)
TiXmlElement* root = XmlDocument.FirstChildElement("composer"); TiXmlElement* root = XmlDocument.FirstChildElement("composer");
if (NULL == root ) { if (NULL == root ) {
EWOL_ERROR("(l ?) main node not find: \"composer\" ..."); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} (l ?) main node not find: \"composer\" ...");
return false; return false;
} }
// call upper class to parse his elements ... // call upper class to parse his elements ...
@ -113,6 +113,6 @@ void widget::Composer::RegisterOnEventNameWidget(const etk::UString& _subWidgetN
//EWOL_DEBUG("Find widget named : \"" << _subWidgetName << "\" register event=\"" << _eventId << "\""); //EWOL_DEBUG("Find widget named : \"" << _subWidgetName << "\" register event=\"" << _eventId << "\"");
tmpWidget->RegisterOnEvent(this, _eventId, _eventIdgenerated, _overloadData); tmpWidget->RegisterOnEvent(this, _eventId, _eventIdgenerated, _overloadData);
} else { } else {
EWOL_WARNING("Can not register event : \"" << _eventId << "\" the widget named=\"" << _subWidgetName << "\" does not exist"); EWOL_WARNING("[" << GetId() << "] {" << GetObjectType() << "} Can not register event : \"" << _eventId << "\" the widget named=\"" << _subWidgetName << "\" does not exist");
} }
} }

View File

@ -54,7 +54,7 @@ void widget::Container::SubWidgetRemove(void)
delete(m_subWidget); delete(m_subWidget);
// might have been destroy first here : // might have been destroy first here :
if (m_subWidget!=NULL) { if (m_subWidget!=NULL) {
EWOL_ERROR("Composer : An error Occured when removing main node"); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} An error Occured when removing main node");
} }
MarkToRedraw(); MarkToRedraw();
ewol::RequestUpdateSize(); ewol::RequestUpdateSize();
@ -133,7 +133,7 @@ void widget::Container::CalculateMinMaxSize(void)
vec2 min = m_subWidget->GetCalculateMinSize(); vec2 min = m_subWidget->GetCalculateMinSize();
m_minSize.setMax(min); m_minSize.setMax(min);
} }
EWOL_ERROR("[" << GetId() << "] Result min size : " << m_minSize); //EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Result min size : " << m_minSize);
} }
void widget::Container::OnRegenerateDisplay(void) void widget::Container::OnRegenerateDisplay(void)
@ -174,23 +174,23 @@ bool widget::Container::LoadXML(TiXmlNode* _node)
} }
etk::UString widgetName = pNode->Value(); etk::UString widgetName = pNode->Value();
if (ewol::widgetManager::Exist(widgetName) == false) { if (ewol::widgetManager::Exist(widgetName) == false) {
EWOL_ERROR("(l "<<pNode->Row()<<") Unknown basic node=\"" << widgetName << "\" not in : [" << ewol::widgetManager::List() << "]" ); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") Unknown basic node=\"" << widgetName << "\" not in : [" << ewol::widgetManager::List() << "]" );
continue; continue;
} }
if (NULL != GetSubWidget()) { if (NULL != GetSubWidget()) {
EWOL_ERROR("(l "<<pNode->Row()<<") " << __class__ << " Can only have one subWidget ??? node=\"" << widgetName << "\"" ); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") " << __class__ << " Can only have one subWidget ??? node=\"" << widgetName << "\"" );
continue; continue;
} }
EWOL_DEBUG("try to create subwidget : '" << widgetName << "'"); EWOL_DEBUG("[" << GetId() << "] {" << GetObjectType() << "} try to create subwidget : '" << widgetName << "'");
ewol::Widget* tmpWidget = ewol::widgetManager::Create(widgetName); ewol::Widget* tmpWidget = ewol::widgetManager::Create(widgetName);
if (tmpWidget == NULL) { if (tmpWidget == NULL) {
EWOL_ERROR ("(l "<<pNode->Row()<<") Can not create the widget : \"" << widgetName << "\""); EWOL_ERROR ("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") Can not create the widget : \"" << widgetName << "\"");
continue; continue;
} }
// add widget : // add widget :
SetSubWidget(tmpWidget); SetSubWidget(tmpWidget);
if (false == tmpWidget->LoadXML(pNode)) { if (false == tmpWidget->LoadXML(pNode)) {
EWOL_ERROR ("(l "<<pNode->Row()<<") can not load widget properties : \"" << widgetName << "\""); EWOL_ERROR ("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") can not load widget properties : \"" << widgetName << "\"");
return false; return false;
} }
} }

View File

@ -58,7 +58,7 @@ void widget::ContainerN::LockExpand(const bvec2& _lockExpand)
void widget::ContainerN::SubWidgetAdd(ewol::Widget* _newWidget) void widget::ContainerN::SubWidgetAdd(ewol::Widget* _newWidget)
{ {
if (NULL == _newWidget) { if (NULL == _newWidget) {
EWOL_ERROR("[" << GetId() << "] Try to add An empty Widget ... "); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Try to add An empty Widget ... ");
return; return;
} }
if (_newWidget!=NULL) { if (_newWidget!=NULL) {
@ -72,7 +72,7 @@ void widget::ContainerN::SubWidgetAdd(ewol::Widget* _newWidget)
void widget::ContainerN::SubWidgetAddStart(ewol::Widget* _newWidget) void widget::ContainerN::SubWidgetAddStart(ewol::Widget* _newWidget)
{ {
if (NULL == _newWidget) { if (NULL == _newWidget) {
EWOL_ERROR("[" << GetId() << "] Try to add start An empty Widget ... "); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Try to add start An empty Widget ... ");
return; return;
} }
if (_newWidget!=NULL) { if (_newWidget!=NULL) {
@ -95,7 +95,7 @@ void widget::ContainerN::SubWidgetRemove(ewol::Widget* _newWidget)
delete(m_subWidget[iii]); delete(m_subWidget[iii]);
// no remove, this element is removed with the function OnObjectRemove ==> it does not exist anymore ... // no remove, this element is removed with the function OnObjectRemove ==> it does not exist anymore ...
if (errorControl == m_subWidget.Size()) { if (errorControl == m_subWidget.Size()) {
EWOL_CRITICAL("[" << GetId() << "] The number of element might have been reduced ... ==> it is not the case ==> the herited class must call the \"OnObjectRemove\" function..."); EWOL_CRITICAL("[" << GetId() << "] {" << GetObjectType() << "} The number of element might have been reduced ... ==> it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
m_subWidget[iii] = NULL; m_subWidget[iii] = NULL;
m_subWidget.Erase(iii); m_subWidget.Erase(iii);
} }
@ -133,11 +133,11 @@ void widget::ContainerN::SubWidgetRemoveAll(void)
delete(m_subWidget[0]); delete(m_subWidget[0]);
// no remove, this element is removed with the function OnObjectRemove ==> it does not exist anymore ... // no remove, this element is removed with the function OnObjectRemove ==> it does not exist anymore ...
if (errorControl == m_subWidget.Size()) { if (errorControl == m_subWidget.Size()) {
EWOL_CRITICAL("[" << GetId() << "] The number of element might have been reduced ... ==> it is not the case ==> the herited class must call the \"OnObjectRemove\" function..."); EWOL_CRITICAL("[" << GetId() << "] {" << GetObjectType() << "} The number of element might have been reduced ... ==> it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
m_subWidget[0] = NULL; m_subWidget[0] = NULL;
} }
} else { } else {
EWOL_WARNING("[" << GetId() << "] Must not have null pointer on the subWidget list ..."); EWOL_WARNING("[" << GetId() << "] {" << GetObjectType() << "} Must not have null pointer on the subWidget list ...");
m_subWidget.Erase(0); m_subWidget.Erase(0);
} }
errorControl = m_subWidget.Size(); errorControl = m_subWidget.Size();
@ -168,7 +168,7 @@ void widget::ContainerN::OnObjectRemove(ewol::EObject* _removeObject)
// second step find if in all the elements ... // second step find if in all the elements ...
for(int32_t iii=m_subWidget.Size()-1; iii>=0; iii--) { for(int32_t iii=m_subWidget.Size()-1; iii>=0; iii--) {
if(m_subWidget[iii] == _removeObject) { if(m_subWidget[iii] == _removeObject) {
EWOL_VERBOSE("[" << GetId() << "]={" << GetObjectType() << "} Remove sizer sub Element [" << iii << "/" << m_subWidget.Size()-1 << "] ==> destroyed object"); EWOL_VERBOSE("[" << GetId() << "] {" << GetObjectType() << "} Remove sizer sub Element [" << iii << "/" << m_subWidget.Size()-1 << "] ==> destroyed object");
m_subWidget[iii] = NULL; m_subWidget[iii] = NULL;
m_subWidget.Erase(iii); m_subWidget.Erase(iii);
} }
@ -210,6 +210,7 @@ void widget::ContainerN::CalculateMinMaxSize(void)
m_subExpend.setValue(false, false); m_subExpend.setValue(false, false);
m_minSize.setValue(0,0); m_minSize.setValue(0,0);
m_maxSize.setValue(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE); m_maxSize.setValue(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE);
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Set min size : " << m_minSize);
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) { for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) { if (NULL != m_subWidget[iii]) {
m_subWidget[iii]->CalculateMinMaxSize(); m_subWidget[iii]->CalculateMinMaxSize();
@ -225,6 +226,7 @@ void widget::ContainerN::CalculateMinMaxSize(void)
etk_max(tmpSize.y(), m_minSize.y()) ); etk_max(tmpSize.y(), m_minSize.y()) );
} }
} }
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Result min size : " << m_minSize);
} }
void widget::ContainerN::OnRegenerateDisplay(void) void widget::ContainerN::OnRegenerateDisplay(void)
@ -294,12 +296,12 @@ bool widget::ContainerN::LoadXML(TiXmlNode* _node)
} }
etk::UString widgetName = pNode->Value(); etk::UString widgetName = pNode->Value();
if (ewol::widgetManager::Exist(widgetName) == false) { if (ewol::widgetManager::Exist(widgetName) == false) {
EWOL_ERROR("(l "<<pNode->Row()<<") Unknown basic node=\"" << widgetName << "\" not in : [" << ewol::widgetManager::List() << "]" ); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") Unknown basic node=\"" << widgetName << "\" not in : [" << ewol::widgetManager::List() << "]" );
continue; continue;
} }
ewol::Widget *subWidget = ewol::widgetManager::Create(widgetName); ewol::Widget *subWidget = ewol::widgetManager::Create(widgetName);
if (subWidget == NULL) { if (subWidget == NULL) {
EWOL_ERROR ("(l "<<pNode->Row()<<") Can not create the widget : \"" << widgetName << "\""); EWOL_ERROR ("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") Can not create the widget : \"" << widgetName << "\"");
continue; continue;
} }
// add sub element : // add sub element :
@ -309,7 +311,7 @@ bool widget::ContainerN::LoadXML(TiXmlNode* _node)
SubWidgetAddStart(subWidget); SubWidgetAddStart(subWidget);
} }
if (false == subWidget->LoadXML(pNode)) { if (false == subWidget->LoadXML(pNode)) {
EWOL_ERROR ("(l "<<pNode->Row()<<") can not load widget properties : \"" << widgetName << "\""); EWOL_ERROR ("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") can not load widget properties : \"" << widgetName << "\"");
return false; return false;
} }
} }

View File

@ -42,13 +42,17 @@ widget::Label::Label(etk::UString _newLabel)
void widget::Label::CalculateMinMaxSize(void) void widget::Label::CalculateMinMaxSize(void)
{ {
vec2 tmpMax = m_userMaxSize.GetPixel(); vec2 tmpMax = m_userMaxSize.GetPixel();
//EWOL_DEBUG("[" << GetId() << "] {" << GetObjectType() << "} tmpMax : " << tmpMax);
if (tmpMax.x() <= 999999) { if (tmpMax.x() <= 999999) {
m_text.SetTextAlignement(0, tmpMax.x()-4, ewol::Text::alignLeft); m_text.SetTextAlignement(0, tmpMax.x()-4, ewol::Text::alignLeft);
//EWOL_DEBUG("[" << GetId() << "] {" << GetObjectType() << "} Forcez Alignement ");
} }
vec3 minSize = m_text.CalculateSizeDecorated(m_label); vec3 minSize = m_text.CalculateSizeDecorated(m_label);
//EWOL_DEBUG("[" << GetId() << "] {" << GetObjectType() << "} minSize : " << minSize);
m_minSize.setX(etk_min(4 + minSize.x(), tmpMax.x())); m_minSize.setX(etk_min(4 + minSize.x(), tmpMax.x()));
m_minSize.setY(etk_min(4 + minSize.y(), tmpMax.y())); m_minSize.setY(etk_min(4 + minSize.y(), tmpMax.y()));
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Result min size : " << m_minSize);
} }
void widget::Label::SetLabel(const etk::UString& _newLabel) void widget::Label::SetLabel(const etk::UString& _newLabel)

View File

@ -34,35 +34,26 @@ widget::PopUp::~PopUp(void)
void widget::PopUp::CalculateSize(const vec2& _availlable) void widget::PopUp::CalculateSize(const vec2& _availlable)
{ {
ewol::Widget::CalculateSize(_availlable); ewol::Widget::CalculateSize(_availlable);
EWOL_DEBUG(" _availlable : " << _availlable);
m_size = _availlable; m_size = _availlable;
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
vec2 subElementSize = m_minSize; vec2 subElementSize = m_minSize;
EWOL_DEBUG("[" << GetId() << "] popUP: m_minSize : " << subElementSize);
vec2 subElementOrigin = m_origin + (m_size-m_minSize)/2.0f; vec2 subElementOrigin = m_origin + (m_size-m_minSize)/2.0f;
EWOL_DEBUG("[" << GetId() << "] popUP: subElementOrigin : " << subElementOrigin);
vec2 subWidgetSize = m_subWidget->GetCalculateMinSize(); vec2 subWidgetSize = m_subWidget->GetCalculateMinSize();
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
if (true == m_subWidget->CanExpand().x()) { if (true == m_subWidget->CanExpand().x()) {
subWidgetSize.setX(m_minSize.x()); subWidgetSize.setX(m_minSize.x());
} }
if (true == m_subWidget->CanExpand().y()) { if (true == m_subWidget->CanExpand().y()) {
subWidgetSize.setY(m_minSize.y()); subWidgetSize.setY(m_minSize.y());
} }
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
// limit the size of the element : // limit the size of the element :
subWidgetSize.setMin(m_minSize); subWidgetSize.setMin(m_minSize);
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
// posiition at a int32_t pos : // posiition at a int32_t pos :
subWidgetSize = vec2ClipInt32(subWidgetSize); subWidgetSize = vec2ClipInt32(subWidgetSize);
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
// set config to the Sub-widget // set config to the Sub-widget
vec2 subWidgetOrigin = m_origin + (m_size-subWidgetSize)/2.0f; vec2 subWidgetOrigin = m_origin + (m_size-subWidgetSize)/2.0f;
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetOrigin : " << subWidgetOrigin);
subWidgetOrigin = vec2ClipInt32(subWidgetOrigin); subWidgetOrigin = vec2ClipInt32(subWidgetOrigin);
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetOrigin : " << subWidgetOrigin);
m_subWidget->SetOrigin(subWidgetOrigin); m_subWidget->SetOrigin(subWidgetOrigin);
m_subWidget->CalculateSize(subWidgetSize); m_subWidget->CalculateSize(subWidgetSize);

View File

@ -66,7 +66,7 @@ void widget::Sizer::CalculateSize(const vec2& _availlable)
{ {
ewol::Widget::CalculateSize(_availlable); ewol::Widget::CalculateSize(_availlable);
vec2 tmpBorderSize = m_borderSize.GetPixel(); vec2 tmpBorderSize = m_borderSize.GetPixel();
EWOL_DEBUG("[" << GetId() << "] Update Size : " << _availlable << " nbElement : " << m_subWidget.Size() << " borderSize=" << tmpBorderSize << " from border=" << m_borderSize); //EWOL_DEBUG("[" << GetId() << "] Update Size : " << _availlable << " nbElement : " << m_subWidget.Size() << " borderSize=" << tmpBorderSize << " from border=" << m_borderSize);
m_size -= tmpBorderSize*2; m_size -= tmpBorderSize*2;
// calculate unExpandable Size : // calculate unExpandable Size :
float unexpandableSize=0.0; float unexpandableSize=0.0;
@ -110,7 +110,7 @@ void widget::Sizer::CalculateSize(const vec2& _availlable)
if (NULL != m_subWidget[iii]) { if (NULL != m_subWidget[iii]) {
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize(); vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
// Set the origin : // Set the origin :
EWOL_DEBUG("[" << GetId() << "] Set iii=" << iii << " ORIGIN : " << tmpOrigin << " & offset=" << m_offset); //EWOL_DEBUG("[" << GetId() << "] Set iii=" << iii << " ORIGIN : " << tmpOrigin << " & offset=" << m_offset);
m_subWidget[iii]->SetOrigin(vec2ClipInt32(tmpOrigin+m_offset)); m_subWidget[iii]->SetOrigin(vec2ClipInt32(tmpOrigin+m_offset));
// Now Update his Size his size in X and the curent sizer size in Y: // Now Update his Size his size in X and the curent sizer size in Y:
if (m_mode==widget::Sizer::modeVert) { if (m_mode==widget::Sizer::modeVert) {
@ -143,7 +143,7 @@ void widget::Sizer::CalculateMinMaxSize(void)
m_subExpend.setValue(false, false); m_subExpend.setValue(false, false);
m_minSize = m_userMinSize.GetPixel(); m_minSize = m_userMinSize.GetPixel();
vec2 tmpBorderSize = m_borderSize.GetPixel(); vec2 tmpBorderSize = m_borderSize.GetPixel();
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Set min size : " << m_minSize);
m_minSize += tmpBorderSize*2; m_minSize += tmpBorderSize*2;
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) { for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) { if (NULL != m_subWidget[iii]) {
@ -156,7 +156,7 @@ void widget::Sizer::CalculateMinMaxSize(void)
} }
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize(); vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
//EWOL_DEBUG("[" << GetId() << "] NewMinSize=" << tmpSize); //EWOL_DEBUG("[" << GetId() << "] NewMinSize=" << tmpSize);
//EWOL_DEBUG("[" << GetId() << "] Get minSize[" << iii << "] "<< tmpSize); //EWOL_DEBUG("[" << GetId() << "] {" << GetObjectType() << "} Get minSize[" << iii << "] "<< tmpSize);
if (m_mode==widget::Sizer::modeVert) { if (m_mode==widget::Sizer::modeVert) {
m_minSize.setY(m_minSize.y() + tmpSize.y()); m_minSize.setY(m_minSize.y() + tmpSize.y());
if (tmpSize.x()>m_minSize.x()) { if (tmpSize.x()>m_minSize.x()) {
@ -170,6 +170,7 @@ void widget::Sizer::CalculateMinMaxSize(void)
} }
} }
} }
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Result min size : " << m_minSize);
} }
bool widget::Sizer::LoadXML(TiXmlNode* _node) bool widget::Sizer::LoadXML(TiXmlNode* _node)

View File

@ -396,7 +396,7 @@ void ewol::Widget::SetOrigin(const vec2& _pos)
#if DEBUG_LEVEL > 2 #if DEBUG_LEVEL > 2
if( m_origin.x() < -5000 if( m_origin.x() < -5000
|| m_origin.y() < -5000) { || m_origin.y() < -5000) {
EWOL_WARNING("[" << GetId() << "] Set origin < 5000 : " << m_origin); EWOL_WARNING("[" << GetId() << "] {" << GetObjectType() << "} Set origin < 5000 : " << m_origin);
} }
#endif #endif
m_origin = _pos; m_origin = _pos;
@ -415,9 +415,9 @@ vec2 ewol::Widget::RelativePosition(const vec2& _pos)
void ewol::Widget::CalculateMinMaxSize(void) void ewol::Widget::CalculateMinMaxSize(void)
{ {
m_minSize = m_userMinSize.GetPixel(); m_minSize = m_userMinSize.GetPixel();
EWOL_ERROR("[" << GetId() << "] convert in min size : " << m_userMinSize << " out=" << m_minSize);
m_maxSize = m_userMaxSize.GetPixel(); m_maxSize = m_userMaxSize.GetPixel();
MarkToRedraw(); MarkToRedraw();
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} convert in min size : " << m_userMinSize << " out=" << m_minSize);
} }
vec2 ewol::Widget::GetCalculateMinSize(void) vec2 ewol::Widget::GetCalculateMinSize(void)
@ -449,7 +449,7 @@ void ewol::Widget::SetMinSize(const ewol::Dimension& _size)
error=true; error=true;
} }
if (error==true) { if (error==true) {
EWOL_ERROR("Can not set a 'min Size' > 'max size' set nothing ..."); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Can not set a 'min Size' > 'max size' set nothing ...");
return; return;
} }
m_userMinSize = _size; m_userMinSize = _size;
@ -481,7 +481,7 @@ void ewol::Widget::SetMaxSize(const ewol::Dimension& _size)
error=true; error=true;
} }
if (error==true) { if (error==true) {
EWOL_ERROR("Can not set a 'min Size' > 'max size' set nothing ..."); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Can not set a 'min Size' > 'max size' set nothing ...");
return; return;
} }
m_userMaxSize = _size; m_userMaxSize = _size;
@ -551,13 +551,13 @@ void ewol::Widget::ShortCutAdd(const char * _descriptiveString, const char * _ge
if( NULL==_descriptiveString if( NULL==_descriptiveString
|| 0==strlen(_descriptiveString)) || 0==strlen(_descriptiveString))
{ {
EWOL_ERROR("try to add shortcut with no descriptive string ..."); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} try to add shortcut with no descriptive string ...");
return; return;
} }
EventShortCut* tmpElement = new EventShortCut(); EventShortCut* tmpElement = new EventShortCut();
if (NULL == tmpElement) { if (NULL == tmpElement) {
EWOL_ERROR("allocation error ... Memory error ..."); EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} allocation error ... Memory error ...");
return; return;
} }
tmpElement->broadcastEvent = _broadcast; tmpElement->broadcastEvent = _broadcast;

View File

@ -52,7 +52,7 @@ ewol::Windows::~Windows(void)
void ewol::Windows::CalculateSize(const vec2& _availlable) void ewol::Windows::CalculateSize(const vec2& _availlable)
{ {
EWOL_DEBUG(" _availlable : " << _availlable); //EWOL_DEBUG(" _availlable : " << _availlable);
m_size = _availlable; m_size = _availlable;
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
m_subWidget->CalculateMinMaxSize(); m_subWidget->CalculateMinMaxSize();