Better display

This commit is contained in:
2012-02-19 15:48:08 +01:00
parent f716055c40
commit a4d314723d
8 changed files with 27 additions and 27 deletions

View File

@@ -264,16 +264,19 @@ void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObjec
#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)
void BufferText::CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip)
{
color_ts & tmpppppp = ColorizeManager::getInstance()->Get(COLOR_CODE_CURSOR);
OOColored->SetColor(tmpppppp);
if (true == ewol::IsSetInsert()) {
OOColored->Rectangle( x, y, letterWidth, letterHeight);
OOColored->Rectangle( x, y, letterWidth, letterHeight, clip);
} else {
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);
// TODO : Clipping
if (x >= clip.x) {
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);
}
}
}
@@ -495,7 +498,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
// display cursor :
if (m_cursorPos == iii) {
// display the cursor:
CursorDisplay(&OOColored, pixelX, y, letterHeight, letterWidth);
CursorDisplay(&OOColored, pixelX - offsetX, y, letterHeight, letterWidth, drawClippingTextArea);
}
pixelX += drawSize;
// move to next line ...
@@ -510,7 +513,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
}
// special case : the cursor is at the end of the buffer...
if (m_cursorPos == iii) {
CursorDisplay(&OOColored, pixelX, y, letterHeight, letterWidth);
CursorDisplay(&OOColored, pixelX - offsetX, y, letterHeight, letterWidth, drawClippingTextArea);
}
int64_t stopTime2 = GetCurrentTime();
@@ -726,6 +729,7 @@ void BufferText::SelectNone(void)
* @return ---
*
*/
// TODO : Deprecated...
void BufferText::ScrollDown(void)
{
MoveUpDown(3);
@@ -740,6 +744,7 @@ void BufferText::ScrollDown(void)
* @return ---
*
*/
// TODO : Deprecated...
void BufferText::ScrollUp(void)
{
MoveUpDown(-3);

View File

@@ -120,7 +120,7 @@ class BufferText : public Buffer {
void MoveUpDown(int32_t ofset);
void DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY,char *myPrint, int32_t lineNumber, int32_t positionY);
void CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth);
void CursorDisplay(ewol::OObject2DColored* OOColored, int32_t x, int32_t y, int32_t letterHeight, int32_t letterWidth, clipping_ts &clip);
};

View File

@@ -141,7 +141,7 @@ 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 (typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
EDN_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
int32_t selectBuf = m_bufferManager->WitchBuffer(raw+1);
if ( 0 <= selectBuf) {

View File

@@ -90,19 +90,15 @@ void CodeView::CalculateMaxSize(void)
int32_t letterHeight = ewol::GetHeight(m_fontNormal);
m_maxSize.y = m_bufferManager->Get(m_bufferID)->GetNumberOfLine() * letterHeight;
}
// TODO : remove this from here ...
#include <ewol/importgl.h>
bool CodeView::OnDraw(void)
{
//glLoadIdentity();
glTranslatef(m_origin.x,m_origin.y, 0);
m_OObjectsColored[ m_currentDrawId].Draw();
m_OObjectTextNormal[ m_currentDrawId].Draw();
m_OObjectTextBold[ m_currentDrawId].Draw();
m_OObjectTextItalic[ m_currentDrawId].Draw();
m_OObjectTextBoldItalic[m_currentDrawId].Draw();
glTranslatef(-m_origin.x,-m_origin.y, 0);
return true;
}
@@ -174,8 +170,6 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
// nothing to do ... done on upper widet ...
return true;
}
x -= m_origin.x;
y -= m_origin.y;
if (1 == IdInput) {
#ifndef __MODE__Touch
if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {

View File

@@ -35,7 +35,6 @@
#include <ewol/widget/CheckBox.h>
#include <ewol/widget/SizerHori.h>
#include <ewol/widget/SizerVert.h>
#include <ewol/widget/Test.h>
#include <ewol/widget/Label.h>
#include <ewol/widget/Entry.h>
#include <ewol/widget/List.h>
@@ -174,7 +173,7 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
}
} else if (generateEventId == ednEventPopUpFileSelected) {
// get widget:
ewol::FileChooser * tmpWidget = reinterpret_cast<ewol::FileChooser*>(ewol::widgetManager::Get(widgetID));
ewol::FileChooser * tmpWidget = dynamic_cast<ewol::FileChooser*>(ewol::widgetManager::Get(widgetID));
if (NULL == tmpWidget) {
EDN_ERROR("impossible to get pop_upWidget " << widgetID);
return false;
@@ -219,7 +218,7 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
}
} else if (generateEventId == ednEventPopUpFileSaveAs) {
// get widget:
ewol::FileChooser * tmpWidget = reinterpret_cast<ewol::FileChooser*>(ewol::widgetManager::Get(widgetID));
ewol::FileChooser * tmpWidget = dynamic_cast<ewol::FileChooser*>(ewol::widgetManager::Get(widgetID));
if (NULL == tmpWidget) {
EDN_ERROR("impossible to get pop_upWidget " << widgetID);
return false;

View File

@@ -277,7 +277,7 @@ void Search::OnButtonReplaceAndNext(GtkWidget *widget, gpointer data)
void Search::OnButtonQuit(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
Search * self = dynamic_cast<Search*>(data);
self->Destroy();
}
@@ -304,7 +304,7 @@ void Search::OnCheckBoxEventCase(GtkWidget *widget, gpointer data)
void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
Search * self = dynamic_cast<Search*>(data);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetRegExp(true);
gtk_widget_set_sensitive(self->m_CkMatchCase, false);
@@ -317,7 +317,7 @@ void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data)
void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
Search * self = dynamic_cast<Search*>(data);
// update research data
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
if (NULL != testData) {
@@ -343,7 +343,7 @@ void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data)
{
//EDN_INFO("CALLBACK");
Search * self = reinterpret_cast<Search*>(data);
Search * self = dynamic_cast<Search*>(data);
// update replace data
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
if (NULL != testData) {

View File

@@ -203,7 +203,7 @@ void CTagsManager::cb_row(GtkTreeView *p_treeview,
gpointer data)
{
EDN_DEBUG("event");
CTagsManager * self = reinterpret_cast<CTagsManager*>(data);
CTagsManager * self = dynamic_cast<CTagsManager*>(data);
gchar * p_file=NULL;
gint lineNumber;