[Frage]

09/18/2010 20:09 Anna<3#1
Hi

wie mache ich das wen ich auf etwas im TreeView klicke das ,das dann
in einer Inputbox steht.

also der Text X Achse wir durch die gespeicherten Korodinaten im
TreeView ersetz wen ich auf ein ein teil dort drauf klicke.
z.B.wie bei einen Teleporter hack ^^

oder wen ich auf etwas im TreeView Clicke soll es im Label angegeben sein z.B so.
ich klicke auf
PHP Code:
$Kuznes ;wie speicher ich hier noch einen wert in die Variabel
und das soll dan ind diesem Label Angegeben werden =>
PHP Code:
$X_Cord_Ausgabe 
hoffe das ist ein bissel einfacher ^^
09/19/2010 12:46 mipez#2
So wie ich das herausgelesen hab, willst irgendwo auf einen Wert klicken, und diesen in einem Input erscheinen lassen...


Benutz da lieber ne ComboBox:
Code:
GUICtrlCreateCombo("Text", x, y, breite, höhe)
GUICtrlSetData(-1, "Item1|Item2|Item3")
Abgerufen werden kann das ganze über GUIGetMsg oder GUICtrlRead.


Probier mal das:
Code:
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Whatever", 239, 95, 192, 124)
$Combo1 = GUICtrlCreateCombo("Item1", 8, 16, 209, 25)
GUICtrlSetData(-1, "Item2|Item3")
$Label1 = GUICtrlCreateLabel("", 16, 56, 100, 20)
GUISetState(@SW_SHOW)


While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Combo1
			GUICtrlSetData($Label1, GUICtrlRead($Combo1))
	EndSwitch
WEnd
EDIT:
Variablen deklariert man mit vorgegebenem Wert so:
$bla = "hallo"

Und "leer" so:
Global $bla
Dim $bla
Local $bla
09/19/2010 13:46 lolkop#3
wenn du das mit treeviews machen willst, musst du immer erst per guictrlread die control ids vom gewählten element auslesen und dann per zusatz parameter 1 noch den text der darin gespeichert ist.

hier mal kleines beispiel:
Code:
GUICreate("blah", 250, 142, -1, -1, 0x10080000)
$tree = GUICtrlCreateTreeView(5, 5, 100, 100, 0x37, 0x200)
$blah = GUICtrlCreateTreeViewItem("blah", $tree)
$bleh = GUICtrlCreateTreeViewItem("bleh", $tree)
$blubb1 = GUICtrlCreateTreeViewItem("blubb1", $blah)
$blubb2 = GUICtrlCreateTreeViewItem("blubb2", $bleh)
GUICtrlSetState($bleh, 0x200) ; bleh Fett schreiben
GUICtrlSetState($blah, 0x200) ; blah Fett schreiben
$input = GUICtrlCreateInput("", 110, 20, 100, 20)
$label= GUICtrlCreateLabel("", 110, 60, 100, 20)

While 1
	Switch GUIGetMsg()
		Case -3
			ExitLoop
		Case $blah
			SetData()
		Case $bleh
			SetData()
		Case $blubb1
			SetData()
		Case $blubb2
			SetData()
	EndSwitch
WEnd

Func SetData()
	$control_id = GUICtrlRead($tree)   ; control id vom gewählten element
	$text = GUICtrlRead($control_id, 1); text vom gewählten element
	GUICtrlSetData($input, $text)      ; text ins input schreiben
	GUICtrlSetData($label, $text)       ; text ins label schreiben
EndFunc
09/19/2010 15:21 Anna<3#4
das mit der combobox ist ganz gut nur soll das jz Kuznes stehen und wen ich was wähle
muss da dan 567839 und in einem anderen label 402879 stehen
also --------__________das in Label1 und-----------______das in label2^^

verstanden ^^
09/19/2010 20:39 mipez#5
Quote:
Originally Posted by LittleAnna View Post
das mit der combobox ist ganz gut nur soll das jz Kuznes stehen und wen ich was wähle
muss da dan 567839 und in einem anderen label 402879 stehen
also --------__________das in Label1 und-----------______das in label2^^

verstanden ^^
Wenn ich das soweit richtig verstanden habe, willst du zu einem Wert aus der Combo einen passenden dazu laden, oder?

Code:
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiComboBox.au3>

$Form1 = GUICreate("Whatever", 239, 95, 192, 124)
$Combo1 = GUICtrlCreateCombo("Item 1", 8, 16, 209, 25)
GUICtrlSetData(-1, "Item 2|Item 3")
$Label1 = GUICtrlCreateLabel("", 16, 56, 50, 20)
$Label2 = GUICtrlCreateLabel("", 76, 56, 100, 20)
GUISetState(@SW_SHOW)

Global $array[4]
$array[0] = "Dummy"
$array[1] = "Wert zu Item 1"
$array[2] = "Wert zu Item 2"
$array[3] = "Wert zu Item 3"


While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Combo1
            GUICtrlSetData($Label1, GUICtrlRead($Combo1))
            $string = StringSplit(GUICtrlRead($Combo1)," ")
            GUICtrlSetData($Label2,$array[$string[2]])
    EndSwitch
WEnd
Wenn du das auf Koordinaten anwenden willst schreib statt "Item 1": "x 1", "123 1"...