/usr/lib/libreoffice/share/extensions/canzeley-client/Kanzleiprogramm/DiaMod2.xba is in libreoffice-canzeley-client 0.5.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | <?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="DiaMod2" script:language="StarBasic">REM ***** BASIC *****
REM ***** Canzeley *****
REM Copyright (C) 2010, 2011, 2012 Dr. Michael Stehmann
REM info@rechtsanwalt-stehmann.de
REM This program is free software: you can redistribute it and/or modify it
REM under the terms of the GNU General Public License as published by the
REM Free Software Foundation, either version 3 of the License, or any later version.
REM This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
REM without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
REM See the GNU General Public License for more details.
REM You should have received a copy of the GNU General Public License along with this program.
REM If not, see <http://www.gnu.org/licenses/>.
REM *** Version 0.5.0 ***
REM **** Kanzleiprogramm - DiaMod2****
REM **** Dieses Modul enthaelt Makros zur Generation von Laufzeitdialogen ****
Option explicit
Private oMod As Object REM * Objekt enthaelt die Eigenschaften von Steuerelementen *
Private oDlgM As Object REM * Objekt enthaelt das Modell eines Dialoges *
REM **** Die folgenden Makros enthalten ein Beispiel, mit welchem ****
REM **** ein Dialog zur Abfrage des Geschlechts erzeugt werden kann ****
Sub DialogGendern
Dim iOk As Integer
CDialogErzeugen ("Gendern", "Gendern-Dialog")
CDialogGeo (100, 100, 300, 100)
CDiaStandardHintergrundfarbe
SEMaennlich REM * Optionsfeld "männlich"
SEWeiblich REM * Optionsfeld "weiblich"
SEOk REM * OK-Schaltfläche
SEAbbrechen REM * Abbrechen-Schaltfläche
CDialogAnzeigen1
CDialogAnzeigen2
iOk = CDiaRueckgabe
If iOk = 1 Then
GendernAusgabe
Else
MsgBox ("Na gut, wenn sie nicht wollen ... ", 48, "Abbruch")
End If
End Sub
Sub SEMaennlich
CSteuerelement ("Optionsfeld")
CControlLabel ("männlich", 10, 200)
CControlGeo (15, 50, 5, 10)
CControlAlign (0, 2)
CCStandardBGColor
CSteuerelementEinfuegen ("ME", "Männlich - Einzahl")
End Sub
Sub SEWeiblich
CSteuerelement ("Optionsfeld")
CControlLabel ("weiblich", 10, 200)
CControlGeo (15, 50, 5, 25)
CControlAlign (0, 2)
CCStandardBGColor
CSteuerelementEinfuegen ("WE", "Weiblich - Einzahl")
End Sub
Sub SEOk
CSteuerelement ("OK")
CControlLabel ("Einfügen", 10, 100)
CControlGeo (15, 40, 5, 60)
CControlAlign (1, 2)
CControlTabStop (1)
CSteuerelementEinfuegen ("OKButton", "Bitte Anklicken")
End Sub
Sub SEAbbrechen
CSteuerelement ("Cancel")
CControlLabel ("Abbrechen", 10, 100)
CControlGeo (15, 40, 50, 60)
CControlAlign (1, 2)
CControlTabStop (2)
CSteuerelementEinfuegen ("AbbruchButton", "Bitte Anklicken")
End Sub
Sub GendernAusgabe
Dim sGender As String
sGender = GendernErgebnis
If sGender ="" Then
MsgBox ("Sie haben keine Auswahl getroffen!", 48, "Nochmal versuchen!")
DialogGendern
Else
MsgBox ("Ihre Auswahl betraf eine " & sGender & " Person", 64, "Ergebnis:")
End If
End Sub
Function GendernErgebnis
If oDlgEF.GetControl("WE").state Then
GendernErgebnis = "weibliche"
ElseIF oDlgEF.GetControl("ME").state Then
GendernErgebnis = "männliche"
End IF
End Function
REM **** Ab hier enthaelt dieses Modul Makros zur Generation von Laufzeitdialogen ****
Sub CDialogErzeugen (sDiaTitle As String, sDiaName As String)
oDlgM = CreateUnoService ("com.sun.star.awt.UnoControlDialogModel")
oDlgM.setPropertyValue("Name", sDiaName)
oDlgM.setPropertyValue("Title", sDiaTitle)
End Sub
Sub CDialogGeo(iDiaHoehe As Integer, iDiaWeite As Integer, iDiaPosX As Integer, iDiaPosY As Integer)
oDlgM.setPropertyValue("Height", iDiaHoehe)
oDlgM.setPropertyValue("Width", iDiaWeite)
oDlgM.setPropertyValue("PositionX", iDiaPosX)
oDlgM.setPropertyValue("PositionY", iDiaPosY)
End Sub
Sub CDiaStandardHintergrundfarbe
CDiaHintergrund (165,186,214)
End Sub
Sub CDiaHintergrund (iDRot As Integer, iDGruen As Integer, iDBlau As Integer)
oDlgM.setPropertyValue("BackgroundColor", RGB (iDRot, iDGruen, iDBlau))
End Sub
Sub CDialogSeite (iStep As Integer)
oDlgM.setPropertyValue("Step", iStep)
End Sub
Sub CSteuerelement (sArt As String)
Select Case sArt
Case "Schaltflaeche"
oMod = oDlgM.CreateInstance ("com.sun.star.awt.UnoControlButtonModel")
Case "OK"
oMod = oDlgM.CreateInstance ("com.sun.star.awt.UnoControlButtonModel")
oMod.setPropertyValue("PushButtonType", com.sun.star.awt.PushButtonType.OK)
Case "Cancel"
oMod = oDlgM.CreateInstance ("com.sun.star.awt.UnoControlButtonModel")
oMod.setPropertyValue("PushButtonType", com.sun.star.awt.PushButtonType.CANCEL)
Case "Beschriftungsfeld"
oMod = oDlgM.CreateInstance ("com.sun.star.awt.UnoControlFixedTextModel")
Case "Textfeld"
oMod = oDlgM.CreateInstance ("com.sun.star.awt.UnoControlEditModel")
oMod.setPropertyValue("HScroll", True)
Case "Listenfeld"
oMod = oDlgM.CreateInstance ("com.sun.star.awt.UnoControlListBoxModel")
Case "Zahlenfeld"
oMod = oDlgM.CreateInstance ("com.sun.star.awt.UnoControlNumericFieldModel")
Case "Waehrungsfeld"
oMod = oDlgM.CreateInstance ("com.sun.star.awt.UnoControlCurrencyFieldModel")
oMod.setPropertyValue("DecimalAccuracy", 2)
oMod.setPropertyValue("ShowThousandsSeparator", True)
oMod.setpropertyValue("CurrencySymbol", "€")
Case "Datumsfeld"
oMod = oDlgM.CreateInstance ("com.sun.star.awt.UnoControlDateFieldModel")
oMod.setPropertyValue("DateFormat", 7)
oMod.setPropertyValue("StrictFormat", True)
oMod.setPropertyValue("Dropdown", True)
Case "Optionsfeld"
oMod = oDlgM.CreateInstance ("com.sun.star.awt.UnoControlRadioButtonModel")
End Select
End Sub
Sub CControlLabel (sCLabel As String, iFontHeight As Integer, iFontWeight As Integer)
Dim oFont As New com.sun.star.awt.FontDescriptor
REM * FontDescriptor mit Werten fuellen *
oFont.Name = "Liberation Sans"
oFont.Height = iFontHeight
oFont.Weight = iFontWeight
oMod.setPropertyValue("Label", sCLabel)
oMod.setPropertyValue("FontDescriptor", oFont)
End Sub
Sub CControlText (sCText As String, iFontHeight As Integer, iFontWeight As Integer)
Dim oFont As New com.sun.star.awt.FontDescriptor
REM * FontDescriptor mit Werten fuellen *
oFont.Name = "Liberation Sans"
oFont.Height = iFontHeight
oFont.Weight = iFontWeight
oMod.setPropertyValue("Text", sCText)
oMod.setPropertyValue("FontDescriptor", oFont)
End Sub
Sub CControldatum (lCDatum As Long)
If bDateStruct = false Then
oMod.setPropertyValue("Date", lCDatum)
Else
Dim sCDatum As String
sCDatum = CDateFromIso(lCDatum)
oMod.setPropertyValue("Date", LibOMod.LibOStruct(sCDatum))
End If
End Sub
Sub CControlGeo (iControlHoehe As Integer, iControlWeite As Integer, iControlPosX As Integer, iControlPosY As Integer)
oMod.setPropertyValue("Height", iControlHoehe)
oMod.setPropertyValue("Width", iControlWeite)
oMod.setPropertyValue("PositionX", iControlPosX)
oMod.setPropertyValue("PositionY", iControlPosY)
End Sub
Sub CControlAlign (iAlign As Integer, iVAlign As Integer)
oMod.setPropertyValue("Align", iAlign) REM 0 = left, 1 = center, 2 = right
REM * Funktioniert erst ab OpenOffice.org Version 3.3 *
Select Case iVAlign
Case 0
REM * Macht Nichts *
Case 1
oMod.setPropertyValue("VerticalAlign", com.sun.star.style.VerticalAlignment.TOP)
Case 2
oMod.setPropertyValue("VerticalAlign", com.sun.star.style.VerticalAlignment.MIDDLE)
Case 3
oMod.setPropertyValue("VerticalAlign", com.sun.star.style.VerticalAlignment.BOTTOM)
Case Else
oMod.setPropertyValue("VerticalAlign", com.sun.star.style.VerticalAlignment.TOP)
End Select
End Sub
Sub CControlTabStop (iTab As Integer)
If iTab = 0 Then
oMod.setPropertyValue("Tabstop", False)
Else
oMod.setPropertyValue("Tabstop", True)
oMod.setPropertyValue("TabIndex", iTab)
End If
End Sub
Sub CCStandardBGColor
CControlBGColor(255,255,204)
End Sub
Sub CControlBGColor (iCRot As Integer, iCGruen As Integer, iCBlau As Integer)
oMod.setPropertyValue("BackgroundColor", RGB (iCRot, iCGruen, iCBlau))
End Sub
Sub CControlTextColor (iCRot As Integer, iCGruen As Integer, iCBlau As Integer)
oMod.setPropertyValue("TextColor", RGB (iCRot, iCGruen, iCBlau))
End Sub
Sub CControlStep(iStepC As Integer)
oMod.setPropertyValue("Step", iStepC)
End Sub
Sub CControlRO
oMod.setPropertyValue("ReadOnly", True)
End Sub
Sub CSteuerelementEinfuegen (sCName As String, sHilfe As String)
REM * Name und Hilfetext *
oMod.setPropertyValue("Name", sCName)
oMod.setPropertyValue("HelpText", sHilfe)
REM * Steuerelement einfuegen *
oDlgM.insertByName(sCName, oMod)
End Sub
REM ** Anzeige des Dialoges **
Sub CDialogAnzeigen1
oDlgEF = CreateUnoService("com.sun.star.awt.UnoControlDialog")
oDlgEF.setmodel(oDlgM)
End Sub
Sub CDialogAnzeigen2
Dim oWin As Object
oWin = CreateUnoService("com.sun.star.awt.toolkit")
oDlgEF.Createpeer(oWin, null)
End Sub
Function CDiaRueckgabe
CDiaRueckgabe = oDlgEF.execute()
End Function
</script:module>
|