Hey,
also ich hab vor ein Dropdownmenü zu erstellen, in dem zb.
Bild1.
Bild2.
Bild3.
unsoweiter auszuwählen sind.
sobald ich das ausgewählt habe,soll er das image in der gui anzeigen.
wie kann man sowas am besten umsetzen?
gruß
Kev
Hey,
also ich hab vor ein Dropdownmenü zu erstellen, in dem zb.
Bild1.
Bild2.
Bild3.
unsoweiter auszuwählen sind.
sobald ich das ausgewählt habe,soll er das image in der gui anzeigen.
wie kann man sowas am besten umsetzen?
gruß
Kev
Sollen in derm Dropdown Menü die Bilder
schon angezeigt werden oder nur der Text?
Denn mit Bildern darin glaube ich nicht, dass
es geht.
MfG
qixx
nur der text,
wie gesagt.
dropdown, wo man zwischen bild 1 , bild 2, bild 3 auswählt und sobald man das tut, drunter das bild angezeigt bekommt.
wo liegt das problem?
-->guictrlcreatepic erstellen
-->über dropdown auswählen lassen welches bild
-->per guictrlsetimage() bild anzeigen
Hi,
eine Lösung:
[autoit]
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiComboBox.au3>
#include <array.au3>
#include <file.au3>
$arfile = _FileListToArray ("C:\programme\AutoIt3\Beta\Examples\GUI", "*.jpg", 1)
[/autoit][autoit][/autoit][autoit]$Form1 = GUICreate("Form1", 633, 454, 193, 115)
$Combo1 = GUICtrlCreateCombo("", 16, 24, 145, 25)
$Pic1 = GUICtrlCreatePic("", 16, 80, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
For $i = 1 To UBound ($arfile) - 1
_GUICtrlComboBox_AddString ($Combo1, $arfile [$i])
Next
_GUICtrlComboBox_SetCurSel ($Combo1, 0)
GUICtrlSetImage ($Pic1, "C:\programme\AutoIt3\Beta\Examples\GUI\" & $arfile [1])
$value = GUICtrlRead ($Combo1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
If $value <> GUICtrlRead ($Combo1) Then
GUICtrlSetImage ($Pic1, "C:\programme\AutoIt3\Beta\Examples\GUI\" & $arfile [_ArraySearch ($arfile, GUICtrlRead ($Combo1))])
$value = GUICtrlRead ($Combo1)
EndIf
sleep (50)
WEnd
;-))
Stefan
Also,
[autoit]#cs ----------------------------------------------------------------------------
[/autoit][autoit][/autoit][autoit]AutoIt Version: 3.3.0.0
Author: Kev
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
[/autoit][autoit][/autoit][autoit]#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <Inet.au3>
#include <String.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiComboBox.au3>
#include <array.au3>
#include <file.au3>
$arfile = _FileListToArray (@scriptdir &"\rg_bg\", "*.gif", 1)
$Form1 = Guicreate("Rising Gods Signaturius",680,350)
GuictrlcreateLabel("Character Name:",30,30,120,25)
$Name = GUICtrlCreateInput("Dein Charactername",130,25,120,25)
$arfile = _FileListToArray (@scriptdir &"\rg_bg\", "*.gif", 1)
GuictrlcreateLabel("Wähle deine Signatur:",265,30,120,25)
GuictrlcreateLabel("Rising Gods Realm:",30,60,120,25)
$Realm = GUICtrlCreateInput("PvE oder PvP",130,55,120,25)
$Button = GUICtrlCreateButton("Fertig",130,85,120,25)
$ButtonExit = GUICtrlCreateButton("Beenden",530,315,120,25)
$Button1 = GUICtrlCreateButton("Zeig her",130,112,120,25)
GuictrlcreateLabel("Character:",500,30,120,25)
GuictrlcreateLabel("Fraktion:",500,60,120,25)
GuictrlcreateLabel("Klasse:",500,90,120,25)
GuictrlcreateLabel("Level:",500,120,120,25)
GuictrlcreateLabel("Rasse:",500,150,120,25)
GuictrlcreateLabel("Skillung:",500,180,120,25)
GuictrlcreateLabel("Gesundheit:",500,210,120,25)
GuictrlcreateLabel("Mana/Wut/Energie:",500,240,120,25)
GuictrlcreateLabel("Gilde:",500,270,120,25)
$charklasse = GuictrlcreateLabel("",600,90,120,25)
$charfraktion = GuictrlcreateLabel("",600,60,120,25)
$charname = GuictrlcreateLabel("",600,30,120,25)
$lvl = GuictrlcreateLabel("",600,120,120,25)
$Rasse = GuictrlcreateLabel("",600,150,120,25)
$Skill = GuictrlcreateLabel("",600,180,120,25)
$Gesund = GuictrlcreateLabel("",600,210,120,25)
$Mana = GuictrlcreateLabel("",600,240,120,25)
$guild = GuictrlcreateLabel("",600,270,120,25)
$Pic1 = GuiCtrlCreatePic("",30,250,450,100,BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Combo1 = Guictrlcreatecombo("",260,55,120,35)
GuiCtrlSetState($Button1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
For $i = 1 To UBound ($arfile) - 1
_GUICtrlComboBox_AddString ($Combo1, $arfile [$i])
Next
_GUICtrlComboBox_SetCurSel ($Combo1, 0)
GUICtrlSetImage ($Pic1, @scriptdir &"\rg_bg\" & $arfile [1])
$value = GUICtrlRead ($Combo1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
If $value <> GUICtrlRead ($Combo1) Then
GUICtrlSetImage ($Pic1, @scriptdir &"\rg_bg\" & $arfile [_ArraySearch ($arfile, GUICtrlRead ($Combo1))])
$value = GUICtrlRead ($Combo1)
EndIf
sleep (50)
WEnd
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
exit
case $button
GuiCtrlSetState($Name, $GUI_DISABLE)
GuiCtrlSetState($Realm, $GUI_DISABLE)
msgbox(0,"Status", "Character wird abgerufen..OK drücken und abwarten.")
GuiCtrlSetState($Button1, $GUI_ENABLE)
$source = _INetGetSource("http://www.arsenal.rising-gods.de/character-sheet.xml?r=" & GUICtrlRead($Realm) & "-Realm&n=" & GUICtrlRead($Name))
$klasse = _StringBetween($source, '" class="', '" classId')
If IsArray($klasse) Then GUICtrlSetData($charklasse, $klasse[0])
$faction = _StringBetween($source , '" faction="', '" factionId')
If IsArray($faction) Then GUICtrlSetData($charfraktion, $faction[0])
$name2 = _StringBetween($source , '" name="', '" points')
If IsArray($name2) Then GUICtrlSetData($charname, $name2[0])
$name3 = _StringBetween($source , '" level="', '" name')
If IsArray($name3) Then GUICtrlSetData($lvl, $name3[0])
$name4 = _StringBetween($source , '" race="', '" raceId')
If IsArray($name4) Then GUICtrlSetData($Rasse, $name4[0])
$name5 = _StringBetween($source , '" prim="', '" treeOne')
If IsArray($name5) Then GUICtrlSetData($Skill, $name5[0])
$name6 = _StringBetween($source , '<health effective="', '"/>')
If IsArray($name6) Then GUICtrlSetData($Gesund, $name6[0])
$name7 = _StringBetween($source , '" effective="', '" notCasting')
If IsArray($name7) Then GUICtrlSetData($Mana, $name7[0])
$name8 = _StringBetween($source , '" guildName="', '" guildUrl')
If IsArray($name8) Then GUICtrlSetData($guild, $name8[0])
case $ButtonExit
exit
case $Button1
ShellExecute("http://www.arsenal.rising-gods.de/character-sheet.xml?r=" & GUICtrlRead($Realm) & "-Realm&n=" & GUICtrlRead($Name))
EndSwitch
Wend
geht soweit, bloß jetzt gehen die funktionen der buttons net mehr das heißt...
[autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
exit
case $button
GuiCtrlSetState($Name, $GUI_DISABLE)
GuiCtrlSetState($Realm, $GUI_DISABLE)
msgbox(0,"Status", "Character wird abgerufen..OK drücken und abwarten.")
GuiCtrlSetState($Button1, $GUI_ENABLE)
$source = _INetGetSource("http://www.arsenal.rising-gods.de/character-sheet.xml?r=" & GUICtrlRead($Realm) & "-Realm&n=" & GUICtrlRead($Name))
$klasse = _StringBetween($source, '" class="', '" classId')
If IsArray($klasse) Then GUICtrlSetData($charklasse, $klasse[0])
$faction = _StringBetween($source , '" faction="', '" factionId')
If IsArray($faction) Then GUICtrlSetData($charfraktion, $faction[0])
$name2 = _StringBetween($source , '" name="', '" points')
If IsArray($name2) Then GUICtrlSetData($charname, $name2[0])
$name3 = _StringBetween($source , '" level="', '" name')
If IsArray($name3) Then GUICtrlSetData($lvl, $name3[0])
$name4 = _StringBetween($source , '" race="', '" raceId')
If IsArray($name4) Then GUICtrlSetData($Rasse, $name4[0])
$name5 = _StringBetween($source , '" prim="', '" treeOne')
If IsArray($name5) Then GUICtrlSetData($Skill, $name5[0])
$name6 = _StringBetween($source , '<health effective="', '"/>')
If IsArray($name6) Then GUICtrlSetData($Gesund, $name6[0])
$name7 = _StringBetween($source , '" effective="', '" notCasting')
If IsArray($name7) Then GUICtrlSetData($Mana, $name7[0])
$name8 = _StringBetween($source , '" guildName="', '" guildUrl')
If IsArray($name8) Then GUICtrlSetData($guild, $name8[0])
case $ButtonExit
exit
case $Button1
ShellExecute("http://www.arsenal.rising-gods.de/character-sheet.xml?r=" & GUICtrlRead($Realm) & "-Realm&n=" & GUICtrlRead($Name))
EndSwitch
Wend
geht net mehr ...
du darfst natürlich nur eine endlosschleife haben in der du die control abfrägst
#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.0.0
Author: Kev
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <Inet.au3>
#include <String.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiComboBox.au3>
#include <array.au3>
#include <file.au3>
$arfile = _FileListToArray (@scriptdir &"\rg_bg\", "*.gif", 1)
$Form1 = Guicreate("Rising Gods Signaturius",680,350)
GuictrlcreateLabel("Character Name:",30,30,120,25)
$Name = GUICtrlCreateInput("Dein Charactername",130,25,120,25)
$arfile = _FileListToArray (@scriptdir &"\rg_bg\", "*.gif", 1)
GuictrlcreateLabel("Wähle deine Signatur:",265,30,120,25)
GuictrlcreateLabel("Rising Gods Realm:",30,60,120,25)
$Realm = GUICtrlCreateInput("PvE oder PvP",130,55,120,25)
$Button = GUICtrlCreateButton("Fertig",130,85,120,25)
$ButtonExit = GUICtrlCreateButton("Beenden",530,315,120,25)
$Button1 = GUICtrlCreateButton("Zeig her",130,112,120,25)
GuictrlcreateLabel("Character:",500,30,120,25)
GuictrlcreateLabel("Fraktion:",500,60,120,25)
GuictrlcreateLabel("Klasse:",500,90,120,25)
GuictrlcreateLabel("Level:",500,120,120,25)
GuictrlcreateLabel("Rasse:",500,150,120,25)
GuictrlcreateLabel("Skillung:",500,180,120,25)
GuictrlcreateLabel("Gesundheit:",500,210,120,25)
GuictrlcreateLabel("Mana/Wut/Energie:",500,240,120,25)
GuictrlcreateLabel("Gilde:",500,270,120,25)
$charklasse = GuictrlcreateLabel("",600,90,120,25)
$charfraktion = GuictrlcreateLabel("",600,60,120,25)
$charname = GuictrlcreateLabel("",600,30,120,25)
$lvl = GuictrlcreateLabel("",600,120,120,25)
$Rasse = GuictrlcreateLabel("",600,150,120,25)
$Skill = GuictrlcreateLabel("",600,180,120,25)
$Gesund = GuictrlcreateLabel("",600,210,120,25)
$Mana = GuictrlcreateLabel("",600,240,120,25)
$guild = GuictrlcreateLabel("",600,270,120,25)
$Pic1 = GuiCtrlCreatePic("",30,250,450,100,BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Combo1 = Guictrlcreatecombo("",260,55,120,35)
GuiCtrlSetState($Button1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
For $i = 1 To UBound ($arfile) - 1
_GUICtrlComboBox_AddString ($Combo1, $arfile [$i])
Next
_GUICtrlComboBox_SetCurSel ($Combo1, 0)
GUICtrlSetImage ($Pic1, @scriptdir &"\rg_bg\" & $arfile [1])
$value = GUICtrlRead ($Combo1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $button
GuiCtrlSetState($Name, $GUI_DISABLE)
GuiCtrlSetState($Realm, $GUI_DISABLE)
msgbox(0,"Status", "Character wird abgerufen..OK drücken und abwarten.")
GuiCtrlSetState($Button1, $GUI_ENABLE)
$source = _INetGetSource("http://www.arsenal.rising-gods.de/character-sheet.xml?r=" & GUICtrlRead($Realm) & "-Realm&n=" & GUICtrlRead($Name))
$klasse = _StringBetween($source, '" class="', '" classId')
If IsArray($klasse) Then GUICtrlSetData($charklasse, $klasse[0])
$faction = _StringBetween($source , '" faction="', '" factionId')
If IsArray($faction) Then GUICtrlSetData($charfraktion, $faction[0])
$name2 = _StringBetween($source , '" name="', '" points')
If IsArray($name2) Then GUICtrlSetData($charname, $name2[0])
$name3 = _StringBetween($source , '" level="', '" name')
If IsArray($name3) Then GUICtrlSetData($lvl, $name3[0])
$name4 = _StringBetween($source , '" race="', '" raceId')
If IsArray($name4) Then GUICtrlSetData($Rasse, $name4[0])
$name5 = _StringBetween($source , '" prim="', '" treeOne')
If IsArray($name5) Then GUICtrlSetData($Skill, $name5[0])
$name6 = _StringBetween($source , '<health effective="', '"/>')
If IsArray($name6) Then GUICtrlSetData($Gesund, $name6[0])
$name7 = _StringBetween($source , '" effective="', '" notCasting')
If IsArray($name7) Then GUICtrlSetData($Mana, $name7[0])
$name8 = _StringBetween($source , '" guildName="', '" guildUrl')
If IsArray($name8) Then GUICtrlSetData($guild, $name8[0])
case $ButtonExit
exit
case $Button1
ShellExecute("http://www.arsenal.rising-gods.de/character-sheet.xml?r=" & GUICtrlRead($Realm) & "-Realm&n=" & GUICtrlRead($Name))
EndSwitch
If $value <> GUICtrlRead ($Combo1) Then
GUICtrlSetImage ($Pic1, @scriptdir &"\rg_bg\" & $arfile [_ArraySearch ($arfile, GUICtrlRead ($Combo1))])
$value = GUICtrlRead ($Combo1)
EndIf
sleep (50)
WEnd