Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 06 MAR 2010 02:33:56AM Colin Rule wrote:

I have created a context menu on an edit-table.

This includes Copy Row and Paste Row options as defined by me.

When you F2 a cell the standard editing commands for copy/paste are not available.

Is there any way to leep these, or a way to tell when the F2 command has been clicked to deal with it.

Colin


At 06 MAR 2010 05:51PM Barry Stevens wrote:

Would that be the 'Windows menu' checkbox on the bottom right of the context build screen.


At 08 MAR 2010 07:30AM Colin Rule wrote:

It could be, I will check this out and see.


At 30 MAR 2010 02:32AM Colin Rule wrote:

Yes, this check box does it but its pretty useless.

If ON, it applies to ALL context menus, and not specific ones.

As such I have turned this off.

I need to be able to allow the standard 'in cell' editing when the user pressed F2 to edit the cell, and the context menu options that I have defined when navigating the table.

Ideas?

Colin


At 30 MAR 2010 02:57AM Barry Stevens wrote:

Ah yes, it does say 'Environment Setting' which sounds pretty global


At 30 MAR 2010 04:18AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Colin,

With context menus that need to be dynamic we design the menu with all the options we need then at runtime we disable or remove those that we don't from the structure and re-create it by passing the new structure to the contextMenu() function.

e.g.

.bpPre {

 font-family:Consolas,Courier New,Courier,Verdana,Arial;
 font-size:10pt;
 background-color:#FEFEFE;
 color:#000000;
 border:1px solid #7389AE;
 padding:10px 20px;
 margin:0px 10px auto;

}

.bpComment {

 font-style:italic;
 color:#008000;

}

.bpDirective {

 color:#808000;

}

.bpKeyword {

 color:#0000FF;

}

.bpNumber {

 color:#800000;

}

.bpString {

 color:#008080;

}

.bpSymbol {

 color:#800040;

}

.bpSysVar {

 color:#8000FF;

}

.bpDebug {

 font-size:12pt;
 font-weight:bold;
 color:#FF0000;

}

.bpDict {

 color:#FF8000;

}

.bpLabel {

 font-size:11pt;
 font-weight:bold;

}

.bpLineNo {

 font-family:Courier New, Courier, monospace;
 color:#808080;
 background-color:#F5F5F5;

}

/*
   Sample code to adjust a context menu bound to an edit table.
   The menu has three options:
   
        Add
        Separator
        Remove
     
   This code is executed from a synchronous WM_RBUTTONDOWN WINMSG
   event handler.
*/

   * // Equates record for the SYSREPOSMENUCONTEXT table
   * // Generated on 06/03/2005 by user SYSPROG

   equ SYSREPOSMENUCONTEXT$ITEMTEXT$           to 1
   equ SYSREPOSMENUCONTEXT$ITEMID$             to 2
   equ SYSREPOSMENUCONTEXT$HELPTEXT$           to 3
   equ SYSREPOSMENUCONTEXT$NOT_USED$           to 4
   equ SYSREPOSMENUCONTEXT$ENTITY_CONTROL$     to 5
   equ SYSREPOSMENUCONTEXT$ENTITY_NAME$        to 6
   equ SYSREPOSMENUCONTEXT$ENTITY_MESSAGE$     to 7
   equ SYSREPOSMENUCONTEXT$ENTITY_PARAMETER$   to 8
   equ SYSREPOSMENUCONTEXT$DISABLED$           to 9
   equ SYSREPOSMENUCONTEXT$CHECKED$            to 10
   equ SYSREPOSMENUCONTEXT$HIDDEN$             to 11

   * // Menu item position equates
   equ CONTEXTMENU_POS_ADD_FILE$    to 1
   equ CONTEXTMENU_POS_SEPARATOR_1$ to 2
   equ CONTEXTMENU_POS_REMOVE_FILE$ to 3
   
   * // "object" is the name of the control - in this case an edit table
   
   menuRec = repository( "ACCESS", @appID<1> : "*CONTEXTMENU**" : object )
   
   * // We are going to adjust the "Remove" option on the context menu - this
   * // is the 3rd option on the menu...
   
   menuRec<SYSREPOSMENUCONTEXT$DISABLED$,CONTEXTMENU_POS_REMOVE_FILE$> = not( removeEnabled )
   
   call contextMenu( object, "CREATEMENU", menuRec )
   
return

So what you could do is detect when the edit table moves into and out of edit mode and adjust/replace the context menu accordingly. You should be able to tell this from a WM_COMMAND WINMSG event on the edit table looking for the appropriate notification code - This list should help:

   equ DTN_CREATE$            to 1
   equ DTN_DESTROY$           to 2
   equ DTN_ERRSPACE$          to 3
   equ DTN_SETFOCUS$          to 4
   equ DTN_KILLFOCUS$         to 5
   equ DTN_HSCROLL$           to 6
   equ DTN_VSCROLL$           to 7
   equ DTN_CELLFULL$          to 8
   equ DTN_SELCHANGE$         to 9
   equ DTN_MODECHANGE$        to 10
   equ DTN_DBLCLK$            to 11
   equ DTN_CHANGE$            to 12
   equ DTN_UPDATE$            to 13
   equ DTN_DROPDOWN$          to 14
   equ DTN_POSCHANGE$         to 15
   equ DTN_BEGINEDIT$         to 16
   equ DTN_ABORTEDIT$         to 17
   equ DTN_CLICKED$           to 18

The Sprezzatura Group

The Sprezzatura Blog

World leaders in all things RevSoft


At 30 MAR 2010 07:58PM Colin Rule wrote:

Thanks, I will try the WinMsg

Colin

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/8974e088eb60e080852576de00298f25.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1