Added first uno control image.

This commit is contained in:
2016-12-07 01:50:28 +08:00
parent 296cfe3baa
commit a8787c38f0
21 changed files with 683 additions and 7 deletions

View File

@ -1,6 +1,20 @@
<?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="0Main" script:language="StarBasic">&apos; 0Main: The main module for the Pokémon GO IV calculator
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="0Main" script:language="StarBasic">&apos; Copyright (c) 2016 imacat.
&apos;
&apos; Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
&apos; you may not use this file except in compliance with the License.
&apos; You may obtain a copy of the License at
&apos;
&apos; http://www.apache.org/licenses/LICENSE-2.0
&apos;
&apos; Unless required by applicable law or agreed to in writing, software
&apos; distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
&apos; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
&apos; See the License for the specific language governing permissions and
&apos; limitations under the License.
&apos; 0Main: The main module for the Pokémon GO IV calculator
&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-27
Option Explicit
@ -81,6 +95,9 @@ Function fnAskParam As aFindIVParam
oDialog.getControl (&quot;cbxBest3&quot;).setVisible (False)
oDialog.getControl (&quot;lstApprasal2&quot;).setVisible (False)
&apos; TODO: To be removed.
oDialog.getControl (&quot;imgTeam&quot;).getModel.setPropertyValue (&quot;ImageURL&quot;, fnGetImageUrl (&quot;TeamValor&quot;))
If oDialog.execute = 0 Then
aQuery.bIsCancelled = True
fnAskParam = aQuery

View File

@ -1,6 +1,20 @@
<?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="1Data" script:language="StarBasic">&apos; 1Data: The Pokémon GO data for IV calculation
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="1Data" script:language="StarBasic">&apos; Copyright (c) 2016 imacat.
&apos;
&apos; Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
&apos; you may not use this file except in compliance with the License.
&apos; You may obtain a copy of the License at
&apos;
&apos; http://www.apache.org/licenses/LICENSE-2.0
&apos;
&apos; Unless required by applicable law or agreed to in writing, software
&apos; distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
&apos; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
&apos; See the License for the specific language governing permissions and
&apos; limitations under the License.
&apos; 1Data: The Pokémon GO data for IV calculation
&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-12-06
&apos; Generated with 9Load.subReadDataSheets ()

View File

@ -0,0 +1,58 @@
<?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="8Registry" script:language="StarBasic">&apos; 8Registry: Utilities used from other modules to access to PokemonGoIV private configuration
&apos; Taken from TextToColumns, 2016-12-07
Option Explicit
Const BASE_KEY As String = &quot;/org.openoffice.Office.Addons.PokemonGoIV.AddonConfiguration/&quot;
&apos; fnGetImageUrl: Returns the image URL for the UNO image controls.
Function fnGetImageUrl (sName As String) As String
Dim oRegKey As Object
oRegKey = fnGetRegistryKeyContent (BASE_KEY &amp; &quot;FileResources/&quot; &amp; sName)
fnGetImageUrl = fnExpandMacroFieldExpression (oRegKey.Url)
End Function
&apos; fnGetRegistryKeyContent: Returns the registry key content
Function fnGetRegistryKeyContent (sKeyName as string, Optional bforUpdate as Boolean)
Dim oConfigProvider As Object
Dim aNodePath (0) As New com.sun.star.beans.PropertyValue
oConfigProvider = createUnoService ( _
&quot;com.sun.star.configuration.ConfigurationProvider&quot;)
aNodePath(0).Name = &quot;nodepath&quot;
aNodePath(0).Value = sKeyName
If IsMissing (bForUpdate) Then
fnGetRegistryKeyContent = oConfigProvider.createInstanceWithArguments (&quot;com.sun.star.configuration.ConfigurationAccess&quot;, aNodePath())
Else
If bForUpdate Then
fnGetRegistryKeyContent = oConfigProvider.createInstanceWithArguments (&quot;com.sun.star.configuration.ConfigurationUpdateAccess&quot;, aNodePath())
Else
fnGetRegistryKeyContent = oConfigProvider.createInstanceWithArguments (&quot;com.sun.star.configuration.ConfigurationAccess&quot;, aNodePath())
End If
End If
End Function
&apos; fnExpandMacroFieldExpression
Function fnExpandMacroFieldExpression (sURL As String) As String
Dim sTemp As String
Dim oSM As Object
Dim oMacroExpander As Object
&apos; Gets the service manager
oSM = getProcessServiceManager
&apos; Gets the macro expander
oMacroExpander = oSM.DefaultContext.getValueByName ( _
&quot;/singletons/com.sun.star.util.theMacroExpander&quot;)
&apos;cut the vnd.sun.star.expand: part
sTemp = Join (Split (sURL, &quot;vnd.sun.star.expand:&quot;))
&apos;Expand the macrofield expression
sTemp = oMacroExpander.ExpandMacros (sTemp)
sTemp = Trim (sTemp)
fnExpandMacroFieldExpression = sTemp
End Function
</script:module>

View File

@ -1,6 +1,20 @@
<?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="9Load" script:language="StarBasic">&apos; 9Load: The Pokémon GO data sheets loader
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="9Load" script:language="StarBasic">&apos; Copyright (c) 2016 imacat.
&apos;
&apos; Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
&apos; you may not use this file except in compliance with the License.
&apos; You may obtain a copy of the License at
&apos;
&apos; http://www.apache.org/licenses/LICENSE-2.0
&apos;
&apos; Unless required by applicable law or agreed to in writing, software
&apos; distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
&apos; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
&apos; See the License for the specific language governing permissions and
&apos; limitations under the License.
&apos; 9Load: The Pokémon GO data sheets loader
&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-28
Option Explicit
@ -11,6 +25,20 @@ Sub subReadDataSheets
Dim sOutput as String, mData As Variant
sOutput = &quot;&quot; _
&amp; &quot;&apos; Copyright (c) 2016 imacat.&quot; &amp; Chr (10) _
&amp; &quot;&apos; &quot; &amp; Chr (10) _
&amp; &quot;&apos; Licensed under the Apache License, Version 2.0 (the &quot;&quot;License&quot;&quot;);&quot; &amp; Chr (10) _
&amp; &quot;&apos; you may not use this file except in compliance with the License.&quot; &amp; Chr (10) _
&amp; &quot;&apos; You may obtain a copy of the License at&quot; &amp; Chr (10) _
&amp; &quot;&apos; &quot; &amp; Chr (10) _
&amp; &quot;&apos; http://www.apache.org/licenses/LICENSE-2.0&quot; &amp; Chr (10) _
&amp; &quot;&apos; &quot; &amp; Chr (10) _
&amp; &quot;&apos; Unless required by applicable law or agreed to in writing, software&quot; &amp; Chr (10) _
&amp; &quot;&apos; distributed under the License is distributed on an &quot;&quot;AS IS&quot;&quot; BASIS,&quot; &amp; Chr (10) _
&amp; &quot;&apos; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&quot; &amp; Chr (10) _
&amp; &quot;&apos; See the License for the specific language governing permissions and&quot; &amp; Chr (10) _
&amp; &quot;&apos; limitations under the License.&quot; &amp; Chr (10) _
&amp; Chr (10) _
&amp; &quot;&apos; 1Data: The Pokémon GO data for IV calculation&quot; &amp; Chr (10) _
&amp; &quot;&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, &quot; &amp; Format (Date (), &quot;yyyy-mm-dd&quot;) &amp; Chr (10) _
&amp; &quot;&apos; Generated with 9Load.subReadDataSheets ()&quot; &amp; Chr (10) _

View File

@ -1,8 +1,8 @@
# Strings for Dialog Library PokemonGoIV
2.DlgMain.HelpText=
3.DlgMain.Title=Pok\u00c3\u00a9mon GO IV Calculator
3.DlgMain.Title=Pok\u00e9mon GO IV Calculator
22.DlgMain.txtPokemon.HelpText=
23.DlgMain.txtPokemon.Label=~Pok\u00c3\u00a9mon:
23.DlgMain.txtPokemon.Label=~Pok\u00e9mon:
26.DlgMain.txtCP.HelpText=
27.DlgMain.txtCP.Label=~CP:
28.DlgMain.numCP.HelpText=
@ -14,7 +14,7 @@
40.DlgMain.txtPlayerLevel.HelpText=
41.DlgMain.txtPlayerLevel.Label=Player ~level:
46.DlgMain.cbxIsNew.HelpText=
47.DlgMain.cbxIsNew.Label=This Pok\u00c3\u00a9mon is ~newly-caught and was not powered-up yet.
47.DlgMain.cbxIsNew.Label=This Pok\u00e9mon has not been powered-up yet.
50.DlgMain.grpApprasals.HelpText=
51.DlgMain.grpApprasals.Label=Team Leader Apprasal
85.DlgMain.btnOK.HelpText=
@ -39,3 +39,5 @@
195.DlgMain.txtBestAfter.HelpText=
201.DlgMain.cbxBest2.HelpText=
203.DlgMain.cbxBest3.HelpText=
205.DlgMain.imgTeam.HelpText=
207.DlgMain.imgTeam.HelpText=

View File

@ -14,7 +14,7 @@
40.DlgMain.txtPlayerLevel.HelpText=
41.DlgMain.txtPlayerLevel.Label=\u73a9\u5bb6\u7b49\u7d1a(~L)\uff1a
46.DlgMain.cbxIsNew.HelpText=
47.DlgMain.cbxIsNew.Label=\u6211\u525b\u6293\u5230\u9019\u96bb\u5bf6\u53ef\u5922\uff0c\u9084\u6c92\u5f37\u5316\u904e(~N)\u3002
47.DlgMain.cbxIsNew.Label=\u9019\u96bb\u5bf6\u53ef\u5922\u9084\u6c92\u5f37\u5316\u904e(~N)\u3002
50.DlgMain.grpApprasals.HelpText=
51.DlgMain.grpApprasals.Label=\u968a\u9577\u8a55\u50f9
85.DlgMain.btnOK.HelpText=
@ -39,3 +39,5 @@
195.DlgMain.txtBestAfter.HelpText=
201.DlgMain.cbxBest2.HelpText=
203.DlgMain.cbxBest3.HelpText=
205.DlgMain.imgTeam.HelpText=
207.DlgMain.imgTeam.HelpText=

View File

@ -5,6 +5,7 @@
<dlg:style dlg:style-id="0" dlg:background-color="0xff0000" dlg:text-color="0xffffff" dlg:font-weight="100"/>
<dlg:style dlg:style-id="1" dlg:background-color="0xff" dlg:text-color="0xffffff"/>
<dlg:style dlg:style-id="2" dlg:background-color="0xffff00"/>
<dlg:style dlg:style-id="3" dlg:border="none"/>
</dlg:styles>
<dlg:bulletinboard>
<dlg:text dlg:id="txtPokemon" dlg:tab-index="16" dlg:left="5" dlg:top="6" dlg:width="30" dlg:height="8" dlg:help-text="&amp;22.DlgMain.txtPokemon.HelpText" dlg:value="&amp;23.DlgMain.txtPokemon.Label"/>
@ -260,6 +261,7 @@
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subRdoTeamYellowItemChanged_itemStateChanged?language=Basic&amp;location=application" script:language="Script"/>
</dlg:radio>
</dlg:radiogroup>
<dlg:img dlg:style-id="3" dlg:id="imgTeam" dlg:tab-index="25" dlg:left="130" dlg:top="55" dlg:width="20" dlg:height="20" dlg:help-text="&amp;207.DlgMain.imgTeam.HelpText"/>
<dlg:menulist dlg:id="lstApprasal1" dlg:tab-index="9" dlg:left="10" dlg:top="79" dlg:width="200" dlg:height="12" dlg:help-text="&amp;164.DlgMain.lstApprasal1.HelpText" dlg:spin="true"/>
<dlg:text dlg:id="txtBestBefore" dlg:tab-index="23" dlg:left="10" dlg:top="96" dlg:width="20" dlg:height="8" dlg:help-text="&amp;194.DlgMain.txtBestBefore.HelpText"/>
<dlg:menulist dlg:id="lstBest" dlg:tab-index="10" dlg:left="30" dlg:top="94" dlg:width="35" dlg:height="12" dlg:help-text="&amp;193.DlgMain.lstBest.HelpText" dlg:spin="true">

View File

@ -4,4 +4,5 @@
<library:element library:name="0Main"/>
<library:element library:name="1Data"/>
<library:element library:name="9Load"/>
<library:element library:name="8Registry"/>
</library:library>