Subject Cancel - Scroll Events called before AfterCancel
Author Eric Handbury
Hello,

(BCB6-SP2, IBO4_2Hf, FB-1.0-796, Enh2.1.2)

I have a Master-Detail query-set and the following sequence happens:
1) I put both master and detail in Insert mode.
2) I have a UpdateBar tied to the Master where I hit 'Cancel'.
3) The Master.BeforeCancel is fired. (correct)
4) The Detail.BeforeCancel is fired. (correct)
5) The Detail.AfterCancel is fired. (correct)
6) The Detail Scroll Events are fired. (correct)
7) The Master.AfterScroll is fired. (incorrect)

Call Stack (when inside the Master.AfterScroll event)

0043536E TFileDM::qrActivityAfterScroll(this=:01524C98,
IB_Dataset=:0155BB58)
005AFC41 Ib_components::LaunchDSEvent(DS=:0155BB58, EV=
{TFileDM::qrActivityAfterScroll,:01524C98})
005AFE16 Ib_components::TIB_Dataset::DoAfterScroll(Self=:0155BB58)
005AF90D Ib_components::TIB_Dataset::SysAfterScroll(Self=:0155BB58)
005B6001 Ib_components::TIB_BDataset::SysAfterScroll(Self=:0155BB58)
005B8478 Ib_components::TIB_BDataset::SysAdjustCurrentRow
(Self=:0155BB58, ADeleteNode=true, AScrollEvents=true)
005B8307 Ib_components::TIB_BDataset::SysCancelInsertedRow
(Self=:0155BB58)
005AEC9D Ib_components::TIB_Dataset::SysCancel(Self=:0155BB58)
005ACA6B Ib_components::TIB_Dataset::Cancel(Self=:0155BB58)
0055BE26 Ib_updatebar::TIB_UpdateBar::BtnClick(Self=:017C57F0,
Index=4 /* ubCancel */)
0055BEC1 Ib_updatebar::TIB_UpdateBar::BarClick(Self=:017C57F0,
Sender=:017E4AE0)

So my questions are:
1) Why is only the SysAfterScroll called? Why not BeforeScroll?
2) My biggest problem... Why is the Master current row adjusted
(and therefore the Scroll events fired) before the Master.AfterCancel
is fired?

My problem is that I test the State property in my AfterScroll
event and what is happening is as follows:
1) I put both master and detail in Insert mode.
2) I have a UpdateBar tied to the Master where I hit 'Cancel'.
3) The Master.BeforeCancel is fired. (correct)
4) The Detail.BeforeCancel is fired. (correct)
5) The Detail.AfterCancel is fired. (correct)
6) The Detail Scroll Events are fired. (correct)
7) The Master.AfterScroll is fired. (incorrect)
8) The Master.State value within the AfterScroll is still dssInsert
which screws-up my logic.

Since IBO has the intelligence to cancel the Detail before the
Master the following sequence should be done:
1) I put both master and detail in Insert mode.
2) I have a UpdateBar tied to the Master where I hit 'Cancel'.
3) The Master.BeforeCancel is fired. (correct)
4) The Detail.BeforeCancel is fired. (correct)
5) The Detail.AfterCancel is fired. (correct)
6) The Detail Scroll Events are fired. (correct)
7) The Master.AfterCancel is fired.
8) The Master Scroll Events are fired.

This would mean that the Master.Scroll Events would be done after
the Cancel is complete and the Master.State value is back to
dssBrowse.

Eric.