Sometimes Method Overload is Not Being Recognized

Posted by jquerijero on 04-Feb-2010 15:18

From time to time the method overloads are not being recognized. The class compiles fine, but it gives a run-time error about mismatched number of parameters. Has anyone else experienced this?

All Replies

Posted by Thomas Mercer-Hursh on 04-Feb-2010 15:32

Version?

Are you really sure that both the calling class and the called class are freshly compiled and that the signature does actually match?

Is this ABL to ABL or ABL to .NET?

Posted by jquerijero on 04-Feb-2010 15:43

ABL Form calling another ABL Form with several overload methods. However, the method overloads are only used internally by the second form. The first form calling a PUBLIC method that has a call to the method overload inside it. The first form is not directly calling the method overload. Also I have other overloaded methods which don't seem to have any problem except for the last one I just added.

10.2A

Posted by sarahm on 05-Feb-2010 09:38

If it's as simple as you describe then I would certainly expect it to work.  I would be very interested in seeing the code so please open a call with tech support.

Posted by Thomas Mercer-Hursh on 05-Feb-2010 11:09

I would look very, very carefully at the definitions and the calls.   Perhaps you could post just those?

Posted by jquerijero on 05-Feb-2010 14:49

After I switched the overload definitions code blocks, it started working.

Posted by Thomas Mercer-Hursh on 05-Feb-2010 15:38

Meaning you just rearranged the code and it started to work?

Mind listing out the definitions in the original and modifier order along with the call that failed to see if we can spot anything?

Posted by jquerijero on 05-Feb-2010 15:46

Here is the code; the problematic overloads were IsWidgetInFixedMode.

-----

USING Progress.Lang.*.
USING Progress.Windows.Form.
USING Dmsi.Agility.Designer.*.
USING System.ComponentModel.Design.*.
USING System.ComponentModel.Design.Serialization.*.
USING System.ComponentModel.*.
USING Infragistics.Win.UltraWinListView.*.

CLASS sys.LayoutEditor INHERITS sys.AgilityWindowBase   :
    {df/customlayoutdefds.i}.
    {common/errormsgds.i}
   
    DEFINE PRIVATE TEMP-TABLE ttControls
        FIELD widget_name AS CHARACTER.
   
    /* Live control */
    DEFINE PRIVATE VARIABLE m_CurrentLiveParent         AS System.Windows.Forms.Control  NO-UNDO.
    DEFINE PRIVATE VARIABLE m_CurrentSectionName        AS CHARACTER                     NO-UNDO.
    /* Designer object corresponding to the the Live parent control, ex. ultragroupbox tabpanel */
    DEFINE PRIVATE VARIABLE m_RootDesignerParent        AS System.Windows.Forms.Control  NO-UNDO.
   
    /* layout engine */
    DEFINE PRIVATE VARIABLE m_DesignerHost              AS DesignerHost                 NO-UNDO.
    DEFINE PRIVATE VARIABLE m_ServiceContainer          AS ServiceContainer             NO-UNDO.
    DEFINE PRIVATE VARIABLE m_SelectionService          AS ISelectionService            NO-UNDO.
    DEFINE PRIVATE VARIABLE m_MenuService               AS MenuCommandService           NO-UNDO.
   
    DEFINE PRIVATE VARIABLE m_IsSynchronizingProperties AS LOGICAL                      NO-UNDO INIT FALSE.
    DEFINE PRIVATE VARIABLE m_IsSynchronizingSelection  AS LOGICAL                      NO-UNDO INIT FALSE.
    DEFINE PRIVATE VARIABLE m_IsFromGridSelection       AS LOGICAL                      NO-UNDO INIT FALSE.      
    DEFINE PRIVATE VARIABLE m_hasAccess                 AS LOGICAL                      NO-UNDO INIT TRUE.
    DEFINE PRIVATE VARIABLE m_isRestoring               AS LOGICAL                      NO-UNDO INIT FALSE.
    DEFINE PRIVATE VARIABLE m_isOpening                 AS LOGICAL                      NO-UNDO INIT FALSE.              
   
    DEFINE PRIVATE VARIABLE m_IsPropertiesShown         AS LOGICAL                      NO-UNDO INIT FALSE.
    DEFINE PRIVATE VARIABLE m_IsControlListShown        AS LOGICAL                      NO-UNDO INIT TRUE.
    DEFINE PRIVATE VARIABLE m_isDefault                 AS LOGICAL                      NO-UNDO.
    DEFINE PRIVATE VARIABLE m_isNewRecord               AS LOGICAL                      NO-UNDO.
    DEFINE PRIVATE VARIABLE m_usageLevel1               AS CHARACTER                    NO-UNDO.
    DEFINE PRIVATE VARIABLE m_usageLevel2               AS CHARACTER                    NO-UNDO.
    DEFINE PRIVATE VARIABLE m_usageLevel3               AS CHARACTER                    NO-UNDO.
    DEFINE PRIVATE VARIABLE m_usageLevel4               AS CHARACTER                    NO-UNDO.

DEFINE PRIVATE VARIABLE m_TabOrderView              AS System.Collections.Specialized.ListDictionary NO-UNDO.

    DEFINE PRIVATE TEMP-TABLE ttLocatedCustomLayoutHeader NO-UNDO LIKE ttcustom_layout_header.
   
    DEFINE PRIVATE TEMP-TABLE ttorigcustom_layout_header LIKE ttcustom_layout_header.
    DEFINE PRIVATE TEMP-TABLE ttorigcustom_layout_section LIKE ttcustom_layout_section.
    DEFINE PRIVATE TEMP-TABLE ttorigcustom_layout_detail LIKE ttcustom_layout_detail.
DEFINE PRIVATE DATASET dsOrigCustomLayout FOR ttorigcustom_layout_header, ttorigcustom_layout_section, ttorigcustom_layout_detail.

    DEFINE PRIVATE TEMP-TABLE ttdefcustom_layout_header LIKE ttcustom_layout_header.
    DEFINE PRIVATE TEMP-TABLE ttdefcustom_layout_section LIKE ttcustom_layout_section.
    DEFINE PRIVATE TEMP-TABLE ttdefcustom_layout_detail LIKE ttcustom_layout_detail.
DEFINE PRIVATE DATASET dsDefCustomLayout FOR ttdefcustom_layout_header, ttdefcustom_layout_section, ttdefcustom_layout_detail.

    DEFINE PUBLIC PROPERTY FormInLayoutMode AS Progress.Windows.Form NO-UNDO
GET.
PRIVATE SET.
       
    DEFINE PUBLIC PROPERTY ControlsContainers AS System.Collections.ArrayList NO-UNDO
GET.
PRIVATE SET.

    DEFINE PRIVATE PROPERTY IsRootIncluded AS LOGICAL NO-UNDO INIT FALSE
GET():
      DEFINE VARIABLE lRootIncluded     AS LOGICAL           NO-UNDO INIT FALSE.
      DEFINE VARIABLE oSelectionService AS SelectionService  NO-UNDO.
      DEFINE VARIABLE oSelection        AS "System.Object[]" NO-UNDO.
      DEFINE VARIABLE i                 AS INTEGER           NO-UNDO.
     
      IF VALID-OBJECT(m_ServiceContainer) THEN
      DO:
          oSelectionService = CAST(m_ServiceContainer:GetService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.ISelectionService")), SelectionService).
   
          IF VALID-OBJECT(oSelectionService) THEN
          DO:
            oSelection = NEW "System.Object[]"(oSelectionService:SelectionCount).
            oSelectionService:GetSelectedComponents():CopyTo(oSelection, 0).               
           
            DO i = 0 TO oSelection:Length - 1:
              IF VALID-OBJECT(oSelection:GetValue(i)) THEN
              DO:
                IF CAST(oSelection:GetValue(i), System.Windows.Forms.Control):Name = "RootElement" THEN
                  lRootIncluded = TRUE.
              END.                  
            END.
          END.
      END.
     
      RETURN lRootIncluded.
    END.
SET.

    DEFINE PRIVATE VARIABLE components AS System.ComponentModel.IContainer NO-UNDO.

DEFINE PRIVATE VARIABLE LayoutEditor_Fill_Panel AS System.Windows.Forms.Panel NO-UNDO.
DEFINE PRIVATE VARIABLE splitContainer1 AS System.Windows.Forms.SplitContainer NO-UNDO.
DEFINE PRIVATE VARIABLE splitContainer2 AS System.Windows.Forms.SplitContainer NO-UNDO.
DEFINE PRIVATE VARIABLE panel3 AS System.Windows.Forms.Panel NO-UNDO.
DEFINE PRIVATE VARIABLE pnlView AS System.Windows.Forms.Panel NO-UNDO.
DEFINE PRIVATE VARIABLE ultraLabel6 AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
DEFINE PRIVATE VARIABLE ultraExplorerBarContainerControl1 AS Infragistics.Win.UltraWinExplorerBar.UltraExplorerBarContainerControl NO-UNDO.
DEFINE PRIVATE VARIABLE m_LayoutEditor_Toolbars_Dock_Area_Left AS Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea NO-UNDO.
DEFINE PRIVATE VARIABLE m_LayoutEditor_Toolbars_Dock_Area_Right AS Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea NO-UNDO.
DEFINE PRIVATE VARIABLE m_LayoutEditor_Toolbars_Dock_Area_Top AS Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea NO-UNDO.
DEFINE PRIVATE VARIABLE m_LayoutEditor_Toolbars_Dock_Area_Bottom AS Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea NO-UNDO.
DEFINE PRIVATE VARIABLE ultraToolbarsManager1 AS tools.AgilityToolbarsManager NO-UNDO.
    DEFINE PRIVATE VARIABLE txtHeight AS Infragistics.Win.UltraWinEditors.UltraNumericEditor NO-UNDO.
    DEFINE PRIVATE VARIABLE txtWidth AS Infragistics.Win.UltraWinEditors.UltraNumericEditor NO-UNDO.
    DEFINE PRIVATE VARIABLE txtX AS Infragistics.Win.UltraWinEditors.UltraNumericEditor NO-UNDO.
    DEFINE PRIVATE VARIABLE txtY AS Infragistics.Win.UltraWinEditors.UltraNumericEditor NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraLabel2 AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraLabel3 AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraLabel4 AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraLabel5 AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
    DEFINE PRIVATE VARIABLE lblProperties AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
    DEFINE PRIVATE VARIABLE flowLayoutPanel1 AS System.Windows.Forms.FlowLayoutPanel NO-UNDO.
    DEFINE PRIVATE VARIABLE panel6 AS System.Windows.Forms.Panel NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraLabel7 AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
    DEFINE PRIVATE VARIABLE panel7 AS System.Windows.Forms.Panel NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraLabel9 AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
    DEFINE PRIVATE VARIABLE btnUserID AS Infragistics.Win.Misc.UltraButton NO-UNDO.
    DEFINE PRIVATE VARIABLE txtCustomLayout AS Infragistics.Win.UltraWinEditors.UltraTextEditor NO-UNDO.
    DEFINE PRIVATE VARIABLE cbAccessedType AS Infragistics.Win.UltraWinEditors.UltraComboEditor NO-UNDO.
    DEFINE PRIVATE VARIABLE txtAccessedBy AS Infragistics.Win.UltraWinEditors.UltraTextEditor NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraGrid1 AS Infragistics.Win.UltraWinGrid.UltraGrid NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraDataSource1 AS Infragistics.Win.UltraWinDataSource.UltraDataSource NO-UNDO.
    DEFINE PRIVATE VARIABLE pnlProperties AS System.Windows.Forms.Panel NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraGrid2 AS Infragistics.Win.UltraWinGrid.UltraGrid NO-UNDO.
    DEFINE PRIVATE VARIABLE panel1 AS System.Windows.Forms.Panel NO-UNDO.
    DEFINE PRIVATE VARIABLE lblChildControls AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraGrid3 AS Infragistics.Win.UltraWinGrid.UltraGrid NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraLabel8 AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
    DEFINE PRIVATE VARIABLE splitContainerTabSettings AS System.Windows.Forms.SplitContainer NO-UNDO.
    DEFINE PRIVATE VARIABLE panel2 AS System.Windows.Forms.Panel NO-UNDO.
    DEFINE PRIVATE VARIABLE btnDown AS Infragistics.Win.Misc.UltraButton NO-UNDO.
    DEFINE PRIVATE VARIABLE btnUp AS Infragistics.Win.Misc.UltraButton NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraDataSourceTabSettings AS Infragistics.Win.UltraWinDataSource.UltraDataSource NO-UNDO.
    DEFINE PRIVATE VARIABLE splitContainer3 AS System.Windows.Forms.SplitContainer NO-UNDO.
    DEFINE PRIVATE VARIABLE ultraDataSourceChildTabSettings AS Infragistics.Win.UltraWinDataSource.UltraDataSource NO-UNDO.
    DEFINE PRIVATE VARIABLE branchSelector AS tools.BranchSelector NO-UNDO.


/*------------------------------------------------------------------------------
            Purpose: Initiatize the editor using the default layout based on usage
                     levels                  
            Notes:                    
    ------------------------------------------------------------------------------*/
CONSTRUCTOR PUBLIC LayoutEditor (INPUT formForLayout   AS Progress.Windows.Form,
                                  INPUT usageLevel1     AS CHARACTER,
                                  INPUT usageLevel2     AS CHARACTER,
                                  INPUT usageLevel3     AS CHARACTER,
                                  INPUT usageLevel4     AS CHARACTER,
                                  INPUT parentContainerList AS System.Collections.ArrayList):
    
    
        DEFINE VARIABLE lDummy        AS LOGICAL                                        NO-UNDO.
       
        SUPER().
        InitializeComponent().
       
        /* NOTE: since 10.2B doesn't support custom event we are just going to pass the
                 form being edited. */
        FormInLayoutMode = formForLayout.
       
        /* Store default layout values */
        RUN sys/sicustomlayoutfetch.p ON g-AppSrvr
          ( INPUT sys.AgilitySession:SessionContextID,
            INPUT "Default",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT usageLevel1,
            INPUT usageLevel2,
            INPUT usageLevel3,
            INPUT usageLevel4,
            OUTPUT lDummy,
            OUTPUT DATASET dsDefCustomLayout).
               
        RUN sys/sicustomlayoutfetch.p ON g-AppSrvr
          ( INPUT sys.AgilitySession:SessionContextID,
            INPUT "Last Accessed",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT usageLevel1,
            INPUT usageLevel2,
            INPUT usageLevel3,
            INPUT usageLevel4,
            OUTPUT m_isDefault,
            OUTPUT DATASET dsCustomLayout).
       
        ASSIGN
            m_usageLevel1 = usageLevel1
            m_usageLevel2 = usageLevel2
            m_usageLevel3 = usageLevel3
            m_usageLevel4 = usageLevel4.
           
        ControlsContainers = parentContainerList.
        
        CATCH e AS Progress.Lang.Error:
            UNDO, THROW e.
        END CATCH.

END CONSTRUCTOR.

    /*------------------------------------------------------------------------------
            Purpose: Initiatize the editor using the default layout based on usage
                     levels                  
            Notes:                    
    ------------------------------------------------------------------------------*/
CONSTRUCTOR PUBLIC LayoutEditor (INPUT formForLayout   AS Progress.Windows.Form,
                                  INPUT usageLevel1     AS CHARACTER,
                                  INPUT usageLevel2     AS CHARACTER,
                                  INPUT usageLevel3     AS CHARACTER,
                                  INPUT usageLevel4     AS CHARACTER,
                                  INPUT parentContainerList AS System.Collections.ArrayList,
                                     INPUT windowWillBeVisualized AS LOGICAL):
    
    
        DEFINE VARIABLE lDummy        AS LOGICAL                                        NO-UNDO.
       
        SUPER().

        IF windowWillBeVisualized THEN
          InitializeComponent().
       
        /* NOTE: since 10.2B doesn't support custom event we are just going to pass the
                 form being edited. */
        FormInLayoutMode = formForLayout.
       
        /* Store default layout values */
        RUN sys/sicustomlayoutfetch.p ON g-AppSrvr
          ( INPUT sys.AgilitySession:SessionContextID,
            INPUT "Default",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT usageLevel1,
            INPUT usageLevel2,
            INPUT usageLevel3,
            INPUT usageLevel4,
            OUTPUT lDummy,
            OUTPUT DATASET dsDefCustomLayout).
               
        RUN sys/sicustomlayoutfetch.p ON g-AppSrvr
          ( INPUT sys.AgilitySession:SessionContextID,
            INPUT "Last Accessed",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT usageLevel1,
            INPUT usageLevel2,
            INPUT usageLevel3,
            INPUT usageLevel4,
            OUTPUT m_isDefault,
            OUTPUT DATASET dsCustomLayout).
       
        ASSIGN
            m_usageLevel1 = usageLevel1
            m_usageLevel2 = usageLevel2
            m_usageLevel3 = usageLevel3
            m_usageLevel4 = usageLevel4.
           
        ControlsContainers = parentContainerList.
        
        CATCH e AS Progress.Lang.Error:
            UNDO, THROW e.
        END CATCH.

END CONSTRUCTOR.
        
    CONSTRUCTOR PUBLIC LayoutEditor (INPUT formForLayout   AS Progress.Windows.Form,
                                  INPUT accessType      AS CHARACTER,
                                  INPUT accessedBy      AS CHARACTER,
                                  INPUT appliesToBranch AS CHARACTER,
                                  INPUT customLayout    AS CHARACTER,
                                  INPUT usageLevel1     AS CHARACTER,
                                  INPUT usageLevel2     AS CHARACTER,
                                  INPUT usageLevel3     AS CHARACTER,
                                  INPUT usageLevel4     AS CHARACTER,
                                  INPUT parentContainerList AS System.Collections.ArrayList):
    
        DEFINE VARIABLE lDummy        AS LOGICAL                                        NO-UNDO.
       
     SUPER().
        InitializeComponent().

        /* NOTE: since 10.2B doesn't support custom event we are just going to pass the
                 form being edited. */
        FormInLayoutMode = formForLayout.
               
        /* Store default layout values */
        RUN sys/sicustomlayoutfetch.p ON g-AppSrvr
          ( INPUT sys.AgilitySession:SessionContextID,
            INPUT "Default",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT usageLevel1,
            INPUT usageLevel2,
            INPUT usageLevel3,
            INPUT usageLevel4,
            OUTPUT lDummy,
            OUTPUT DATASET dsDefCustomLayout).
              
        RUN sys/sicustomlayoutfetch.p ON g-AppSrvr
          ( INPUT sys.AgilitySession:SessionContextID,
            INPUT "",
            INPUT accessType,
            INPUT accessedBy,
            INPUT appliesToBranch,
            INPUT customLayout,
            INPUT usageLevel1,
            INPUT usageLevel2,
            INPUT usageLevel3,
            INPUT usageLevel4,
            OUTPUT m_isDefault,
            OUTPUT DATASET dsCustomLayout).
       
        ControlsContainers = parentContainerList.

        ASSIGN
            m_usageLevel1 = usageLevel1
            m_usageLevel2 = usageLevel2
            m_usageLevel3 = usageLevel3
            m_usageLevel4 = usageLevel4.
                    
        CATCH e AS Progress.Lang.Error:
            UNDO, THROW e.
        END CATCH.

END CONSTRUCTOR.

    CONSTRUCTOR PUBLIC LayoutEditor (INPUT formForLayout   AS Progress.Windows.Form,
                                  INPUT accessType      AS CHARACTER,
                                  INPUT accessedBy      AS CHARACTER,
                                  INPUT appliesToBranch AS CHARACTER,
                                  INPUT customLayout    AS CHARACTER,
                                  INPUT usageLevel1     AS CHARACTER,
                                  INPUT usageLevel2     AS CHARACTER,
                                  INPUT usageLevel3     AS CHARACTER,
                                  INPUT usageLevel4     AS CHARACTER,
                                  INPUT parentContainer AS System.Windows.Forms.Control):
    
        DEFINE VARIABLE parentContainerList AS System.Collections.ArrayList NO-UNDO.
        DEFINE VARIABLE lDummy              AS LOGICAL                      NO-UNDO.
 
        SUPER().
        InitializeComponent().

         /* NOTE: since 10.2B doesn't support custom event we are just going to pass the
                 form being edited. */
        FormInLayoutMode = formForLayout.
              
        /* Store default layout values */
        RUN sys/sicustomlayoutfetch.p ON g-AppSrvr
          ( INPUT sys.AgilitySession:SessionContextID,
            INPUT "Default",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT "",
            INPUT usageLevel1,
            INPUT usageLevel2,
            INPUT usageLevel3,
            INPUT usageLevel4,
            OUTPUT lDummy,
            OUTPUT DATASET dsDefCustomLayout).
              
        RUN sys/sicustomlayoutfetch.p ON g-AppSrvr
          ( INPUT sys.AgilitySession:SessionContextID,
            INPUT "",
            INPUT accessType,
            INPUT accessedBy,
            INPUT appliesToBranch,
            INPUT customLayout,
            INPUT usageLevel1,
            INPUT usageLevel2,
            INPUT usageLevel3,
            INPUT usageLevel4,
            OUTPUT m_isDefault,
            OUTPUT DATASET dsCustomLayout).
       
        parentContainerList = NEW System.Collections.ArrayList().
        parentContainerList:Add(parentContainer).
        ControlsContainers = parentContainerList.

        ASSIGN
            m_usageLevel1 = usageLevel1
            m_usageLevel2 = usageLevel2
            m_usageLevel3 = usageLevel3
            m_usageLevel4 = usageLevel4.
                   
        CATCH e AS Progress.Lang.Error:
            UNDO, THROW e.
        END CATCH.

END CONSTRUCTOR.

  /*------------------------------------------------------------------------------
          Purpose: Recursively add the controls into the design surface                    
          Notes:                    
  ------------------------------------------------------------------------------*/
  METHOD PRIVATE VOID AddChildrenToDesignSurface( INPUT parentContainer AS System.Windows.Forms.Control,
    INPUT designContainer AS System.Windows.Forms.Control):
       
    DEFINE VARIABLE chkVisible       AS Infragistics.Win.UltraWinEditors.UltraCheckEditor NO-UNDO.
    DEFINE VARIABLE i                AS INTEGER                                           NO-UNDO.
    DEFINE VARIABLE j                AS INTEGER                                           NO-UNDO.
    DEFINE VARIABLE oDesignerControl AS System.Windows.Forms.Control                      NO-UNDO.
    DEFINE VARIABLE oControlRow      AS Infragistics.Win.UltraWinDataSource.UltraDataRow  NO-UNDO.
    DEFINE VARIABLE oTabOrderRow     AS Infragistics.Win.UltraWinDataSource.UltraDataRow  NO-UNDO.
    DEFINE VARIABLE cParentName      AS CHARACTER                                         NO-UNDO.
    DEFINE VARIABLE cReadableName    AS CHARACTER                                         NO-UNDO.
    DEFINE VARIABLE cWidgetName      AS CHARACTER                                         NO-UNDO.
 
    DO i = 0 TO parentContainer:Controls:Count - 1:
      oDesignerControl = ?.
     
      cWidgetName = parentContainer:Controls[i]:Name.
      cParentName = parentContainer:Controls[i]:Parent:Name.
  
   FIND FIRST ttcustom_layout_detail WHERE
              ttcustom_layout_detail.section     = m_CurrentSectionName AND
              ttcustom_layout_detail.widget_name = cWidgetName NO-ERROR.
  
   /* for debugging purpose */
   IF NOT AVAIL ttcustom_layout_detail THEN
   DO:
     MESSAGE cWidgetName + " not found in section " + m_CurrentSectionName + "." VIEW-AS ALERT-BOX.
     NEXT.
   END.      
     
   /* ttControls is an indicator that the control or control group has been added into the grid */
      IF ( (AVAIL ttcustom_layout_detail   AND
        ttcustom_layout_detail.visible AND
        NOT CAN-FIND(FIRST ttControls WHERE widget_name = cParentName)) OR /* initial load */
                
        NOT AVAIL ttcustom_layout_detail OR                                /* child element of panel that needs to be added to the designer */
               
        CAN-FIND(FIRST ttControls WHERE widget_name = cParentName) ) AND   /* when updating visibility */
              
        VALID-OBJECT(designContainer) THEN
      DO:
        /* Handle unknown UI injected by IG control for its own use */
        IF cWidgetName = "" THEN
          cWidgetName = System.Guid:NewGuid():ToString().
               
        DO ON ERROR UNDO, LEAVE:
          IF TYPE-OF(parentContainer:Controls[i], tools.IAgilityControl) THEN
          DO:
            oDesignerControl = DYNAMIC-NEW parentContainer:Controls[i]:GetType():ToString() ().
            oDesignerControl:Name = cWidgetName.
            m_DesignerHost:Add(oDesignerControl).
            m_RootDesignerParent:Controls:Add(oDesignerControl).           
          END. 
          ELSE
            oDesignerControl = CAST(m_DesignerHost:CreateComponent(parentContainer:Controls[i]:GetType(), cWidgetName), System.Windows.Forms.Control).
         
          CATCH e AS Progress.Lang.Error :
            oDesignerControl = CAST(m_DesignerHost:CreateComponent(Progress.Util.TypeHelper:GetType("System.Windows.Forms.TextBox"), cWidgetName), System.Windows.Forms.Control).
            CAST(oDesignerControl, System.Windows.Forms.TextBox):AutoSize = FALSE.
          END CATCH.
        END.
              
        THIS-OBJECT:CopyPropertiesFromTempTable(parentContainer:Controls[i], oDesignerControl, FALSE).

        /* Additional properties of controls inside the panel */
        THIS-OBJECT:SetAdditionalProperties(oDesignerControl).

        oDesignerControl:Visible = TRUE.         
         
        /* add to design surface else to the available list */
        designContainer:Controls:Add(oDesignerControl).
      END.
           
      /* Only add the children immediately parented by the main container to the grid . */   
      IF Progress.Util.TypeHelper:Equals(parentContainer, m_CurrentLiveParent) THEN
      DO:             
        CREATE ttControls.
        ASSIGN
          ttControls.widget_name = parentContainer:Controls[i]:Name.
                   
        cReadableName = GetReadableName(ttcustom_layout_detail.widget_name).
               
        /* UltraDataSource is only used to build the UltraGrid because the grid needs
           a BindingSource */
        oControlRow = THIS-OBJECT:ultraDataSource1:Rows:Add().
               
        oControlRow:Item["visible"] = ttcustom_layout_detail.visible.           
        oControlRow:Item["widget_name"] = cReadableName.               
        oControlRow:Item["mode"] = IF AVAIL ttcustom_layout_detail AND ttcustom_layout_detail.visible THEN ttcustom_layout_detail.mode
                                   ELSE IF AVAIL ttcustom_layout_detail AND NOT ttcustom_layout_detail.visible THEN ""
                                   ELSE "Editable".           
        oControlRow:Item["tab_stop"] = IF AVAIL ttcustom_layout_detail THEN ttcustom_layout_detail.tab_stop ELSE TRUE.
        oControlRow:Item["tab_index"] = IF AVAIL ttcustom_layout_detail THEN ttcustom_layout_detail.tab_index ELSE 0.
               
        IF VALID-OBJECT(oDesignerControl) THEN
        DO:
          oDesignerControl:Tag = ultraGrid1:Rows[ultraGrid1:Rows:Count - 1].
          oDesignerControl:SizeChanged:SUBSCRIBE(ctl_SizeLocationChanged).
          oDesignerControl:LocationChanged:SUBSCRIBE(ctl_SizeLocationChanged).
        END.
               
        ultraGrid1:Rows[ultraGrid1:Rows:Count - 1]:Cells[0]:Tag = parentContainer:Controls[i]. /* This is the original control */
        ultraGrid1:Rows[ultraGrid1:Rows:Count - 1]:Tag = oDesignerControl. /* designer control object */
               
        THIS-OBJECT:BuildValueList(parentContainer:Controls[i], ultraGrid1:Rows[ultraGrid1:Rows:Count - 1], FALSE). 
               
        /* tab settings */
        IF ttcustom_layout_detail.visible                                          AND
           NOT THIS-OBJECT:IsWidgetInFixedMode(ttcustom_layout_detail.widget_name) THEN
        DO:
          oTabOrderRow = THIS-OBJECT:ultraDataSourceTabSettings:Rows:Add().
                   
          oTabOrderRow:Item["widget_name"] = cReadableName.               
          oTabOrderRow:Item["tab_stop"] = IF AVAIL ttcustom_layout_detail THEN ttcustom_layout_detail.tab_stop ELSE TRUE.
          oTabOrderRow:Item["tab_index"] = IF AVAIL ttcustom_layout_detail THEN ttcustom_layout_detail.tab_index ELSE 0.
          oTabOrderRow:Tag = ultraGrid1:Rows[ultraGrid1:Rows:Count - 1].
                   
          ultraGrid3:Rows[ultraGrid3:Rows:Count - 1]:Tag = ultraGrid1:Rows[ultraGrid1:Rows:Count - 1].
                   
          /* this allow the ultragrid1 to know about the exact entry of ultragrid3 it is linked to */
          ultraGrid1:Rows[ultraGrid1:Rows:Count - 1]:Cells[1]:Tag = ultraGrid3:Rows[ultraGrid3:Rows:Count - 1].              
        END.
      END.
     
      /* Child controls of user controls are not added to the designer individually.
         Assign child control's value after the UserControl is added. */
      IF VALID-OBJECT(oDesignerControl)                              AND
         TYPE-OF(parentContainer:Controls[i], tools.IAgilityControl) AND
         parentContainer:Controls[i]:Controls:Count > 0              THEN 
   DO j = 0 TO oDesignerControl:Controls:Count - 1:
        CopyPropertiesFromTempTable(oDesignerControl:Controls[j]).
      END.
                
      /* If this is a container, add its children to the design surface */
      IF parentContainer:Controls[i]:Controls:Count > 0                   AND
         NOT TYPE-OF(parentContainer:Controls[i], tools.IAgilityControl)  THEN
        AddChildrenToDesignSurface(parentContainer:Controls[i], oDesignerControl).
     
      IF VALID-OBJECT(oDesignerControl)                                            AND
         VALID-OBJECT(oDesignerControl:Tag)                                        AND
         TYPE-OF(oDesignerControl:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow) THEN
        DesignerControlUpdateVisual(CAST(oDesignerControl:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow)).         
    END.
       
  END METHOD.

    /*------------------------------------------------------------------------------
            Purpose: Use to add components that is already part of the control list after
                     AddChildrenToDesignSurface has been called.                   
            Notes:                    
    ------------------------------------------------------------------------------*/

    METHOD PUBLIC System.Windows.Forms.Control AddComponentToSurface( INPUT oRow AS Infragistics.Win.UltraWinGrid.UltraGridRow, INPUT lExcludePositionAndSize AS LOGICAL ):
       
        DEFINE VARIABLE i                AS INTEGER                                          NO-UNDO.
        DEFINE VARIABLE oDesignerControl AS System.Windows.Forms.Control                     NO-UNDO.
        DEFINE VARIABLE oOriginalControl AS System.Windows.Forms.Control                     NO-UNDO.
        DEFINE VARIABLE oTabOrderRow   AS Infragistics.Win.UltraWinDataSource.UltraDataRow NO-UNDO.

     DEFINE BUFFER   bufcustom_layout_detail FOR ttcustom_layout_detail.

  IF VALID-OBJECT(oRow) THEN
  DO:  
            oOriginalControl = CAST(oRow:Cells[0]:Tag, System.Windows.Forms.Control).
           
            IF VALID-OBJECT(oOriginalControl) AND
               NOT m_RootDesignerParent:Controls:ContainsKey(oOriginalControl:Name) THEN
            DO:
                IF TYPE-OF(oOriginalControl, tools.IAgilityControl) THEN
                DO:
                  oDesignerControl = DYNAMIC-NEW oOriginalControl:GetType():ToString() ().
                  oDesignerControl:Name = oOriginalControl:Name.
                  m_DesignerHost:Add(oDesignerControl).
                  m_RootDesignerParent:Controls:Add(oDesignerControl).           
                END. 
                ELSE   
                  oDesignerControl = CAST(m_DesignerHost:CreateComponent(oOriginalControl:GetType(), oOriginalControl:Name), System.Windows.Forms.Control).
         
                IF NOT VALID-OBJECT(oDesignerControl) THEN
                  UNDO, THROW NEW PROGRESS.Lang.AppError("Unable to create the control on the design surface.").

          THIS-OBJECT:CopyPropertiesFromTempTable(oOriginalControl, oDesignerControl, lExcludePositionAndSize).
          oDesignerControl:Visible = TRUE.
         
                /* add to design surface */    
                m_RootDesignerParent:Controls:Add(oDesignerControl).
                oRow:Tag = oDesignerControl.
                oDesignerControl:Tag = oRow.
               
                /* tab settings datasource */
                IF NOT THIS-OBJECT:IsWidgetInFixedMode( oOriginalControl:NAME) THEN
                DO: 
                  oTabOrderRow = THIS-OBJECT:ultraDataSourceTabSettings:Rows:Add().
                  oTabOrderRow:Item["widget_name"] = oRow:Cells["widget_name"]:Value.
                 
                  FOR FIRST bufcustom_layout_detail WHERE
                            bufcustom_layout_detail.SECTION     = m_CurrentSectionName  AND
                            bufcustom_layout_detail.WIDGET_name = oOriginalControl:NAME NO-LOCK:                  
                    oRow:Cells["tab_stop"]:Value = bufcustom_layout_detail.TAB_stop.              
                    oTabOrderRow:Item["tab_stop"] = bufcustom_layout_detail.TAB_stop.
                    oDesignerControl:TabStop = bufcustom_layout_detail.TAB_stop.

                    /* Additional properties of controls inside the panel */
                    THIS-OBJECT:SetAdditionalProperties(oDesignerControl).
                  END.                
                 
                  oTabOrderRow:Tag = oRow. 
                   
                  IF NOT m_isRestoring THEN
                  DO:
                    oTabOrderRow:Item["tab_index"] = ultraDataSourceTabSettings:Rows:Count - 1.
                    oRow:Cells["tab_index"]:Value = ultraDataSourceTabSettings:Rows:Count - 1.
                  END.
                   
                  /* associate the control list row to the tab order grid entry */
                  ultraGrid3:Rows[ultraGrid3:Rows:Count - 1]:Tag = oRow.
                  /* associate the tab order grid entry to the control list row */
                  oRow:Cells[1]:Tag = ultraGrid3:Rows[ultraGrid3:Rows:Count - 1].
                END.

                IF oOriginalControl:Controls:Count > 0  AND
                   NOT TYPE-OF(oOriginalControl, tools.IAgilityControl) THEN
                    THIS-OBJECT:AddChildrenToDesignSurface(oOriginalControl, oDesignerControl).
            END.
           
            /* set the tab stop of child controls to TRUE */
            IF VALID-OBJECT(oDesignerControl) AND
               NOT m_isRestoring              THEN
            DO:
              DO i = 0 TO oDesignerControl:Controls:Count - 1:
                oDesignerControl:Controls[i]:TabStop = oDesignerControl:TabStop.
              END.
            END.

            IF VALID-OBJECT(oDesignerControl) THEN
            DO:
              oDesignerControl:SizeChanged:SUBSCRIBE(ctl_SizeLocationChanged).
              oDesignerControl:LocationChanged:SUBSCRIBE(ctl_SizeLocationChanged).
            END.
        END.
       
        RETURN oDesignerControl.
       
    END METHOD.

/*------------------------------------------------------------------------------
   Purpose: This will arrange the control visibility of the controls
            immediately parented by the given container.                    
   Notes: You want to do this all at once, as changing the Index individually
          will cause all the other controls to recalculate its
          position.                   
------------------------------------------------------------------------------*/

METHOD PUBLIC VOID ApplyLayerPosition( INPUT parentContainer AS System.Windows.Forms.Control ):
 
  DEFINE VARIABLE oControl AS System.Windows.Forms.Control NO-UNDO.
  DEFINE VARIABLE cSectionName AS CHARACTER NO-UNDO.
  DEFINE BUFFER bufcustom_layout_detail FOR ttcustom_layout_detail.

        cSectionName = GetSectionName(parentContainer:Name).
       
  /* set z-index */
        FOR EACH bufcustom_layout_detail WHERE
                 bufcustom_layout_detail.section = cSectionName:
            /* this check will make sure that we only apply layout to the
               controls immediately parented by the parentContainer */
            IF parentContainer:Controls:ContainsKey(bufcustom_layout_detail.widget_name) THEN
            DO:
                oControl = CAST(parentContainer:Controls[bufcustom_layout_detail.widget_name], System.Windows.Forms.Control).
                parentContainer:Controls:SetChildIndex(oControl, 0). /* change to top as you go along  */ 
            END.
        END.

END METHOD.


  /*------------------------------------------------------------------------------
   Purpose:  This will apply the current value of the layout definition                  
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PUBLIC VOID ApplyLayout(  ):
 
  DEFINE VARIABLE i AS INTEGER NO-UNDO.
       
        DO i = 0 TO ControlsContainers:Count - 1:
            ApplyLayerPosition(CAST(ControlsContainers[i], System.Windows.Forms.Control)).
            ApplyLayoutToContainer(CAST(ControlsContainers[i], System.Windows.Forms.Control)).
        END.
       
END METHOD.

   
/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID ApplyLayoutToContainer( INPUT parentContainer AS System.Windows.Forms.Control ):
 
        DEFINE VARIABLE cWidgetName  AS CHARACTER                    NO-UNDO.
        DEFINE VARIABLE oControl     AS System.Windows.Forms.Control NO-UNDO.
        DEFINE VARIABLE i            AS INTEGER                      NO-UNDO.
  DEFINE VARIABLE j            AS INTEGER                      NO-UNDO.
  DEFINE VARIABLE cSectionName AS CHARACTER                    NO-UNDO.
 
  DEFINE BUFFER bufcustom_layout_detail FOR ttcustom_layout_detail.
    
/*         DumpTempTable(parentContainer). */
 
  IF TYPE-OF(parentContainer, System.Windows.Forms.ScrollableControl) THEN
    CAST(parentContainer, System.WIndows.Forms.ScrollableControl):AutoScrollPosition = NEW System.Drawing.Point(0, 0).
   
  parentContainer:SuspendLayout().
       
  cSectionName = GetSectionName(parentContainer:Name).
  CopyPropertiesFromTempTable(cSectionName, parentContainer).
 
  DO i = 0 TO parentContainer:Controls:Count - 1:
           
            oControl = parentContainer:Controls[i].
        
/*             DumpTempTable(oControl). */
      CopyPropertiesFromTempTable(cSectionName, oControl).
         AssignLabel(cSectionName, oControl).
        
            DO j = 0 TO oControl:Controls:Count - 1:
/*                 DumpTempTable(oControl:Controls[j]). */
                IF TYPE-OF(oControl, tools.IAgilityControl) THEN
            cWidgetName = oControl:Name + "+" + oControl:Controls[j]:Name.
          ELSE
            cWidgetName = oControl:Controls[j]:Name.
               
                IF NOT oControl:TabStop THEN
                    oControl:Controls[j]:TabStop = FALSE.
                ELSE
                FOR FIRST bufcustom_layout_detail WHERE
                    bufcustom_layout_detail.section      = cSectionName AND
                    bufcustom_layout_detail.widget_name  = cWidgetName:
                
              oControl:Controls[j]:TabStop  = bufcustom_layout_detail.tab_stop.   
                END.
            END.
              
            /*
            IF THIS-OBJECT:IsWidgetInFixedMode(cSectionName, oControl:Name) THEN
                oControl:Enabled = FALSE.
             */
  END.
       
        parentContainer:ResumeLayout().
       
END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

  METHOD PRIVATE VOID AssignLabel( INPUT ipcSectionName AS CHARACTER, INPUT ctrl AS System.Windows.Forms.Control ):
    DEFINE VARIABLE agilityCtrl AS tools.IAgilityControl       NO-UNDO.
    DEFINE VARIABLE i           AS INTEGER                      NO-UNDO.
    DEFINE VARIABLE cCaption    AS CHARACTER                    NO-UNDO.
 
    IF VALID-OBJECT(ctrl)                   AND
       TYPE-OF(ctrl, tools.IAgilityControl) THEN
    DO:
      agilityCtrl = CAST(ctrl, tools.IAgilityControl).
      cCaption = GetReadableName(ipcSectionName, ctrl:Name).             
      IF cCaption = ctrl:Name THEN 
         cCaption = agilityCtrl:LabelText.
        
      CAST(ctrl, tools.IAgilityControl):LabelText = cCaption.  
    END.                   
    ELSE IF VALID-OBJECT(ctrl)      AND
            ctrl:Controls:Count > 0 THEN
    DO i = 0 TO ctrl:Controls:Count - 1:
      IF TYPE-OF(ctrl:Controls[i], Infragistics.Win.Misc.UltraLabel) THEN
        DO:
          cCaption = GetReadableName(ipcSectionName, ctrl:Controls[i]:Name).
          cCaption = REPLACE(cCaption, "&", "&&").
          ctrl:Controls[i]:Text = cCaption.
        END.
        ELSE IF TYPE-OF(ctrl:Controls[i], Infragistics.Win.UltraWinEditors.UltraCheckEditor) THEN
          DO:
            cCaption = GetReadableName(ipcSectionName, ctrl:Controls[i]:Name).
            ctrl:Controls[i]:Text = cCaption.
          END.     
    END.
    ELSE IF VALID-OBJECT(ctrl) AND
        TYPE-OF(ctrl, Infragistics.Win.Misc.UltraLabel) THEN
      DO:
        cCaption = GetReadableName(ipcSectionName, ctrl:Name).
        cCaption = REPLACE(cCaption, "&", "&&").
        ctrl:Text = cCaption.
      END.   
      ELSE IF VALID-OBJECT(ctrl) AND
          TYPE-OF(ctrl, Infragistics.Win.UltraWinEditors.UltraCheckEditor) THEN
        DO:
          cCaption = GetReadableName(ipcSectionName, ctrl:Name).
          ctrl:Text = cCaption.
        END.
  END METHOD.


  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID btnDown_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
 
  MoveActiveRow(FALSE).

END METHOD.


  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID btnUp_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
 
  MoveActiveRow(TRUE).
     
END METHOD.


  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
    METHOD PRIVATE VOID btnUserID_Click( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
 
        DEFINE VARIABLE recUserCtl AS RECID   NO-UNDO.
        DEFINE VARIABLE dProdObj   AS DECIMAL NO-UNDO.
   
        IF cbAccessedType:Value:ToString() = "User Group" THEN
        DO:
            FOR FIRST gsc_product WHERE
                gsc_product.product_code = 'Agility'
                NO-LOCK:
     
                ASSIGN
                    dProdObj = gsc_product.product_obj.
     
                RUN sys/lusergrp.w
                    ( INPUT  dProdObj,
                    INPUT  0.0, /* userCatgObj = 0.0 will default to INTERNAL */
                    INPUT  TRUE, /* logical field by userid = no, by group = yes */
                    INPUT  "GROUP ID",
                    INPUT  "",
                    OUTPUT dProdObj ).
     
                IF dProdObj <> 0.0 AND
                   dProdObj <> ?   THEN
                    FOR EACH asc_product_user FIELDS(user_obj) WHERE
                        asc_product_user.asc_product_user_obj = dProdObj
                        NO-LOCK,
                        EACH gsm_user FIELDS(user_login_name) WHERE
                        gsm_user.user_obj = asc_product_user.user_obj
                        NO-LOCK:
     
                        ASSIGN
                            txtAccessedBy:Text = gsm_user.user_login_name
                            .
                    END. /* FOR EACH asc_product_user FIELDS(user_obj) WHERE */
   
            END. /* FOR FIRST gsc_product WHERE */
        END.
   
        ELSE IF cbAccessedType:Value:ToString() = "User" THEN
            DO:
                RUN luser-ct.w
                    (INPUT ?,
                    INPUT ?,
                    INPUT "customizeview.w",
                    OUTPUT recUserCtl).
                IF recUserCtl <> ? THEN
                DO:
                    FOR FIRST user_ctl WHERE
                        RECID(user_ctl) = recUserCtl
                        NO-LOCK:
                        ASSIGN
                            txtAccessedBy:Text = user_ctl.user_or_group_id.
                    END.
                END.
            END.

    END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID BuildChildrenGrid( INPUT parentContainer AS System.Windows.Forms.Control ):
 
        DEFINE VARIABLE oRow         AS Infragistics.Win.UltraWinDataSource.UltraDataRow NO-UNDO.
        DEFINE VARIABLE i            AS INTEGER                                          NO-UNDO.
        DEFINE VARIABLE cReadableName AS CHARACTER                                        NO-UNDO.
 
  ultraGrid2:BeginUpdate().
  ultraDataSourceChildTabSettings:Rows:Clear().
     
  IF VALID-OBJECT(parentContainer)      AND
     parentContainer:Controls:Count > 0 THEN
  DO i = 0 TO parentContainer:Controls:COUNT - 1:
      IF NOT TYPE-OF(parentContainer:Controls[i], System.Windows.Forms.Panel)       AND
         NOT TYPE-OF(parentContainer:Controls[i], Infragistics.Win.Misc.UltraLabel) THEN
      DO:
                oRow = ultraDataSourceChildTabSettings:Rows:Add().
         
          IF TYPE-OF(parentContainer, Progress.Windows.UserControl) THEN
                  cReadableName = GetReadableName(parentContainer:Name + "+" + parentContainer:Controls[i]:Name).
                ELSE
                  cReadableName = GetReadableName(parentContainer:Controls[i]:Name).
                 
          oRow:Item["widget_name"] = cReadableName.                               
                oRow:Item["tab_stop"] = parentContainer:Controls[i]:TabStop.
                oRow:Item["tab_index"] = parentContainer:Controls[i]:TabIndex.

                /*
                IF TYPE-OF(parentContainer:Controls[i], Infragistics.Win.Misc.UltraLabel) THEN
                    ultraGrid2:Rows[ultraGrid2:Rows:Count - 1]:Cells["tab_stop"]:Activation = Infragistics.Win.UltraWinGrid.Activation:Disabled.  
          */
                ultraGrid2:Rows[ultraGrid2:Rows:Count - 1]:Tag = parentContainer:Controls[i].
            END.   
  END.
       
        IF ultraGrid2:Rows:Count = 1 THEN
            ultraDataSourceChildTabSettings:Rows:Clear().
       
        ultraGrid2:EndUpdate().
       
        ultraGrid2:BeforeSortChange:UNSUBSCRIBE(THIS-OBJECT:ultraGrid2_BeforeSortChange).
        ultraGrid2:DisplayLayout:Bands[0]:Columns["tab_index"]:SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator:Ascending.
        ultraGrid2:BeforeSortChange:SUBSCRIBE(THIS-OBJECT:ultraGrid2_BeforeSortChange).        
END METHOD.


     /*------------------------------------------------------------------------------
            Purpose:                    
            Notes:                    
    ------------------------------------------------------------------------------*/

    METHOD PRIVATE VOID BuildValueList( INPUT ctrl AS System.Windows.Forms.Control,
                                        INPUT oRow AS Infragistics.Win.UltraWinGrid.UltraGridRow,
                                        INPUT lInitialize AS LOGICAL  ):
 
        DEFINE VARIABLE cMode AS CHARACTER                  NO-UNDO.
        DEFINE VARIABLE vl    AS Infragistics.Win.ValueList NO-UNDO.
    
        IF oRow:Cells["visible"]:Text <> ""        AND
           NOT LOGICAL(oRow:Cells["visible"]:Text) THEN
        DO:
            oRow:Cells["mode"]:ValueList = ?.
            IF lInitialize THEN
                oRow:Cells["mode"]:Value = "".
               
            oRow:Cells["mode"]:Activation = Infragistics.Win.UltraWinGrid.Activation:DISABLED.
        END.                  
        ELSE IF TYPE-OF(ctrl, tools.AgilityButton)               OR
                TYPE-OF(ctrl, Infragistics.Win.Misc.UltraButton) THEN
        DO:
            oRow:Cells["mode"]:ValueList = ?.
            oRow:Cells["mode"]:Value = "".                
            oRow:Cells["mode"]:Activation = Infragistics.Win.UltraWinGrid.Activation:DISABLED.
        END.                  
        ELSE IF TYPE-OF(ctrl, Infragistics.Win.UltraWinEditors.UltraCheckEditor) THEN
        DO:
            cMode = GetWidgetDefaultMode(ctrl:Name).
            oRow:Cells["mode"]:ValueList = ?.

            IF NOT THIS-OBJECT:IsWidgetInFixedMode( ctrl:Name) THEN
            DO:
              vl = NEW Infragistics.Win.ValueList().
              vl:ValueListItems:Add("Editable", "Editable").
              vl:ValueListItems:Add("Read-only", "Read-only").

              oRow:Cells["mode"]:ValueList = vl.
              oRow:Cells["mode"]:Activation = Infragistics.Win.UltraWinGrid.Activation:AllowEdit.
             
              IF lInitialize THEN
                oRow:Cells["mode"]:Value = cMode.           
            END.
            ELSE
            DO:
              oRow:Cells["mode"]:Value = "N/A".                
              oRow:Cells["mode"]:Activation = Infragistics.Win.UltraWinGrid.Activation:DISABLED.
            END.
        END.
        ELSE
        DO:
            cMode = GetWidgetDefaultMode(ctrl:Name).
            oRow:Cells["mode"]:ValueList = ?.

            IF NOT THIS-OBJECT:IsWidgetInFixedMode( ctrl:Name) THEN
            DO:
              vl = NEW Infragistics.Win.ValueList().
              vl:ValueListItems:Add("Editable", "Editable").
              vl:ValueListItems:Add("Read-only", "Read-only").
              vl:ValueListItems:Add("Required", "Required").
             
              oRow:Cells["mode"]:ValueList = vl.
              oRow:Cells["mode"]:Activation = Infragistics.Win.UltraWinGrid.Activation:AllowEdit.
             
              IF lInitialize THEN
                  oRow:Cells["mode"]:Value = cMode.
            END.
            ELSE
            DO:
              oRow:Cells["mode"]:Value = "N/A".                
              oRow:Cells["mode"]:Activation = Infragistics.Win.UltraWinGrid.Activation:DISABLED.
            END.
        END.
       
        oRow:Cells["mode"]:Refresh().
    
    END METHOD.


  /*------------------------------------------------------------------------------
   Purpose: Overrides the base form implementation                   
   Notes:                    
------------------------------------------------------------------------------*/

   METHOD PROTECTED OVERRIDE LOGICAL CheckForChanges( INPUT parentControl AS System.Windows.Forms.Control ):
 
  DEFINE VARIABLE result AS LOGICAL NO-UNDO.
       
        IF m_isNewRecord THEN
            result = TRUE.
        ELSE IF m_hasAccess THEN
        DO:
            THIS-OBJECT:UpdateDataSet().
           
            FOR EACH ttorigcustom_layout_detail WHERE
                     ttorigcustom_layout_detail.section = m_CurrentSectionName:
               
                FIND FIRST ttcustom_layout_detail WHERE
                           ttcustom_layout_detail.access_type       = ttorigcustom_layout_detail.access_type       AND
                           ttcustom_layout_detail.accessed_by       = ttorigcustom_layout_detail.accessed_by       AND
                           ttcustom_layout_detail.applies_to_branch = ttorigcustom_layout_detail.applies_to_branch AND
                           ttcustom_layout_detail.custom_layout     = ttorigcustom_layout_detail.custom_layout     AND
                           ttcustom_layout_detail.section           = ttorigcustom_layout_detail.section           AND
                           ttcustom_layout_detail.widget_name       = ttorigcustom_layout_detail.widget_name NO-ERROR.
               
                IF NOT AVAILABLE ttcustom_layout_detail THEN
                    result = TRUE.
                ELSE
                DO:
                    IF m_CurrentLiveParent:Name = ttorigcustom_layout_detail.widget_name THEN               
                        result = ttcustom_layout_detail.height <> ttorigcustom_layout_detail.height OR
                                 ttcustom_layout_detail.width  <> ttorigcustom_layout_detail.width.
                    ELSE IF ttcustom_layout_detail.visible THEN
                    DO:
                        /* panel or single control */
                        IF m_CurrentLiveParent:Controls:ContainsKey(ttorigcustom_layout_detail.widget_name) THEN
                            result = ttcustom_layout_detail.x_position <> ttorigcustom_layout_detail.x_position OR
                                     ttcustom_layout_detail.y_position <> ttorigcustom_layout_detail.y_position OR
                                     ttcustom_layout_detail.height     <> ttorigcustom_layout_detail.height     OR
                                     ttcustom_layout_detail.width      <> ttorigcustom_layout_detail.width      OR
                                     ttcustom_layout_detail.mode       <> ttorigcustom_layout_detail.mode       OR
                                     ttcustom_layout_detail.visible    <> ttorigcustom_layout_detail.visible    OR
                                     ttcustom_layout_detail.tab_index  <> ttorigcustom_layout_detail.tab_index  OR
                                     ttcustom_layout_detail.tab_stop   <> ttorigcustom_layout_detail.tab_stop.
                        /* panel controls */
                        ELSE
                            result = ttcustom_layout_detail.tab_stop <> ttorigcustom_layout_detail.tab_stop.
                        /*   
                        IF RESULT THEN
                          MESSAGE
                            m_CurrentLiveParent:Controls:ContainsKey(ttorigcustom_layout_detail.widget_name)
                            ttcustom_layout_detail.widget_name
                            ttcustom_layout_detail.x_position  ttorigcustom_layout_detail.x_position ":"
                            ttcustom_layout_detail.y_position  ttorigcustom_layout_detail.y_position ":"
                            ttcustom_layout_detail.height      ttorigcustom_layout_detail.height     ":"
                            ttcustom_layout_detail.width       ttorigcustom_layout_detail.width      ":"
                            ttcustom_layout_detail.mode        ttorigcustom_layout_detail.mode       ":"
                            ttcustom_layout_detail.visible     ttorigcustom_layout_detail.visible    ":"
                            ttcustom_layout_detail.tab_index   ttorigcustom_layout_detail.tab_index  ":"
                            ttcustom_layout_detail.tab_stop    ttorigcustom_layout_detail.tab_stop    VIEW-AS ALERT-BOX. */

                    END.
                    ELSE
                    DO:
                        result = ttcustom_layout_detail.visible <> ttorigcustom_layout_detail.visible.
                    END.
               END.
  
               IF result THEN
               DO:
                   LEAVE. 
               END.          
            END.
           
            DATASET dsCustomLayout:COPY-DATASET(DATASET dsOrigCustomLayout:HANDLE). /* reset */
        END.
           
        RETURN result. /* allow the CanClose logic */

END METHOD.

   /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
    METHOD PRIVATE VOID cbAccessedType_ValueChanged( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
    
     {waiton.i}
    
        CASE cbAccessedType:Value:ToString():
       
            WHEN "User" THEN
            DO:  
              IF {common\checktokensecurity.i &Module = '"Agility Main":U'
                                        &Program = 'LayoutEditor'
                                        &Token = 'allow_access_other_user_layouts'} THEN
                ASSIGN
                  txtAccessedBy:Text    = {getagilprop.i &PropList = 'currentUserLogin'}
                  txtAccessedBy:Enabled = {common\checktokensecurity.i &Module = '"Agility Main":U'
                                                                 &Program = 'LayoutEditor'
                                                                 &Token = 'allow_save_user_layouts'}
                  txtAccessedBy:Visible = YES
                  btnUserID:Visible     = {common\checktokensecurity.i &Module = '"Agility Main":U'
                                                                 &Program = 'LayoutEditor'
                                                                 &Token = 'allow_save_user_layouts'}
                  btnUserID:Enabled     = btnUserID:Visible.
       
              ELSE
                ASSIGN
                  txtAccessedBy:Text    = {getagilprop.i &PropList = 'currentUserLogin'}
                  txtAccessedBy:Enabled = NO
                  txtAccessedBy:Visible = YES
                  btnUserID:Visible     = NO
                  btnUserID:Enabled     = btnUserID:Visible.
            END.
            WHEN "User Group" THEN
            DO:
                ASSIGN
                    txtAccessedBy:Text    = ""
                    txtAccessedBy:Enabled = {common\checktokensecurity.i &Module = '"Agility Main":U'
                                                                   &Program = 'LayoutEditor'
                                                                   &Token = 'allow_save_all_group_layouts'}
                txtAccessedBy:Visible = YES
                btnUserID:Enabled     = txtAccessedBy:Enabled
                btnUserID:Visible     = txtAccessedBy:Enabled.
            END. /* WHEN "User Group" THEN */
       
            WHEN "All" THEN
            DO:
                ASSIGN
                    txtAccessedBy:Text    = ""
                    txtAccessedBy:Enabled = NO
                    txtAccessedBy:Visible = NO
                    btnUserID:Visible     = NO.
            END.
            OTHERWISE
                MESSAGE "PROGRAMMER ERROR - Access Type not handled."
                    VIEW-AS ALERT-BOX INFO BUTTONS OK.
        END.
       
        DEFINE VARIABLE lPrevious AS LOGICAL NO-UNDO.
       
        lPrevious = m_hasAccess.
        m_hasAccess = UpdateButtonsState().
       
        IF VALID-OBJECT(m_RootDesignerParent) THEN
        DO:
          IF lPrevious <> m_hasAccess THEN
          DO:
            LoadSectionLayout(m_CurrentLiveParent).
          END.
        END. 
                
        {waitoff.i}   
    END METHOD.


/*------------------------------------------------------------------------------
   Purpose: Use to get the parent container section name                   
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE CHARACTER GetSectionName( INPUT ipcWidgetName AS CHARACTER ):
 
  DEFINE VARIABLE cSectionName AS CHARACTER NO-UNDO.
        DEFINE BUFFER bufcustom_layout_detail FOR ttcustom_layout_detail.
       
        FIND FIRST bufcustom_layout_detail WHERE
                   bufcustom_layout_detail.widget_name = ipcWidgetName NO-ERROR.
       
        IF AVAILABLE bufcustom_layout_detail THEN      
          cSectionName = bufcustom_layout_detail.section.   
              
  RETURN cSectionName.

END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID GridSelectionChanged(  ):
 
        DEFINE VARIABLE oRow            AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
        DEFINE VARIABLE i               AS INTEGER                                    NO-UNDO.
        DEFINE VARIABLE j               AS INTEGER                                    NO-UNDO INIT 0.
        DEFINE VARIABLE iCount          AS INTEGER                                    NO-UNDO.
        DEFINE VARIABLE iVisibleCount   AS INTEGER                                    NO-UNDO.
        DEFINE VARIABLE oSelections     AS "System.Object[]"                          NO-UNDO.
 
  IF NOT m_IsSynchronizingSelection THEN
        DO:
          m_IsFromGridSelection = TRUE.
          m_IsSynchronizingSelection = TRUE.
         
          IF ultraGrid1:Selected:Rows:Count > 0 THEN
          DO: 
              iCount = ultraGrid1:Selected:Rows:Count.
              DO i = 0 TO iCount - 1:
                  oRow = ultraGrid1:Selected:Rows[i].
                 
                  IF UNBOX(oRow:Cells["visible"]:VALUE) THEN
                    iVisibleCount = iVisibleCount + 1.
              END.
             
              IF iVisibleCount > 0 THEN
              DO:           
                  oSelections = NEW "System.Object[]"(iVisibleCount).
                 
                  DO i = 0 TO iCount - 1:
                      oRow = ultraGrid1:Selected:Rows[i].
                     
                      IF UNBOX(oRow:Cells["visible"]:VALUE) THEN
                      DO:
                        oSelections:SetValue(oRow:Tag, j).
                        j = j + 1.                     
                      END.
                  END.                
                 
                  SetSelectedComponents(oSelections, System.ComponentModel.Design.SelectionTypes:REPLACE).
              END.
              ELSE
                  SetSelectedComponents(?, System.ComponentModel.Design.SelectionTypes:REPLACE).
          END.     
          ELSE
              SetSelectedComponents(?, System.ComponentModel.Design.SelectionTypes:REPLACE).
               
          m_IsFromGridSelection = FALSE.
          m_IsSynchronizingSelection = FALSE.
        END.

END METHOD.

    /*------------------------------------------------------------------------------
      Purpose:                    
      Notes:  oRow should be an ultraGrid1 row                  
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID RefreshChildTabSettings( INPUT oRow AS Infragistics.Win.UltraWinGrid.UltraGridRow ):
 
  IF VALID-OBJECT(oRow)                   AND
           VALID-OBJECT(oRow:Tag)               AND
     LOGICAL(oRow:Cells["tab_stop"]:Text) THEN
            BuildChildrenGrid(CAST(oRow:Tag, System.Windows.Forms.Control)).
        ELSE
            ultraDataSourceChildTabSettings:Rows:Clear().
       
        /* associate the currently selected designer control to the child tab settings */
       
       
        IF VALID-OBJECT(oRow)     AND
           VALID-OBJECT(oRow:Tag) THEN
            ASSIGN
                lblChildControls:Tag = oRow:Tag
                lblChildControls:Text = "Set Tab Stops for " + oRow:Cells["widget_name"]:Text.
        ELSE
            ASSIGN
                lblChildControls:Tag = ?
                lblChildControls:Text = "Set Tab Stops".           
END METHOD.


     /*------------------------------------------------------------------------------
            Purpose:                    
            Notes:                    
    ------------------------------------------------------------------------------*/

    METHOD PUBLIC Infragistics.Win.UltraWinEditors.UltraComboEditor CreateModeComboBox(  ):
 
        DEFINE VARIABLE cbMode          AS Infragistics.Win.UltraWinEditors.UltraComboEditor NO-UNDO.
        DEFINE VARIABLE oValueListItem1 AS Infragistics.Win.ValueListItem                    NO-UNDO.
        DEFINE VARIABLE oValueListItem2 AS Infragistics.Win.ValueListItem                    NO-UNDO.
        DEFINE VARIABLE oValueListItem3 AS Infragistics.Win.ValueListItem                    NO-UNDO.
       
        cbMode = NEW Infragistics.Win.UltraWinEditors.UltraComboEditor().
        cbMode:DropDownStyle = Infragistics.Win.DropDownStyle:DropDownList.
        oValueListItem1:DataValue = "Editable".
        oValueListItem1:DisplayText = "Editable".
        oValueListItem2:DataValue = "Read Only".
        oValueListItem2:DisplayText = "Read Only".
        oValueListItem3:DataValue = "Required".
        oValueListItem3:DisplayText = "Required".

        DEFINE VARIABLE arrayVar AS Infragistics.Win.ValueListItem EXTENT 3 NO-UNDO.
        arrayVar[1] = oValueListItem1.
        arrayVar[2] = oValueListItem2.
        arrayVar[3] = oValueListItem3.

        cbMode:Items:AddRange(arrayVar).
        cbMode:Size = NEW System.Drawing.Size(144, 21).
       
        RETURN cbMode.
       
    END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID CreateTabOrderView(  ):
 
  DEFINE VARIABLE i AS INTEGER NO-UNDO.
  DEFINE VARIABLE iNum AS INTEGER NO-UNDO.
  DEFINE VARIABLE ctrl AS System.Windows.Forms.Control NO-UNDO.
  DEFINE VARIABLE oTabOrderControl AS System.Windows.Forms.Label NO-UNDO.
 
  m_SelectionService:SelectionChanged:UNSUBSCRIBE(OnSelectionChanged).     
  m_DesignerHost:ComponentRemoved:UNSUBSCRIBE(OnComponentRemoved).
     
  IF NOT VALID-OBJECT(m_TabOrderView) THEN
     m_TabOrderView = NEW System.Collections.Specialized.ListDictionary().
    
  m_TabOrderView:Clear().
 
  iNum = m_RootDesignerParent:Controls:Count.
  DO i = 0 TO iNum - 1:
            /* Create a dummy designer entries for the tab order setting */
      ctrl = CAST(m_DesignerHost:CreateComponent(Progress.Util.TypeHelper:GetType("System.Windows.Forms.Label"), m_RootDesignerParent:Controls[0]:Name + "TabOrder"), System.Windows.Forms.Control).
            oTabOrderControl = CAST(ctrl, System.Windows.Forms.Label).
            oTabOrderControl:AutoSize = FALSE.
            oTabOrderControl:BorderStyle = System.Windows.Forms.BorderStyle:FixedSingle.
            oTabOrderControl:AutoEllipsis = TRUE.
            oTabOrderControl:TextAlign = System.Drawing.ContentAlignment:MiddleCenter.
            oTabOrderControl:Text = m_RootDesignerParent:Controls[0]:Name.
            oTabOrderControl:Size = m_RootDesignerParent:Controls[0]:Size.
      oTabOrderControl:Location = m_RootDesignerParent:Controls[0]:Location.
      oTabOrderControl:TabIndex = m_RootDesignerParent:Controls[0]:TabIndex.
     
      /* store the rows that needs to be rebuilt */
      oTabOrderControl:Tag = m_RootDesignerParent:Controls[0]:Tag.
     
      m_TabOrderView:Add(m_RootDesignerParent:Controls[0]:Name, oTabOrderControl).
     
      m_DesignerHost:DestroyComponent(m_RootDesignerParent:Controls[0]).
  END.

  DEFINE VARIABLE oEnumerator AS System.Collections.IDictionaryEnumerator NO-UNDO.
    
     oEnumerator = m_TabOrderView:GetEnumerator().
  DO WHILE oEnumerator:MoveNext():
      oTabOrderControl = CAST(oEnumerator:Value, System.Windows.Forms.Label).
      oTabOrderControl:Visible = TRUE.
      m_RootDesignerParent:Controls:Add(oTabOrderControl).
  END.
       
    END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID CreateCurrentView(  ):

        DEFINE VARIABLE oRow             AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
        DEFINE VARIABLE oEnumerator      AS System.Collections.IDictionaryEnumerator   NO-UNDO.
        DEFINE VARIABLE oTabOrderControl AS System.Windows.Forms.Label                 NO-UNDO.
        DEFINE VARIABLE oCurrentControl  AS System.Windows.Forms.Control               NO-UNDO.
        DEFINE VARIABLE oCurrentLocation AS System.Drawing.Point                       NO-UNDO.
        DEFINE VARIABLE oCurrentSize     AS System.Drawing.Size                        NO-UNDO.
 
  oEnumerator = m_TabOrderView:GetEnumerator().
  DO WHILE oEnumerator:MoveNext():
      oTabOrderControl = CAST(oEnumerator:Value, System.Windows.Forms.Label).
      oCurrentLocation = oTabOrderControl:Location.
      oCurrentSize = oTabOrderControl:Size.
      oRow = CAST(oTabOrderControl:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
      oRow:Cells["tab_index"]:Value = oTabOrderControl:TabIndex.
             
      m_DesignerHost:DestroyComponent(oTabOrderControl).
     
      oRow = CAST(oTabOrderControl:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
      oCurrentControl = AddComponentToSurface(oRow, FALSE).
      oCurrentControl:Location = oCurrentLocation.
      oCurrentControl:Size = oCurrentSize.
      DesignerControlUpdateVisual(oRow).
  END.
   
  m_TabOrderView:Clear().
   
        /* not sure why, it is saying the event was still SUBSCRIDED to */
        IF VALID-OBJECT(m_DesignerHost) THEN
  DO ON ERROR UNDO, LEAVE:
            m_DesignerHost:ComponentRemoved:SUBSCRIBE(OnComponentRemoved).
            CATCH e AS Progress.Lang.Error :             
            END CATCH.
        END.
       
        IF VALID-OBJECT(m_SelectionService) THEN
  DO ON ERROR UNDO, LEAVE:
            m_SelectionService:SelectionChanged:SUBSCRIBE(OnSelectionChanged).
            CATCH e AS Progress.Lang.Error :             
            END CATCH.
        END.   
END METHOD.

   /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID DeleteLayout(  ):
 
        DEFINE VARIABLE lDelete AS LOGICAL NO-UNDO.
        DEFINE BUFFER bufcustom_layout_header FOR ttcustom_layout_header.
       
        FIND FIRST bufcustom_layout_header NO-ERROR.
       
        IF AVAILABLE bufcustom_layout_header THEN
        DO:
            RUN sysinfo.p
              ( INPUT        "general_delete",
                INPUT        "this layout",
                INPUT-OUTPUT lDelete ).               
           
            IF lDelete THEN
            DO:
                RUN sys/sicustomlayoutdel.p  ON g-AppSrvr
                      ( INPUT sys.AgilitySession:SessionContextID,
                        INPUT bufcustom_layout_header.access_type,
                        INPUT bufcustom_layout_header.accessed_by,
                        INPUT bufcustom_layout_header.applies_to_branch,
                        INPUT bufcustom_layout_header.custom_layout,
                        INPUT bufcustom_layout_header.usage_level_1,
                        INPUT bufcustom_layout_header.usage_level_2,
                        INPUT bufcustom_layout_header.usage_level_3,
                        INPUT bufcustom_layout_header.usage_level_4,
                        OUTPUT DATASET dsErrorMsg).
               
                RUN sys/sicustomlayoutfetch.p ON g-AppSrvr (
                    INPUT sys.AgilitySession:SessionContextID,
                    INPUT "Most Specific",
                    INPUT "",
                    INPUT "",
                    INPUT THIS-OBJECT:ProfName,
                    INPUT "",
                    INPUT m_usageLevel1,
                    INPUT m_usageLevel2,
                    INPUT m_usageLevel3,
                    INPUT m_usageLevel4,
                    OUTPUT m_isDefault,
                    OUTPUT DATASET dsCustomLayout).
               
                DATASET dsOrigCustomLayout:COPY-DATASET(DATASET dsCustomLayout:HANDLE).
               
                FOR FIRST ttcustom_layout_header:
                  RUN usrlstaccd.p ON g-AppSrvr
                    ( INPUT "set",
                      INPUT        ttcustom_layout_header.usage_level_1,
                      INPUT        ttcustom_layout_header.usage_level_2,
                      INPUT        ttcustom_layout_header.usage_level_3,
                      INPUT        ttcustom_layout_header.usage_level_4,
                      INPUT-OUTPUT ttcustom_layout_header.custom_layout,
                      INPUT-OUTPUT ttcustom_layout_header.access_type,
                      INPUT-OUTPUT ttcustom_layout_header.accessed_by,
                      INPUT-OUTPUT ttcustom_layout_header.applies_to_branch).
                END.
                   
                RestoreLayout().
                branchSelector:Focus().
                m_isNewRecord = FALSE. /* just for the InitializeFields to display the layout name */
                InitializeFields().
               
                UpdateButtonsState().
            END. 
        END.

END METHOD.

        /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PUBLIC VOID DesignerControlShowHide( INPUT oRow AS Infragistics.Win.UltraWinGrid.UltraGridRow):
 
        DEFINE VARIABLE lChecked AS LOGICAL NO-UNDO.
 
  IF NOT m_IsSynchronizingProperties THEN
        DO:
            ultraGrid1:Selected:Rows:Clear().
                   
            lChecked = LOGICAL(oRow:Cells["visible"]:Text).
            IF lChecked THEN
            DO:
                AddComponentToSurface(oRow, TRUE).
                BuildValueList(CAST(oRow:Tag, System.Windows.Forms.Control), oRow, TRUE).
                DesignerControlUpdateVisual(oRow).
                       
                IF VALID-OBJECT(oRow:Tag)         AND
                   NOT m_IsSynchronizingSelection THEN
                DO:
                    SetSelectedComponent(CAST(oRow:Tag, System.Windows.Forms.Control), System.ComponentModel.Design.SelectionTypes:REPLACE). 
                END.
            END.
            ELSE
            DO:
                m_SelectionService:SelectionChanged:UNSUBSCRIBE(OnSelectionChanged).           
                THIS-OBJECT:RemoveComponentFromSurface(oRow).
                m_SelectionService:SelectionChanged:SUBSCRIBE(OnSelectionChanged).
                SetSelectedComponent(?, System.ComponentModel.Design.SelectionTypes:REPLACE).
            END.
        END.

END METHOD.

    /*------------------------------------------------------------------------------
            Purpose:                    
            Notes:                    
    ------------------------------------------------------------------------------*/

    METHOD PRIVATE VOID DesignerControlUpdateVisual( INPUT oRow AS Infragistics.Win.UltraWinGrid.UltraGridRow ):
 
        DEFINE VARIABLE ctrl AS System.Windows.Forms.Control     NO-UNDO.
 
  IF NOT m_IsSynchronizingProperties THEN
        DO:
            ctrl = CAST(oRow:Tag, System.Windows.Forms.Control).
            UpdateVisual(oRow:Cells["mode"]:Text, ctrl).
        END.
       
    END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID DumpTempTable( INPUT ctrl AS System.Windows.Forms.Control ):
 
/*         OUTPUT TO c:\stuff.txt APPEND.                                                                      */
/*                                                                                                             */
/*         PUT UNFORMATTED "CREATE ttcustom_layout_detail.~n".                                                 */
/*         PUT UNFORMATTED "ASSIGN~n".                                                                         */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.access_type = 'All'~n".                                   */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.accessed_by = ''~n".                                      */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.applies_to_branch = ''~n".                           */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.custom_layout = 'Sales Order Layout'~n".                  */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.section = 'HeaderSection'~n".                             */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.usage_level_1 = 'Sales Order Entry'~n".                   */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.widget_name = '" + ctrl:Name + "'~n".                     */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.x_position = " + STRING(ctrl:Left) + "~n".                */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.y_position = " + STRING(ctrl:Top) + "~n".                 */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.tab_stop = " + STRING(ctrl:TabStop, "TRUE/FALSE") + "~n". */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.tab_index = " + STRING(ctrl:TabIndex) + "~n".             */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.width = " + STRING(ctrl:Width) + "~n".                    */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.height = " + STRING(ctrl:Height) + "~n".                  */
/*         PUT UNFORMATTED "  ttcustom_layout_detail.mode = 'Editable'.~n~n".                                  */
/*                                                                                                             */
/*         OUTPUT CLOSE.                                                                                       */

END METHOD.


  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE LOGICAL IsLayoutUsable( INPUT cAccessType AS CHARACTER ):
 
  DEFINE VARIABLE lOkToUpdate AS LOGICAL NO-UNDO.
  DEFINE BUFFER bufcustom_layout_header FOR ttcustom_layout_header.
 
  FIND FIRST bufcustom_layout_header NO-ERROR.
 
  /* check if the user can access the setting */
        CASE cAccessType:

            WHEN "User" THEN
            DO:
                DEFINE VARIABLE cCurrentUser   AS CHARACTER   NO-UNDO.
               
                ASSIGN
                    cCurrentUser = {getagilprop.i &PropList="'currentUserLogin'"}
                    lOkToUpdate  = bufcustom_layout_header.accessed_by = cCurrentUser.
            END.
            WHEN "User Group" THEN
            DO:
                DEFINE VARIABLE cSecurityGroups   AS CHARACTER NO-UNDO.
                DEFINE VARIABLE iSecGroupCounter  AS INTEGER   NO-UNDO.
                DEFINE VARIABLE dSecurityGroupObj AS DECIMAL   NO-UNDO.

                ASSIGN
                    cSecurityGroups = {getagilprop.i &PropList="'SecurityGroups'":U}.

                IF cSecurityGroups <> "" THEN
                DO-BLK:
                DO iSecGroupCounter = 1 TO NUM-ENTRIES(cSecurityGroups,CHR(4)) WHILE lOkToUpdate = NO:

                    dSecurityGroupObj = DECIMAL(ENTRY(iSecGroupCounter,cSecurityGroups,CHR(4))).

                    IF CAN-FIND(FIRST user_ctl WHERE
                        user_ctl.user_obj         = dSecurityGroupObj AND
                        user_ctl.user_or_group_id = bufcustom_layout_header.accessed_by
                        NO-LOCK) THEN
                        lOkToUpdate = YES.
 
                END. /* IF cSecurityGroups <> "" THEN */

            END. /* WHEN "User Group" THEN */

            OTHERWISE
            ASSIGN
                lOkToUpdate = YES.

        END CASE. /* CASE iopcAccessType: */
       
        /* check the parent window is same branch as the current layout */
        IF NOT VALID-OBJECT(THIS-OBJECT:FormInLayoutMode) THEN
          lOkToUpdate = bufcustom_layout_header.applies_to_branch = "".
        ELSE IF lOkToUpdate THEN
        DO:
          IF TYPE-OF(THIS-OBJECT:FormInLayoutMode, sys.AgilityWindowBase)   AND
             bufcustom_layout_header.applies_to_branch <> "" THEN
          DO:
            lOkToUpdate = CAST(THIS-OBJECT:FormInLayoutMode, sys.AgilityWindowBase):ProfName = bufcustom_layout_header.applies_to_branch.
          END.
          ELSE
              lOkToUpdate = bufcustom_layout_header.applies_to_branch = "".
        END.
       
        RETURN lOkToUpdate.
        
END METHOD.


    /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID LoadSectionLayout( INPUT oLiveParentControl AS System.Windows.Forms.Control ):
 
        ultraGrid1:BeginUpdate().
  ultraGrid2:BeginUpdate().
  ultraGrid3:BeginUpdate().
 
        RefreshChildTabSettings(?).
        SetSelectedComponent(?, System.ComponentModel.Design.SelectionTypes:REPLACE).

  IF VALID-OBJECT(m_SelectionService) THEN
      m_SelectionService:SelectionChanged:UNSUBSCRIBE(OnSelectionChanged).
           
        IF VALID-OBJECT(m_RootDesignerParent) THEN
            m_RootDesignerParent:SizeChanged:UNSUBSCRIBE(ctl_SizeLocationChanged).
         
     IF VALID-OBJECT(m_DesignerHost) THEN
            m_DesignerHost:ComponentRemoved:UNSUBSCRIBE(OnComponentRemoved).
           
  IF VALID-OBJECT(m_SelectionService) THEN
            DELETE OBJECT m_SelectionService.
           
        IF VALID-OBJECT(m_RootDesignerParent) THEN
        DO:
            ultraDataSource1:Rows:Clear().
            ultraDataSourceTabSettings:Rows:Clear().
            ultraDataSourceChildTabSettings:Rows:Clear().
            EMPTY TEMP-TABLE ttControls.
            m_DesignerHost:DestroyComponent(m_RootDesignerParent).
            DELETE OBJECT m_RootDesignerParent.
        END.
         
     IF VALID-OBJECT(m_DesignerHost) THEN
        DO:
            m_DesignerHost:Dispose().
            DELETE OBJECT m_DesignerHost.
        END.
       
        m_CurrentLiveParent = oLiveParentControl.
        m_CurrentSectionName = GetSectionName(oLiveParentControl:Name).
       
        /* Will set m_RootDesignerParent to either a form(updatable) or a usercontrol(non-updatable) */
        InitializeDesigner(oLiveParentControl).
        ultraGrid1:Selected:Rows:Clear().
        ultraGrid1:ActiveRow = ?.
        ultraGrid2:Selected:Rows:Clear().
        ultraGrid2:ActiveRow = ?.        
        ultraGrid3:Selected:Rows:Clear().
        ultraGrid3:ActiveRow = ?.       
        ApplyLayerPosition(m_RootDesignerParent).       
      
        /* we are preventing manual sort on the Tab Order grid once shown inside the BeforeSortChange */
        THIS-OBJECT:ultraGrid3:BeforeSortChange:UNSUBSCRIBE(THIS-OBJECT:ultraGrid3_BeforeSortChange).
        ultraGrid3:DisplayLayout:Bands[0]:Columns["tab_index"]:SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator:Ascending.
        THIS-OBJECT:ultraGrid3:BeforeSortChange:SUBSCRIBE(THIS-OBJECT:ultraGrid3_BeforeSortChange).       
       
        btnUp:Enabled = FALSE.
     btnDown:Enabled = FALSE.
       
        ultraGrid1:DisplayLayout:Bands[0]:Columns["widget_name"]:SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator:Ascending.

        ultraGrid1:EndUpdate().
        ultraGrid2:EndUpdate().
        ultraGrid3:EndUpdate().       
       
        /* The engine always has a selected control in memory. Replace it with a control found
           in the current section, so the engine stop referencing the previously selected control. */
        IF m_hasAccess THEN
        DO:
          IF m_RootDesignerParent:Controls:COUNT > 0 THEN
            SetSelectedComponent(m_RootDesignerParent:Controls[0], System.ComponentModel.Design.SelectionTypes:REPLACE).
          ELSE
            SetSelectedComponent(m_RootDesignerParent, System.ComponentModel.Design.SelectionTypes:REPLACE).
        END.
        ELSE
          SetSelectedComponent(LayoutEditor_Fill_Panel, System.ComponentModel.Design.SelectionTypes:REPLACE).
       
        SetSelectedComponent(?, System.ComponentModel.Design.SelectionTypes:REPLACE).

END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID MoveActiveRow( INPUT lUpDirection AS LOGICAL ):

        DEFINE VARIABLE iDestinationRow AS INTEGER                                    NO-UNDO.
        DEFINE VARIABLE iTabIndex       AS INTEGER                                    NO-UNDO.
        DEFINE VARIABLE oControlRow     AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
 
        IF VALID-OBJECT(ultraGrid3:ActiveRow) THEN
        DO:
          IF lUpDirection THEN
           iDestinationRow = ultraGrid3:ActiveRow:Index - 1.
       ELSE
           iDestinationRow = ultraGrid3:ActiveRow:Index + 1.
        
          iTabIndex = ultraGrid3:Rows[iDestinationRow]:Cells["tab_index"]:Value.
         
          /* Update tab index values and make the worker ultragrid1 current */
          ultraGrid3:Rows[iDestinationRow]:Cells["tab_index"]:Value = ultraGrid3:ActiveRow:Cells["tab_index"]:Value.
          oControlRow = CAST(ultraGrid3:Rows[iDestinationRow]:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
          oControlRow:Cells["tab_index"]:Value = ultraGrid3:ActiveRow:Cells["tab_index"]:Value.
         
          ultraGrid3:ActiveRow:Cells["tab_index"]:Value = iTabIndex.
          oControlRow = CAST(ultraGrid3:ActiveRow:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
          oControlRow:Cells["tab_index"]:Value = ultraGrid3:ActiveRow:Cells["tab_index"]:Value.
         
          /* reposition based on the column sort indicator */
          ultraGrid3:ActiveRow:RefreshSortPosition().
         
          btnUp:Enabled = ultraGrid3:ActiveRow:Index <> 0.
       btnDown:Enabled = ultraGrid3:ActiveRow:Index <> ultraGrid3:Rows:Count - 1.
        END.  
END METHOD.


  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID oRootContainer_KeyDown( INPUT sender AS System.Object, INPUT e AS System.Windows.Forms.KeyEventArgs  ):
           
  IF Progress.Util.EnumHelper:AreEqual(e:KeyCode, System.Windows.Forms.Keys:Delete) THEN
  DO:
      /* The designer is not firing the KeyDown event, so exclude controls where we don't want the
         delete key to be applied. */
      IF NOT branchSelector:Focused AND
         NOT txtCustomLayout:Focused AND
         NOT cbAccessedType:Focused AND
         NOT txtAccessedBy:Focused AND
         NOT btnUserID:Focused AND
         NOT txtX:Focused AND
         NOT txtY:Focused AND
         NOT txtWidth:Focused AND
         NOT txtHeight:Focused THEN
      DO:  
          m_SelectionService:SelectionChanged:UNSUBSCRIBE(OnSelectionChanged).
          /* m_MenuService:GlobalInvoke(StandardCommands:Delete). */
         
          DEFINE VARIABLE oSelectionService AS SelectionService                                 NO-UNDO.
                DEFINE VARIABLE oSelection        AS "System.Object[]"                                NO-UNDO.
                DEFINE VARIABLE oControlRow       AS Infragistics.Win.UltraWinGrid.UltraGridRow       NO-UNDO.
                DEFINE VARIABLE oDesignerControl  AS System.Windows.Forms.Control                     NO-UNDO.
                DEFINE VARIABLE i                 AS INTEGER                                          NO-UNDO.
               
          oSelectionService = CAST(m_ServiceContainer:GetService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.ISelectionService")), SelectionService).
                oSelection = NEW "System.Object[]"(oSelectionService:SelectionCount).
                oSelectionService:GetSelectedComponents():CopyTo(oSelection, 0).               
              
                DO i = oSelection:Length - 1 TO 0 BY -1:
                  IF VALID-OBJECT(oSelection:GetValue(i)) THEN
                  DO:
                    oDesignerControl = CAST(oSelection:GetValue(i), System.Windows.Forms.Control).
                    oControlRow = CAST( oDesignerControl:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow ).
                    RemoveComponentFromSurface(oControlRow).
                  END.                  
                END.
         
          m_SelectionService:SelectionChanged:SUBSCRIBE(OnSelectionChanged).
          SetSelectedComponent(?).
      END.
  END.

END METHOD.


/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID ultraGrid1_AfterSelectChange( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs ):
 
        GridSelectionChanged().
      
END METHOD.


/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID ultraGrid2_BeforeSortChange( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinGrid.BeforeSortChangeEventArgs ):
 
  e:Cancel = TRUE.

END METHOD.


  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID ultraGrid2_CellChange( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinGrid.CellEventArgs ):
 
  DEFINE VARIABLE ctrl AS System.Windows.Forms.Control NO-UNDO.
 
  CASE e:Cell:Column:Key:
            WHEN "tab_stop" THEN
            DO:
                ctrl = CAST(e:Cell:Row:Tag, System.Windows.Forms.Control).
                ctrl:TabStop = LOGICAL(e:Cell:Text).
            END.
        END CASE.

END METHOD.


/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID ultraGrid3_AfterRowActivate( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
     DEFINE VARIABLE ctrl AS System.Windows.Forms.Control NO-UNDO.
     DEFINE VARIABLE oRow AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
    
     oRow = CAST(ultraGrid3:ActiveRow:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
     ctrl = CAST(oRow:Tag, system.Windows.Forms.Control).
    
     IF NOT m_IsSynchronizingSelection THEN
     DO:
         m_IsSynchronizingSelection = TRUE.
            SetSelectedComponent(ctrl).
            m_IsSynchronizingSelection = FALSE.
        END.
                       
  RefreshChildTabSettings(oRow).
    
        btnUp:Enabled = ultraGrid3:ActiveRow:Index <> 0 AND m_hasAccess.
     btnDown:Enabled = ultraGrid3:ActiveRow:Index <> ultraGrid3:Rows:Count - 1 AND m_hasAccess.
    
END METHOD.


/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID ultraGrid3_BeforeSortChange( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinGrid.BeforeSortChangeEventArgs ):
 
  e:Cancel = TRUE.

END METHOD.


  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID ultraGrid3_CellChange( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinGrid.CellEventArgs ):
 
  CASE e:Cell:Column:Key:
      WHEN "tab_stop" THEN
      DO:
          DEFINE VARIABLE oRow AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
         
          /* we want the ultraGrid1 to be current */
          oRow = CAST(e:Cell:Row:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
          oRow:Cells["tab_stop"]:Value = e:Cell:Text.
          RefreshChildTabSettings(oRow).
      END.
        END CASE.
       
END METHOD.


/*------------------------------------------------------------------------------
    Purpose:                    
    Notes:                    
------------------------------------------------------------------------------*/

  METHOD PRIVATE VOID UpdateVisual( INPUT ipcMode AS CHARACTER, INPUT ctrl AS System.Windows.Forms.Control ):
   
    DEFINE VARIABLE lbl         AS Infragistics.Win.Misc.UltraLabel NO-UNDO.
    DEFINE VARIABLE i           AS INTEGER                          NO-UNDO.
    DEFINE VARIABLE lDesignMode AS LOGICAL                          NO-UNDO.
    DEFINE VARIABLE ctrlParent  AS System.Windows.Forms.Control     NO-UNDO.
    DEFINE VARIABLE cTagValue   AS CHARACTER                        NO-UNDO.
                 
    IF VALID-OBJECT(ctrl) THEN
    DO:
      IF THIS-OBJECT:IsWidgetInFixedMode( ctrl:Name) THEN
        ipcMode = GetWidgetDefaultMode(ctrl:Name).

      ctrlParent = ctrl:Parent.
      DO WHILE VALID-OBJECT(ctrlParent):
        IF ctrlParent:Name = "RootElement" THEN
        DO:
          lDesignMode = TRUE.
          LEAVE.
        END.
        ELSE
          ctrlParent = ctrlParent:Parent.
      END.
     
      IF TYPE-OF(ctrl, tools.IAgilityControl) THEN
      DO:
          CASE ipcMode:
            WHEN "Editable" OR
            WHEN "" THEN
            DO:
              CAST(ctrl, tools.IAgilityControl):ReadOnly = FALSE.
              CAST(ctrl, tools.IAgilityControl):Required = FALSE.
            END.
            WHEN "Read-only" THEN
            DO:
              CAST(ctrl, tools.IAgilityControl):ReadOnly = TRUE.
              CAST(ctrl, tools.IAgilityControl):Required = FALSE.
            END.           
            WHEN "Required" THEN
            DO:
              CAST(ctrl, tools.IAgilityControl):ReadOnly = FALSE.
              CAST(ctrl, tools.IAgilityControl):Required = TRUE.
            END.
          END.       
      END.
      ELSE
      DO:                    
        IF ctrl:Controls:Count > 0                   OR
          TYPE-OF(ctrl, System.Windows.Forms.Panel) THEN
        DO:
          /* Label */
          DO i = 0 TO ctrl:Controls:Count - 1:
            IF TYPE-OF(ctrl:Controls[i], Infragistics.Win.Misc.UltraLabel) THEN
            DO:
              lbl = CAST(ctrl:Controls[i], Infragistics.Win.Misc.UltraLabel).
                         
              CASE ipcMode:
                WHEN "Editable" OR
                WHEN "" THEN
                  lbl:ForeColor = ?.
                WHEN "Read-only" THEN
                  lbl:ForeColor = ?.            
                WHEN "Required" THEN
                  lbl:ForeColor = System.Drawing.Color:Red.
              END.
            END.
          END.
       
          /* Editor */
          DO i = 0 TO ctrl:Controls:Count - 1:
            cTagValue = ctrl:Controls[i]:Tag.
                 
            IF TYPE-OF(ctrl:Controls[i], Infragistics.Win.UltraWinEditors.UltraCheckEditor) THEN
            DO:
              IF lDesignMode THEN
              DO:
                IF ipcMode <> "Read-only"    AND
                  cTagValue <> "ReadOnly" THEN
                  ctrl:Controls[i]:ForeColor = ?.
                ELSE
                  ctrl:Controls[i]:ForeColor = System.Drawing.Color:Gray.
              END.
              ELSE
                ctrl:Controls[i]:Enabled = ipcMode <> "Read-only" AND
                  cTagValue <> "ReadOnly".
            END.
            ELSE IF TYPE-OF(ctrl:Controls[i], Infragistics.Win.Misc.UltraButton) THEN
              DO:
                IF
                  INDEX(ctrl:Controls[i]:Name, "Locator") > 0 OR
                  INDEX(ctrl:Controls[i]:Name, "Recalc")  > 0 THEN
                  ctrl:Controls[i]:Visible = ipcMode <> "Read-only".
              END.
              ELSE
              DO ON ERROR UNDO,LEAVE:
                IF ipcMode = "Read-only"                          OR
                  cTagValue = "ReadOnly" THEN                                                  
                  ctrl:Controls[i]:GetType():GetProperty("ReadOnly"):SetValue(ctrl:Controls[i], TRUE, ?).
                ELSE
                  ctrl:Controls[i]:GetType():GetProperty("ReadOnly"):SetValue(ctrl:Controls[i], FALSE, ?).
                
                CATCH e AS Progress.Lang.Error :                                      
                END CATCH.                          
              END.                       
          END.
          
        END.
        /* we don't want visual to be applied directly to controls that are not
          immediately parent by the designer form or the current line container */
        ELSE IF Progress.Util.TypeHelper:Equals(ctrl:Parent, m_RootDesignerParent) OR
            Progress.Util.TypeHelper:Equals(ctrl:Parent, m_CurrentLiveParent) THEN
          DO: /* non-parented control */
                 
            cTagValue = ctrl:Tag.
             
            IF TYPE-OF(ctrl, Infragistics.Win.UltraWinEditors.UltraCheckEditor) THEN
            DO:
              IF lDesignMode THEN
              DO:
                IF ipcMode <> "Read-only"    AND
                  cTagValue <> "ReadOnly" THEN
                  ctrl:ForeColor = ?.
                ELSE
                  ctrl:ForeColor = System.Drawing.Color:Gray.
              END.
              ELSE
                ctrl:Enabled = ipcMode <> "Read-only" AND
                  cTagValue <> "ReadOnly".
            END.
            ELSE IF TYPE-OF(ctrl, Infragistics.Win.Misc.UltraButton) THEN
              DO:
                IF
                  INDEX(ctrl:Name, "Locator") > 0 OR
                  INDEX(ctrl:Name, "Recalc")  > 0 THEN
                  ctrl:Visible = ipcMode <> "Read-only".
              END.
              ELSE
              DO ON ERROR UNDO,LEAVE:                                                 
                IF ipcMode = "Read-only"              OR
                  cTagValue = "ReadOnly" THEN                                                  
                  ctrl:GetType():GetProperty("ReadOnly"):SetValue(ctrl:Controls[i], TRUE, ?).
                ELSE
                  ctrl:GetType():GetProperty("ReadOnly"):SetValue(ctrl:Controls[i], FALSE, ?).
                             
                CATCH e AS Progress.Lang.Error :                                      
                END CATCH.                          
              END. 
          END.
      END.
    END.
  END METHOD.
   
    /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID InitializeFields(  ):
 
  DEFINE BUFFER bufcustom_layout_header FOR ttcustom_layout_header.
 
  /* Read default value from the dataset is present. */
        FOR FIRST bufcustom_layout_header:
            /* Try will fire the value-changed event of Access Type */
            cbAccessedType:Value = bufcustom_layout_header.access_type.

            branchSelector:ProfName = bufcustom_layout_header.applies_to_branch.
           
            IF m_isNewRecord AND
               m_isDefault   THEN
                txtCustomLayout:Text = "".
            ELSE       
                txtCustomLayout:Text = bufcustom_layout_header.custom_layout.
           
            txtAccessedBy:TEXT  = bufcustom_layout_header.accessed_by.           
        END.
             
END METHOD.
   
    /*------------------------------------------------------------------------------
   Purpose:  This is called during the design surface building                  
   Notes:                    
------------------------------------------------------------------------------*/
METHOD PRIVATE VOID CopyPropertiesFromTempTable( INPUT src AS System.Windows.Forms.Control, INPUT dest AS System.Windows.Forms.Control, INPUT lExcludePositionAndSize AS LOGICAL ):
 
  DEFINE BUFFER bufcustom_layout_detail FOR ttcustom_layout_detail.
    
  DO ON ERROR UNDO, LEAVE:
      FIND FIRST bufcustom_layout_detail WHERE
                 bufcustom_layout_detail.section     = m_CurrentSectionName AND
                    bufcustom_layout_detail.widget_name = dest:Name NO-ERROR.
                
      /* default from existing controls */
            ASSIGN              
                dest:Name     = src:Name               
                dest:TabIndex = src:TabIndex
                dest:TabStop  = src:TabStop
                dest:Tag      = src:Tag.
               
            IF lExcludePositionAndSize THEN
            DO:
                ASSIGN 
                    dest:Left     = 10
                    dest:Top      = 10
                    dest:Width    = 290
                    dest:Height   = 21.
                   
                FOR FIRST ttdefcustom_layout_detail WHERE
                          ttdefcustom_layout_detail.section     = m_CurrentSectionName AND
                          ttdefcustom_layout_detail.widget_name = src:Name:
                    ASSIGN
                        dest:Width    = ttdefcustom_layout_detail.width
                        dest:Height   = ttdefcustom_layout_detail.height.
                END.
            END.           
            ELSE
                ASSIGN 
                    dest:Location = src:Location
                    dest:Size     = src:Size.
           
                                                   
            IF AVAILABLE(bufcustom_layout_detail) THEN
            DO:
                IF NOT lExcludePositionAndSize THEN
                    ASSIGN 
                        dest:Left     = bufcustom_layout_detail.x_position
                        dest:Top      = bufcustom_layout_detail.y_position
                        dest:Width    = bufcustom_layout_detail.width
                        dest:Height   = bufcustom_layout_detail.height.
               
                ASSIGN
                    dest:TabStop  = bufcustom_layout_detail.tab_stop
                    dest:TabIndex = bufcustom_layout_detail.tab_index
                    dest:Visible  = bufcustom_layout_detail.visible.
               
                IF Progress.Util.TypeHelper:Equals(dest:Parent, m_RootDesignerParent) THEN    
                    UpdateVisual(bufcustom_layout_detail.mode, dest).    
            END.
           
            /* these are static settings from design-time */
            ASSIGN       
          dest:Dock   = src:Dock
                dest:Anchor = src:Anchor
                dest:Padding = src:Padding.
           
            IF TYPE-OF(src, Infragistics.Win.Misc.UltraLabel) OR
               TYPE-OF(src, Infragistics.Win.Misc.UltraButton) OR
               TYPE-OF(src, System.Windows.Forms.Label) OR
               TYPE-OF(src, System.Windows.Forms.Button) OR
               TYPE-OF(src, Infragistics.Win.UltraWinEditors.UltraCheckEditor) OR
               TYPE-OF(src, System.Windows.Forms.CheckBox) THEN
                dest:Text = src:Text.
     
      IF TYPE-OF(src, tools.IAgilityControl) THEN
      DO:
        CAST(dest, tools.IAgilityControl):LabelText = CAST(src, tools.IAgilityControl):LabelText.
        CAST(dest, tools.IAgilityControl):AllowManualUpdate = CAST(src, tools.IAgilityControl):AllowManualUpdate.
      END.
     
            IF TYPE-OF(src, tools.AgilityMaskedTextBox) THEN
      DO:
        CAST(dest, tools.AgilityMaskedTextBox):EditorInputMask = CAST(src, tools.AgilityMaskedTextBox):EditorInputMask.
      END.
     
            DEFINE VARIABLE i AS INTEGER NO-UNDO.
      IF TYPE-OF(src, tools.IAgilityControl) THEN 
      DO i = 0 TO src:Controls:Count - 1:
              CopyPropertiesFromTempTable(src:Controls[i]).
            END.
             
            CATCH e AS Progress.Lang.Error :
              MESSAGE e:GetMessage(1) VIEW-AS ALERT-BOX.
            END CATCH.
        END.

END METHOD.

   /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
METHOD PRIVATE VOID CopyPropertiesFromTempTable( INPUT dest AS System.Windows.Forms.Control ):
    
     CopyPropertiesFromTempTable(m_CurrentSectionName, dest).

END METHOD.

   /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
METHOD PRIVATE VOID CopyPropertiesFromTempTable( INPUT ipcSectionName AS CHARACTER, INPUT dest AS System.Windows.Forms.Control ):
    
        DEFINE BUFFER bufcustom_layout_detail FOR ttcustom_layout_detail.
     DEFINE VARIABLE cWidgetName AS CHARACTER NO-UNDO.
    
  IF TYPE-OF(dest:Parent, tools.IAgilityControl) THEN
          cWidgetName = dest:Parent:Name + "+" + dest:Name.
        ELSE
          cWidgetName = dest:Name.                          
 
  FIND FIRST bufcustom_layout_detail WHERE
             bufcustom_layout_detail.section     = ipcSectionName AND
                bufcustom_layout_detail.widget_name = cWidgetName NO-ERROR.
 
  IF AVAILABLE bufcustom_layout_detail THEN
  DO:
          IF TYPE-OF(dest:Parent, tools.IAgilityControl) THEN
      ASSIGN
        dest:TabStop  = bufcustom_layout_detail.tab_stop.
    ELSE
    DO:
      ASSIGN 
              dest:Left     = bufcustom_layout_detail.x_position
              dest:Top      = bufcustom_layout_detail.y_position
              dest:Width    = bufcustom_layout_detail.width
              dest:Height   = bufcustom_layout_detail.height
              dest:TabStop  = bufcustom_layout_detail.tab_stop
              dest:TabIndex = bufcustom_layout_detail.tab_index
              dest:Visible  = bufcustom_layout_detail.visible.
          END.
                                 
          UpdateVisual(bufcustom_layout_detail.mode, dest).                   
        END.

END METHOD.

    METHOD PRIVATE VOID AssignAdditionalProperties(INPUT dest AS System.Windows.Forms.Control, INPUT ipcPropertyValue AS CHARACTER):
      
       DEFINE VARIABLE i           AS INTEGER   NO-UNDO.
       DEFINE VARIABLE iNumEntries AS INTEGER   NO-UNDO.
       DEFINE VARIABLE cPair       AS CHARACTER NO-UNDO.
      
       IF ipcPropertyValue <> "" AND
          VALID-OBJECT(dest)     THEN
       DO:
         iNumEntries = NUM-ENTRIES(ipcPropertyValue, "^").
        
         DO i = 1 TO iNumEntries:
           cPair = ENTRY(i, ipcPropertyValue, "^").
          
           CASE ENTRY(3, cPair, ":"):
               WHEN "LOGICAL" THEN
                   dest:GetType():GetProperty(ENTRY(1, cPair, ":")):SetValue(dest, BOX(LOGICAL(ENTRY(2, cPair, ":"))), ?).
               WHEN "INTEGER" THEN
                   dest:GetType():GetProperty(ENTRY(1, cPair, ":")):SetValue(dest, BOX(INT(ENTRY(2, cPair, ":"))), ?).
               WHEN "DECIMAL" THEN
                   dest:GetType():GetProperty(ENTRY(1, cPair, ":")):SetValue(dest, BOX(DEC(ENTRY(2, cPair, ":"))), ?).
               OTHERWISE
                   dest:GetType():GetProperty(ENTRY(1, cPair, ":")):SetValue(dest, BOX(ENTRY(2, cPair, ":")), ?).
           END CASE.
         END.
       END.
      
    END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID ctl_SizeLocationChanged( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
 
        DEFINE VARIABLE oSelectionService AS SelectionService             NO-UNDO.
        DEFINE VARIABLE oPrimarySelection AS System.Windows.Forms.Control NO-UNDO.
        DEFINE VARIABLE oCurrentControl   AS System.Windows.Forms.Control NO-UNDO.
       
  oSelectionService = CAST(m_ServiceContainer:GetService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.ISelectionService")), SelectionService).
        oPrimarySelection = CAST(oSelectionService:PrimarySelection, System.Windows.Forms.Control).
        oCurrentControl = CAST(sender, System.Windows.Forms.Control).
       
        IF VALID-OBJECT(oPrimarySelection)                                     AND
           Progress.Util.TypeHelper:Equals(oPrimarySelection, oCurrentControl) AND
           NOT m_IsSynchronizingProperties THEN
        DO:
            txtX:Value = oCurrentControl:Left.
            txtY:Value = oCurrentControl:Top.
            txtWidth:Value = oCurrentControl:Width.
            txtHeight:Value = oCurrentControl:Height.
        END.     
        
END METHOD.

  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
METHOD PRIVATE CHARACTER GetReadableName( INPUT ipcSectionName AS CHARACTER, INPUT ipcWidgetName AS CHARACTER ):
 
        DEFINE VARIABLE cReadableName    AS CHARACTER                    NO-UNDO.
        DEFINE VARIABLE i                AS INTEGER                      NO-UNDO.
        DEFINE VARIABLE oDesignerControl AS System.Windows.Forms.Control NO-UNDO.
 
        DEFINE BUFFER bufcustom_layout_detail   FOR ttdefcustom_layout_detail.
       
        FOR FIRST bufcustom_layout_detail WHERE
                  bufcustom_layout_detail.section     = ipcSectionName AND
                  bufcustom_layout_detail.widget_name = ipcWidgetName NO-LOCK:
           
            FIND FIRST ttdefcustom_layout_detail WHERE
                       ttdefcustom_layout_detail.SECTION     = bufcustom_layout_detail.SECTION     AND
                       ttdefcustom_layout_detail.widget_name = bufcustom_layout_detail.widget_name NO-ERROR.

            IF AVAILABLE ttdefcustom_layout_detail AND
               ttdefcustom_layout_detail.DISPLAY_name <> "" THEN
                cReadableName = ttdefcustom_layout_detail.DISPLAY_name.
            ELSE IF bufcustom_layout_detail.display_name <> "" THEN
                cReadableName = bufcustom_layout_detail.display_name.
            ELSE
            DO ON ERROR UNDO, LEAVE:
                oDesignerControl = CAST(m_CurrentLiveParent:Controls[ipcWidgetName], System.Windows.Forms.Control).
               
                IF TYPE-OF(oDesignerControl, tools.IAgilityControl) THEN
                  cReadableName = CAST(oDesignerControl, tools.IAgilityControl):LabelText.
                ELSE IF VALID-OBJECT(oDesignerControl)      AND
                        oDesignerControl:Controls:Count > 0 THEN
                DO i = 0 TO oDesignerControl:Controls:Count - 1:
                    IF TYPE-OF(oDesignerControl:Controls[i], Infragistics.Win.Misc.UltraLabel) THEN
                    DO:
                        cReadableName = CAST(oDesignerControl:Controls[i], Infragistics.Win.Misc.UltraLabel):Text.
                        LEAVE.
                    END.
                END.
                ELSE IF VALID-OBJECT(oDesignerControl) THEN
                     cReadableName = oDesignerControl:Text.
                   
                CATCH e AS Progress.Lang.Error :
                END CATCH.
            END.
           
        END.       
       
        IF cReadableName = "" THEN
            cReadableName = ipcWidgetName.
        ELSE
            cReadableName = REPLACE(cReadableName, "&&", "&").
                   
  RETURN cReadableName.

END METHOD.

  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
METHOD PRIVATE CHARACTER GetReadableName( INPUT ipcWidgetName AS CHARACTER ):
 
        RETURN GetReadableName(m_CurrentSectionName, ipcWidgetName).

END METHOD.

    /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
METHOD PRIVATE CHARACTER GetWidgetDefaultMode( INPUT ipcWidgetName AS CHARACTER ):
     
      DEFINE VARIABLE cMode AS CHARACTER NO-UNDO.

      FOR FIRST ttdefcustom_layout_detail WHERE
                ttdefcustom_layout_detail.section     = m_CurrentSectionName AND
                ttdefcustom_layout_detail.widget_name = ipcWidgetName:
          ASSIGN
              cMode    = ttdefcustom_layout_detail.mode.
      END.
      
      RETURN cMode.

END METHOD.

        /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
METHOD PRIVATE CHARACTER GetWidgetPropertyDefault( INPUT ipcWidgetName AS CHARACTER ):
     
      DEFINE VARIABLE cPropertyValuePairs AS CHARACTER NO-UNDO.

      FOR FIRST ttdefcustom_layout_detail WHERE
                ttdefcustom_layout_detail.section     = m_CurrentSectionName AND
                ttdefcustom_layout_detail.widget_name = ipcWidgetName:
          ASSIGN
              cPropertyValuePairs    = ttdefcustom_layout_detail.property_value_pair.
      END.
      
      RETURN cPropertyValuePairs.

END METHOD.

    /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
    ------------------------------------------------------------------------------*/
METHOD PRIVATE LOGICAL IsWidgetInFixedMode( INPUT ipcWidgetName AS CHARACTER ):
     
      RETURN IsWidgetInFixedMode(m_CurrentSectionName, ipcWidgetName).

END METHOD.

    /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
METHOD PRIVATE LOGICAL IsWidgetInFixedMode( INPUT ipcSectionName AS CHARACTER, INPUT ipcWidgetName AS CHARACTER ):
     
      DEFINE VARIABLE lFixedMode AS LOGICAL NO-UNDO.

      FOR FIRST ttdefcustom_layout_detail WHERE
                ttdefcustom_layout_detail.section     = ipcSectionName AND
                ttdefcustom_layout_detail.widget_name = ipcWidgetName:
        ASSIGN
          lFixedMode = ttdefcustom_layout_detail.fixed_mode.
      END.
      
      RETURN lFixedMode.

END METHOD.

    /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PUBLIC VOID InitializeToolbarsManager(  ):
 
  sys.Imagehelper:AssignImageToTool(THIS-OBJECT:ultraToolbarsManager1, "New", "images/new").
  sys.Imagehelper:AssignImageToTool(THIS-OBJECT:ultraToolbarsManager1, "Open", "images/open").
  sys.Imagehelper:AssignImageToTool(THIS-OBJECT:ultraToolbarsManager1, "Save", "images/save").
  sys.Imagehelper:AssignImageToTool(THIS-OBJECT:ultraToolbarsManager1, "Delete", "images/delete").
        sys.Imagehelper:AssignImageToTool(THIS-OBJECT:ultraToolbarsManager1, "Restore", "images/restore").
       
        btnUserID:Appearance:Image = sys.ImageHelper:FromFilename("images/locate_16").
       
        ultraToolbarsManager1:AddToolToContinueList(THIS-OBJECT:ultraToolbarsManager1:Tools["View Properties Pane"]).
        ultraToolbarsManager1:AddToolToContinueList(THIS-OBJECT:ultraToolbarsManager1:Tools["View Control List Pane"]).
        ultraToolbarsManager1:AddToolToContinueList(THIS-OBJECT:ultraToolbarsManager1:Tools["Tab Index"]).
END METHOD.


/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID LayoutEditor_FormClosed( INPUT sender AS System.Object, INPUT e AS System.Windows.Forms.FormClosedEventArgs ):
  DEFINE VARIABLE cLastAccessedName AS CHARACTER   NO-UNDO.
        DEFINE VARIABLE cAccessType       AS CHARACTER   NO-UNDO.
        DEFINE VARIABLE cAccessedBy       AS CHARACTER   NO-UNDO.
        DEFINE VARIABLE cAppliesToBranch  AS CHARACTER   NO-UNDO.
       
        /* Do this to avoid unnecessary firing of the events while disposing objects that
           affects the UI while disposition is being done. */
       
        IF VALID-OBJECT(m_SelectionService) THEN
      m_SelectionService:SelectionChanged:UNSUBSCRIBE(OnSelectionChanged).
           
        IF VALID-OBJECT(m_RootDesignerParent) THEN
            m_RootDesignerParent:SizeChanged:UNSUBSCRIBE(ctl_SizeLocationChanged).
         
     IF VALID-OBJECT(m_DesignerHost) THEN
            m_DesignerHost:ComponentRemoved:UNSUBSCRIBE(OnComponentRemoved).
       
        /* will update user_last_accessed */
        IF NOT m_isNewRecord THEN
        FOR FIRST ttcustom_layout_header:
            RUN usrlstaccd.p ON g-AppSrvr
              ( INPUT "set",
                INPUT        ttcustom_layout_header.usage_level_1,
                INPUT        ttcustom_layout_header.usage_level_2,
                INPUT        ttcustom_layout_header.usage_level_3,
                INPUT        ttcustom_layout_header.usage_level_4,
                INPUT-OUTPUT ttcustom_layout_header.custom_layout,
                INPUT-OUTPUT ttcustom_layout_header.access_type,
                INPUT-OUTPUT ttcustom_layout_header.accessed_by,
                INPUT-OUTPUT ttcustom_layout_header.applies_to_branch).
           
            IF IsLayoutUsable(ttcustom_layout_header.access_type) THEN
            DO:
              IF VALID-OBJECT(FormInLayoutMode) AND
                 TYPE-OF(FormInLayoutMode, sys.ILayoutableForm) THEN
                CAST(FormInLayoutMode, sys.ILayoutableForm):ApplyLayout().
              ELSE 
                ApplyLayout().
            END.           
        END.             
       
        THIS-OBJECT:Hide().
 
        IF VALID-OBJECT(m_SelectionService) THEN
     DO:
         DELETE OBJECT m_SelectionService.
        END.
       
        IF VALID-OBJECT(m_RootDesignerParent) THEN
        DO ON ERROR UNDO, LEAVE:       
           
            EMPTY TEMP-TABLE ttControls.
            ultraDataSource1:Rows:Clear().
            ultraDataSourceTabSettings:Rows:Clear().
            ultraDataSourceChildTabSettings:Rows:Clear().
           
            ultraGrid1:AfterSelectChange:UNSUBSCRIBE(ultraGrid1_AfterSelectChange).
            m_RootDesignerParent:Controls:Clear().
            m_RootDesignerParent:Dispose() NO-ERROR.
            DELETE OBJECT m_RootDesignerParent.
           
            CATCH e1 AS Progress.Lang.Error :       
            END CATCH.
        END.
       
        IF VALID-OBJECT(m_DesignerHost) THEN
        DO ON ERROR UNDO, LEAVE:
            m_DesignerHost:Dispose() NO-ERROR.
            DELETE OBJECT m_DesignerHost.
          
            CATCH e2 AS Progress.Lang.Error :       
            END CATCH.           
        END.
END METHOD.


    /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID LayoutEditor_Load( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
        DEFINE VARIABLE currentParent AS System.Windows.Forms.Control                   NO-UNDO.
        DEFINE VARIABLE comboBoxTool  AS Infragistics.Win.UltraWinToolbars.ComboBoxTool NO-UNDO.
        DEFINE VARIABLE i             AS INTEGER                                        NO-UNDO.
        DEFINE VARIABLE numEntries    AS INTEGER                                        NO-UNDO.
       
        /* store for comparison and reset */
        DATASET dsOrigCustomLayout:COPY-DATASET(DATASET dsCustomLayout:HANDLE).
       
        m_isNewRecord = FALSE.
        InitializeFields().
       
        IF VALID-OBJECT(ControlsContainers) THEN
        DO:
            numEntries   = ControlsContainers:Count.
            comboBoxTool = CAST(THIS-OBJECT:ultraToolbarsManager1:Tools["Section"], Infragistics.Win.UltraWinToolbars.ComboBoxTool).
       
            comboBoxTool:ValueList:ValueListItems:Clear().
            DO i = 1 TO numEntries:
                currentParent = CAST(ControlsContainers[i - 1], System.Windows.Forms.Control).
                comboBoxTool:ValueList:ValueListItems:Add(currentParent, GetReadableName(GetSectionName(currentParent:Name), currentParent:Name)).
            END.
       
            InitializeToolbarsManager().
            m_hasAccess = UpdateButtonsState().
            UpdateLayoutToolbarState(FALSE).
 
           /* NOTE: this will fire the valuechanged event */
         comboBoxTool:Value = ControlsContainers[0].
        END.
       
        splitContainer3:Panel1Collapsed = TRUE.
      
END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID NewLayout(  ):
 
        IF THIS-OBJECT:ContinueIfModified() THEN
        DO:
            RUN sys/sicustomlayoutfetch.p ON g-AppSrvr (
                INPUT sys.AgilitySession:SessionContextID,
                INPUT "Default",
                INPUT "",
                INPUT "",
                INPUT "",
                INPUT "",
                INPUT m_usageLevel1,
                INPUT m_usageLevel2,
                INPUT m_usageLevel3,
                INPUT m_usageLevel4,
                OUTPUT m_isDefault,
                OUTPUT DATASET dsCustomLayout).
       
            DATASET dsOrigCustomLayout:COPY-DATASET(DATASET dsCustomLayout:HANDLE).
         
            THIS-OBJECT:txtCustomLayout:Text = "".
            m_isNewRecord = TRUE.
            RestoreLayout().
            UpdateButtonsState().
            branchSelector:Focus().
        END.                 
END METHOD.


     /*------------------------------------------------------------------------------
   Purpose: Fires every time a control is removed from the layout unless the
            UNSUBSCRIBE to this event is run first before the control is removed.
           
            Calling oDesignerControl:Dispose() will fire this event.
                              
   Notes: DO NOT dispose or deallocate the control inside this event.                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID OnComponentRemoved( INPUT sender AS System.Object, INPUT e AS ComponentEventArgs ):
 
        DEFINE VARIABLE i                 AS INTEGER                                    NO-UNDO.
        DEFINE VARIABLE oControlRow       AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
        DEFINE VARIABLE ctrl              AS System.Windows.Forms.Control               NO-UNDO.
        DEFINE VARIABLE oLinkedControlRow AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
        DEFINE VARIABLE oTabOrderRow      AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
                                  
        ctrl = CAST(e:Component, System.Windows.Forms.Control).
        IF VALID-OBJECT(ctrl) THEN
        DO:
            IF VALID-OBJECT(ctrl:Tag) AND
               TYPE-OF(ctrl:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow) THEN
            DO:
                oControlRow = CAST(ctrl:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
           
                IF VALID-OBJECT(oControlRow) THEN
                DO:
                    oControlRow:Cells["visible"]:Value = FALSE.
                    BuildValueList(ctrl, oControlRow, TRUE).
                   
                    IF VALID-OBJECT(oControlRow:Cells[1]:Tag) THEN
                    DO:
                      oTabOrderRow = CAST(oControlRow:Cells[1]:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
                     
                      IF NOT m_isRestoring THEN
                      DO i = oTabOrderRow:Index + 1 TO ultraGrid3:Rows:Count - 1:
                          ultraGrid3:Rows[i]:Cells["tab_index"]:Value = INTEGER(ultraGrid3:Rows[i]:Cells["tab_index"]:Text) - 1.
                          oLinkedControlRow = CAST(ultraGrid3:Rows[i]:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
                          oLinkedControlRow:Cells["tab_index"]:Value = ultraGrid3:Rows[i]:Cells["tab_index"]:Value.                 
                      END.
                     
                      oTabOrderRow:Delete(FALSE).
                    END.
                   
                    IF VALID-OBJECT(lblChildControls:Tag)                          AND
                       Progress.Util.TypeHelper:Equals(ctrl, lblChildControls:Tag) THEN
                      RefreshChildTabSettings(?).
                      
                    oControlRow:Tag = ?.
                END.
            END.
        END.
        
        /*
        DO i = 0 TO ultraGrid1:Rows:Count - 1:
            oControlRow = ultraGrid1:Rows[i].
           
            MESSAGE VALID-OBJECT(oControlRow:Tag) VIEW-AS ALERT-BOX.
            IF VALID-OBJECT(oControlRow:Tag) THEN
                oControlRow:Cells["visible"]:Value = TRUE.
            ELSE IF NOT VALID-OBJECT(oControlRow:Tag) THEN
                oControlRow:Cells["visible"]:Value = FALSE.
        END.
        */
       
END METHOD.

    /*------------------------------------------------------------------------------
            Purpose:                    
            Notes:                    
    ------------------------------------------------------------------------------*/

    METHOD PRIVATE VOID OpenLayout(  ):
  DEFINE BUFFER bufcustom_layout_header FOR ttcustom_layout_header.
              
        IF THIS-OBJECT:ContinueIfModified() THEN
        DO:
            m_isOpening = TRUE.
           
            EMPTY TEMP-TABLE ttLocatedCustomLayoutHeader.
 
            RUN df/lcustomlayout.w (
                INPUT m_usageLevel1,
                INPUT m_usageLevel2,
                INPUT m_usageLevel3,
                INPUT m_usageLevel4,
                OUTPUT TABLE ttLocatedCustomLayoutHeader).
      
      FIND FIRST bufcustom_layout_header.       
            FIND FIRST ttLocatedCustomLayoutHeader NO-ERROR.
               
            IF AVAILABLE ttLocatedCustomLayoutHeader THEN
            DO:
              DEFINE VARIABLE lPreviousAccess AS LOGICAL NO-UNDO.
              lPreviousAccess = HasAccess(cbAccessedType:Value:ToString()).
              m_hasAccess = HasAccess(ttLocatedCustomLayoutHeader.access_type).

              IF ((AVAILABLE bufcustom_layout_header AND
                (ttLocatedCustomLayoutHeader.access_type       <> bufcustom_layout_header.access_type       OR
                 ttLocatedCustomLayoutHeader.accessed_by       <> bufcustom_layout_header.accessed_by       OR
                 ttLocatedCustomLayoutHeader.applies_to_branch <> bufcustom_layout_header.applies_to_branch OR
                 ttLocatedCustomLayoutHeader.custom_layout     <> bufcustom_layout_header.custom_layout)) OR
                 m_isNewRecord) THEN
              DO:
                  RUN sys/sicustomlayoutfetch.p ON g-AppSrvr
                    ( INPUT sys.AgilitySession:SessionContextID,
                      INPUT "Specific Record",
                      INPUT ttLocatedCustomLayoutHeader.access_type,
                      INPUT ttLocatedCustomLayoutHeader.accessed_by,
                      INPUT ttLocatedCustomLayoutHeader.applies_to_branch,
                      INPUT ttLocatedCustomLayoutHeader.custom_layout,
                      INPUT ttLocatedCustomLayoutHeader.usage_level_1,
                      INPUT ttLocatedCustomLayoutHeader.usage_level_2,
                      INPUT ttLocatedCustomLayoutHeader.usage_level_3,
                      INPUT ttLocatedCustomLayoutHeader.usage_level_4,
                      OUTPUT m_isDefault,
                      OUTPUT DATASET dsCustomLayout).
                 
                  DATASET dsOrigCustomLayout:COPY-DATASET(DATASET dsCustomLayout:HANDLE).
                 
                  /* If not changing access, reuse the current view */
                  IF lPreviousAccess = m_hasAccess THEN
                  DO:
                    RestoreLayout().
                    UpdateButtonsState().
                    RefreshChildTabSettings(?).
                  END.
                  ELSE
                    LoadSectionLayout(m_CurrentLiveParent).
              END.

              m_isNewRecord = FALSE. 
              InitializeFields().  
             
            END.

            m_isOpening = FALSE.
        END.
    END METHOD.


      /*------------------------------------------------------------------------------
             Purpose: Calls when the user clicks on the visibility check box or press
                      the Delete key                    
             Notes:                    
     ------------------------------------------------------------------------------*/

    METHOD PUBLIC VOID RemoveComponentFromSurface( INPUT oControlRow AS Infragistics.Win.UltraWinGrid.UltraGridRow  ):
 
        DEFINE VARIABLE oDesignerControl  AS System.Windows.Forms.Control               NO-UNDO.
        DEFINE VARIABLE oTabOrderRow      AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
        DEFINE VARIABLE oLinkedControlRow AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
        DEFINE VARIABLE i                 AS INTEGER                                    NO-UNDO.
 
        IF VALID-OBJECT(oControlRow) THEN
        DO:
            oDesignerControl = CAST(oControlRow:Tag, System.Windows.Forms.Control). /* get the control added to the designer */
           
            IF VALID-OBJECT(oDesignerControl) THEN
            DO:
                DO WHILE oDesignerControl:Controls:Count > 0:
                    oDesignerControl:Controls[0]:Dispose().
                END.
                
                oDesignerControl:Dispose().
                DELETE OBJECT oDesignerControl.
                oControlRow:Tag = ?.
                ultraGrid1:Refresh().
            END. 
           
            IF m_hasAccess THEN
              ultraGrid1:Selected:Rows:Add(oControlRow).
        END.
    END METHOD.

   /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID InitializeDesigner( INPUT parentContainer AS System.Windows.Forms.Control ):
 
        DEFINE VARIABLE rootDesigner     AS IRootDesigner                NO-UNDO.
        DEFINE VARIABLE oDesignerControl AS System.Windows.Forms.Control NO-UNDO.
        DEFINE VARIABLE lNew             AS LOGICAL                      NO-UNDO.

        /* Initialise service container and designer m_DesignerHost */
        IF NOT VALID-OBJECT(m_DesignerHost) THEN
        DO:
            lNew = TRUE.
           
            m_ServiceContainer = NEW ServiceContainer().
            m_ServiceContainer:AddService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.Serialization.INameCreationService"), NEW NameCreationService()).
            /* m_ServiceContainer:AddService(Progress.Util.TypeHelper:GetType("IUIService"), NEW UIService(THIS-OBJECT)). */       
            m_DesignerHost = NEW DesignerHost(m_ServiceContainer).
       
            /* Add toolbox service
            m_ServiceContainer.AddService(typeof(IToolboxService), lstToolbox);
            lstToolbox.designPanel = pnlViewHost;
            PopulateToolbox(lstToolbox);
            */
            /* Add menu command service */
            m_MenuService = NEW MenuCommandService(m_DesignerHost).
            m_ServiceContainer:AddService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.IMenuCommandService"), m_MenuService).       
       
            /* Subscribe to the selectionchanged event and activate the designer */
            m_SelectionService = CAST(m_ServiceContainer:GetService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.ISelectionService")), ISelectionService).
        END.
       
        /* Start the designer m_DesignerHost off with a Form to design */
        IF m_hasAccess THEN
        DO:
            DEFINE VARIABLE oRootContainer AS Progress.Windows.Form NO-UNDO.
            oRootContainer = NEW Progress.Windows.Form().
            oRootContainer:FormBorderStyle = System.Windows.Forms.FormBorderStyle:None.           
            oRootContainer:TopLevel = FALSE.
            oRootContainer:Name = "RootElement".
            oRootContainer:Text = "Layout Surface".
           
            m_RootDesignerParent = oRootContainer.
        END.
        ELSE
        DO:
            DEFINE VARIABLE oUserControl AS System.Windows.Forms.UserControl NO-UNDO.
            oUserControl = NEW System.Windows.Forms.UserControl().
            oUserControl:Name = "RootElement".
            oUserControl:Text = "Layout Surface".           
           
            m_RootDesignerParent = oUserControl.           
        END.
       
        ASSIGN
            m_RootDesignerParent:Width  = 800
            m_RootDesignerParent:Height = 600.
 
        /* set the main container of the controls */       
        FOR FIRST ttcustom_layout_detail WHERE
                  ttcustom_layout_detail.section     = m_CurrentSectionName AND  
                  ttcustom_layout_detail.widget_name = parentContainer:Name:
            ASSIGN
                m_RootDesignerParent:Width  = ttcustom_layout_detail.Width
          m_RootDesignerParent:Height = ttcustom_layout_detail.Height.
        END.
       
        m_DesignerHost:AddInitialDesignSurface(m_RootDesignerParent).
        IF m_hasAccess THEN
          SetSelectedComponent(m_RootDesignerParent).
       
        m_RootDesignerParent:SizeChanged:SUBSCRIBE(ctl_SizeLocationChanged).
       
        /* Get the root designer for the form and add its design view to this form */
        rootDesigner = CAST(m_DesignerHost:GetDesigner(m_RootDesignerParent), IRootDesigner).
        oDesignerControl = CAST(rootDesigner:GetView(ViewTechnology:Default), System.Windows.Forms.Control).
        oDesignerControl:Dock = System.Windows.Forms.DockStyle:Fill.
        pnlView:Controls:Add(oDesignerControl).
       
        /* Add the corresponding UI representation of the child elements */
        THIS-OBJECT:AddChildrenToDesignSurface(parentContainer, m_RootDesignerParent).
       
        m_DesignerHost:Activate().
       
        IF m_hasAccess THEN
        DO: 
          IF lNew THEN
          DO:
            m_SelectionService:SelectionChanged:SUBSCRIBE(OnSelectionChanged).
            m_DesignerHost:ComponentRemoved:SUBSCRIBE(OnComponentRemoved).
          END.         
                 
          /* Layout engine needs a selected control once created */
          SetSelectedComponent(?).
          SetSelectedComponent(m_RootDesignerParent).
        END.
END METHOD.


  METHOD PRIVATE VOID InitializeComponent(  ):
 
        /* NOTE: The following method is automatically generated.
       
        We strongly suggest that the contents of this method only be modified using the
        Visual Designer to avoid any incompatible modifications.
       
        Modifying the contents of this method using a code editor will invalidate any support for this file. */
        THIS-OBJECT:components = NEW System.ComponentModel.Container().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance39 AS Infragistics.Win.Appearance NO-UNDO.
        appearance39 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridBand1 AS Infragistics.Win.UltraWinGrid.UltraGridBand NO-UNDO.
        ultraGridBand1 = NEW Infragistics.Win.UltraWinGrid.UltraGridBand("Band 0", -1).
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn1 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn1 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("visible").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn2 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn2 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("widget_name").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn3 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn3 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("mode").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn4 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn4 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("tab_stop").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn5 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn5 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("tab_index").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn6 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn6 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("Column 0").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance40 AS Infragistics.Win.Appearance NO-UNDO.
        appearance40 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance41 AS Infragistics.Win.Appearance NO-UNDO.
        appearance41 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance42 AS Infragistics.Win.Appearance NO-UNDO.
        appearance42 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance45 AS Infragistics.Win.Appearance NO-UNDO.
        appearance45 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance46 AS Infragistics.Win.Appearance NO-UNDO.
        appearance46 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance47 AS Infragistics.Win.Appearance NO-UNDO.
        appearance47 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance48 AS Infragistics.Win.Appearance NO-UNDO.
        appearance48 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance49 AS Infragistics.Win.Appearance NO-UNDO.
        appearance49 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance50 AS Infragistics.Win.Appearance NO-UNDO.
        appearance50 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance51 AS Infragistics.Win.Appearance NO-UNDO.
        appearance51 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance63 AS Infragistics.Win.Appearance NO-UNDO.
        appearance63 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn1 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn1 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("visible").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn2 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn2 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("widget_name").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn3 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn3 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("mode").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn4 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn4 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("tab_stop").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn5 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn5 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("tab_index").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn6 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn6 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("Column 0").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance14 AS Infragistics.Win.Appearance NO-UNDO.
        appearance14 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance17 AS Infragistics.Win.Appearance NO-UNDO.
        appearance17 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance15 AS Infragistics.Win.Appearance NO-UNDO.
        appearance15 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance3 AS Infragistics.Win.Appearance NO-UNDO.
        appearance3 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance61 AS Infragistics.Win.Appearance NO-UNDO.
        appearance61 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridBand2 AS Infragistics.Win.UltraWinGrid.UltraGridBand NO-UNDO.
        ultraGridBand2 = NEW Infragistics.Win.UltraWinGrid.UltraGridBand("Band 0", -1).
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn7 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn7 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("tab_stop", -1, ?, 0, Infragistics.Win.UltraWinGrid.SortIndicator:Descending, FALSE).
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn8 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn8 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("widget_name").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn9 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn9 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("tab_index").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance78 AS Infragistics.Win.Appearance NO-UNDO.
        appearance78 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance79 AS Infragistics.Win.Appearance NO-UNDO.
        appearance79 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance80 AS Infragistics.Win.Appearance NO-UNDO.
        appearance80 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance4 AS Infragistics.Win.Appearance NO-UNDO.
        appearance4 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance5 AS Infragistics.Win.Appearance NO-UNDO.
        appearance5 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance83 AS Infragistics.Win.Appearance NO-UNDO.
        appearance83 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance84 AS Infragistics.Win.Appearance NO-UNDO.
        appearance84 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance85 AS Infragistics.Win.Appearance NO-UNDO.
        appearance85 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance86 AS Infragistics.Win.Appearance NO-UNDO.
        appearance86 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance87 AS Infragistics.Win.Appearance NO-UNDO.
        appearance87 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance90 AS Infragistics.Win.Appearance NO-UNDO.
        appearance90 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn7 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn7 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("tab_stop").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn8 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn8 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("widget_name").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn9 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn9 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("tab_index").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance52 AS Infragistics.Win.Appearance NO-UNDO.
        appearance52 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance37 AS Infragistics.Win.Appearance NO-UNDO.
        appearance37 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance38 AS Infragistics.Win.Appearance NO-UNDO.
        appearance38 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance70 AS Infragistics.Win.Appearance NO-UNDO.
        appearance70 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridBand3 AS Infragistics.Win.UltraWinGrid.UltraGridBand NO-UNDO.
        ultraGridBand3 = NEW Infragistics.Win.UltraWinGrid.UltraGridBand("Band 0", -1).
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn10 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn10 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("widget_name").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn11 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn11 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("tab_stop").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraGridColumn12 AS Infragistics.Win.UltraWinGrid.UltraGridColumn NO-UNDO.
        ultraGridColumn12 = NEW Infragistics.Win.UltraWinGrid.UltraGridColumn("tab_index").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance71 AS Infragistics.Win.Appearance NO-UNDO.
        appearance71 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance72 AS Infragistics.Win.Appearance NO-UNDO.
        appearance72 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance73 AS Infragistics.Win.Appearance NO-UNDO.
        appearance73 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance76 AS Infragistics.Win.Appearance NO-UNDO.
        appearance76 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance77 AS Infragistics.Win.Appearance NO-UNDO.
        appearance77 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance92 AS Infragistics.Win.Appearance NO-UNDO.
        appearance92 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance93 AS Infragistics.Win.Appearance NO-UNDO.
        appearance93 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance94 AS Infragistics.Win.Appearance NO-UNDO.
        appearance94 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance95 AS Infragistics.Win.Appearance NO-UNDO.
        appearance95 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance96 AS Infragistics.Win.Appearance NO-UNDO.
        appearance96 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance97 AS Infragistics.Win.Appearance NO-UNDO.
        appearance97 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn10 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn10 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("widget_name").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn11 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn11 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("tab_stop").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraDataColumn12 AS Infragistics.Win.UltraWinDataSource.UltraDataColumn NO-UNDO.
        ultraDataColumn12 = NEW Infragistics.Win.UltraWinDataSource.UltraDataColumn("tab_index").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance1 AS Infragistics.Win.Appearance NO-UNDO.
        appearance1 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance67 AS Infragistics.Win.Appearance NO-UNDO.
        appearance67 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance19 AS Infragistics.Win.Appearance NO-UNDO.
        appearance19 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraToolbar1 AS Infragistics.Win.UltraWinToolbars.UltraToolbar NO-UNDO.
        ultraToolbar1 = NEW Infragistics.Win.UltraWinToolbars.UltraToolbar("Layout").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool8 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool8 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Align Lefts").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool12 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool12 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Align Rights").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool19 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool19 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Make Same Width").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool20 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool20 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Make Same Height").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool21 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool21 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Make Same Size").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool15 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool15 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Bring to Front").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool16 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool16 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Send to Back").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool9 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool9 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Capture Values").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE ultraToolbar2 AS Infragistics.Win.UltraWinToolbars.UltraToolbar NO-UNDO.
        ultraToolbar2 = NEW Infragistics.Win.UltraWinToolbars.UltraToolbar("File").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool31 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool31 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("New").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool27 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool27 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Open").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool25 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool25 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Save").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool34 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool34 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Delete").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool33 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool33 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Restore").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE stateButtonTool5 AS Infragistics.Win.UltraWinToolbars.StateButtonTool NO-UNDO.
        stateButtonTool5 = NEW Infragistics.Win.UltraWinToolbars.StateButtonTool("View Control List Pane", "").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE stateButtonTool6 AS Infragistics.Win.UltraWinToolbars.StateButtonTool NO-UNDO.
        stateButtonTool6 = NEW Infragistics.Win.UltraWinToolbars.StateButtonTool("View Properties Pane", "").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE stateButtonTool7 AS Infragistics.Win.UltraWinToolbars.StateButtonTool NO-UNDO.
        stateButtonTool7 = NEW Infragistics.Win.UltraWinToolbars.StateButtonTool("Tab Index", "").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE comboBoxTool1 AS Infragistics.Win.UltraWinToolbars.ComboBoxTool NO-UNDO.
        comboBoxTool1 = NEW Infragistics.Win.UltraWinToolbars.ComboBoxTool("Section").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool1 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool1 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Align Lefts").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance13 AS Infragistics.Win.Appearance NO-UNDO.
        appearance13 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE resources AS System.Resources.ResXResourceSet NO-UNDO.
        resources = Progress.Util.ResourceHelper:Load("sys\LayoutEditor.resx", PROPATH).
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool2 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool2 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Align Centers").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance20 AS Infragistics.Win.Appearance NO-UNDO.
        appearance20 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool3 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool3 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Align Rights").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance21 AS Infragistics.Win.Appearance NO-UNDO.
        appearance21 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool4 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool4 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Align Tops").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance25 AS Infragistics.Win.Appearance NO-UNDO.
        appearance25 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool5 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool5 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Align Middles").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance26 AS Infragistics.Win.Appearance NO-UNDO.
        appearance26 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool6 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool6 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Align Bottoms").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance27 AS Infragistics.Win.Appearance NO-UNDO.
        appearance27 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool17 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool17 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Bring to Front").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance23 AS Infragistics.Win.Appearance NO-UNDO.
        appearance23 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool18 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool18 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Send to Back").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance24 AS Infragistics.Win.Appearance NO-UNDO.
        appearance24 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool22 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool22 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Make Same Width").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance28 AS Infragistics.Win.Appearance NO-UNDO.
        appearance28 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool23 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool23 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Make Same Height").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance29 AS Infragistics.Win.Appearance NO-UNDO.
        appearance29 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool24 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool24 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Make Same Size").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance30 AS Infragistics.Win.Appearance NO-UNDO.
        appearance30 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE stateButtonTool2 AS Infragistics.Win.UltraWinToolbars.StateButtonTool NO-UNDO.
        stateButtonTool2 = NEW Infragistics.Win.UltraWinToolbars.StateButtonTool("View Properties Pane", "").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance31 AS Infragistics.Win.Appearance NO-UNDO.
        appearance31 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE stateButtonTool4 AS Infragistics.Win.UltraWinToolbars.StateButtonTool NO-UNDO.
        stateButtonTool4 = NEW Infragistics.Win.UltraWinToolbars.StateButtonTool("View Control List Pane", "").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance32 AS Infragistics.Win.Appearance NO-UNDO.
        appearance32 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool28 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool28 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Save").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool29 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool29 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("New").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE stateButtonTool3 AS Infragistics.Win.UltraWinToolbars.StateButtonTool NO-UNDO.
        stateButtonTool3 = NEW Infragistics.Win.UltraWinToolbars.StateButtonTool("Tab Index", "").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance36 AS Infragistics.Win.Appearance NO-UNDO.
        appearance36 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE comboBoxTool2 AS Infragistics.Win.UltraWinToolbars.ComboBoxTool NO-UNDO.
        comboBoxTool2 = NEW Infragistics.Win.UltraWinToolbars.ComboBoxTool("Section").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE valueList1 AS Infragistics.Win.ValueList NO-UNDO.
        valueList1 = NEW Infragistics.Win.ValueList(0).
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool7 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool7 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Open").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool14 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool14 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Delete").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool26 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool26 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Restore").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool10 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool10 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Delete Control").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE buttonTool11 AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        buttonTool11 = NEW Infragistics.Win.UltraWinToolbars.ButtonTool("Capture Values").
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance2 AS Infragistics.Win.Appearance NO-UNDO.
        appearance2 = NEW Infragistics.Win.Appearance().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE valueListItem1 AS Infragistics.Win.ValueListItem NO-UNDO.
        valueListItem1 = NEW Infragistics.Win.ValueListItem().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE valueListItem2 AS Infragistics.Win.ValueListItem NO-UNDO.
        valueListItem2 = NEW Infragistics.Win.ValueListItem().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE valueListItem3 AS Infragistics.Win.ValueListItem NO-UNDO.
        valueListItem3 = NEW Infragistics.Win.ValueListItem().
        @VisualDesigner.FormMember (NeedsInitialize="true").
        DEFINE VARIABLE appearance22 AS Infragistics.Win.Appearance NO-UNDO.
        appearance22 = NEW Infragistics.Win.Appearance().
        THIS-OBJECT:ultraGrid1 = NEW Infragistics.Win.UltraWinGrid.UltraGrid().
        THIS-OBJECT:ultraDataSource1 = NEW Infragistics.Win.UltraWinDataSource.UltraDataSource(THIS-OBJECT:components).
        THIS-OBJECT:pnlProperties = NEW System.Windows.Forms.Panel().
        THIS-OBJECT:ultraLabel5 = NEW Infragistics.Win.Misc.UltraLabel().
        THIS-OBJECT:ultraLabel3 = NEW Infragistics.Win.Misc.UltraLabel().
        THIS-OBJECT:txtY = NEW Infragistics.Win.UltraWinEditors.UltraNumericEditor().
        THIS-OBJECT:txtX = NEW Infragistics.Win.UltraWinEditors.UltraNumericEditor().
        THIS-OBJECT:txtHeight = NEW Infragistics.Win.UltraWinEditors.UltraNumericEditor().
        THIS-OBJECT:ultraLabel4 = NEW Infragistics.Win.Misc.UltraLabel().
        THIS-OBJECT:txtWidth = NEW Infragistics.Win.UltraWinEditors.UltraNumericEditor().
        THIS-OBJECT:ultraLabel2 = NEW Infragistics.Win.Misc.UltraLabel().
        THIS-OBJECT:LayoutEditor_Fill_Panel = NEW System.Windows.Forms.Panel().
        THIS-OBJECT:splitContainer1 = NEW System.Windows.Forms.SplitContainer().
        THIS-OBJECT:splitContainer3 = NEW System.Windows.Forms.SplitContainer().
        THIS-OBJECT:splitContainerTabSettings = NEW System.Windows.Forms.SplitContainer().
        THIS-OBJECT:ultraGrid3 = NEW Infragistics.Win.UltraWinGrid.UltraGrid().
        THIS-OBJECT:ultraDataSourceTabSettings = NEW Infragistics.Win.UltraWinDataSource.UltraDataSource(THIS-OBJECT:components).
        THIS-OBJECT:panel2 = NEW System.Windows.Forms.Panel().
        THIS-OBJECT:btnDown = NEW Infragistics.Win.Misc.UltraButton().
        THIS-OBJECT:btnUp = NEW Infragistics.Win.Misc.UltraButton().
        THIS-OBJECT:ultraLabel8 = NEW Infragistics.Win.Misc.UltraLabel().
        THIS-OBJECT:panel1 = NEW System.Windows.Forms.Panel().
        THIS-OBJECT:ultraGrid2 = NEW Infragistics.Win.UltraWinGrid.UltraGrid().
        THIS-OBJECT:ultraDataSourceChildTabSettings = NEW Infragistics.Win.UltraWinDataSource.UltraDataSource(THIS-OBJECT:components).
        THIS-OBJECT:lblChildControls = NEW Infragistics.Win.Misc.UltraLabel().
        THIS-OBJECT:panel3 = NEW System.Windows.Forms.Panel().
        THIS-OBJECT:pnlView = NEW System.Windows.Forms.Panel().
        THIS-OBJECT:splitContainer2 = NEW System.Windows.Forms.SplitContainer().
        THIS-OBJECT:ultraLabel6 = NEW Infragistics.Win.Misc.UltraLabel().
        THIS-OBJECT:lblProperties = NEW Infragistics.Win.Misc.UltraLabel().
        THIS-OBJECT:ultraExplorerBarContainerControl1 = NEW Infragistics.Win.UltraWinExplorerBar.UltraExplorerBarContainerControl().
        THIS-OBJECT:ultraToolbarsManager1 = NEW tools.AgilityToolbarsManager(THIS-OBJECT:components).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Left = NEW Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea().
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Right = NEW Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea().
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Top = NEW Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea().
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Bottom = NEW Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea().
        THIS-OBJECT:flowLayoutPanel1 = NEW System.Windows.Forms.FlowLayoutPanel().
        THIS-OBJECT:branchSelector = NEW tools.BranchSelector().
        THIS-OBJECT:panel6 = NEW System.Windows.Forms.Panel().
        THIS-OBJECT:txtCustomLayout = NEW Infragistics.Win.UltraWinEditors.UltraTextEditor().
        THIS-OBJECT:ultraLabel7 = NEW Infragistics.Win.Misc.UltraLabel().
        THIS-OBJECT:panel7 = NEW System.Windows.Forms.Panel().
        THIS-OBJECT:cbAccessedType = NEW Infragistics.Win.UltraWinEditors.UltraComboEditor().
        THIS-OBJECT:btnUserID = NEW Infragistics.Win.Misc.UltraButton().
        THIS-OBJECT:txtAccessedBy = NEW Infragistics.Win.UltraWinEditors.UltraTextEditor().
        THIS-OBJECT:ultraLabel9 = NEW Infragistics.Win.Misc.UltraLabel().
        CAST(THIS-OBJECT:ultraGrid1, System.ComponentModel.ISupportInitialize):BeginInit().
        CAST(THIS-OBJECT:ultraDataSource1, System.ComponentModel.ISupportInitialize):BeginInit().
        THIS-OBJECT:pnlProperties:SuspendLayout().
        CAST(THIS-OBJECT:txtY, System.ComponentModel.ISupportInitialize):BeginInit().
        CAST(THIS-OBJECT:txtX, System.ComponentModel.ISupportInitialize):BeginInit().
        CAST(THIS-OBJECT:txtHeight, System.ComponentModel.ISupportInitialize):BeginInit().
        CAST(THIS-OBJECT:txtWidth, System.ComponentModel.ISupportInitialize):BeginInit().
        THIS-OBJECT:LayoutEditor_Fill_Panel:SuspendLayout().
        THIS-OBJECT:splitContainer1:Panel1:SuspendLayout().
        THIS-OBJECT:splitContainer1:Panel2:SuspendLayout().
        THIS-OBJECT:splitContainer1:SuspendLayout().
        THIS-OBJECT:splitContainer3:Panel1:SuspendLayout().
        THIS-OBJECT:splitContainer3:Panel2:SuspendLayout().
        THIS-OBJECT:splitContainer3:SuspendLayout().
        THIS-OBJECT:splitContainerTabSettings:Panel1:SuspendLayout().
        THIS-OBJECT:splitContainerTabSettings:Panel2:SuspendLayout().
        THIS-OBJECT:splitContainerTabSettings:SuspendLayout().
        CAST(THIS-OBJECT:ultraGrid3, System.ComponentModel.ISupportInitialize):BeginInit().
        CAST(THIS-OBJECT:ultraDataSourceTabSettings, System.ComponentModel.ISupportInitialize):BeginInit().
        THIS-OBJECT:panel2:SuspendLayout().
        THIS-OBJECT:panel1:SuspendLayout().
        CAST(THIS-OBJECT:ultraGrid2, System.ComponentModel.ISupportInitialize):BeginInit().
        CAST(THIS-OBJECT:ultraDataSourceChildTabSettings, System.ComponentModel.ISupportInitialize):BeginInit().
        THIS-OBJECT:panel3:SuspendLayout().
        THIS-OBJECT:splitContainer2:Panel1:SuspendLayout().
        THIS-OBJECT:splitContainer2:Panel2:SuspendLayout().
        THIS-OBJECT:splitContainer2:SuspendLayout().
        CAST(THIS-OBJECT:ultraToolbarsManager1, System.ComponentModel.ISupportInitialize):BeginInit().
        THIS-OBJECT:flowLayoutPanel1:SuspendLayout().
        THIS-OBJECT:panel6:SuspendLayout().
        CAST(THIS-OBJECT:txtCustomLayout, System.ComponentModel.ISupportInitialize):BeginInit().
        THIS-OBJECT:panel7:SuspendLayout().
        CAST(THIS-OBJECT:cbAccessedType, System.ComponentModel.ISupportInitialize):BeginInit().
        CAST(THIS-OBJECT:txtAccessedBy, System.ComponentModel.ISupportInitialize):BeginInit().
        THIS-OBJECT:SuspendLayout().
        /*  */
        /* ultraGrid1 */
        /*  */
        THIS-OBJECT:ultraGrid1:DataSource = THIS-OBJECT:ultraDataSource1.
        appearance39:BackColor = System.Drawing.SystemColors:Window.
        appearance39:BorderColor = System.Drawing.SystemColors:InactiveCaption.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Appearance = appearance39.
        THIS-OBJECT:ultraGrid1:DisplayLayout:AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle:ExtendLastColumn.
        ultraGridColumn1:Header:Caption = "".
        ultraGridColumn1:Header:Fixed = TRUE.
        ultraGridColumn1:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn1:Header:VisiblePosition = 0.
        ultraGridColumn1:LockedWidth = TRUE.
        ultraGridColumn1:MaxWidth = 23.
        ultraGridColumn1:MinWidth = 23.
        ultraGridColumn1:Width = 23.
        ultraGridColumn2:CellActivation = Infragistics.Win.UltraWinGrid.Activation:NoEdit.
        ultraGridColumn2:CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction:RowSelect.
        ultraGridColumn2:Header:Caption = "Name".
        ultraGridColumn2:Header:Fixed = TRUE.
        ultraGridColumn2:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn2:Header:VisiblePosition = 1.
        ultraGridColumn2:SortComparisonType = Infragistics.Win.UltraWinGrid.SortComparisonType:CaseInsensitive.
        ultraGridColumn2:Width = 107.
        ultraGridColumn3:Header:Caption = "Mode".
        ultraGridColumn3:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn3:Header:VisiblePosition = 2.
        ultraGridColumn3:Style = Infragistics.Win.UltraWinGrid.ColumnStyle:DropDownList.
        ultraGridColumn3:Width = 76.
        ultraGridColumn4:Header:Caption = "Tab Stop".
        ultraGridColumn4:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn4:Header:VisiblePosition = 3.
        ultraGridColumn4:Hidden = TRUE.
        ultraGridColumn4:LockedWidth = TRUE.
        ultraGridColumn4:Width = 57.
        ultraGridColumn5:CellActivation = Infragistics.Win.UltraWinGrid.Activation:NoEdit.
        ultraGridColumn5:Header:Caption = "Tab Index".
        ultraGridColumn5:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn5:Header:VisiblePosition = 4.
        ultraGridColumn5:Hidden = TRUE.
        ultraGridColumn5:Width = 63.
        ultraGridColumn6:CellActivation = Infragistics.Win.UltraWinGrid.Activation:NoEdit.
        ultraGridColumn6:CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction:RowSelect.
        ultraGridColumn6:Header:Caption = "".
        ultraGridColumn6:Header:Enabled = FALSE.
        ultraGridColumn6:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn6:Header:VisiblePosition = 5.
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar0 AS System.Object EXTENT 6 NO-UNDO.
        arrayvar0[1] = ultraGridColumn1.
        arrayvar0[2] = ultraGridColumn2.
        arrayvar0[3] = ultraGridColumn3.
        arrayvar0[4] = ultraGridColumn4.
        arrayvar0[5] = ultraGridColumn5.
        arrayvar0[6] = ultraGridColumn6.
        ultraGridBand1:Columns:AddRange(arrayvar0).
        THIS-OBJECT:ultraGrid1:DisplayLayout:BandsSerializer:Add(ultraGridBand1).
        THIS-OBJECT:ultraGrid1:DisplayLayout:BorderStyle = Infragistics.Win.UIElementBorderStyle:Solid.
        THIS-OBJECT:ultraGrid1:DisplayLayout:CaptionVisible = Infragistics.Win.DefaultableBoolean:False.
        THIS-OBJECT:ultraGrid1:DisplayLayout:EmptyRowSettings:ShowEmptyRows = TRUE.
        appearance40:BackColor = System.Drawing.SystemColors:ActiveBorder.
        appearance40:BackColor2 = System.Drawing.SystemColors:ControlDark.
        appearance40:BackGradientStyle = Infragistics.Win.GradientStyle:Vertical.
        appearance40:BorderColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:ultraGrid1:DisplayLayout:GroupByBox:Appearance = appearance40.
        appearance41:ForeColor = System.Drawing.SystemColors:GrayText.
        THIS-OBJECT:ultraGrid1:DisplayLayout:GroupByBox:BandLabelAppearance = appearance41.
        THIS-OBJECT:ultraGrid1:DisplayLayout:GroupByBox:BorderStyle = Infragistics.Win.UIElementBorderStyle:Solid.
        THIS-OBJECT:ultraGrid1:DisplayLayout:GroupByBox:Hidden = TRUE.
        appearance42:BackColor = System.Drawing.SystemColors:ControlLightLight.
        appearance42:BackColor2 = System.Drawing.SystemColors:Control.
        appearance42:BackGradientStyle = Infragistics.Win.GradientStyle:Horizontal.
        appearance42:ForeColor = System.Drawing.SystemColors:GrayText.
        THIS-OBJECT:ultraGrid1:DisplayLayout:GroupByBox:PromptAppearance = appearance42.
        THIS-OBJECT:ultraGrid1:DisplayLayout:MaxColScrollRegions = 1.
        THIS-OBJECT:ultraGrid1:DisplayLayout:MaxRowScrollRegions = 1.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew:No.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:AllowColMoving = Infragistics.Win.UltraWinGrid.AllowColMoving:NotAllowed.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:AllowDelete = Infragistics.Win.DefaultableBoolean:False.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:BorderStyleCell = Infragistics.Win.UIElementBorderStyle:Dotted.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:BorderStyleRow = Infragistics.Win.UIElementBorderStyle:Dotted.
        appearance45:BackColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:CardAreaAppearance = appearance45.
        appearance46:BorderColor = System.Drawing.Color:Silver.
        appearance46:TextTrimming = Infragistics.Win.TextTrimming:EllipsisCharacter.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:CellAppearance = appearance46.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:CellPadding = 0.
        appearance47:BackColor = System.Drawing.SystemColors:Control.
        appearance47:BackColor2 = System.Drawing.SystemColors:ControlDark.
        appearance47:BackGradientAlignment = Infragistics.Win.GradientAlignment:Element.
        appearance47:BackGradientStyle = Infragistics.Win.GradientStyle:Horizontal.
        appearance47:BorderColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:GroupByRowAppearance = appearance47.
        appearance48:TextHAlignAsString = "Left".
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:HeaderAppearance = appearance48.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction:SortSingle.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:HeaderStyle = Infragistics.Win.HeaderStyle:WindowsXPCommand.
        appearance49:BackColor = System.Drawing.SystemColors:Window.
        appearance49:BorderColor = System.Drawing.Color:Silver.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:RowAppearance = appearance49.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:RowSelectors = Infragistics.Win.DefaultableBoolean:False.
        appearance50:BackColor = System.Drawing.SystemColors:Highlight.
        appearance50:ForeColor = System.Drawing.SystemColors:HighlightText.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:SelectedCellAppearance = appearance50.
        appearance51:BackColor = System.Drawing.SystemColors:Highlight.
        appearance51:ForeColor = System.Drawing.SystemColors:HighlightText.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:SelectedRowAppearance = appearance51.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType:None.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:SelectTypeCol = Infragistics.Win.UltraWinGrid.SelectType:None.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType:Extended.
        appearance63:BackColor = System.Drawing.SystemColors:ControlLight.
        THIS-OBJECT:ultraGrid1:DisplayLayout:Override:TemplateAddRowAppearance = appearance63.
        THIS-OBJECT:ultraGrid1:DisplayLayout:ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds:ScrollToFill.
        THIS-OBJECT:ultraGrid1:DisplayLayout:ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle:Immediate.
        THIS-OBJECT:ultraGrid1:DisplayLayout:TabNavigation = Infragistics.Win.UltraWinGrid.TabNavigation:NextControlOnLastCell.
        THIS-OBJECT:ultraGrid1:DisplayLayout:UseFixedHeaders = TRUE.
        THIS-OBJECT:ultraGrid1:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:ultraGrid1:Font = NEW System.Drawing.Font("Microsoft Sans Serif", 8.25, System.Drawing.FontStyle:Regular, System.Drawing.GraphicsUnit:Point, System.Convert:ToByte(0)).
        THIS-OBJECT:ultraGrid1:Location = NEW System.Drawing.Point(0, 17).
        THIS-OBJECT:ultraGrid1:Name = "ultraGrid1".
        THIS-OBJECT:ultraGrid1:Size = NEW System.Drawing.Size(226, 593).
        THIS-OBJECT:ultraGrid1:TabIndex = 1.
        THIS-OBJECT:ultraGrid1:Text = "ultraGrid1".
        THIS-OBJECT:ultraGrid1:UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode:OnCellChangeOrLostFocus.
        THIS-OBJECT:ultraGrid1:InitializeLayout:SUBSCRIBE(THIS-OBJECT:ultraGrid1_InitializeLayout).
        THIS-OBJECT:ultraGrid1:AfterSelectChange:SUBSCRIBE(THIS-OBJECT:ultraGrid1_AfterSelectChange).
        THIS-OBJECT:ultraGrid1:CellChange:SUBSCRIBE(THIS-OBJECT:ultraGrid1_CellChange).
        /*  */
        /* ultraDataSource1 */
        /*  */
        THIS-OBJECT:ultraDataSource1:AllowAdd = FALSE.
        THIS-OBJECT:ultraDataSource1:AllowDelete = FALSE.
        ultraDataColumn1:DataType = Progress.Util.TypeHelper:GetType("System.Boolean").
        ultraDataColumn1:ReadOnly = Infragistics.Win.DefaultableBoolean:False.
        ultraDataColumn2:ReadOnly = Infragistics.Win.DefaultableBoolean:True.
        ultraDataColumn3:ReadOnly = Infragistics.Win.DefaultableBoolean:False.
        ultraDataColumn4:DataType = Progress.Util.TypeHelper:GetType("System.Boolean").
        ultraDataColumn4:DefaultValue = FALSE.
        ultraDataColumn4:ReadOnly = Infragistics.Win.DefaultableBoolean:False.
        ultraDataColumn5:DataType = Progress.Util.TypeHelper:GetType("System.Int32").
        ultraDataColumn5:DefaultValue = 0.
        ultraDataColumn5:ReadOnly = Infragistics.Win.DefaultableBoolean:False.
        ultraDataColumn6:DefaultValue = "".
        ultraDataColumn6:ReadOnly = Infragistics.Win.DefaultableBoolean:True.
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar1 AS System.Object EXTENT 6 NO-UNDO.
        arrayvar1[1] = ultraDataColumn1.
        arrayvar1[2] = ultraDataColumn2.
        arrayvar1[3] = ultraDataColumn3.
        arrayvar1[4] = ultraDataColumn4.
        arrayvar1[5] = ultraDataColumn5.
        arrayvar1[6] = ultraDataColumn6.
        THIS-OBJECT:ultraDataSource1:Band:Columns:AddRange(arrayvar1).
        /*  */
        /* pnlProperties */
        /*  */
        THIS-OBJECT:pnlProperties:AutoScroll = TRUE.
        THIS-OBJECT:pnlProperties:BackColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:pnlProperties:Controls:Add(THIS-OBJECT:ultraLabel5).
        THIS-OBJECT:pnlProperties:Controls:Add(THIS-OBJECT:ultraLabel3).
        THIS-OBJECT:pnlProperties:Controls:Add(THIS-OBJECT:txtY).
        THIS-OBJECT:pnlProperties:Controls:Add(THIS-OBJECT:txtX).
        THIS-OBJECT:pnlProperties:Controls:Add(THIS-OBJECT:txtHeight).
        THIS-OBJECT:pnlProperties:Controls:Add(THIS-OBJECT:ultraLabel4).
        THIS-OBJECT:pnlProperties:Controls:Add(THIS-OBJECT:txtWidth).
        THIS-OBJECT:pnlProperties:Controls:Add(THIS-OBJECT:ultraLabel2).
        THIS-OBJECT:pnlProperties:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:pnlProperties:Location = NEW System.Drawing.Point(0, 16).
        THIS-OBJECT:pnlProperties:Name = "pnlProperties".
        THIS-OBJECT:pnlProperties:Size = NEW System.Drawing.Size(150, 30).
        THIS-OBJECT:pnlProperties:TabIndex = 1.
        /*  */
        /* ultraLabel5 */
        /*  */
        appearance14:BackColor = System.Drawing.Color:Transparent.
        THIS-OBJECT:ultraLabel5:Appearance = appearance14.
        THIS-OBJECT:ultraLabel5:Location = NEW System.Drawing.Point(13, 17).
        THIS-OBJECT:ultraLabel5:Name = "ultraLabel5".
        THIS-OBJECT:ultraLabel5:Size = NEW System.Drawing.Size(45, 14).
        THIS-OBJECT:ultraLabel5:TabIndex = 0.
        THIS-OBJECT:ultraLabel5:Text = "Left".
        /*  */
        /* ultraLabel3 */
        /*  */
        appearance17:BackColor = System.Drawing.Color:Transparent.
        THIS-OBJECT:ultraLabel3:Appearance = appearance17.
        THIS-OBJECT:ultraLabel3:Location = NEW System.Drawing.Point(13, 71).
        THIS-OBJECT:ultraLabel3:Name = "ultraLabel3".
        THIS-OBJECT:ultraLabel3:Size = NEW System.Drawing.Size(45, 14).
        THIS-OBJECT:ultraLabel3:TabIndex = 4.
        THIS-OBJECT:ultraLabel3:Text = "Width".
        /*  */
        /* txtY */
        /*  */
        THIS-OBJECT:txtY:Location = NEW System.Drawing.Point(82, 40).
        THIS-OBJECT:txtY:MaskInput = "-nnnnnnnnn".
        THIS-OBJECT:txtY:Name = "txtY".
        THIS-OBJECT:txtY:Nullable = TRUE.
        THIS-OBJECT:txtY:NullText = "0".
        THIS-OBJECT:txtY:PromptChar = ' '.
        THIS-OBJECT:txtY:Size = NEW System.Drawing.Size(69, 21).
        THIS-OBJECT:txtY:TabIndex = 3.
        THIS-OBJECT:txtY:Leave:SUBSCRIBE(THIS-OBJECT:txtX_Leave).
        /*  */
        /* txtX */
        /*  */
        THIS-OBJECT:txtX:Location = NEW System.Drawing.Point(82, 13).
        THIS-OBJECT:txtX:MaskInput = "-nnnnnnnnn".
        THIS-OBJECT:txtX:Name = "txtX".
        THIS-OBJECT:txtX:Nullable = TRUE.
        THIS-OBJECT:txtX:NullText = "0".
        THIS-OBJECT:txtX:PromptChar = ' '.
        THIS-OBJECT:txtX:Size = NEW System.Drawing.Size(69, 21).
        THIS-OBJECT:txtX:TabIndex = 1.
        THIS-OBJECT:txtX:Leave:SUBSCRIBE(THIS-OBJECT:txtX_Leave).
        /*  */
        /* txtHeight */
        /*  */
        THIS-OBJECT:txtHeight:Enabled = FALSE.
        THIS-OBJECT:txtHeight:Location = NEW System.Drawing.Point(82, 94).
        THIS-OBJECT:txtHeight:Name = "txtHeight".
        THIS-OBJECT:txtHeight:Nullable = TRUE.
        THIS-OBJECT:txtHeight:NullText = "0".
        THIS-OBJECT:txtHeight:PromptChar = ' '.
        THIS-OBJECT:txtHeight:Size = NEW System.Drawing.Size(69, 21).
        THIS-OBJECT:txtHeight:TabIndex = 7.
        THIS-OBJECT:txtHeight:Leave:SUBSCRIBE(THIS-OBJECT:txtX_Leave).
        /*  */
        /* ultraLabel4 */
        /*  */
        appearance15:BackColor = System.Drawing.Color:Transparent.
        THIS-OBJECT:ultraLabel4:Appearance = appearance15.
        THIS-OBJECT:ultraLabel4:Location = NEW System.Drawing.Point(13, 44).
        THIS-OBJECT:ultraLabel4:Name = "ultraLabel4".
        THIS-OBJECT:ultraLabel4:Size = NEW System.Drawing.Size(45, 14).
        THIS-OBJECT:ultraLabel4:TabIndex = 2.
        THIS-OBJECT:ultraLabel4:Text = "Top".
        /*  */
        /* txtWidth */
        /*  */
        THIS-OBJECT:txtWidth:Enabled = FALSE.
        THIS-OBJECT:txtWidth:Location = NEW System.Drawing.Point(82, 67).
        THIS-OBJECT:txtWidth:Name = "txtWidth".
        THIS-OBJECT:txtWidth:Nullable = TRUE.
        THIS-OBJECT:txtWidth:NullText = "0".
        THIS-OBJECT:txtWidth:PromptChar = ' '.
        THIS-OBJECT:txtWidth:Size = NEW System.Drawing.Size(69, 21).
        THIS-OBJECT:txtWidth:TabIndex = 5.
        THIS-OBJECT:txtWidth:Leave:SUBSCRIBE(THIS-OBJECT:txtX_Leave).
        /*  */
        /* ultraLabel2 */
        /*  */
        appearance3:BackColor = System.Drawing.Color:Transparent.
        THIS-OBJECT:ultraLabel2:Appearance = appearance3.
        THIS-OBJECT:ultraLabel2:Location = NEW System.Drawing.Point(13, 98).
        THIS-OBJECT:ultraLabel2:Name = "ultraLabel2".
        THIS-OBJECT:ultraLabel2:Size = NEW System.Drawing.Size(45, 14).
        THIS-OBJECT:ultraLabel2:TabIndex = 6.
        THIS-OBJECT:ultraLabel2:Text = "Height".
        /*  */
        /* LayoutEditor_Fill_Panel */
        /*  */
        THIS-OBJECT:LayoutEditor_Fill_Panel:Controls:Add(THIS-OBJECT:splitContainer1).
        THIS-OBJECT:LayoutEditor_Fill_Panel:Cursor = System.Windows.Forms.Cursors:Default.
        THIS-OBJECT:LayoutEditor_Fill_Panel:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:LayoutEditor_Fill_Panel:Location = NEW System.Drawing.Point(0, 56).
        THIS-OBJECT:LayoutEditor_Fill_Panel:Name = "LayoutEditor_Fill_Panel".
        THIS-OBJECT:LayoutEditor_Fill_Panel:Size = NEW System.Drawing.Size(1016, 610).
        THIS-OBJECT:LayoutEditor_Fill_Panel:TabIndex = 1.
        /*  */
        /* splitContainer1 */
        /*  */
        THIS-OBJECT:splitContainer1:BackColor = System.Drawing.Color:Transparent.
        THIS-OBJECT:splitContainer1:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:splitContainer1:FixedPanel = System.Windows.Forms.FixedPanel:Panel2.
        THIS-OBJECT:splitContainer1:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:splitContainer1:Name = "splitContainer1".
        /*  */
        /* splitContainer1.Panel1 */
        /*  */
        THIS-OBJECT:splitContainer1:Panel1:BackColor = System.Drawing.Color:Transparent.
        THIS-OBJECT:splitContainer1:Panel1:Controls:Add(THIS-OBJECT:splitContainer3).
        /*  */
        /* splitContainer1.Panel2 */
        /*  */
        THIS-OBJECT:splitContainer1:Panel2:Controls:Add(THIS-OBJECT:splitContainer2).
        THIS-OBJECT:splitContainer1:Size = NEW System.Drawing.Size(1016, 610).
        THIS-OBJECT:splitContainer1:SplitterDistance = 786.
        THIS-OBJECT:splitContainer1:TabIndex = 0.
        /*  */
        /* splitContainer3 */
        /*  */
        THIS-OBJECT:splitContainer3:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:splitContainer3:FixedPanel = System.Windows.Forms.FixedPanel:Panel1.
        THIS-OBJECT:splitContainer3:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:splitContainer3:Name = "splitContainer3".
        /*  */
        /* splitContainer3.Panel1 */
        /*  */
        THIS-OBJECT:splitContainer3:Panel1:Controls:Add(THIS-OBJECT:splitContainerTabSettings).
        /*  */
        /* splitContainer3.Panel2 */
        /*  */
        THIS-OBJECT:splitContainer3:Panel2:Controls:Add(THIS-OBJECT:panel3).
        THIS-OBJECT:splitContainer3:Size = NEW System.Drawing.Size(786, 610).
        THIS-OBJECT:splitContainer3:SplitterDistance = 212.
        THIS-OBJECT:splitContainer3:TabIndex = 4.
        /*  */
        /* splitContainerTabSettings */
        /*  */
        THIS-OBJECT:splitContainerTabSettings:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:splitContainerTabSettings:FixedPanel = System.Windows.Forms.FixedPanel:Panel2.
        THIS-OBJECT:splitContainerTabSettings:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:splitContainerTabSettings:Name = "splitContainerTabSettings".
        THIS-OBJECT:splitContainerTabSettings:Orientation = System.Windows.Forms.Orientation:Horizontal.
        /*  */
        /* splitContainerTabSettings.Panel1 */
        /*  */
        THIS-OBJECT:splitContainerTabSettings:Panel1:Controls:Add(THIS-OBJECT:ultraGrid3).
        THIS-OBJECT:splitContainerTabSettings:Panel1:Controls:Add(THIS-OBJECT:panel2).
        THIS-OBJECT:splitContainerTabSettings:Panel1:Controls:Add(THIS-OBJECT:ultraLabel8).
        /*  */
        /* splitContainerTabSettings.Panel2 */
        /*  */
        THIS-OBJECT:splitContainerTabSettings:Panel2:Controls:Add(THIS-OBJECT:panel1).
        THIS-OBJECT:splitContainerTabSettings:Size = NEW System.Drawing.Size(212, 610).
        THIS-OBJECT:splitContainerTabSettings:SplitterDistance = 465.
        THIS-OBJECT:splitContainerTabSettings:TabIndex = 3.
        /*  */
        /* ultraGrid3 */
        /*  */
        THIS-OBJECT:ultraGrid3:DataSource = THIS-OBJECT:ultraDataSourceTabSettings.
        appearance61:BackColor = System.Drawing.SystemColors:Window.
        appearance61:BorderColor = System.Drawing.SystemColors:InactiveCaption.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Appearance = appearance61.
        THIS-OBJECT:ultraGrid3:DisplayLayout:AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle:ExtendLastColumn.
        ultraGridColumn7:Header:Caption = "".
        ultraGridColumn7:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn7:Header:VisiblePosition = 0.
        ultraGridColumn7:MaxWidth = 23.
        ultraGridColumn7:Width = 23.
        ultraGridColumn8:CellActivation = Infragistics.Win.UltraWinGrid.Activation:NoEdit.
        ultraGridColumn8:CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction:RowSelect.
        ultraGridColumn8:Header:Caption = "Name".
        ultraGridColumn8:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn8:Header:VisiblePosition = 1.
        ultraGridColumn8:Width = 14.
        ultraGridColumn9:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn9:Header:VisiblePosition = 2.
        ultraGridColumn9:Hidden = TRUE.
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar2 AS System.Object EXTENT 3 NO-UNDO.
        arrayvar2[1] = ultraGridColumn7.
        arrayvar2[2] = ultraGridColumn8.
        arrayvar2[3] = ultraGridColumn9.
        ultraGridBand2:Columns:AddRange(arrayvar2).
        THIS-OBJECT:ultraGrid3:DisplayLayout:BandsSerializer:Add(ultraGridBand2).
        THIS-OBJECT:ultraGrid3:DisplayLayout:BorderStyle = Infragistics.Win.UIElementBorderStyle:Solid.
        THIS-OBJECT:ultraGrid3:DisplayLayout:CaptionVisible = Infragistics.Win.DefaultableBoolean:False.
        THIS-OBJECT:ultraGrid3:DisplayLayout:EmptyRowSettings:ShowEmptyRows = TRUE.
        appearance78:BackColor = System.Drawing.SystemColors:ActiveBorder.
        appearance78:BackColor2 = System.Drawing.SystemColors:ControlDark.
        appearance78:BackGradientStyle = Infragistics.Win.GradientStyle:Vertical.
        appearance78:BorderColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:ultraGrid3:DisplayLayout:GroupByBox:Appearance = appearance78.
        appearance79:ForeColor = System.Drawing.SystemColors:GrayText.
        THIS-OBJECT:ultraGrid3:DisplayLayout:GroupByBox:BandLabelAppearance = appearance79.
        THIS-OBJECT:ultraGrid3:DisplayLayout:GroupByBox:BorderStyle = Infragistics.Win.UIElementBorderStyle:Solid.
        THIS-OBJECT:ultraGrid3:DisplayLayout:GroupByBox:Hidden = TRUE.
        appearance80:BackColor = System.Drawing.SystemColors:ControlLightLight.
        appearance80:BackColor2 = System.Drawing.SystemColors:Control.
        appearance80:BackGradientStyle = Infragistics.Win.GradientStyle:Horizontal.
        appearance80:ForeColor = System.Drawing.SystemColors:GrayText.
        THIS-OBJECT:ultraGrid3:DisplayLayout:GroupByBox:PromptAppearance = appearance80.
        THIS-OBJECT:ultraGrid3:DisplayLayout:MaxColScrollRegions = 1.
        THIS-OBJECT:ultraGrid3:DisplayLayout:MaxRowScrollRegions = 1.
        appearance4:BackColor = System.Drawing.SystemColors:Highlight.
        appearance4:ForeColor = System.Drawing.SystemColors:HighlightText.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:ActiveRowAppearance = appearance4.
        appearance5:BackColor = System.Drawing.SystemColors:Highlight.
        appearance5:ForeColor = System.Drawing.SystemColors:HighlightText.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:ActiveRowCellAppearance = appearance5.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew:No.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:AllowColMoving = Infragistics.Win.UltraWinGrid.AllowColMoving:NotAllowed.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:AllowColSwapping = Infragistics.Win.UltraWinGrid.AllowColSwapping:NotAllowed.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:AllowDelete = Infragistics.Win.DefaultableBoolean:False.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:BorderStyleCell = Infragistics.Win.UIElementBorderStyle:Dotted.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:BorderStyleRow = Infragistics.Win.UIElementBorderStyle:Dotted.
        appearance83:BackColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:CardAreaAppearance = appearance83.
        appearance84:BorderColor = System.Drawing.Color:Silver.
        appearance84:TextTrimming = Infragistics.Win.TextTrimming:EllipsisCharacter.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:CellAppearance = appearance84.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:CellPadding = 0.
        appearance85:BackColor = System.Drawing.SystemColors:Control.
        appearance85:BackColor2 = System.Drawing.SystemColors:ControlDark.
        appearance85:BackGradientAlignment = Infragistics.Win.GradientAlignment:Element.
        appearance85:BackGradientStyle = Infragistics.Win.GradientStyle:Horizontal.
        appearance85:BorderColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:GroupByRowAppearance = appearance85.
        appearance86:TextHAlignAsString = "Left".
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:HeaderAppearance = appearance86.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction:SortSingle.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:HeaderStyle = Infragistics.Win.HeaderStyle:WindowsXPCommand.
        appearance87:BackColor = System.Drawing.SystemColors:Window.
        appearance87:BorderColor = System.Drawing.Color:Silver.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:RowAppearance = appearance87.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:RowSelectors = Infragistics.Win.DefaultableBoolean:False.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType:None.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:SelectTypeCol = Infragistics.Win.UltraWinGrid.SelectType:None.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType:Single.
        appearance90:BackColor = System.Drawing.SystemColors:ControlLight.
        THIS-OBJECT:ultraGrid3:DisplayLayout:Override:TemplateAddRowAppearance = appearance90.
        THIS-OBJECT:ultraGrid3:DisplayLayout:ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds:ScrollToFill.
        THIS-OBJECT:ultraGrid3:DisplayLayout:ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle:Immediate.
        THIS-OBJECT:ultraGrid3:DisplayLayout:TabNavigation = Infragistics.Win.UltraWinGrid.TabNavigation:NextControlOnLastCell.
        THIS-OBJECT:ultraGrid3:DisplayLayout:UseFixedHeaders = TRUE.
        THIS-OBJECT:ultraGrid3:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:ultraGrid3:Font = NEW System.Drawing.Font("Microsoft Sans Serif", 8.25, System.Drawing.FontStyle:Regular, System.Drawing.GraphicsUnit:Point, System.Convert:ToByte(0)).
        THIS-OBJECT:ultraGrid3:Location = NEW System.Drawing.Point(0, 17).
        THIS-OBJECT:ultraGrid3:Name = "ultraGrid3".
        THIS-OBJECT:ultraGrid3:Size = NEW System.Drawing.Size(212, 420).
        THIS-OBJECT:ultraGrid3:TabIndex = 1.
        THIS-OBJECT:ultraGrid3:Text = "ultraGrid3".
        THIS-OBJECT:ultraGrid3:UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode:OnCellChangeOrLostFocus.
        THIS-OBJECT:ultraGrid3:BeforeSortChange:SUBSCRIBE(THIS-OBJECT:ultraGrid3_BeforeSortChange).
        THIS-OBJECT:ultraGrid3:AfterRowActivate:SUBSCRIBE(THIS-OBJECT:ultraGrid3_AfterRowActivate).
        THIS-OBJECT:ultraGrid3:CellChange:SUBSCRIBE(THIS-OBJECT:ultraGrid3_CellChange).
        /*  */
        /* ultraDataSourceTabSettings */
        /*  */
        ultraDataColumn7:DataType = Progress.Util.TypeHelper:GetType("System.Boolean").
        ultraDataColumn7:DefaultValue = FALSE.
        ultraDataColumn7:ReadOnly = Infragistics.Win.DefaultableBoolean:False.
        ultraDataColumn8:ReadOnly = Infragistics.Win.DefaultableBoolean:True.
        ultraDataColumn9:DataType = Progress.Util.TypeHelper:GetType("System.Int32").
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar3 AS System.Object EXTENT 3 NO-UNDO.
        arrayvar3[1] = ultraDataColumn7.
        arrayvar3[2] = ultraDataColumn8.
        arrayvar3[3] = ultraDataColumn9.
        THIS-OBJECT:ultraDataSourceTabSettings:Band:Columns:AddRange(arrayvar3).
        /*  */
        /* panel2 */
        /*  */
        THIS-OBJECT:panel2:Controls:Add(THIS-OBJECT:btnDown).
        THIS-OBJECT:panel2:Controls:Add(THIS-OBJECT:btnUp).
        THIS-OBJECT:panel2:Dock = System.Windows.Forms.DockStyle:Bottom.
        THIS-OBJECT:panel2:Location = NEW System.Drawing.Point(0, 437).
        THIS-OBJECT:panel2:Name = "panel2".
        THIS-OBJECT:panel2:Padding = NEW System.Windows.Forms.Padding(2).
        THIS-OBJECT:panel2:Size = NEW System.Drawing.Size(212, 28).
        THIS-OBJECT:panel2:TabIndex = 2.
        /*  */
        /* btnDown */
        /*  */
        THIS-OBJECT:btnDown:Anchor = System.Windows.Forms.AnchorStyles:None.
        appearance52:ImageHAlign = Infragistics.Win.HAlign:Center.
        appearance52:ImageVAlign = Infragistics.Win.VAlign:Middle.
        THIS-OBJECT:btnDown:Appearance = appearance52.
        THIS-OBJECT:btnDown:Location = NEW System.Drawing.Point(109, 3).
        THIS-OBJECT:btnDown:Name = "btnDown".
        THIS-OBJECT:btnDown:ShowFocusRect = FALSE.
        THIS-OBJECT:btnDown:Size = NEW System.Drawing.Size(80, 23).
        THIS-OBJECT:btnDown:TabIndex = 1.
        THIS-OBJECT:btnDown:Text = "Move Down".
        THIS-OBJECT:btnDown:Click:SUBSCRIBE(THIS-OBJECT:btnDown_Click).
        /*  */
        /* btnUp */
        /*  */
        THIS-OBJECT:btnUp:Anchor = System.Windows.Forms.AnchorStyles:None.
        appearance37:ImageHAlign = Infragistics.Win.HAlign:Center.
        appearance37:ImageVAlign = Infragistics.Win.VAlign:Middle.
        THIS-OBJECT:btnUp:Appearance = appearance37.
        THIS-OBJECT:btnUp:Location = NEW System.Drawing.Point(23, 3).
        THIS-OBJECT:btnUp:Name = "btnUp".
        THIS-OBJECT:btnUp:ShowFocusRect = FALSE.
        THIS-OBJECT:btnUp:Size = NEW System.Drawing.Size(80, 23).
        THIS-OBJECT:btnUp:TabIndex = 0.
        THIS-OBJECT:btnUp:Text = "Move Up".
        THIS-OBJECT:btnUp:Click:SUBSCRIBE(THIS-OBJECT:btnUp_Click).
        /*  */
        /* ultraLabel8 */
        /*  */
        appearance38:BackColor = System.Drawing.SystemColors:InactiveCaptionText.
        appearance38:BackColor2 = System.Drawing.SystemColors:GradientInactiveCaption.
        appearance38:BackGradientStyle = Infragistics.Win.GradientStyle:Vertical.
        appearance38:FontData:BoldAsString = "True".
        appearance38:TextTrimming = Infragistics.Win.TextTrimming:EllipsisCharacter.
        appearance38:TextVAlignAsString = "Middle".
        THIS-OBJECT:ultraLabel8:Appearance = appearance38.
        THIS-OBJECT:ultraLabel8:Dock = System.Windows.Forms.DockStyle:Top.
        THIS-OBJECT:ultraLabel8:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:ultraLabel8:Name = "ultraLabel8".
        THIS-OBJECT:ultraLabel8:Size = NEW System.Drawing.Size(212, 17).
        THIS-OBJECT:ultraLabel8:TabIndex = 0.
        THIS-OBJECT:ultraLabel8:Text = "Adjust Tab Order".
        THIS-OBJECT:ultraLabel8:UseMnemonic = FALSE.
        THIS-OBJECT:ultraLabel8:WrapText = FALSE.
        /*  */
        /* panel1 */
        /*  */
        THIS-OBJECT:panel1:Controls:Add(THIS-OBJECT:ultraGrid2).
        THIS-OBJECT:panel1:Controls:Add(THIS-OBJECT:lblChildControls).
        THIS-OBJECT:panel1:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:panel1:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:panel1:Name = "panel1".
        THIS-OBJECT:panel1:Size = NEW System.Drawing.Size(212, 141).
        THIS-OBJECT:panel1:TabIndex = 4.
        /*  */
        /* ultraGrid2 */
        /*  */
        THIS-OBJECT:ultraGrid2:DataSource = THIS-OBJECT:ultraDataSourceChildTabSettings.
        appearance70:BackColor = System.Drawing.SystemColors:Window.
        appearance70:BorderColor = System.Drawing.SystemColors:InactiveCaption.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Appearance = appearance70.
        THIS-OBJECT:ultraGrid2:DisplayLayout:AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle:ExtendLastColumn.
        ultraGridColumn10:CellActivation = Infragistics.Win.UltraWinGrid.Activation:NoEdit.
        ultraGridColumn10:CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction:RowSelect.
        ultraGridColumn10:Header:Caption = "Name".
        ultraGridColumn10:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn10:Header:VisiblePosition = 1.
        ultraGridColumn10:SortComparisonType = Infragistics.Win.UltraWinGrid.SortComparisonType:CaseInsensitive.
        ultraGridColumn10:Width = 14.
        ultraGridColumn11:Header:Caption = "".
        ultraGridColumn11:Header:FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator:None.
        ultraGridColumn11:Header:VisiblePosition = 0.
        ultraGridColumn11:LockedWidth = TRUE.
        ultraGridColumn11:MaxWidth = 23.
        ultraGridColumn11:Width = 23.
        ultraGridColumn12:Header:VisiblePosition = 2.
        ultraGridColumn12:Hidden = TRUE.
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar4 AS System.Object EXTENT 3 NO-UNDO.
        arrayvar4[1] = ultraGridColumn10.
        arrayvar4[2] = ultraGridColumn11.
        arrayvar4[3] = ultraGridColumn12.
        ultraGridBand3:Columns:AddRange(arrayvar4).
        THIS-OBJECT:ultraGrid2:DisplayLayout:BandsSerializer:Add(ultraGridBand3).
        THIS-OBJECT:ultraGrid2:DisplayLayout:BorderStyle = Infragistics.Win.UIElementBorderStyle:Solid.
        THIS-OBJECT:ultraGrid2:DisplayLayout:CaptionVisible = Infragistics.Win.DefaultableBoolean:False.
        THIS-OBJECT:ultraGrid2:DisplayLayout:EmptyRowSettings:ShowEmptyRows = TRUE.
        appearance71:BackColor = System.Drawing.SystemColors:ActiveBorder.
        appearance71:BackColor2 = System.Drawing.SystemColors:ControlDark.
        appearance71:BackGradientStyle = Infragistics.Win.GradientStyle:Vertical.
        appearance71:BorderColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:ultraGrid2:DisplayLayout:GroupByBox:Appearance = appearance71.
        appearance72:ForeColor = System.Drawing.SystemColors:GrayText.
        THIS-OBJECT:ultraGrid2:DisplayLayout:GroupByBox:BandLabelAppearance = appearance72.
        THIS-OBJECT:ultraGrid2:DisplayLayout:GroupByBox:BorderStyle = Infragistics.Win.UIElementBorderStyle:Solid.
        THIS-OBJECT:ultraGrid2:DisplayLayout:GroupByBox:Hidden = TRUE.
        appearance73:BackColor = System.Drawing.SystemColors:ControlLightLight.
        appearance73:BackColor2 = System.Drawing.SystemColors:Control.
        appearance73:BackGradientStyle = Infragistics.Win.GradientStyle:Horizontal.
        appearance73:ForeColor = System.Drawing.SystemColors:GrayText.
        THIS-OBJECT:ultraGrid2:DisplayLayout:GroupByBox:PromptAppearance = appearance73.
        THIS-OBJECT:ultraGrid2:DisplayLayout:MaxColScrollRegions = 1.
        THIS-OBJECT:ultraGrid2:DisplayLayout:MaxRowScrollRegions = 1.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew:No.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:AllowColMoving = Infragistics.Win.UltraWinGrid.AllowColMoving:NotAllowed.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:AllowColSwapping = Infragistics.Win.UltraWinGrid.AllowColSwapping:NotAllowed.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:AllowDelete = Infragistics.Win.DefaultableBoolean:False.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:BorderStyleCell = Infragistics.Win.UIElementBorderStyle:Dotted.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:BorderStyleRow = Infragistics.Win.UIElementBorderStyle:Dotted.
        appearance76:BackColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:CardAreaAppearance = appearance76.
        appearance77:BorderColor = System.Drawing.Color:Silver.
        appearance77:TextTrimming = Infragistics.Win.TextTrimming:EllipsisCharacter.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:CellAppearance = appearance77.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:CellPadding = 0.
        appearance92:BackColor = System.Drawing.SystemColors:Control.
        appearance92:BackColor2 = System.Drawing.SystemColors:ControlDark.
        appearance92:BackGradientAlignment = Infragistics.Win.GradientAlignment:Element.
        appearance92:BackGradientStyle = Infragistics.Win.GradientStyle:Horizontal.
        appearance92:BorderColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:GroupByRowAppearance = appearance92.
        appearance93:TextHAlignAsString = "Left".
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:HeaderAppearance = appearance93.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction:SortSingle.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:HeaderStyle = Infragistics.Win.HeaderStyle:WindowsXPCommand.
        appearance94:BackColor = System.Drawing.SystemColors:Window.
        appearance94:BorderColor = System.Drawing.Color:Silver.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:RowAppearance = appearance94.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:RowSelectors = Infragistics.Win.DefaultableBoolean:False.
        appearance95:BackColor = System.Drawing.SystemColors:Highlight.
        appearance95:ForeColor = System.Drawing.SystemColors:HighlightText.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:SelectedCellAppearance = appearance95.
        appearance96:BackColor = System.Drawing.SystemColors:Highlight.
        appearance96:ForeColor = System.Drawing.SystemColors:HighlightText.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:SelectedRowAppearance = appearance96.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType:None.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:SelectTypeCol = Infragistics.Win.UltraWinGrid.SelectType:None.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType:None.
        appearance97:BackColor = System.Drawing.SystemColors:ControlLight.
        THIS-OBJECT:ultraGrid2:DisplayLayout:Override:TemplateAddRowAppearance = appearance97.
        THIS-OBJECT:ultraGrid2:DisplayLayout:ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds:ScrollToFill.
        THIS-OBJECT:ultraGrid2:DisplayLayout:ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle:Immediate.
        THIS-OBJECT:ultraGrid2:DisplayLayout:TabNavigation = Infragistics.Win.UltraWinGrid.TabNavigation:NextControlOnLastCell.
        THIS-OBJECT:ultraGrid2:DisplayLayout:UseFixedHeaders = TRUE.
        THIS-OBJECT:ultraGrid2:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:ultraGrid2:Font = NEW System.Drawing.Font("Microsoft Sans Serif", 8.25, System.Drawing.FontStyle:Regular, System.Drawing.GraphicsUnit:Point, System.Convert:ToByte(0)).
        THIS-OBJECT:ultraGrid2:Location = NEW System.Drawing.Point(0, 17).
        THIS-OBJECT:ultraGrid2:Name = "ultraGrid2".
        THIS-OBJECT:ultraGrid2:Size = NEW System.Drawing.Size(212, 124).
        THIS-OBJECT:ultraGrid2:TabIndex = 1.
        THIS-OBJECT:ultraGrid2:Text = "ultraGrid2".
        THIS-OBJECT:ultraGrid2:UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode:OnCellChangeOrLostFocus.
        THIS-OBJECT:ultraGrid2:BeforeSortChange:SUBSCRIBE(THIS-OBJECT:ultraGrid2_BeforeSortChange).
        THIS-OBJECT:ultraGrid2:CellChange:SUBSCRIBE(THIS-OBJECT:ultraGrid2_CellChange).
        /*  */
        /* ultraDataSourceChildTabSettings */
        /*  */
        THIS-OBJECT:ultraDataSourceChildTabSettings:AllowAdd = FALSE.
        THIS-OBJECT:ultraDataSourceChildTabSettings:AllowDelete = FALSE.
        ultraDataColumn10:ReadOnly = Infragistics.Win.DefaultableBoolean:True.
        ultraDataColumn11:DataType = Progress.Util.TypeHelper:GetType("System.Boolean").
        ultraDataColumn11:DefaultValue = FALSE.
        ultraDataColumn11:ReadOnly = Infragistics.Win.DefaultableBoolean:False.
        ultraDataColumn12:DataType = Progress.Util.TypeHelper:GetType("System.Int32").
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar5 AS System.Object EXTENT 3 NO-UNDO.
        arrayvar5[1] = ultraDataColumn10.
        arrayvar5[2] = ultraDataColumn11.
        arrayvar5[3] = ultraDataColumn12.
        THIS-OBJECT:ultraDataSourceChildTabSettings:Band:Columns:AddRange(arrayvar5).
        /*  */
        /* lblChildControls */
        /*  */
        appearance1:BackColor = System.Drawing.SystemColors:InactiveCaptionText.
        appearance1:BackColor2 = System.Drawing.SystemColors:GradientInactiveCaption.
        appearance1:BackGradientStyle = Infragistics.Win.GradientStyle:Vertical.
        appearance1:FontData:BoldAsString = "True".
        appearance1:TextTrimming = Infragistics.Win.TextTrimming:EllipsisCharacter.
        appearance1:TextVAlignAsString = "Middle".
        THIS-OBJECT:lblChildControls:Appearance = appearance1.
        THIS-OBJECT:lblChildControls:Dock = System.Windows.Forms.DockStyle:Top.
        THIS-OBJECT:lblChildControls:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:lblChildControls:Name = "lblChildControls".
        THIS-OBJECT:lblChildControls:Size = NEW System.Drawing.Size(212, 17).
        THIS-OBJECT:lblChildControls:TabIndex = 0.
        THIS-OBJECT:lblChildControls:Text = "Set Tab Stops".
        THIS-OBJECT:lblChildControls:UseMnemonic = FALSE.
        THIS-OBJECT:lblChildControls:WrapText = FALSE.
        /*  */
        /* panel3 */
        /*  */
        THIS-OBJECT:panel3:BackColor = System.Drawing.SystemColors:ControlDark.
        THIS-OBJECT:panel3:Controls:Add(THIS-OBJECT:pnlView).
        THIS-OBJECT:panel3:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:panel3:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:panel3:Name = "panel3".
        THIS-OBJECT:panel3:Padding = NEW System.Windows.Forms.Padding(1).
        THIS-OBJECT:panel3:Size = NEW System.Drawing.Size(570, 610).
        THIS-OBJECT:panel3:TabIndex = 0.
        /*  */
        /* pnlView */
        /*  */
        THIS-OBJECT:pnlView:BackColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:pnlView:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:pnlView:Location = NEW System.Drawing.Point(1, 1).
        THIS-OBJECT:pnlView:Name = "pnlView".
        THIS-OBJECT:pnlView:Size = NEW System.Drawing.Size(568, 608).
        THIS-OBJECT:pnlView:TabIndex = 0.
        /*  */
        /* splitContainer2 */
        /*  */
        THIS-OBJECT:splitContainer2:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:splitContainer2:FixedPanel = System.Windows.Forms.FixedPanel:Panel2.
        THIS-OBJECT:splitContainer2:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:splitContainer2:Name = "splitContainer2".
        THIS-OBJECT:splitContainer2:Orientation = System.Windows.Forms.Orientation:Horizontal.
        /*  */
        /* splitContainer2.Panel1 */
        /*  */
        THIS-OBJECT:splitContainer2:Panel1:Controls:Add(THIS-OBJECT:ultraGrid1).
        THIS-OBJECT:splitContainer2:Panel1:Controls:Add(THIS-OBJECT:ultraLabel6).
        /*  */
        /* splitContainer2.Panel2 */
        /*  */
        THIS-OBJECT:splitContainer2:Panel2:AutoScroll = TRUE.
        THIS-OBJECT:splitContainer2:Panel2:BackColor = System.Drawing.SystemColors:Window.
        THIS-OBJECT:splitContainer2:Panel2:Controls:Add(THIS-OBJECT:pnlProperties).
        THIS-OBJECT:splitContainer2:Panel2:Controls:Add(THIS-OBJECT:lblProperties).
        THIS-OBJECT:splitContainer2:Panel2Collapsed = TRUE.
        THIS-OBJECT:splitContainer2:Size = NEW System.Drawing.Size(226, 610).
        THIS-OBJECT:splitContainer2:SplitterDistance = 433.
        THIS-OBJECT:splitContainer2:TabIndex = 0.
        /*  */
        /* ultraLabel6 */
        /*  */
        appearance67:BackColor = System.Drawing.SystemColors:InactiveCaptionText.
        appearance67:BackColor2 = System.Drawing.SystemColors:GradientInactiveCaption.
        appearance67:BackGradientStyle = Infragistics.Win.GradientStyle:Vertical.
        appearance67:FontData:BoldAsString = "True".
        appearance67:TextTrimming = Infragistics.Win.TextTrimming:EllipsisCharacter.
        appearance67:TextVAlignAsString = "Middle".
        THIS-OBJECT:ultraLabel6:Appearance = appearance67.
        THIS-OBJECT:ultraLabel6:Dock = System.Windows.Forms.DockStyle:Top.
        THIS-OBJECT:ultraLabel6:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:ultraLabel6:Name = "ultraLabel6".
        THIS-OBJECT:ultraLabel6:Size = NEW System.Drawing.Size(226, 17).
        THIS-OBJECT:ultraLabel6:TabIndex = 0.
        THIS-OBJECT:ultraLabel6:Text = "Field Options".
        THIS-OBJECT:ultraLabel6:UseMnemonic = FALSE.
        THIS-OBJECT:ultraLabel6:WrapText = FALSE.
        /*  */
        /* lblProperties */
        /*  */
        appearance19:BackColor = System.Drawing.SystemColors:InactiveCaptionText.
        appearance19:BackColor2 = System.Drawing.SystemColors:GradientInactiveCaption.
        appearance19:BackGradientStyle = Infragistics.Win.GradientStyle:Vertical.
        appearance19:FontData:BoldAsString = "True".
        appearance19:TextTrimming = Infragistics.Win.TextTrimming:EllipsisCharacter.
        appearance19:TextVAlignAsString = "Middle".
        THIS-OBJECT:lblProperties:Appearance = appearance19.
        THIS-OBJECT:lblProperties:Dock = System.Windows.Forms.DockStyle:Top.
        THIS-OBJECT:lblProperties:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:lblProperties:Name = "lblProperties".
        THIS-OBJECT:lblProperties:Size = NEW System.Drawing.Size(150, 16).
        THIS-OBJECT:lblProperties:TabIndex = 0.
        THIS-OBJECT:lblProperties:Text = "Field Properties".
        THIS-OBJECT:lblProperties:UseMnemonic = FALSE.
        THIS-OBJECT:lblProperties:WrapText = FALSE.
        /*  */
        /* ultraExplorerBarContainerControl1 */
        /*  */
        THIS-OBJECT:ultraExplorerBarContainerControl1:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:ultraExplorerBarContainerControl1:Name = "ultraExplorerBarContainerControl1".
        THIS-OBJECT:ultraExplorerBarContainerControl1:Size = NEW System.Drawing.Size(200, 100).
        THIS-OBJECT:ultraExplorerBarContainerControl1:TabIndex = 0.
        /*  */
        /* ultraToolbarsManager1 */
        /*  */
        THIS-OBJECT:ultraToolbarsManager1:DesignerFlags = 1.
        THIS-OBJECT:ultraToolbarsManager1:DockWithinContainer = THIS-OBJECT.
        THIS-OBJECT:ultraToolbarsManager1:DockWithinContainerBaseType = Progress.Util.TypeHelper:GetType("Progress.Windows.Form").
        THIS-OBJECT:ultraToolbarsManager1:ShowFullMenusDelay = 500.
        THIS-OBJECT:ultraToolbarsManager1:ShowShortcutsInToolTips = TRUE.
        THIS-OBJECT:ultraToolbarsManager1:Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle:Office2007.
        ultraToolbar1:DockedColumn = 1.
        ultraToolbar1:DockedRow = 0.
        ultraToolbar1:FloatingSize = NEW System.Drawing.Size(414, 24).
        buttonTool19:InstanceProps:IsFirstInGroup = TRUE.
        buttonTool15:InstanceProps:IsFirstInGroup = TRUE.
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar6 AS Infragistics.Win.UltraWinToolbars.ToolBase EXTENT 8 NO-UNDO.
        arrayvar6[1] = buttonTool8.
        arrayvar6[2] = buttonTool12.
        arrayvar6[3] = buttonTool19.
        arrayvar6[4] = buttonTool20.
        arrayvar6[5] = buttonTool21.
        arrayvar6[6] = buttonTool15.
        arrayvar6[7] = buttonTool16.
        arrayvar6[8] = buttonTool9.
        ultraToolbar1:NonInheritedTools:AddRange(arrayvar6).
        ultraToolbar1:Settings:AllowCustomize = Infragistics.Win.DefaultableBoolean:False.
        ultraToolbar1:Settings:AllowHiding = Infragistics.Win.DefaultableBoolean:False.
        ultraToolbar1:Text = "Layout".
        ultraToolbar2:DockedColumn = 0.
        ultraToolbar2:DockedRow = 0.
        stateButtonTool5:Checked = TRUE.
        stateButtonTool5:InstanceProps:IsFirstInGroup = TRUE.
        comboBoxTool1:InstanceProps:IsFirstInGroup = TRUE.
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar7 AS Infragistics.Win.UltraWinToolbars.ToolBase EXTENT 9 NO-UNDO.
        arrayvar7[1] = buttonTool31.
        arrayvar7[2] = buttonTool27.
        arrayvar7[3] = buttonTool25.
        arrayvar7[4] = buttonTool34.
        arrayvar7[5] = buttonTool33.
        arrayvar7[6] = stateButtonTool5.
        arrayvar7[7] = stateButtonTool6.
        arrayvar7[8] = stateButtonTool7.
        arrayvar7[9] = comboBoxTool1.
        ultraToolbar2:NonInheritedTools:AddRange(arrayvar7).
        ultraToolbar2:Settings:AllowCustomize = Infragistics.Win.DefaultableBoolean:False.
        ultraToolbar2:Settings:AllowHiding = Infragistics.Win.DefaultableBoolean:False.
        ultraToolbar2:Text = "File".
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar8 AS Infragistics.Win.UltraWinToolbars.UltraToolbar EXTENT 2 NO-UNDO.
        arrayvar8[1] = ultraToolbar1.
        arrayvar8[2] = ultraToolbar2.
        THIS-OBJECT:ultraToolbarsManager1:Toolbars:AddRange(arrayvar8).
        appearance13:Image = CAST(resources:GetObject("appearance13.Image"), System.Object).
        buttonTool1:SharedProps:AppearancesSmall:Appearance = appearance13.
        buttonTool1:SharedProps:Caption = "Align Left".
        buttonTool1:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        appearance20:Image = CAST(resources:GetObject("appearance20.Image"), System.Object).
        buttonTool2:SharedProps:AppearancesSmall:Appearance = appearance20.
        buttonTool2:SharedProps:Caption = "Align Centers".
        buttonTool2:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        appearance21:Image = CAST(resources:GetObject("appearance21.Image"), System.Object).
        buttonTool3:SharedProps:AppearancesSmall:Appearance = appearance21.
        buttonTool3:SharedProps:Caption = "Align Right".
        buttonTool3:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        appearance25:Image = CAST(resources:GetObject("appearance25.Image"), System.Object).
        buttonTool4:SharedProps:AppearancesSmall:Appearance = appearance25.
        buttonTool4:SharedProps:Caption = "Align Tops".
        buttonTool4:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        appearance26:Image = CAST(resources:GetObject("appearance26.Image"), System.Object).
        buttonTool5:SharedProps:AppearancesSmall:Appearance = appearance26.
        buttonTool5:SharedProps:Caption = "Align Middles".
        buttonTool5:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        appearance27:Image = CAST(resources:GetObject("appearance27.Image"), System.Object).
        buttonTool6:SharedProps:AppearancesSmall:Appearance = appearance27.
        buttonTool6:SharedProps:Caption = "Align Bottoms".
        buttonTool6:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        appearance23:Image = CAST(resources:GetObject("appearance23.Image"), System.Object).
        buttonTool17:SharedProps:AppearancesSmall:Appearance = appearance23.
        buttonTool17:SharedProps:Caption = "Bring to Front".
        appearance24:Image = CAST(resources:GetObject("appearance24.Image"), System.Object).
        buttonTool18:SharedProps:AppearancesSmall:Appearance = appearance24.
        buttonTool18:SharedProps:Caption = "Send to Back".
        appearance28:Image = CAST(resources:GetObject("appearance28.Image"), System.Object).
        buttonTool22:SharedProps:AppearancesSmall:Appearance = appearance28.
        buttonTool22:SharedProps:Caption = "Make Same Width".
        appearance29:Image = CAST(resources:GetObject("appearance29.Image"), System.Object).
        buttonTool23:SharedProps:AppearancesSmall:Appearance = appearance29.
        buttonTool23:SharedProps:Caption = "Make Same Height".
        appearance30:Image = CAST(resources:GetObject("appearance30.Image"), System.Object).
        buttonTool24:SharedProps:AppearancesSmall:Appearance = appearance30.
        buttonTool24:SharedProps:Caption = "Make Same Size".
        appearance31:Image = CAST(resources:GetObject("appearance31.Image"), System.Object).
        stateButtonTool2:SharedProps:AppearancesSmall:Appearance = appearance31.
        stateButtonTool2:SharedProps:Caption = "Set Field Properties".
        stateButtonTool2:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        stateButtonTool4:Checked = TRUE.
        appearance32:Image = CAST(resources:GetObject("appearance32.Image"), System.Object).
        stateButtonTool4:SharedProps:AppearancesSmall:Appearance = appearance32.
        stateButtonTool4:SharedProps:Caption = "Select Field Options".
        stateButtonTool4:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        buttonTool28:SharedProps:Caption = "Save".
        buttonTool28:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        buttonTool28:SharedProps:ToolTipText = "Save Layout".
        buttonTool29:SharedProps:Caption = "New".
        buttonTool29:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        buttonTool29:SharedProps:ToolTipText = "Create New Layout".
        appearance36:Image = CAST(resources:GetObject("appearance36.Image"), System.Object).
        stateButtonTool3:SharedProps:AppearancesSmall:Appearance = appearance36.
        stateButtonTool3:SharedProps:Caption = "Tab Index".
        stateButtonTool3:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        stateButtonTool3:SharedProps:ToolTipText = "Adjust Tab Order".
        comboBoxTool2:SharedProps:Caption = "Section".
        comboBoxTool2:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:ImageAndText.
        valueList1:DisplayStyle = Infragistics.Win.ValueListDisplayStyle:DisplayText.
        comboBoxTool2:ValueList = valueList1.
        buttonTool7:SharedProps:Caption = "Open".
        buttonTool7:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        buttonTool7:SharedProps:ToolTipText = "Open Layout".
        buttonTool14:SharedProps:Caption = "Delete".
        buttonTool14:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        buttonTool14:SharedProps:ToolTipText = "Delete Layout".
        buttonTool26:SharedProps:Caption = "Restore".
        buttonTool26:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:DefaultForToolType.
        buttonTool26:SharedProps:ToolTipText = "Restore Layout".
        buttonTool10:SharedProps:Caption = "Delete Control".
        buttonTool11:SharedProps:Caption = "Capture Values".
        buttonTool11:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:TextOnlyAlways.
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar9 AS Infragistics.Win.UltraWinToolbars.ToolBase EXTENT 22 NO-UNDO.
        arrayvar9[1] = buttonTool1.
        arrayvar9[2] = buttonTool2.
        arrayvar9[3] = buttonTool3.
        arrayvar9[4] = buttonTool4.
        arrayvar9[5] = buttonTool5.
        arrayvar9[6] = buttonTool6.
        arrayvar9[7] = buttonTool17.
        arrayvar9[8] = buttonTool18.
        arrayvar9[9] = buttonTool22.
        arrayvar9[10] = buttonTool23.
        arrayvar9[11] = buttonTool24.
        arrayvar9[12] = stateButtonTool2.
        arrayvar9[13] = stateButtonTool4.
        arrayvar9[14] = buttonTool28.
        arrayvar9[15] = buttonTool29.
        arrayvar9[16] = stateButtonTool3.
        arrayvar9[17] = comboBoxTool2.
        arrayvar9[18] = buttonTool7.
        arrayvar9[19] = buttonTool14.
        arrayvar9[20] = buttonTool26.
        arrayvar9[21] = buttonTool10.
        arrayvar9[22] = buttonTool11.
        THIS-OBJECT:ultraToolbarsManager1:Tools:AddRange(arrayvar9).
        THIS-OBJECT:ultraToolbarsManager1:ToolClick:SUBSCRIBE(THIS-OBJECT:ultraToolbarsManager1_ToolClick).
        THIS-OBJECT:ultraToolbarsManager1:ToolValueChanged:SUBSCRIBE(THIS-OBJECT:ultraToolbarsManager1_ToolValueChanged).
        /*  */
        /* m_LayoutEditor_Toolbars_Dock_Area_Left */
        /*  */
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Left:AccessibleRole = System.Windows.Forms.AccessibleRole:Grouping.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Left:BackColor = System.Drawing.Color:FromArgb(System.Convert:ToInt32(System.Convert:ToByte(191)), System.Convert:ToInt32(System.Convert:ToByte(219)), System.Convert:ToInt32(System.Convert:ToByte(255))).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Left:DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition:Left.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Left:ForeColor = System.Drawing.SystemColors:ControlText.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Left:Location = NEW System.Drawing.Point(0, 28).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Left:Name = "m_LayoutEditor_Toolbars_Dock_Area_Left".
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Left:Size = NEW System.Drawing.Size(0, 638).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Left:ToolbarsManager = THIS-OBJECT:ultraToolbarsManager1.
        /*  */
        /* m_LayoutEditor_Toolbars_Dock_Area_Right */
        /*  */
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Right:AccessibleRole = System.Windows.Forms.AccessibleRole:Grouping.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Right:BackColor = System.Drawing.Color:FromArgb(System.Convert:ToInt32(System.Convert:ToByte(191)), System.Convert:ToInt32(System.Convert:ToByte(219)), System.Convert:ToInt32(System.Convert:ToByte(255))).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Right:DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition:Right.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Right:ForeColor = System.Drawing.SystemColors:ControlText.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Right:Location = NEW System.Drawing.Point(1016, 28).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Right:Name = "m_LayoutEditor_Toolbars_Dock_Area_Right".
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Right:Size = NEW System.Drawing.Size(0, 638).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Right:ToolbarsManager = THIS-OBJECT:ultraToolbarsManager1.
        /*  */
        /* m_LayoutEditor_Toolbars_Dock_Area_Top */
        /*  */
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Top:AccessibleRole = System.Windows.Forms.AccessibleRole:Grouping.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Top:BackColor = System.Drawing.Color:FromArgb(System.Convert:ToInt32(System.Convert:ToByte(191)), System.Convert:ToInt32(System.Convert:ToByte(219)), System.Convert:ToInt32(System.Convert:ToByte(255))).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Top:DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition:Top.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Top:ForeColor = System.Drawing.SystemColors:ControlText.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Top:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Top:Name = "m_LayoutEditor_Toolbars_Dock_Area_Top".
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Top:Size = NEW System.Drawing.Size(1016, 28).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Top:ToolbarsManager = THIS-OBJECT:ultraToolbarsManager1.
        /*  */
        /* m_LayoutEditor_Toolbars_Dock_Area_Bottom */
        /*  */
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Bottom:AccessibleRole = System.Windows.Forms.AccessibleRole:Grouping.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Bottom:BackColor = System.Drawing.Color:FromArgb(System.Convert:ToInt32(System.Convert:ToByte(191)), System.Convert:ToInt32(System.Convert:ToByte(219)), System.Convert:ToInt32(System.Convert:ToByte(255))).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Bottom:DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition:Bottom.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Bottom:ForeColor = System.Drawing.SystemColors:ControlText.
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Bottom:Location = NEW System.Drawing.Point(0, 666).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Bottom:Name = "m_LayoutEditor_Toolbars_Dock_Area_Bottom".
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Bottom:Size = NEW System.Drawing.Size(1016, 0).
        THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Bottom:ToolbarsManager = THIS-OBJECT:ultraToolbarsManager1.
        /*  */
        /* flowLayoutPanel1 */
        /*  */
        THIS-OBJECT:flowLayoutPanel1:AutoSize = TRUE.
        THIS-OBJECT:flowLayoutPanel1:BackColor = System.Drawing.Color:Transparent.
        THIS-OBJECT:flowLayoutPanel1:Controls:Add(THIS-OBJECT:branchSelector).
        THIS-OBJECT:flowLayoutPanel1:Controls:Add(THIS-OBJECT:panel6).
        THIS-OBJECT:flowLayoutPanel1:Controls:Add(THIS-OBJECT:panel7).
        THIS-OBJECT:flowLayoutPanel1:Dock = System.Windows.Forms.DockStyle:Top.
        THIS-OBJECT:flowLayoutPanel1:Location = NEW System.Drawing.Point(0, 28).
        THIS-OBJECT:flowLayoutPanel1:Name = "flowLayoutPanel1".
        THIS-OBJECT:flowLayoutPanel1:Size = NEW System.Drawing.Size(1016, 28).
        THIS-OBJECT:flowLayoutPanel1:TabIndex = 0.
        THIS-OBJECT:flowLayoutPanel1:TabStop = TRUE.
        /*  */
        /* branchSelector */
        /*  */
        THIS-OBJECT:branchSelector:AllowAll = TRUE.
        THIS-OBJECT:branchSelector:AllowBranchChange = FALSE.
        THIS-OBJECT:branchSelector:AllowManualUpdate = TRUE.
        THIS-OBJECT:branchSelector:AllowNone = FALSE.
        THIS-OBJECT:branchSelector:BackColor = System.Drawing.Color:Transparent.
        THIS-OBJECT:branchSelector:BranchID = "".
        THIS-OBJECT:branchSelector:CheckSecurity = TRUE.
        THIS-OBJECT:branchSelector:EditorText = "".
        THIS-OBJECT:branchSelector:IncludeInModificationCheck = TRUE.
        THIS-OBJECT:branchSelector:LabelText = "View for Branch".
        THIS-OBJECT:branchSelector:LabelWidth = 100.
        THIS-OBJECT:branchSelector:Location = NEW System.Drawing.Point(3, 3).
        THIS-OBJECT:branchSelector:Name = "branchSelector".
        THIS-OBJECT:branchSelector:ProfName = "".
        THIS-OBJECT:branchSelector:ReadOnly = FALSE.
        THIS-OBJECT:branchSelector:RefreshOnBranchAssign = FALSE.
        THIS-OBJECT:branchSelector:Required = FALSE.
        THIS-OBJECT:branchSelector:ShowGroupButton = FALSE.
        THIS-OBJECT:branchSelector:Size = NEW System.Drawing.Size(300, 22).
        THIS-OBJECT:branchSelector:TabIndex = 0.
        THIS-OBJECT:branchSelector:WindowType = "".
        /*  */
        /* panel6 */
        /*  */
        THIS-OBJECT:panel6:Controls:Add(THIS-OBJECT:txtCustomLayout).
        THIS-OBJECT:panel6:Controls:Add(THIS-OBJECT:ultraLabel7).
        THIS-OBJECT:panel6:Location = NEW System.Drawing.Point(309, 3).
        THIS-OBJECT:panel6:Name = "panel6".
        THIS-OBJECT:panel6:Size = NEW System.Drawing.Size(300, 22).
        THIS-OBJECT:panel6:TabIndex = 1.
        /*  */
        /* txtCustomLayout */
        /*  */
        THIS-OBJECT:txtCustomLayout:Dock = System.Windows.Forms.DockStyle:Fill.
        THIS-OBJECT:txtCustomLayout:Location = NEW System.Drawing.Point(100, 0).
        THIS-OBJECT:txtCustomLayout:MaxLength = 40.
        THIS-OBJECT:txtCustomLayout:Name = "txtCustomLayout".
        THIS-OBJECT:txtCustomLayout:Size = NEW System.Drawing.Size(200, 21).
        THIS-OBJECT:txtCustomLayout:TabIndex = 1.
        /*  */
        /* ultraLabel7 */
        /*  */
        appearance2:BackColor = System.Drawing.Color:Transparent.
        appearance2:TextVAlignAsString = "Middle".
        THIS-OBJECT:ultraLabel7:Appearance = appearance2.
        THIS-OBJECT:ultraLabel7:Dock = System.Windows.Forms.DockStyle:Left.
        THIS-OBJECT:ultraLabel7:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:ultraLabel7:Name = "ultraLabel7".
        THIS-OBJECT:ultraLabel7:Size = NEW System.Drawing.Size(100, 22).
        THIS-OBJECT:ultraLabel7:TabIndex = 0.
        THIS-OBJECT:ultraLabel7:Text = "Custom Layout".
        /*  */
        /* panel7 */
        /*  */
        THIS-OBJECT:panel7:Controls:Add(THIS-OBJECT:cbAccessedType).
        THIS-OBJECT:panel7:Controls:Add(THIS-OBJECT:btnUserID).
        THIS-OBJECT:panel7:Controls:Add(THIS-OBJECT:txtAccessedBy).
        THIS-OBJECT:panel7:Controls:Add(THIS-OBJECT:ultraLabel9).
        THIS-OBJECT:panel7:Location = NEW System.Drawing.Point(615, 3).
        THIS-OBJECT:panel7:Name = "panel7".
        THIS-OBJECT:panel7:Size = NEW System.Drawing.Size(366, 22).
        THIS-OBJECT:panel7:TabIndex = 2.
        /*  */
        /* cbAccessedType */
        /*  */
        THIS-OBJECT:cbAccessedType:DropDownStyle = Infragistics.Win.DropDownStyle:DropDownList.
        valueListItem1:DataValue = "All".
        valueListItem1:DisplayText = "All".
        valueListItem2:DataValue = "User Group".
        valueListItem2:DisplayText = "Security Group".
        valueListItem3:DataValue = "User".
        valueListItem3:DisplayText = "User".
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar10 AS Infragistics.Win.ValueListItem EXTENT 3 NO-UNDO.
        arrayvar10[1] = valueListItem1.
        arrayvar10[2] = valueListItem2.
        arrayvar10[3] = valueListItem3.
        THIS-OBJECT:cbAccessedType:Items:AddRange(arrayvar10).
        THIS-OBJECT:cbAccessedType:Location = NEW System.Drawing.Point(100, 0).
        THIS-OBJECT:cbAccessedType:Name = "cbAccessedType".
        THIS-OBJECT:cbAccessedType:Size = NEW System.Drawing.Size(103, 21).
        THIS-OBJECT:cbAccessedType:TabIndex = 1.
        THIS-OBJECT:cbAccessedType:ValueChanged:SUBSCRIBE(THIS-OBJECT:cbAccessedType_ValueChanged).
        /*  */
        /* btnUserID */
        /*  */
        THIS-OBJECT:btnUserID:Location = NEW System.Drawing.Point(344, 0).
        THIS-OBJECT:btnUserID:Name = "btnUserID".
        THIS-OBJECT:btnUserID:ShowFocusRect = FALSE.
        THIS-OBJECT:btnUserID:Size = NEW System.Drawing.Size(21, 21).
        THIS-OBJECT:btnUserID:TabIndex = 3.
        THIS-OBJECT:btnUserID:Click:SUBSCRIBE(THIS-OBJECT:btnUserID_Click).
        /*  */
        /* txtAccessedBy */
        /*  */
        THIS-OBJECT:txtAccessedBy:Location = NEW System.Drawing.Point(207, 0).
        THIS-OBJECT:txtAccessedBy:MaxLength = 15.
        THIS-OBJECT:txtAccessedBy:Name = "txtAccessedBy".
        THIS-OBJECT:txtAccessedBy:Size = NEW System.Drawing.Size(137, 21).
        THIS-OBJECT:txtAccessedBy:TabIndex = 2.
        /*  */
        /* ultraLabel9 */
        /*  */
        appearance22:BackColor = System.Drawing.Color:Transparent.
        appearance22:TextVAlignAsString = "Middle".
        THIS-OBJECT:ultraLabel9:Appearance = appearance22.
        THIS-OBJECT:ultraLabel9:Dock = System.Windows.Forms.DockStyle:Left.
        THIS-OBJECT:ultraLabel9:Location = NEW System.Drawing.Point(0, 0).
        THIS-OBJECT:ultraLabel9:Name = "ultraLabel9".
        THIS-OBJECT:ultraLabel9:Size = NEW System.Drawing.Size(100, 22).
        THIS-OBJECT:ultraLabel9:TabIndex = 0.
        THIS-OBJECT:ultraLabel9:Text = "Accessed by".
        /*  */
        /* LayoutEditor */
        /*  */
        THIS-OBJECT:ApplyThemeToWindowBackColor = TRUE.
        THIS-OBJECT:ClientSize = NEW System.Drawing.Size(1016, 666).
        THIS-OBJECT:Controls:Add(THIS-OBJECT:LayoutEditor_Fill_Panel).
        THIS-OBJECT:Controls:Add(THIS-OBJECT:flowLayoutPanel1).
        THIS-OBJECT:Controls:Add(THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Left).
        THIS-OBJECT:Controls:Add(THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Right).
        THIS-OBJECT:Controls:Add(THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Top).
        THIS-OBJECT:Controls:Add(THIS-OBJECT:m_LayoutEditor_Toolbars_Dock_Area_Bottom).
        THIS-OBJECT:KeyPreview = TRUE.
        THIS-OBJECT:Name = "LayoutEditor".
        THIS-OBJECT:Text = "myUI Designer".
        THIS-OBJECT:Load:SUBSCRIBE(THIS-OBJECT:LayoutEditor_Load).
        THIS-OBJECT:FormClosed:SUBSCRIBE(THIS-OBJECT:LayoutEditor_FormClosed).
        THIS-OBJECT:KeyDown:SUBSCRIBE(THIS-OBJECT:oRootContainer_KeyDown).
        CAST(THIS-OBJECT:ultraGrid1, System.ComponentModel.ISupportInitialize):EndInit().
        CAST(THIS-OBJECT:ultraDataSource1, System.ComponentModel.ISupportInitialize):EndInit().
        THIS-OBJECT:pnlProperties:ResumeLayout(FALSE).
        THIS-OBJECT:pnlProperties:PerformLayout().
        CAST(THIS-OBJECT:txtY, System.ComponentModel.ISupportInitialize):EndInit().
        CAST(THIS-OBJECT:txtX, System.ComponentModel.ISupportInitialize):EndInit().
        CAST(THIS-OBJECT:txtHeight, System.ComponentModel.ISupportInitialize):EndInit().
        CAST(THIS-OBJECT:txtWidth, System.ComponentModel.ISupportInitialize):EndInit().
        THIS-OBJECT:LayoutEditor_Fill_Panel:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainer1:Panel1:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainer1:Panel2:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainer1:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainer3:Panel1:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainer3:Panel2:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainer3:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainerTabSettings:Panel1:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainerTabSettings:Panel2:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainerTabSettings:ResumeLayout(FALSE).
        CAST(THIS-OBJECT:ultraGrid3, System.ComponentModel.ISupportInitialize):EndInit().
        CAST(THIS-OBJECT:ultraDataSourceTabSettings, System.ComponentModel.ISupportInitialize):EndInit().
        THIS-OBJECT:panel2:ResumeLayout(FALSE).
        THIS-OBJECT:panel1:ResumeLayout(FALSE).
        CAST(THIS-OBJECT:ultraGrid2, System.ComponentModel.ISupportInitialize):EndInit().
        CAST(THIS-OBJECT:ultraDataSourceChildTabSettings, System.ComponentModel.ISupportInitialize):EndInit().
        THIS-OBJECT:panel3:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainer2:Panel1:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainer2:Panel2:ResumeLayout(FALSE).
        THIS-OBJECT:splitContainer2:ResumeLayout(FALSE).
        CAST(THIS-OBJECT:ultraToolbarsManager1, System.ComponentModel.ISupportInitialize):EndInit().
        THIS-OBJECT:flowLayoutPanel1:ResumeLayout(FALSE).
        THIS-OBJECT:panel6:ResumeLayout(FALSE).
        THIS-OBJECT:panel6:PerformLayout().
        CAST(THIS-OBJECT:txtCustomLayout, System.ComponentModel.ISupportInitialize):EndInit().
        THIS-OBJECT:panel7:ResumeLayout(FALSE).
        THIS-OBJECT:panel7:PerformLayout().
        CAST(THIS-OBJECT:cbAccessedType, System.ComponentModel.ISupportInitialize):EndInit().
        CAST(THIS-OBJECT:txtAccessedBy, System.ComponentModel.ISupportInitialize):EndInit().
        THIS-OBJECT:ResumeLayout(FALSE).
        THIS-OBJECT:PerformLayout().
        CATCH e AS Progress.Lang.Error:
            UNDO, THROW e.
        END CATCH.
END METHOD.


    /*------------------------------------------------------------------------------
            Purpose: Process the primary selection and update the grid selection
                     based on what are currently selected.                    
            Notes:                    
    ------------------------------------------------------------------------------*/

    METHOD PRIVATE VOID OnSelectionChanged( INPUT sender AS System.Object, INPUT e AS System.EventArgs):
   
        DEFINE VARIABLE oSelectionService AS SelectionService                                 NO-UNDO.
        DEFINE VARIABLE oSelection        AS "System.Object[]"                                NO-UNDO.
        DEFINE VARIABLE oPrimarySelection AS System.Windows.Forms.Control                     NO-UNDO.
        DEFINE VARIABLE oControlRow       AS Infragistics.Win.UltraWinGrid.UltraGridRow       NO-UNDO.
        DEFINE VARIABLE oDesignerControl  AS System.Windows.Forms.Control                     NO-UNDO.
        DEFINE VARIABLE i                 AS INTEGER                                          NO-UNDO.
        DEFINE VARIABLE lRootIncluded     AS LOGICAL                                          NO-UNDO INIT FALSE.
       
        {waiton.i}
        oSelectionService = CAST(m_ServiceContainer:GetService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.ISelectionService")), SelectionService).
                   
        IF VALID-OBJECT(oSelectionService) THEN
        DO:
            m_IsSynchronizingSelection = TRUE.
               
            IF oSelectionService:SelectionCount = 0 OR
               ( VALID-OBJECT(oSelectionService:PrimarySelection) AND
                 CAST(oSelectionService:PrimarySelection, System.Windows.Forms.Control):Name = "LayoutEditor_Fill_Panel") THEN
            DO:
                IF NOT m_IsFromGridSelection THEN
                DO:
                  ultraGrid1:Selected:Rows:Clear().         
                  ultraGrid1:ActiveRow = ?.
                END.
                
                ASSIGN
                    lblProperties:Text    = "Field Properties"
                    txtX:Text             = "0"
                    txtY:Text             = "0"              
                    txtWidth:Text         = "0"
                    txtHeight:Text        = "0".
                   
                UpdateLayoutToolbarState(FALSE).
            END.
            ELSE
            DO:
                oSelection = NEW "System.Object[]"(oSelectionService:SelectionCount).
                oSelectionService:GetSelectedComponents():CopyTo(oSelection, 0).               
              
                IF NOT m_IsFromGridSelection THEN
                  ultraGrid1:Selected:Rows:Clear().
                          
                DO i = 0 TO oSelection:Length - 1:
                  IF VALID-OBJECT(oSelection:GetValue(i)) THEN
                  DO:
                    oDesignerControl = CAST(oSelection:GetValue(i), System.Windows.Forms.Control).
                    oControlRow = CAST( oDesignerControl:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow ).
                 
                    IF VALID-OBJECT(oControlRow) AND
                       NOT m_IsFromGridSelection THEN
                     ultraGrid1:Selected:Rows:Add(oControlRow).
                     
                    IF CAST(oSelection:GetValue(i), System.Windows.Forms.Control):Name = "RootElement" THEN
                      lRootIncluded = TRUE.
                  END.                  
                END.
            END.
               
            UpdateLayoutToolbarState(NOT lRootIncluded).
            m_IsSynchronizingSelection = FALSE.           

            IF VALID-OBJECT(oSelectionService:PrimarySelection) THEN
            DO:
                oPrimarySelection = CAST(oSelectionService:PrimarySelection, System.Windows.Forms.Control).
            
             IF m_RootDesignerParent:Controls:Contains(oPrimarySelection) THEN   
                    m_RootDesignerParent:Controls:SetChildIndex(oPrimarySelection, 0).
               
                IF NOT ( VALID-OBJECT(oSelectionService:PrimarySelection) AND
                         CAST(oSelectionService:PrimarySelection, System.Windows.Forms.Control):Name = "LayoutEditor_Fill_Panel") THEN
                DO:
                  IF oPrimarySelection:Name = "RootElement" THEN
                  DO:
                    DEFINE VARIABLE comboBoxTool  AS Infragistics.Win.UltraWinToolbars.ComboBoxTool NO-UNDO.               
                    comboBoxTool = CAST(ultraToolbarsManager1:Tools["Section"], Infragistics.Win.UltraWinToolbars.ComboBoxTool).
                 
                    ASSIGN
                      lblProperties:Text    = "Field Properties of " + comboBoxTool:Text.
                  END.
                  ELSE 
                    ASSIGN
                      lblProperties:Text    = "Field Properties of " + GetReadableName(oPrimarySelection:Name).
                     
                  ASSIGN
                    txtX:Value            = oPrimarySelection:Left
                    txtY:Value            = oPrimaryselection:Top
                    txtWidth:Value        = oPrimarySelection:Width
                    txtHeight:Value       = oPrimarySelection:Height.
                END.
                   
                /* make sure to update the focus rectangle */
                IF oPrimarySelection:Name = "RootElement"             OR   /* m_hasAccess is true */
                   oPrimarySelection:Name = "LayoutEditor_Fill_Panel" THEN /* m_hasAccess is false */
                DO:
                    ASSIGN
                        ultraGrid1:ActiveRow = ?
                        ultraGrid3:ActiveRow = ?
                        btnUp:ENABLED = FALSE
                        btnDown:ENABLED = FALSE.

                    ultraGrid3:SELECTED:Rows:CLEAR().
                    BuildChildrenGrid(?).
                END.
                    ELSE
                DO:
                    oControlRow = CAST(oPrimarySelection:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow ).
                    IF VALID-OBJECT(oControlRow) THEN
                    DO:
                        m_IsSynchronizingSelection = TRUE.
                        IF NOT m_IsFromGridSelection THEN
                          ultraGrid1:ActiveRow = oControlRow.
                    
                     ultraGrid3:Selected:Rows:Clear().
                     ultraGrid3:ActiveRow = CAST(oControlRow:Cells[1]:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow ).
                     m_IsSynchronizingSelection = FALSE.
                    END.
                END.       
            END.
           
            ASSIGN
                txtX:Enabled      = oSelectionService:SelectionCount > 0 AND oPrimarySelection:Name <> "LayoutEditor_Fill_Panel" AND oPrimarySelection:Name <> "RootElement"
                txtY:Enabled      = oSelectionService:SelectionCount > 0 AND oPrimarySelection:Name <> "LayoutEditor_Fill_Panel" AND oPrimarySelection:Name <> "RootElement"
                txtWidth:Enabled  = oSelectionService:SelectionCount > 0 AND oPrimarySelection:Name <> "LayoutEditor_Fill_Panel"
                txtHeight:Enabled = oSelectionService:SelectionCount > 0 AND oPrimarySelection:Name <> "LayoutEditor_Fill_Panel".
                                 
        END.
        ELSE
            UpdateLayoutToolbarState(FALSE).
       
        {waitoff.i}
        
    END METHOD.


/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID RestoreLayout(  ):
        DEFINE VARIABLE i                AS INTEGER                                          NO-UNDO.
        DEFINE VARIABLE j                AS INTEGER                                          NO-UNDO.
        DEFINE VARIABLE cWidgetName      AS CHARACTER                                        NO-UNDO.
        DEFINE VARIABLE oLiveControl     AS System.Windows.Forms.Control                     NO-UNDO.
        DEFINE VARIABLE oDesignerControl AS System.Windows.Forms.Control                     NO-UNDO.
        DEFINE VARIABLE oParentControl   AS System.Windows.Forms.Control                     NO-UNDO.
        DEFINE VARIABLE lCurrentValue    AS LOGICAL                                          NO-UNDO.
        DEFINE VARIABLE lPrevious        AS LOGICAL                                          NO-UNDO.
        DEFINE VARIABLE oTabOrderRow     AS Infragistics.Win.UltraWinGrid.UltraGridRow       NO-UNDO.
        DEFINE VARIABLE oDataSourceRow   AS Infragistics.Win.UltraWinDataSource.UltraDataRow NO-UNDO.
 
  DEFINE BUFFER bufcustom_layout_detail  FOR ttcustom_layout_detail.
  DEFINE BUFFER bufcustom_layout_detail2 FOR ttcustom_layout_detail.
 
        {waiton.i}
  m_isRestoring = TRUE.
        m_IsSynchronizingSelection = TRUE.

        ultraGrid1:BeginUpdate().
  ultraGrid2:BeginUpdate().
  ultraGrid3:BeginUpdate().
 
  ultraDataSourceTabSettings:Rows:Clear().
 
  m_SelectionService:SelectionChanged:UNSUBSCRIBE(OnSelectionChanged).
  ultraGrid1:CellChange:UNSUBSCRIBE(ultraGrid1_CellChange).
  ultraGrid1:AfterSelectChange:UNSUBSCRIBE(ultraGrid1_AfterSelectChange).
         
        IF NOT m_isOpening THEN
            InitializeFields().
       
        cWidgetName = m_CurrentLiveParent:Name.
        FOR FIRST bufcustom_layout_detail WHERE
                  bufcustom_layout_detail.section     = m_CurrentSectionName AND
                  bufcustom_layout_detail.widget_name = cWidgetName:
            ASSIGN
                m_RootDesignerParent:Height = bufcustom_layout_detail.height          
                m_RootDesignerParent:Width  = bufcustom_layout_detail.width.
        END.
       
        DO i = 0 TO ultraGrid1:Rows:Count - 1:
            
            oLiveControl = CAST(ultraGrid1:Rows[i]:Cells[0]:Tag, System.Windows.Forms.Control).
           
            IF VALID-OBJECT(oLiveControl) THEN
            DO:
                cWidgetName = oLiveControl:Name.
                     
                FOR FIRST bufcustom_layout_detail WHERE
                          bufcustom_layout_detail.section     = m_CurrentSectionName AND
                          bufcustom_layout_detail.widget_name = cWidgetName:
                   
                    ASSIGN
                        lCurrentValue = LOGICAL(ultraGrid1:Rows[i]:Cells["visible"]:Value:ToString())                        
                        ultraGrid1:Rows[i]:Cells["visible"]:Value   = bufcustom_layout_detail.visible
                        ultraGrid1:Rows[i]:Cells["mode"]:Value      = IF bufcustom_layout_detail.visible THEN bufcustom_layout_detail.mode
                                                                      ELSE ""
                        ultraGrid1:Rows[i]:Cells["tab_stop"]:Value  = bufcustom_layout_detail.tab_stop
                        ultraGrid1:Rows[i]:Cells["tab_index"]:Value = bufcustom_layout_detail.tab_index.
                     
                    IF lCurrentValue <> bufcustom_layout_detail.visible THEN
                        DesignerControlShowHide(ultraGrid1:Rows[i]).

                    IF lCurrentValue                   AND
                       bufcustom_layout_detail.visible AND
                       NOT THIS-OBJECT:IsWidgetInFixedMode( cWidgetName) THEN
                    DO:
                        /* re-add to the tab order grid */
                        oDataSourceRow = THIS-OBJECT:ultraDataSourceTabSettings:Rows:Add().                            
                        oDataSourceRow:Item["widget_name"] = GetReadableName(cWidgetName).
                        oDataSourceRow:Tag = ultraGrid1:Rows[i].
                       
                        /* associate the control list row to the tab order grid entry */
                        ultraGrid3:Rows[ultraGrid3:Rows:Count - 1]:Tag = ultraGrid1:Rows[i].
                        /* associate the tab order grid entry to the control list row */
                        ultraGrid1:Rows[i]:Cells[1]:Tag = ultraGrid3:Rows[ultraGrid3:Rows:Count - 1].
                    END.
                   
                    IF VALID-OBJECT(ultraGrid1:Rows[i]:Cells[1]:Tag) THEN
                    DO:
                      oTabOrderRow = CAST(ultraGrid1:Rows[i]:Cells[1]:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
                     
                      IF VALID-OBJECT(oTabOrderRow) THEN
                        ASSIGN
                          oTabOrderRow:Cells["tab_stop"]:Value  = bufcustom_layout_detail.tab_stop
                          oTabOrderRow:Cells["tab_index"]:Value = bufcustom_layout_detail.tab_index.
                    END.
                   
                    /* if the control was hidden, this will be FALSE */
                    IF VALID-OBJECT(ultraGrid1:Rows[i]:Tag) THEN
                    DO:
                      oDesignerControl = CAST(ultraGrid1:Rows[i]:Tag, System.Windows.Forms.Control).
                     
                      ASSIGN
                        oDesignerControl:Height   = bufcustom_layout_detail.height
                        oDesignerControl:Width    = bufcustom_layout_detail.width
                        oDesignerControl:Left     = bufcustom_layout_detail.x_position      
                        oDesignerControl:Top      = bufcustom_layout_detail.y_position
                        oDesignerControl:TabStop  = bufcustom_layout_detail.tab_stop
                        oDesignerControl:TabIndex = bufcustom_layout_detail.tab_index     
                        oDesignerControl:Parent   = m_RootDesignerParent.
                      
                      DesignerControlUpdateVisual(ultraGrid1:Rows[i]).
                     
                      /* store the child control settings if the group is visible */
                      DO j = 0 TO oDesignerControl:Controls:Count - 1:
                          IF TYPE-OF(oDesignerControl, tools.IAgilityControl) THEN
                            cWidgetName = oDesignerControl:Name + "+" + oDesignerControl:Controls[j]:Name.
                          ELSE  
                            cWidgetName = oDesignerControl:Controls[j]:Name.
                         
                          FOR FIRST bufcustom_layout_detail2 WHERE
                                    bufcustom_layout_detail2.section     = m_CurrentSectionName AND
                                    bufcustom_layout_detail2.widget_name = cWidgetName:   
                              ASSIGN
                                  oDesignerControl:Controls[j]:TabStop = bufcustom_layout_detail2.tab_stop.
                          END.
                      END.   
                     
                      IF VALID-OBJECT(lblChildControls:Tag)                                      AND
                         Progress.Util.TypeHelper:Equals(lblChildControls:Tag, oDesignerControl) THEN
                          BuildChildrenGrid(oDesignerControl).                          
                     
                      BuildValueList(oDesignerControl, ultraGrid1:Rows[i], FALSE).
                   END.  
                END.
            END.                 
        END.
        
        m_RootDesignerParent:Refresh().
        ApplyLayerPosition(m_RootDesignerParent).
       
        /* we are preventing manual sort on the Tab Order grid once shown inside the BeforeSortChange */
        ultraGrid3:BeforeSortChange:UNSUBSCRIBE(THIS-OBJECT:ultraGrid3_BeforeSortChange).
        ultraGrid3:DisplayLayout:Bands[0]:Columns["tab_index"]:SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator:Ascending.
        ultraGrid3:BeforeSortChange:SUBSCRIBE(THIS-OBJECT:ultraGrid3_BeforeSortChange).
       
        ultraGrid1:ActiveRow = ?.
  ultraGrid1:Selected:Rows:Clear().
  ultraGrid2:ActiveRow = ?.
  ultraGrid2:Selected:Rows:Clear().
        ultraGrid3:ActiveRow = ?.
  ultraGrid3:Selected:Rows:Clear(). 
  btnUp:Enabled = FALSE.
     btnDown:Enabled = FALSE.

     ultraGrid1:AfterSelectChange:SUBSCRIBE(ultraGrid1_AfterSelectChange).
        ultraGrid1:CellChange:SUBSCRIBE(ultraGrid1_CellChange).
        
        /* not sure why, it is saying the event was still SUBSCRIBED to */
        DO ON ERROR UNDO, LEAVE:
            m_SelectionService:SelectionChanged:SUBSCRIBE(OnSelectionChanged).
            CATCH e AS Progress.Lang.Error :             
            END CATCH.
        END.
        /* The engine always has a selected control in memory. Replace it with a control found
           in the current section, so the engine stop referencing the previously selected control. */
        IF m_hasAccess THEN
        DO:
          IF m_RootDesignerParent:Controls:COUNT > 0 THEN
            SetSelectedComponent(m_RootDesignerParent:Controls[0], System.ComponentModel.Design.SelectionTypes:REPLACE).
          ELSE
            SetSelectedComponent(m_RootDesignerParent, System.ComponentModel.Design.SelectionTypes:REPLACE).
        END.
        ELSE
          SetSelectedComponent(LayoutEditor_Fill_Panel, System.ComponentModel.Design.SelectionTypes:REPLACE).

        SetSelectedComponent(?, System.ComponentModel.Design.SelectionTypes:REPLACE).

        UpdateButtonsState().
        RefreshChildTabSettings(?).
       
        ultraGrid1:EndUpdate().
        ultraGrid2:EndUpdate().
        ultraGrid3:EndUpdate().
       
        m_IsSynchronizingSelection = FALSE.
        m_isRestoring = FALSE.
       
        {waitoff.i}
       
END METHOD.


     /*------------------------------------------------------------------------------
            Purpose:                    
            Notes:                    
    ------------------------------------------------------------------------------*/

    METHOD PRIVATE VOID SaveLayout( ):
 
        DEFINE VARIABLE accessType          AS CHARACTER NO-UNDO.
        DEFINE VARIABLE accessedBy          AS CHARACTER NO-UNDO.
        DEFINE VARIABLE appliesToBranch     AS CHARACTER NO-UNDO.
        DEFINE VARIABLE customLayout        AS CHARACTER NO-UNDO.
        DEFINE VARIABLE origAccessType      AS CHARACTER NO-UNDO.
        DEFINE VARIABLE origAccessedBy      AS CHARACTER NO-UNDO.
        DEFINE VARIABLE origAppliesToBranch AS CHARACTER NO-UNDO.
        DEFINE VARIABLE origCustomLayout    AS CHARACTER NO-UNDO. 
        DEFINE VARIABLE cAnswer             AS CHARACTER NO-UNDO.
        DEFINE VARIABLE cMessageUser        AS CHARACTER NO-UNDO.                 
    
        ASSIGN
          accessType      = TRIM(THIS-OBJECT:cbAccessedType:Value:ToString())
          accessedBy      = IF accessType = "All" THEN "" ELSE TRIM(THIS-OBJECT:txtAccessedBy:Text)
          appliesToBranch = TRIM(branchSelector:ProfName)
          customLayout    = TRIM(THIS-OBJECT:txtCustomLayout:Text).                               
       
        IF LENGTH(appliesToBranch) = 0 THEN
        DO:
          RUN sysinfok.p
            ( INPUT  "required_fld",
              INPUT  "Branch" ).
         
          branchSelector:Focus(). 
          RETURN.
        END.
       
        IF LENGTH(customLayout) = 0 THEN
        DO:
          RUN sysinfok.p
            ( INPUT  "required_fld",
              INPUT  "Custom Layout" ).
         
          THIS-OBJECT:txtCustomLayout:Focus().
          RETURN.
        END.
       
        IF LENGTH(accessedBy)  = 0   AND
            accessType         <> "All" THEN
        DO:
          RUN sysinfok.p
            ( INPUT  "required_fld",
              INPUT  "Accessed By" ).
   
          THIS-OBJECT:txtAccessedBy:Focus().
          RETURN.
        END.
       
        IF accessType = "User Group" THEN
        DO:
          IF NOT CAN-FIND(FIRST gsm_user WHERE
              gsm_user.user_login_name = accessedBy AND
              gsm_user.security_group = YES
              NO-LOCK) THEN
          DO:
              RUN sysinfok.p
                ( INPUT  "invalid",
                  INPUT  "Security Group " + accessedBy ).
   
              THIS-OBJECT:txtAccessedBy:Focus().
              RETURN.
          END.
        END.
       
        IF accessType = "User" THEN
        DO:
          IF NOT CAN-FIND(FIRST gsm_user WHERE
              gsm_user.user_login_name = accessedBy AND
              gsm_user.security_group = NO
              NO-LOCK) THEN
          DO:
              RUN sysinfok.p
                ( INPUT  "invalid",
                  INPUT  "User " + accessedBy ).
   
              THIS-OBJECT:txtAccessedBy:Focus().
              RETURN.
          END. /* IF LOOKUP(txtAccessedBy:Text,cSecurityGroups,CHR(4)) = 0 THEN */
        END. /* IF cbAccessedType:Value:ToString() = "User Group" THEN */
       
        FIND FIRST ttcustom_layout_header NO-ERROR.
        
        IF m_isNewRecord OR
           m_isDefault   THEN
            ASSIGN
                cAnswer = "Add".
        ELSE IF ttcustom_layout_header.access_type       = accessType AND
                ttcustom_layout_header.accessed_by       = accessedBy AND
               (ttcustom_layout_header.applies_to_branch <> appliesToBranch OR
                ttcustom_layout_header.custom_layout     <> customLayout) THEN
        DO:
            RUN confirm.w
                ( INPUT  "Custom Layout",
                  OUTPUT cAnswer ).

            IF cAnswer = "Cancel" THEN
                RETURN.
        END.
        ELSE IF ttcustom_layout_header.access_type       = accessType AND
                ttcustom_layout_header.accessed_by       = accessedBy AND
                ttcustom_layout_header.applies_to_branch = appliesToBranch AND
                ttcustom_layout_header.custom_layout     = customLayout    THEN
            ASSIGN
                cAnswer = "Update".
        ELSE
            ASSIGN
                cAnswer = "Add".
       
        IF (ttcustom_layout_header.custom_layout     <> customLayout    OR
            ttcustom_layout_header.applies_to_branch <> appliesToBranch OR
            ttcustom_layout_header.access_type       <> accessType      OR
            ttcustom_layout_header.accessed_by       <> accessedBy ) AND
           CAN-FIND(FIRST custom_layout_header WHERE
                          custom_layout_header.access_type       = accessType      AND
                          custom_layout_header.accessed_by       = accessedBy      AND
                          custom_layout_header.applies_to_branch = appliesToBranch AND
                          custom_layout_header.custom_layout     = customLayout    AND
                          custom_layout_header.usage_level_1     = m_UsageLevel1   AND
                          custom_layout_header.usage_level_2     = m_UsageLevel2   AND
                          custom_layout_header.usage_level_3     = m_UsageLevel3   AND
                          custom_layout_header.usage_level_4     = m_UsageLevel4  
                          NO-LOCK) THEN
        DO:
            ASSIGN
                origAccessType      = accessType
                origAccessedBy      = accessedBy
                origAppliesToBranch = appliesToBranch
                origCustomLayout    = customLayout.

            CASE accessType:
               
                WHEN "User" THEN
                    ASSIGN
                        cMessageUser = "user " + accessedBy.

                WHEN "User Group" THEN
                    ASSIGN
                        cMessageUser = "security group " + accessedBy.

                WHEN "All" THEN
                    ASSIGN
                        cMessageUser = "all users".

                OTHERWISE
                MESSAGE "PROGRAMMING ERROR - Access Type not handled"
                    VIEW-AS ALERT-BOX INFO BUTTONS OK.

            END CASE. /* CASE cbAccessedType:Value:ToString(): */

            MESSAGE "Custom Layout """ + customLayout + """ already exists for " + cMessageUser + ".~n" +
                    "Do you want to continue and override this record?"
                VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO UPDATE lOverride AS LOGICAL.

            IF NOT lOverride THEN
                RETURN.
            ELSE IF cAnswer = "Update" THEN /* remove the current record, and keep the matching record */
                RUN sys/sicustomlayoutdel.p  ON g-AppSrvr
                  ( INPUT sys.AgilitySession:SessionContextID,
                    INPUT ttcustom_layout_header.access_type,
                    INPUT ttcustom_layout_header.accessed_by,
                    INPUT ttcustom_layout_header.applies_to_branch,
                    INPUT ttcustom_layout_header.custom_layout,
                    INPUT ttcustom_layout_header.usage_level_1,
                    INPUT ttcustom_layout_header.usage_level_2,
                    INPUT ttcustom_layout_header.usage_level_3,
                    INPUT ttcustom_layout_header.usage_level_4,
                    OUTPUT DATASET dsErrorMsg).
                   
            ASSIGN
                cAnswer = "Update".
        END.
        ELSE       
        FOR FIRST ttcustom_layout_header: /* update dataset with the new value */
            ASSIGN
                origAccessType      = ttcustom_layout_header.access_type
                origAccessedBy      = ttcustom_layout_header.accessed_by
                origAppliesToBranch = ttcustom_layout_header.applies_to_branch
                origCustomLayout    = ttcustom_layout_header.custom_layout .
        END.
       
        {waiton.i}
       
        THIS-OBJECT:UpdateDataSet().
       
        RUN sys/sicustomlayoutsave.p ON g-AppSrvr (
            INPUT sys.AgilitySession:SessionContextID,
            INPUT cAnswer,
            INPUT origAccessType,
            INPUT origAccessedBy,
            INPUT origAppliesToBranch,
            INPUT origCustomLayout,
            INPUT DATASET dsCustomLayout,
            OUTPUT DATASET dsErrorMsg).
            
        {waitoff.i}
       
        FIND FIRST tterrormsg NO-ERROR.
        IF AVAIL tterrormsg THEN
        DO:
            DATASET dsCustomLayout:COPY-DATASET(DATASET dsOrigCustomLayout:HANDLE).
           
            IF tterrormsg.cErrorType = "sysinfok" THEN
                RUN sysinfok.p
                  ( INPUT  tterrormsg.cMessageID,
                    INPUT  tterrormsg.cMessageParameters ).
            ELSE
                MESSAGE tterrormsg.cMessageTxt VIEW-AS ALERT-BOX ERROR.
        END.
        ELSE
        DO:
            DATASET dsOrigCustomLayout:COPY-DATASET(DATASET dsCustomLayout:HANDLE). 
            m_isNewRecord = FALSE.
            m_isDefault = FALSE.
           
            FOR FIRST ttcustom_layout_header:
              RUN usrlstaccd.p ON g-AppSrvr
                ( INPUT "set",
                  INPUT        ttcustom_layout_header.usage_level_1,
                  INPUT        ttcustom_layout_header.usage_level_2,
                  INPUT        ttcustom_layout_header.usage_level_3,
                  INPUT        ttcustom_layout_header.usage_level_4,
                  INPUT-OUTPUT ttcustom_layout_header.custom_layout,
                  INPUT-OUTPUT ttcustom_layout_header.access_type,
                  INPUT-OUTPUT ttcustom_layout_header.accessed_by,
                  INPUT-OUTPUT ttcustom_layout_header.applies_to_branch).
             
              IF IsLayoutUsable(ttcustom_layout_header.access_type) THEN 
              DO:
                IF VALID-OBJECT(FormInLayoutMode) AND
                   TYPE-OF(FormInLayoutMode, sys.ILayoutableForm) THEN
                  CAST(FormInLayoutMode, sys.ILayoutableForm):ApplyLayout().
                ELSE 
                  ApplyLayout().
              END.
            END.
           
            UpdateButtonsState().
        END. 

    END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE Infragistics.Win.ValueListItem SelectComboBoxItem( INPUT cb AS Infragistics.Win.UltraWinEditors.UltraComboEditor,
                                                                   INPUT cText AS CHARACTER ):
 
        DEFINE VARIABLE cbItem AS Infragistics.Win.ValueListItem NO-UNDO.
        DEFINE VARIABLE i      AS INTEGER                        NO-UNDO.
 
  DO i = 0 TO cb:Items:Count - 1:
 
            IF cb:Items[i]:DisplayText = cText THEN
            DO:
                cbItem = cb:Items[i].
                LEAVE.
            END.   
        END.
       
        RETURN cbItem.
       
END METHOD.


   /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID SetSelectedComponent( INPUT oDesignerControl AS System.Windows.Forms.Control ):
 
        SetSelectedComponent(oDesignerControl, System.ComponentModel.Design.SelectionTypes:Normal).

END METHOD.


   /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID SetSelectedComponent( INPUT oDesignerControl AS System.Windows.Forms.Control, INPUT selectionType AS System.ComponentModel.Design.SelectionTypes ):
 
        DEFINE VARIABLE oSelectionService AS ISelectionService NO-UNDO.
        DEFINE VARIABLE oSelection        AS "System.Object[]" NO-UNDO. 
       
        IF VALID-OBJECT(m_ServiceContainer) THEN /* when loading or restoring this can be NULL */
        DO:
    oSelectionService = CAST(m_ServiceContainer:GetService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.ISelectionService")), ISelectionService).
         
          IF VALID-OBJECT(oDesignerControl) AND
             m_hasAccess THEN  /* check if the control is valid */
          DO:
              oSelection = NEW "System.Object[]"(1).
              oSelection:SetValue(oDesignerControl, 0).
        oSelectionService:SetSelectedComponents(CAST(oSelection, System.Collections.ICollection), selectionType).
          END.
          ELSE /* pass a null collection to select the root */
          DO:
              oSelectionService:SetSelectedComponents(?, selectionType).
          END.
        END.

END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PUBLIC VOID SetSelectedComponents( INPUT oSelections AS "System.Object[]" ):
 
        SetSelectedComponents(oSelections, System.ComponentModel.Design.SelectionTypes:Normal).
       
END METHOD.


     /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PUBLIC VOID SetSelectedComponents( INPUT oSelections AS "System.Object[]", INPUT selectionType AS System.ComponentModel.Design.SelectionTypes ):
 
        DEFINE VARIABLE oSelectionService AS ISelectionService NO-UNDO.
 
  oSelectionService = CAST(m_ServiceContainer:GetService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.ISelectionService")), ISelectionService).
       
        IF VALID-OBJECT(oSelections) AND
           m_hasAccess THEN  /* check if the control is valid */
        DO:
            oSelectionService:SetSelectedComponents(CAST(oSelections, System.Collections.ICollection), selectionType).
        END.
        ELSE /* pass a null collection to select the root */
        DO:
            oSelectionService:SetSelectedComponents(?, selectionType).
        END.

END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID TogglePaneVisibility(  ):
 
        IF NOT m_IsPropertiesShown  AND
           NOT m_IsControlListShown THEN
            THIS-OBJECT:splitContainer1:Panel2Collapsed = TRUE.
        ELSE IF m_IsPropertiesShown      AND
                NOT m_IsControlListShown THEN
        DO:
            THIS-OBJECT:splitContainer1:Panel2Collapsed = FALSE.
            THIS-OBJECT:splitContainer2:Panel2Collapsed = FALSE.
            THIS-OBJECT:splitContainer2:Panel1Collapsed = TRUE.
        END.
        ELSE IF NOT m_IsPropertiesShown  AND
                m_IsControlListShown     THEN
        DO:
            THIS-OBJECT:splitContainer1:Panel2Collapsed = FALSE.
            THIS-OBJECT:splitContainer2:Panel2Collapsed = TRUE.
            THIS-OBJECT:splitContainer2:Panel1Collapsed = FALSE.
        END.
        ELSE
        DO:
            THIS-OBJECT:splitContainer1:Panel2Collapsed = FALSE.
            THIS-OBJECT:splitContainer2:Panel2Collapsed = FALSE.
            THIS-OBJECT:splitContainer2:Panel1Collapsed = FALSE.
        END.

END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID txtX_Leave( INPUT sender AS System.Object, INPUT e AS System.EventArgs ):
 
  UpdateDesigner().

END METHOD.


/*------------------------------------------------------------------------------
   Purpose:                    
   Notes: The cell Value will still reflect the old value. The Text property
          will contain the current screen value which may or may not be
          in the valid format.                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID ultraGrid1_CellChange( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinGrid.CellEventArgs ):
 
        CASE e:Cell:Column:Key:
      WHEN "visible" THEN
      DO:
          IF e:Cell:Row:Cells["mode"]:Text <> "Editable" AND
             e:Cell:Row:Cells["mode"]:Text <> ""         AND
             e:Cell:Text = "False"                       THEN
             e:Cell:Row:Cells["mode"]:Value = "Editable".
         
          DesignerControlShowHide(e:Cell:ROW).
      END.
      WHEN "mode" THEN
      DO:
          DesignerControlUpdateVisual(e:Cell:Row).
         
          IF e:Cell:Text = "Read-only" THEN
          DO:
              e:Cell:Row:Cells["tab_stop"]:Value = FALSE.
             
           DEFINE VARIABLE oTabStopRow AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
         
              oTabStopRow = CAST(e:Cell:Row:Cells[1]:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
             
              IF VALID-OBJECT(oTabStopRow) THEN              
              DO:
                  oTabStopRow:Cells["tab_stop"]:Value = FALSE.
                 
                  /* if the tab order list grid and control list points to the same control */
                  IF Progress.Util.TypeHelper:Equals(e:Cell:Row:Tag, lblChildControls:Tag) THEN
                      RefreshChildTabSettings(e:Cell:Row).
              END.   
          END.
      END.     
  END CASE.
                
END METHOD.


/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID ultraGrid1_InitializeLayout( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs ):


      DEFINE VARIABLE chkVisible AS Infragistics.Win.UltraWinEditors.UltraCheckEditor NO-UNDO.
    
      chkVisible = NEW Infragistics.Win.UltraWinEditors.UltraCheckEditor().
      e:Layout:Bands[0]:Columns["visible"]:EditorControl = chkVisible.
   
   /* sample
     DEFINE VARIABLE vl AS Infragistics.Win.ValueList NO-UNDO.
    
     IF NOT e:Layout:ValueLists:Exists("ModeValueList") THEN
     DO:
         vl = e:Layout:ValueLists:Add("ModeValueList").
         vl:ValueListItems:Add("Editable", "Editable").
         vl:ValueListItems:Add("Read-only", "Read-only").
         vl:ValueListItems:Add("Required", "Required").
     END.
    
     e:Layout:Bands[0]:Columns["mode"]:ValueList = e:Layout:ValueLists["ModeValueList"].
     */
   
END METHOD.


       /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID ultraToolbarsManager1_ToolClick( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinToolbars.ToolClickEventArgs ):
       
        /* The following 3 lines should be part of every window with toolbar */
        DEFINE VARIABLE lContinue AS LOGICAL NO-UNDO.
        THIS-OBJECT:ultraToolbarsManager1:RunAgilityControlLogics(THIS-OBJECT, OUTPUT lContinue).       
        IF NOT lContinue     THEN
            RETURN.
     
  CASE e:Tool:Key:
      WHEN "Capture Values" THEN
      DO:
          DEFINE VARIABLE cFilename AS CHARACTER NO-UNDO.
          SaveLayout().
         
          cFilename = SESSION:TEMP-DIRECTORY + "\capturedvalues.txt".
          OUTPUT TO VALUE(cFilename).

                FOR FIRST ttcustom_layout_header:
                    PUT UNFORMATTED
                        "CREATE ttcustom_layout_header." + CHR(10)
                        "ASSIGN" + CHR(10)
                        "  ttcustom_layout_header.access_type       = cAccessType" + CHR(10)
                        "  ttcustom_layout_header.accessed_by       = cAccessedBy" + CHR(10)
                        "  ttcustom_layout_header.applies_to_branch = cAppliesToBranch" + CHR(10)
                        "  ttcustom_layout_header.custom_layout     = cCustomLayout" + CHR(10)
                        "  ttcustom_layout_header.usage_level_1     = cUsageLevel1." + CHR(10) + CHR(10).
                   
                    FOR EACH ttcustom_layout_section:
                        PUT UNFORMATTED "/* " + CAPS(ttcustom_layout_section.SECTION) + " SECTION */" + CHR(10).
                       
                        PUT UNFORMATTED
                            "ASSIGN" + CHR(10)
                            "  cSection = '" + ttcustom_layout_section.SECTION + "'." + CHR(10) + CHR(10).

                        PUT UNFORMATTED
                            "CREATE ttcustom_layout_section." + CHR(10)
                            "ASSIGN" + CHR(10)
                            "  ttcustom_layout_section.access_type       = cAccessType" + CHR(10)    
                            "  ttcustom_layout_section.accessed_by       = cAccessedBy" + CHR(10)    
                            "  ttcustom_layout_section.applies_to_branch = cAppliesToBranch" + CHR(10)
                            "  ttcustom_layout_section.custom_layout     = cCustomLayout" + CHR(10)  
                            "  ttcustom_layout_section.section           = cSection" + CHR(10)
                            "  ttcustom_layout_section.usage_level_1     = cUsageLevel1." + CHR(10) + CHR(10).

                        FOR EACH ttcustom_layout_detail WHERE
                                 ttcustom_layout_detail.SECTION = ttcustom_layout_section.SECTION:
                            PUT UNFORMATTED
                                "CREATE ttcustom_layout_detail." + CHR(10)
                                "ASSIGN" + CHR(10)
                                "  ttcustom_layout_detail.access_type       = cAccessType" + CHR(10)          
                                "  ttcustom_layout_detail.accessed_by       = cAccessedBy" + CHR(10)          
                                "  ttcustom_layout_detail.applies_to_branch = cAppliesToBranch" + CHR(10)     
                                "  ttcustom_layout_detail.custom_layout     = cCustomLayout" + CHR(10)        
                                "  ttcustom_layout_detail.section           = cSection" + CHR(10)             
                                "  ttcustom_layout_detail.usage_level_1     = cUsageLevel1" + CHR(10)
                                "  ttcustom_layout_detail.widget_name       = '" + ttcustom_layout_detail.widget_name + "'" + CHR(10)
                                "  ttcustom_layout_detail.x_position        = " + STRING(ttcustom_layout_detail.x_position) + CHR(10)
                                "  ttcustom_layout_detail.y_position        = " + STRING(ttcustom_layout_detail.y_position) + CHR(10)
                                "  ttcustom_layout_detail.visible           = " + STRING(ttcustom_layout_detail.VISIBLE) + CHR(10)
                                "  ttcustom_layout_detail.tab_stop          = " + STRING(ttcustom_layout_detail.tab_stop) + CHR(10)
                                "  ttcustom_layout_detail.tab_index         = " + STRING(ttcustom_layout_detail.tab_index) + CHR(10)
                                "  ttcustom_layout_detail.width             = " + STRING(ttcustom_layout_detail.width) + CHR(10)
                                "  ttcustom_layout_detail.height            = " + STRING(ttcustom_layout_detail.height) + CHR(10)
                                "  ttcustom_layout_detail.mode              = '" + ttcustom_layout_detail.mode + "'" + CHR(10).
                             
                            FOR FIRST ttdefcustom_layout_detail WHERE
                                      ttdefcustom_layout_detail.SECTION     = ttcustom_layout_detail.SECTION     AND
                                      ttdefcustom_layout_detail.widget_name = ttcustom_layout_detail.widget_name:
                              PUT UNFORMATTED
                                "  ttcustom_layout_detail.fixed_mode              = " + STRING(ttdefcustom_layout_detail.fixed_mode)  + CHR(10)
                                "  ttcustom_layout_detail.property_value_pair     = '" + ttdefcustom_layout_detail.property_value_pair  + "'" + CHR(10).
                            END.

                            IF ttcustom_layout_detail.widget_name = "dtMiscDate1" THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_date1'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "dtMiscDate2" THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_date2'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc1"    THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_1'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc2"    THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_2'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc3"    THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_3'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc4"    THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_4'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc5"    THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_5'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc6"    THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_6'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc7"    THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_7'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc8"    THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_8'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc9"    THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_9'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc10"   THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_10'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc11"   THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_11'." + CHR(10) + CHR(10).

                            ELSE IF ttcustom_layout_detail.widget_name = "txtMisc12"   THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = 'misc_12'." + CHR(10) + CHR(10).
                            ELSE
                            DO:
                              FIND FIRST ttdefcustom_layout_detail WHERE
                                         ttdefcustom_layout_detail.SECTION     = ttcustom_layout_detail.SECTION     AND
                                         ttdefcustom_layout_detail.widget_name = ttcustom_layout_detail.widget_name NO-ERROR.

                              IF AVAILABLE ttdefcustom_layout_detail THEN
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = '" + ttdefcustom_layout_detail.display_name + "'." + CHR(10) + CHR(10).
                              ELSE
                                PUT UNFORMATTED
                                  "  ttcustom_layout_detail.display_name      = ''." + CHR(10) + CHR(10).
                           END.
                        END.
                    END.
                END.

          OUTPUT CLOSE.
         
          MESSAGE cFilename VIEW-AS ALERT-BOX INFO.
      END.
      /* file functions */
      WHEN "New" THEN
      DO:
          NewLayout().
      END.
      WHEN "Open" THEN
      DO:
                OpenLayout().    
      END.
      WHEN "Save" THEN
            DO:
                SaveLayout().          
            END.
            WHEN "Delete" THEN
            DO:
                DeleteLayout().        
            END. 
      WHEN "Restore" THEN
      DO:
          RestoreLayout().
      END.
     
      WHEN "Align Lefts" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:AlignLeft).
            END.
            WHEN "Align Centers" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:AlignVerticalCenters).
            END.
            WHEN "Align Rights" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:AlignRight).
            END.
            WHEN "Align Tops" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:AlignTop).
            END.
            WHEN "Align Middles" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:AlignHorizontalCenters).
            END.
            WHEN "Align Bottoms" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:AlignBottom).
            END.
           
            WHEN "Make Same Width" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:SizeToControlWidth).
            END.
            WHEN "Make Same Height" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:SizeToControlHeight).
            END.
            WHEN "Make Same Size" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:SizeToControl).
            END.       
            WHEN "Bring to Front" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:BringToFront).
            END. 
            WHEN "Send to Back" THEN
            DO:
                m_MenuService:GlobalInvoke(StandardCommands:SendToBack).
            END.
            WHEN "Tab Index" THEN
            DO:
                /*
                IF CAST(e:Tool, Infragistics.Win.UltraWinToolbars.StateButtonTool):Checked THEN
                DO:
                    flowLayoutPanel1:Enabled = FALSE.
                    UpdateFileToolbarState(FALSE).
                    UpdateLayoutToolbarState(FALSE).
                    THIS-OBJECT:splitContainer2:Enabled = FALSE.
                    CreateTabOrderView().
                    THIS-OBJECT:Refresh().
                END.
                   
                m_MenuService:GlobalInvoke(StandardCommands:TabOrder).
               
                IF NOT CAST(e:Tool, Infragistics.Win.UltraWinToolbars.StateButtonTool):Checked THEN
                DO:
                    flowLayoutPanel1:Enabled = TRUE.
                    UpdateListItems().
                    UpdateFileToolbarState(TRUE).
                    UpdateLayoutToolbarState(TRUE).
                    THIS-OBJECT:splitContainer2:Enabled = TRUE.
                    CreateCurrentView().
                    THIS-OBJECT:Refresh().
                END.
                */
                splitContainer3:Panel1Collapsed = NOT CAST(e:Tool, Infragistics.Win.UltraWinToolbars.StateButtonTool):Checked.
            END.
            WHEN "View Control List Pane" THEN
            DO:
                m_IsControlListShown = CAST(e:Tool, Infragistics.Win.UltraWinToolbars.StateButtonTool):Checked.
                TogglePaneVisibility().
            END.
            WHEN "View Properties Pane" THEN
            DO:
                m_IsPropertiesShown = CAST(e:Tool, Infragistics.Win.UltraWinToolbars.StateButtonTool):Checked.
                TogglePaneVisibility().            
            END.
            WHEN "Bring to Front" THEN
            DO:   
            END.
            WHEN "Send to Back" THEN
            DO:
            END.                                                                                
  END CASE.
END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/
@VisualDesigner.
METHOD PRIVATE VOID ultraToolbarsManager1_ToolValueChanged( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinToolbars.ToolEventArgs ):
 
  CASE e:Tool:Key:
      WHEN "Section" THEN
            DO:
                DEFINE VARIABLE comboBoxTool  AS Infragistics.Win.UltraWinToolbars.ComboBoxTool NO-UNDO.
                DEFINE VARIABLE parentControl AS System.Windows.Forms.Control                   NO-UNDO.
                DEFINE VARIABLE lNew          AS LOGICAL                                        NO-UNDO.
               
                PROCESS EVENTS.
                comboBoxTool = CAST(e:Tool, Infragistics.Win.UltraWinToolbars.ComboBoxTool).
                parentControl =  CAST(comboBoxTool:Value, System.Windows.Forms.Control).               
               
                lNew = m_isNewRecord.
                m_isNewRecord = FALSE. /* to bypass check changed message for NEW record */
               
                IF NOT VALID-OBJECT(m_CurrentLiveParent) OR    /* initial load */
                   THIS-OBJECT:ContinueIfModified()      THEN  /* switching section */
                DO:
                  {waiton.i}
                  LoadSectionLayout(parentControl).
                  {waitoff.i}
                END.
               
                m_isNewRecord = lNew.
            END.                                                                       
  END CASE.

END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE LOGICAL UpdateButtonsState(  ):
        DEFINE VARIABLE cDefaultView     AS CHARACTER                                    NO-UNDO.
        DEFINE VARIABLE btnNew           AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        DEFINE VARIABLE btnSave          AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        DEFINE VARIABLE btnDelete        AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
        DEFINE VARIABLE btnRestore       AS Infragistics.Win.UltraWinToolbars.ButtonTool NO-UNDO.
 
  btnNew = CAST(THIS-OBJECT:ultraToolbarsManager1:Tools["New"], Infragistics.Win.UltraWinToolbars.ButtonTool).
  btnSave = CAST(THIS-OBJECT:ultraToolbarsManager1:Tools["Save"], Infragistics.Win.UltraWinToolbars.ButtonTool).
  btnDelete = CAST(THIS-OBJECT:ultraToolbarsManager1:Tools["Delete"], Infragistics.Win.UltraWinToolbars.ButtonTool).
  btnRestore = CAST(THIS-OBJECT:ultraToolbarsManager1:Tools["Restore"], Infragistics.Win.UltraWinToolbars.ButtonTool).
  btnSave:SharedProps:Enabled = THIS-OBJECT:HasAccess(cbAccessedType:Value:ToString()).
   
        IF {common\checktokensecurity.i &Module = '"Agility Main":U'
                                     &Program = 'LayoutEditor'
                                     &Token = 'allow_save_user_layouts'} OR
           {common\checktokensecurity.i &Module = '"Agility Main":U'
                                     &Program = 'LayoutEditor'
                                     &Token = 'allow_save_all_group_layouts'} THEN
          ASSIGN
            cbAccessedType:Enabled = YES.
        ELSE
          ASSIGN
            cbAccessedType:Enabled = NO.
           
        ASSIGN
            btnNew:SharedProps:Enabled     = btnSave:SharedProps:Enabled
            btnDelete:SharedProps:Enabled  = btnSave:SharedProps:Enabled AND NOT m_isNewRecord AND NOT m_isDefault
            btnRestore:SharedProps:Enabled = btnSave:SharedProps:Enabled
            txtCustomLayout:Enabled        = btnSave:SharedProps:Enabled
            branchSelector:Enabled         = btnSave:SharedProps:Enabled
            ultraGrid1:Enabled             = btnSave:SharedProps:Enabled
            ultraGrid2:Enabled             = btnSave:SharedProps:Enabled
            ultraGrid3:Enabled             = btnSave:SharedProps:Enabled
            pnlProperties:Enabled          = btnSave:SharedProps:Enabled.
           
        UpdateLayoutToolbarState(NOT THIS-OBJECT:IsRootIncluded).      
       
        RETURN btnSave:SharedProps:Enabled.
       
    END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID UpdateDataSet(  ):
 
        DEFINE VARIABLE accessType       AS CHARACTER                    NO-UNDO.
        DEFINE VARIABLE accessedBy       AS CHARACTER                    NO-UNDO.
        DEFINE VARIABLE appliesToBranch  AS CHARACTER                    NO-UNDO.
        DEFINE VARIABLE customLayout     AS CHARACTER                    NO-UNDO.
        DEFINE VARIABLE i                AS INTEGER                      NO-UNDO.
        DEFINE VARIABLE j                AS INTEGER                      NO-UNDO.
        DEFINE VARIABLE oDesignerControl AS System.Windows.Forms.Control NO-UNDO.
        DEFINE VARIABLE cWidgetName      AS CHARACTER                    NO-UNDO.      

        DEFINE BUFFER bufcustom_layout_detail     FOR ttcustom_layout_detail.
       
        accessType = TRIM(THIS-OBJECT:cbAccessedType:Value:ToString()).
        accessedBy = IF accessType = "All" THEN "" ELSE TRIM(THIS-OBJECT:txtAccessedBy:Text).
        appliesToBranch = TRIM(branchSelector:ProfName).
        customLayout = TRIM(THIS-OBJECT:txtCustomLayout:Text).
        customLayout = IF m_isDefault AND customLayout = "" THEN "Sales Order Layout" ELSE customLayout.
        
        FOR FIRST ttcustom_layout_header:
            ASSIGN
                ttcustom_layout_header.access_type       = accessType
                ttcustom_layout_header.accessed_by       = accessedBy
                ttcustom_layout_header.applies_to_branch = appliesToBranch
                ttcustom_layout_header.custom_layout     = customLayout.
        END.
       
        FOR EACH ttcustom_layout_section:
            ASSIGN
                ttcustom_layout_section.access_type       = accessType
                ttcustom_layout_section.accessed_by       = accessedBy
                ttcustom_layout_section.applies_to_branch = appliesToBranch
                ttcustom_layout_section.custom_layout     = customLayout.
        END.

        FOR EACH ttcustom_layout_detail:
            ASSIGN
                ttcustom_layout_detail.access_type       = accessType
                ttcustom_layout_detail.accessed_by       = accessedBy
                ttcustom_layout_detail.applies_to_branch = appliesToBranch
                ttcustom_layout_detail.custom_layout     = customLayout.
        END.
               
        /* Update the parent container */
        cWidgetName = m_CurrentLiveParent:Name.
        FOR FIRST ttcustom_layout_detail WHERE
                  ttcustom_layout_detail.widget_name = cWidgetName:
            ASSIGN
                ttcustom_layout_detail.height         = m_RootDesignerParent:Height
                ttcustom_layout_detail.width          = m_RootDesignerParent:Width
                ttcustom_layout_detail.visible        = TRUE
                ttcustom_layout_detail.mode           = "Editable"
                ttcustom_layout_detail.tab_stop       = TRUE
                ttcustom_layout_detail.tab_index      = 0
                ttcustom_layout_detail.x_position     = 0
                ttcustom_layout_detail.y_position     = 0
                ttcustom_layout_detail.layer_position = 0.
        END.
       
        /* Update the immediate child controls */
        DEFINE VARIABLE lHasDesigner AS LOGICAL NO-UNDO.   
        DO i = 0 TO ultraGrid1:Rows:Count - 1:
           
            lHasDesigner = TRUE.
            oDesignerControl = CAST(ultraGrid1:Rows[i]:Tag, System.Windows.Forms.Control).           
           
            IF NOT VALID-OBJECT(oDesignerControl) THEN
            DO:
                lHasDesigner = FALSE.
                oDesignerControl = CAST(ultraGrid1:Rows[i]:Cells[0]:Tag, System.Windows.Forms.Control).
            END.
           
            IF VALID-OBJECT(oDesignerControl) THEN
            DO:   
                cWidgetName = oDesignerControl:Name.
               
                FOR FIRST ttcustom_layout_detail WHERE
                          ttcustom_layout_detail.section     = m_CurrentSectionName AND
                          ttcustom_layout_detail.widget_name = cWidgetName:
                   
                    ASSIGN
                        ttcustom_layout_detail.mode      = IF ultraGrid1:Rows[i]:Cells["mode"]:Text = "" THEN "Editable"
                                                           ELSE IF ultraGrid1:Rows[i]:Cells["mode"]:Text = "N/A" THEN GetWidgetDefaultMode(cWidgetName)
                                                           ELSE ultraGrid1:Rows[i]:Cells["mode"]:Text
                        ttcustom_layout_detail.visible   = LOGICAL(ultraGrid1:Rows[i]:Cells["visible"]:Text)
                        ttcustom_layout_detail.tab_stop  = LOGICAL(ultraGrid1:Rows[i]:Cells["tab_stop"]:Text)
                        ttcustom_layout_detail.tab_index = INTEGER(ultraGrid1:Rows[i]:Cells["tab_index"]:Text).
                  
                   IF lHasDesigner THEN
                   DO:
                       ASSIGN
                           ttcustom_layout_detail.height     = oDesignerControl:Height
                           ttcustom_layout_detail.width      = oDesignerControl:Width
                           ttcustom_layout_detail.x_position = oDesignerControl:Left
                           ttcustom_layout_detail.y_position = oDesignerControl:Top.
                          
                       IF m_RootDesignerParent:Controls:Contains(oDesignerControl) THEN
                           ttcustom_layout_detail.layer_position = oDesignerControl:Parent:Controls:GetChildIndex(oDesignerControl).
                       ELSE
                           ttcustom_layout_detail.layer_position = 0.
                          
                       /* store the child control settings if the group is visible */
                       DO j = 0 TO oDesignerControl:Controls:Count - 1:
                            IF TYPE-OF(oDesignerControl, tools.IAgilityControl) THEN
                              cWidgetName = oDesignerControl:Name + "+" + oDesignerControl:Controls[j]:Name.
                            ELSE
                              cWidgetName = oDesignerControl:Controls[j]:Name.
                           
                            FOR FIRST bufcustom_layout_detail WHERE
                                      bufcustom_layout_detail.section     = m_CurrentSectionName AND
                                      bufcustom_layout_detail.widget_name = cWidgetName:   
                                ASSIGN
                                    bufcustom_layout_detail.tab_stop = oDesignerControl:Controls[j]:TabStop.
                            END.
                       END. 
                   END.
                   ELSE
                   FOR FIRST ttorigcustom_layout_detail WHERE
                             ttorigcustom_layout_detail.section     = m_CurrentSectionName AND
                             ttorigcustom_layout_detail.widget_name = cWidgetName:

                       BUFFER-COPY
                           ttorigcustom_layout_detail
                         EXCEPT
                           ttorigcustom_layout_detail.access_type       
                           ttorigcustom_layout_detail.accessed_by     
                           ttorigcustom_layout_detail.applies_to_branch
                           ttorigcustom_layout_detail.custom_layout
                           ttorigcustom_layout_detail.mode                                                            
                           ttorigcustom_layout_detail.visible 
                           ttorigcustom_layout_detail.tab_stop
                           ttorigcustom_layout_detail.tab_index
                         TO
                           ttcustom_layout_detail
                         ASSIGN
                           ttcustom_layout_detail.layer_position = 0.                            
                   END.
                END.
            END.
        END.
        
END METHOD.


    /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PUBLIC VOID UpdateDesigner(  ):
 
      DEFINE VARIABLE oSelectionService AS SelectionService             NO-UNDO.
      DEFINE VARIABLE oPrimarySelection AS System.Windows.Forms.Control NO-UNDO.
     
   oSelectionService = CAST(m_ServiceContainer:GetService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.ISelectionService")), SelectionService).
      oPrimarySelection = CAST(oSelectionService:PrimarySelection, System.Windows.Forms.Control).
     
      IF VALID-OBJECT(oPrimarySelection) THEN
      DO:
        m_IsSynchronizingProperties = TRUE.
       
        ASSIGN
            oPrimarySelection:Left     = txtX:Value
            oPrimarySelection:Top      = txtY:Value
            oPrimarySelection:Width    = txtWidth:Value
            oPrimarySelection:Height   = txtHeight:Value.
       
        m_IsSynchronizingProperties = FALSE.
        m_RootDesignerParent:Invalidate().
      END.

END METHOD.

    /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE LOGICAL HasAccess( INPUT ipcAccessedType AS CHARACTER ):
  
      DEFINE VARIABLE lHasAccess AS LOGICAL NO-UNDO INIT NO.

      CASE ipcAccessedType:
   
        WHEN "User" THEN
          ASSIGN
            lHasAccess    = {common\checktokensecurity.i &Module = '"Agility Main":U'
                                                      &Program = 'LayoutEditor'
                                                      &Token = 'allow_save_user_layouts'}.
   
        WHEN "User Group" THEN
          ASSIGN
            lHasAccess    = {common\checktokensecurity.i &Module = '"Agility Main":U'
                                                      &Program = 'LayoutEditor'
                                                      &Token = 'allow_save_all_group_layouts'}.
   
        WHEN "All" THEN
        DO:
          IF {common\checktokensecurity.i &Module = '"Agility Main":U'
                                       &Program = 'LayoutEditor'
                                       &Token = 'allow_save_all_group_layouts'} THEN
          DO:
              ASSIGN
                  lHasAccess   = YES.
          END.
          ELSE
              ASSIGN
                  lHasAccess    = NO.
        END. /* WHEN "All" THEN */
   
        OTHERWISE
          UNDO, THROW NEW Progress.Lang.AppError("PROGRAMMER ERROR - Access type not handled").
   
      END CASE.
      
      RETURN lHasAccess.

END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID UpdateLayoutToolbarState( INPUT lEnabled AS LOGICAL  ):
 
        UpdateToolbarState("Layout", lEnabled).

END METHOD.

/*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID UpdateFileToolbarState( INPUT lEnabled AS LOGICAL  ):
 
        UpdateToolbarState("File", lEnabled).

END METHOD.

/*------------------------------------------------------------------------------
   Purpose: Use this to mass set the Enabled property of the toolbar buttons                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID UpdateToolbarState( INPUT cKey AS CHARACTER, INPUT lEnabled AS LOGICAL  ):
 
        DEFINE VARIABLE i                AS INTEGER                                           NO-UNDO.
        DEFINE VARIABLE oToolBase        AS Infragistics.Win.UltraWinToolbars.ToolBase        NO-UNDO.
     DEFINE VARIABLE btnSave          AS Infragistics.Win.UltraWinToolbars.ButtonTool      NO-UNDO.
     DEFINE VARIABLE btnTabIndex      AS Infragistics.Win.UltraWinToolbars.StateButtonTool NO-UNDO.
    
     btnSave = CAST(THIS-OBJECT:ultraToolbarsManager1:Tools["Save"], Infragistics.Win.UltraWinToolbars.ButtonTool).
            
     DO i = 0 TO THIS-OBJECT:ultraToolbarsManager1:Toolbars[cKey]:Tools:Count - 1:
    
         oToolBase = THIS-OBJECT:ultraToolbarsManager1:Toolbars[cKey]:Tools[i].        
        
         IF cKey = "Layout"             AND
            oToolBase:Key = "Tab Index" THEN
         DO:
             btnTabIndex = CAST(oToolBase, Infragistics.Win.UltraWinToolbars.StateButtonTool).
                oToolBase:SharedProps:Enabled = btnSave:SharedProps:Enabled OR
                                                btnTabIndex:Checked.
         END.
         ELSE IF cKey = "Layout"  THEN
         DO:
                oToolBase:SharedProps:Enabled = lEnabled AND btnSave:SharedProps:Enabled.
         END.
         ELSE IF cKey = "File" THEN
         DO:
             oToolBase:SharedProps:Enabled = lEnabled.
            
                IF lEnabled THEN
                    UpdateButtonsState().
         END.
         ELSE
             oToolBase:SharedProps:Enabled = lEnabled.     
     END.

END METHOD.
 
     /*------------------------------------------------------------------------------
            Purpose:                    
            Notes:                    
    ------------------------------------------------------------------------------*/

    METHOD PRIVATE VOID UpdateListItems(  ):
    
        DEFINE VARIABLE i                AS INTEGER                                    NO-UNDO.
        DEFINE VARIABLE oControlRow      AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
        DEFINE VARIABLE oDesignerControl AS System.Windows.Forms.Control               NO-UNDO.
 
        DO i = 0 TO ultraGrid1:Rows:Count - 1:
            oControlRow = ultraGrid1:Rows[i].
            oDesignerControl = CAST(oControlRow:Tag, System.Windows.Forms.Control).
           
            IF VALID-OBJECT(oDesignerControl) THEN
                oControlRow:Cells["tab_index"]:Value = oDesignerControl:TabIndex.
        END.
           
    END METHOD.


  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID UpdateListView(  ):
 
        DEFINE VARIABLE oSelectionService AS SelectionService                           NO-UNDO.
        DEFINE VARIABLE oPrimarySelection AS System.Windows.Forms.Control               NO-UNDO.
        DEFINE VARIABLE oControlRow       AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
       
  oSelectionService = CAST(m_ServiceContainer:GetService(Progress.Util.TypeHelper:GetType("System.ComponentModel.Design.ISelectionService")), SelectionService).
        oPrimarySelection = CAST(oSelectionService:PrimarySelection, System.Windows.Forms.Control).
       
        IF VALID-OBJECT(oPrimarySelection) THEN
        DO:
            /* oPrimarySelection:TabStop = chkTabstop:Checked. */
           
            oControlRow = CAST(oPrimarySelection:Tag, Infragistics.Win.UltraWinGrid.UltraGridRow).
           
            IF VALID-OBJECT(oControlRow) THEN
            DO:
              
               ultraGrid1:Refresh().
            END.
        END.

END METHOD.  

  /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PRIVATE VOID SetAdditionalProperties( INPUT ctrl AS System.Windows.Forms.Control  ):
   
      DEFINE VARIABLE i                  AS INTEGER   NO-UNDO.
      DEFINE VARIABLE cPropertyNamePairs AS CHARACTER NO-UNDO.

      cPropertyNamePairs = GetWidgetPropertyDefault(ctrl:Name).
     
      IF cPropertyNamePairs <> "" THEN
      DO:
        /* oDesignerControl:GetType():GetProperty("Multiline"):SetValue(oDesignerControl, parentContainer:Controls[i]:GetType():GetProperty("Multiline"):GetValue(parentContainer:Controls[i], ?), ?). */
     
        DEFINE VARIABLE iNumPairs     AS INTEGER                        NO-UNDO.
        DEFINE VARIABLE cPair         AS CHARACTER                      NO-UNDO.
        DEFINE VARIABLE cPropertyName AS CHARACTER                      NO-UNDO.
        DEFINE VARIABLE cValue        AS CHARACTER                      NO-UNDO.
        DEFINE VARIABLE cDataType     AS CHARACTER                      NO-UNDO.
        DEFINE VARIABLE oType         AS System.Type                    NO-UNDO.
        DEFINE VARIABLE oPropInfo     AS System.Reflection.PropertyInfo NO-UNDO.
       
        ASSIGN
          oType     = ctrl:GetType()
          iNumPairs = NUM-ENTRIES(cPropertyNamePairs,"^").

        DO i = 1 TO iNumPairs:
          cPair = ENTRY(i, cPropertyNamePairs, "^").
       
          ASSIGN
            cPropertyName = ENTRY(1, cPair,";")
            cValue        = ENTRY(2, cPair,";")
            cDataType     = ENTRY(3, cPair,";").
         
          oPropInfo = oType:GetProperty(cPropertyName). 
         
          IF VALID-OBJECT(oPropInfo) THEN
          CASE cDataType:
              WHEN "LOGICAL" THEN
                  oPropInfo:SetValue(ctrl, BOX(LOGICAL(cValue)), ?).
              WHEN "CHARACTER" OR
              WHEN "LONGCHAR"  THEN
                  oPropInfo:SetValue(ctrl, BOX(cValue), ?).
              WHEN "INTEGER" THEN
                  oPropInfo:SetValue(ctrl, BOX(INTEGER(cValue)), ?).
              WHEN "DECIMAL" THEN
                  oPropInfo:SetValue(ctrl, BOX(DECIMAL(cValue)), ?).
          END CASE.
        END.
      END.
    END METHOD.

DESTRUCTOR PUBLIC LayoutEditor ( ):
     IF VALID-OBJECT(m_SelectionService) THEN
     DO:
      m_SelectionService:SelectionChanged:UNSUBSCRIBE(OnSelectionChanged).
            DELETE OBJECT m_SelectionService.
        END.
           
        IF VALID-OBJECT(m_RootDesignerParent) THEN
        DO:
            m_RootDesignerParent:SizeChanged:UNSUBSCRIBE(ctl_SizeLocationChanged).
      m_RootDesignerParent:Dispose().
            DELETE OBJECT m_RootDesignerParent.
        END.
         
     IF VALID-OBJECT(m_DesignerHost) THEN
        DO:
            m_DesignerHost:ComponentRemoved:UNSUBSCRIBE(OnComponentRemoved).
            m_DesignerHost:Dispose().
            DELETE OBJECT m_DesignerHost.
        END.
       
  IF VALID-OBJECT(components) THEN DO:       
   CAST(components, System.IDisposable):Dispose().
  END.

END DESTRUCTOR.

    /*------------------------------------------------------------------------------
   Purpose:                    
   Notes:                    
------------------------------------------------------------------------------*/

METHOD PROTECTED OVERRIDE VOID WndProc(INPUT-OUTPUT msg AS System.Windows.Forms.Message):
  
      DEFINE VARIABLE WM_SYSCOMMAND   AS INTEGER INIT 274.
      DEFINE VARIABLE SC_MAXIMIZE2    AS INTEGER INIT 61490.
     
      IF VALID-OBJECT(msg)       AND
         msg:Msg = WM_SYSCOMMAND THEN
      DO:
        IF msg:WParam:ToInt32() = SC_MAXIMIZE2 THEN
        DO:
           SUPER:WndProc(INPUT-OUTPUT  msg).
           
           DEFINE VARIABLE oMethod     AS System.Reflection.MethodInfo NO-UNDO.
           DEFINE VARIABLE oType       AS System.TYPE NO-UNDO.
           DEFINE VARIABLE bindingAttr AS System.Reflection.BindingFlags NO-UNDO.
           DEFINE VARIABLE arrayVar    AS System.Object EXTENT 2 NO-UNDO.
          
          
           bindingAttr = System.Reflection.BindingFlags:Instance.
           bindingAttr = CAST(Progress.Util.EnumHelper:Or(bindingAttr, System.Reflection.BindingFlags:NonPublic), System.Reflection.BindingFlags).
           oType = Progress.Util.TypeHelper:GetType("System.Windows.Forms.Control").
           oMethod = oType:GetMethod("RemovePendingMessages", bindingAttr).

           IF VALID-OBJECT(oMethod) THEN
           DO:
             /* throw away left mouse event */
             arrayVar[1] = 513.
             arrayVar[2] = 515.
             oMethod:Invoke(THIS-OBJECT, arrayVar).

             /* throw away left mouse event on non-client area */
             arrayVar[1] = 161.
             arrayVar[2] = 163.
             oMethod:Invoke(THIS-OBJECT, arrayVar).
           END.
        END.
        ELSE
          SUPER:WndProc(INPUT-OUTPUT  msg).
      END.
      ELSE IF VALID-OBJECT(msg) THEN
        SUPER:WndProc(INPUT-OUTPUT  msg).

END METHOD.

END CLASS.

Posted by Thomas Mercer-Hursh on 05-Feb-2010 16:06

That's really hard to read, especially squished up in an indented post.  What I was hoping for was just the signature lines and the calls.

E,g, definitions:

METHOD PRIVATE LOGICAL IsWidgetInFixedMode( INPUT ipcWidgetName AS  CHARACTER ):

METHOD PRIVATE LOGICAL IsWidgetInFixedMode( INPUT ipcSectionName AS  CHARACTER, INPUT ipcWidgetName AS CHARACTER ):

E.g Calls:

THIS-OBJECT:IsWidgetInFixedMode(ttcustom_layout_detail.widget_name)

THIS-OBJECT:IsWidgetInFixedMode( oOriginalControl:NAME)

THIS-OBJECT:IsWidgetInFixedMode(cSectionName, oControl:Name)

THIS-OBJECT:IsWidgetInFixedMode( ctrl:Name)

RETURN IsWidgetInFixedMode(m_CurrentSectionName, ipcWidgetName).

THIS-OBJECT:IsWidgetInFixedMode( cWidgetName)

Is that all of them?  Is this the order of definitions that worked or the one that didn't?

Which is the call that gets the error?

I notice all the calls use THIS-OBJECT except one.  And that one is in the body of the method.  Significant?

Posted by jquerijero on 05-Feb-2010 16:20

The one with 2 parameters is the one getting called inside the public method and causing the error. THIS-OBJECT is optional though it helps with the Intellisense.

This thread is closed