Fixed so that the "OK" butten is only enabled when all the Pokémon, CP, HP, star dust are filled.
This commit is contained in:
parent
12e4cd3052
commit
c3e70ddff9
@ -437,6 +437,7 @@ Function fnAskParam0 As aFindIVParam
|
||||
oButtonModel.setPropertyValue ("PushButtonType", _
|
||||
com.sun.star.awt.PushButtonType.OK)
|
||||
oButtonModel.setPropertyValue ("DefaultButton", True)
|
||||
oButtonModel.setPropertyValue ("Enabled", False)
|
||||
oDialogModel.insertByName ("btnOK", oButtonModel)
|
||||
|
||||
' Adds the cancel button.
|
||||
@ -455,6 +456,18 @@ Function fnAskParam0 As aFindIVParam
|
||||
oDialog.setModel (oDialogModel)
|
||||
oDialog.setVisible (True)
|
||||
oDialog.getControl ("lstPokemon").setFocus
|
||||
oListener = CreateUnoListener ("subBtnOKCheck_", _
|
||||
"com.sun.star.awt.XItemListener")
|
||||
oDialog.getControl ("lstPokemon").addItemListener (oListener)
|
||||
oListener = CreateUnoListener ("subBtnOKCheck_", _
|
||||
"com.sun.star.awt.XTextListener")
|
||||
oDialog.getControl ("numCP").addTextListener (oListener)
|
||||
oListener = CreateUnoListener ("subBtnOKCheck_", _
|
||||
"com.sun.star.awt.XTextListener")
|
||||
oDialog.getControl ("numHP").addTextListener (oListener)
|
||||
oListener = CreateUnoListener ("subBtnOKCheck_", _
|
||||
"com.sun.star.awt.XItemListener")
|
||||
oDialog.getControl ("lstStarDust").addItemListener (oListener)
|
||||
oListener = CreateUnoListener ("subRdoTeamRedItemChanged_", _
|
||||
"com.sun.star.awt.XItemListener")
|
||||
oDialog.getControl ("rdoTeamRed").addItemListener (oListener)
|
||||
@ -541,6 +554,38 @@ Function fnAskParam0 As aFindIVParam
|
||||
fnAskParam0 = aQuery
|
||||
End Function
|
||||
|
||||
' subBtnOKCheck_disposing: Dummy for the listener.
|
||||
Sub subBtnOKCheck_disposing (oEvent As object)
|
||||
End Sub
|
||||
|
||||
' subBtnOKCheck_itemStateChanged: When the Pokémon or star dust is selected.
|
||||
Sub subBtnOKCheck_itemStateChanged (oEvent As object)
|
||||
Dim oDialog As Object
|
||||
Dim oPokemon As Object, oCP As Object
|
||||
Dim oHP As Object, oStarDust As Object, oOK As Object
|
||||
|
||||
oDialog = oEvent.Source.getContext
|
||||
oPokemon = oDialog.getControl ("lstPokemon")
|
||||
oCP = oDialog.getControl ("numCP")
|
||||
oHP = oDialog.getControl ("numHP")
|
||||
oStarDust = oDialog.getControl ("lstStarDust")
|
||||
oOK = oDialog.getControl ("btnOK")
|
||||
|
||||
If oPokemon.getSelectedItemPos <> -1 _
|
||||
And oCP.getText <> "" _
|
||||
And oHP.getText <> "" _
|
||||
And oStarDust.getSelectedItemPos <> -1 Then
|
||||
oOK.setEnable (True)
|
||||
Else
|
||||
oOK.setEnable (False)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' subBtnOKCheck_textChanged: When the CP or HP is filled
|
||||
Sub subBtnOKCheck_textChanged (oEvent As object)
|
||||
subBtnOKCheck_itemStateChanged (oEvent)
|
||||
End Sub
|
||||
|
||||
' subRdoTeamRedItemChanged_disposing: Dummy for the listener.
|
||||
Sub subRdoTeamRedItemChanged_disposing (oEvent As object)
|
||||
End Sub
|
||||
@ -550,12 +595,13 @@ Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object)
|
||||
Dim oDialog As Object, oList As Object, oText As Object
|
||||
Dim mItems () As String
|
||||
|
||||
oDialog = oEvent.Source.getContext
|
||||
|
||||
mItems = Array ( _
|
||||
"Overall, your [Pokémon] simply amazes me. It can accomplish anything!", _
|
||||
"Overall, your [Pokémon] is a strong Pokémon. You should be proud!", _
|
||||
"Overall, your [Pokémon] is a decent Pokémon.", _
|
||||
"Overall, your [Pokémon] may not be great in battle, but I still like it!")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal1")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
@ -592,7 +638,6 @@ Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object)
|
||||
"It's got excellent stats! How exciting!", _
|
||||
"Its stats indicate that in battle, it'll get the job done.", _
|
||||
"Its stats don't point to greatness in battle.")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal2")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
@ -608,12 +653,13 @@ Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object)
|
||||
Dim oDialog As Object, oList As Object, oText As Object
|
||||
Dim mItems () As String
|
||||
|
||||
oDialog = oEvent.Source.getContext
|
||||
|
||||
mItems = Array ( _
|
||||
"Overall, your [Pokémon] is a wonder! What a breathtaking Pokémon!", _
|
||||
"Overall, your [Pokémon] has certainly caught my attention.", _
|
||||
"Overall, your [Pokémon] is above average.", _
|
||||
"Overall, your [Pokémon] is not likely to make much headway in battle.")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal1")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
@ -650,7 +696,6 @@ Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object)
|
||||
"I am certainly impressed by its stats, I must say.", _
|
||||
"Its stats are noticeably trending to the positive.", _
|
||||
"Its stats are not out of the norm, in my opinion.")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal2")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
@ -666,12 +711,13 @@ Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object)
|
||||
Dim oDialog As Object, oList As Object, oText As Object
|
||||
Dim mItems () As String
|
||||
|
||||
oDialog = oEvent.Source.getContext
|
||||
|
||||
mItems = Array ( _
|
||||
"Overall, your [Pokémon] looks like it can really battle with the best of them!", _
|
||||
"Overall, your [Pokémon] is really strong!", _
|
||||
"Overall, your [Pokémon] is pretty decent!", _
|
||||
"Overall, your [Pokémon] has room for improvement as far as battling goes.")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal1")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
@ -708,7 +754,6 @@ Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object)
|
||||
"Its stats are really strong! Impressive.", _
|
||||
"It's definitely got some good stats. Definitely!", _
|
||||
"Its stats are all right, but kinda basic, as far as I can see.")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal2")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
|
@ -439,6 +439,7 @@ Function fnAskParam0 As aFindIVParam
|
||||
oButtonModel.setPropertyValue ("PushButtonType", _
|
||||
com.sun.star.awt.PushButtonType.OK)
|
||||
oButtonModel.setPropertyValue ("DefaultButton", True)
|
||||
oButtonModel.setPropertyValue ("Enabled", False)
|
||||
oDialogModel.insertByName ("btnOK", oButtonModel)
|
||||
|
||||
' Adds the cancel button.
|
||||
@ -457,6 +458,18 @@ Function fnAskParam0 As aFindIVParam
|
||||
oDialog.setModel (oDialogModel)
|
||||
oDialog.setVisible (True)
|
||||
oDialog.getControl ("lstPokemon").setFocus
|
||||
oListener = CreateUnoListener ("subBtnOKCheck_", _
|
||||
"com.sun.star.awt.XItemListener")
|
||||
oDialog.getControl ("lstPokemon").addItemListener (oListener)
|
||||
oListener = CreateUnoListener ("subBtnOKCheck_", _
|
||||
"com.sun.star.awt.XTextListener")
|
||||
oDialog.getControl ("numCP").addTextListener (oListener)
|
||||
oListener = CreateUnoListener ("subBtnOKCheck_", _
|
||||
"com.sun.star.awt.XTextListener")
|
||||
oDialog.getControl ("numHP").addTextListener (oListener)
|
||||
oListener = CreateUnoListener ("subBtnOKCheck_", _
|
||||
"com.sun.star.awt.XItemListener")
|
||||
oDialog.getControl ("lstStarDust").addItemListener (oListener)
|
||||
oListener = CreateUnoListener ("subRdoTeamRedItemChanged_", _
|
||||
"com.sun.star.awt.XItemListener")
|
||||
oDialog.getControl ("rdoTeamRed").addItemListener (oListener)
|
||||
@ -543,6 +556,38 @@ Function fnAskParam0 As aFindIVParam
|
||||
fnAskParam0 = aQuery
|
||||
End Function
|
||||
|
||||
' subBtnOKCheck_disposing: Dummy for the listener.
|
||||
Sub subBtnOKCheck_disposing (oEvent As object)
|
||||
End Sub
|
||||
|
||||
' subBtnOKCheck_itemStateChanged: When the Pokémon or star dust is selected.
|
||||
Sub subBtnOKCheck_itemStateChanged (oEvent As object)
|
||||
Dim oDialog As Object
|
||||
Dim oPokemon As Object, oCP As Object
|
||||
Dim oHP As Object, oStarDust As Object, oOK As Object
|
||||
|
||||
oDialog = oEvent.Source.getContext
|
||||
oPokemon = oDialog.getControl ("lstPokemon")
|
||||
oCP = oDialog.getControl ("numCP")
|
||||
oHP = oDialog.getControl ("numHP")
|
||||
oStarDust = oDialog.getControl ("lstStarDust")
|
||||
oOK = oDialog.getControl ("btnOK")
|
||||
|
||||
If oPokemon.getSelectedItemPos <> -1 _
|
||||
And oCP.getText <> "" _
|
||||
And oHP.getText <> "" _
|
||||
And oStarDust.getSelectedItemPos <> -1 Then
|
||||
oOK.setEnable (True)
|
||||
Else
|
||||
oOK.setEnable (False)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' subBtnOKCheck_textChanged: When the CP or HP is filled
|
||||
Sub subBtnOKCheck_textChanged (oEvent As object)
|
||||
subBtnOKCheck_itemStateChanged (oEvent)
|
||||
End Sub
|
||||
|
||||
' subRdoTeamRedItemChanged_disposing: Dummy for the listener.
|
||||
Sub subRdoTeamRedItemChanged_disposing (oEvent As object)
|
||||
End Sub
|
||||
@ -552,12 +597,13 @@ Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object)
|
||||
Dim oDialog As Object, oList As Object, oText As Object
|
||||
Dim mItems () As String
|
||||
|
||||
oDialog = oEvent.Source.getContext
|
||||
|
||||
mItems = Array ( _
|
||||
"Overall, your [Pokémon] simply amazes me. It can accomplish anything!", _
|
||||
"Overall, your [Pokémon] is a strong Pokémon. You should be proud!", _
|
||||
"Overall, your [Pokémon] is a decent Pokémon.", _
|
||||
"Overall, your [Pokémon] may not be great in battle, but I still like it!")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal1")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
@ -594,7 +640,6 @@ Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object)
|
||||
"It's got excellent stats! How exciting!", _
|
||||
"Its stats indicate that in battle, it'll get the job done.", _
|
||||
"Its stats don't point to greatness in battle.")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal2")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
@ -610,12 +655,13 @@ Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object)
|
||||
Dim oDialog As Object, oList As Object, oText As Object
|
||||
Dim mItems () As String
|
||||
|
||||
oDialog = oEvent.Source.getContext
|
||||
|
||||
mItems = Array ( _
|
||||
"Overall, your [Pokémon] is a wonder! What a breathtaking Pokémon!", _
|
||||
"Overall, your [Pokémon] has certainly caught my attention.", _
|
||||
"Overall, your [Pokémon] is above average.", _
|
||||
"Overall, your [Pokémon] is not likely to make much headway in battle.")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal1")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
@ -652,7 +698,6 @@ Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object)
|
||||
"I am certainly impressed by its stats, I must say.", _
|
||||
"Its stats are noticeably trending to the positive.", _
|
||||
"Its stats are not out of the norm, in my opinion.")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal2")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
@ -668,12 +713,13 @@ Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object)
|
||||
Dim oDialog As Object, oList As Object, oText As Object
|
||||
Dim mItems () As String
|
||||
|
||||
oDialog = oEvent.Source.getContext
|
||||
|
||||
mItems = Array ( _
|
||||
"Overall, your [Pokémon] looks like it can really battle with the best of them!", _
|
||||
"Overall, your [Pokémon] is really strong!", _
|
||||
"Overall, your [Pokémon] is pretty decent!", _
|
||||
"Overall, your [Pokémon] has room for improvement as far as battling goes.")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal1")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
@ -710,7 +756,6 @@ Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object)
|
||||
"Its stats are really strong! Impressive.", _
|
||||
"It's definitely got some good stats. Definitely!", _
|
||||
"Its stats are all right, but kinda basic, as far as I can see.")
|
||||
oDialog = oEvent.Source.getContext
|
||||
oList = oDialog.getControl ("lstApprasal2")
|
||||
oList.removeItems (0, oList.getItemCount())
|
||||
oList.addItems (mItems, 0)
|
||||
|
@ -163,11 +163,16 @@
|
||||
<dlg:menuitem dlg:value="Mewtwo"/>
|
||||
<dlg:menuitem dlg:value="Mew"/>
|
||||
</dlg:menupopup>
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subBtnOKCheck_itemStateChanged?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
<dlg:text dlg:id="txtCP" dlg:tab-index="17" dlg:left="5" dlg:top="21" dlg:width="15" dlg:height="8" dlg:help-text="&26.DlgMain.txtCP.HelpText" dlg:value="&27.DlgMain.txtCP.Label"/>
|
||||
<dlg:numericfield dlg:id="numCP" dlg:tab-index="1" dlg:left="20" dlg:top="19" dlg:width="20" dlg:height="12" dlg:help-text="&28.DlgMain.numCP.HelpText" dlg:decimal-accuracy="0" dlg:value-min="10" dlg:value-max="5000"/>
|
||||
<dlg:numericfield dlg:id="numCP" dlg:tab-index="1" dlg:left="20" dlg:top="19" dlg:width="20" dlg:height="12" dlg:help-text="&28.DlgMain.numCP.HelpText" 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_textChanged?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:numericfield>
|
||||
<dlg:text dlg:id="txtHP" dlg:tab-index="18" dlg:left="50" dlg:top="21" dlg:width="15" dlg:height="8" dlg:help-text="&29.DlgMain.txtHP.HelpText" dlg:value="&30.DlgMain.txtHP.Label"/>
|
||||
<dlg:numericfield dlg:id="numHP" dlg:tab-index="2" dlg:left="65" dlg:top="19" dlg:width="15" dlg:height="12" dlg:help-text="&31.DlgMain.numHP.HelpText" dlg:decimal-accuracy="0" dlg:value-min="0" dlg:value-max="200"/>
|
||||
<dlg:numericfield dlg:id="numHP" dlg:tab-index="2" dlg:left="65" dlg:top="19" dlg:width="15" dlg:height="12" dlg:help-text="&31.DlgMain.numHP.HelpText" dlg:decimal-accuracy="0" dlg:value-min="0" dlg:value-max="200">
|
||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subBtnOKCheck_textChanged?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:numericfield>
|
||||
<dlg:text dlg:id="txtStarDust" dlg:tab-index="19" dlg:left="90" dlg:top="21" dlg:width="30" dlg:height="8" dlg:help-text="&32.DlgMain.txtStarDust.HelpText" dlg:value="&33.DlgMain.txtStarDust.Label"/>
|
||||
<dlg:menulist dlg:id="lstStarDust" dlg:tab-index="3" dlg:left="120" dlg:top="19" dlg:width="30" dlg:height="12" dlg:help-text="&162.DlgMain.lstStarDust.HelpText" dlg:spin="true">
|
||||
<dlg:menupopup>
|
||||
@ -192,6 +197,7 @@
|
||||
<dlg:menuitem dlg:value="9000"/>
|
||||
<dlg:menuitem dlg:value="10000"/>
|
||||
</dlg:menupopup>
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subBtnOKCheck_itemStateChanged?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
<dlg:text dlg:id="txtPlayerLevel" dlg:tab-index="20" dlg:left="160" dlg:top="21" dlg:width="35" dlg:height="8" dlg:help-text="&40.DlgMain.txtPlayerLevel.HelpText" dlg:value="&41.DlgMain.txtPlayerLevel.Label"/>
|
||||
<dlg:menulist dlg:id="lstPlayerLevel" dlg:tab-index="4" dlg:left="195" dlg:top="19" dlg:width="20" dlg:height="12" dlg:help-text="&163.DlgMain.lstPlayerLevel.HelpText" dlg:spin="true">
|
||||
@ -263,7 +269,7 @@
|
||||
<dlg:checkbox dlg:id="cbxBest2" dlg:tab-index="11" dlg:left="10" dlg:top="111" dlg:width="200" dlg:height="8" dlg:help-text="&201.DlgMain.cbxBest2.HelpText" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="cbxBest3" dlg:tab-index="12" dlg:left="10" dlg:top="126" dlg:width="200" dlg:height="8" dlg:help-text="&203.DlgMain.cbxBest3.HelpText" dlg:checked="false"/>
|
||||
<dlg:menulist dlg:id="lstApprasal2" dlg:tab-index="13" dlg:left="10" dlg:top="139" dlg:width="200" dlg:height="12" dlg:help-text="&165.DlgMain.lstApprasal2.HelpText" dlg:spin="true"/>
|
||||
<dlg:button dlg:id="btnOK" dlg:tab-index="14" dlg:left="35" dlg:top="165" dlg:width="60" dlg:height="15" dlg:help-text="&85.DlgMain.btnOK.HelpText" dlg:default="true" dlg:button-type="ok"/>
|
||||
<dlg:button dlg:id="btnOK" dlg:tab-index="14" dlg:disabled="true" dlg:left="35" dlg:top="165" dlg:width="60" dlg:height="15" dlg:help-text="&85.DlgMain.btnOK.HelpText" dlg:default="true" dlg:button-type="ok"/>
|
||||
<dlg:button dlg:id="btnCancel" dlg:tab-index="15" dlg:left="125" dlg:top="165" dlg:width="60" dlg:height="15" dlg:help-text="&87.DlgMain.btnCancel.HelpText" dlg:button-type="cancel"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
@ -4,5 +4,4 @@
|
||||
<library:element library:name="0Main"/>
|
||||
<library:element library:name="1Data"/>
|
||||
<library:element library:name="9Load"/>
|
||||
<library:element library:name="2Data"/>
|
||||
</library:library>
|
Loading…
Reference in New Issue
Block a user