Type | Description | |||
Itm as Item | An Item object that contains the sub-control. | |||
Ev as OleEvent | An OleEvent object that holds information about the fired event. |
The eXRibbon component may include sub-menus that displays any ActiveX / NET Component. The inside COM/ActiveX control fires its events through the ExRibbon's OleEvent event. Use the ItemTypeEnum.SubControl to add an item that hosts an ActiveX inside. Use the SubControl property to access the properties to create the inside ActiveX control.
The following screen shot displays an item with an ExCalendar inside:
Syntax for OleEvent event, /NET version, on:
private void OleEvent(object sender,exontrol.EXRIBBONLib.Item Itm,exontrol.EXRIBBONLib.OleEvent Ev) { } Private Sub OleEvent(ByVal sender As System.Object,ByVal Itm As exontrol.EXRIBBONLib.Item,ByVal Ev As exontrol.EXRIBBONLib.OleEvent) Handles OleEvent End Sub |
private void OleEvent(object sender, AxEXRIBBONLib._IRibbonEvents_OleEventEvent e) { } void OnOleEvent(LPDISPATCH Itm,LPDISPATCH Ev) { } void __fastcall OleEvent(TObject *Sender,Exribbonlib_tlb::IItem *Itm,Exribbonlib_tlb::IOleEvent *Ev) { } procedure OleEvent(ASender: TObject; Itm : IItem;Ev : IOleEvent); begin end; procedure OleEvent(sender: System.Object; e: AxEXRIBBONLib._IRibbonEvents_OleEventEvent); begin end; begin event OleEvent(oleobject Itm,oleobject Ev) end event OleEvent Private Sub OleEvent(ByVal sender As System.Object, ByVal e As AxEXRIBBONLib._IRibbonEvents_OleEventEvent) Handles OleEvent End Sub Private Sub OleEvent(ByVal Itm As EXRIBBONLibCtl.IItem,ByVal Ev As EXRIBBONLibCtl.IOleEvent) End Sub Private Sub OleEvent(ByVal Itm As Object,ByVal Ev As Object) End Sub LPARAMETERS Itm,Ev PROCEDURE OnOleEvent(oRibbon,Itm,Ev) RETURN |
<SCRIPT EVENT="OleEvent(Itm,Ev)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function OleEvent(Itm,Ev) End Function </SCRIPT> Procedure OnComOleEvent Variant llItm Variant llEv Forward Send OnComOleEvent llItm llEv End_Procedure METHOD OCX_OleEvent(Itm,Ev) CLASS MainDialog RETURN NIL void onEvent_OleEvent(COM _Itm,COM _Ev) { } function OleEvent as v (Itm as OLE::Exontrol.Ribbon.1::IItem,Ev as OLE::Exontrol.Ribbon.1::IOleEvent) end function function nativeObject_OleEvent(Itm,Ev) return |
The following samples shows how to load an ActiveX control ( Exontrol.Calendar )
VBA (MS Access, Excell...)
With Ribbon1 With .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create End With .Refresh End With
VB6
With Ribbon1 With .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create End With .Refresh End With
VB.NET
With Exribbon1 With .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create() End With .Refresh() End With
VB.NET for /COM
With AxRibbon1 With .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create() End With .Refresh() End With
C++
/* Copy and paste the following directives to your header file as it defines the namespace 'EXRIBBONLib' for the library: 'ExRibbon 1.0 Control Library' #import <ExRibbon.dll> using namespace EXRIBBONLib; */ EXRIBBONLib::IRibbonPtr spRibbon1 = GetDlgItem(IDC_RIBBON1)->GetControlUnknown(); EXRIBBONLib::IControlPtr var_Control = spRibbon1->GetItems()->Add(L"Calendar",long(3),vtMissing)->GetSubControl(); var_Control->PutWidth(256); var_Control->PutHeight(256); var_Control->PutControlID(L"Exontrol.Calendar"); var_Control->Create(); spRibbon1->Refresh();
C++ Builder
Exribbonlib_tlb::IControlPtr var_Control = Ribbon1->Items->Add(L"Calendar",TVariant(3),TNoParam())->SubControl; var_Control->Width = 256; var_Control->Height = 256; var_Control->ControlID = L"Exontrol.Calendar"; var_Control->Create(); Ribbon1->Refresh();
C#
exontrol.EXRIBBONLib.Control var_Control = exribbon1.Items.Add("Calendar",3,null).SubControl; var_Control.Width = 256; var_Control.Height = 256; var_Control.ControlID = "Exontrol.Calendar"; var_Control.Create(); exribbon1.Refresh();
JScript/JavaScript
<BODY onload='Init()'> <OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="Ribbon1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_Control = Ribbon1.Items.Add("Calendar",3,null).SubControl; var_Control.Width = 256; var_Control.Height = 256; var_Control.ControlID = "Exontrol.Calendar"; var_Control.Create(); Ribbon1.Refresh(); } </SCRIPT> </BODY>
VBScript
<BODY onload='Init()'> <OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="Ribbon1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With Ribbon1 With .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create End With .Refresh End With End Function </SCRIPT> </BODY>
C# for /COM
EXRIBBONLib.Control var_Control = axRibbon1.Items.Add("Calendar",3,null).SubControl; var_Control.Width = 256; var_Control.Height = 256; var_Control.ControlID = "Exontrol.Calendar"; var_Control.Create(); axRibbon1.Refresh();
X++ (Dynamics Ax 2009)
public void init() { COM com_Control,com_Item; anytype var_Control,var_Item; ; super(); var_Item = COM::createFromObject(exribbon1.Items()).Add("Calendar",COMVariant::createFromInt(3)); com_Item = var_Item; var_Control = com_Item.SubControl(); com_Control = var_Control; com_Control.Width(256); com_Control.Height(256); com_Control.ControlID("Exontrol.Calendar"); com_Control.Create(); exribbon1.Refresh(); }
Delphi 8 (.NET only)
with AxRibbon1 do begin with Items.Add('Calendar',TObject(3),Nil).SubControl do begin Width := 256; Height := 256; ControlID := 'Exontrol.Calendar'; Create(); end; Refresh(); end
Delphi (standard)
with Ribbon1 do begin with Items.Add('Calendar',OleVariant(3),Null).SubControl do begin Width := 256; Height := 256; ControlID := 'Exontrol.Calendar'; Create(); end; Refresh(); end
VFP
with thisform.Ribbon1 with .Items.Add("Calendar",3).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.Calendar" .Create endwith .Refresh endwith
dBASE Plus
local oRibbon,var_Control oRibbon = form.Activex1.nativeObject var_Control = oRibbon.Items.Add("Calendar",3).SubControl var_Control.Width = 256 var_Control.Height = 256 var_Control.ControlID = "Exontrol.Calendar" var_Control.Create() oRibbon.Refresh()
XBasic (Alpha Five)
Dim oRibbon as P Dim var_Control as P oRibbon = topparent:CONTROL_ACTIVEX1.activex var_Control = oRibbon.Items.Add("Calendar",3).SubControl var_Control.Width = 256 var_Control.Height = 256 var_Control.ControlID = "Exontrol.Calendar" var_Control.Create() oRibbon.Refresh()
Visual Objects
local var_Control as IControl var_Control := oDCOCX_Exontrol1:Items:Add("Calendar",3,nil):SubControl var_Control:Width := 256 var_Control:Height := 256 var_Control:ControlID := "Exontrol.Calendar" var_Control:Create() oDCOCX_Exontrol1:Refresh()
PowerBuilder
OleObject oRibbon,var_Control oRibbon = ole_1.Object var_Control = oRibbon.Items.Add("Calendar",3).SubControl var_Control.Width = 256 var_Control.Height = 256 var_Control.ControlID = "Exontrol.Calendar" var_Control.Create() oRibbon.Refresh()
Visual DataFlex
Procedure OnCreate Forward Send OnCreate Variant voItems Get ComItems to voItems Handle hoItems Get Create (RefClass(cComItems)) to hoItems Set pvComObject of hoItems to voItems Variant voItem Get ComAdd of hoItems "Calendar" 3 Nothing to voItem Handle hoItem Get Create (RefClass(cComItem)) to hoItem Set pvComObject of hoItem to voItem Variant voControl Get ComSubControl of hoItem to voControl Handle hoControl Get Create (RefClass(cComControl)) to hoControl Set pvComObject of hoControl to voControl Set ComWidth of hoControl to 256 Set ComHeight of hoControl to 256 Set ComControlID of hoControl to "Exontrol.Calendar" Send ComCreate of hoControl Send Destroy to hoControl Send Destroy to hoItem Send Destroy to hoItems Send ComRefresh End_Procedure
XBase++
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oControl LOCAL oRibbon oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oRibbon := XbpActiveXControl():new( oForm:drawingArea ) oRibbon:CLSID := "Exontrol.Ribbon.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/ oRibbon:create(,, {10,60},{610,370} ) oControl := oRibbon:Items():Add("Calendar",3):SubControl() oControl:Width := 256 oControl:Height := 256 oControl:ControlID := "Exontrol.Calendar" oControl:Create() oRibbon:Refresh() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN