Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Shortcuts for "Select All" and "Undo" in Popup Menu

When right-clicking in a TElTreeInplaceEdit, a nice Popup menu comes up that allows Undo, Cut, Copy, Paste, Delete and Select All. I'd like to add the standard shortcuts for them. I managed to get Ctrl-X, Ctrl-C, Ctrl-V and the Del key to work.

But I can't seem to figure out how to hook Ctrl-Z into Undo and Ctrl-A into Select All. Is there an easy way to get these to work?

Tagged:

Comments

  • 2 Comments sorted by Votes Date Added
  • edited June 2011 Posts: 18Vote Up0Vote Down
    Actually, I think I figured it out. This is what I've done and it seems to work.

    procedure TOrganizePages.TagsDisplayInplaceEditEditorOnKeyUp(Sender: TObject;
      var Key: Word; Shift: TShiftState);
    begin
      case Key of
        $41: { A part of Ctrl-A }
          if ssCtrl in Shift then
            TCustomElEdit(Sender).SelectAll;
        $5a: { Z part of Ctrl-Z }
          if ssCtrl in Shift then
            TCustomElEdit(Sender).Undo;
        end;
    end;
Sign In or Register to comment.