New code for pageConfig dialog

This commit is contained in:
Georgy Litvinov 2020-05-05 23:32:59 +02:00
parent 163cb7de47
commit 23f8834361
4 changed files with 32 additions and 12 deletions

View file

@ -5,7 +5,6 @@
<dlg:style dlg:style-id="0" dlg:border="none"/>
</dlg:styles>
<dlg:bulletinboard>
<dlg:textfield dlg:style-id="0" dlg:id="TextField11" dlg:tab-index="10" dlg:left="193" dlg:top="277" dlg:width="16" dlg:height="10" dlg:value="1000"/>
<dlg:textfield dlg:style-id="0" dlg:id="pageHeight" dlg:tab-index="11" dlg:left="11" dlg:top="141" dlg:width="16" dlg:height="10" dlg:value="1000"/>
<dlg:textfield dlg:style-id="0" dlg:id="pageWidth" dlg:tab-index="7" dlg:left="99" dlg:top="281" dlg:width="16" dlg:height="10" dlg:value="1000"/>
<dlg:textfield dlg:style-id="0" dlg:id="leftPageMargin" dlg:tab-index="6" dlg:left="32" dlg:top="1" dlg:width="16" dlg:height="10" dlg:value="1000"/>
@ -18,11 +17,12 @@
<dlg:textfield dlg:style-id="0" dlg:id="footnoteAreaOffset" dlg:tab-index="1" dlg:left="193" dlg:top="202" dlg:width="16" dlg:height="10" dlg:value="1000"/>
<dlg:text dlg:id="description" dlg:tab-index="12" dlg:left="229" dlg:top="6" dlg:width="155" dlg:height="42" dlg:value="Label1"/>
<dlg:button dlg:id="Cancel" dlg:tab-index="14" dlg:left="314" dlg:top="290" dlg:width="58" dlg:height="13" dlg:value="Cancel" dlg:button-type="cancel"/>
<dlg:button dlg:id="Ok" dlg:tab-index="13" dlg:left="241" dlg:top="290" dlg:width="58" dlg:height="13" dlg:value="Ok" dlg:button-type="ok"/>
<dlg:button dlg:id="Ok" dlg:tab-index="13" dlg:left="241" dlg:top="290" dlg:width="58" dlg:height="13" dlg:value="Ok" dlg:button-type="cancel"/>
<dlg:menulist dlg:id="ListBox2" dlg:tab-index="16" dlg:left="286" dlg:top="15" dlg:width="2" dlg:height="0"/>
<dlg:menulist dlg:id="slylesList" dlg:tab-index="17" dlg:left="293" dlg:top="95" dlg:width="0" dlg:height="2"/>
<dlg:img dlg:style-id="0" dlg:id="ImageControl1" dlg:tab-index="18" dlg:left="11" dlg:top="8" dlg:width="214" dlg:height="291" dlg:image-src="%origin%/images/panel.svg" dlg:scale-mode="isotropic"/>
<dlg:img dlg:style-id="0" dlg:id="ImageControl1" dlg:tab-index="18" dlg:left="11" dlg:top="8" dlg:width="214" dlg:height="291" dlg:scale-mode="isotropic"/>
<dlg:menulist dlg:id="pageStyles" dlg:tab-index="15" dlg:left="229" dlg:top="50" dlg:width="155" dlg:height="230" dlg:multiselection="true"/>
<dlg:textfield dlg:style-id="0" dlg:id="rightPageMargin" dlg:tab-index="0" dlg:left="168" dlg:top="1" dlg:width="16" dlg:height="10" dlg:value="1000"/>
<dlg:textfield dlg:style-id="0" dlg:id="bottomPageMargin" dlg:tab-index="10" dlg:left="193" dlg:top="277" dlg:width="16" dlg:height="10" dlg:value="1000"/>
</dlg:bulletinboard>
</dlg:window>
</dlg:window>

View file

@ -8,27 +8,47 @@
Dim pageStyles As Object
Dim pageStyleNames() As String
Dim imageURL As String
Dim pageStyle As Object
oStyles = ThisComponent.StyleFamilies
pageStyles = oStyles.getByName(oStyles.elementNames(2))
pageStyleNames = pageStyles.getElementNames
Dim displayPageStyleNames(Ubound(pageStyleNames))
For i = LBound(displayPageStyleNames) To Ubound(displayPageStyleNames)
pageStyle = pageStyles.getByName(pageStyleNames(i))
displayPageStyleNames(i) = pageStyle.displayName
Next i
subShellSort(displayPageStyleNames)
dialog = CreateUnoDialog( DialogLibraries.ePublishing.PageConfig )
&apos; Globalscope.BasicLibraries.LoadLibrary( &quot;MRILib&quot; )
a = dialog.getControl(&quot;ImageControl1&quot;)
Globalscope.BasicLibraries.LoadLibrary( &quot;MRILib&quot; )
imageURL = convertToURL(getExtensionPath() + &quot;/images/panel.svg&quot;)
dialog.getControl(&quot;ImageControl1&quot;).model.imageURL = imageURL
dialog.getControl(&quot;description&quot;).setText(getTranslation(&quot;PageConfigDialogTranslations&quot;))
dialog.getControl(&quot;pageHeight&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;pageWidth&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;leftPageMargin&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;topPageMargin&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;rightPageMargin&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;bottomPageMargin&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;headerHeight&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;headerOffset&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;footerHeight&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;footerOffset&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;footnoteAreaHeight&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;footnoteAreaOffset&quot;).setText(&quot;&quot;)
dialog.getControl(&quot;Cancel&quot;).Label = getTranslation(&quot;PageConfigDialogCancelButton&quot;)
dialog.getControl(&quot;Ok&quot;).Label = getTranslation(&quot;PageConfigDialogOkButton&quot;)
listBox = dialog.getControl(&quot;pageStyles&quot;)
listBox.addItems(pageStyleNames , 0)
dialog.Title = getTranslation(&quot;batchChangePageStyleProperties&quot;)
listBox.addItems(displayPageStyleNames, 0)
dialog.Title = getTranslation(&quot;PageConfigDialogTitle&quot;)
dialog.Execute()
End Sub
Function getExtensionPath As String
Dim extensionIdentifier As String
Dim pip As Object
extensionIdentifier = &quot;pro.litvinovg.Redaction&quot;
extensionIdentifier = &quot;pro.litvinovg.epublishing&quot;
pip = GetDefaultContext.getByName(&quot;/singletons/com.sun.star.deployment.PackageInformationProvider&quot;)
getExtensionPath = pip.getPackageLocation(extensionIdentifier)
End Function

View file

@ -1,6 +1,6 @@
<?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="journals" script:language="StarBasic">Private sub journalsMark15
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="journals" script:language="StarBasic">Private sub journalsMark16
End sub
Dim templateName As String

Binary file not shown.