Skip to main content
1-Visitor
April 10, 2012
Question

can't menu_add -before ".Edit.Delete Markup" in 6.0 m010

  • April 10, 2012
  • 2 replies
  • 676 views
I'm moving some code into a 6.0 environment and I'm having problems
managing a menu item.

I can't menu_add -before ".Edit.Delete Markup" in 6.0 m010

I can menu_add -before ".Edit.Change Markup" no problem.
response(menu_add(".Edit.Delete Markup")) produces empty message.
response(menu_add(".Edit.Change Markup")) produces "ChangeMarkup" as
expected.

Whassup?

A search through the Editor install tree for DeleteMarkup leads me to
$DeleteMarkupLabel but I can't find that defined anywhere ... just the
places it is used.

Why can't I menu_add -before Edit.Delete Markup?

Or, if you don't know that, where is $DeleteMarkupLabel initialized?

Or, maybe just some sympathy 😉

--
Paul Nagai

    2 replies

    1-Visitor
    April 11, 2012
    Paul,

    You have my sympathy, I ran across this a few months ago. I couldn't
    find where the acl variable was initialized, either. The reason for the
    variable instead of the normal menu path is that they switch the label
    to "Uncomment" (if I remember correctly) when the cursor is at/in an xml
    comment. You'll have to use the variable name in the menu_xxxx
    commands. Here's the ugly stuff I had to do to get what I wanted
    (doesn't look like you'll need to manually set the menu label like I do,
    which is what I mean by ugliness):

    function setDeleteMarkupMenuLabel() {
    # Following if statement copied from the DeleteMarkup alias def
    # in packages\commands.acl
    if(oid_name(oid_current_tag() ) == '_comment') {
    $main::DeleteMarkupLabel = '&Uncomment';
    } else {
    $main::DeleteMarkupLabel = 'Delete Mar&kup';
    }

    menu_change '.Edit.$DeleteMarkupLabel' -label '$DeleteMarkupLabel';
    menu_change ':EditPopup.$DeleteMarkupLabel' -label
    '$DeleteMarkupLabel';
    return 1;
    }

    #### later in a different function of the same file:
    if(!menu_exists(':EditPopup.$DeleteMarkupLabel') ) {
    menu_change '.Edit.$DeleteMarkupLabel' \
    -active "(ico_menus::setDeleteMarkupMenuLabel() && <other stuff=">)";
    menu_copy '.Edit.$DeleteMarkupLabel' -before
    :EditPopup.Select_Element_Content;
    }

    Regards,



    Brian Jensen
    bjensen@bluelid.com


    naglists1-VisitorAuthor
    1-Visitor
    July 10, 2012
    Hi again,
    And, thanks again, Brian.

    FWIW: PTC has opened a doc SPR to address this. And they found another
    similar instance, Edit Undo ... which could be "Undo Delete" or "Undo
    Typing". The syntax would be:

    menu_add -before '.Edit.&Undo $undo_label' "my cmdname" -cmd {mycmd}