Type | Description | |||
Object as Object | An Object that fires the event. | |||
Ev as OleEvent | An OleEvent object that holds information about fired event. | |||
Ed as Editor | An Editor object whose inner ActiveX control fires the event. |
private void UserEditorOleEvent(object sender,object Obj,exontrol.EXRECORDLib.OleEvent Ev,exontrol.EXRECORDLib.Editor Ed) { } Private Sub UserEditorOleEvent(ByVal sender As System.Object,ByVal Obj As Object,ByVal Ev As exontrol.EXRECORDLib.OleEvent,ByVal Ed As exontrol.EXRECORDLib.Editor) Handles UserEditorOleEvent End Sub |
private void UserEditorOleEvent(object sender, AxEXRECORDLib._IRecordEvents_UserEditorOleEventEvent e) { } void OnUserEditorOleEvent(LPDISPATCH Object,LPDISPATCH Ev,LPDISPATCH Ed) { } void __fastcall UserEditorOleEvent(TObject *Sender,IDispatch *Object,Exrecordlib_tlb::IOleEvent *Ev,Exrecordlib_tlb::IEditor *Ed) { } procedure UserEditorOleEvent(ASender: TObject; Object : IDispatch;Ev : IOleEvent;Ed : IEditor); begin end; procedure UserEditorOleEvent(sender: System.Object; e: AxEXRECORDLib._IRecordEvents_UserEditorOleEventEvent); begin end; begin event UserEditorOleEvent(oleobject Object,oleobject Ev,oleobject Ed) end event UserEditorOleEvent Private Sub UserEditorOleEvent(ByVal sender As System.Object, ByVal e As AxEXRECORDLib._IRecordEvents_UserEditorOleEventEvent) Handles UserEditorOleEvent End Sub Private Sub UserEditorOleEvent(ByVal Object As Object,ByVal Ev As EXRECORDLibCtl.IOleEvent,ByVal Ed As EXRECORDLibCtl.IEditor) End Sub Private Sub UserEditorOleEvent(ByVal Object As Object,ByVal Ev As Object,ByVal Ed As Object) End Sub LPARAMETERS Object,Ev,Ed PROCEDURE OnUserEditorOleEvent(oRecord,Object,Ev,Ed) RETURN |
<SCRIPT EVENT="UserEditorOleEvent(Object,Ev,Ed)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function UserEditorOleEvent(Object,Ev,Ed) End Function </SCRIPT> Procedure OnComUserEditorOleEvent Variant llObject Variant llEv Variant llEd Forward Send OnComUserEditorOleEvent llObject llEv llEd End_Procedure METHOD OCX_UserEditorOleEvent(Object,Ev,Ed) CLASS MainDialog RETURN NIL void onEvent_UserEditorOleEvent(COM _Object,COM _Ev,COM _Ed) { } function UserEditorOleEvent as v (Object as P,Ev as OLE::Exontrol.Record.1::IOleEvent,Ed as OLE::Exontrol.Record.1::IEditor) end function function nativeObject_UserEditorOleEvent(Object,Ev,Ed) return |
The following VB sample adds an Exontrol.ComboBox control and displays the events being fired by inner ActiveX control:
Option Explicit Private Function isInstalled(ByVal s As String) As Boolean On Error GoTo Error CreateObject (s) isInstalled = True Exit Function Error: isInstalled = False End Function Private Sub Form_Load() With Record1 .BeginUpdate With .Add("ActiveX", UserEditorType) .Position = 2 Dim progID As String progID = "Exontrol.ComboBox" If Not (isInstalled(progID)) Then .Value = """" & progID & """ is not installed." .ToolTip = .Value .ForeColor = vbRed Else .UserEditor progID, "" .LabelBackColor = SystemColorConstants.vbMenuBar ' Accesses the inside ActiveX control, in our case an ExComboBox control. https://www.exontrol.com/excombobox.jsp With .UserEditorObject() .BeginUpdate .BackColorEdit = SystemColorConstants.vbMenuBar .IntegralHeight = True .ColumnAutoResize = True .LinesAtRoot = True .MinHeightList = 164 .MinWidthList = 264 .MarkSearchColumn = False .FilterBarDropDownHeight = -150 .DrawGridLines = True .Alignment = 0 With .Columns .Add "Column 1" .Add "Column 2" With .Add("Column 3") .DisplayFilterButton = True End With End With With .Items Dim h, h1 h = .AddItem(Array("Root 1", "SubChild 1", "SubChild 2")) h1 = .InsertItem(h, , Array("Child 1", "SubChild 1.1", "SubChild 1.2")) .CellMerge(h1, 0) = 1 .CellHasCheckBox(h1, 0) = True h1 = .InsertItem(h, , Array("Child 2", "SubChild 2.1", "SubChild 2.2")) .CellMerge(h1, 0) = 1 .CellHasCheckBox(h1, 0) = True .ExpandItem(h) = True h = .AddItem(Array("Root 2", "SubChild 1", "SubChild 2")) h1 = .InsertItem(h, , Array("Child 1", "SubChild 1.1", "SubChild 1.2")) .CellMerge(h1, 0) = 1 h1 = .InsertItem(h, , Array("Child 2", "SubChild 2.1", "SubChild 2.2")) .CellMerge(h1, 0) = 1 .ExpandItem(h) = True End With .Value = "Root 1" .EndUpdate End With End If End With .EndUpdate End With End Sub Private Sub Record1_UserEditorOleEvent(ByVal Object As Object, ByVal Ev As EXRECORDLibCtl.IOleEvent, ByVal Ed As EXRECORDLibCtl.IEditor) On Error Resume Next Debug.Print "Event name: " & Ev.Name If (Ev.CountParam = 0) Then Debug.Print vbTab & "The event has no arguments." Else Debug.Print "The event has the following arguments:" Dim i As Long For i = 0 To Ev.CountParam - 1 Debug.Print vbTab & Ev(i).Name; " = " & Ev(i).Value Next End If End Sub
The following VC sample adds an Exontrol.ComboBox control and displays the events being fired by inner ActiveX control:
#import "c:\winnt\system32\ExComboBox.dll" #import "c:\winnt\system32\ExRecord.dll" CString strObject( "Exontrol.ComboBox" ); COleVariant vtMissing; vtMissing.vt = VT_ERROR; m_record.BeginUpdate(); m_record.SetLabelSize( 110 ); CEditor editor = m_record.Add( COleVariant( "ActiveX" ), EXRECORDLib::UserEditorType, vtMissing ); editor.SetPosition( 2 ); if ( !isInstalled( strObject.AllocSysString() ) ) { CString strFormat; strFormat.Format( "\"%s\" is not installed.", (LPCSTR)strObject ); editor.SetValue( COleVariant( strFormat ) ); editor.SetForeColor( RGB( 255, 0, 0 ) ); } else { // Creates the exComboBox control. https://www.exontrol.com/excombobox.jsp editor.UserEditor( strObject, "" ); if ( EXCOMBOBOXLib::IComboBoxPtr spComboBox = editor.GetUserEditorObject() ) { spComboBox->BeginUpdate(); spComboBox->BackColorEdit = GetSysColor( COLOR_MENU ); spComboBox->IntegralHeight = true; spComboBox->ColumnAutoResize = true; spComboBox->LinesAtRoot = EXCOMBOBOXLib::exLinesAtRoot; spComboBox->MinHeightList = 164; spComboBox->MinWidthList = 264; spComboBox->MarkSearchColumn = false; spComboBox->DrawGridLines = EXCOMBOBOXLib::exAllLines; spComboBox->FilterBarDropDownHeight = -150; spComboBox->Alignment = EXCOMBOBOXLib::RightAlignment; EXCOMBOBOXLib::IColumnsPtr spColumns = spComboBox->Columns; spColumns->Add("Column 1"); spColumns->Add("Column 2"); EXCOMBOBOXLib::IColumnPtr spColumn = spColumns->Add("Column 3"); spColumn->DisplayFilterButton = true; EXCOMBOBOXLib::IItemsPtr spItems = spComboBox->Items; long h = spItems->AddItem( v( "Root 1" ) ); spItems->CellCaption[v(h)][v((long)1)] = v("SubChild 1"); spItems->CellCaption[v(h)][v((long)2)] = v("SubChild 2"); long h1 = spItems->InsertItem( h, vtMissing, v( "Child 1" ) ); spItems->CellCaption[v(h1)][v((long)1)] = v("SubChild 1.1"); spItems->CellCaption[v(h1)][v((long)2)] = v("SubChild 1.2"); spItems->CellHasCheckBox[v(h1)][v((long)0)] = true; spItems->CellMerge[v(h1)][v((long)0)] = v((long)1); h1 = spItems->InsertItem( h, vtMissing, v( "Child 2" ) ); spItems->CellCaption[v(h1)][v((long)1)] = v("SubChild 2.1"); spItems->CellCaption[v(h1)][v((long)2)] = v("SubChild 2.2"); spItems->CellHasCheckBox[v(h1)][v((long)0)] = true; spItems->CellMerge[v(h1)][v((long)0)] = v((long)1); spItems->put_ExpandItem( h, TRUE ); h = spItems->AddItem( v( "Root 2" ) ); spItems->CellCaption[v(h)][v((long)1)] = v("SubChild 1"); spItems->CellCaption[v(h)][v((long)2)] = v("SubChild 2"); h1 = spItems->InsertItem( h, vtMissing, v( "Child 1" ) ); spItems->CellCaption[v(h1)][v((long)1)] = v("SubChild 1.1"); spItems->CellCaption[v(h1)][v((long)2)] = v("SubChild 1.2"); spItems->CellHasCheckBox[v(h1)][v((long)0)] = true; spItems->CellMerge[v(h1)][v((long)0)] = v((long)1); h1 = spItems->InsertItem( h, vtMissing, v( "Child 2" ) ); spItems->CellCaption[v(h1)][v((long)1)] = v("SubChild 2.1"); spItems->CellCaption[v(h1)][v((long)2)] = v("SubChild 2.2"); spItems->CellHasCheckBox[v(h1)][v((long)0)] = true; spItems->CellMerge[v(h1)][v((long)0)] = v((long)1); spItems->put_ExpandItem( h, TRUE ); spComboBox->Value = "Root 1"; spComboBox->EndUpdate(); } } m_record.EndUpdate(); static CString V2S( VARIANT* pv, LPCTSTR szDefault = _T("") ) { if ( pv ) { if ( pv->vt == VT_ERROR ) return szDefault; COleVariant vt; vt.ChangeType( VT_BSTR, pv ); return V_BSTR( &vt ); } return szDefault; } void OnUserEditorOleEventRecord1(LPDISPATCH Object, LPDISPATCH Ev, LPDISPATCH Ed) { EXRECORDLib::IOleEventPtr spEvent = Ev; CString strOutput = "Event name: "; strOutput += spEvent->Name; strOutput += "\r\n"; if ( spEvent->CountParam == 0 ) { strOutput += "\tThe event has no arguments."; } else { strOutput += "\tThe event has no arguments.\r\n"; for ( long i = 0; i < spEvent->CountParam; i++ ) { strOutput += spEvent->GetParam( v(i) )->Name; strOutput += " = "; strOutput += V2S( &spEvent->GetParam( v(i) )->Value); strOutput += "\r\n"; } } OutputDebugString( strOutput ); }
In C++, the #import "path-to-ExRecord.dll" adds a new EXRECORDLib namespace that includes definition for OleEvent and OleEventParam classes.