On Saturday 19 Jul 2003 11:21 pm, Mark Hymers wrote:
> The basic functionality is easy - I simply do the same thing as
> SegmentLabelCommand and derive from KNamedCommand but this doesn't
> provide the UpdateRefreshStatuses for free.

I would suggest that you update the composition's refresh status from 
whichever method in base/ provides the most atomic way to modify 
colours, not from the Command object.

If you look at the Segment and Composition implementations, you'll see 
that every method that modifies the contents of the segment or 
composition (with a few exceptions -- probably mostly mistakes) 
updates the refresh statuses itself as well.  The only reason 
BasicCommand has its explicit update is to handle cases where no 
events are added to or removed from the segment (so the segment 
itself doesn't realise anything has happened) but some properties of 
the events themselves were changed (so a refresh is still necessary).  
This is obviously quite a common case, but it's not relevant to the 
colouring code.

You still need a Command though, as we rely on the CommandHistory's 
commandExecuted signal to indicate to the GUI that _something_ may 
have changed -- the refresh statuses are only used when that signal 
has been received, to find out _what_ has changed.

(And of course you still want a Command for undo/redo.)


Chris



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Rosegarden-devel mailing list
[EMAIL PROTECTED] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to