Remove all the capabilities at the Widget main classes
This commit is contained in:
parent
bd8b05eaf2
commit
227c141993
@ -34,7 +34,7 @@
|
||||
|
||||
ewol::OObject::OObject(void)
|
||||
{
|
||||
m_name="";
|
||||
// nothing to do ...
|
||||
}
|
||||
|
||||
|
||||
@ -43,21 +43,3 @@ ewol::OObject::~OObject(void)
|
||||
|
||||
}
|
||||
|
||||
void ewol::OObject::SetName(etk::UString & name)
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
void ewol::OObject::SetName(const char * name)
|
||||
{
|
||||
if (NULL != name) {
|
||||
m_name = name;
|
||||
}
|
||||
}
|
||||
|
||||
etk::UString ewol::OObject::GetName(void)
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,32 +47,12 @@ namespace ewol {
|
||||
virtual ~OObject(void);
|
||||
public:
|
||||
virtual void Draw(void) = 0;
|
||||
void SetName(etk::UString & name);
|
||||
void SetName(const char * name);
|
||||
etk::UString GetName(void);
|
||||
public:
|
||||
// use to crop element outside the display
|
||||
virtual void UpdateSize(etkFloat_t sizeX, etkFloat_t sizeY) { };
|
||||
// Move to the correct position display
|
||||
virtual void UpdateOrigin(etkFloat_t x, etkFloat_t y) { };
|
||||
private:
|
||||
etk::UString m_name;
|
||||
};
|
||||
|
||||
/*
|
||||
class OObjectFile :public ewol::OObject
|
||||
{
|
||||
public:
|
||||
OObjectFile(etk::File fileName) {};
|
||||
virtual ~OObject2DColored(void) {};
|
||||
public:
|
||||
void Draw(void);
|
||||
bool Save(etk::File fileName) { return false; };
|
||||
protected:
|
||||
etk::VectorType<OObject*> m_listsubObject; //!< an object file contain more than one object...
|
||||
bool m_isBinaryFile; //!< to know th mode of saving the file
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -93,8 +93,6 @@ ewol::Widget::Widget(void)
|
||||
SetExpendY();
|
||||
SetFillX();
|
||||
SetFillY();
|
||||
m_genericDraw = true;
|
||||
m_specificDraw = false;
|
||||
ewol::widgetManager::Add(this);
|
||||
m_canFocus = false;
|
||||
m_hasFocus = false;
|
||||
@ -249,70 +247,6 @@ bool ewol::Widget::ExternLinkOnEvent(const char * eventName, int32_t widgetId, c
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ewol::Widget::AddOObject(ewol::OObject* newObject, etk::UString name, int32_t pos)
|
||||
{
|
||||
if (NULL == newObject) {
|
||||
EWOL_ERROR("Try to add an empty object in the Widget generic display system : name=\"" << name << "\"");
|
||||
return;
|
||||
}
|
||||
newObject->SetName(name);
|
||||
//EWOL_INFO("UPDATE AT size : (" << m_size.x << "," << m_size.y << ")");
|
||||
newObject->UpdateSize(m_size.x, m_size.y);
|
||||
//EWOL_INFO("UPDATE AT origin : (" << m_origin.x << "," << m_origin.y << ")");
|
||||
newObject->UpdateOrigin(m_origin.x, m_origin.y);
|
||||
if (pos < 0 || pos >= m_listOObject[m_currentCreateId].Size() ) {
|
||||
m_listOObject[m_currentCreateId].PushBack(newObject);
|
||||
} else {
|
||||
m_listOObject[m_currentCreateId].Insert(pos, newObject);
|
||||
}
|
||||
m_needFlipFlop = true;
|
||||
}
|
||||
|
||||
|
||||
ewol::OObject* ewol::Widget::GetOObject(etk::UString name)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_listOObject[m_currentCreateId].Size(); iii++) {
|
||||
if (m_listOObject[m_currentCreateId][iii]->GetName() == name) {
|
||||
return m_listOObject[m_currentCreateId][iii];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ewol::Widget::RmOObjectElem(etk::UString name)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_listOObject[m_currentCreateId].Size(); iii++) {
|
||||
if (m_listOObject[m_currentCreateId][iii]->GetName() == name) {
|
||||
delete(m_listOObject[m_currentCreateId][iii]);
|
||||
m_listOObject[m_currentCreateId][iii] = NULL;
|
||||
m_listOObject[m_currentCreateId].Erase(iii);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::Widget::ClearOObjectList(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_listOObject[m_currentCreateId].Size(); iii++) {
|
||||
delete(m_listOObject[m_currentCreateId][iii]);
|
||||
m_listOObject[m_currentCreateId][iii] = NULL;
|
||||
}
|
||||
m_listOObject[m_currentCreateId].Clear();
|
||||
}
|
||||
|
||||
bool ewol::Widget::GenericDraw(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_listOObject[m_currentDrawId].Size(); iii++) {
|
||||
if (NULL != m_listOObject[m_currentDrawId][iii]) {
|
||||
m_listOObject[m_currentDrawId][iii]->Draw();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void ewol::Widget::DoubleBufferFlipFlop(void)
|
||||
{
|
||||
if (true == m_needFlipFlop) {
|
||||
|
@ -38,6 +38,7 @@ namespace ewol {
|
||||
|
||||
namespace ewol {
|
||||
extern "C" {
|
||||
// TODO : Remove this bu coord2D_ts
|
||||
typedef struct {
|
||||
etkFloat_t x;
|
||||
etkFloat_t y;
|
||||
@ -102,13 +103,8 @@ namespace ewol {
|
||||
#define UTF8_MAX_SIZE (8)
|
||||
#define EWOL_EVENT_AREA (0)
|
||||
#define EWOL_EVENT_SHORTCUT (1)
|
||||
// TODO : Remove this and set it at the Windows only ...
|
||||
extern "C" {
|
||||
typedef struct {
|
||||
const char * generateEventId; // event generate ID (to be unique it was pointer on the string name)
|
||||
coord origin; // widget specific
|
||||
coord size; // widget specific
|
||||
uint64_t flags; // widget specific
|
||||
} eventArea_ts;
|
||||
typedef struct {
|
||||
const char * generateEventId; // event generate ID (to be unique it was pointer on the string name)
|
||||
bool shift;
|
||||
@ -252,45 +248,25 @@ namespace ewol {
|
||||
// -- Drawing : Special case ==> have internal system drawing management to prevent reconstriction of a widget
|
||||
// -- this will automaticly regenerate the same view in openGL
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
private:
|
||||
bool m_genericDraw;
|
||||
bool m_specificDraw;
|
||||
etk::VectorType<ewol::OObject*> m_listOObject[NB_BOUBLE_BUFFER]; //!< generic element to display...
|
||||
bool GenericDraw(void);
|
||||
protected:
|
||||
int32_t m_currentDrawId;
|
||||
int32_t m_currentCreateId;
|
||||
bool m_needFlipFlop;
|
||||
public:
|
||||
void DoubleBufferFlipFlop(void);
|
||||
protected:
|
||||
void AddOObject(ewol::OObject* newObject, etk::UString name = "", int32_t pos=-1);
|
||||
ewol::OObject* GetOObject(etk::UString name);
|
||||
void RmOObjectElem(etk::UString name);
|
||||
void ClearOObjectList(void);
|
||||
void GenericDrawDisable(void) { m_genericDraw = false; };
|
||||
void GenericDrawEnable(void) { m_genericDraw = true; };
|
||||
void SpecificDrawDisable(void) { m_specificDraw = false; };
|
||||
void SpecificDrawEnable(void) { m_specificDraw = true; };
|
||||
virtual bool OnDraw(void) { /*EWOL_ERROR("plop");*/ return true; };
|
||||
private:
|
||||
bool m_needRegenerateDisplay;
|
||||
int32_t m_currentDrawId;
|
||||
int32_t m_currentCreateId;
|
||||
bool m_needFlipFlop;
|
||||
bool m_needRegenerateDisplay;
|
||||
virtual bool OnDraw(void) { return true; };
|
||||
protected:
|
||||
void MarkToReedraw(void) { m_needRegenerateDisplay = true; };
|
||||
bool NeedRedraw(void) { bool tmpData=m_needRegenerateDisplay; m_needRegenerateDisplay=false; return tmpData; };
|
||||
public:
|
||||
virtual void OnRegenerateDisplay(void) { };
|
||||
void DoubleBufferFlipFlop(void);
|
||||
virtual void OnRegenerateDisplay(void) { /* nothing to do */ };
|
||||
bool GenDraw(void)
|
||||
{
|
||||
if (true == m_genericDraw) {
|
||||
//EWOL_DEBUG("Draw generic...");
|
||||
GenericDraw();
|
||||
}
|
||||
if (true == m_specificDraw) {
|
||||
//EWOL_DEBUG("Draw Custum...");
|
||||
OnDraw();
|
||||
}
|
||||
return true;
|
||||
// TODO : Set here the open gl moving ...
|
||||
//EWOL_DEBUG("Draw Custum...");
|
||||
bool valRet = OnDraw();
|
||||
|
||||
return valRet;
|
||||
};
|
||||
|
||||
}; // end of the class Widget declaration
|
||||
|
@ -48,8 +48,6 @@ ewol::Windows::Windows(void)
|
||||
SetCanHaveFocus(true);
|
||||
m_subWidget = NULL;
|
||||
m_keyBoardwidget = NULL;
|
||||
// enable specific drawing system ...
|
||||
SpecificDrawEnable();
|
||||
SetDecorationDisable();
|
||||
//KeyboardShow(KEYBOARD_MODE_CODE);
|
||||
}
|
||||
|
@ -177,9 +177,9 @@ void ewol::Button::OnRegenerateDisplay(void)
|
||||
tmpSizeX += m_padding.x/1;
|
||||
tmpSizeY += m_padding.y/1;
|
||||
tmpOObjects->Rectangle( tmpOriginX, tmpOriginY, tmpSizeX, tmpSizeY);
|
||||
AddOObject(tmpOObjects, "BouttonDecoration");
|
||||
AddOObject(tmpOObjects);
|
||||
|
||||
AddOObject(tmpText, "BouttonText");
|
||||
AddOObject(tmpText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Debug.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include <ewol/widget/Drawable.h>
|
||||
|
||||
extern const char * const ewolEventButtonPressed;
|
||||
extern const char * const ewolEventButtonEnter;
|
||||
@ -38,7 +38,7 @@ namespace ewol {
|
||||
TEXT_ALIGN_LEFT,
|
||||
TEXT_ALIGN_CENTER,
|
||||
} textAlignement_te;
|
||||
class Button :public ewol::Widget
|
||||
class Button :public ewol::Drawable
|
||||
{
|
||||
public:
|
||||
Button(void);
|
||||
|
@ -142,8 +142,8 @@ void ewol::CheckBox::OnRegenerateDisplay(void)
|
||||
tmpOObjects->Line( 2.5, boxSize+2.5, boxSize+2.5, 2.5, borderWidth);
|
||||
}
|
||||
|
||||
AddOObject(tmpOObjects, "Decoration");
|
||||
AddOObject(tmpText, "Text");
|
||||
AddOObject(tmpOObjects);
|
||||
AddOObject(tmpText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,12 +27,12 @@
|
||||
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Debug.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include <ewol/widget/Drawable.h>
|
||||
|
||||
extern const char* const ewolEventCheckBoxClicked;
|
||||
|
||||
namespace ewol {
|
||||
class CheckBox :public ewol::Widget
|
||||
class CheckBox :public ewol::Drawable
|
||||
{
|
||||
public:
|
||||
CheckBox(void);
|
||||
|
@ -33,8 +33,6 @@
|
||||
|
||||
ewol::ContextMenu::ContextMenu(void)
|
||||
{
|
||||
//GenericDrawDisable();
|
||||
SpecificDrawEnable();
|
||||
m_userExpendX = true;
|
||||
m_userExpendY = true;
|
||||
|
||||
@ -189,6 +187,7 @@ void ewol::ContextMenu::SubWidgetRemove(void)
|
||||
|
||||
bool ewol::ContextMenu::OnDraw(void)
|
||||
{
|
||||
ewol::Drawable::OnDraw();
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->GenDraw();
|
||||
}
|
||||
@ -203,7 +202,7 @@ void ewol::ContextMenu::OnRegenerateDisplay(void)
|
||||
// generate a white background and take gray on other surfaces
|
||||
ClearOObjectList();
|
||||
ewol::OObject2DColored * BGOObjects = new ewol::OObject2DColored();
|
||||
AddOObject(BGOObjects, "ListDeco");
|
||||
AddOObject(BGOObjects);
|
||||
|
||||
if (NULL != m_subWidget) {
|
||||
coord tmpSize = m_subWidget->GetSize();
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Debug.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include <ewol/widget/Drawable.h>
|
||||
|
||||
namespace ewol {
|
||||
typedef enum {
|
||||
@ -37,7 +38,7 @@ namespace ewol {
|
||||
CONTEXT_MENU_MARK_LEFT,
|
||||
CONTEXT_MENU_MARK_NONE
|
||||
}markPosition_te;
|
||||
class ContextMenu : public ewol::Widget
|
||||
class ContextMenu : public ewol::Drawable
|
||||
{
|
||||
public:
|
||||
ContextMenu(void);
|
||||
|
85
Sources/libewol/ewol/widget/Drawable.cpp
Normal file
85
Sources/libewol/ewol/widget/Drawable.cpp
Normal file
@ -0,0 +1,85 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file ewol/widget/Drawable.h
|
||||
* @brief basic ewol drawable widget (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 18/02/2012
|
||||
* @par Project
|
||||
* ewol
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2011 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
*
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <ewol/widget/Drawable.h>
|
||||
|
||||
|
||||
ewol::Drawable::Drawable(void)
|
||||
{
|
||||
// nothing to do ...
|
||||
}
|
||||
|
||||
ewol::Drawable::~Drawable(void)
|
||||
{
|
||||
//clean all the object
|
||||
for (int32_t jjj=0; jjj<NB_BOUBLE_BUFFER; jjj++) {
|
||||
for (int32_t iii=0; iii<m_listOObject[jjj].Size(); iii++) {
|
||||
delete(m_listOObject[jjj][iii]);
|
||||
m_listOObject[jjj][iii] = NULL;
|
||||
}
|
||||
m_listOObject[jjj].Clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ewol::Drawable::AddOObject(ewol::OObject* newObject, int32_t pos)
|
||||
{
|
||||
if (NULL == newObject) {
|
||||
EWOL_ERROR("Try to add an empty object in the Widget generic display system");
|
||||
return;
|
||||
}
|
||||
//EWOL_INFO("UPDATE AT size : (" << m_size.x << "," << m_size.y << ")");
|
||||
newObject->UpdateSize(m_size.x, m_size.y);
|
||||
//EWOL_INFO("UPDATE AT origin : (" << m_origin.x << "," << m_origin.y << ")");
|
||||
newObject->UpdateOrigin(m_origin.x, m_origin.y);
|
||||
if (pos < 0 || pos >= m_listOObject[m_currentCreateId].Size() ) {
|
||||
m_listOObject[m_currentCreateId].PushBack(newObject);
|
||||
} else {
|
||||
m_listOObject[m_currentCreateId].Insert(pos, newObject);
|
||||
}
|
||||
m_needFlipFlop = true;
|
||||
}
|
||||
|
||||
|
||||
void ewol::Drawable::ClearOObjectList(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_listOObject[m_currentCreateId].Size(); iii++) {
|
||||
delete(m_listOObject[m_currentCreateId][iii]);
|
||||
m_listOObject[m_currentCreateId][iii] = NULL;
|
||||
}
|
||||
m_listOObject[m_currentCreateId].Clear();
|
||||
}
|
||||
|
||||
bool ewol::Drawable::OnDraw(void)
|
||||
{
|
||||
for (int32_t iii=0; iii<m_listOObject[m_currentDrawId].Size(); iii++) {
|
||||
if (NULL != m_listOObject[m_currentDrawId][iii]) {
|
||||
m_listOObject[m_currentDrawId][iii]->Draw();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file ewol/widget/Test.h
|
||||
* @brief ewol test widget system (header)
|
||||
* @file ewol/widget/Drawable.h
|
||||
* @brief basic ewol drawable widget (header)
|
||||
* @author Edouard DUPIN
|
||||
* @date 07/11/2011
|
||||
* @date 18/02/2012
|
||||
* @par Project
|
||||
* ewol
|
||||
*
|
||||
@ -22,27 +22,29 @@
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __EWOL_TEST_H__
|
||||
#define __EWOL_TEST_H__
|
||||
#ifndef __EWOL_WIDGET_DRAWABLE_H__
|
||||
#define __EWOL_WIDGET_DRAWABLE_H__
|
||||
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Debug.h>
|
||||
#include <ewol/Widget.h>
|
||||
|
||||
|
||||
namespace ewol {
|
||||
class Test :public ewol::Widget
|
||||
{
|
||||
|
||||
class Drawable : virtual public ewol::Widget {
|
||||
public:
|
||||
Test(void);
|
||||
virtual ~Test(void);
|
||||
virtual bool CalculateMinSize(void);
|
||||
public:
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
public:
|
||||
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y);
|
||||
Drawable(void);
|
||||
virtual ~Drawable(void);
|
||||
|
||||
private:
|
||||
int32_t m_elementID;
|
||||
etk::VectorType<ewol::OObject*> m_listOObject[NB_BOUBLE_BUFFER]; //!< generic element to display...
|
||||
public:
|
||||
void AddOObject(ewol::OObject* newObject, int32_t pos=-1);
|
||||
void ClearOObjectList(void);
|
||||
protected:
|
||||
virtual bool OnDraw(void);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -165,8 +165,8 @@ void ewol::Entry::OnRegenerateDisplay(void)
|
||||
int32_t XCursorPos = fontWidth + m_borderSize + 2*m_paddingSize;
|
||||
tmpOObjects->Line(XCursorPos, tmpTextOriginY, XCursorPos, tmpTextOriginY + fontHeight, 1);
|
||||
}
|
||||
AddOObject(tmpOObjects, "BouttonDecoration");
|
||||
AddOObject(tmpText, "BouttonText");
|
||||
AddOObject(tmpOObjects);
|
||||
AddOObject(tmpText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,14 +27,14 @@
|
||||
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Debug.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include <ewol/widget/Drawable.h>
|
||||
|
||||
extern const char * const ewolEventEntryClick;
|
||||
extern const char * const ewolEventEntryEnter;
|
||||
extern const char * const ewolEventEntryModify;
|
||||
|
||||
namespace ewol {
|
||||
class Entry :public ewol::Widget
|
||||
class Entry :public ewol::Drawable
|
||||
{
|
||||
public:
|
||||
Entry(void);
|
||||
|
@ -114,7 +114,7 @@ void ewol::Label::OnRegenerateDisplay(void)
|
||||
drawClipping.h = m_size.y - 2*paddingSize;
|
||||
tmpText->Text(textPos, drawClipping, m_label);
|
||||
|
||||
AddOObject(tmpText, "LabelText");
|
||||
AddOObject(tmpText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,12 +27,12 @@
|
||||
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Debug.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include <ewol/widget/Drawable.h>
|
||||
|
||||
extern const char * const ewolEventLabelPressed;
|
||||
|
||||
namespace ewol {
|
||||
class Label :public ewol::Widget
|
||||
class Label :public ewol::Drawable
|
||||
{
|
||||
public:
|
||||
Label(void);
|
||||
|
@ -146,7 +146,7 @@ void ewol::List::OnRegenerateDisplay(void)
|
||||
AddOObject(tmpText);
|
||||
tmpOriginY += minHeight + 2* m_paddingSizeY;
|
||||
}
|
||||
AddOObject(BGOObjects, "ListDeco", 0);
|
||||
AddOObject(BGOObjects, 0);
|
||||
|
||||
// call the herited class...
|
||||
WidgetScrooled::OnRegenerateDisplay();
|
||||
|
@ -28,9 +28,10 @@
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Debug.h>
|
||||
#include <ewol/widget/WidgetScrolled.h>
|
||||
#include <ewol/widget/Drawable.h>
|
||||
|
||||
namespace ewol {
|
||||
class List :public ewol::WidgetScrooled
|
||||
class List :public ewol::WidgetScrooled, ewol::Drawable
|
||||
{
|
||||
public:
|
||||
List(void);
|
||||
|
@ -32,8 +32,6 @@
|
||||
|
||||
ewol::PopUp::PopUp(void)
|
||||
{
|
||||
//GenericDrawDisable();
|
||||
SpecificDrawEnable();
|
||||
m_userExpendX = true;
|
||||
m_userExpendY = true;
|
||||
|
||||
@ -158,7 +156,7 @@ void ewol::PopUp::OnRegenerateDisplay(void)
|
||||
// generate a white background and take gray on other surfaces
|
||||
ClearOObjectList();
|
||||
ewol::OObject2DColored * BGOObjects = new ewol::OObject2DColored();
|
||||
AddOObject(BGOObjects, "ListDeco");
|
||||
AddOObject(BGOObjects);
|
||||
|
||||
BGOObjects->SetColor(m_colorEmptyArea);
|
||||
BGOObjects->Rectangle(0, 0, m_size.x, m_size.y);
|
||||
|
@ -28,9 +28,10 @@
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Debug.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include <ewol/widget/Drawable.h>
|
||||
|
||||
namespace ewol {
|
||||
class PopUp : public ewol::Widget
|
||||
class PopUp : public ewol::Drawable
|
||||
{
|
||||
public:
|
||||
PopUp(void);
|
||||
|
@ -32,8 +32,6 @@
|
||||
|
||||
ewol::SizerHori::SizerHori(void)
|
||||
{
|
||||
GenericDrawDisable();
|
||||
SpecificDrawEnable();
|
||||
// set contamination enable
|
||||
LockExpendContamination();
|
||||
}
|
||||
|
@ -33,8 +33,6 @@
|
||||
|
||||
ewol::SizerVert::SizerVert(void)
|
||||
{
|
||||
GenericDrawDisable();
|
||||
SpecificDrawEnable();
|
||||
// set contamination enable
|
||||
LockExpendContamination();
|
||||
}
|
||||
|
@ -35,7 +35,6 @@
|
||||
ewol::Spacer::Spacer(void)
|
||||
{
|
||||
m_size = 10;
|
||||
GenericDrawDisable();
|
||||
SetCanHaveFocus(false);
|
||||
}
|
||||
|
||||
|
@ -27,10 +27,10 @@
|
||||
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Debug.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include <ewol/widget/Drawable.h>
|
||||
|
||||
namespace ewol {
|
||||
class Spacer :public ewol::Widget
|
||||
class Spacer :public ewol::Drawable
|
||||
{
|
||||
public:
|
||||
Spacer(void);
|
||||
|
@ -1,163 +0,0 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file ewol/widget/Test.cpp
|
||||
* @brief ewol Test widget system (Sources)
|
||||
* @author Edouard DUPIN
|
||||
* @date 07/11/2011
|
||||
* @par Project
|
||||
* ewol
|
||||
*
|
||||
* @par Copyright
|
||||
* Copyright 2011 Edouard DUPIN, all right reserved
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
* Licence summary :
|
||||
* You can modify and redistribute the sources code and binaries.
|
||||
* You can send me the bug-fix
|
||||
*
|
||||
* Term of the licence in in the file licence.txt.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include <ewol/widget/Test.h>
|
||||
|
||||
#include <ewol/OObject.h>
|
||||
#include <ewol/themeManager.h>
|
||||
|
||||
|
||||
|
||||
const char * ewolEventTestPressed = "ewol Test Pressed";
|
||||
|
||||
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "ewol::Test"
|
||||
|
||||
ewol::Test::Test(void)
|
||||
{
|
||||
AddEventId(ewolEventTestPressed);
|
||||
m_elementID = 0;
|
||||
}
|
||||
|
||||
|
||||
ewol::Test::~Test(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool ewol::Test::CalculateMinSize(void)
|
||||
{
|
||||
m_minSize.x = 150;
|
||||
m_minSize.y = 150;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ewol::Test::OnRegenerateDisplay(void)
|
||||
{
|
||||
if (true == NeedRedraw()) {
|
||||
// clean the object list ...
|
||||
ClearOObjectList();
|
||||
ewol::OObject2DColored * tmpOObjects = NULL;
|
||||
|
||||
tmpOObjects = new ewol::OObject2DColored;
|
||||
|
||||
tmpOObjects->SetColor(1.0, 0.0, 0.0, 1.0);
|
||||
tmpOObjects->Rectangle( 0, 0, m_size.x, m_size.y);
|
||||
tmpOObjects->SetColor(1.0, 1.0, 1.0, 1.0);
|
||||
tmpOObjects->Rectangle( 3, 3, m_size.x-6, m_size.y-6);
|
||||
|
||||
tmpOObjects->SetColor(0.0, 0.0, 1.0, 1.0);
|
||||
|
||||
if (0 == m_elementID) {
|
||||
tmpOObjects->Line(50, 50, 100, 50, 10); // 0°
|
||||
} else if (1 == m_elementID) {
|
||||
tmpOObjects->Line(50, 50, 100, 100, 15); // 45°
|
||||
} else if (2 == m_elementID) {
|
||||
tmpOObjects->Line(50, 50, 50, 100, 20); // 90°
|
||||
} else if (3 == m_elementID) {
|
||||
tmpOObjects->Line(50, 50, 0, 100, 5); // 135°
|
||||
} else if (4 == m_elementID) {
|
||||
tmpOObjects->Line(50, 50, 0, 50, 3); // 180°
|
||||
} else if (5 == m_elementID) {
|
||||
tmpOObjects->Line(50, 50, 0, 0, 2); // 225°
|
||||
} else if (6 == m_elementID) {
|
||||
tmpOObjects->Line(50, 50, 50, 0, 1); // °
|
||||
} else {
|
||||
tmpOObjects->Line(50, 50, 100, 0, 0.5); // °
|
||||
}
|
||||
|
||||
if (0 == m_elementID) {
|
||||
tmpOObjects->SetColor(0.0, 1.0, 0.0, 1.0);
|
||||
tmpOObjects->Disc(200, 100, 5);
|
||||
} else if (1 == m_elementID) {
|
||||
tmpOObjects->SetColor(0.0, 1.0, 0.0, 1.0);
|
||||
tmpOObjects->Disc(200, 100, 10);
|
||||
} else if (2 == m_elementID) {
|
||||
tmpOObjects->SetColor(0.0, 1.0, 0.0, 1.0);
|
||||
tmpOObjects->Disc(200, 100, 15);
|
||||
} else if (3 == m_elementID) {
|
||||
tmpOObjects->SetColor(0.0, 1.0, 0.0, 1.0);
|
||||
tmpOObjects->Disc(200, 100, 20);
|
||||
} else if (4 == m_elementID) {
|
||||
tmpOObjects->SetColor(0.0, 1.0, 0.0, 1.0);
|
||||
tmpOObjects->Disc(200, 100, 25);
|
||||
} else if (5 == m_elementID) {
|
||||
tmpOObjects->SetColor(0.0, 1.0, 0.0, 0.75);
|
||||
tmpOObjects->Disc(200, 100, 100);
|
||||
} else if (6 == m_elementID) {
|
||||
tmpOObjects->SetColor(0.0, 1.0, 0.0, 0.75);
|
||||
tmpOObjects->Disc(200, 100, 200);
|
||||
} else {
|
||||
tmpOObjects->SetColor(0.0, 1.0, 0.0, 0.5);
|
||||
tmpOObjects->Disc(200, 100, 300);
|
||||
}
|
||||
tmpOObjects->SetColor(0.0, 0.0, 0.0, 1.0);
|
||||
if (0 == m_elementID) {
|
||||
tmpOObjects->Circle(100, 100, 10, 3);
|
||||
} else if (1 == m_elementID) {
|
||||
tmpOObjects->Circle(100, 100, 20, 3);
|
||||
} else if (2 == m_elementID) {
|
||||
tmpOObjects->Circle(100, 100, 30, 2);
|
||||
} else if (3 == m_elementID) {
|
||||
tmpOObjects->Circle(100, 100, 40, 1);
|
||||
} else if (4 == m_elementID) {
|
||||
tmpOObjects->Circle(100, 100, 50, 0.5);
|
||||
} else if (5 == m_elementID) {
|
||||
tmpOObjects->Circle(100, 100, 100, 25);
|
||||
} else if (6 == m_elementID) {
|
||||
tmpOObjects->Circle(100, 100, 100, 35);
|
||||
} else {
|
||||
tmpOObjects->Circle(100, 100, 100, 50);
|
||||
}
|
||||
tmpOObjects->SetColor(1.0, 1.0, 0.0, 1.0);
|
||||
tmpOObjects->DiscPart(150, 60, 60, 45, 180);
|
||||
tmpOObjects->SetColor(0.0, 0.0, 0.0, 1.0);
|
||||
tmpOObjects->CirclePart(150, 60, 60, 2, 45, 180);
|
||||
|
||||
AddOObject(tmpOObjects, "BouttonDecoration");
|
||||
/*
|
||||
tmpOObjects = new ewol::OObject2DColored;
|
||||
ewol::theme::Generate(0, 0, *tmpOObjects, 50, 50, m_size.x*0.75, m_size.y*0.75);
|
||||
AddOObject(tmpOObjects, "themeObject");
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
bool ewol::Test::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
EWOL_DEBUG("Event on Test ...");
|
||||
if (1 == IdInput) {
|
||||
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
||||
m_elementID++;
|
||||
if (m_elementID > 7 ) {
|
||||
m_elementID = 0;
|
||||
}
|
||||
MarkToReedraw();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
@ -50,17 +50,19 @@ void ewol::WidgetScrooled::OnRegenerateDisplay(void)
|
||||
ewol::OObject2DColored* myOObjectsColored = new ewol::OObject2DColored();
|
||||
myOObjectsColored->SetColor(1.0, 0.0, 0.0, 0.4);
|
||||
myOObjectsColored->Disc(m_highSpeedStartPos.x, m_highSpeedStartPos.y, 10);
|
||||
AddOObject(myOObjectsColored, "scolling object");
|
||||
AddOObject(myOObjectsColored);
|
||||
}
|
||||
*/
|
||||
#else
|
||||
/*
|
||||
if( ewol::SCROLL_ENABLE_HORIZONTAL==m_highSpeedMode
|
||||
|| ewol::SCROLL_ENABLE_VERTICAL ==m_highSpeedMode) {
|
||||
ewol::OObject2DColored* myOObjectsColored = new ewol::OObject2DColored();
|
||||
myOObjectsColored->SetColor(1.0, 0.0, 0.0, 0.4);
|
||||
myOObjectsColored->Disc(m_highSpeedStartPos.x, m_highSpeedStartPos.y, 10);
|
||||
AddOObject(myOObjectsColored, "scolling object");
|
||||
AddOObject(myOObjectsColored);
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace ewol {
|
||||
#endif
|
||||
}highSpeedMode_te;
|
||||
|
||||
class WidgetScrooled :public ewol::Widget
|
||||
class WidgetScrooled : virtual public ewol::Widget
|
||||
{
|
||||
protected:
|
||||
coord m_originScrooled;
|
||||
|
@ -467,7 +467,7 @@ ewol::FileChooser::~FileChooser(void)
|
||||
|
||||
void ewol::FileChooser::SetTitle(etk::UString label)
|
||||
{
|
||||
ewol::Label * tmpWidget = (ewol::Label*)ewol::widgetManager::Get(m_widgetTitleId);
|
||||
ewol::Label * tmpWidget = reinterpret_cast<ewol::Label*>(ewol::widgetManager::Get(m_widgetTitleId));
|
||||
if (NULL == tmpWidget) {
|
||||
return;
|
||||
}
|
||||
@ -476,7 +476,7 @@ void ewol::FileChooser::SetTitle(etk::UString label)
|
||||
|
||||
void ewol::FileChooser::SetValidateLabel(etk::UString label)
|
||||
{
|
||||
ewol::Button * tmpWidget = (ewol::Button*)ewol::widgetManager::Get(m_widgetValidateId);
|
||||
ewol::Button * tmpWidget = reinterpret_cast<ewol::Button*>(ewol::widgetManager::Get(m_widgetValidateId));
|
||||
if (NULL == tmpWidget) {
|
||||
return;
|
||||
}
|
||||
@ -485,7 +485,7 @@ void ewol::FileChooser::SetValidateLabel(etk::UString label)
|
||||
|
||||
void ewol::FileChooser::SetCancelLabel(etk::UString label)
|
||||
{
|
||||
ewol::Button * tmpWidget = (ewol::Button*)ewol::widgetManager::Get(m_widgetCancelId);
|
||||
ewol::Button * tmpWidget = reinterpret_cast<ewol::Button*>(ewol::widgetManager::Get(m_widgetCancelId));
|
||||
if (NULL == tmpWidget) {
|
||||
return;
|
||||
}
|
||||
@ -501,7 +501,7 @@ void ewol::FileChooser::SetFolder(etk::UString folder)
|
||||
void ewol::FileChooser::SetFileName(etk::UString filename)
|
||||
{
|
||||
m_file = filename;
|
||||
ewol::Entry * tmpWidget = (ewol::Entry*)ewol::widgetManager::Get(m_widgetCurrentFileNameId);
|
||||
ewol::Entry * tmpWidget = reinterpret_cast<ewol::Entry*>(ewol::widgetManager::Get(m_widgetCurrentFileNameId));
|
||||
if (NULL == tmpWidget) {
|
||||
return;
|
||||
}
|
||||
@ -519,7 +519,7 @@ bool ewol::FileChooser::OnEventAreaExternal(int32_t widgetID, const char * gener
|
||||
return true;
|
||||
} else if (ewolEventFileChooserEntryFile == generateEventId) {
|
||||
//==> change the file name
|
||||
ewol::Entry * tmpWidget = (ewol::Entry*)ewol::widgetManager::Get(m_widgetCurrentFileNameId);
|
||||
ewol::Entry * tmpWidget = reinterpret_cast<ewol::Entry*>(ewol::widgetManager::Get(m_widgetCurrentFileNameId));
|
||||
if (NULL != tmpWidget) {
|
||||
m_file = tmpWidget->GetValue();
|
||||
}
|
||||
@ -536,7 +536,7 @@ bool ewol::FileChooser::OnEventAreaExternal(int32_t widgetID, const char * gener
|
||||
return true;
|
||||
} else if (ewolEventFileChooserSelectFolder == generateEventId) {
|
||||
//==> this is an internal event ...
|
||||
FileChooserFolderList * myListFolder = (FileChooserFolderList *)ewol::widgetManager::Get(m_widgetListFolderId);
|
||||
FileChooserFolderList * myListFolder = reinterpret_cast<FileChooserFolderList *>(ewol::widgetManager::Get(m_widgetListFolderId));
|
||||
etk::UString tmpString = myListFolder->GetSelectedLine();
|
||||
EWOL_DEBUG(" old PATH : \"" << m_folder << "\" + \"" << tmpString << "\"");
|
||||
m_folder = m_folder + tmpString;
|
||||
@ -561,7 +561,7 @@ bool ewol::FileChooser::OnEventAreaExternal(int32_t widgetID, const char * gener
|
||||
return true;
|
||||
} else if (ewolEventFileChooserSelectFile == generateEventId) {
|
||||
m_hasSelectedFile = true;
|
||||
FileChooserFileList * myListFile = (FileChooserFileList *)ewol::widgetManager::Get(m_widgetListFileId);
|
||||
FileChooserFileList * myListFile = reinterpret_cast<FileChooserFileList *>(ewol::widgetManager::Get(m_widgetListFileId));
|
||||
etk::UString file = myListFile->GetSelectedLine();
|
||||
SetFileName(file);
|
||||
GenEventInputExternal(generateEventId, x, y);
|
||||
@ -580,10 +580,10 @@ bool ewol::FileChooser::OnEventAreaExternal(int32_t widgetID, const char * gener
|
||||
|
||||
void ewol::FileChooser::UpdateCurrentFolder(void)
|
||||
{
|
||||
FileChooserFileList * myListFile = (FileChooserFileList *)ewol::widgetManager::Get(m_widgetListFileId);
|
||||
FileChooserFolderList * myListFolder = (FileChooserFolderList *)ewol::widgetManager::Get(m_widgetListFolderId);
|
||||
ewol::Entry * myEntry = (ewol::Entry *)ewol::widgetManager::Get(m_widgetCurrentFolderId);
|
||||
ewol::CheckBox * myhidenFiles = (ewol::CheckBox *)ewol::widgetManager::Get(m_widgetCheckBoxId);
|
||||
FileChooserFileList * myListFile = reinterpret_cast<FileChooserFileList *>(ewol::widgetManager::Get(m_widgetListFileId));
|
||||
FileChooserFolderList * myListFolder = reinterpret_cast<FileChooserFolderList *>(ewol::widgetManager::Get(m_widgetListFolderId));
|
||||
ewol::Entry * myEntry = reinterpret_cast<ewol::Entry *>(ewol::widgetManager::Get(m_widgetCurrentFolderId));
|
||||
ewol::CheckBox * myhidenFiles = reinterpret_cast<ewol::CheckBox *>(ewol::widgetManager::Get(m_widgetCheckBoxId));
|
||||
|
||||
myListFile->ClearElements();
|
||||
myListFolder->ClearElements();
|
||||
|
@ -53,7 +53,6 @@ ewol::Keyboard::Keyboard(void)
|
||||
{
|
||||
// set event that can propagate outside ....
|
||||
AddEventId(ewolEventKeyboardHide);
|
||||
SpecificDrawEnable();
|
||||
|
||||
m_mode = KEYBOARD_MODE_TEXT;
|
||||
m_isHide = true;
|
||||
@ -183,7 +182,7 @@ bool ewol::Keyboard::OnEventAreaExternal(int32_t widgetID, const char * generate
|
||||
{
|
||||
EWOL_INFO("Receive Event from the Keyboard ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> internalEvent=\"" << data << "\"" );
|
||||
if (ewolEventKeyEvent == generateEventId) {
|
||||
ewol::Button * bt = (ewol::Button *)ewol::widgetManager::Get(widgetID);
|
||||
ewol::Button * bt = reinterpret_cast<ewol::Button *>(ewol::widgetManager::Get(widgetID));
|
||||
EWOL_DEBUG("kbevent : \"" << bt->GetLabel() << "\"");
|
||||
etk::UString data = bt->GetLabel();
|
||||
if (data == "DEL") {
|
||||
@ -292,7 +291,7 @@ void ewol::Keyboard::OnRegenerateDisplay(void)
|
||||
ewol::OObject2DColored * BGOObjects = new ewol::OObject2DColored();
|
||||
BGOObjects->SetColor(mycolor);
|
||||
BGOObjects->Rectangle(0, 0, m_size.x, m_size.y);
|
||||
AddOObject(BGOObjects, "ListDeco");
|
||||
AddOObject(BGOObjects);
|
||||
}
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->OnRegenerateDisplay();
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <etk/Types.h>
|
||||
#include <ewol/Debug.h>
|
||||
#include <ewol/Widget.h>
|
||||
#include <ewol/widget/Drawable.h>
|
||||
|
||||
extern const char * const ewolEventKeyboardHide;
|
||||
|
||||
@ -37,7 +38,7 @@ namespace ewol {
|
||||
KEYBOARD_MODE_CODE,
|
||||
} keyboardMode_te;
|
||||
|
||||
class Keyboard : public ewol::Widget
|
||||
class Keyboard : public ewol::Drawable
|
||||
{
|
||||
public:
|
||||
Keyboard(void);
|
||||
|
@ -18,6 +18,7 @@ FILE_LIST = ewol/ewol.cpp \
|
||||
ewol/WidgetMessageMultiCast.cpp \
|
||||
ewol/Windows.cpp \
|
||||
ewol/widget/WidgetScrolled.cpp \
|
||||
ewol/widget/Drawable.cpp \
|
||||
ewol/widget/Button.cpp \
|
||||
ewol/widget/Label.cpp \
|
||||
ewol/widget/CheckBox.cpp \
|
||||
@ -29,7 +30,6 @@ FILE_LIST = ewol/ewol.cpp \
|
||||
ewol/widget/SizerHori.cpp \
|
||||
ewol/widget/SizerVert.cpp \
|
||||
ewol/widget/Spacer.cpp \
|
||||
ewol/widget/Test.cpp \
|
||||
ewol/widgetMeta/FileChooser.cpp \
|
||||
ewol/widgetMeta/Keyboard.cpp \
|
||||
ewol/themeManager.cpp \
|
||||
|
Loading…
x
Reference in New Issue
Block a user