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
07249785
Kaydet (Commit)
07249785
authored
13 years ago
tarafından
Laurent Godard
Kaydeden (comit)
Stephan Bergmann
13 years ago
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SDK examples : add Python section and ToolPanel python example
correct minor css rendering too
üst
1ed632b4
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
480 additions
and
8 deletions
+480
-8
sdk_styles.css
odk/docs/sdk_styles.css
+10
-6
examples.html
odk/examples/examples.html
+61
-2
CalcWindowState.xcu
odk/examples/python/toolpanel/CalcWindowState.xcu
+48
-0
Factory.xcu
odk/examples/python/toolpanel/Factory.xcu
+53
-0
manifest.xml
odk/examples/python/toolpanel/META-INF/manifest.xml
+42
-0
description.xml
odk/examples/python/toolpanel/description.xml
+32
-0
Module1.xba
odk/examples/python/toolpanel/toolPanelPocBasic/Module1.xba
+30
-0
dialog.xlb
odk/examples/python/toolpanel/toolPanelPocBasic/dialog.xlb
+4
-0
script.xlb
odk/examples/python/toolpanel/toolPanelPocBasic/script.xlb
+6
-0
toolpanel.component
odk/examples/python/toolpanel/toolpanel.component
+35
-0
toolpanel.py
odk/examples/python/toolpanel/toolpanel.py
+148
-0
poc.xdl
odk/examples/python/toolpanel/toolpanels/poc.xdl
+11
-0
No files found.
odk/docs/sdk_styles.css
Dosyayı görüntüle @
07249785
...
...
@@ -876,7 +876,8 @@ hr {
border-color
:
#CCCCCC
;
border-spacing
:
0
;
border-collapse
:
collapse
;
padding
:
4
;
}
padding
:
4
;
color
:
#000000
;
}
.cell20
{
width
:
20%
;
border-width
:
2px
;
...
...
@@ -884,7 +885,8 @@ hr {
border-color
:
#CCCCCC
;
border-spacing
:
0
;
border-collapse
:
collapse
;
padding
:
4
;
}
padding
:
4
;
color
:
#000000
;
}
.cell80
{
width
:
80%
;
border-width
:
2px
;
...
...
@@ -892,7 +894,8 @@ hr {
border-color
:
#CCCCCC
;
border-spacing
:
0
;
border-collapse
:
collapse
;
padding
:
4
;
}
padding
:
4
;
color
:
#000000
;
}
.cell85
{
width
:
85%
;
border-width
:
2px
;
...
...
@@ -900,7 +903,8 @@ hr {
border-color
:
#CCCCCC
;
border-spacing
:
0
;
border-collapse
:
collapse
;
padding
:
4
;
}
padding
:
4
;
color
:
#000000
;}
.nothing1
{
width
:
20
;
height
:
1
;
}
...
...
@@ -941,8 +945,8 @@ hr {
font-weight
:
bold
;
}
.thead
{
font-weight
:
bold
;
background-
image
:
url(../docs/images/bg_table.png)
;
backgor
und-position
:
middle
;
}
background-
color
:
#18a303
;
backgro
und-position
:
middle
;
}
.navigate
{
border
:
0
;
}
...
...
This diff is collapsed.
Click to expand it.
odk/examples/examples.html
Dosyayı görüntüle @
07249785
<html>
<head>
<title>
OpenOffice.org
%PRODUCT_RELEASE% SDK - Examples
</title>
<title>
LibreOffice
%PRODUCT_RELEASE% SDK - Examples
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"../docs/sdk_styles.css"
>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=iso-8859-1"
>
<meta
name=
"author"
content=
"Jürgen Schmidt"
>
...
...
@@ -10,7 +10,7 @@
<body
class=
"sdkbody"
><a
name=
"examples"
/>
<table
class=
"table1"
cellpadding=
0
>
<tr
style=
"background-image:url(../docs/images/sdk_head-2.png); backgorund-position: bottom; "
>
<td
class=
"background"
colspan=
"3"
align=
"left"
><img
src=
"../docs/images/sdk_head-1.png"
width=
"800"
height=
"120"
usemap=
"#Map"
border=
"0"
></td>
<td
class=
"background"
colspan=
"3"
align=
"left"
><img
src=
"../docs/images/sdk_head-1.png"
height=
"120"
usemap=
"#Map"
border=
"0"
></td>
</tr>
<tr>
<td
colspan=
"3"
><img
class=
"nothing10"
src=
"../docs/images/nada.gif"
></td>
...
...
@@ -75,6 +75,11 @@
<td
class=
"content75"
>
Set of simple and more complex examples which
shows the use of the API from Java.
</td>
</tr>
<tr
valign=
"top"
>
<td
class=
"content3"
><img
src=
"../docs/images/arrow-1.gif"
></td>
<td><a
href=
"#python_examples"
title=
"link to the Python examples section"
>
Python examples
</a></td>
<td
class=
"content75"
>
Small set of examples which shows the use of the API from Python.
</td>
</tr>
<tr
valign=
"top"
>
<td
class=
"content3"
><img
src=
"../docs/images/arrow-1.gif"
></td>
<td><a
href=
"#Cpp_examples"
title=
"link to the C++ examples section"
>
C++ examples
</a></td>
...
...
@@ -364,6 +369,60 @@
<tr>
<td
colspan=
"3"
><img
class=
"line"
src=
"../docs/images/sdk_line-1.gif"
></td>
</tr>
<tr>
<td
class=
"content1"
><img
class=
"nothing8"
src=
"../docs/images/nada.gif"
></td>
<td>
<table
class=
"table2"
>
<tr>
<td>
<table
class=
"table3"
>
<tr>
<td
colspan=
"2"
class=
"head1"
><a
name=
"python_examples"
>
Python examples
</td>
<td
align=
"right"
>
<a
href=
"#examples"
title=
"link to the examples overview"
><img
class=
"navigate"
src=
"../docs/images/nav_up.png"
></a>
<a
href=
"../index.html"
title=
"link to the SDK start page"
><img
class=
"navigate"
src=
"../docs/images/nav_home.png"
></a>
</td>
</tr>
<tr>
<td
colspan=
"3"
></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table
class=
"table4"
>
<tbody>
<tr
class=
"thead"
>
<td
class=
"cell20"
>
Example
</td>
<td
class=
"cell80"
>
Description
</td>
</tr>
<tr>
<td
class=
"cell20"
><a
href=
"python/toolpanel/"
title=
"link to the source directory of the ToolPanel python axample"
>
ToolPanelPoc
</a></td>
<td
class=
"cell80"
>
This extension illustrates how to create a ToolPanel in Calc.
</td>
</tr>
<tbody>
</table>
</td>
</tr>
<tr>
<td>
<table
class=
"table3"
>
<tr>
<td
colspan=
"3"
>
<p>
No Additional information
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td
class=
"content1"
><img
class=
"nothing8"
src=
"../docs/images/nada.gif"
></td>
</tr>
<tr>
<td
colspan=
"3"
><img
class=
"line"
src=
"../docs/images/sdk_line-1.gif"
></td>
</tr>
<tr>
<td
class=
"content1"
><img
class=
"nothing8"
src=
"../docs/images/nada.gif"
></td>
<td>
...
...
This diff is collapsed.
Click to expand it.
odk/examples/python/toolpanel/CalcWindowState.xcu
0 → 100644
Dosyayı görüntüle @
07249785
<?xml version='1.0' encoding='UTF-8'?>
<!--# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Laurent Godard <lgodard.libre@laposte.net>
# Portions created by the Initial Developer are Copyright (C) 2011 the
# Initial Developer. All Rights Reserved.
#
# Major Contributor(s):
#
# For minor contributions see the git repository.
#
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.-->
<oor:component-data
oor:name=
"CalcWindowState"
oor:package=
"org.openoffice.Office.UI"
xmlns:install=
"http://openoffice.org/2004/installation"
xmlns:oor=
"http://openoffice.org/2001/registry"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<node
oor:name=
"UIElements"
>
<node
oor:name=
"States"
>
<node
oor:name=
"private:resource/toolpanel/myToolPanelPoc"
oor:op=
"replace"
>
<prop
oor:name=
"UIName"
oor:type=
"xs:string"
>
<value>
ToolPanel Proof of Concept
</value>
</prop>
<prop
oor:name=
"Visible"
oor:type=
"xs:boolean"
>
<value>
true
</value>
</prop>
</node>
</node>
</node>
</oor:component-data>
This diff is collapsed.
Click to expand it.
odk/examples/python/toolpanel/Factory.xcu
0 → 100644
Dosyayı görüntüle @
07249785
<?xml version='1.0' encoding='UTF-8'?>
<!--# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Laurent Godard <lgodard.libre@laposte.net>
# Portions created by the Initial Developer are Copyright (C) 2011 the
# Initial Developer. All Rights Reserved.
#
# Major Contributor(s):
#
# For minor contributions see the git repository.
#
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.-->
<oor:component-data
oor:name=
"Factories"
oor:package=
"org.openoffice.Office.UI"
xmlns:oor=
"http://openoffice.org/2001/registry"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<node
oor:name=
"Registered"
>
<node
oor:name=
"UIElementFactories"
>
<node
oor:name=
"org.libreoffice.example.sdk.CustomToolPanel"
oor:op=
"replace"
>
<prop
oor:name=
"Type"
>
<value>
toolpanel
</value>
</prop>
<prop
oor:name=
"Name"
>
<value>
myToolPanelPoc
</value>
</prop>
<prop
oor:name=
"Module"
>
<value/>
</prop>
<prop
oor:name=
"FactoryImplementation"
>
<value>
org.libreoffice.example.toolpanel.pocFactory
</value>
</prop>
</node>
</node>
</node>
</oor:component-data>
This diff is collapsed.
Click to expand it.
odk/examples/python/toolpanel/META-INF/manifest.xml
0 → 100644
Dosyayı görüntüle @
07249785
<?xml version="1.0" encoding="UTF-8"?>
<!--# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Laurent Godard <lgodard.libre@laposte.net>
# Portions created by the Initial Developer are Copyright (C) 2011 the
# Initial Developer. All Rights Reserved.
#
# Major Contributor(s):
#
# For minor contributions see the git repository.
#
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.-->
<manifest:manifest
xmlns:manifest=
"http://openoffice.org/2001/manifest"
>
<manifest:file-entry
manifest:media-type=
"application/vnd.sun.star.uno-components"
manifest:full-path=
"toolpanel.component"
/>
<manifest:file-entry
manifest:media-type=
"application/vnd.sun.star.configuration-data"
manifest:full-path=
"CalcWindowState.xcu"
/>
<manifest:file-entry
manifest:media-type=
"application/vnd.sun.star.configuration-data"
manifest:full-path=
"Factory.xcu"
/>
<manifest:file-entry
manifest:full-path=
"toolPanelPocBasic/"
manifest:media-type=
"application/vnd.sun.star.basic-library"
/>
</manifest:manifest>
This diff is collapsed.
Click to expand it.
odk/examples/python/toolpanel/description.xml
0 → 100755
Dosyayı görüntüle @
07249785
<?xml version="1.0" encoding="UTF-8"?>
<!--# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Laurent Godard <lgodard.libre@laposte.net>
# Portions created by the Initial Developer are Copyright (C) 2011 the
# Initial Developer. All Rights Reserved.
#
# Major Contributor(s):
#
# For minor contributions see the git repository.
#
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.-->
<description
xmlns=
"http://openoffice.org/extensions/description/2006"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<version
value=
"0.1.0"
/>
<identifier
value=
"org.libreoffice.example.toolpanel"
/>
</description>
This diff is collapsed.
Click to expand it.
odk/examples/python/toolpanel/toolPanelPocBasic/Module1.xba
0 → 100644
Dosyayı görüntüle @
07249785
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module
xmlns:script=
"http://openoffice.org/2000/script"
script:name=
"Module1"
script:language=
"StarBasic"
>
global theDialog
Sub dialogOnLoad(event)
theDialog = event.source
End Sub
sub buttonClick(event)
theButton = theDialog.getControl(
"
CommandButton1
"
)
theTextField = theDialog.getControl(
"
TextInfo
"
)
colors = Array(rgb(255,0,0),rgb(0,255,0),rgb(0,0,255))
rank = getSystemTicks() mod 3
theDialog.Model.BackgroundColor = colors(rank)
theTextField.text = cstr(Now) + chr(10)+
"
Color
"
+ cstr(rank) +
"
randomly applied
"
theButton.label =
"
Click Me to change color
"
end sub
</script:module>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
odk/examples/python/toolpanel/toolPanelPocBasic/dialog.xlb
0 → 100644
Dosyayı görüntüle @
07249785
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library
xmlns:library=
"http://openoffice.org/2000/library"
library:name=
"toolPanelPocBasic"
library:readonly=
"false"
library:passwordprotected=
"false"
/>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
odk/examples/python/toolpanel/toolPanelPocBasic/script.xlb
0 → 100644
Dosyayı görüntüle @
07249785
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library
xmlns:library=
"http://openoffice.org/2000/library"
library:name=
"toolPanelPocBasic"
library:readonly=
"false"
library:passwordprotected=
"false"
>
<library:element
library:name=
"Module1"
/>
</library:library>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
odk/examples/python/toolpanel/toolpanel.component
0 → 100644
Dosyayı görüntüle @
07249785
<?xml version="1.0" encoding="UTF-8"?>
<!--# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Laurent Godard <lgodard.libre@laposte.net>
# Portions created by the Initial Developer are Copyright (C) 2011 the
# Initial Developer. All Rights Reserved.
#
# Major Contributor(s):
#
# For minor contributions see the git repository.
#
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.-->
<components
xmlns=
"http://openoffice.org/2010/uno-components"
>
<component
loader=
"com.sun.star.loader.Python"
uri=
"./toolpanel.py"
>
<implementation
name=
"org.libreoffice.example.toolpanel.pocFactory"
>
<service
name=
"org.libreoffice.example.toolpanel.pocFactory"
/>
</implementation>
</component>
</components>
This diff is collapsed.
Click to expand it.
odk/examples/python/toolpanel/toolpanel.py
0 → 100644
Dosyayı görüntüle @
07249785
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Initial Developer of the Original Code is
# Laurent Godard <lgodard.libre@laposte.net>
# Portions created by the Initial Developer are Copyright (C) 2011 the
# Initial Developer. All Rights Reserved.
#
# Major Contributor(s):
#
# For minor contributions see the git repository.
#
# inspired from core/testautomation/extensions/optional/input/extension_sources/TaskPaneComponent
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
import
uno
import
unohelper
from
com.sun.star.ui
import
XUIElementFactory
from
com.sun.star.ui
import
XUIElement
from
com.sun.star.ui.UIElementType
import
TOOLPANEL
as
unoTOOLPANEL
from
com.sun.star.ui
import
XToolPanel
implementation_name
=
"org.libreoffice.example.toolpanel.pocFactory"
# as defined in Factory.xcu
implementation_services
=
(
"org.libreoffice.example.toolpanel.pocFactory"
,)
xdlPath
=
"toolpanels/poc.xdl"
# the path inside the oxt
extensionID
=
"org.libreoffice.example.toolpanel"
# as defined in description.xml
########################################################################
########################################################################
class
pocToolPanel
(
unohelper
.
Base
,
XToolPanel
):
def
__init__
(
self
,
xPanelWindow
,
ctx
):
self
.
ctx
=
ctx
self
.
PanelWindow
=
xPanelWindow
self
.
Window
=
xPanelWindow
def
createAccessible
(
self
,
i_parentAccessible
):
return
self
.
PanelWindow
########################################################################
########################################################################
class
pyPanel
(
unohelper
.
Base
,
XUIElement
):
def
__init__
(
self
,
ctx
,
xFrame
,
xParentWindow
,
url
):
self
.
ctx
=
ctx
self
.
xParentWindow
=
xParentWindow
self
.
toolpanel
=
None
self
.
m_panelRootWindow
=
None
self
.
Frame
=
xFrame
self
.
ResourceURL
=
url
self
.
Type
=
unoTOOLPANEL
def
getRealInterface
(
self
):
if
not
self
.
toolpanel
:
rootWindow
=
self
.
getOrCreatePanelRootWindow
()
self
.
toolpanel
=
pocToolPanel
(
rootWindow
,
self
.
ctx
)
return
self
.
toolpanel
def
getOrCreatePanelRootWindow
(
self
):
pip
=
self
.
ctx
.
getValueByName
(
"/singletons/com.sun.star.deployment.PackageInformationProvider"
)
s
=
pip
.
getPackageLocation
(
extensionID
)
dialogUrl
=
s
+
"/"
+
xdlPath
provider
=
self
.
ctx
.
ServiceManager
.
createInstanceWithContext
(
"com.sun.star.awt.ContainerWindowProvider"
,
self
.
ctx
)
self
.
m_panelRootWindow
=
provider
.
createContainerWindow
(
dialogUrl
,
""
,
self
.
xParentWindow
,
None
)
return
self
.
m_panelRootWindow
def
postDisposing
(
self
):
super
.
postDisposing
()
if
self
.
m_panelRootWindow
:
self
.
m_panelRootWindow
.
dispose
()
self
.
m_panelRootWindow
=
None
self
.
toolpanel
=
None
return
#######################################################################
#######################################################################
class
pocFactory
(
unohelper
.
Base
,
XUIElementFactory
):
def
__init__
(
self
,
ctx
):
self
.
ctx
=
ctx
def
createUIElement
(
self
,
url
,
properties
):
xParentWindow
=
None
xFrame
=
None
xUIElement
=
None
for
arg
in
properties
:
if
arg
.
Name
==
"Frame"
:
xFrame
=
arg
.
Value
elif
arg
.
Name
==
"ParentWindow"
:
xParentWindow
=
arg
.
Value
if
xFrame
and
xParentWindow
:
try
:
xUIElement
=
pyPanel
(
self
.
ctx
,
xFrame
,
xParentWindow
,
url
)
except
Exception
as
e
:
print
(
e
)
return
xUIElement
########################################################################
########################################################################
# pythonloader looks for a static g_ImplementationHelper variable
g_ImplementationHelper
=
unohelper
.
ImplementationHelper
()
# add the FormatFactory class to the implementation container,
# which the loader uses to register/instantiate the component.
g_ImplementationHelper
.
addImplementation
(
pocFactory
,
implementation_name
,
implementation_services
,
)
This diff is collapsed.
Click to expand it.
odk/examples/python/toolpanel/toolpanels/poc.xdl
0 → 100755
Dosyayı görüntüle @
07249785
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window
xmlns:dlg=
"http://openoffice.org/2000/dialog"
xmlns:script=
"http://openoffice.org/2000/script"
dlg:id=
"MyDialog"
dlg:left=
"192"
dlg:top=
"127"
dlg:width=
"174"
dlg:height=
"147"
dlg:closeable=
"true"
dlg:moveable=
"true"
dlg:help-url=
"customcontrol1"
dlg:withtitlebar=
"false"
>
<script:event
script:event-name=
"on-focus"
script:macro-name=
"vnd.sun.star.script:toolPanelPocBasic.Module1.dialogOnLoad?language=Basic&location=application"
script:language=
"Script"
/>
<dlg:bulletinboard>
<dlg:button
dlg:id=
"CommandButton1"
dlg:tab-index=
"0"
dlg:left=
"6"
dlg:top=
"8"
dlg:width=
"80"
dlg:height=
"30"
dlg:value=
"The button label"
>
<script:event
script:event-name=
"on-performaction"
script:macro-name=
"vnd.sun.star.script:toolPanelPocBasic.Module1.buttonClick?language=Basic&location=application"
script:language=
"Script"
/>
</dlg:button>
<dlg:textfield
dlg:id=
"TextInfo"
dlg:textarea-vertical-align=
"top"
dlg:tab-index=
"1"
dlg:left=
"6"
dlg:top=
"48"
dlg:width=
"80"
dlg:height=
"59"
dlg:value=
"a sample text"
dlg:multiline=
"true"
/>
</dlg:bulletinboard>
</dlg:window>
This diff is collapsed.
Click to expand it.
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