select the good buffer when opening a new file
This commit is contained in:
parent
f390a594a3
commit
8ccb9c3bac
@ -44,6 +44,7 @@ BufferView::BufferView(void)
|
|||||||
RegisterMultiCast(ednMsgBufferState);
|
RegisterMultiCast(ednMsgBufferState);
|
||||||
RegisterMultiCast(ednMsgBufferId);
|
RegisterMultiCast(ednMsgBufferId);
|
||||||
m_selectedID = -1;
|
m_selectedID = -1;
|
||||||
|
m_selectedIdRequested = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferView::~BufferView(void)
|
BufferView::~BufferView(void)
|
||||||
@ -98,6 +99,7 @@ void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
|
|||||||
if (eventId == ednMsgBufferListChange) {
|
if (eventId == ednMsgBufferListChange) {
|
||||||
MarkToReedraw();
|
MarkToReedraw();
|
||||||
}else if (eventId == ednMsgBufferId) {
|
}else if (eventId == ednMsgBufferId) {
|
||||||
|
m_selectedIdRequested = BufferManager::GetSelected();
|
||||||
MarkToReedraw();
|
MarkToReedraw();
|
||||||
}else if (eventId == ednMsgBufferState) {
|
}else if (eventId == ednMsgBufferState) {
|
||||||
MarkToReedraw();
|
MarkToReedraw();
|
||||||
@ -132,7 +134,10 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
|
|||||||
bool isModify;
|
bool isModify;
|
||||||
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
||||||
basicColor_te selectBG = COLOR_LIST_BG_1;
|
basicColor_te selectBG = COLOR_LIST_BG_1;
|
||||||
|
// when requested a new display selection ==> reset the previous one ...
|
||||||
|
if (m_selectedIdRequested != -1) {
|
||||||
|
m_selectedID = -1;
|
||||||
|
}
|
||||||
// transforme the ID in the real value ...
|
// transforme the ID in the real value ...
|
||||||
int32_t realID = BufferManager::WitchBuffer(raw+1);
|
int32_t realID = BufferManager::WitchBuffer(raw+1);
|
||||||
if (BufferManager::Exist(realID)) {
|
if (BufferManager::Exist(realID)) {
|
||||||
@ -164,6 +169,12 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
|
|||||||
} else {
|
} else {
|
||||||
selectBG = COLOR_LIST_BG_2;
|
selectBG = COLOR_LIST_BG_2;
|
||||||
}
|
}
|
||||||
|
// the buffer change of selection ...
|
||||||
|
if (m_selectedIdRequested == realID) {
|
||||||
|
m_selectedID = raw;
|
||||||
|
// stop searching
|
||||||
|
m_selectedIdRequested = -1;
|
||||||
|
}
|
||||||
if (m_selectedID == raw) {
|
if (m_selectedID == raw) {
|
||||||
selectBG = COLOR_LIST_BG_SELECTED;
|
selectBG = COLOR_LIST_BG_SELECTED;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ class BufferView : public ewol::List
|
|||||||
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, color_ts &fg, color_ts &bg);
|
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, color_ts &fg, color_ts &bg);
|
||||||
virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y);
|
virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y);
|
||||||
private:
|
private:
|
||||||
|
int32_t m_selectedIdRequested;
|
||||||
int32_t m_selectedID;
|
int32_t m_selectedID;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user