Added navigator dialog

This commit is contained in:
Georgy Litvinov 2021-06-04 20:42:13 +02:00
parent 2395f816e6
commit 9846e2933c
7 changed files with 2469 additions and 1 deletions

12
Redaction/Navigator.xdl Normal file
View file

@ -0,0 +1,12 @@
<?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="Navigator" dlg:left="0" dlg:top="50" dlg:width="100" dlg:height="123" dlg:closeable="true" dlg:moveable="true">
<dlg:bulletinboard>
<dlg:text dlg:id="description" dlg:tab-index="1" dlg:left="2" dlg:top="5" dlg:width="96" dlg:height="47" dlg:value="описание объектов для навигации" dlg:multiline="true"/>
<dlg:button dlg:id="close" dlg:tab-index="2" dlg:left="2" dlg:top="105" dlg:width="96" dlg:height="15" dlg:value="Закрыть навигатор" dlg:toggled="1"/>
<dlg:button dlg:id="next" dlg:tab-index="0" dlg:left="67" dlg:top="70" dlg:width="30" dlg:height="30" dlg:toggled="1"/>
<dlg:text dlg:id="current" dlg:tab-index="4" dlg:left="36" dlg:top="81" dlg:width="28" dlg:height="15" dlg:value="current"/>
<dlg:text dlg:id="found" dlg:tab-index="5" dlg:left="2" dlg:top="55" dlg:width="96" dlg:height="12" dlg:value="Всего найдено"/>
<dlg:button dlg:id="prev" dlg:tab-index="3" dlg:left="3" dlg:top="70" dlg:width="30" dlg:height="30" dlg:valign="center" dlg:toggled="1"/>
</dlg:bulletinboard>
</dlg:window>

View file

@ -287,6 +287,12 @@ Function getRussian(identifier As String) As String
Case &quot;advancedMenuconvertFontsToCharStyles&quot;
getRussian = &quot;Создать стили символов из найденных шрифтов&quot;
Exit Function
Case &quot;buttonClose&quot;
getRussian = &quot;Закрыть&quot;
Exit Function
Case &quot;navigatorFound&quot;
getRussian = &quot;Всего найдено: &quot;
Exit Function
Case Else
getRussian = &quot;Перевод не найден&quot;
End Select
@ -556,6 +562,12 @@ Function getEnglish(identifier As String) As String
Case &quot;advancedMenuconvertFontsToCharStyles&quot;
getEnglish = &quot;Create character styles from found fonts &quot;
Exit Function
Case &quot;buttonClose&quot;
getEnglish = &quot;Close&quot;
Exit Function
Case &quot;navigatorFound&quot;
getEnglish = &quot;Total found: &quot;
Exit Function
Case Else
getEnglish = &quot;No translation&quot;
End Select
@ -824,6 +836,12 @@ Function getCroatian(identifier As String) As String
Case &quot;advancedMenuconvertFontsToCharStyles&quot;
getCroatian = &quot;Stvorite stilove znakova iz pronađenih fontova &quot;
Exit Function
Case &quot;buttonClose&quot;
getCroatian = &quot;Zatvoriti &quot;
Exit Function
Case &quot;navigatorFound&quot;
getCroatian = &quot;Ukupno pronađeno: &quot;
Exit Function
Case Else
getCroatian = &quot;No translation&quot;
End Select
@ -1092,6 +1110,12 @@ Function getSerbian(identifier As String) As String
Case &quot;advancedMenuconvertFontsToCharStyles&quot;
getSerbian = &quot;Створите стилове знакова од пронађених фонтова &quot;
Exit Function
Case &quot;buttonClose&quot;
getSerbian = &quot;Затворити&quot;
Exit Function
Case &quot;navigatorFound&quot;
getSerbian = &quot;Укупно пронађено: &quot;
Exit Function
Case Else
getSerbian = &quot;No translation&quot;
End Select
@ -1360,6 +1384,12 @@ Function getBosnian(identifier As String) As String
Case &quot;advancedMenuconvertFontsToCharStyles&quot;
getBosnian = &quot;Stvorite stilove znakova iz pronađenih fontova &quot;
Exit Function
Case &quot;buttonClose&quot;
getBosnian = &quot;Zatvoriti &quot;
Exit Function
Case &quot;navigatorFound&quot;
getBosnian = &quot;Ukupno pronađeno: &quot;
Exit Function
Case Else
getBosnian = &quot;No translation&quot;
End Select

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="Validation" script:language="StarBasic">Sub markval22
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval24
End Sub
@ -851,6 +851,81 @@ Function getCharsInFont(fontName As String) As String
EndIf
End Function
Sub findColoredBackgroundInDoc()
Dim founds As Object
Dim sDesc As Object
Dim SrchAttributes(0) as new com.sun.star.beans.PropertyValue
SrchAttributes(0).Name = &quot;CharBackTransparent&quot;
SrchAttributes(0).Value = False
sDesc = Thiscomponent.createSearchDescriptor()
sDesc.SearchAll = true
sDesc.ValueSearch = false
sDesc.SearchRegularExpression = true
sDesc.SearchString = searchString
sDesc.searchStyles = true
sDesc.SetSearchAttributes(SrchAttributes())
founds = Thiscomponent.findAll(sDesc)
If founds.count &lt;&gt; 0 Then
MsgBox founds.count
Else
MsgBox getTranslation(&quot;No colored text excerpts found&quot;)
EndIf
End Sub
Sub starNavigatorDialog(objectsDescription As Text,founds As Object)
Dim dialog As Object
Dim leftImageURL As String
Dim rightImageURL As String
waitingForDialog = true
dialog = notModalDialog(&quot;Navigator&quot;)
&apos; dialog.getControl(&quot;found&quot;).SetText(getTranslation(&quot;EndnotesNativeDialogFound&quot;) &amp; CStr(UBound(foundEndNotes)+1))
&apos; dialog.getControl(&quot;description&quot;).SetText(getTranslation(&quot;EndnotesNativeDialogDescriptionSelect&quot;))
&apos; dialog.getControl(&quot;cancel&quot;).Label = getTranslation(&quot;buttonCancel&quot;)
dialog.getControl(&quot;close&quot;).Label = getTranslation(&quot;buttonClose&quot;)
leftImageURL = convertToURL(getExtensionPath() &amp; &quot;/images/left-navigator.svg&quot;)
rightImageURL = convertToURL(getExtensionPath() &amp; &quot;/images/right-navigator.svg&quot;)
dialog.getControl(&quot;prev&quot;).model.imageURL = leftImageURL
&apos;dialog.getControl(&quot;prev&quot;).model.ScaleMode = 2
dialog.getControl(&quot;next&quot;).model.imageURL = rightImageURL
&apos;dialog.getControl(&quot;next&quot;).model.ScaleMode = 2
dialog.setvisible(true)
Do While waitingForDialog
If dialog.getControl(&quot;close&quot;).model.state = 1 then
exit Do
EndIf
If dialog.getControl(&quot;prev&quot;).model.state = 1 then
EndIf
If dialog.getControl(&quot;next&quot;).model.state = 1 then
EndIf
wait (100)
Loop
dialog.dispose
End Sub
Function getExtensionPath() As String
Dim extensionIdentifier As String
Dim pip As Object
extensionIdentifier = &quot;pro.litvinovg.Redaction&quot;
pip = GetDefaultContext.getByName(&quot;/singletons/com.sun.star.deployment.PackageInformationProvider&quot;)
getExtensionPath = pip.getPackageLocation(extensionIdentifier)
End Function
Function notModalDialog(dialogName As String) As Variant
Dim windowProvider As Object
Dim containerWindow As Object
Dim handler As Object
Dim dialogUrl As String
Dim dialog As Object
containerWindow = ThisComponent.getCurrentController().getFrame().getContainerWindow()
dialogUrl = &quot;vnd.sun.star.script:Redaction.&quot; &amp; dialogName &amp; &quot;?location=application&quot;
windowProvider = CreateUnoService(&quot;com.sun.star.awt.ContainerWindowProvider&quot;)
dialog = windowProvider.createContainerWindow(dialogUrl, &quot;&quot;, containerWindow, handler)
notModalDialog = dialog
End Function
sub openReport(fileName As String)
dim document as object

View file

@ -6,4 +6,5 @@
<library:element library:name="NoStyleFile"/>
<library:element library:name="StartQuietCleaning"/>
<library:element library:name="ChooseFontname"/>
<library:element library:name="Navigator"/>
</library:library>

1175
images/left-navigator.svg Normal file

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 64 KiB

1175
images/right-navigator.svg Normal file

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.