Asking for onCanCut/Copy/Paste/Clear just before onCut/Copy/Paste/Clear
in the same InputChainElement we ensure that the command for that specific
element can be used (and we aren't mixing onCans result of one input chain
element with the execution of the first input chain element command).
This commit includes the new doc::PalettePicks class. It's a helper
class to identify which entries are selected in the ColorBar.
We've removed the Copy/Paste buttons from the Palette Editor window.
Now the default palette is saved in the user configuration
directory, so we can set any palette as the default (it doesn't
matter if it's related or not to a file, it will be copied into
the user directory anyway).
As now the eraser must show the boundaries of custom brushes, the fixed
maximum limit we were using (MAX_SAVED) for boundaries is not enough.
So now we use a std::vector for saved pixels.
There was an ugly combination of events:
1. When ContextBar::BrushTypeField receives an onItemChange is because the
mouse button is pressed on it (a kMouseDownMessage)
2. It shows the BrushPopup window (which is a PopupWindow
with kCloseOnClickInOtherWindow click behavior)
3. When other click is made in BrushTypeField, the BrushPopup is closed
because it is filtering messages (since it's
kCloseOnClickInOtherWindow). This generates a kCloseMessage in the
queue.
4. BrushTypeField::onItemChange() is executed again (for the same
click in point 3), and it checks that the popup is closed (recently
closed, by this click), so it shows the BrushPopup again.
5. The enqueued kCloseMessage is receved by PopupWindow, and it calls
stopFilteringMessages().
So in this case we have a visible PopupWindow that is not filtering
messages. To fix this bug we have included a startFilteringMessages()
in kOpenMessage. So when the popup is shown again, it filters messages
and the popup cannot stay visible.
After creating a new cel from a tool loop, we have to generate an
ActiveSiteChange notification (because now we have a cel in the active
position). In this way the StatusBar can update/enable the opacity slider.