9 messages in org.openoffice.fr.progRe: [prog] [DRAW]gestion de la grille
FromSent OnAttachments
SEGUIN FrançoisOct 4, 2007 10:39 pm 
Anthony BenoistOct 5, 2007 12:49 am 
gerardOct 5, 2007 2:30 am 
Bernard MarcellyOct 5, 2007 4:48 am 
SEGUIN FrançoisOct 5, 2007 10:04 am 
Anthony BenoistOct 7, 2007 9:55 am 
SEGUIN FrançoisOct 7, 2007 10:50 am 
Ariel Constenla-HaileOct 8, 2007 8:36 pm 
SEGUIN FrançoisOct 9, 2007 11:10 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [prog] [DRAW]gestion de la grilleActions...
From:SEGUIN François (fseg@wanadoo.fr)
Date:Oct 9, 2007 11:10:35 pm
List:org.openoffice.fr.prog

----- Original Message ----- From: "Ariel Constenla-Haile" <arie@googlemail.com> To: <pr@fr.openoffice.org> Sent: Tuesday, October 09, 2007 5:36 AM Subject: Re: [prog] [DRAW]gestion de la grille

Bonjour et grand merci a toi Ariel car le code que tu as fourni permet une bonne avancée mais il reste comme tu l'as ndiqué encore un petit problème. Lire la suite...

Ariel Constela Haile à écrit

Vous pouvez manipuler les options du menu "Outils" - "Options" - "OpenOffice.org Draw" - "Grille", si vous accédez à la branche de configuration "/org.openoffice.Office.Draw"

Pour manipuler la grille, utilisez "/org.openoffice.Office.Draw/Grid".

Exemple:

Sub DRAW_GRID_CONFIG

Dim oDrawGridConfig as Object oDrawGridConfig = getConfigurationAccess(_ "/org.openoffice.Office.Draw/Grid", true )

If NOT IsNull(oDrawGridConfig) Then Dim bIsVisibleGrid as Boolean bIsVisibleGrid = oDrawGridConfig.getHierarchicalPropertyValue(_ "Option/VisibleGrid") oDrawGridConfig.setHierarchicalPropertyValue(_ "Option/VisibleGrid", NOT bIsVisibleGrid) oDrawGridConfig.setHierarchicalPropertyValue(_ "Resolution/XAxis/Metric", 500) oDrawGridConfig.setHierarchicalPropertyValue(_ "Resolution/YAxis/Metric", 500)

'DO NOT forget to commit the changes! oDrawGridConfig.commitChanges()

'BUT unfortunately, this will have NO effect until you close OOo 'and the QuickStarter 'NOT very useful! End If End Sub

Effectivement les modifications ne sont prise en compte que si on sort de oOO. J'ai l'impression que c'est parce que le code de la fonction qui accède bien à l'objet désiré le fait en créant une nouvelle instance de l'objet donc ce n'est pas l'objet du fichier Draw à l'écran qui est modifié??? J'ai fait des recherche avex Xray mais pour l'instant infructueuses.

Function getConfigurationAccess( sNodePath$, bUpdate as Boolean, Optional aLocale$)

REM Param. aLocale is STRING, NOT com.sun.star.lang.Locale ' for example. "es", "es-AR" ' "*" for ALL locales

On Error GoTo getConfigurationAccessErrorHandler

Dim sConfigurationProvider$, oConfigurationProvider as Object Dim sConfigurationAccess$, sConfigurationUpdateAccess$, sConfiguration$ Dim oConfigurationAccess as Object

sConfigurationProvider = "com.sun.star.configuration.ConfigurationProvider" oConfigurationProvider = createUNOService(sConfigurationProvider)

Dim oParametros(0) As New com.sun.star.beans.PropertyValue oParametros(0).Name = "nodepath" oParametros(0).Value = sNodePath

sConfigurationAccess = "com.sun.star.configuration.ConfigurationAccess" sConfigurationUpdateAccess = "com.sun.star.configuration.ConfigurationUpdateAccess"

if bUpdate then ReDim Preserve oParametros(1) oParametros(1).Name = "EnableAsync" oParametros(1).Value = FALSE sConfiguration = sConfigurationUpdateAccess else sConfiguration = sConfigurationAccess end if

if NOT IsMissing(aLocale) then Dim n% n = UBound(oParametros)+1 ReDim Preserve oParametros(n) oParametros(n).Name = "Locale" oParametros(n).Value = aLocale end if

c'est le code ci-après qui créée une instance...

oConfigurationAccess = oConfigurationProvider.createInstanceWithArguments(_ sConfiguration, oParametros())

getConfigurationAccessCleanUp: getConfigurationAccess() = oConfigurationAccess Exit Function getConfigurationAccessErrorHandler: Resume getConfigurationAccessCleanUp End Function