/usr/lib/libreoffice/share/extensions/DmathsAddon/DmInstall/Options.xba is in libreoffice-dmaths 3.4+dfsg1-1.
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 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | <?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="Options" script:language="StarBasic">'************************************************
'Copyright (C) 2006-2010 Didier Dorange-Pattoret
'38, chemin de l'Abbaye
'74940 Annecy le Vieux
'France
'ddorange@dmaths.com
'
'
'This library is free software; you can redistribute it and/or
'modify it under the terms of the GNU General Public Licence (GPL)
'as published by the Free Software Foundation; either
'version 2.1 of the License, or (at your option) any later version.
'This library is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
'General Public License for more details.
'You should have received a copy of the GNU General Public Licence (GPL)
'along with this library; if not, write to the Free Software
'Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'************************************************
Public oLanguesSelect as Object
Public oDmOptions as Object
Private oAddonBarre, oAddon, oConfigAccess, oConfigAccessToolBarre,oDmBarre as Object
Public oCopyDmaths as Object
Public sNomFichierInstall as String
Public bIconesChangees, bAfficherMasquerIcones as Boolean
Public sSource as String
Sub ChoixOptionsDmaths
BasicLibraries.loadLibrary("Dmaths")
Call VerifOperationnel
bIconesChangees = False
bAfficherMasquerIcones = False
If bFigure=True Then oFigure.Visible=False
If bGrille=True or bDiagBox=True or bRepreGra=True Then oPoints.Visible=False
oDmOptions = Dmaths.Module5.LoadDialog("DmInstall","DmOptions")
' If GetguiType <> 4 or Not FileExists("/Users") Then
DmInstall.Install_Addon.LoadAppsPref(oDmOptions,False,True,sThemeIcons) rem bPremInstall=False bRegleOptions = True
' Endif
If bPremInstall Then Call ReinitialiseOptions
exitOK = com.sun.star.ui.dialogs.ExecutableDialogResults.OK
exitCANCEL = com.sun.star.ui.dialogs.ExecutableDialogResults.CANCEL
If oDmOptions.Execute = exitOK Then ValidOptionsDmaths
' elseif oDmOptions.Execute = exitCANCEL Then
' AfficherMasquerIcones
' Endif
End Sub
Sub ReinitialiseOptions
oDmOptions.Model.CheckBox1.State=1
oDmOptions.Model.CheckBox2.State=1
oDmOptions.Model.CheckBox3.State=1
oDmOptions.Model.CheckBox4.State=1
oDmOptions.Model.CheckBox5.State=1
oDmOptions.Model.CheckBox16.State=1
oDmOptions.Model.CheckBox6.State=1
oDmOptions.Model.CheckBox7.State=1
oDmOptions.Model.CheckBox7.State=1
oDmOptions.Model.CheckBox8.State=0
oDmOptions.Model.CheckBox9.State=0
oDmOptions.Model.CheckBox10.State=0
oDmOptions.Model.CheckBox11.State=0
oDmOptions.Model.CheckBox12.State=1
oDmOptions.GetControl("TextField1").Enable = False
oDmOptions.Model.CheckBox13.State=0
oDmOptions.Model.CheckBox14.State=0
oDmOptions.Model.CheckBox15.State=1
oDmOptions.Model.CheckBox17.State=0
oDmOptions.Model.CheckBox18.State=0
oDmOptions.Model.CheckBox19.State=1
If OOoNumVersion < 300 Then rem modifie le 15-11-08
oDmOptions.Model.CheckBox20.State = 1
Else
oDmOptions.Model.CheckBox20.State = 0
Endif
oDmOptions.Model.CheckBox21.State=1
oDmOptions.Model.CheckBox22.State=1
If iLang = 0 Then
oDmOptions.Model.CheckBox23.State=0
Else
oDmOptions.Model.CheckBox23.State=1
Endif
oDmOptions.Model.OptionButton1.State=1
oDmOptions.Model.TextField6.Text="0"
oDmOptions.Model.TextField4.Text="0"
oDmOptions.Model.TextField2.Text="40"
oDmOptions.Model.TextField3.Text="0"
oDmOptions.Model.TextField1.Text="12"
If (GetguiType = 4 and FileExists("/Users")) Then
oDmOptions.Model.TextField5.Text = "Apple Chancery"
Else
oDmOptions.Model.TextField5.Text = "Atalante"
Endif
oDmOptions.GetControl("TextField7").Enable = True
oDmOptions.Model.TextField7.Text = "abcdexyzt"
End Sub
Sub ReinitialiseCheminsApps
rem recherche des logiciels installes
BasicLibraries.loadLibrary("DmInstall")
sThemeIconesChoisi = DmInstall.Install_Addon.DeterminesThemeIcons(oDmOptions)
bIconesChangees = True
DmInstall.Install_Addon.LoadAppsPref(oDmOptions,True,True,sThemeIconesChoisi)
End Sub
Sub FinChoixOptionsDmaths
oDmOptions.EndExecute()
If bFigure=True Then oFigure.Visible=True
If bGrille=True or bDiagBox=True or bRepreGra=True Then oPoints.Visible=True
End Sub
Sub ValidOptionsDmaths
' Print "change les options"
Dim sMatricesRondes as String
Dim sWidevec,sWidehat,sOverline,sItalic,sTailleFormules,sMarqHorPoints,sMarqVerPoints,sFormulesGras,sMessage as String
Dim sLettresAreScalaires, sLettresScalaires as String
Dim sPoliceFormCarac, sMargesFormules, sConcateneFormules, sThemeIconesChoisi as String
Dim sIdroit, sEdroit, sFractions, sModeFactoriel, sbXpointaulieux, sDelaiEntreSauvegardes as String
Dim sTextMode, sBorneInfIntegrales, sBorneSupIntegrales,sFormulesEspacees, sTailleFormCarac, sNomPoliceCursive as String
Dim sFormulesEncadrees, sGrandesParentheses, sUsingDispatcher as String
Dim sCheminSoftware1,sCheminSoftware2,sCheminSoftware3 as String
Dim iLangChoisie as Integer
If oDmOptions.Model.CheckBox1.State=1 Then sItalic = "TRUE" Else sItalic = "FALSE"
If oDmOptions.Model.CheckBox2.State=1 Then sWidevec = "TRUE" Else sWidevec = "FALSE"
If oDmOptions.Model.CheckBox3.State=1 Then sWidehat = "TRUE" Else sWidehat = "FALSE"
If oDmOptions.Model.CheckBox4.State=1 Then sOverline = "TRUE" Else sOverline = "FALSE"
If oDmOptions.Model.CheckBox5.State=1 Then sEdroit = "TRUE" Else sEdroit = "FALSE"
If oDmOptions.Model.CheckBox16.State=1 Then sIdroit = "TRUE" Else sIdroit = "FALSE"
If oDmOptions.Model.CheckBox6.State=1 Then sChiffresDroits = "TRUE" Else sChiffresDroits = "FALSE"
If oDmOptions.Model.CheckBox7.State=1 Then sBorneInfIntegrales = "from" Else sBorneInfIntegrales = "_"
If oDmOptions.Model.CheckBox7.State=1 Then sBorneSupIntegrales = "to" Else sBorneSupIntegrales = "^"
If oDmOptions.Model.CheckBox8.State=1 Then sTextMode = "TRUE" Else sTextMode = "FALSE"
If oDmOptions.Model.CheckBox9.State=1 Then sCoordColonne = "TRUE" Else sCoordColonne = "FALSE"
If oDmOptions.Model.CheckBox10.State=1 Then sFormulesGras = "TRUE" Else sFormulesGras = "FALSE"
If oDmOptions.Model.CheckBox11.State=1 Then sSystemesAlignes = "TRUE" Else sSystemesAlignes = "FALSE"
If oDmOptions.Model.CheckBox12.State=1 Then sTailleFormCarac = "TRUE" Else sTailleFormCarac = "FALSE"
If oDmOptions.Model.CheckBox13.State=1 Then sFormulesEspacees = "TRUE" Else sFormulesEspacees = "FALSE"
If oDmOptions.Model.CheckBox14.State=1 Then sFormulesEncadrees = "TRUE" Else sFormulesEncadrees = "FALSE"
If oDmOptions.Model.CheckBox15.State=1 Then sGrandesParentheses = "TRUE" Else sGrandesParentheses = "FALSE"
If oDmOptions.Model.CheckBox17.State=1 Then sFractions = "TRUE" Else sFractions = "FALSE"
If oDmOptions.Model.CheckBox18.State=1 Then sModeFactoriel = "TRUE" Else sModeFactoriel = "FALSE"
If oDmOptions.Model.CheckBox19.State=1 Then sPoliceFormCarac = "TRUE" Else sPoliceFormCarac = "FALSE"
If oDmOptions.Model.CheckBox20.State=1 Then sUsingDispatcher = "TRUE" Else sUsingDispatcher = "FALSE"
If oDmOptions.Model.CheckBox21.State=1 Then sConcateneFormules = "TRUE" Else sConcateneFormules = "FALSE"
If oDmOptions.Model.CheckBox22.State=1 Then sLettresAreScalaires = "TRUE" Else sLettresAreScalaires = "FALSE"
If oDmOptions.Model.CheckBox23.State=1 Then sbXpointaulieux = "TRUE" Else sbXpointaulieux = "FALSE"
If oDmOptions.Model.MatriceButton1.State=1 Then sMatricesRondes = "TRUE" Else sMatricesRondes = "FALSE"
sThemeIconesChoisi = DmInstall.Install_Addon.DeterminesThemeIcons(oDmOptions)
rem choix du theme des icones si modification demandée
If sThemeIconesChoisi <> sThemeIcons Then bIconesChangees = True
'-------------------------------------------------------------------------------------
sTailleFormules=oDmOptions.Model.TextField1.Text
sMarqHorPoints=oDmOptions.Model.TextField2.Text
sMarqVerPoints=oDmOptions.Model.TextField3.Text
sDelaiEntreSauvegardes = oDmOptions.Model.TextField4.Text
sNomPoliceCursive = oDmOptions.Model.TextField5.Text
sMargesFormules = oDmOptions.Model.TextField6.Text
sLettresScalaires = oDmOptions.Model.TextField7.Text
sCheminSoftware1 = oDmOptions.Model.FileControl2.Text
sCheminSoftware2 = oDmOptions.Model.FileControl3.Text
sCheminSoftware3 = oDmOptions.Model.FileControl4.Text
If GetguiType = 4 Then
sCheminSoftware1 = RegleAppsSousLinux(sCheminSoftware1)
sCheminSoftware2 = RegleAppsSousLinux(sCheminSoftware2)
sCheminSoftware3 = RegleAppsSousLinux(sCheminSoftware3)
Endif
rem valeur langue choisie
iLangChoisie = oDmOptions.GetControl("ListBox1").SelectedItemPos
sSource="Rem (C) Didier Dorange-Pattoret www.dmaths.org"+Chr(13)
sSource=sSource+"Global const iLang = "+iLangChoisie+Chr(13)
sSource=sSource+"Public const iNumVersionDmathsCourante = "+ iNumVersionDmaths + "" + Chr(13)
sSource=sSource+"Public const sChemindmaths = """ + DetermineRepertoireDmaths + """"+ Chr(13)
sSource=sSource+"Public const sChemindmathsODS = """ + fCheminduFichierDmathsODS + """" + Chr(13) rem sChemindmathsODS est le fichier dmaths.ods
sSource=sSource+"Public const bItalic = "+sItalic+Chr(13)
sSource=sSource+"Public const bEdroit = "+sEdroit+Chr(13)
sSource=sSource+"Public const bIdroit = "+sIdroit+Chr(13)
sSource=sSource+"Public const bChiffresDroits = "+sChiffresDroits+Chr(13)
sSource=sSource+"Public const bVecteursItalic = "+sWidevec+Chr(13)
sSource=sSource+"Public const bAnglesItalic = "+sWidehat+Chr(13)
sSource=sSource+"Public const bMesuresAlgItalic = "+sOverline+Chr(13)
sSource=sSource+"Public const bLettresAreScalaires = "+sLettresAreScalaires+Chr(13)
sSource=sSource+"Public const sLettresScalaires = """+sLettresScalaires+""""+Chr(13)
sSource=sSource+"Public const bFormulesGras = "+sFormulesGras+Chr(13)
sSource=sSource+"Public const iTailleFormules = "+sTailleFormules+Chr(13)
sSource=sSource+"Public const bTailleFormCarac = "+sTailleFormCarac+Chr(13)
sSource=sSource+"Public const bPoliceFormCarac = "+sPoliceFormCarac+Chr(13)
sSource=sSource+"Public const iMargesFormules = "+sMargesFormules+Chr(13)
sSource=sSource+"Public const bConcateneFormules = "+sConcateneFormules+Chr(13)
sSource=sSource+"Public const iMarqHorPoints = "+sMarqHorPoints+Chr(13)
sSource=sSource+"Public const iMarqVerPoints = "+sMarqVerPoints+Chr(13)
sSource=sSource+"Public const sBorneInfIntegrales = """+sBorneInfIntegrales+""""+Chr(13)
sSource=sSource+"Public const sBorneSupIntegrales = """+sBorneSupIntegrales+""""+Chr(13)
sSource=sSource+"Public const bTextMode = "+sTextMode+Chr(13)
sSource=sSource+"Public const bCoordColonne = "+sCoordColonne+Chr(13)
sSource=sSource+"Public const bSystemesAlignes = "+sSystemesAlignes+Chr(13)
sSource=sSource+"Public const bMatricesRondes = "+sMatricesRondes+Chr(13)
sSource=sSource+"Public const bFormulesEspacees = "+sFormulesEspacees+Chr(13)
sSource=sSource+"Public const bFormulesEncadrees = "+sFormulesEncadrees+Chr(13)
sSource=sSource+"Public const bGrandesParentheses = "+sGrandesParentheses+Chr(13)
sSource=sSource+"Public const bModeFactoriel = "+sModeFactoriel+Chr(13)
sSource=sSource+"Public const bFractions = "+sFractions+Chr(13)
sSource=sSource+"Public const bXpointaulieux = "+sbXpointaulieux+Chr(13)
sSource=sSource+"Public const bUsingDispatcher = "+ sUsingDispatcher +Chr(13)
sSource=sSource+"Public const iDelaiEntreSauvegardes = "+sDelaiEntreSauvegardes+Chr(13)
sSource=sSource+"Public const sThemeIcons = """+sThemeIconesChoisi+""""+Chr(13)
sSource=sSource+"Public const sCheminSoftware1 = """+sCheminSoftware1+""""+Chr(13)
sSource=sSource+"Public const sCheminSoftware2 = """+sCheminSoftware2+""""+Chr(13)
sSource=sSource+"Public const sCheminSoftware3 = """+sCheminSoftware3+""""+Chr(13)
sSource=sSource+"Public const sNomPoliceCursive = """+sNomPoliceCursive+""""+Chr(13)
sSource=sSource+"Public const sOptionsTraceCourbe = """+sOptionsTraceCourbe+""""+Chr(13)
sSource=sSource+"Sub MyTest2" & Chr(13) & "Print ""Vive Dmaths !""" & Chr(13) & "End Sub"
If bFigure=True Then oFigure.Visible=True
If bGrille=True or bDiagBox=True or bRepreGra=True Then oPoints.Visible=True
'---------------------------------------------------------------------------------------------------------------------------
rem inscription de la taille des formules dans le fichier de configuration.
If iTailleFormules<>Cint(sTailleFormules) Then
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Math", True )
oTailleDesFormules = oConfigAccess.getByName( "StandardFormat" )
oTailleDesFormules.BaseSize = Cint(sTailleFormules)
oConfigAccess.commitChanges()
bModifieTailleFormule = TRUE
End if
rem installation du process mise à jour automatique
' oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Events/ApplicationEvents/Bindings", True )
' If oConfigAccess.hasByName("OnStartApp") Then oConfigAccess.removeByName("OnStartApp")
' If sMiseAJourManuel = "FALSE" Then
' oEvene = oConfigAccess.createInstance
' oEvene.BindingURL = "vnd.sun.star.script:DmInstall.MajAuto.TestNewVersionDemarrage?language=Basic&location=application"
' oConfigAccess.insertByName("OnStartApp",oEvene)
' End if
' oConfigAccess.CommitChanges
'----------------------------------------------------------------------------------------------------------------------------
rem validation des icones
'If (GetguiType = 1 or Not FileExists("/Users")) Then
DmInstall.Install_Addon.RegleIconesAppsPref(oDmOptions,sThemeIconesChoisi)
DmInstall.Install_Addon.ChoisirThemeIcone(sThemeIconesChoisi)
'Endif
'----------------------------------------------------------------------------------------------------------------------------
rem affiche masque les icones
If bAfficherMasquerIcones = True Then RegleAffichageIcones
rem on considère le dictionnaire comme déchargé
DictionnaireCharge = False
rem message de fin
Call ChargementDuVocabulaire
sMessage = Trad(iLangChoisie,3) & " "
If bIconesChangees = True Then
If IsMacOS Then
sMessage = sMessage & Chr(13) & Chr(13) & Trad(iLangChoisie,5) rem Quittez et relancer OOo/SO/NeO
Else
sMessage = sMessage & Chr(13) & Chr(13) & Trad(iLangChoisie,0) rem OOo va être redémarré.
Endif
Endif
If bMiseAJour = FALSE Then msgbox(sMessage,64,"Dmaths")
If (bIconesChangees = True and bMiseAJour = False) Then
If IsMacOS Then
' If OOoName = "NeoOffice" Then
ReLanceOOoMac
' Else
' EcritFichierDmOptionsTXT(sSource) rem ecrit le fichier dmoptions.txt
' InsertModuleDmOptions(sSource) rem ecrit le module DmOptions
' Endif
Else
ReLanceOOo
End if
Else rem si icones pas changées
EcritFichierDmOptionsTXT(sSource) rem ecrit le fichier dmoptions.txt
InsertModuleDmOptions(sSource) rem ecrit le module DmOptions
EndIf
End Sub
Sub CreeIconesOptionsSoft1
BasicLibraries.loadLibrary("DmInstall")
DmInstall.ToolsImages.CreeIcones(oDmOptions,1)
bIconesChangees = True
End Sub
Sub CreeIconesOptionsSoft2
BasicLibraries.loadLibrary("DmInstall")
DmInstall.ToolsImages.CreeIcones(oDmOptions,2)
bIconesChangees = True
End Sub
Sub CreeIconesOptionsSoft3
BasicLibraries.loadLibrary("DmInstall")
DmInstall.ToolsImages.CreeIcones(oDmOptions,3)
bIconesChangees = True
End Sub
'Sub GereSoftButton1Options
' Print "ICI3"
' Xray oDmOptions
' GereSoftButton(oDmOptions,1)
'End Sub
'Sub GereSoftButton2Options
' GereSoftButton(oDmOptions,2)
'End Sub
'Sub GereSoftButton3Options
' GereSoftButton(oDmOptions,3)
'End Sub
Sub AfficherMasquerIcones rem cette macro permet de masquer ou d'afficher des icones de la barre dmaths
rem chargement des boites de dialogues
Dim sImage, sRacineImage as String
oDmOptions.Visible = False
DialogLibraries.loadLibrary( "Dmaths" )
oAddonBarre = CreateUnoDialog( DialogLibraries.DmInstall.AddonBarre )
oConfigAccessToolBarre = GetConfigAccess( "/org.openoffice.Office.Addons/AddonUI/OfficeToolBar", True )
oDmBarre = oConfigAccessToolBarre.getByName("org.openoffice.Office.addon.DMathsBarre")
oAddonBarre.GetControl("CheckBox42").Visible = 0
Dim sElementNames$()
sElementNames = oDmBarre.getElementNames()
For I = LBound(sElementNames()) To UBound(sElementNames())
sImage = NomFichier(oDmBarre.getByname(sElementNames(I)).ImageIdentifier)
oAddonBarre.GetControl("ImageControl"&cStr(I+1)).Model.Width = 8
oAddonBarre.GetControl("ImageControl"&cStr(I+1)).Model.Height = 8
oAddonBarre.GetControl("ImageControl"&cStr(I+1)).Model.ImageUrl = oDmBarre.getByname(sElementNames(I)).ImageIdentifier & "_16.bmp"
If Instr(sImage,"choixoptionsdmaths") > 0 Then oAddonBarre.GetControl("CheckBox"&cStr(I+1)).Enable = False
If oDmBarre.getByname(sElementNames(I)).Context <> "hidden" Then oAddonBarre.GetControl("CheckBox"&cStr(I+1)).State = 1
Next I
exitOK = com.sun.star.ui.dialogs.ExecutableDialogResults.OK
if oAddonBarre.Execute = exitOK then RetourChoixOptionsDmaths
' oAddonBarre.Execute()
End Sub
Sub RetourChoixOptionsDmaths
bAfficherMasquerIcones = True
oDmOptions.Visible = True
End Sub
Sub RegleAffichageIcones
Dim sElementNames$()
sElementNames = oDmBarre.getElementNames()
For I = LBound(sElementNames()) To UBound(sElementNames())
If oAddonBarre.GetControl("CheckBox"&cStr(I+1)).State = 1 Then
oDmBarre.getByname(sElementNames(I)).Context = "com.sun.star.text.TextDocument"
Else
oDmBarre.getByname(sElementNames(I)).Context = "hidden"
End if
Next I
oAddonBarre.EndExecute()
oConfigAccessToolBarre.commitChanges()
bIconesChangees = True
End Sub
Sub CancelMasquerIcones
oAddonBarre.EndExecute()
oDmOptions.Visible = True
End Sub
Sub About_Dmaths rem enregistré le 7 mai 2004
DialogLibraries.loadLibrary("DmInstall")
BasicLibraries.loadLibrary("Dmaths")
Call Dmaths.Tools.VerifOperationnel
Dim oImage as Object
Dim sInfo as String
oCopyDmaths = CreateUnoDialog( DialogLibraries.DmInstall.CopyDmaths )
oImage = oCopyDmaths.Model.ImageControl1
oImage.ImageUrl=sChemindmaths+"Images/logo.png"
sInfo = "Dmaths version "+iVersion+" Licence GPL"+Chr(13)
sInfo = sInfo+"Copyright 2001-2010 Didier Dorange-Pattoret"+Chr(13)
sInfo = sInfo+ "http://www.dmaths.org"+Chr(13) +Chr(13)
sInfo = sInfo+ "Remerciements à: "+Chr(13)
sInfo = sInfo+ "- Laurent Godard (lgodard@indesko.com http://www.indesko.com)"+Chr(13)
sInfo = sInfo+ " pour ses conseils, TailleFormule et BatchConv (LGPL),"+Chr(13)
sInfo = sInfo+ "- Andy Lewis pour GraphPlotter et Box Plot Histogram (LGPL),"+Chr(13)
sInfo = sInfo+ "- Gilles Daurat pour les macros de Gdmath (GPL),"+Chr(13)
sInfo = sInfo+ "- Christophe Devalland pour les macros SPIP/LateX (GPL),"+Chr(13)
sInfo = sInfo+ "- Agnès Simonet pour la macro qui permet d'encadrer du texte,"+Chr(13)
sInfo = sInfo+ "- Jérôme Ortais pour ses macros et les modifications apportées,"+Chr(13)
sInfo = sInfo+ "- Jacqueline Gouguenheim-Desloy pour l'installation sous Mac,"+Chr(13)
sInfo = sInfo+ "- Jean Marc Gervais pour le mémo et le mini mémo,"+Chr(13)
sInfo = sInfo+ "- Arnaud Kientz et Sébastien Estrade pour le logo et le site,"+Chr(13)
sInfo = sInfo+ "- Gisbert Friege pour la traduction en allemand"+Chr(13)
sInfo = sInfo+ " et l'introduction de la dérivée seconde dans les tableaux de variations."+Chr(13)
sInfo = sInfo+ "- Jean-Luc Guillot pour l'amélioration du traceur de courbes."+Chr(13)
sInfo = sInfo+ "- Romain Dorange-Pattoret pour celle du module figures géométriques."+Chr(13)
sInfo = sInfo+ "- Jean Marc Gervais, Gisbert Friege et Jacqueline Gouguenheim-Desloy"+Chr(13)+" pour leurs suggestions et leur aide précieuse."+Chr(13)+Chr(13)
sInfo = sInfo +"Dmaths is a free software under the GPL Licence"+Chr(13)
sInfo = sInfo +"of the Free Software Foundation (www.fsf.org)"+Chr(13)
oCopyDmaths.GetControl("Label1").Text = sInfo
oCopyDmaths.Execute()
End Sub
Sub End_About_Dmaths
oCopyDmaths.Endexecute()
End Sub
Sub Display_Licence
Dim oLicence as Object
Dim mFileProperties(0) As New com.sun.star.beans.PropertyValue
Dim sUrl as String
mFileProperties(0).Value=True
sUrl=sChemindmaths+"licence.odt"
oDesktop=createUnoService("com.sun.star.frame.Desktop")
oLicence= oDesktop.LoadComponentFromURL(sUrl,"_blank",0,mFileProperties())
End Sub
Sub Join_dmaths
On error resume next
' If GetGuiType = 1 Then
Dim sUrl as String
Dim sys As Object
Dim iFlags As Integer
sUrl=ConvertToURL("http://www.dmaths.org")
sys = CreateUnoService("com.sun.star.system.SystemShellExecute")
iFlags = com.sun.star.system.SystemShellExecuteFlags.NO_SYSTEM_ERROR_MESSAGE ' = 0
sys.execute(sUrl," ", iFlags)
' Elseif FileExists ("/usr/bin/konqueror") Then
' shell("/usr/bin/konqueror http://www.dmaths.org")
' Endif
End Sub
rem cette macro sert a relancer la mise a jour
Sub Repare_Dmaths
oDmOptions.EndExecute()
Wait 100
Call Install_Addon.LanceFinInstallation(TRUE)
End Sub
'---------------------------------------------------------------------------------------------------------
Rem Cette macro transforme les raccourcis F10 en F8 et F9 en F4 ecrite le 17 octobre 2010 par Didier DP
Sub Config4Mac(bForMac as Boolean)
Dim oConfigAccess,MyProp as Object
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Accelerators/PrimaryKeys/Modules/com.sun.star.text.TextDocument", True )
If oConfigAccess.hasByName("F4") Then oConfigAccess.removeByName("F4")
If oConfigAccess.hasByName("F8") Then oConfigAccess.removeByName("F8")
If oConfigAccess.hasByName("F9") Then oConfigAccess.removeByName("F9")
If oConfigAccess.hasByName("F10") Then oConfigAccess.removeByName("F10")
MyProp = oConfigAccess.CreateInstance
If bForMac Then
MyProp.Command = "vnd.sun.star.script:Dmaths.Module1.MetentreAccolades?language=Basic&location=application"
oConfigAccess.insertByName("F4",myProp)
Endif
MyProp = oConfigAccess.CreateInstance
If bForMac Then
MyProp.Command = "vnd.sun.star.script:Dmaths.Module1.MetenFormule?language=Basic&location=application"
Else
MyProp.Command = ".uno:SetExtSelection"
Endif
oConfigAccess.insertByName("F8",myProp)
oConfigAccess.CommitChanges()
End Sub
rem --------------------------------------------------------------------------------------------------------------------------------
rem la macro suivante permet dechanger F4-F9 et F8-F10
Sub SwitchF4F8
Dim oConfigAccess,MyProp as Object
Dim bDefaultConfig as Boolean
bIconesChangees = True rem commande le redemarrage apres validation des options.
bDefaultConfig = False
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Accelerators/PrimaryKeys/Modules/com.sun.star.text.TextDocument", True )
If oConfigAccess.hasByName("F8") Then bDefaultConfig = (oConfigAccess.getByName("F8").Command = ".uno:SetExtSelection")
' MyProp = oConfigAccess.CreateInstance
If oConfigAccess.hasByName("F4") Then oConfigAccess.removeByName("F4")
If oConfigAccess.hasByName("F8") Then oConfigAccess.removeByName("F8")
If oConfigAccess.hasByName("F9") Then oConfigAccess.removeByName("F9")
If oConfigAccess.hasByName("F10") Then oConfigAccess.removeByName("F10")
' Print oConfigAccess.getByName("F8").Command
oConfigAccess.CommitChanges()
If bDefaultConfig Then
MyProp = oConfigAccess.CreateInstance
MyProp.Command = "vnd.sun.star.script:Dmaths.Module1.MetentreAccolades?language=Basic&location=application"
oConfigAccess.insertByName("F4",myProp)
MyProp = oConfigAccess.CreateInstance
MyProp.Command = "vnd.sun.star.script:Dmaths.Module1.MetenFormule?language=Basic&location=application"
oConfigAccess.insertByName("F8",myProp)
Else
MyProp = oConfigAccess.CreateInstance
MyProp.Command = "vnd.sun.star.script:Dmaths.Module1.MetentreAccolades?language=Basic&location=application"
oConfigAccess.insertByName("F9",myProp)
MyProp = oConfigAccess.CreateInstance
MyProp.Command = "vnd.sun.star.script:Dmaths.Module1.MetenFormule?language=Basic&location=application"
oConfigAccess.insertByName("F10",myProp)
MyProp = oConfigAccess.CreateInstance
MyProp.Command = ".uno:SetExtSelection"
oConfigAccess.insertByName("F8",myProp)
Endif
oConfigAccess.CommitChanges()
End Sub
'----------------------------------------------------------------------------------------------------------
Sub ModifieCheckBoxTailleFormule
If oDmOptions.GetControl("CheckBox12").State=1 Then
oDmOptions.GetControl("TextField1").Enable = False
Else
oDmOptions.GetControl("TextField1").Enable = True
End If
End Sub
'---------------------------------------------------------------------------------------------------------
Sub InsertModuleDmOptions(srce as String)
Dim oLib as Object
oLib = GlobalScope.BasicLibraries.Standard
If oLib.hasByName("DmOptions") Then
oLib.removeByName("DmOptions")
EndIf
If oLib.hasByName("Lang") Then
oLib.removeByName("Lang")
EndIf
oLib.InsertByName("DmOptions",srce)
End Sub
Function GetConfigAccess( ByVal cNodePath As String,ByVal bWriteAccess As Boolean,Optional bEnableSync,Optional bLazyWrite) As Object
If IsMissing(bEnableSync) Then bEnableSync = True
If IsMissing( bLazyWrite ) Then bLazyWrite = False
Dim oConfigProvider, oConfigAccess as Object
oConfigProvider = GetProcessServiceManager.createInstanceWithArguments("com.sun.star.configuration.ConfigurationProvider",Array( MakePropertyValue( "enableasync", bEnableSync)))
If bWriteAccess Then
cServiceName = "com.sun.star.configuration.ConfigurationUpdateAccess"
Else
cServiceName = "com.sun.star.configuration.ConfigurationAccess"
EndIf
oConfigAccess = oConfigProvider.createInstanceWithArguments( cServiceName, Array( MakePropertyValue( "nodepath", cNodePath ), MakePropertyValue( "lazywrite", bLazyWrite )))
GetConfigAccess() = oConfigAccess
End Function
'----------
' Create and return a new com.sun.star.beans.PropertyValue.
'
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function
rem cette fonction retourne True pour les installation multi-utilisateurs.
Function TestInstallRezo as Boolean
Dim LeTest As Boolean
Dim oAC As Object
LeTest = False
oCmdEnv = CreateUnoListener( "CmdEnv_", _
"com.sun.star.deployment.XCommandEnvironment" )
GetPMF = GetDefaultContext.getValueByName( _
"/singletons/com.sun.star.deployment.thePackageManagerFactory")
oPackages = GetPMF.getPackageManager("shared").getDeployedPackages(oAc,oCmdEnv)
For I = LBound(oPackages) To UBound(oPackages)
If oPackages(I).Name = "DmathsAddon.oxt" Then
LeTest = True
Endif
Next I
TestInstallRezo = LeTest
End Function
rem cette fonction donne le nom d'un fichier connaissant son URL
Function NomFichier(sURL as String) as String
Dim iPos,iLongUrl as integer
iLongUrl = Len(sUrl)
iPos = iLongUrl
Do
iPos = iPos - 1
Loop until (Mid(sUrl,iPos,1) = "/" or iPos = 0)
NomFichier = Mid(sUrl,iPos+1,iLongUrl-iPos)
end function
rem cette macro active ou desactive le champ de texte des scalaires lettres
Sub ChangeLettresStatuts(oEvt as Object)
oEvt.Source.Context.GetControl("TextField7").Enable = (oEVt.Source.State = 1)
End Sub
</script:module>
|