Function Dakota_Test_Events(CtrlEntId, Event, @PARAMS)
/***********************************************************************************************************************

    This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
    permission from Infineon.

    Name        :   NDW_Main_Events

    Description :   This function acts as a commuter module for all events related to this window.

    Notes       :   Commuter Modules are automatically called from the Promoted_Events function which is called by the
                    application-specific promoted event handler. This makes it possible to add QuickEvents that need to
                    execute Basic+ logic without having use the Form Designer to make the association, although this is
                    limited to the events which are currently promoted.

                    If the form needs to call the commuter module directly then the QuickEvent parameters should be
                    formatted like this:

                        '@SELF','@EVENT',['@PARAM1','@PARAMx']

    Parameters  :
        CtrlEntId   [in] -- The fully qualified name of the control calling the promoted event
        Event       [in] -- The event being executed. See the Notes section regarding "PRE" events
        Param1-15   [in] -- Additional event parameter holders
        EventFlow  [out] -- Set to 1 or 0 so the calling event knows whether or not to chain forward. See comments in
                            EVENT_SETUP insert

    History     :   (Date, Initials, Notes)
        05/08/18    dmb     Created initial commuter module.

***********************************************************************************************************************/

#pragma precomp SRP_PreCompiler
#Window DAKOTA_TEST

$insert APP_INSERTS
$insert EVENT_SETUP


SubclassInfo    = Form_Services('FindSubclassControl')
Subclass        = SubclassInfo<1>

// Update the arguments so that the OpenInsight OLE event will treate the ActiveX event as a native event handler.
If Event EQ 'OLE' then
    Transfer Event to OIEvent
    Transfer Param1 to Event
    Transfer Param2 to Param1
    Transfer Param3 to Param2
    Transfer Param4 to Param3
    Transfer Param5 to Param4
    Transfer Param6 to Param5
    Transfer Param7 to Param6
    Transfer Param8 to Param7
end


GoToEvent Event for CtrlEntID

Return EventFlow else EVENT_CONTINUE$


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Events
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Event WINDOW.CREATE(CreateParam)
	
	Gosub Setup_OLE_Controls
    
end event




////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Setup_OLE_Controls:

    Qualify     = ''
    Qualify<1>  = 1
    Qualify<4>  = 0

    FontArray          = ''
    ColorFill          = ''
    FontArray<1, 1, 2> = 11
	Send_Message(@Window : '.OLE_WIP_STATUS', 'QUALIFY_EVENT', 'OLE.OnClick', Qualify)
    Set_Property(@Window:".OLE_WIP_STATUS", "OLE.Font", FontArray)
    ColorFill<1>       = "White"
    ColorFill<2>       = "White"
    ColorFill<3>       = "White"
    ColorFill<5>       = "White"
    Set_Property(@Window:".OLE_WIP_STATUS", "OLE.ForeColor", ColorFill)
    ColorFill          = ''
    ColorFill<1>       = "Vertical(Gradient(RGB(10, 130, 118), (10, 130, 118)),Border(RGB(10, 130, 118)),Rounded(1))"
    ColorFill<2>       = "Vertical(Gradient(RGB(10, 130, 118) L=40, RGB(10, 130, 118) L=40), Border(RGB(10, 130, 118)),Rounded(1))"
    ColorFill<3>       = "Vertical(Gradient(RGB(10, 130, 118) L=20, RGB(10, 130, 118) L=20), Border(RGB(10, 130, 118)),Rounded(1))"
    ColorFill<5>       = "Vertical(Gradient(RGB(10, 130, 118), (10, 130, 118)),Border(RGB(10, 130, 118)),Rounded(1))"
    Set_Property(@Window : '.OLE_WIP_STATUS', "OLE.Background", ColorFill)
    Set_Property(@Window:".OLE_WIP_STATUS", "OLE.Caption", "WIP Status")
    
    ColorFill = ''
    Send_Message(@Window : '.OLE_RDS', 'QUALIFY_EVENT', 'OLE.OnClick', Qualify)
    Set_Property(@Window:".OLE_RDS", "OLE.Font", FontArray)
    ColorFill<1> = "White"
    ColorFill<2> = "White"
    ColorFill<3> = "White"
    ColorFill<5> = "White"
    Set_Property(@Window:".OLE_RDS", "OLE.ForeColor", ColorFill)
    ColorFill = ''
    ColorFill<1> = "Vertical(Gradient(RGB(10, 130, 118), (10, 130, 118)),Border(RGB(10, 130, 118)),Rounded(1))"
    ColorFill<2> = "Vertical(Gradient(RGB(10, 130, 118) L=40, RGB(10, 130, 118) L=40), Border(RGB(10, 130, 118)),Rounded(1))"
    ColorFill<3> = "Vertical(Gradient(RGB(10, 130, 118) L=20, RGB(10, 130, 118) L=20), Border(RGB(10, 130, 118)),Rounded(1))"
    ColorFill<5> = "Vertical(Gradient(RGB(10, 130, 118), (10, 130, 118)),Border(RGB(10, 130, 118)),Rounded(1))"
    Set_Property(@Window : '.OLE_RDS', "OLE.Background", ColorFill)
    Set_Property(@Window:".OLE_RDS", "OLE.Caption", "RDS")
    
    ColorFill = ''
    Send_Message(@Window : '.OLE_WM_OUT', 'QUALIFY_EVENT', 'OLE.OnClick', Qualify)
    Set_Property(@Window:".OLE_WM_OUT", "OLE.Font", FontArray)
    ColorFill<1> = "White"
    ColorFill<2> = "White"
    ColorFill<3> = "White"
    ColorFill<5> = "White"
    Set_Property(@Window:".OLE_WM_OUT", "OLE.ForeColor", ColorFill)
    ColorFill = ''
    ColorFill<1> = "Vertical(Gradient(RGB(10, 130, 118), (10, 130, 118)),Border(RGB(10, 130, 118)),Rounded(1))"
    ColorFill<2> = "Vertical(Gradient(RGB(10, 130, 118) L=40, RGB(10, 130, 118) L=40), Border(RGB(10, 130, 118)),Rounded(1))"
    ColorFill<3> = "Vertical(Gradient(RGB(10, 130, 118) L=20, RGB(10, 130, 118) L=20), Border(RGB(10, 130, 118)),Rounded(1))"
    ColorFill<5> = "Vertical(Gradient(RGB(10, 130, 118), (10, 130, 118)),Border(RGB(10, 130, 118)),Rounded(1))"
    Set_Property(@Window : '.OLE_WM_OUT', "OLE.Background", ColorFill)
    Set_Property(@Window:".OLE_WM_OUT", "OLE.Caption", "WM Out")
    
return





