windowing/windowserver/nga/SERVER/TCURSOR.CPP
changeset 36 01a6848ebfd7
parent 0 5d03bc08d59c
equal deleted inserted replaced
0:5d03bc08d59c 36:01a6848ebfd7
   136 			{
   136 			{
   137 			flags|=ETextCursorFlagClipped;
   137 			flags|=ETextCursorFlagClipped;
   138 			clipRect=aSet.rect;
   138 			clipRect=aSet.rect;
   139 			}
   139 			}
   140 
   140 
   141 		if (pos != iPos || size != iSize || iType != type ||
   141 		TPoint absPos(pos.iX,pos.iY);
       
   142 		absPos=absPos+win->Origin();
       
   143 		if (pos != iPos || absPos != iAbsPos || size != iSize || iType != type ||
   142 			flags != iFlags || clipRect != iClipRect || color != iColor ||
   144 			flags != iFlags || clipRect != iClipRect || color != iColor ||
   143 			customTextCursor != iCustomTextCursor || win != iWin)
   145 			customTextCursor != iCustomTextCursor || win != iWin)
   144 			{
   146 			{
   145 			// There is a change in the cursor.
   147 			// There is a change in the cursor.
   146 			changed = ETrue;
   148 			changed = ETrue;
   151 			if ((win != iWin && !iCustomTextCursor) || (customTextCursor && !iCustomTextCursor))
   153 			if ((win != iWin && !iCustomTextCursor) || (customTextCursor && !iCustomTextCursor))
   152 				ReleaseNode();
   154 				ReleaseNode();
   153 			TCursorSprite::Hide();
   155 			TCursorSprite::Hide();
   154 			}
   156 			}
   155 
   157 
   156 		UpdateAttributes(pos, size, type, flags, clipRect, color, customTextCursor, win);
   158 		UpdateAttributes(pos, absPos, size, type, flags, clipRect, color, customTextCursor, win);
   157 
   159 
   158 		if (customTextCursor && iInternalFlags&EHasFocus)
   160 		if (customTextCursor && iInternalFlags&EHasFocus)
   159 			{
   161 			{
   160 			customTextCursor->CompleteL(win, !(flags&TTextCursor::EFlagNoFlash), flags & (TTextCursor::EFlagClipHorizontal | TTextCursor::EFlagClipVertical), clipOrigo, clipSize);
   162 			customTextCursor->CompleteL(win, !(flags&TTextCursor::EFlagNoFlash), flags & (TTextCursor::EFlagClipHorizontal | TTextCursor::EFlagClipVertical), clipOrigo, clipSize);
   161 			customTextCursor->SetPositionNoRedraw(pos);
   163 			customTextCursor->SetPositionNoRedraw(pos);
   165 			{
   167 			{
   166 			TCursorSprite::SetCurrentCursor(this, win);
   168 			TCursorSprite::SetCurrentCursor(this, win);
   167 			}
   169 			}
   168 		}
   170 		}
   169 	}
   171 	}
   170 void RWsTextCursor::UpdateAttributes(TPoint aPos, TSize aSize, TInt aType, TUint aFlags, TRect aClipRect, TRgb aColor, CWsCustomTextCursor* aCustomTextCursor, CWsClientWindow* aWin)
   172 void RWsTextCursor::UpdateAttributes(TPoint aPos, TPoint aAbsPos, TSize aSize, TInt aType, TUint aFlags, TRect aClipRect, TRgb aColor, CWsCustomTextCursor* aCustomTextCursor, CWsClientWindow* aWin)
   171 	{
   173 	{
   172 	if (aPos != iPos || aSize != iSize)
   174 	if (aPos != iPos || aSize != iSize || aAbsPos != iAbsPos)
   173 		{
   175 		{
   174 		iPos = aPos;
   176 		iPos = aPos;
       
   177         iAbsPos = aAbsPos;
   175 		iSize = aSize;
   178 		iSize = aSize;
   176 		WS_ASSERT_DEBUG(iGroupWin->Screen(),EWsPanicNoScreen);
   179 		WS_ASSERT_DEBUG(iGroupWin->Screen(),EWsPanicNoScreen);
   177 		MWsWindowTreeObserver* const windowTreeObserver = iGroupWin->Screen()->WindowTreeObserver();
   180 		MWsWindowTreeObserver* const windowTreeObserver = iGroupWin->Screen()->WindowTreeObserver();
   178 		if (windowTreeObserver && iInternalFlags&EHasFocus && iInternalFlags&EActiveNode)
   181 		if (windowTreeObserver && iInternalFlags&EHasFocus && iInternalFlags&EActiveNode)
   179 			windowTreeObserver->NodeExtentChanged(*this, RectRelativeToScreen());
   182 			windowTreeObserver->NodeExtentChanged(*this, RectRelativeToScreen());