[DEV] working not so bag, but rework not ended

This commit is contained in:
Edouard DUPIN 2012-11-25 11:54:17 +01:00
parent d045b4bd14
commit 50db842954
49 changed files with 396 additions and 721 deletions

View File

@ -34,10 +34,8 @@ include $(LOCAL_PATH)/file.mk
LOCAL_SRC_FILES := \
$(FILE_LIST) \
QSDFQSDFQSDF = \
ewol/os/gui.X11.cpp \
ewol/audio/interfacePortAudio.cpp
ewol/renderer/os/gui.X11.cpp \
ewol/renderer/audio/interfacePortAudio.cpp

View File

@ -427,7 +427,8 @@ void ewol::Drawing::SetThickness(float thickness)
void ewol::Drawing::AddVertex(void)
{
InternalSetColor(m_color);
SetPoint(m_position);
}

View File

@ -17,7 +17,7 @@ ewol::Image::Image(etk::UString imageName) :
m_clippingPosStart(0.0, 0.0, 0.0),
m_clippingPosStop(0.0, 0.0, 0.0),
m_clippingEnable(false),
m_color(draw::color::black),
m_color(draw::color::white),
m_axes(0.0, 0.0, 0.0),
m_angle(0.0),
m_GLprogram(NULL),
@ -62,7 +62,7 @@ void ewol::Image::Draw(void)
return;
}
if (m_resource == NULL) {
EWOL_WARNING("no resources ...");
// this is a normale case ... the user can choice to have no image ...
return;
}
if (m_GLprogram==NULL) {
@ -99,7 +99,7 @@ void ewol::Image::Clear(void)
m_clippingPosStart = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_clippingPosStop = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_clippingEnable = false;
m_color = draw::color::black;
m_color = draw::color::white;
m_axes = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_angle = 0.0;
}
@ -247,9 +247,18 @@ void ewol::Image::SetSource(etk::UString newFile)
ewol::resource::Release(m_resource);
m_resource = NULL;
}
etk::Vector2D<int32_t> size(-1,-1);
etk::Vector2D<int32_t> size(32,32);
// note that no image can be loaded...
if (newFile != "") {
// link to new One
if (false == ewol::resource::Keep(newFile, m_resource, size)) {
EWOL_ERROR("Can not get Image resource");
}
}
}
bool ewol::Image::HasSources(void)
{
return m_resource!=NULL;
}

View File

@ -49,7 +49,7 @@ namespace ewol
* @brief generic constructor
* @param[in] imageName Name of the file that might be loaded
*/
Image(etk::UString imageName);
Image(etk::UString imageName="");
/**
* @brief generic destructor
*/
@ -125,6 +125,11 @@ namespace ewol
* @param[in] newFile New file of the Image
*/
void SetSource(etk::UString newFile);
/**
* @brief Sometimes the user declare an image but not allocate the ressources all the time, this is to know it ..
* @return the validity od the resources.
*/
bool HasSources(void);
};
};

View File

@ -99,20 +99,11 @@ namespace ewol
*/
~Text(void);
public:
/**
* @brief Translate the current display of this element
* @param[in] vect The translation vector to apply at the transformation matrix
*/
// Derived function
virtual void Translate(etk::Vector3D<float> vect);
/**
* @brief Rotate the curent display of this element
* @param[in] vect The rotation vector to apply at the transformation matrix
*/
// Derived function
virtual void Rotate(etk::Vector3D<float> vect, float angle);
/**
* @brief Scale the current diaplsy of this element
* @param[in] vect The scaling vector to apply at the transformation matrix
*/
// Derived function
virtual void Scale(etk::Vector3D<float> vect);
public:
/**

View File

@ -65,7 +65,7 @@ void ewol::ForceRedrawAll(void)
void ewol::RequestUpdateSize(void)
{
eSystem::RequestUpdateSize();
}
void ewol::Keyboard(bool hide)

View File

@ -105,5 +105,9 @@ etk::CCout& ewol::keyEvent::operator <<(etk::CCout &os, const ewol::keyEvent::ty
return os;
}
static ewol::SpecialKey l_LocalKeyStatus;
ewol::SpecialKey& ewol::GetCurrentSpecialKeyStatus(void)
{
return l_LocalKeyStatus;
}

View File

@ -112,8 +112,56 @@ namespace ewol
unsigned altGr : 1;
unsigned verNum : 1;
unsigned insert : 1;
};
/*
SpecialKey(void)
{
capLock = false;
shift = false;
ctrl = false;
meta = false;
alt = false;
altGr = false;
verNum = false;
insert = false;
}
bool IsSetCapsLock(void)
{
return capLock;
}
bool IsSetShift(void)
{
return shift;
}
bool IsSetCtrl(void)
{
return ctrl;
}
bool IsSetMeta(void)
{
return meta;
}
bool IsSetAlt(void)
{
return alt;
}
bool IsSetAltGr(void)
{
return altGr;
}
bool IsSetVerNum(void)
{
return verNum;
}
};
*/
SpecialKey& GetCurrentSpecialKeyStatus(void);
};

View File

@ -9,8 +9,8 @@
#include <etk/types.h>
#include <etk/UString.h>
#include <ewol/debug.h>
#include <ewol/audio/interfacePortAudio.h>
#include <ewol/audio/audio.h>
#include <ewol/renderer/audio/interfacePortAudio.h>
#include <ewol/renderer/audio/audio.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>

View File

@ -86,9 +86,6 @@ typedef struct {
// deblare the message system
static etk::MessageFifo<eSystemMessage_ts> l_msgSystem;
extern ewol::SpecialKey specialCurrentKey;
static bool requestEndProcessing = false;
void ewolProcessEvents(void)
@ -136,6 +133,7 @@ void ewolProcessEvents(void)
case THREAD_KEYBORAD_KEY:
//EWOL_DEBUG("Receive MSG : THREAD_KEYBORAD_KEY");
{
ewol::SpecialKey& specialCurrentKey = ewol::GetCurrentSpecialKeyStatus();
specialCurrentKey = data.keyboardKey.special;
if (NULL != windowsCurrent) {
if (false==windowsCurrent->OnEventShortCut(data.keyboardKey.special,
@ -172,6 +170,7 @@ void ewolProcessEvents(void)
data.keyboardKey.myChar,
ewol::keyEvent::keyboardUnknow,
data.keyboardKey.isDown)) {
ewol::SpecialKey& specialCurrentKey = ewol::GetCurrentSpecialKeyStatus();
specialCurrentKey = data.keyboardMove.special;
// Get the current Focused Widget :
ewol::Widget * tmpWidget = ewol::widgetManager::FocusGet();
@ -315,7 +314,7 @@ void eSystem::UnInit(void)
}
void ewol::RequestUpdateSize(void)
void eSystem::RequestUpdateSize(void)
{
if (true == isGlobalSystemInit) {
eSystemMessage_ts data;

View File

@ -49,6 +49,8 @@ namespace eSystem
void ClipBoardArrive(ewol::clipBoard::clipboardListe_te clipboardID);
void RequestUpdateSize(void);
// return true if a flush is needed
bool Draw(bool displayEveryTime);

View File

@ -7,15 +7,18 @@
*/
#include <ewol/Debug.h>
#include <ewol/debug.h>
#include <ewol/ewol.h>
#include <ewol/key.h>
#include <ewol/config.h>
#include <ewol/commandLine.h>
#include <etk/UString.h>
#include <etk/unicode.h>
#include <ewol/widget/WidgetManager.h>
#include <ewol/os/gui.h>
#include <ewol/renderer/os/gui.h>
#include <ewol/ResourceManager.h>
#include <ewol/os/eSystem.h>
#include <ewol/renderer/ResourceManager.h>
#include <ewol/renderer/os/eSystem.h>
#include <unistd.h>
#include <stdlib.h>
@ -530,14 +533,14 @@ void X11_Run(void)
);
if (true == l_clipBoardRequestPrimary) {
etk::UString tmpppp((char*)buf);
ewol::clipBoard::SetSystem(ewol::clipBoard::CLIPBOARD_SELECTION, tmpppp);
ewol::clipBoard::SetSystem(ewol::clipBoard::clipboardSelection, tmpppp);
// just transmit an event , we have the data in the system
eSystem::ClipBoardArrive(ewol::clipBoard::CLIPBOARD_SELECTION);
eSystem::ClipBoardArrive(ewol::clipBoard::clipboardSelection);
} else {
etk::UString tmpppp((char*)buf);
ewol::clipBoard::SetSystem(ewol::clipBoard::CLIPBOARD_STD, tmpppp);
ewol::clipBoard::SetSystem(ewol::clipBoard::clipboardStd, tmpppp);
// just transmit an event , we have the data in the system
eSystem::ClipBoardArrive(ewol::clipBoard::CLIPBOARD_STD);
eSystem::ClipBoardArrive(ewol::clipBoard::clipboardStd);
}
}
break;
@ -562,9 +565,9 @@ void X11_Run(void)
etk::UString tmpData = "";
if (req->selection == XAtomeSelection) {
tmpData = ewol::clipBoard::Get(ewol::clipBoard::CLIPBOARD_SELECTION);
tmpData = ewol::clipBoard::Get(ewol::clipBoard::clipboardSelection);
} else if (req->selection == XAtomeClipBoard) {
tmpData = ewol::clipBoard::Get(ewol::clipBoard::CLIPBOARD_STD);
tmpData = ewol::clipBoard::Get(ewol::clipBoard::clipboardStd);
}
magatTextToSend = tmpData.c_str();
Atom listOfAtom[4];
@ -688,7 +691,7 @@ void X11_Run(void)
EWOL_INFO("X11 event ButtonPress");
#endif
m_cursorEventX = event.xbutton.x;
m_cursorEventY = event.xbutton.y;
m_cursorEventY = (m_currentHeight-event.xbutton.y);
if (event.xbutton.button < NB_MAX_INPUT) {
inputIsPressed[event.xbutton.button] = true;
}
@ -807,29 +810,29 @@ void X11_Run(void)
guiKeyBoardMode.altGr = false;
}
bool find = true;
ewol::eventKbMoveType_te keyInput;
ewol::keyEvent::keyboard_te keyInput;
switch (event.xkey.keycode) {
//case 80: // keypad
case 111: keyInput = ewol::EVENT_KB_MOVE_TYPE_UP; break;
case 111: keyInput = ewol::keyEvent::keyboardUp; break;
//case 83: // keypad
case 113: keyInput = ewol::EVENT_KB_MOVE_TYPE_LEFT; break;
case 113: keyInput = ewol::keyEvent::keyboardLeft; break;
//case 85: // keypad
case 114: keyInput = ewol::EVENT_KB_MOVE_TYPE_RIGHT; break;
case 114: keyInput = ewol::keyEvent::keyboardRight; break;
//case 88: // keypad
case 116: keyInput = ewol::EVENT_KB_MOVE_TYPE_DOWN; break;
case 116: keyInput = ewol::keyEvent::keyboardDown; break;
//case 81: // keypad
case 112: keyInput = ewol::EVENT_KB_MOVE_TYPE_PAGE_UP; break;
case 112: keyInput = ewol::keyEvent::keyboardPageUp; break;
//case 89: // keypad
case 117: keyInput = ewol::EVENT_KB_MOVE_TYPE_PAGE_DOWN; break;
case 117: keyInput = ewol::keyEvent::keyboardPageDown; break;
//case 79: // keypad
case 110: keyInput = ewol::EVENT_KB_MOVE_TYPE_START; break;
case 110: keyInput = ewol::keyEvent::keyboardStart; break;
//case 87: // keypad
case 115: keyInput = ewol::EVENT_KB_MOVE_TYPE_END; break;
case 78: keyInput = ewol::EVENT_KB_MOVE_TYPE_ARRET_DEFIL; break;
case 127: keyInput = ewol::EVENT_KB_MOVE_TYPE_WAIT; break;
case 115: keyInput = ewol::keyEvent::keyboardEnd; break;
case 78: keyInput = ewol::keyEvent::keyboardStopDefil; break;
case 127: keyInput = ewol::keyEvent::keyboardWait; break;
//case 90: // keypad
case 118:
keyInput = ewol::EVENT_KB_MOVE_TYPE_INSERT;
keyInput = ewol::keyEvent::keyboardInsert;
if(event.type == KeyRelease) {
if (true == guiKeyBoardMode.insert) {
guiKeyBoardMode.insert = false;
@ -838,30 +841,30 @@ void X11_Run(void)
}
}
break;
//case 84: keyInput = ewol::EVENT_KB_MOVE_TYPE_CENTER; break; // Keypad
case 67: keyInput = ewol::EVENT_KB_MOVE_TYPE_F1; break;
case 68: keyInput = ewol::EVENT_KB_MOVE_TYPE_F2; break;
case 69: keyInput = ewol::EVENT_KB_MOVE_TYPE_F3; break;
case 70: keyInput = ewol::EVENT_KB_MOVE_TYPE_F4; break;
case 71: keyInput = ewol::EVENT_KB_MOVE_TYPE_F5; break;
case 72: keyInput = ewol::EVENT_KB_MOVE_TYPE_F6; break;
case 73: keyInput = ewol::EVENT_KB_MOVE_TYPE_F7; break;
case 74: keyInput = ewol::EVENT_KB_MOVE_TYPE_F8; break;
case 75: keyInput = ewol::EVENT_KB_MOVE_TYPE_F9; break;
case 76: keyInput = ewol::EVENT_KB_MOVE_TYPE_F10; break;
case 95: keyInput = ewol::EVENT_KB_MOVE_TYPE_F11; break;
case 96: keyInput = ewol::EVENT_KB_MOVE_TYPE_F12; break;
case 66: keyInput = ewol::EVENT_KB_MOVE_TYPE_CAPLOCK; guiKeyBoardMode.capLock = (event.type == KeyPress) ? true : false; break;
case 50: keyInput = ewol::EVENT_KB_MOVE_TYPE_SHIFT_LEFT; guiKeyBoardMode.shift = (event.type == KeyPress) ? true : false; break;
case 62: keyInput = ewol::EVENT_KB_MOVE_TYPE_SHIFT_RIGHT; guiKeyBoardMode.shift = (event.type == KeyPress) ? true : false; break;
case 37: keyInput = ewol::EVENT_KB_MOVE_TYPE_CTRL_LEFT; guiKeyBoardMode.ctrl = (event.type == KeyPress) ? true : false; break;
case 105: keyInput = ewol::EVENT_KB_MOVE_TYPE_CTRL_RIGHT; guiKeyBoardMode.ctrl = (event.type == KeyPress) ? true : false; break;
case 133: keyInput = ewol::EVENT_KB_MOVE_TYPE_META_LEFT; guiKeyBoardMode.meta = (event.type == KeyPress) ? true : false; break;
case 134: keyInput = ewol::EVENT_KB_MOVE_TYPE_META_RIGHT; guiKeyBoardMode.meta = (event.type == KeyPress) ? true : false; break;
case 64: keyInput = ewol::EVENT_KB_MOVE_TYPE_ALT; guiKeyBoardMode.alt = (event.type == KeyPress) ? true : false; break;
case 108: keyInput = ewol::EVENT_KB_MOVE_TYPE_ALT_GR; guiKeyBoardMode.altGr = (event.type == KeyPress) ? true : false; break;
case 135: keyInput = ewol::EVENT_KB_MOVE_TYPE_CONTEXT_MENU; break;
case 77: keyInput = ewol::EVENT_KB_MOVE_TYPE_VER_NUM; guiKeyBoardMode.verNum = (event.type == KeyPress) ? true : false; break;
//case 84: keyInput = ewol::keyEvent::keyboardCenter; break; // Keypad
case 67: keyInput = ewol::keyEvent::keyboardF1; break;
case 68: keyInput = ewol::keyEvent::keyboardF2; break;
case 69: keyInput = ewol::keyEvent::keyboardF3; break;
case 70: keyInput = ewol::keyEvent::keyboardF4; break;
case 71: keyInput = ewol::keyEvent::keyboardF5; break;
case 72: keyInput = ewol::keyEvent::keyboardF6; break;
case 73: keyInput = ewol::keyEvent::keyboardF7; break;
case 74: keyInput = ewol::keyEvent::keyboardF8; break;
case 75: keyInput = ewol::keyEvent::keyboardF9; break;
case 76: keyInput = ewol::keyEvent::keyboardF10; break;
case 95: keyInput = ewol::keyEvent::keyboardF11; break;
case 96: keyInput = ewol::keyEvent::keyboardF12; break;
case 66: keyInput = ewol::keyEvent::keyboardCapLock; guiKeyBoardMode.capLock = (event.type == KeyPress) ? true : false; break;
case 50: keyInput = ewol::keyEvent::keyboardShiftLeft; guiKeyBoardMode.shift = (event.type == KeyPress) ? true : false; break;
case 62: keyInput = ewol::keyEvent::keyboardShiftRight; guiKeyBoardMode.shift = (event.type == KeyPress) ? true : false; break;
case 37: keyInput = ewol::keyEvent::keyboardCtrlLeft; guiKeyBoardMode.ctrl = (event.type == KeyPress) ? true : false; break;
case 105: keyInput = ewol::keyEvent::keyboardCtrlRight; guiKeyBoardMode.ctrl = (event.type == KeyPress) ? true : false; break;
case 133: keyInput = ewol::keyEvent::keyboardMetaLeft; guiKeyBoardMode.meta = (event.type == KeyPress) ? true : false; break;
case 134: keyInput = ewol::keyEvent::keyboardMetaRight; guiKeyBoardMode.meta = (event.type == KeyPress) ? true : false; break;
case 64: keyInput = ewol::keyEvent::keyboardAlt; guiKeyBoardMode.alt = (event.type == KeyPress) ? true : false; break;
case 108: keyInput = ewol::keyEvent::keyboardAltGr; guiKeyBoardMode.altGr = (event.type == KeyPress) ? true : false; break;
case 135: keyInput = ewol::keyEvent::keyboardContextMenu; break;
case 77: keyInput = ewol::keyEvent::keyboardVerNum; guiKeyBoardMode.verNum = (event.type == KeyPress) ? true : false; break;
case 91: // Suppr on keypad
find = false;
{
@ -986,7 +989,7 @@ void guiInterface::ClipBoardGet(ewol::clipBoard::clipboardListe_te clipboardID)
{
switch (clipboardID)
{
case ewol::clipBoard::CLIPBOARD_SELECTION:
case ewol::clipBoard::clipboardSelection:
if (false == l_clipBoardOwnerPrimary) {
l_clipBoardRequestPrimary = true;
// Generate a request on X11
@ -1001,7 +1004,7 @@ void guiInterface::ClipBoardGet(ewol::clipBoard::clipboardListe_te clipboardID)
eSystem::ClipBoardArrive(clipboardID);
}
break;
case ewol::clipBoard::CLIPBOARD_STD:
case ewol::clipBoard::clipboardStd:
if (false == l_clipBoardOwnerStd) {
l_clipBoardRequestPrimary = false;
// Generate a request on X11
@ -1027,14 +1030,14 @@ void guiInterface::ClipBoardSet(ewol::clipBoard::clipboardListe_te clipboardID)
{
switch (clipboardID)
{
case ewol::clipBoard::CLIPBOARD_SELECTION:
case ewol::clipBoard::clipboardSelection:
// Request the selection :
if (false == l_clipBoardOwnerPrimary) {
XSetSelectionOwner(m_display, XAtomeSelection, WindowHandle, CurrentTime);
l_clipBoardOwnerPrimary = true;
}
break;
case ewol::clipBoard::CLIPBOARD_STD:
case ewol::clipBoard::clipboardStd:
// Request the clipBoard :
if (false == l_clipBoardOwnerStd) {
XSetSelectionOwner(m_display, XAtomeClipBoard, WindowHandle, CurrentTime);
@ -1111,9 +1114,9 @@ void guiInterface::GetAbsPos(etk::Vector2D<int32_t>& pos)
*/
int guiInterface::main(int argc, const char *argv[])
{
ewol::CmdLine::Clean();
ewol::commandLine::Clean();
for( int32_t i=1 ; i<argc; i++) {
EWOL_INFO("CmdLine : \"" << argv[i] << "\"" );
EWOL_INFO("commandLine : \"" << argv[i] << "\"" );
if (0==strncmp("-l0", argv[i], 256)) {
GeneralDebugSetLevel(etk::LOG_LEVEL_NONE);
} else if (0==strncmp("-l1", argv[i], 256)) {
@ -1130,7 +1133,7 @@ int guiInterface::main(int argc, const char *argv[])
GeneralDebugSetLevel(etk::LOG_LEVEL_VERBOSE);
} else {
etk::UString tmpString(argv[i]);
ewol::CmdLine::Add(tmpString);
ewol::commandLine::Add(tmpString);
}
}
@ -1160,7 +1163,7 @@ int guiInterface::main(int argc, const char *argv[])
guiInterface::Stop();
// uninit ALL :
eSystem::UnInit();
ewol::CmdLine::Clean();
ewol::commandLine::Clean();
return 0;
}

View File

@ -23,13 +23,11 @@ extern const char * const ewolEventButtonLeave = "ewol-button-leave";
void widget::Button::Init(void)
{
m_oObjectImage=NULL;
AddEventId(ewolEventButtonPressed);
AddEventId(ewolEventButtonDown);
AddEventId(ewolEventButtonUp);
AddEventId(ewolEventButtonEnter);
AddEventId(ewolEventButtonLeave);
m_hasAnImage = false;
m_alignement = widget::TEXT_ALIGN_CENTER;
m_status.m_stateOld = 0;
@ -37,15 +35,6 @@ void widget::Button::Init(void)
m_status.m_transition = 1.0;
m_time = -1;
m_nextStatusRequested = -1;
/*
#ifdef __TARGET_OS__Android
m_padding.y = 12;
m_padding.x = 12;
#else
m_padding.y = 4;
m_padding.x = 4;
#endif
*/
m_textColorFg = draw::color::black;
SetCanHaveFocus(true);
@ -94,15 +83,17 @@ widget::Button::~Button(void)
void widget::Button::SetImage(etk::UString imageName)
{
if (imageName == "") {
m_hasAnImage = false;
} else {
m_imageSelected = imageName;
m_hasAnImage = true;
}
m_displayImage.SetSource(imageName);
MarkToRedraw();
}
void widget::Button::SetImageToggle(etk::UString imageName)
{
m_displayImageToggle.SetSource(imageName);
MarkToRedraw();
}
bool widget::Button::CalculateMinSize(void)
{
etk::Vector2D<int32_t> padding;
@ -113,9 +104,8 @@ bool widget::Button::CalculateMinSize(void)
m_minSize.x = padding.x*2 + minSize.x;
m_minSize.y = padding.y*2 + minSize.y;
// Add the image element ...
if (true == m_hasAnImage) {
//m_minSize.x += -m_padding.x + m_padding.y*2 + minHeight;
//m_minSize.y += m_padding.y*2;
if( true == m_displayImage.HasSources()
|| true == m_displayImageToggle.HasSources()) {
m_minSize.x += padding.x + minSize.y;
}
@ -205,11 +195,12 @@ void widget::Button::OnDraw(ewol::DrawProperty& displayProp)
glDrawArrays(GL_TRIANGLES, 0, m_coord.Size());
m_GLprogram->UnUse();
if (NULL != m_oObjectImage) {
m_oObjectImage->Draw();
#warning generate the Toggle
if (true) {
m_displayImage.Draw();
} else {
m_displayImageToggle.Draw();
}
//m_oObjectText.Draw();
m_displayText.Draw();
}
@ -221,9 +212,9 @@ void widget::Button::OnRegenerateDisplay(void)
padding.x = m_config->GetInteger(m_confIdPaddingX);
padding.y = m_config->GetInteger(m_confIdPaddingY);
if (NULL != m_oObjectImage) {
m_oObjectImage->Clear();
}
m_displayImage.Clear();
m_displayImageToggle.Clear();
int32_t tmpSizeX = m_minSize.x;
int32_t tmpSizeY = m_minSize.y;
etk::Vector3D<float> tmpOrigin((float)((m_size.x - m_minSize.x) / 2.0),
@ -252,16 +243,19 @@ void widget::Button::OnRegenerateDisplay(void)
etk::Vector2D<float> textPos(tmpTextOrigin.x, tmpTextOrigin.x);
/*ewol::OObject2DTextured * tmpImage = NULL;
if (true == m_hasAnImage) {
int32_t fontId = GetDefaultFontId();
int32_t fontHeight = ewol::GetHeight(fontId);
tmpImage = new ewol::OObject2DTextured(m_imageSelected, fontHeight, fontHeight);
tmpImage->Rectangle(textPos.x, textPos.y, fontHeight, fontHeight);
if( true == m_displayImage.HasSources()
|| true == m_displayImageToggle.HasSources()) {
etk::Vector3D<int32_t> minSize = m_displayText.CalculateSize(m_label);
etk::Vector3D<int32_t> imagePos(tmpTextOrigin.x-padding.x/4, tmpTextOrigin.y-padding.x/4, 0);
etk::Vector2D<int32_t> imageSize(minSize.y+padding.x/2, minSize.y+padding.x/2);
m_displayImage.SetPos(imagePos);
m_displayImage.Print(imageSize);
m_displayImageToggle.SetPos(imagePos);
m_displayImageToggle.Print(imageSize);
// update the text position ...
textPos.x += m_padding.x + fontHeight;
tmpTextOrigin.x += padding.x/2 + minSize.y;
}
*/
etk::Vector3D<float> drawClippingPos(0.0, 0.0, -0.5);
etk::Vector3D<float> drawClippingSize((float)(m_size.x - 2*padding.x),
(float)(m_size.y - 2*padding.y),

View File

@ -87,55 +87,42 @@ namespace widget {
void Rectangle(float x, float y, float w, float h);
private:
ewol::Text m_displayText;
ewol::Image* m_oObjectImage;
bool m_hasAnImage;
etk::UString m_imageSelected;
ewol::Image m_displayImage;
ewol::Image m_displayImageToggle;
textAlignement_te m_alignement;
etk::UString m_label;
draw::Color m_textColorFg; //!< Text color
public:
Button(void);
Button(etk::UString newLabel);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolButton"; };
void Init(void);
virtual ~Button(void);
// Derived function
virtual bool CalculateMinSize(void);
void SetLabel(etk::UString newLabel);
etk::UString GetLabel(void) {return m_label;};
void SetImage(etk::UString imageName);
void SetImageToggle(etk::UString imageName);
void SetValue(bool val);
bool GetValue(void);
void SetAlignement(textAlignement_te typeAlign);
void SetColorFg(draw::Color newColor) { m_textColorFg = newColor; };
public:
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
// Derived function
virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData);
private:
int32_t m_nextStatusRequested;
void ChangeStatusIn(int32_t newStatusId);
int64_t m_time;
/**
* @brief Periodic call of this widget
* @param localTime curent system time
* @return ---
*/
// Derived function
virtual void PeriodicCall(int64_t localTime);
};
};

View File

@ -183,7 +183,7 @@ bool widget::ButtonColor::OnEventInput(ewol::keyEvent::type_te type, int32_t IdI
m_widgetContextMenu->SetPositionMark(widget::CONTEXT_MENU_MARK_BOTTOM, newPosition );
ewol::ColorChooser * myColorChooser = new ewol::ColorChooser();
widget::ColorChooser * myColorChooser = new widget::ColorChooser();
myColorChooser->SetColor(m_textColorBg);
// set it in the pop-up-system :
m_widgetContextMenu->SubWidgetSet(myColorChooser);

View File

@ -25,12 +25,7 @@ namespace widget {
public:
ButtonColor(void);
ButtonColor(etk::UString newLabel);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolButtonColor"; };
void Init(void);
virtual ~ButtonColor(void);
@ -52,28 +47,15 @@ namespace widget {
draw::Color m_selectedColor; //!< user current selected Color
widget::ContextMenu* m_widgetContextMenu;
public:
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
public:
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
draw::Color GetCurrentColor(void) { return m_selectedColor; };
void SetCurrentColor(draw::Color color);
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
// Derived function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
};
};

View File

@ -23,15 +23,11 @@ namespace widget {
public:
CheckBox(void);
CheckBox(etk::UString newLabel);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolCheckBox"; };
void Init(void);
virtual ~CheckBox(void);
// Derived function
virtual bool CalculateMinSize(void);
void SetLabel(etk::UString newLabel);
void SetValue(bool val);
@ -44,19 +40,13 @@ namespace widget {
draw::Color m_textColorFg; //!< Text color
draw::Color m_textColorBg; //!< Background color
public:
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
public:
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
// Derived function
virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData);
};

View File

@ -22,13 +22,9 @@ namespace widget {
public:
ColorBar(void);
virtual ~ColorBar(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolColorBar"; };
// Derived function
virtual bool CalculateMinSize(void);
draw::Color GetCurrentColor(void);
void SetCurrentColor(draw::Color newOne);
@ -37,17 +33,9 @@ namespace widget {
etk::Vector2D<float> m_currentUserPos;
etk::Vector2D<float> m_padding;
public:
// Derived function
virtual void OnRegenerateDisplay(void);
public:
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
};

View File

@ -28,12 +28,7 @@ namespace widget {
public:
ContextMenu(void);
virtual ~ContextMenu(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolContextMenu"; };
public:
virtual bool CalculateSize(float availlableX, float availlableY); // this generate the current size ...
@ -54,26 +49,14 @@ namespace widget {
void SubWidgetRemove(void);
void SetPositionMark(markPosition_te position, etk::Vector2D<float> arrowPos);
protected:
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
public:
// Derived function
virtual void OnRegenerateDisplay(void);
public:
/**
* @brief Get the widget at the specific windows absolute position
* @param[in] pos gAbsolute position of the requested widget knowledge
* @return NULL No widget found
* @return pointer on the widget found
*/
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
};

View File

@ -19,13 +19,7 @@ namespace widget {
public:
Drawable(void);
virtual ~Drawable(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolDrawable"; };
private:
@ -34,6 +28,7 @@ namespace widget {
void AddOObject(ewol::Compositing* newObject, int32_t pos=-1);
void ClearOObjectList(void);
protected:
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
};

View File

@ -209,17 +209,17 @@ void widget::Entry::OnRegenerateDisplay(void)
etk::Vector3D<float> drawClippingSize( m_size.x - 2*drawClippingPos.x,
m_size.y - 2*drawClippingPos.y,
1 );
m_oObjectText.SetClipping(drawClippingPos, drawClippingSize);
m_oObjectText.SetClippingWidth(drawClippingPos, drawClippingSize);
m_oObjectText.SetPos(textPos);
m_oObjectText.Print(m_data);
m_oObjectText.SetClippingMode(false);
/*
m_pos[0] = m_borderSize+2*drawClipping.x;
m_pos[1] = m_borderSize+2*drawClipping.y;
m_pos[2] = m_size.x - 2*(m_borderSize+2*drawClipping.x);
m_pos[3] = m_size.y - 2*(m_borderSize+2*drawClipping.y);
m_pos[0] = m_borderSize+2*drawClippingPos.x;
m_pos[1] = m_borderSize+2*drawClippingPos.y;
m_pos[2] = m_size.x - 2*(m_borderSize+2*drawClippingPos.x);
m_pos[3] = m_size.y - 2*(m_borderSize+2*drawClippingPos.y);
Rectangle(0, 0, m_size.x, m_size.y);
*/
/*
Must be rework corectly ==> selection and Cursor are integrated at the system ...
int32_t pos1 = m_displayCursorPosSelection;

View File

@ -73,14 +73,10 @@ namespace widget {
* @brief Destuctor
*/
virtual ~Entry(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolEntry"; };
void Init(void);
// Derived function
virtual bool CalculateMinSize(void);
void SetValue(etk::UString newData);
etk::UString GetValue(void);
@ -89,57 +85,20 @@ namespace widget {
m_userSize = width;
}
public:
/**
* @brief Event generated when a redraw is needed
* @param ---
* @return ---
*/
// Derived function
virtual void OnRegenerateDisplay(void);
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
/**
* @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)
* @param[in] unicodeValue key pressed by the user
* @return true if the event has been used
* @return false if the event has not been used
*/
// Derived function
virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData);
/**
* @brief Event on the keyboard that is not a printable key (if no shortcut has been detected before).
* @return true if the event has been used
* @return false if the event has not been used
*/
// Derived function
virtual bool OnEventKbMove(ewol::keyEvent::status_te typeEvent, ewol::keyEvent::keyboard_te moveTypeEvent);
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
// Derived function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
/**
* @brief Event on a past event ==> this event is asynchronous due to all system does not support direct getting datas
* @note : need to have focus ...
* @param[in] mode Mode of data requested
* @return ---
*/
// Derived function
virtual void OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID);
protected:
/**
* @brief Common widget drawing function (called by the drawing thread [Android, X11, ...])
* @param[in] displayProp properties of the current display
* @return ---
*/
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
/**
* @brief Change the cursor position with the curent position requested on the display
@ -167,17 +126,9 @@ namespace widget {
* @return ---
*/
virtual void RemoveSelected(void);
/**
* @brief Event of the focus has been grep by the current widget
* @param ---
* @return ---
*/
// Derived function
virtual void OnGetFocus(void);
/**
* @brief Event of the focus has been lost by the current widget
* @param ---
* @return ---
*/
// Derived function
virtual void OnLostFocus(void);
};

View File

@ -21,15 +21,11 @@ namespace widget {
{
public:
Image(etk::UString dataFile, int32_t size=-1); // automatic considering in the appl Data older
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolImage"; };
void Init(void);
virtual ~Image(void);
// Derived function
virtual bool CalculateMinSize(void);
void SetFile(etk::UString newFile);
void SetPadding(etk::Vector2D<float> newPadding);
@ -39,17 +35,9 @@ namespace widget {
draw::Color m_textColorBg; //!< Background color
int32_t m_imageSize;
public:
// Derived function
virtual void OnRegenerateDisplay(void);
public:
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
};
};

View File

@ -42,31 +42,13 @@ namespace widget {
public:
Joystick(void);
virtual ~Joystick(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "Ewol"; };
/**
* @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] availlableX Availlable horisantal pixel size
* @param[in] availlableY Availlable vertical pixel size
* @return ---
*/
// Derived function
virtual bool CalculateSize(float availlableX, float availlableY);
// Derived function
virtual void OnRegenerateDisplay(void);
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
void SetLockMode(bool lockWhenOut) { m_lock = lockWhenOut; };
void SetDisplayMode(joystickMode_te newMode) { m_displayMode = newMode; };

View File

@ -22,15 +22,11 @@ namespace widget {
public:
Label(void);
Label(etk::UString newLabel);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolLabel"; };
void Init(void);
virtual ~Label(void);
// Derived function
virtual bool CalculateMinSize(void);
void SetLabel(etk::UString newLabel);
private:
@ -38,18 +34,11 @@ namespace widget {
etk::UString m_label;
draw::Color m_textColorFg; //!< Text color
public:
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
public:
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
};

View File

@ -19,16 +19,13 @@ namespace widget {
public:
Layer(void);
virtual ~Layer(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolLayer"; };
public:
virtual bool CalculateSize(float availlableX, float availlableY); // this generate the current size ...
virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
// Derived function
virtual bool CalculateSize(float availlableX, float availlableY);
// Derived function
virtual bool CalculateMinSize(void);
virtual void SetMinSise(float x=-1, float y=-1);
virtual void SetExpendX(bool newExpend=false);
virtual bool CanExpentX(void);
@ -44,23 +41,14 @@ namespace widget {
virtual void SubWidgetRemove(ewol::Widget* newWidget);
virtual void SubWidgetUnLink(ewol::Widget* newWidget);
protected:
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
public:
// Derived function
virtual void OnRegenerateDisplay(void);
public:
/**
* @brief Get the widget at the specific windows absolute position
* @param[in] pos gAbsolute position of the requested widget knowledge
* @return NULL No widget found
* @return pointer on the widget found
*/
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
};

View File

@ -21,12 +21,7 @@ namespace widget {
public:
List(void);
void Init(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolList"; };
virtual ~List(void);
virtual bool CalculateMinSize(void);
@ -39,6 +34,7 @@ namespace widget {
void AddOObject(ewol::Compositing* newObject, int32_t pos=-1);
void ClearOObjectList(void);
protected:
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
// list properties ...
private:
@ -47,16 +43,9 @@ namespace widget {
int32_t m_displayStartRaw; //!< Current starting diaplayed raw
int32_t m_displayCurrentNbLine; //!< Number of line in the display
public:
// Derived function
virtual void OnRegenerateDisplay(void);
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
protected:
// function call to display the list :
@ -89,7 +78,9 @@ namespace widget {
return false;
}
protected:
// Derived function
virtual void OnGetFocus(void);
// Derived function
virtual void OnLostFocus(void);
};

View File

@ -31,19 +31,19 @@ namespace widget {
public:
ListFileSystem(void);
~ListFileSystem(void);
// display API :
// Derived function
virtual draw::Color GetBasicBG(void);
// Derived function
uint32_t GetNuberOfColomn(void);
// Derived function
bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg);
// Derived function
uint32_t GetNuberOfRaw(void);
// Derived function
bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
// Derived function
bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
const char * const GetObjectType(void) { return "EwolListFileSystem"; };
public:
// extern API :

View File

@ -34,13 +34,7 @@ namespace widget {
public:
Menu(void);
virtual ~Menu(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived functionv
virtual const char * const GetObjectType(void) { return "EwolMenu"; };
private:
virtual void SubWidgetRemoveAll(void);
@ -56,21 +50,9 @@ namespace widget {
int32_t AddTitle(etk::UString label, etk::UString image="", const char * generateEvent = NULL, const etk::UString message = "");
int32_t Add(int32_t parent, etk::UString label, etk::UString image="", const char * generateEvent = NULL, const etk::UString message = "");
void AddSpacer(void);
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
// Derived function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
};

View File

@ -21,18 +21,18 @@ namespace widget {
public:
PopUp(void);
virtual ~PopUp(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolPopUp"; };
public:
virtual bool CalculateSize(float availlableX, float availlableY); // this generate the current size ...
virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
// 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 void SetExpendX(bool newExpend=false);
// Derived function
virtual void SetExpendY(bool newExpend=false);
void SetDisplayRatio(float ratio);
private:
@ -46,23 +46,14 @@ namespace widget {
void SubWidgetSet(ewol::Widget* newWidget);
void SubWidgetRemove(void);
protected:
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
public:
// Derived function
virtual void OnRegenerateDisplay(void);
public:
/**
* @brief Get the widget at the specific windows absolute position
* @param[in] pos gAbsolute position of the requested widget knowledge
* @return NULL No widget found
* @return pointer on the widget found
*/
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
};

View File

@ -21,12 +21,7 @@ namespace widget {
public:
ProgressBar(void);
virtual ~ProgressBar(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolProgressBar"; };
virtual bool CalculateMinSize(void);
void ValueSet(float val);
@ -38,6 +33,7 @@ namespace widget {
draw::Color m_textColorBgOn; //!< bar color enable
draw::Color m_textColorBgOff; //!< bar color disable
public:
// Derived function
virtual void OnRegenerateDisplay(void);
};

View File

@ -27,26 +27,13 @@ namespace widget {
public:
Scene(void);
virtual ~Scene(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolScene"; };
// Derived function
virtual void OnRegenerateDisplay(void);
/**
* @brief Periodic call of this widget
* @param localTime curent system time
* @return ---
*/
// Derived function
virtual void PeriodicCall(int64_t localTime);
/**
* @brief Common widget drawing function (called by the drawing thread [Android, X11, ...])
* @param ---
* @return ---
*/
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
/**
* @brief Set the scene in pause for a while
@ -103,15 +90,6 @@ namespace widget {
*/
virtual etk::Vector2D<float> RelativePosition(etk::Vector2D<float> pos);
};
/**
* @brief Initilise the basic widget property ==> due to the android system
* @note all widget that have template might have this initializer ...
* @param ---
* @return ---
*/
void WIDGET_SceneInit(void);
};
#endif

View File

@ -19,21 +19,22 @@ namespace widget {
public:
SizerHori(void);
virtual ~SizerHori(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolSizerHori"; };
public:
virtual bool CalculateSize(float availlableX, float availlableY); // this generate the current size ...
virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
// Derived function
virtual bool CalculateSize(float availlableX, float availlableY);
// Derived function
virtual bool CalculateMinSize(void);
// Derived function
virtual void SetMinSize(float x=-1, float y=-1);
// Derived function
virtual void SetExpendX(bool newExpend=false);
// Derived function
virtual bool CanExpentX(void);
// Derived function
virtual void SetExpendY(bool newExpend=false);
// Derived function
virtual bool CanExpentY(void);
void LockExpendContamination(bool lockExpend=false);
private:
@ -45,22 +46,14 @@ namespace widget {
virtual void SubWidgetRemove(ewol::Widget* newWidget);
virtual void SubWidgetUnLink(ewol::Widget* newWidget);
protected:
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
public:
// Derived function
virtual void OnRegenerateDisplay(void);
/**
* @brief Get the widget at the specific windows absolute position
* @param[in] pos gAbsolute position of the requested widget knowledge
* @return NULL No widget found
* @return pointer on the widget found
*/
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
};

View File

@ -19,20 +19,22 @@ namespace widget {
public:
SizerVert(void);
virtual ~SizerVert(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolSizerVert"; };
public:
virtual bool CalculateSize(float availlableX, float availlableY); // this generate the current size ...
virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
// Derived function
virtual bool CalculateSize(float availlableX, float availlableY);
// Derived function
virtual bool CalculateMinSize(void);
// Derived function
virtual void SetMinSize(float x=-1, float y=-1);
// Derived function
virtual void SetExpendX(bool newExpend=false);
// Derived function
virtual bool CanExpentX(void);
// Derived function
virtual void SetExpendY(bool newExpend=false);
// Derived function
virtual bool CanExpentY(void);
void LockExpendContamination(bool lockExpend=false);
private:
@ -44,23 +46,14 @@ namespace widget {
virtual void SubWidgetRemove(ewol::Widget* newWidget);
virtual void SubWidgetUnLink(ewol::Widget* newWidget);
protected:
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
public:
// Derived function
virtual void OnRegenerateDisplay(void);
public:
/**
* @brief Get the widget at the specific windows absolute position
* @param[in] pos gAbsolute position of the requested widget knowledge
* @return NULL No widget found
* @return pointer on the widget found
*/
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
};

View File

@ -22,13 +22,9 @@ namespace widget {
public:
Slider(void);
virtual ~Slider(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolSlider"; } ;
// Derived function
virtual bool CalculateMinSize(void);
void SetValue(int32_t val);
int32_t GetValue(void);
@ -42,17 +38,9 @@ namespace widget {
draw::Color m_textColorFg; //!< Text color
draw::Color m_textColorBg; //!< Background color
public:
// Derived function
virtual void OnRegenerateDisplay(void);
public:
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
};

View File

@ -20,23 +20,14 @@ namespace widget {
public:
Spacer(void);
virtual ~Spacer(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolSpacer"; };
// Derived function
virtual bool CalculateMinSize(void);
void SetSize(float size);
/**
* @brief Get the widget at the specific windows absolute position
* @note the sizer return NULL, because nothing can be done inside nothing
* @param[in] pos gAbsolute position of the requested widget knowledge
* @return NULL No widget found
* @return pointer on the widget found
*/
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos) { return NULL; };
// Derived function
virtual void OnRegenerateDisplay(void);
void SetColor(draw::Color newColor) { m_color = newColor; MarkToRedraw(); };
private:

View File

@ -19,20 +19,20 @@ namespace widget {
public:
WSlider(void);
virtual ~WSlider(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolWSlider"; };
private:
etk::Vector2D<bool> m_underExpend; // expend of the uner elements ...
public:
virtual bool CalculateSize(float availlableX, float availlableY); // this generate the current size ...
virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
// 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);
private:
@ -50,29 +50,16 @@ namespace widget {
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);
public:
// Derived function
virtual void OnRegenerateDisplay(void);
public:
/**
* @brief Get the widget at the specific windows absolute position
* @param[in] pos gAbsolute position of the requested widget knowledge
* @return NULL No widget found
* @return pointer on the widget found
*/
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
/**
* @brief Periodic call of this widget
* @param localTime curent system time
* @return ---
*/
// Derived function
virtual void PeriodicCall(int64_t localTime);
};

View File

@ -72,7 +72,6 @@ namespace ewol {
virtual ~Widget(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/

View File

@ -46,7 +46,7 @@ void widget::WidgetScrooled::OnRegenerateDisplay(void)
tmpDraw = new ewol::Drawing();
tmpDraw->SetColor(0xFF00007F);
}
if (NULL!=tmpDraw) {
if (NULL==tmpDraw) {
return;
}
tmpDraw->SetThickness(1);

View File

@ -49,32 +49,15 @@ namespace widget {
public:
WidgetScrooled(void);
virtual ~WidgetScrooled(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolWidgetScrooled"; };
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
/**
* @brief extern interface to request a draw ... (called by the drawing thread [Android, X11, ...])
* This function generate a clipping with the viewport openGL system. Like this a widget draw can not draw over an other widget
* @note This function is virtual for the scrolled widget, and the more complicated OpenGl widget
* @param ---
* @return ---
*/
// Derived function
virtual void GenDraw(ewol::DrawProperty displayProp);
protected:
/**

View File

@ -20,12 +20,7 @@ namespace ewol {
public:
Windows(void);
virtual ~Windows(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolWindows"; };
// internal event at ewol system :
public:
@ -40,13 +35,9 @@ namespace ewol {
virtual void OnReduce(void) { };
virtual void On(void) { };
public:
// Derived function
virtual bool CalculateSize(float availlableX, float availlableY);
/**
* @brief Get the widget at the specific windows absolute position
* @param[in] pos gAbsolute position of the requested widget knowledge
* @return NULL No widget found
* @return pointer on the widget found
*/
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
private:
bool m_hasDecoration;
@ -67,16 +58,12 @@ namespace ewol {
void SetSubWidget(ewol::Widget * widget);
void PopUpWidgetPush(ewol::Widget * widget);
protected:
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
public:
// Derived function
virtual void OnRegenerateDisplay(void);
public:
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
};

View File

@ -33,7 +33,7 @@ const char * const eventColorBarHasChange = "event-color-bar-has-change
const char * const eventColorSpecificHasChange = "event-color-specific-has-change";
ewol::ColorChooser::ColorChooser(void)
widget::ColorChooser::ColorChooser(void)
{
AddEventId(ewolEventColorChooserChange);
@ -97,13 +97,13 @@ ewol::ColorChooser::ColorChooser(void)
}
ewol::ColorChooser::~ColorChooser(void)
widget::ColorChooser::~ColorChooser(void)
{
}
void ewol::ColorChooser::SetColor(draw::Color newColor)
void widget::ColorChooser::SetColor(draw::Color newColor)
{
m_currentColor = newColor;
if (NULL != m_widgetRed) {
@ -124,13 +124,13 @@ void ewol::ColorChooser::SetColor(draw::Color newColor)
}
draw::Color ewol::ColorChooser::GetColor(void)
draw::Color widget::ColorChooser::GetColor(void)
{
return m_currentColor;
}
void ewol::ColorChooser::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
void widget::ColorChooser::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
if (NULL == CallerObject) {
return;
@ -181,7 +181,7 @@ void ewol::ColorChooser::OnReceiveMessage(ewol::EObject * CallerObject, const ch
};
void ewol::ColorChooser::OnObjectRemove(ewol::EObject * removeObject)
void widget::ColorChooser::OnObjectRemove(ewol::EObject * removeObject)
{
// First step call parrent :
widget::SizerVert::OnObjectRemove(removeObject);

View File

@ -21,33 +21,17 @@
extern const char * const ewolEventColorChooserChange;
namespace ewol {
namespace widget {
class ColorChooser : public widget::SizerVert
{
public:
ColorChooser(void);
~ColorChooser(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolColorChooser"; };
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
// Derived function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
void SetColor(draw::Color newColor);

View File

@ -64,7 +64,7 @@ extern const char * const ewolEventFileChooserListFileValidate = "ewol-event-fil
extern const char * const ewolEventFileChooserHome = "ewol-event-file-chooser-home";
ewol::FileChooser::FileChooser(void)
widget::FileChooser::FileChooser(void)
{
AddEventId(ewolEventFileChooserCancel);
AddEventId(ewolEventFileChooserValidate);
@ -264,13 +264,13 @@ ewol::FileChooser::FileChooser(void)
}
ewol::FileChooser::~FileChooser(void)
widget::FileChooser::~FileChooser(void)
{
}
void ewol::FileChooser::SetTitle(etk::UString label)
void widget::FileChooser::SetTitle(etk::UString label)
{
if (NULL == m_widgetTitle) {
return;
@ -278,7 +278,7 @@ void ewol::FileChooser::SetTitle(etk::UString label)
m_widgetTitle->SetLabel(label);
}
void ewol::FileChooser::SetValidateLabel(etk::UString label)
void widget::FileChooser::SetValidateLabel(etk::UString label)
{
if (NULL == m_widgetValidate) {
return;
@ -286,7 +286,7 @@ void ewol::FileChooser::SetValidateLabel(etk::UString label)
m_widgetValidate->SetLabel(label);
}
void ewol::FileChooser::SetCancelLabel(etk::UString label)
void widget::FileChooser::SetCancelLabel(etk::UString label)
{
if (NULL == m_widgetCancel) {
return;
@ -294,13 +294,13 @@ void ewol::FileChooser::SetCancelLabel(etk::UString label)
m_widgetCancel->SetLabel(label);
}
void ewol::FileChooser::SetFolder(etk::UString folder)
void widget::FileChooser::SetFolder(etk::UString folder)
{
m_folder = folder + "/";
UpdateCurrentFolder();
}
void ewol::FileChooser::SetFileName(etk::UString filename)
void widget::FileChooser::SetFileName(etk::UString filename)
{
m_file = filename;
if (NULL == m_widgetCurrentFileName) {
@ -317,7 +317,7 @@ void ewol::FileChooser::SetFileName(etk::UString filename)
* @param[in] data Data registered by this class
* @return ---
*/
void ewol::FileChooser::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
void widget::FileChooser::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
EWOL_INFO("Receive Event from the LIST ... : widgetPointer=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" );
if (ewolEventFileChooserEntryFolder == eventId) {
@ -389,7 +389,7 @@ void ewol::FileChooser::OnReceiveMessage(ewol::EObject * CallerObject, const cha
void ewol::FileChooser::UpdateCurrentFolder(void)
void widget::FileChooser::UpdateCurrentFolder(void)
{
if (m_folder != "" ) {
if (m_folder[m_folder.Size()-1] != '/') {
@ -409,7 +409,7 @@ void ewol::FileChooser::UpdateCurrentFolder(void)
}
etk::UString ewol::FileChooser::GetCompleateFileName(void)
etk::UString widget::FileChooser::GetCompleateFileName(void)
{
etk::UString tmpString = m_folder;
tmpString += "/";
@ -424,7 +424,7 @@ etk::UString ewol::FileChooser::GetCompleateFileName(void)
* @note : Sub classes must call this class
* @return ---
*/
void ewol::FileChooser::OnObjectRemove(ewol::EObject * removeObject)
void widget::FileChooser::OnObjectRemove(ewol::EObject * removeObject)
{
// First step call parrent :
widget::PopUp::OnObjectRemove(removeObject);

View File

@ -21,33 +21,17 @@
extern const char * const ewolEventFileChooserCancel;
extern const char * const ewolEventFileChooserValidate;
namespace ewol {
namespace widget {
class FileChooser : public widget::PopUp
{
public:
FileChooser(void);
virtual ~FileChooser(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolFileChooser"; };
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
// Derived function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
void SetTitle(etk::UString label);
void SetValidateLabel(etk::UString label);

View File

@ -28,27 +28,11 @@ namespace widget {
public:
Parameter(void);
~Parameter(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolParameter"; };
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
// Derived function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
void SetTitle(etk::UString label);

View File

@ -42,14 +42,10 @@ namespace widget {
etk::Vector<widget::elementPL *> m_list;
public:
ParameterList(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolParameterList"; };
virtual ~ParameterList(void);
// Derived function
virtual bool CalculateMinSize(void);
void SetLabel(etk::UString newLabel);
// Drawing capabilities ....
@ -59,6 +55,7 @@ namespace widget {
void AddOObject(ewol::Compositing* newObject, int32_t pos=-1);
void ClearOObjectList(void);
protected:
// Derived function
void OnDraw(ewol::DrawProperty& displayProp);
// list properties ...
private:
@ -67,19 +64,14 @@ namespace widget {
int32_t m_displayStartRaw; //!< Current starting diaplayed raw
int32_t m_displayCurrentNbLine; //!< Number of line in the display
public:
// Derived function
void OnRegenerateDisplay(void);
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
// Derived function
bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
protected:
// Derived function
void OnGetFocus(void);
// Derived function
void OnLostFocus(void);
public:
void MenuAdd(etk::UString& label, int32_t refId, etk::UString& image);

View File

@ -28,7 +28,7 @@ extern const char * const ewolEventFileStdPopUpButton3 = "ewol event std_pop_up
extern const char * const ewolEventFileStdPopUpButton4 = "ewol event std_pop_up BT4";
ewol::StdPopUp::StdPopUp(void)
widget::StdPopUp::StdPopUp(void)
{
AddEventId(ewolEventFileStdPopUpCancel);
AddEventId(ewolEventFileStdPopUpValidate);
@ -106,13 +106,13 @@ ewol::StdPopUp::StdPopUp(void)
}
ewol::StdPopUp::~StdPopUp(void)
widget::StdPopUp::~StdPopUp(void)
{
}
void ewol::StdPopUp::SetTitle(etk::UString label)
void widget::StdPopUp::SetTitle(etk::UString label)
{
ewol::Label * tmpWidget = (ewol::Label*)ewol::widgetManager::Get(m_widgetTitleId);
if (NULL == tmpWidget) {
@ -121,7 +121,7 @@ void ewol::StdPopUp::SetTitle(etk::UString label)
tmpWidget->SetLabel(label);
}
void ewol::StdPopUp::SetValidateLabel(etk::UString label)
void widget::StdPopUp::SetValidateLabel(etk::UString label)
{
ewol::Button * tmpWidget = (ewol::Button*)ewol::widgetManager::Get(m_widgetValidateId);
if (NULL == tmpWidget) {
@ -130,7 +130,7 @@ void ewol::StdPopUp::SetValidateLabel(etk::UString label)
tmpWidget->SetLabel(label);
}
void ewol::StdPopUp::SetCancelLabel(etk::UString label)
void widget::StdPopUp::SetCancelLabel(etk::UString label)
{
ewol::Button * tmpWidget = (ewol::Button*)ewol::widgetManager::Get(m_widgetCancelId);
if (NULL == tmpWidget) {
@ -139,14 +139,14 @@ void ewol::StdPopUp::SetCancelLabel(etk::UString label)
tmpWidget->SetLabel(label);
}
void ewol::StdPopUp::SetFolder(etk::UString folder)
void widget::StdPopUp::SetFolder(etk::UString folder)
{
m_folder = folder;
}
bool ewol::StdPopUp::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, float x, float y)
bool widget::StdPopUp::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, float x, float y)
{
EWOL_INFO("Receive Event from the BT ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> internalEvent=\"" << eventExternId << "\"" );
if (ewolEventFileChooserCancel == eventExternId) {

View File

@ -22,18 +22,13 @@ extern const char * const ewolEventFileStdPopUpButton4;
extern const char * const ewolEventFileStdPopUpButton5;
extern const char * const ewolEventFileStdPopUpButton6;
namespace ewol {
namespace widget {
class StdPopUp : public widget::PopUp
{
public:
StdPopUp(void);
~StdPopUp(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
// Derived function
virtual const char * const GetObjectType(void) { return "EwolPopUp"; };
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, float x, float y);
void SetTitle(etk::UString text);