diff --git a/src/gui/value/image.cpp b/src/gui/value/image.cpp index afba1420..b3c66e5a 100644 --- a/src/gui/value/image.cpp +++ b/src/gui/value/image.cpp @@ -85,3 +85,20 @@ bool ImageValueEditor::doPaste() { sliceImage(data.GetBitmap().ConvertToImage()); return true; } + +bool ImageValueEditor::doDelete() { + getSet().actions.add(value_action(valueP(), FileName())); + return true; +} + + +bool ImageValueEditor::onChar(wxKeyEvent& ev) { + if (ev.AltDown() || ev.ShiftDown() || ev.ControlDown()) return false; + switch (ev.GetKeyCode()) { + case WXK_DELETE: + doDelete(); + return true; + default: + return false; + } +} diff --git a/src/gui/value/image.hpp b/src/gui/value/image.hpp index 60f6aa9a..5231683d 100644 --- a/src/gui/value/image.hpp +++ b/src/gui/value/image.hpp @@ -25,10 +25,12 @@ class ImageValueEditor : public ImageValueViewer, public ValueEditor { // --------------------------------------------------- : Clipboard virtual bool canCopy() const; - virtual bool canCut() const { return false; } virtual bool canPaste() const; virtual bool doCopy(); virtual bool doPaste(); + virtual bool doDelete(); + + virtual bool onChar(wxKeyEvent&); private: // Open the image slice window showing the give image