General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion overriding paste functionality for Edit (menu) > Paste

  • authr

    overriding paste functionality for Edit (menu) > Paste

    Participants 1
    Replies 2
    Last Activity 13 years, 8 months ago

    Hi,

    Can somebody please specify how to overwrite the functionality for the paste command available from

    Menu Edit-> Paste, XMetal Standard Toolbar button and from Right Mouse Context Menu

    I have gone through the post on overriding the  File menu ->open command but the same process doesnt work for Edit-> Paste  and remaining of the above ,but i can overwrite the Ctrl+V shortcut functionality by following the process specified in post for Open Button overriding

    Am i missing something ?

    Thank you

    Reply

    Derek Read

    Reply to: overriding paste functionality for Edit (menu) > Paste

    (note that this was originally part of another topic, but did not fit, so I've split it off and created this new one here)

    Reply

    Derek Read

    Reply to: overriding paste functionality for Edit (menu) > Paste

    Assigning the Ctrl+V shortcut does not affect menu items or toolbar buttons (if you wanted to replace that functionality you'd need to add a new menu item or toolbar button, and then optionally remove the existing ones).

    What you want to do is best accomplished using one of these event macros:

    • On_Document_Before_DropText
    • On_Application_Document_Before_DropText.

    Here's an example that changes any text you paste to uppercase for a particular document type:

    [code] Application.Alert(“Changing text to UPPERCASE…”);
    Application.Clipboard.Text = Application.Clipboard.Text.toUpperCase();
    ]]>
    [/code]

    The Programmer's Guide topic “When text is dropped” documents these events (and more).

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support