Subject | Re: [IBO] TIB_updateBar |
---|---|
Author | Ulrich |
Post date | 2003-04-29T11:34:43Z |
Hi Helen,
functionality. Ok, I think I've got it.
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);
begin
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;
end;
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.
Ulrich
> "For example, in an MDI application the user could go from one childwindow
> to another. Each child window could have its own DataSource context. Thus,set
> 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,you
> have one ib_datasource there, associated with each datasetWell, more or less, that is my design, with some slight modifications.
> 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. :-))
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);
begin
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;
end;
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.
Ulrich