Display a correct cursor
This commit is contained in:
parent
9c9eac7d37
commit
43d8aaef48
@ -247,45 +247,18 @@ void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObjec
|
||||
OOText->TextAdd(1, positionY, tmpLineNumber, -1);
|
||||
}
|
||||
|
||||
#define CURSOR_WIDTH (4)
|
||||
#define CURSOR_WIDTH (5)
|
||||
#define CURSOR_THICKNESS (1.2)
|
||||
void BufferText::CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth)
|
||||
{
|
||||
|
||||
//EDN_ERROR("RequestCursorDisplay(" << x << "," << y << ")" );
|
||||
color_ts & tmpppppp = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR);
|
||||
|
||||
OOColored->SetColor(tmpppppp);
|
||||
|
||||
OOColored->Rectangle( x, y, letterWidth, letterHeight);
|
||||
|
||||
// get the cursor Color :
|
||||
//color_ts myColor = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR);
|
||||
//cairo_set_source_rgb(m_cairo, myColor.red, myColor.green, myColor.blue);
|
||||
|
||||
// draw cursor
|
||||
//int32_t letterHeight = Display::GetFontHeight();
|
||||
//int32_t letterWidth = Display::GetFontWidth();
|
||||
// depending on the inserting mode
|
||||
if (false == globals::IsSetInsert()) {
|
||||
//OOColored.Line(x-CURSOR_WIDTH, y-letterHeight+1, etkFloat_t ex, etkFloat_t ey, etkFloat_t thickness);
|
||||
/*
|
||||
cairo_set_line_width(m_cairo, 2);
|
||||
cairo_move_to(m_cairo, x-CURSOR_WIDTH, y - letterHeight+1);
|
||||
cairo_rel_line_to(m_cairo, CURSOR_WIDTH*2, 0);
|
||||
cairo_rel_move_to(m_cairo, -CURSOR_WIDTH, 0);
|
||||
cairo_rel_line_to(m_cairo, 0, letterHeight-2);
|
||||
cairo_rel_move_to(m_cairo, -CURSOR_WIDTH, 0);
|
||||
cairo_rel_line_to(m_cairo, CURSOR_WIDTH*2, 0);
|
||||
*/
|
||||
if (true == globals::IsSetInsert()) {
|
||||
OOColored->Rectangle( x, y, letterWidth, letterHeight);
|
||||
} else {
|
||||
/*
|
||||
cairo_set_line_width(m_cairo, 1);
|
||||
cairo_move_to(m_cairo, x, y - letterHeight + 1);
|
||||
cairo_rel_line_to(m_cairo, letterWidth, 0);
|
||||
cairo_rel_line_to(m_cairo, 0, letterHeight);
|
||||
cairo_rel_line_to(m_cairo, -letterWidth, 0);
|
||||
cairo_rel_line_to(m_cairo, 0, -letterHeight);
|
||||
*/
|
||||
OOColored->Line( (int32_t)(x-CURSOR_WIDTH), (int32_t)(y) , (int32_t)(x+CURSOR_WIDTH), (int32_t)(y) , CURSOR_THICKNESS);
|
||||
OOColored->Line( (int32_t)(x-CURSOR_WIDTH), (int32_t)(y+letterHeight-CURSOR_THICKNESS), (int32_t)(x+CURSOR_WIDTH), (int32_t)(y+letterHeight-CURSOR_THICKNESS), CURSOR_THICKNESS);
|
||||
OOColored->Line( (int32_t)(x) , (int32_t)(y) , (int32_t)(x) , (int32_t)(y+letterHeight-CURSOR_THICKNESS), CURSOR_THICKNESS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ void APP_Init(int argc, char *argv[])
|
||||
}
|
||||
{
|
||||
EDN_INFO("need load file : \"" << "avancement.boo" << "\"" );
|
||||
etk::File myfile("avancement.boo", etk::FILE_TYPE_DIRECT);
|
||||
etk::File myfile("RegExp.cpp", etk::FILE_TYPE_DIRECT);
|
||||
if (false == myBufferManager->Exist(myfile) ) {
|
||||
int32_t idBuffOpened = myBufferManager->Open(myfile);
|
||||
MsgBroadcastCore::getInstance()->SendMessage(NULL, EDN_MSG__CURRENT_CHANGE_BUFFER_ID, idBuffOpened);
|
||||
|
Loading…
x
Reference in New Issue
Block a user