Subject Re: [IBO] TIB_updateBar
Author Ulrich
Hi Helen,

> "For example, in an MDI application the user could go from one child
> to another. Each child window could have its own DataSource context. Thus,
> if each child window's DataSource component's AnnounceFocus property is
> to true the SearchBar will receive the focus and align with it.

That is the theory how this component should work if using the AnnounceFocus
functionality. Ok, I think I've got it.

> I'm assuming you have your data objects on a datamodule and, currently,
> 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. :-))

Well, more or less, that is my design, with some slight modifications.
Actually I use a TIB_updateBar on every MDI-child form with TIB_Query and
TIB_Datasources on every MDI-form. The TIB_connection component is on a
central data-module together with some general purpose components like
TIB_Script, TIB_SyncCursorDML, TIB_SessionProps etc. When creating a new
instance of a MDI-Child I submit the database handle to MDI-form and assign
the db-handle to datasets via code. Up to know it seems to work this way.
Cause I don't like the design of the TIB_UpdateBar component so much, I use
TBitBtn components with my own bitmaps. To syncronize the button.enabled
property with the TIB_UpdateBar buttons, I use this code :

procedure TfrmMDIChild.IB_UpdateBarButtonsStateChanged(Sender: TObject);
BitBtnInsert.enabled :=IB_UpdateBar.Buttons[ubInsert].enabled;
BitBtnDelete.enabled :=IB_UpdateBar.Buttons[ubDelete].enabled;
BitBtnPost.enabled :=IB_UpdateBar.Buttons[ubPost].enabled;
BitBtnCancel.enabled :=IB_UpdateBar.Buttons[ubCancel].enabled;

All works fine, until I open a second instance! I try to translate the
german error message :

"Error reading from IB_UpdateBar.Receivefocus. Exception in address xxxxxx"

Maybe two important thing to notice :

If I open the first MDI-child and don't assign one datasource to the
IB_UpdateBar (with activating any of the data sensitive components) I can
open a second instance without error message.

If I disable the code above no error message too.