15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CRichEditCtrl and cursor display

Lee Aoi Frincke -- lee@ris.risinc.com
Friday, August 23, 1996

Environment:  Win95, VC++ 4.2

Hi,

My application read/writes RTF data using a descendent of a 
CRichEditCtrl.  Before the control is displayed I use a "hidden"
control (created without WS_VISIBLE included as a style) to load and
manipulate the data before loading the data into a visible control for
display and editing.  

The problem is that the cursor changes (actually flickers BIG TIME) to
the wait cursor and back to the I-beam even though I am accessing the
hidden control.  I have narrowed it down to the SetSel () call. 

By changing the cursor to the wait cursor in the routines that make
the SetSel () calls for the hidden control seems to help.
Unfortunately, this would need to be done all over the place. The
there must be a better way.

If a control is not visible, then why would accessing it or calling
any of its methods change the display in any manner???

BTW This "problem" also occurs under VC++ 4.0 and 4.1.

Thank you,

Lee
_________________________________________________________
Lee Aoi Frincke                 email: lee@ris.risinc.com
Research Information Systems    Voice: (619) 438-5526 x236
Camino Corporate Center         Fax:   (619) 438-5573
2355 Camino Vida Roble 
Carlsbad, CA  92009-1572  USA
www : http://www.risinc.com/
__________________________________________________________ 



Ed Ball -- ed@logos.com
Tuesday, August 27, 1996


I had the same problem that you are having, and was only able to
eliminate the problem by never calling SetSel (I was able to do what I
had to do by only calling SetWindowText, SetParaFormat,
SetSelectionCharFormat, and ReplaceSel). I tried any number of things to
prevent the cursor flicker that occurred with SetSel, all to no avail.
I, too, am very curious as to how a hidden, disabled, non-focused
control could have any effect on the mouse cursor.

- Ed

>----------
>From: 	Lee Aoi Frincke[SMTP:lee@ris.risinc.com]
>Sent: 	Friday, August 23, 1996 5:20 PM
>To: 	mfc-l@netcom.com
>Subject: 	CRichEditCtrl and cursor display
>
>Environment:  Win95, VC++ 4.2
>
>Hi,
>
>My application read/writes RTF data using a descendent of a 
>CRichEditCtrl.  Before the control is displayed I use a "hidden"
>control (created without WS_VISIBLE included as a style) to load and
>manipulate the data before loading the data into a visible control for
>display and editing.  
>
>The problem is that the cursor changes (actually flickers BIG TIME) to
>the wait cursor and back to the I-beam even though I am accessing the
>hidden control.  I have narrowed it down to the SetSel () call. 
>
>By changing the cursor to the wait cursor in the routines that make
>the SetSel () calls for the hidden control seems to help.
>Unfortunately, this would need to be done all over the place. The
>there must be a better way.
>
>If a control is not visible, then why would accessing it or calling
>any of its methods change the display in any manner???
>
>BTW This "problem" also occurs under VC++ 4.0 and 4.1.
>
>Thank you,
>
>Lee
>_________________________________________________________
>Lee Aoi Frincke                 email: lee@ris.risinc.com
>Research Information Systems    Voice: (619) 438-5526 x236
>Camino Corporate Center         Fax:   (619) 438-5573
>2355 Camino Vida Roble 
>Carlsbad, CA  92009-1572  USA
>www : http://www.risinc.com/
>__________________________________________________________ 
>



Spencer Jones -- Spencer@azure.com
Thursday, August 29, 1996

I have seen a similar problem of the Icon changing after setting it to
be an I-Beam in a view. It fickers back to the standard windows arrow.
This is because the default registered icon for the class is an arrow,
and this is set before each paint on a mouse move.

To overcome this you can set the class cursor to NULL in the OnCreate
member function:

BOOL CFOLDPRO2View::Create(LPCTSTR lpszClassName, LPCTSTR
lpszWindowName, 
			             DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, 
			             UINT nID, CCreateContext* pContext) 
{
	CString myClass = AfxRegisterWndClass( 0, NULL, (HBRUSH)
::GetStockObject(WHITE_BRUSH),
						 AfxGetApp()->LoadStandardIcon( IDI_APPLICATION ) );
	return CWnd::Create(myClass /*lpszClassName*/, lpszWindowName, dwStyle,
rect, pParentWnd, nID, pContext);
}

I imagine you are having the same problem for the hidden control, it
defaults to an I-beam and is then being repainted
as a wait cursor.

--
Spencer Jones ( http://www.azure.com/~spencer/)
Chief Software Developer
Azure Limited


>----------
>From: 	Ed Ball[SMTP:ed@logos.com]
>Sent: 	27 August 1996 16:29
>To: 	'mfc-l@netcom.com'
>Subject: 	RE: CRichEditCtrl and cursor display
>
>
>I had the same problem that you are having, and was only able to
>eliminate the problem by never calling SetSel (I was able to do what I
>had to do by only calling SetWindowText, SetParaFormat,
>SetSelectionCharFormat, and ReplaceSel). I tried any number of things to
>prevent the cursor flicker that occurred with SetSel, all to no avail.
>I, too, am very curious as to how a hidden, disabled, non-focused
>control could have any effect on the mouse cursor.
>
>- Ed
>
>>----------
>>From: 	Lee Aoi Frincke[SMTP:lee@ris.risinc.com]
>>Sent: 	Friday, August 23, 1996 5:20 PM
>>To: 	mfc-l@netcom.com
>>Subject: 	CRichEditCtrl and cursor display
>>
>>Environment:  Win95, VC++ 4.2
>>
>>Hi,
>>
>>My application read/writes RTF data using a descendent of a 
>>CRichEditCtrl.  Before the control is displayed I use a "hidden"
>>control (created without WS_VISIBLE included as a style) to load and
>>manipulate the data before loading the data into a visible control for
>>display and editing.  
>>
>>The problem is that the cursor changes (actually flickers BIG TIME) to
>>the wait cursor and back to the I-beam even though I am accessing the
>>hidden control.  I have narrowed it down to the SetSel () call. 
>>
>>By changing the cursor to the wait cursor in the routines that make
>>the SetSel () calls for the hidden control seems to help.
>>Unfortunately, this would need to be done all over the place. The
>>there must be a better way.
>>
>>If a control is not visible, then why would accessing it or calling
>>any of its methods change the display in any manner???
>>
>>BTW This "problem" also occurs under VC++ 4.0 and 4.1.
>>
>>Thank you,
>>
>>Lee
>>_________________________________________________________
>>Lee Aoi Frincke                 email: lee@ris.risinc.com
>>Research Information Systems    Voice: (619) 438-5526 x236
>>Camino Corporate Center         Fax:   (619) 438-5573
>>2355 Camino Vida Roble 
>>Carlsbad, CA  92009-1572  USA
>>www : http://www.risinc.com/
>>__________________________________________________________ 
>>
>




| Вернуться в корень Архива |