ciffer Posted May 6, 2008 Share Posted May 6, 2008 (edited) Hi! I am making a script which will show mouse pos and also color (normal and in hex). All that information is stored in ListViewItems. The only problem is 1st column, also known as Name (variable $nazwa). I want to make a little child gui window with input so i can put that name there. But i don't know how ._. Can anyone help me? expandcollapse popup#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $mainwindow = GUICreate("Hello World", 800, 400) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") $okbutton = GUICtrlCreateButton("OK", 70, 50, 60) GUICtrlSetOnEvent($okbutton, "OKButton") $posmysz = MouseGetPos() GUISetState(@SW_SHOW) $lista = GUICtrlCreateListView("Nazwa|Pozycja X|Pozycja Y|Kolor|Kolor Hex|", 300, 100, 400, 200) $kolor = 0 $kolor_hex = 0 $nazwa = ">.<" While 1 Sleep(500) $posmysz = MouseGetPos() GUICtrlCreateLabel("X=" & $posmysz[0] & " Y=" & $posmysz[1], 80, 10) WEnd Func OKButton() $posmysz = MouseGetPos() MsgBox(0, "GUI Event", "Umieć mysz nad pikselem i nacinij enter") Kolor($posmysz[0], $posmysz[1]) ;Func Kolor is looking and writing information about colors. That is why i want that window here $nazwa = GUICtrlCreateInput("Wprowadź nazwę", 10, 10) GuiCtrlCreateListViewItem($nazwa & "|" & $posmysz[0] & "|" & $posmysz[1] & "|" & $kolor & "|" & $kolor_hex, $lista) EndFunc ;==>OKButton Func CLOSEClicked() Exit EndFunc ;==>CLOSEClicked Func Kolor ($posx, $posy) $kolor = PixelGetColor($posx, $posy) $kolor_hex = hex($kolor) EndFunc Edited May 6, 2008 by ciffer Link to comment Share on other sites More sharing options...
newbiescripter Posted May 6, 2008 Share Posted May 6, 2008 I know it isn't the question, but Insted of using the OK button. then create a Hotkey because else you can only get the color of different places in the OK button.. Regards Link to comment Share on other sites More sharing options...
ciffer Posted May 6, 2008 Author Share Posted May 6, 2008 Nope ;] You can use enter to press OK in dialog box ;] Link to comment Share on other sites More sharing options...
newbiescripter Posted May 6, 2008 Share Posted May 6, 2008 You're right but use for example: HotKeySet("{F4}","OKButton") When you get more buttons in your script then I think it's a bit easier for the client Link to comment Share on other sites More sharing options...
ciffer Posted May 6, 2008 Author Share Posted May 6, 2008 Wow thanks I will use it for sure Link to comment Share on other sites More sharing options...
covaks Posted May 7, 2008 Share Posted May 7, 2008 How about using a simple InputBox instead of an Input control? eg: Replace this: $nazwa = GUICtrlCreateInput("Wprowadź nazwę", 10, 10)oÝ÷ ÙhØb±«¢+ØÀÌØí¹éÝô%¹ÁÕÑ ½à ÅÕ½Ðí]ÁɽÝè¹éÝÅÕ½Ðì°ÅÕ½Ðí]ÁɽÝè¹éÝÅÕ½Ðì¤ Link to comment Share on other sites More sharing options...
ciffer Posted May 7, 2008 Author Share Posted May 7, 2008 Great! Just as i wanted to ;] Thanks ;] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now