AHK:GUI_SetRequest_DropDownList Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
inseption86
Posts: 203
Joined: 19 Apr 2018, 00:24

AHK:GUI_SetRequest_DropDownList

23 Oct 2021, 05:18

Good day! How to display only item.number in DropDownList, but further work with item.ServiceName and item.TicketID

Code: Select all

HTTP.Open("POST", URL . "Queue/SectorTickets" ,false)
HTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
HTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36")
HTTP.Send("windowID=" . windowID "&searchPattern=")
HTTP.WaitForResponse()

obj := JSON.Parse(HTTP.ResponseText)
for jsonresult, item in obj
   list_ticket .= item.number "_" item.TicketID  "_" item.ServiceName  "|" 
   
Gui, +ToolWindow  +AlwaysOnTop  +Hwndmygui
Gui, Font, s18 Normal
Gui, Add, text, x5 y10 , Ticket - 


Gui, Add, DropDownList, x110 w90  y+-30 r10 vTicket, % list_ticket "|"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;how to implement it?;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if ( item.ServiceName = "Money")
{
    Gui,Font,s18 bold, Verdana
    GuiControl,Font,Ticket
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Gui, Add, text, x5 y+20 , Status -
Gui, Add, DropDownList, x110 w100 y+-30 r6 vstatus, Bank|Home

Gui, Add, Text,  w215  x5 h1    0x10  
Gui, Font, s18 normal
Gui, Add, Button, x60 y+10  w110 h30 gButton_next, % Chr(0x2192)
Gui, Show, w220 Center, (*_*)
return

Button_next:
Gui, Submit, NoHide
;msgbox, % TicketID := % RegExReplace(Ticket, ".*_(\d+)", "$1")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;how to implement it?;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
msgbox, % item.TicketID
return
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: AHK:GUI_SetRequest_DropDownList  Topic is solved

23 Oct 2021, 06:25

Code: Select all

tik := {}
For jsonresult, item in obj
   list_ticket .= item.number "|"
 , tik[item.number, "Svc"] := item.ServiceName, tik[item.number, "ID"] := item.TicketID
Gui, Font, s10
Gui, Add, Text,, Ticket number:
Gui, Add, DropDownList, w200 vTicket, % list_ticket "|"
Gui, Add, Button, Default, OK
Gui, Show,, Test
Return

ButtonOK:
Gui, Submit, NoHide
MsgBox, 64, Info, % "Ticket number : " Ticket
                . "`nService name  : " tik[Ticket].Svc
                . "`nTicketID          : " tik[Ticket].ID
Return
inseption86
Posts: 203
Joined: 19 Apr 2018, 00:24

Re: AHK:GUI_SetRequest_DropDownList

23 Oct 2021, 06:39

Thank you very match!!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CrowexBR, Google [Bot] and 256 guests