force the redraw when get the focus ...

This commit is contained in:
Edouard Dupin 2011-10-04 13:03:40 +02:00
parent 4477ef0ab5
commit 85806b2638
3 changed files with 20 additions and 0 deletions

View File

@ -458,6 +458,21 @@ void Buffer::AnchorRm(int32_t anchorID)
} }
void Buffer::AnchorRedrawAll(int32_t anchorID)
{
if (anchorID == -1) {
EDN_ERROR("[" << m_uniqueID << "] AnchorID="<< anchorID << " Can not redraw this one !!!");
return;
}
int32_t localID = AnchorRealId(anchorID);
if (localID >=0) {
AnchorForceRedrawAll(localID);
} else {
EDN_ERROR("[" << m_uniqueID << "] AnchorID="<< anchorID << " does not exist !!!");
}
}
bool Buffer::AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor) bool Buffer::AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor)
{ {
EDN_ERROR("[" << m_uniqueID << "] AnchorID="<< anchorID << " Main buffer ==> can not manage Anchor (type buffer specific)"); EDN_ERROR("[" << m_uniqueID << "] AnchorID="<< anchorID << " Main buffer ==> can not manage Anchor (type buffer specific)");

View File

@ -149,6 +149,7 @@ class Buffer {
public: public:
void AnchorAdd(int32_t anchorID); void AnchorAdd(int32_t anchorID);
void AnchorRm(int32_t anchorID); void AnchorRm(int32_t anchorID);
void AnchorRedrawAll(int32_t anchorID);
virtual bool AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor); virtual bool AnchorGet(int32_t anchorID, bufferAnchor_ts & anchor);
virtual bool AnchorNext(bufferAnchor_ts & anchor); virtual bool AnchorNext(bufferAnchor_ts & anchor);
void AnchorSetSize(int32_t anchorID, int32_t sizePixelX, int32_t sizePixelY); void AnchorSetSize(int32_t anchorID, int32_t sizePixelX, int32_t sizePixelY);

View File

@ -298,6 +298,10 @@ gint CodeView::CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer da
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
# endif # endif
self->SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, self->m_bufferID); self->SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, self->m_bufferID);
Buffer * tmpBuf = self->m_bufferManager->Get(self->m_bufferID);
tmpBuf->AnchorRedrawAll(self->m_displayUniqueId);
// Force redraw of the widget
gtk_widget_queue_draw_area(self->m_widget, 0, 0, self->m_shawableAreaX, self->m_shawableAreaY);
EDN_INFO("Focus - In"); EDN_INFO("Focus - In");
return FALSE; return FALSE;
} }