Updated the dialog for styling and text width for Deutsch.

This commit is contained in:
依瑪貓 2017-02-18 17:16:49 +08:00
parent 98d3149264
commit 42445bcd67
3 changed files with 39 additions and 47 deletions

View File

@ -330,21 +330,16 @@ Sub subUpdateBestStatAppraisal (oDialog As Object, sAppraisal)
Dim oText As Object, oList As Object, nX As Integer
Dim sBefore As String, nBeforeWidth As Integer
Dim sAfter As String, nAfterWidth As Integer
Dim nDialogWidth As Integer
Dim nPos As Integer
Dim mItems () As String
nPos = InStr (sAppraisal, "[Stat]")
sBefore = Left (sAppraisal, nPos - 1)
If Right (sBefore, 1) <> " " Then
sBefore = sBefore & " "
End If
nBeforeWidth = CInt (Len (sBefore) * 2.3)
nBeforeWidth = CInt (Len (sBefore) * 2.8)
sAfter = Right (sAppraisal, _
Len (sAppraisal) - nPos - Len ("[Stat]") + 1)
If Left (sAfter, 1) <> " " Then
sAfter = " " & sAfter
End If
nAfterWidth = CInt (Len (sAfter) * 2.3)
nDialogWidth = oDialog.getModel.getPropertyValue ("Width")
oText = oDialog.getControl ("txtBestBefore")
oText.getModel.setPropertyValue ("Width", nBeforeWidth)
@ -361,8 +356,9 @@ Sub subUpdateBestStatAppraisal (oDialog As Object, sAppraisal)
oList.addItems (mItems, 0)
oList.getModel.setPropertyValue ("PositionX", nX)
oList.setVisible (True)
nX = nX + oList.getModel.getPropertyValue ("Width") + 2
nX = nX + oList.getModel.getPropertyValue ("Width")
nAfterWidth = nDialogWidth - nX - 10
oText = oDialog.getControl ("txtBestAfter")
oText.getModel.setPropertyValue ("PositionX", nX)
oText.getModel.setPropertyValue ("Width", nAfterWidth)

View File

@ -332,21 +332,16 @@ Sub subUpdateBestStatAppraisal (oDialog As Object, sAppraisal)
Dim oText As Object, oList As Object, nX As Integer
Dim sBefore As String, nBeforeWidth As Integer
Dim sAfter As String, nAfterWidth As Integer
Dim nDialogWidth As Integer
Dim nPos As Integer
Dim mItems () As String
nPos = InStr (sAppraisal, &quot;[Stat]&quot;)
sBefore = Left (sAppraisal, nPos - 1)
If Right (sBefore, 1) &lt;&gt; &quot; &quot; Then
sBefore = sBefore &amp; &quot; &quot;
End If
nBeforeWidth = CInt (Len (sBefore) * 2.3)
nBeforeWidth = CInt (Len (sBefore) * 2.8)
sAfter = Right (sAppraisal, _
Len (sAppraisal) - nPos - Len (&quot;[Stat]&quot;) + 1)
If Left (sAfter, 1) &lt;&gt; &quot; &quot; Then
sAfter = &quot; &quot; &amp; sAfter
End If
nAfterWidth = CInt (Len (sAfter) * 2.3)
nDialogWidth = oDialog.getModel.getPropertyValue (&quot;Width&quot;)
oText = oDialog.getControl (&quot;txtBestBefore&quot;)
oText.getModel.setPropertyValue (&quot;Width&quot;, nBeforeWidth)
@ -363,8 +358,9 @@ Sub subUpdateBestStatAppraisal (oDialog As Object, sAppraisal)
oList.addItems (mItems, 0)
oList.getModel.setPropertyValue (&quot;PositionX&quot;, nX)
oList.setVisible (True)
nX = nX + oList.getModel.getPropertyValue (&quot;Width&quot;) + 2
nX = nX + oList.getModel.getPropertyValue (&quot;Width&quot;)
nAfterWidth = nDialogWidth - nX - 10
oText = oDialog.getControl (&quot;txtBestAfter&quot;)
oText.getModel.setPropertyValue (&quot;PositionX&quot;, nX)
oText.getModel.setPropertyValue (&quot;Width&quot;, nAfterWidth)

View File

@ -1,6 +1,6 @@
<?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="DlgMain" dlg:left="100" dlg:top="100" dlg:width="250" dlg:height="250" dlg:closeable="true" dlg:moveable="true" dlg:title="&amp;1.DlgMain.Title">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="DlgMain" dlg:left="50" dlg:top="50" dlg:width="265" dlg:height="235" dlg:closeable="true" dlg:moveable="true" dlg:title="&amp;1.DlgMain.Title">
<dlg:styles>
<dlg:style dlg:style-id="0" dlg:border="none"/>
<dlg:style dlg:style-id="1" dlg:background-color="0xff0000" dlg:text-color="0xffffff" dlg:font-weight="100"/>
@ -8,8 +8,8 @@
<dlg:style dlg:style-id="3" dlg:background-color="0xffff00"/>
</dlg:styles>
<dlg:bulletinboard>
<dlg:text dlg:id="txtPokemon" dlg:tab-index="16" dlg:left="5" dlg:top="15" dlg:width="30" dlg:height="8" dlg:value="&amp;2.DlgMain.txtPokemon.Label"/>
<dlg:menulist dlg:id="lstPokemon" dlg:tab-index="0" dlg:left="35" dlg:top="12" dlg:width="55" dlg:height="16" dlg:spin="true" dlg:linecount="20">
<dlg:text dlg:id="txtPokemon" dlg:tab-index="16" dlg:left="5" dlg:top="26" dlg:width="30" dlg:height="8" dlg:value="&amp;2.DlgMain.txtPokemon.Label"/>
<dlg:menulist dlg:id="lstPokemon" dlg:tab-index="0" dlg:left="35" dlg:top="24" dlg:width="55" dlg:height="12" dlg:spin="true" dlg:linecount="20">
<dlg:menupopup>
<dlg:menuitem dlg:value="&amp;1001.lstPokemon.StringItemList"/>
<dlg:menuitem dlg:value="&amp;1002.lstPokemon.StringItemList"/>
@ -169,21 +169,21 @@
<dlg:menuitem dlg:value="&amp;1176.lstPokemon.StringItemList"/>
<dlg:menuitem dlg:value="&amp;1238.lstPokemon.StringItemList"/>
<dlg:menuitem dlg:value="&amp;1239.lstPokemon.StringItemList"/>
<dlg:menuitem dlg:value="&amp;1240.lstPokemon.StringItemList"/>
<dlg:menuitem dlg:value="&amp;1240.lstPokemon.StringItemList"/>
</dlg:menupopup>
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subLstPokemonSelected?language=Basic&amp;location=application" script:language="Script"/>
</dlg:menulist>
<dlg:img dlg:style-id="0" dlg:id="imgPokemon" dlg:tab-index="25" dlg:left="95" dlg:top="5" dlg:width="30" dlg:height="30"/>
<dlg:text dlg:id="txtCP" dlg:tab-index="17" dlg:left="5" dlg:top="42" dlg:width="15" dlg:height="8" dlg:value="&amp;3.DlgMain.txtCP.Label"/>
<dlg:img dlg:style-id="0" dlg:id="imgPokemon" dlg:tab-index="26" dlg:left="95" dlg:top="5" dlg:width="30" dlg:height="30"/>
<dlg:text dlg:id="txtCP" dlg:tab-index="17" dlg:left="5" dlg:top="41" dlg:width="15" dlg:height="8" dlg:value="&amp;3.DlgMain.txtCP.Label"/>
<dlg:numericfield dlg:id="numCP" dlg:tab-index="1" dlg:left="20" dlg:top="39" dlg:width="20" dlg:height="12" dlg:decimal-accuracy="0" dlg:value-min="10" dlg:value-max="5000">
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subBtnOKCheck?language=Basic&amp;location=application" script:language="Script"/>
</dlg:numericfield>
<dlg:text dlg:id="txtHP" dlg:tab-index="18" dlg:left="48" dlg:top="42" dlg:width="15" dlg:height="8" dlg:value="&amp;4.DlgMain.txtHP.Label" dlg:align="right"/>
<dlg:text dlg:id="txtHP" dlg:tab-index="18" dlg:left="50" dlg:top="41" dlg:width="15" dlg:height="8" dlg:value="&amp;4.DlgMain.txtHP.Label"/>
<dlg:numericfield dlg:id="numHP" dlg:tab-index="2" dlg:left="65" dlg:top="39" dlg:width="15" dlg:height="12" dlg:decimal-accuracy="0" dlg:value-min="10" dlg:value-max="500">
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subBtnOKCheck?language=Basic&amp;location=application" script:language="Script"/>
</dlg:numericfield>
<dlg:text dlg:id="txtStarDust" dlg:tab-index="19" dlg:left="89" dlg:top="42" dlg:width="42" dlg:height="8" dlg:value="&amp;5.DlgMain.txtStarDust.Label" dlg:align="right"/>
<dlg:menulist dlg:id="lstStarDust" dlg:tab-index="3" dlg:left="132" dlg:top="39" dlg:width="35" dlg:height="16" dlg:spin="true" dlg:linecount="20">
<dlg:text dlg:id="txtStardust" dlg:tab-index="19" dlg:left="90" dlg:top="41" dlg:width="45" dlg:height="8" dlg:value="&amp;5.DlgMain.txtStardust.Label"/>
<dlg:menulist dlg:id="lstStardust" dlg:tab-index="3" dlg:left="135" dlg:top="39" dlg:width="40" dlg:height="12" dlg:spin="true" dlg:linecount="20">
<dlg:menupopup>
<dlg:menuitem dlg:value="200"/>
<dlg:menuitem dlg:value="400"/>
@ -208,8 +208,8 @@
</dlg:menupopup>
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subBtnOKCheck?language=Basic&amp;location=application" script:language="Script"/>
</dlg:menulist>
<dlg:text dlg:id="txtPlayerLevel" dlg:tab-index="20" dlg:left="170" dlg:top="42" dlg:width="42" dlg:height="8" dlg:value="&amp;6.DlgMain.txtPlayerLevel.Label" dlg:align="right"/>
<dlg:menulist dlg:id="lstPlayerLevel" dlg:tab-index="4" dlg:left="214" dlg:top="39" dlg:width="30" dlg:height="16" dlg:spin="true" dlg:linecount="20">
<dlg:text dlg:id="txtPlayerLevel" dlg:tab-index="20" dlg:left="185" dlg:top="41" dlg:width="45" dlg:height="8" dlg:value="&amp;6.DlgMain.txtPlayerLevel.Label"/>
<dlg:menulist dlg:id="lstPlayerLevel" dlg:tab-index="4" dlg:left="230" dlg:top="39" dlg:width="30" dlg:height="12" dlg:spin="true" dlg:linecount="20">
<dlg:menupopup>
<dlg:menuitem dlg:value="1"/>
<dlg:menuitem dlg:value="2"/>
@ -253,34 +253,34 @@
<dlg:menuitem dlg:value="40"/>
</dlg:menupopup>
</dlg:menulist>
<dlg:checkbox dlg:id="cbxIsNew" dlg:tab-index="5" dlg:left="5" dlg:top="58" dlg:width="225" dlg:height="10" dlg:value="&amp;7.DlgMain.cbxIsNew.Label" dlg:checked="true"/>
<dlg:titledbox dlg:id="grpAppraisals" dlg:tab-index="21" dlg:left="5" dlg:top="75" dlg:width="240" dlg:height="150">
<dlg:checkbox dlg:id="cbxIsNew" dlg:tab-index="5" dlg:left="5" dlg:top="56" dlg:width="255" dlg:height="8" dlg:value="&amp;7.DlgMain.cbxIsNew.Label" dlg:checked="true"/>
<dlg:titledbox dlg:id="grpAppraisals" dlg:tab-index="21" dlg:left="5" dlg:top="70" dlg:width="255" dlg:height="140">
<dlg:title dlg:value="&amp;8.DlgMain.grpAppraisals.Label"/>
</dlg:titledbox>
<dlg:img dlg:style-id="0" dlg:id="imgTeamLogo" dlg:tab-index="24" dlg:left="10" dlg:top="92" dlg:width="30" dlg:height="30"/>
<dlg:img dlg:style-id="0" dlg:id="imgTeamLogo" dlg:tab-index="25" dlg:left="10" dlg:top="80" dlg:width="30" dlg:height="30"/>
<dlg:radiogroup>
<dlg:radio dlg:style-id="1" dlg:id="rdoTeamValor" dlg:tab-index="6" dlg:left="45" dlg:top="90" dlg:width="60" dlg:height="10" dlg:value="&amp;9.DlgMain.rdoTeamValor.Label" dlg:valign="center">
<dlg:radio dlg:style-id="1" dlg:id="rdoTeamValor" dlg:tab-index="6" dlg:left="45" dlg:top="100" dlg:width="60" dlg:height="10" dlg:value="&amp;9.DlgMain.rdoTeamValor.Label" dlg:valign="center">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subRdoTeamValorItemChanged?language=Basic&amp;location=application" script:language="Script"/>
</dlg:radio>
<dlg:radio dlg:style-id="2" dlg:id="rdoTeamMystic" dlg:tab-index="7" dlg:left="111" dlg:top="90" dlg:width="60" dlg:height="10" dlg:value="&amp;10.DlgMain.rdoTeamMystic.Label" dlg:valign="center">
<dlg:radio dlg:style-id="2" dlg:id="rdoTeamMystic" dlg:tab-index="7" dlg:left="120" dlg:top="100" dlg:width="60" dlg:height="10" dlg:value="&amp;10.DlgMain.rdoTeamMystic.Label" dlg:valign="center">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subRdoTeamMysticItemChanged?language=Basic&amp;location=application" script:language="Script"/>
</dlg:radio>
<dlg:radio dlg:style-id="3" dlg:id="rdoTeamInstinct" dlg:tab-index="8" dlg:left="177" dlg:top="90" dlg:width="60" dlg:height="10" dlg:value="&amp;11.DlgMain.rdoTeamInstinct.Label" dlg:valign="center">
<dlg:radio dlg:style-id="3" dlg:id="rdoTeamInstinct" dlg:tab-index="8" dlg:left="195" dlg:top="100" dlg:width="60" dlg:height="10" dlg:value="&amp;11.DlgMain.rdoTeamInstinct.Label" dlg:valign="center">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subRdoTeamInstinctItemChanged?language=Basic&amp;location=application" script:language="Script"/>
</dlg:radio>
</dlg:radiogroup>
<dlg:img dlg:style-id="0" dlg:id="imgTeamLeader" dlg:tab-index="27" dlg:left="10" dlg:top="125" dlg:width="30" dlg:height="35"/>
<dlg:text dlg:id="txtLeaderAppraise" dlg:tab-index="26" dlg:left="45" dlg:top="108" dlg:width="192" dlg:height="10"/>
<dlg:menulist dlg:id="lstTotal" dlg:tab-index="9" dlg:left="45" dlg:top="121" dlg:width="192" dlg:height="16" dlg:spin="true"/>
<dlg:text dlg:id="txtBestBefore" dlg:tab-index="22" dlg:left="45" dlg:top="147" dlg:width="20" dlg:height="10"/>
<dlg:menulist dlg:id="lstBest" dlg:tab-index="10" dlg:left="69" dlg:top="143" dlg:width="54" dlg:height="16" dlg:spin="true">
<dlg:img dlg:style-id="0" dlg:id="imgTeamLeader" dlg:tab-index="28" dlg:left="10" dlg:top="110" dlg:width="30" dlg:height="35"/>
<dlg:text dlg:id="txtLeaderAppraise" dlg:tab-index="27" dlg:left="45" dlg:top="116" dlg:width="210" dlg:height="8"/>
<dlg:menulist dlg:id="lstTotal" dlg:tab-index="9" dlg:left="45" dlg:top="129" dlg:width="210" dlg:height="12" dlg:spin="true"/>
<dlg:text dlg:id="txtBestBefore" dlg:tab-index="23" dlg:left="45" dlg:top="146" dlg:width="20" dlg:height="8"/>
<dlg:menulist dlg:id="lstBest" dlg:tab-index="10" dlg:left="65" dlg:top="144" dlg:width="58" dlg:height="12" dlg:spin="true">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subLstBestItemChanged?language=Basic&amp;location=application" script:language="Script"/>
</dlg:menulist>
<dlg:text dlg:id="txtBestAfter" dlg:tab-index="23" dlg:left="125" dlg:top="147" dlg:width="112" dlg:height="10"/>
<dlg:checkbox dlg:id="cbxBest2" dlg:tab-index="11" dlg:left="45" dlg:top="165" dlg:width="192" dlg:height="10" dlg:checked="false"/>
<dlg:checkbox dlg:id="cbxBest3" dlg:tab-index="12" dlg:left="45" dlg:top="183" dlg:width="192" dlg:height="10" dlg:checked="false"/>
<dlg:menulist dlg:id="lstMax" dlg:tab-index="13" dlg:left="45" dlg:top="202" dlg:width="192" dlg:height="16" dlg:spin="true"/>
<dlg:button dlg:id="btnOK" dlg:tab-index="14" dlg:disabled="true" dlg:left="40" dlg:top="230" dlg:width="60" dlg:height="16" dlg:default="true" dlg:button-type="ok"/>
<dlg:button dlg:id="btnCancel" dlg:tab-index="15" dlg:left="144" dlg:top="230" dlg:width="60" dlg:height="16" dlg:button-type="cancel"/>
<dlg:text dlg:id="txtBestAfter" dlg:tab-index="24" dlg:left="110" dlg:top="146" dlg:width="100" dlg:height="8"/>
<dlg:checkbox dlg:id="cbxBest2" dlg:tab-index="11" dlg:left="45" dlg:top="161" dlg:width="210" dlg:height="8" dlg:checked="false"/>
<dlg:checkbox dlg:id="cbxBest3" dlg:tab-index="12" dlg:left="45" dlg:top="176" dlg:width="210" dlg:height="8" dlg:checked="false"/>
<dlg:menulist dlg:id="lstMax" dlg:tab-index="13" dlg:left="45" dlg:top="189" dlg:width="210" dlg:height="12" dlg:spin="true"/>
<dlg:button dlg:id="btnOK" dlg:tab-index="14" dlg:disabled="true" dlg:left="45" dlg:top="215" dlg:width="60" dlg:height="15" dlg:default="true" dlg:button-type="ok"/>
<dlg:button dlg:id="btnCancel" dlg:tab-index="15" dlg:left="145" dlg:top="215" dlg:width="60" dlg:height="15" dlg:button-type="cancel"/>
</dlg:bulletinboard>
</dlg:window>