Jump to content

Click input


Recommended Posts

Hi every one, can you help me set an click to the input named "$iid", thank all!
P/s: Here is my code (below)
 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ###
$Form1 = GUICreate("Form1", 391, 518, 192, 124)
$iid = GUICtrlCreateInput("", 0, 392, 385, 21)
GUICtrlSetLimit ($iid , 63)
$c_i_d = GUICtrlCreateInput("", 0, 424, 353, 21)
$copy_ = GUICtrlCreateButton("Copy", 352, 424, 35, 25, $WS_GROUP)
$cid = GUICtrlCreateInput("", 0, 456, 353, 21)
$copy = GUICtrlCreateButton("Copy", 352, 456, 35, 25, $WS_GROUP)
$atp = GUICtrlCreateButton("ATP COPY", 0, 488, 75, 25, $WS_GROUP)
$ospp = GUICtrlCreateButton("OSPP COPY", 80, 488, 75, 25, $WS_GROUP)
$slipt = GUICtrlCreateButton("SLIPT", 160, 488, 75, 25, $WS_GROUP)
$re = GUICtrlCreateButton("REFRESH", 240, 488, 75, 25, $WS_GROUP)
$out = GUICtrlCreateButton("EXIT", 320, 488, 67, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd


 

Edited by Melba23
Added code tags
Link to comment
Share on other sites

  • Moderators

malble12i,

Welcome to the AutoIt forums.

I presume you want the cursor to be placed in that input - if so then just give it focus:

$iid = GUICtrlCreateInput("", 0, 392, 385, 21)
GUICtrlSetState($iid, $GUI_FOCUS)

M23

P.S. When you post code please use Code tags - see here how to do it.  Then you get a scrolling box and syntax colouring as you can see above now I have added the tags.

 

 

 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

malble12i,

Quote

send the code

What do you think that code in my previous post does?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

malble12i,

You need to add that additional GUICtrlSetState line immediately after the control creation line - just as I posted it above. Then you will have the cursor in the input when the GUI opens.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

2 minutes ago, Melba23 said:

malble12i,

You need to add that additional GUICtrlSetState line immediately after the control creation line - just as I posted it above. Then you will have the cursor in the input when the GUI opens.

M23

Thank you, but I'm a noob, can you give me the example?

Link to comment
Share on other sites

  • Moderators

malble21i,

Sigh......

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ###
$Form1 = GUICreate("Form1", 391, 518, 192, 124)
$iid = GUICtrlCreateInput("", 0, 392, 385, 21)
GUICtrlSetState($iid, $GUI_FOCUS) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUICtrlSetLimit ($iid , 63)
$c_i_d = GUICtrlCreateInput("", 0, 424, 353, 21)
$copy_ = GUICtrlCreateButton("Copy", 352, 424, 35, 25, $WS_GROUP)
$cid = GUICtrlCreateInput("", 0, 456, 353, 21)
$copy = GUICtrlCreateButton("Copy", 352, 456, 35, 25, $WS_GROUP)
$atp = GUICtrlCreateButton("ATP COPY", 0, 488, 75, 25, $WS_GROUP)
$ospp = GUICtrlCreateButton("OSPP COPY", 80, 488, 75, 25, $WS_GROUP)
$slipt = GUICtrlCreateButton("SLIPT", 160, 488, 75, 25, $WS_GROUP)
$re = GUICtrlCreateButton("REFRESH", 240, 488, 75, 25, $WS_GROUP)
$out = GUICtrlCreateButton("EXIT", 320, 488, 67, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

2 minutes ago, Melba23 said:

malble21i,

Sigh......

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ###
$Form1 = GUICreate("Form1", 391, 518, 192, 124)
$iid = GUICtrlCreateInput("", 0, 392, 385, 21)
GUICtrlSetState($iid, $GUI_FOCUS) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUICtrlSetLimit ($iid , 63)
$c_i_d = GUICtrlCreateInput("", 0, 424, 353, 21)
$copy_ = GUICtrlCreateButton("Copy", 352, 424, 35, 25, $WS_GROUP)
$cid = GUICtrlCreateInput("", 0, 456, 353, 21)
$copy = GUICtrlCreateButton("Copy", 352, 456, 35, 25, $WS_GROUP)
$atp = GUICtrlCreateButton("ATP COPY", 0, 488, 75, 25, $WS_GROUP)
$ospp = GUICtrlCreateButton("OSPP COPY", 80, 488, 75, 25, $WS_GROUP)
$slipt = GUICtrlCreateButton("SLIPT", 160, 488, 75, 25, $WS_GROUP)
$re = GUICtrlCreateButton("REFRESH", 240, 488, 75, 25, $WS_GROUP)
$out = GUICtrlCreateButton("EXIT", 320, 488, 67, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23

Sorry, but can you set "If I click to the Input, it will Exit"?

Link to comment
Share on other sites

  • Moderators

malble12i,

Please explain what you actually want to do because that makes no sense to me whatsoever. You click in an input so that you can enter data, not to exit a script.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

malble21i,

Then you should have said so at the beginning:

#include <GUIConstantsEx.au3>

$Form1 = GUICreate("Form1", 391, 518, 192, 124)
$iid = GUICtrlCreateInput("", 0, 392, 385, 21)
GUICtrlSetLimit ($iid , 63)
$c_i_d = GUICtrlCreateInput("", 0, 424, 353, 21)
$copy_ = GUICtrlCreateButton("Copy", 352, 424, 35, 25)
$cid = GUICtrlCreateInput("", 0, 456, 353, 21)
$copy = GUICtrlCreateButton("Copy", 352, 456, 35, 25)
$atp = GUICtrlCreateButton("ATP COPY", 0, 488, 75, 25)
$ospp = GUICtrlCreateButton("OSPP COPY", 80, 488, 75, 25)
$slipt = GUICtrlCreateButton("SLIPT", 160, 488, 75, 25)
$re = GUICtrlCreateButton("REFRESH", 240, 488, 75, 25)
$out = GUICtrlCreateButton("EXIT", 320, 488, 67, 25)

GUISetState(@SW_SHOW)

; Just for an example - load the clipboard
ClipPut("Just for an example")

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $out
            Exit
        Case $GUI_EVENT_PRIMARYUP ; The mouse button has been released
            ; Is the cursor over an input?
            $aInfo = GUIGetCursorInfo()
            If IsArray($aInfo) Then
                Switch $aInfo[4]
                    Case $iid
                        ; Do what you want to do here, for example
                        If Not GUICtrlRead($iid) Then
                            GUICtrlSetData($iid, ClipGet())
                        EndIf
                        ; will put the clipboard content into the input

                    Case $c_i_d
                        If Not GUICtrlRead($c_i_d) Then
                            GUICtrlSetData($c_i_d, ClipGet())
                        EndIf
                        
                    Case $cid
                        If Not GUICtrlRead($cid) Then
                            GUICtrlSetData($cid, ClipGet())
                        EndIf
                        
                EndSwitch
            EndIf
    EndSwitch
WEnd

M23

P.S. When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily.

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...