Advertisement
Guest User

Untitled

a guest
Aug 10th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.77 KB | None | 0 0
  1. [ExtensionOf(formStr(CustInvoiceJournal))]
  2. final class GoCustInvoiceJourForm_Extension
  3. {
  4.     public const int            listCreateRoot = 1;
  5.  
  6.     public void init()
  7.     {
  8.         next init();
  9.  
  10.         FormGridControl invoiceIDControl = this.control(this.controlid("CustInvoiceJour_InvoiceNum_Grid"));
  11.  
  12.         if(invoiceIDControl)
  13.         {
  14.             this.controlMethodOverload(true);
  15.             this.controlMethodOverloadObject(this);  
  16.  
  17.             invoiceIDControl.registerOverrideMethod(methodstr(FormGridControl, selectedMenuOption),
  18.                 formMethodStr(CustInvoiceJournal, selectedMenuOptionNew));
  19.             invoiceIDControl.registerOverrideMethod(methodStr(FormGridControl, getContextMenuOptions),
  20.                 formMethodStr(CustInvoiceJournal, getContextMenuOptionsNew));
  21.         }
  22.     }
  23.  
  24.     public str getContextMenuOptionsNew(FormStringControl _control)
  25.     {
  26.         ContextMenu     menu        = new ContextMenu();
  27.         List            menuOptions = new List(Types::Class);
  28.  
  29.         info("I'm in");
  30.        
  31.         ContextMenuOption contextMenu_changeID = ContextMenuOption::Create('testas', listCreateRoot);
  32.         menuOptions.addEnd(contextMenu_changeID);
  33.  
  34.         menu.ContextMenuOptions(menuOptions);
  35.  
  36.         _control.getContextMenuOptions();
  37.        
  38.         return menu.Serialize();
  39.     }
  40.  
  41.     /// <summary>
  42.     /// Define new override on the control for processing the user selection
  43.     /// </summary>
  44.     public void selectedMenuOptionNew(int selectedOption, FormStringControl _control)
  45.     {
  46.         switch (selectedOption)
  47.         {
  48.             case -1:
  49.                 break;
  50.             case listCreateRoot:
  51.                 info('testas');
  52.                 break;
  53.             default:
  54.                 break;
  55.         }
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement