From: Cheng Wei [mailto:[EMAIL PROTECTED]]
>>- if you set your cursor to crHourGlass in advance, there will be no
>>flicker, ie.
>>
>> Screen.Cursor := crHourGlass;
>> try
>> for i := 1 to Lots do
>> IBQuery1.ExecSQL;
>>{ The above line would cause flicker, by changing the cursor to
crHourGlass
>>and back, were the cursor not already set to crHourGlass }
>> finally
>> Screen.Cursor := crDefault;
>> end;
>
>Tried this, it flicks when you have nested db access
Interesting, I hadn't encountered that problem. The methods of
TIBCustomDataSet mostly have code in the following format:
SetCursor := (GetCurrentThreadID = MainThreadID) and (Screen.Cursor =
crDefault);
if SetCursor then
Screen.Cursor := crHourGlass;
try
{ database access}
finally
if SetCursor and (Screen.Cursor = crHourGlass) then
Screen.Cursor := crDefault;
end;
So setting cursor to crHourGlass in advance should work to stop flicker -
nesting shouldn't make any difference as long as the cursor is never changed
away from crHourGlass until the end. Is something else changing the cursor
away from crHourGlass during the db-access, a data-aware control perhaps?
That would cause flicker to start again. Or is it just that you nest the
code above? In that case you should be saving the old cursor setting and
restoring it, not setting it back to crDefault. That would cater for
nesting, if I understand you correctly.
Aside from the obvious annoyance of the cursor flickering, lots of flicker
also causes poor performance.
Cheers,
Carl
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"