Subject Re: [IBO] SQL progress animation
Author Jason Wharton
Robert,

As Geoff indicated, CallbackInc and OnCallback isn't going to be a perfect
fit for what you are looking for. It only gives you an opportunity between
fetches. If your query is of such a nature that it has to do a full scan on
the server before the results are readied for fetching then it will
definitely not fit your needs.

You may want to tap into the BeginBusy() ... EndBusy events of a TIB_Session
component. Using these events you could activate a thread that solely
performs an animation of some kind indicating that the server is busy
processing data. You likely would want some kind of a delay before it makes
any visual appearances. That way you would not exaggerate the flicker effect
that happens when the screen cursor changes.

Be sure you put the TIB_Session component on the main data module or form
that is created first in your application and make sure it is first in the
creation order of the form/module it is on. IBO will make it first if it can
automatically but you still want to check it. Then, you can assign event
handlers to the OnBeginBusy and OnEndBusy events. These can resume a thread
that animates a special part of a form or a popup form, etc. with animation
on it.

Hope this helps,
Jason Wharton

----- Original Message -----
From: "Robert martin" <rob@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, March 22, 2010 8:17 PM
Subject: Re: [IBO] SQL progress animation


> Thanks for the heads up Geoff.
>
> I am TIBOQuery and have added a OnCallback event but it doesn't
> trigger. I tryied changing the CallbackInc from -1 to 0 and 1 but still
> no go. The event doesn't trigger. It says it is triggered every nth
> record fetched so
>
> A) doesn't look like it will do what I want, the bulk of processing is
> running the Query (not preparing or processing records).
> B) Where do I specify the nth record, I have left other settings as
> default.
>
> Am I doing something wrong.
>
>
> Rob
>
>
> On 23/03/2010 12:44 p.m., Geoff Worboys wrote:
>>> What we want is a simple way of displaying an animation while
>>> an SQL is being processed. In this particular case the SQL
>>> is being built in code and results are being displayed in a
>>> DB aware grid. As the delphi animation components are no
>>> longer threaded they dont work. We cant put the db Query in a
>>> thread becuase we want to display the results in a db grid.
>>>
>> TIB_Dataset.OnCallback (which means TIB_Cursor and TIB_Query)
>> have it). See also the various Callback* properties that allow
>> you to adjust callback processing.
>>
>> TIBODataset has OnCallback too... but see the help for how
>> to use it.
>>
>>
>>
>>> Any suggestions would be appreciated.
>>>
>> You can see it in use in the source for form IBF_DataPump.
>>
>>
>> Note that this can only give feedback events between record
>> fetches, it cannot give feedback events during a long prepare.
>> That is: In some very complicated selected procedures and the
>> like it can the prepare that takes a long time and during the
>> prepare your interface will appear frozen and callback can do
>> nothing about it.
>>
>> HTH