Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
bad4c221
Kaydet (Commit)
bad4c221
authored
May 22, 2003
tarafından
Vladimir Glazounov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
INTEGRATION: CWS uno4 (1.3.2); FILE ADDED
2003/05/08 06:41:40 jl 1.3.2.1: *** empty log message ***
üst
238c51fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
0 deletions
+98
-0
events.htm
extensions/test/ole/EventListenerSample/events.htm
+98
-0
No files found.
extensions/test/ole/EventListenerSample/events.htm
0 → 100644
Dosyayı görüntüle @
bad4c221
<HTML>
<HEAD>
<META
NAME=
"GENERATOR"
Content=
"Microsoft Developer Studio"
>
<META
HTTP-EQUIV=
"Content-Type"
content=
"text/html; charset=iso-8859-1"
>
<TITLE>
Document Title
</TITLE>
</HEAD>
<BODY
id=
theBody
>
<script
language=
"JScript"
>
function
Main
(
id
)
{
var
objServiceManager
=
new
ActiveXObject
(
"com.sun.star.ServiceManager"
);
var
objDesktop
=
objServiceManager
.
createInstance
(
"com.sun.star.frame.Desktop"
);
var
args
=
new
Array
();
var
objDocument
=
objDesktop
.
loadComponentFromURL
(
"private:factory/swriter"
,
"_blank"
,
0
,
args
);
var
listener
;
if
(
id
==
0
)
listener
=
new
XEventListener_Impl
();
else
if
(
id
==
1
)
listener
=
new
ActiveXObject
(
"EventListener.EvtListener"
);
objDocument
.
addEventListener
(
listener
);
}
function
XEventListener_Impl
()
{
this
.
_environment
=
"JScript"
;
this
.
_implementedInterfaces
=
new
Array
(
"com.sun.star.lang.XEventListener"
);
//XEventListener
this
.
disposing
=
XEventListener_disposing
;
}
function
XEventListener_disposing
(
source
)
{
alert
(
"JScript Event Listener
\n
The document was closed"
);
}
</script>
<script
language=
"VBScript"
>
SUB
MainVB
(
id
)
Set
objServiceManager
=
CreateObject
(
"com.sun.star.ServiceManager"
)
Set
objCoreReflection
=
objServiceManager
.
createInstance
(
"com.sun.star.reflection.CoreReflection"
)
Set
objDesktop
=
objServiceManager
.
createInstance
(
"com.sun.star.frame.Desktop"
)
'Open a new empty writer document
Dim args()
Set objDocument= objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, args)
Dim eventListener
select case id
case 0
Set eventListener= CreateObject("EventListener.EvtListener")
case 1
Set eventListener= CreateObject("VBasicEventListener.VBEventListener")
end select
objDocument.addEventListener eventlistener
END SUB
</script>
<p>
The script on this page creates a new StarOffice document and connects an event listener
to it. When the document is closed then the XEventListener::disposing method is called on the
listener object. How the listener is set up depends on the button being clicked.
</p>
<p>
The button will run JScript code that and adds an JScript event listener to the document.
The listener is also implemented in JScript an is on this page..
</p>
<button
onclick=
'Main(0)'
>
JScript go
</Button>
<p>
The button runs JScript code that creates the ActiveX component EventListener.EvtListener that
is written in C++ and housed in a dll. Then the event listener is added to the document.
</p>
<button
onclick=
'Main( 1)'
>
JScript go
</Button>
<p>
The button runs VBScript code that creates the components EventListener.EvtListener and adds it
to the document.
</p>
<button
onclick=
'MainVB(0)'
>
VBScript
</Button>
<p>
Runs VBScript code that creates VBasicEventListener.VBEventListener ActiveX component which was
written with VB
</p>
<button
onclick=
'MainVB(1)'
>
VBScript
</Button>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment