Subject Re: [IBO] TIB_updateBar
Author Helen Borrie
At 11:10 AM 29/04/2003 +0200, you wrote:
>I tried to use a TIB_updateBar on my MDI-child forms to manage the different
>datasources on this form. I noticed, that if I open another instance of the
>same MDI child, the TIB_UpdateBar from this instance also receive the
>onFocus event. How can I manage, that the TIB_UpdateBars only receive the
>onFocus event from their own MDI-form?
Hi Ulrich,
from the Help for ReceiveFocus:
"For example, in an MDI application the user could go from one child window
to another. Each child window could have its own DataSource context. Thus,
if each child window's DataSource component's AnnounceFocus property is set
to true the SearchBar will receive the focus and align with it.

You can also customize the action taken by supplying an OnReceiveFocus
event handler."

I'm assuming you have your data objects on a datamodule and, currently, you
have one ib_datasource there, associated with each dataset
component. That's fine for a lot of application designs, but you don't
*have* to lock them together like this. You can use as many datasources
per dataset as you need and they can be owned by any form or
datamodule. Just create *separate* ib_datasources with each child form,
making the child form the owner of the datasource - remembering to take
good care of creation order, of course. :-))