Rework of EWOL (Step 3)
This commit is contained in:
parent
ae113a8a2f
commit
f6f8679b76
@ -28,12 +28,12 @@
|
||||
#include <tools_globals.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ewol/EObject.h>
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <ewol/EObjectManager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "classBufferManager"
|
||||
|
||||
class classBufferManager: public ewol::Widget
|
||||
class classBufferManager: public ewol::EObject
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
@ -41,7 +41,14 @@ class classBufferManager: public ewol::Widget
|
||||
~classBufferManager(void);
|
||||
|
||||
public:
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
/**
|
||||
* @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 ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
||||
private:
|
||||
// return the ID of the buffer allocated
|
||||
// create a buffer with no element
|
||||
@ -87,14 +94,12 @@ classBufferManager::classBufferManager(void)
|
||||
// nothing to do ...
|
||||
BufferNotExiste = new BufferEmpty();
|
||||
m_idSelected = -1;
|
||||
/*
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiNew);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgOpenFile);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiClose);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiSave);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewSelectedId);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
|
||||
*/
|
||||
RegisterMultiCast(ednMsgGuiNew);
|
||||
RegisterMultiCast(ednMsgOpenFile);
|
||||
RegisterMultiCast(ednMsgGuiClose);
|
||||
RegisterMultiCast(ednMsgGuiSave);
|
||||
RegisterMultiCast(ednMsgCodeViewSelectedId);
|
||||
RegisterMultiCast(ednMsgBufferId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -118,15 +123,24 @@ classBufferManager::~classBufferManager(void)
|
||||
}
|
||||
|
||||
|
||||
bool classBufferManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
||||
/**
|
||||
* @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 ---
|
||||
*/
|
||||
void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
if (generateEventId == ednMsgBufferId) {
|
||||
ewol::EObject::OnReceiveMessage(CallerObject, eventId, data);
|
||||
|
||||
if (eventId == ednMsgBufferId) {
|
||||
// select a new buffer ID :
|
||||
if (NULL == data) {
|
||||
EDN_ERROR("Request select buffer ID = NULL ????");
|
||||
if (data == "") {
|
||||
EDN_ERROR("Request select buffer ID = \"\" ");
|
||||
} else {
|
||||
int32_t newID = -1;
|
||||
sscanf(data, "%d", &newID);
|
||||
sscanf(data.Utf8Data(), "%d", &newID);
|
||||
if(true == Exist(newID)) {
|
||||
m_idSelected = newID;
|
||||
} else {
|
||||
@ -134,74 +148,67 @@ bool classBufferManager::OnEventAreaExternal(int32_t widgetID, const char * gene
|
||||
EDN_ERROR("Request a non existant ID : " << newID << " reset to -1...");
|
||||
}
|
||||
}
|
||||
} else if (generateEventId == ednMsgGuiNew) {
|
||||
/*
|
||||
} else if (eventId == ednMsgGuiNew) {
|
||||
int32_t newOne = Create();
|
||||
if (-1 != newOne) {
|
||||
m_idSelected = newOne;
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
||||
SendMultiCast(ednMsgBufferId, m_idSelected);
|
||||
SendMultiCast(ednMsgBufferListChange);
|
||||
}
|
||||
*/
|
||||
} else if (generateEventId == ednMsgOpenFile) {
|
||||
/*
|
||||
if (NULL != data) {
|
||||
} else if (eventId == ednMsgOpenFile) {
|
||||
if (data != "" ) {
|
||||
etk::File myFile(data, etk::FILE_TYPE_DIRECT);
|
||||
int32_t newOne = Open(myFile);
|
||||
if (-1 != newOne) {
|
||||
m_idSelected = newOne;
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
||||
SendMultiCast(ednMsgBufferId, m_idSelected);
|
||||
SendMultiCast(ednMsgBufferListChange);
|
||||
}
|
||||
}
|
||||
*/
|
||||
} else if (generateEventId == ednMsgGuiSave) {
|
||||
/*
|
||||
if (NULL == data) {
|
||||
} else if (eventId == ednMsgGuiSave) {
|
||||
if (data == "") {
|
||||
EDN_ERROR("Null data for close file ... ");
|
||||
} else {
|
||||
if (0 == strcmp(data , "current")) {
|
||||
if (data == "current") {
|
||||
// Check buffer existence
|
||||
if(true == Exist(m_idSelected)) {
|
||||
// If no name ==> request a Gui display ...
|
||||
if (Get(m_idSelected)->HaveName() == false) {
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSaveAs, "current");
|
||||
SendMultiCast(ednMsgGuiSaveAs, "current");
|
||||
} else {
|
||||
Get(m_idSelected)->Save();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int32_t newId;
|
||||
sscanf(data, "%d", &newId);
|
||||
sscanf(data.Utf8Data(), "%d", &newId);
|
||||
if (false == Exist(newId)) {
|
||||
EDN_ERROR("Request a save As with a non existant ID=" << newId);
|
||||
} else {
|
||||
// If no name ==> request a Gui display ...
|
||||
if (Get(newId)->HaveName() == false) {
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSaveAs, newId);
|
||||
SendMultiCast(ednMsgGuiSaveAs, newId);
|
||||
} else {
|
||||
Get(m_idSelected)->Save();
|
||||
}
|
||||
}
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferState, "saved");
|
||||
SendMultiCast(ednMsgBufferState, "saved");
|
||||
}
|
||||
}
|
||||
*/
|
||||
} else if (generateEventId == ednMsgGuiClose) {
|
||||
/*
|
||||
if (NULL == data) {
|
||||
} else if (eventId == ednMsgGuiClose) {
|
||||
if (data == "") {
|
||||
EDN_ERROR("Null data for close file ... ");
|
||||
} else {
|
||||
if (0 == strcmp(data , "All")) {
|
||||
if (data == "All") {
|
||||
|
||||
} else {
|
||||
int32_t closeID = -1;
|
||||
if (0 == strcmp(data , "current")) {
|
||||
if (data == "current") {
|
||||
closeID = m_idSelected;
|
||||
EDN_DEBUG("Close specific buffer ID" << closeID);
|
||||
} else {
|
||||
// close specific buffer ...
|
||||
sscanf(data, "%d", &closeID);
|
||||
sscanf(data.Utf8Data(), "%d", &closeID);
|
||||
EDN_DEBUG("Close specific buffer ID="<< closeID);
|
||||
}
|
||||
if(true == Exist(closeID)) {
|
||||
@ -225,36 +232,33 @@ bool classBufferManager::OnEventAreaExternal(int32_t widgetID, const char * gene
|
||||
}
|
||||
}
|
||||
// set it to the currect display
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, destBuffer);
|
||||
SendMultiCast(ednMsgBufferId, destBuffer);
|
||||
m_idSelected = destBuffer;
|
||||
}
|
||||
// Remove requested buffer
|
||||
Remove(closeID);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
||||
SendMultiCast(ednMsgBufferListChange);
|
||||
} else {
|
||||
EDN_ERROR("Request Close of a non existant ID : " << closeID);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
} else if (generateEventId == ednMsgCodeViewSelectedId) {
|
||||
/*
|
||||
} else if (eventId == ednMsgCodeViewSelectedId) {
|
||||
//Change the selected buffer
|
||||
if (NULL == data) {
|
||||
if (data == "") {
|
||||
EDN_ERROR("Null data for changing buffer ID file ... ");
|
||||
} else {
|
||||
int32_t newId;
|
||||
sscanf(data, "%d", &newId);
|
||||
sscanf(data.Utf8Data(), "%d", &newId);
|
||||
if (true == Exist(newId)) {
|
||||
m_idSelected = newId;
|
||||
} else {
|
||||
EDN_ERROR("code biew request the selection of an non -existant buffer ==> reset to -1");
|
||||
m_idSelected = -1;
|
||||
}
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
||||
SendMultiCast(ednMsgBufferId, m_idSelected);
|
||||
SendMultiCast(ednMsgBufferListChange);
|
||||
}
|
||||
*/
|
||||
}
|
||||
/*
|
||||
switch (id)
|
||||
@ -271,7 +275,6 @@ bool classBufferManager::OnEventAreaExternal(int32_t widgetID, const char * gene
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -290,13 +293,11 @@ bool classBufferManager::OnEventAreaExternal(int32_t widgetID, const char * gene
|
||||
*/
|
||||
void classBufferManager::RemoveAll(void)
|
||||
{
|
||||
/*
|
||||
int32_t i;
|
||||
for (i=0; i<listBuffer.Size(); i++) {
|
||||
Remove(i);
|
||||
}
|
||||
ewol::widgetMessageMultiCast::Send(-1, ednMsgGuiClose, "All");
|
||||
*/
|
||||
SendMultiCast(ednMsgGuiClose, "All");
|
||||
}
|
||||
|
||||
|
||||
@ -513,7 +514,7 @@ void BufferManager::UnInit(void)
|
||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||
return;
|
||||
}
|
||||
localManager->MarkToRemove();
|
||||
ewol::EObjectManager::MarkToRemoved(localManager);
|
||||
localManager = NULL;
|
||||
}
|
||||
|
||||
|
@ -27,20 +27,27 @@
|
||||
#include <ColorizeManager.h>
|
||||
#include <tinyXML/tinyxml.h>
|
||||
#include <ewol/EObject.h>
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <ewol/EObjectManager.h>
|
||||
|
||||
#define PFX "ColorizeManager "
|
||||
|
||||
|
||||
|
||||
class classColorManager: public ewol::Widget
|
||||
class classColorManager: public ewol::EObject
|
||||
{
|
||||
public:
|
||||
// Constructeur
|
||||
classColorManager(void);
|
||||
~classColorManager(void);
|
||||
public:
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
/**
|
||||
* @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 ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
||||
public:
|
||||
void LoadFile(etk::UString &xmlFilename);
|
||||
void LoadFile(const char * xmlFilename);
|
||||
@ -80,8 +87,7 @@ classColorManager::~classColorManager(void)
|
||||
listMyColor.Clear();
|
||||
}
|
||||
|
||||
|
||||
bool classColorManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
@ -96,7 +102,6 @@ bool classColorManager::OnEventAreaExternal(int32_t widgetID, const char * gener
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -388,7 +393,7 @@ void ColorizeManager::UnInit(void)
|
||||
EWOL_ERROR("ColorizeManager ==> request UnInit, but does not exist ...");
|
||||
return;
|
||||
}
|
||||
localManager->MarkToRemove();
|
||||
ewol::EObjectManager::MarkToRemoved(localManager);
|
||||
localManager = NULL;
|
||||
}
|
||||
|
||||
|
@ -37,37 +37,36 @@
|
||||
|
||||
BufferView::BufferView(void)
|
||||
{
|
||||
/*
|
||||
SetCanHaveFocus(true);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferListChange);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferState);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
|
||||
RegisterMultiCast(ednMsgBufferListChange);
|
||||
RegisterMultiCast(ednMsgBufferState);
|
||||
RegisterMultiCast(ednMsgBufferId);
|
||||
m_selectedID = -1;
|
||||
*/
|
||||
}
|
||||
|
||||
BufferView::~BufferView(void)
|
||||
{
|
||||
|
||||
}
|
||||
/*
|
||||
GtkWidget * BufferView::GetMainWidget(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 ---
|
||||
*/
|
||||
void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
return m_widget;
|
||||
}
|
||||
*/
|
||||
bool BufferView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
if (generateEventId == ednMsgBufferListChange) {
|
||||
ewol::List::OnReceiveMessage(CallerObject, eventId, data);
|
||||
if (eventId == ednMsgBufferListChange) {
|
||||
MarkToReedraw();
|
||||
}else if (generateEventId == ednMsgBufferId) {
|
||||
}else if (eventId == ednMsgBufferId) {
|
||||
MarkToReedraw();
|
||||
}else if (generateEventId == ednMsgBufferState) {
|
||||
}else if (eventId == ednMsgBufferState) {
|
||||
MarkToReedraw();
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -138,17 +137,15 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
|
||||
|
||||
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y)
|
||||
{
|
||||
/*
|
||||
if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
|
||||
EDN_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
|
||||
int32_t selectBuf = BufferManager::WitchBuffer(raw+1);
|
||||
if ( 0 <= selectBuf) {
|
||||
m_selectedID = raw;
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, selectBuf);
|
||||
SendMultiCast(ednMsgBufferId, selectBuf);
|
||||
}
|
||||
}
|
||||
MarkToReedraw();
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,14 @@ class BufferView : public ewol::List
|
||||
// Constructeur
|
||||
BufferView(void);
|
||||
~BufferView(void);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
/**
|
||||
* @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 ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
||||
protected:
|
||||
// function call to display the list :
|
||||
virtual color_ts GetBasicBG(void);
|
||||
|
@ -65,9 +65,7 @@ CodeView::CodeView(void)
|
||||
m_textColorBg.blue = 0.0;
|
||||
m_textColorBg.alpha = 0.25;
|
||||
SetCanHaveFocus(true);
|
||||
/*
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
|
||||
*/
|
||||
RegisterMultiCast(ednMsgBufferId);
|
||||
}
|
||||
|
||||
CodeView::~CodeView(void)
|
||||
@ -123,11 +121,11 @@ void CodeView::OnRegenerateDisplay(void)
|
||||
|
||||
// generate the objects :
|
||||
BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal[m_currentCreateId],
|
||||
m_OObjectTextBold[m_currentCreateId],
|
||||
m_OObjectTextItalic[m_currentCreateId],
|
||||
m_OObjectTextBoldItalic[m_currentCreateId],
|
||||
m_OObjectsColored[m_currentCreateId],
|
||||
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
||||
m_OObjectTextBold[m_currentCreateId],
|
||||
m_OObjectTextItalic[m_currentCreateId],
|
||||
m_OObjectTextBoldItalic[m_currentCreateId],
|
||||
m_OObjectsColored[m_currentCreateId],
|
||||
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
||||
|
||||
int64_t stopTime = GetCurrentTime();
|
||||
EDN_DEBUG("Display Code Generation = " << stopTime - startTime << " milli-s");
|
||||
@ -227,15 +225,23 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
|
||||
|
||||
|
||||
|
||||
bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
||||
/**
|
||||
* @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 ---
|
||||
*/
|
||||
void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
EDN_DEBUG("Extern Event : " << widgetID << " type : " << generateEventId << " position(" << x << "," << y << ")");
|
||||
ewol::WidgetScrooled::OnReceiveMessage(CallerObject, eventId, data);
|
||||
EDN_DEBUG("Extern Event : " << CallerObject << " type : " << eventId << " data=\"" << data << "\"");
|
||||
|
||||
|
||||
|
||||
if( ednMsgBufferId == generateEventId) {
|
||||
if(eventId == ednMsgBufferId) {
|
||||
int32_t bufferID = 0;
|
||||
sscanf(data, "%d", &bufferID);
|
||||
sscanf(data.Utf8Data(), "%d", &bufferID);
|
||||
EDN_INFO("Select a new Buffer ... " << bufferID);
|
||||
m_bufferID = bufferID;
|
||||
BufferManager::Get(m_bufferID)->ForceReDraw(true);
|
||||
@ -390,7 +396,6 @@ bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventI
|
||||
*/
|
||||
// Force redraw of the widget
|
||||
MarkToReedraw();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,7 +56,14 @@ class CodeView :public ewol::WidgetScrooled
|
||||
|
||||
public:
|
||||
virtual void OnRegenerateDisplay(void);
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||
/**
|
||||
* @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 ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
||||
public:
|
||||
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, ewol::eventPosition_ts pos);
|
||||
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
|
||||
|
@ -137,15 +137,13 @@ MainWindows::MainWindows(void)
|
||||
*/
|
||||
mySizerHori->SubWidgetAdd(myCodeView);
|
||||
|
||||
/*
|
||||
// Generic event ...
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiSaveAs);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiOpen);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiAbout);
|
||||
RegisterMultiCast(ednMsgGuiSaveAs);
|
||||
RegisterMultiCast(ednMsgGuiOpen);
|
||||
RegisterMultiCast(ednMsgGuiAbout);
|
||||
// to update the title ...
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferState);
|
||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
|
||||
*/
|
||||
RegisterMultiCast(ednMsgBufferState);
|
||||
RegisterMultiCast(ednMsgBufferId);
|
||||
}
|
||||
|
||||
|
||||
@ -157,14 +155,20 @@ MainWindows::~MainWindows(void)
|
||||
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
|
||||
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
|
||||
|
||||
bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
||||
/**
|
||||
* @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 ---
|
||||
*/
|
||||
void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
if (true == ewol::Windows::OnEventAreaExternal(widgetID, generateEventId, data, x, y) ) {
|
||||
return true;
|
||||
}
|
||||
EDN_INFO("Receive Event from the main windows ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> data=\"" << data << "\"" );
|
||||
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data);
|
||||
|
||||
EDN_INFO("Receive Event from the main windows ... : widgetid=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" );
|
||||
// Open file Section ...
|
||||
if (generateEventId == ednMsgGuiOpen) {
|
||||
if (eventId == ednMsgGuiOpen) {
|
||||
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
||||
tmpWidget->SetTitle("Open Files ...");
|
||||
tmpWidget->SetValidateLabel("Open");
|
||||
@ -172,7 +176,7 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
||||
//tmpWidget->SetFolder("/");
|
||||
PopUpWidgetPush(tmpWidget);
|
||||
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
|
||||
} else if (generateEventId == ednEventPopUpFileSelected) {
|
||||
} else if (eventId == ednEventPopUpFileSelected) {
|
||||
/*
|
||||
// get widget:
|
||||
ewol::FileChooser * tmpWidget = static_cast<ewol::FileChooser*>(ewol::widgetManager::Get(widgetID));
|
||||
@ -185,15 +189,15 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
||||
EDN_DEBUG("Request opening the file : " << tmpData);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgOpenFile, tmpData);
|
||||
*/
|
||||
} else if (generateEventId == ednMsgGuiSaveAs) {
|
||||
if (NULL == data) {
|
||||
} else if (eventId == ednMsgGuiSaveAs) {
|
||||
if (data == "") {
|
||||
EDN_ERROR("Null data for Save As file ... ");
|
||||
} else {
|
||||
m_currentSavingAsIdBuffer = -1;
|
||||
if (0 == strcmp(data , "current")) {
|
||||
if (data == "current") {
|
||||
m_currentSavingAsIdBuffer = BufferManager::GetSelected();
|
||||
} else {
|
||||
sscanf(data, "%d", &m_currentSavingAsIdBuffer);
|
||||
sscanf(data.Utf8Data(), "%d", &m_currentSavingAsIdBuffer);
|
||||
}
|
||||
|
||||
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
|
||||
@ -216,7 +220,7 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
||||
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs);
|
||||
}
|
||||
}
|
||||
} else if (generateEventId == ednEventPopUpFileSaveAs) {
|
||||
} else if (eventId == ednEventPopUpFileSaveAs) {
|
||||
/*
|
||||
// get widget:
|
||||
ewol::FileChooser * tmpWidget = static_cast<ewol::FileChooser*>(ewol::widgetManager::Get(widgetID));
|
||||
@ -231,8 +235,8 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
||||
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
|
||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSave, m_currentSavingAsIdBuffer);
|
||||
*/
|
||||
} else if( generateEventId == ednMsgBufferState
|
||||
|| generateEventId == ednMsgBufferId) {
|
||||
} else if( eventId == ednMsgBufferState
|
||||
|| eventId == ednMsgBufferId) {
|
||||
// the buffer change we need to update the widget string
|
||||
Buffer* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
|
||||
if (NULL != tmpBuffer) {
|
||||
@ -243,14 +247,14 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
||||
directName += " *";
|
||||
}
|
||||
if (NULL == m_widgetLabelFileName) {
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
m_widgetLabelFileName->SetLabel(directName);
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
return false;
|
||||
return;
|
||||
// TODO : Set the Title ....
|
||||
} else if (generateEventId == ednMsgGuiAbout) {
|
||||
} else if (eventId == ednMsgGuiAbout) {
|
||||
/*
|
||||
//Title
|
||||
"Edn"
|
||||
@ -282,6 +286,6 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
||||
*/
|
||||
}
|
||||
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,14 @@ class MainWindows : public ewol::Windows
|
||||
// Constructeur
|
||||
MainWindows(void);
|
||||
~MainWindows(void);
|
||||
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y);
|
||||
/**
|
||||
* @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 ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -27,13 +27,13 @@
|
||||
#include <tools_globals.h>
|
||||
#include <HighlightManager.h>
|
||||
#include <ewol/EObject.h>
|
||||
#include <ewol/WidgetManager.h>
|
||||
#include <ewol/EObjectManager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "HighlightManager"
|
||||
|
||||
|
||||
class localClassHighlightManager: public ewol::Widget
|
||||
class localClassHighlightManager: public ewol::EObject
|
||||
{
|
||||
private:
|
||||
etk::VectorType<Highlight*> listHighlight; //!< List of ALL hightlight modules
|
||||
@ -54,7 +54,14 @@ class localClassHighlightManager: public ewol::Widget
|
||||
// clear the compleate list
|
||||
listHighlight.Clear();
|
||||
};
|
||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||
/**
|
||||
* @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 ---
|
||||
*/
|
||||
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||
{
|
||||
/*
|
||||
switch (id)
|
||||
@ -69,7 +76,6 @@ class localClassHighlightManager: public ewol::Widget
|
||||
break;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
Highlight* Get(etk::File &fileName)
|
||||
@ -159,7 +165,7 @@ void HighlightManager::UnInit(void)
|
||||
EWOL_ERROR("HighlightManager ==> request UnInit, but does not exist ...");
|
||||
return;
|
||||
}
|
||||
localManager->MarkToRemove();
|
||||
ewol::EObjectManager::MarkToRemoved(localManager);
|
||||
localManager = NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user