Re: Control::reactivate_and_undo



> > The is best explained by example. Assume the control is a simple OK
button.
> > In design mode you want to be able to change its location, the caption
(in
> > this case to OK), make it appear to be the default button, and then add
some
> > code to do the OK behavior. All that is in design-mode. In run-mode, you
> > just want the user to invoke the code by either pressing the button or
> > hitting Enter. You would never do undo-able changes to the button.
>
> But the designer could just take care of this problem.  While running
> under the designer, the designer is the one recording the actions into
> the undo list.  And it is only the designer that cares about this.
>
> So the "reactivate_and_undo" method is never ever going to be invoked
> in designer mode (as the designer will know what to do, which will
> probably be related to layout and properties of the control).
>
> The "reactivate_and_undo" feature is intended to be used at runtime,
> and let the application undo changes done inside the control after the
> control just lost its state.
>
> I hope this helps the discussion a bit ;-)

Now I am really confused. If it is only intended for run-time, why have it
at all. The only control container that would care about coordinated undo is
a container that is doing embedding, not control hosts. I think it a bit
far-fetched to assume that a dialog box wants to coordinate undo among its
controls. Sure it is possible but it is like using a tank to kill
ground-squirrels. Typically a dialog box that hosts controls will have some
other "undo" mechanism that is just throwing away all the changes. For a
simple dialog, this is by ignoring the changes in the control (not
extracting them). For a database form, it by canceling the update to the
database and reverting the data. The only time I see you want coordinated,
incremental undo is when the control's state is an integral part of a larger
state, which sounds like an embedding to me.

Chuck.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]