Register for your free account! | Forgot your password?

You last visited: Today at 11:26

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Frage]

Discussion on [Frage] within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
Anna<3's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 353
Received Thanks: 285
[Frage]

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 ^^
Anna<3 is offline  
Old 09/19/2010, 12:46   #2
 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,241
Received Thanks: 848
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
mipez is offline  
Old 09/19/2010, 13:46   #3
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
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
lolkop is offline  
Old 09/19/2010, 15:21   #4
 
Anna<3's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 353
Received Thanks: 285
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 ^^
Anna<3 is offline  
Old 09/19/2010, 20:39   #5
 
elite*gold: 0
Join Date: Jul 2009
Posts: 2,241
Received Thanks: 848
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"...
mipez is offline  
Thanks
1 User
Reply




All times are GMT +1. The time now is 11:27.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.