Jump to content
Sign in to follow this  

Child gui with input thingy

Recommended Posts


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?

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)
$mainwindow = GUICreate("Hello World", 800, 400)
$okbutton = GUICtrlCreateButton("OK", 70, 50, 60)
GUICtrlSetOnEvent($okbutton, "OKButton")
$posmysz = MouseGetPos()
$lista = GUICtrlCreateListView("Nazwa|Pozycja X|Pozycja Y|Kolor|Kolor Hex|", 300, 100, 400, 200)
$kolor = 0
$kolor_hex = 0
$nazwa = ">.<"

While 1
    $posmysz = MouseGetPos()
    GUICtrlCreateLabel("X=" & $posmysz[0] & "   Y=" & $posmysz[1], 80, 10)

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()
EndFunc  ;==>CLOSEClicked

Func Kolor ($posx, $posy)
    $kolor = PixelGetColor($posx, $posy)
    $kolor_hex = hex($kolor)
Edited by ciffer

Share this post

Link to post
Share on other sites

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.. :)


Share this post

Link to post
Share on other sites

How about using a simple InputBox instead of an Input control? eg:

Replace this:

$nazwa = GUICtrlCreateInput("Wprowadź nazwę", 10, 10)oÝ÷ Ùh­Øb±«­¢+ØÀÌØí¹éÝô%¹ÁÕÑ   ½à ÅÕ½Ðí]ÁɽÝè¹éÝÅÕ½Ðì°ÅÕ½Ðí]ÁɽÝè¹éÝÅÕ½Ðì¤

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...