image back in the corect sens and context menu in the good orientation
This commit is contained in:
parent
b8dcbd57a7
commit
a97df32a66
@ -95,8 +95,8 @@ void ewol::OObject2DTextured::Rectangle(float x, float y, float w, float h, floa
|
||||
Vector2D<float> point;
|
||||
texCoord_ts tex;
|
||||
|
||||
tex.u = texX;
|
||||
tex.v = texY;
|
||||
tex.u = texSX;
|
||||
tex.v = texSY;
|
||||
point.x = x;
|
||||
point.y = y;
|
||||
m_coord.PushBack(point);
|
||||
@ -104,8 +104,8 @@ void ewol::OObject2DTextured::Rectangle(float x, float y, float w, float h, floa
|
||||
m_coordColor.PushBack(tmpColor);
|
||||
|
||||
|
||||
tex.u = texSX;
|
||||
tex.v = texY;
|
||||
tex.u = texX;
|
||||
tex.v = texSY;
|
||||
point.x = x + w;
|
||||
point.y = y;
|
||||
m_coord.PushBack(point);
|
||||
@ -113,8 +113,8 @@ void ewol::OObject2DTextured::Rectangle(float x, float y, float w, float h, floa
|
||||
m_coordColor.PushBack(tmpColor);
|
||||
|
||||
|
||||
tex.u = texSX;
|
||||
tex.v = texSY;
|
||||
tex.u = texX;
|
||||
tex.v = texY;
|
||||
point.x = x + w;
|
||||
point.y = y + h;
|
||||
m_coord.PushBack(point);
|
||||
@ -125,16 +125,16 @@ void ewol::OObject2DTextured::Rectangle(float x, float y, float w, float h, floa
|
||||
m_coordTex.PushBack(tex);
|
||||
m_coordColor.PushBack(tmpColor);
|
||||
|
||||
tex.u = texX;
|
||||
tex.v = texSY;
|
||||
tex.u = texSX;
|
||||
tex.v = texY;
|
||||
point.x = x;
|
||||
point.y = y + h;
|
||||
m_coord.PushBack(point);
|
||||
m_coordTex.PushBack(tex);
|
||||
m_coordColor.PushBack(tmpColor);
|
||||
|
||||
tex.u = texX;
|
||||
tex.v = texY;
|
||||
tex.u = texSX;
|
||||
tex.v = texSY;
|
||||
point.x = x;
|
||||
point.y = y;
|
||||
m_coord.PushBack(point);
|
||||
|
@ -123,11 +123,11 @@ bool ewol::ContextMenu::CalculateSize(float availlableX, float availlableY)
|
||||
{
|
||||
case ewol::CONTEXT_MENU_MARK_TOP:
|
||||
subWidgetOrigin.x = (int32_t)(m_arrowPos.x - subWidgetSize.x/2);
|
||||
subWidgetOrigin.y = (int32_t)(m_arrowPos.y + m_offset);
|
||||
subWidgetOrigin.y = (int32_t)(m_arrowPos.y - m_offset - subWidgetSize.y);
|
||||
break;
|
||||
case ewol::CONTEXT_MENU_MARK_BOTTOM:
|
||||
subWidgetOrigin.x = (int32_t)(m_arrowPos.x - subWidgetSize.x/2);
|
||||
subWidgetOrigin.y = (int32_t)(m_arrowPos.y - m_offset - subWidgetSize.y);
|
||||
subWidgetOrigin.y = (int32_t)(m_arrowPos.y + m_offset);
|
||||
break;
|
||||
case ewol::CONTEXT_MENU_MARK_RIGHT:
|
||||
case ewol::CONTEXT_MENU_MARK_LEFT:
|
||||
@ -249,18 +249,6 @@ void ewol::ContextMenu::OnRegenerateDisplay(void)
|
||||
switch (m_arrawBorder)
|
||||
{
|
||||
case ewol::CONTEXT_MENU_MARK_TOP:
|
||||
BGOObjects->SetPoint(m_arrowPos.x, m_arrowPos.y);
|
||||
if (m_arrowPos.x <= tmpOrigin.x ) {
|
||||
int32_t laking = m_offset - m_padding.y;
|
||||
BGOObjects->SetPoint(m_arrowPos.x+laking, m_arrowPos.y+laking);
|
||||
BGOObjects->SetPoint(m_arrowPos.x, m_arrowPos.y+laking);
|
||||
} else {
|
||||
int32_t laking = m_offset - m_padding.y;
|
||||
BGOObjects->SetPoint(m_arrowPos.x+laking, m_arrowPos.y+laking);
|
||||
BGOObjects->SetPoint(m_arrowPos.x-laking, m_arrowPos.y+laking);
|
||||
}
|
||||
break;
|
||||
case ewol::CONTEXT_MENU_MARK_BOTTOM:
|
||||
BGOObjects->SetPoint(m_arrowPos.x, m_arrowPos.y);
|
||||
if (m_arrowPos.x <= tmpOrigin.x ) {
|
||||
int32_t laking = m_offset - m_padding.y;
|
||||
@ -272,6 +260,17 @@ void ewol::ContextMenu::OnRegenerateDisplay(void)
|
||||
BGOObjects->SetPoint(m_arrowPos.x-laking, m_arrowPos.y-laking);
|
||||
}
|
||||
break;
|
||||
case ewol::CONTEXT_MENU_MARK_BOTTOM:
|
||||
BGOObjects->SetPoint(m_arrowPos.x, m_arrowPos.y);
|
||||
if (m_arrowPos.x <= tmpOrigin.x ) {
|
||||
int32_t laking = m_offset - m_padding.y;
|
||||
BGOObjects->SetPoint(m_arrowPos.x+laking, m_arrowPos.y+laking);
|
||||
BGOObjects->SetPoint(m_arrowPos.x, m_arrowPos.y+laking);
|
||||
} else {
|
||||
int32_t laking = m_offset - m_padding.y;
|
||||
BGOObjects->SetPoint(m_arrowPos.x+laking, m_arrowPos.y+laking);
|
||||
BGOObjects->SetPoint(m_arrowPos.x-laking, m_arrowPos.y+laking);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case ewol::CONTEXT_MENU_MARK_RIGHT:
|
||||
|
@ -216,7 +216,7 @@ void ewol::Menu::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
|
||||
Vector2D<float> tmpSize = eventFromWidget->GetSize();
|
||||
// calculate the correct position
|
||||
newPosition.x = tmpOri.x + tmpSize.x/2;
|
||||
newPosition.y = tmpOri.y + tmpSize.y;
|
||||
newPosition.y = tmpOri.y;
|
||||
}
|
||||
|
||||
m_widgetContextMenu->SetPositionMark(ewol::CONTEXT_MENU_MARK_TOP, newPosition );
|
||||
@ -229,21 +229,23 @@ void ewol::Menu::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
|
||||
// set it in the pop-up-system :
|
||||
m_widgetContextMenu->SubWidgetSet(mySizerVert);
|
||||
|
||||
for(int32_t jjj=0; jjj<m_listElement.Size(); jjj++) {
|
||||
if (m_listElement[iii]->m_localId == m_listElement[jjj]->m_parentId) {
|
||||
myButton = new ewol::Button(m_listElement[jjj]->m_label);
|
||||
if (NULL == myButton) {
|
||||
EWOL_ERROR("Allocation Error");
|
||||
} else {
|
||||
// set the image if one is present ...
|
||||
myButton->SetImage(m_listElement[jjj]->m_image);
|
||||
myButton->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventButtonPressed);
|
||||
myButton->SetExpendX(true);
|
||||
myButton->SetFillX(true);
|
||||
myButton->SetAlignement(ewol::TEXT_ALIGN_LEFT);
|
||||
// add it in the widget list
|
||||
mySizerVert->SubWidgetAdd(myButton);
|
||||
m_listElement[jjj]->m_widgetPointer = myButton;
|
||||
for(int32_t jjj=m_listElement.Size()-1; jjj>=0; jjj--) {
|
||||
if (m_listElement[iii]!=NULL) {
|
||||
if (m_listElement[iii]->m_localId == m_listElement[jjj]->m_parentId) {
|
||||
myButton = new ewol::Button(m_listElement[jjj]->m_label);
|
||||
if (NULL == myButton) {
|
||||
EWOL_ERROR("Allocation Error");
|
||||
} else {
|
||||
// set the image if one is present ...
|
||||
myButton->SetImage(m_listElement[jjj]->m_image);
|
||||
myButton->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventButtonPressed);
|
||||
myButton->SetExpendX(true);
|
||||
myButton->SetFillX(true);
|
||||
myButton->SetAlignement(ewol::TEXT_ALIGN_LEFT);
|
||||
// add it in the widget list
|
||||
mySizerVert->SubWidgetAdd(myButton);
|
||||
m_listElement[jjj]->m_widgetPointer = myButton;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user