Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\gmSpec\Migrate\MSGridTest\proj\idf\FromIdl\GRID32.OCX.xml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 <DescriptionFile>
>   2 <library id="GRID32.OCX"
    3          name="MSGrid"
    4          uuid="A8B3B723-0B5A-101B-B22E-00AA0037B2FC"
    5          netVersion="1.0"
    6          source="GRID32.OCX"

I prepare a RefactorLibrary called grid32.ocx.Winforms.Refactor.xml to organize the declarative migration rules that will take this to gmRTL.MSGrid.

...

Code Block
int Grid(int context,int ctlRoot,int iStart)
{
  // migration event handler: called by translation process when it encounters an MSGrid.Grid class member reference
  
  string propName;
  string Value;
  string Name;
  
  if(context == EventType.ControlValue)
  {
     propName = Store.GetIdent(iStart);
     Value = Write.Clear();
     Name = Store.GetName(ctlRoot);
     if(propName == "FixedRows") Grid_FixedRows(Name,Value); 
     else return 0;
     return 1;
  }
  if(context != EventType.InitializeComponent) return 0;
  return 1;
}
void Grid_FixedRows(string Name, string Value)   
{
   // migration event helper: called from handler when Authoring the FixedRows property in the designer MigClass
   
   if (Value > 0)
   {
     System.LogMessage("Grid_FixedRows:" + Name + "," + Value);
     if(Select.Dialect == Dialects.vbn)
     {
        Write.Line("Me." + Name + ".RowHeadersVisible ColumnHeadersVisible= True");
     }
     else
     {
        Write.Line("this." + Name + ".RowHeadersVisible ColumnHeadersVisible= true;");
     }
   }
}


To engage the migration handler, I need to attach gmSL code block to the RefactorLibrary. I must do this in IDF my modifying the RefactorLibrary file .as follows:

1) Add an event attribute to the top level Refactor element

...