better buffer display and select the good folder in the open file
This commit is contained in:
parent
a0f3beba5c
commit
21b786f920
@ -293,7 +293,9 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
|
|||||||
int32_t letterWidth = ewol::GetWidth(fontId, "A");
|
int32_t letterWidth = ewol::GetWidth(fontId, "A");
|
||||||
int32_t letterHeight = ewol::GetHeight(fontId);
|
int32_t letterHeight = ewol::GetHeight(fontId);
|
||||||
|
|
||||||
int32_t displayStartLineId = offsetY / letterHeight;
|
int32_t displayStartLineId = offsetY / letterHeight - 1;
|
||||||
|
displayStartLineId = etk_max(0, displayStartLineId);
|
||||||
|
uint32_t y = - offsetY + displayStartLineId*letterHeight;
|
||||||
|
|
||||||
// update the display position with the scroll ofset :
|
// update the display position with the scroll ofset :
|
||||||
int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId);
|
int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId);
|
||||||
@ -311,7 +313,6 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
|
|||||||
|
|
||||||
colorInformation_ts * HLColor = NULL;
|
colorInformation_ts * HLColor = NULL;
|
||||||
|
|
||||||
uint32_t y = 0;
|
|
||||||
int32_t iii, new_i;
|
int32_t iii, new_i;
|
||||||
// Get color :
|
// Get color :
|
||||||
Colorize * myColor = ColorizeManager::Get("normal");
|
Colorize * myColor = ColorizeManager::Get("normal");
|
||||||
|
@ -156,9 +156,7 @@ void CodeView::OnRegenerateDisplay(void)
|
|||||||
m_OObjectTextBoldItalic[m_currentCreateId].Clear();
|
m_OObjectTextBoldItalic[m_currentCreateId].Clear();
|
||||||
m_OObjectsColored[ m_currentCreateId].Clear();
|
m_OObjectsColored[ m_currentCreateId].Clear();
|
||||||
|
|
||||||
APPL_WARNING("plop");
|
|
||||||
if (true == BufferManager::Get(m_bufferID)->NeedToUpdateDisplayPosition() ) {
|
if (true == BufferManager::Get(m_bufferID)->NeedToUpdateDisplayPosition() ) {
|
||||||
APPL_WARNING("ploppppppp");
|
|
||||||
coord2D_ts borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize();
|
coord2D_ts borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize();
|
||||||
bool centerRequested = false;
|
bool centerRequested = false;
|
||||||
coord2D_ts currentPosition = BufferManager::Get(m_bufferID)->GetPosition(m_OObjectTextNormal[m_currentCreateId].GetFontID(), centerRequested);
|
coord2D_ts currentPosition = BufferManager::Get(m_bufferID)->GetPosition(m_OObjectTextNormal[m_currentCreateId].GetFontID(), centerRequested);
|
||||||
|
@ -68,7 +68,7 @@ MainWindows::MainWindows(void)
|
|||||||
myMenu = new ewol::Menu();
|
myMenu = new ewol::Menu();
|
||||||
mySizerHori->SubWidgetAdd(myMenu);
|
mySizerHori->SubWidgetAdd(myMenu);
|
||||||
int32_t idMenuFile = myMenu->AddTitle("File");
|
int32_t idMenuFile = myMenu->AddTitle("File");
|
||||||
(void)myMenu->Add(idMenuFile, "New", "iconEdn.bmp", ednMsgGuiNew);
|
(void)myMenu->Add(idMenuFile, "New", "", ednMsgGuiNew);
|
||||||
(void)myMenu->AddSpacer();
|
(void)myMenu->AddSpacer();
|
||||||
(void)myMenu->Add(idMenuFile, "Open", "icon/Load.svg", ednMsgGuiOpen);
|
(void)myMenu->Add(idMenuFile, "Open", "icon/Load.svg", ednMsgGuiOpen);
|
||||||
(void)myMenu->Add(idMenuFile, "Close", "icon/Close.svg", ednMsgGuiClose, "current");
|
(void)myMenu->Add(idMenuFile, "Close", "icon/Close.svg", ednMsgGuiClose, "current");
|
||||||
@ -214,7 +214,13 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
|
|||||||
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
||||||
tmpWidget->SetTitle("Open Files ...");
|
tmpWidget->SetTitle("Open Files ...");
|
||||||
tmpWidget->SetValidateLabel("Open");
|
tmpWidget->SetValidateLabel("Open");
|
||||||
// TODO : Set the good folder ...
|
Buffer * myBuffer = BufferManager::Get(BufferManager::GetSelected());
|
||||||
|
if (NULL!=myBuffer) {
|
||||||
|
etk::File tmpFile = myBuffer->GetFileName();
|
||||||
|
tmpWidget->SetFolder(tmpFile.GetFolder());
|
||||||
|
} else {
|
||||||
|
// nothing to do : just open the basic folder
|
||||||
|
}
|
||||||
//tmpWidget->SetFolder("/");
|
//tmpWidget->SetFolder("/");
|
||||||
PopUpWidgetPush(tmpWidget);
|
PopUpWidgetPush(tmpWidget);
|
||||||
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
|
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user