This topic is now closed to further replies.
This topic give you access to an AutoIt functions library I maintain which is called PAL, Peter's AutoIt Library. The latest version 1.20 contains 197 functions divided into these topics:
window, desktop and monitor mouse and GUI GUI controls including graphical buttons (jpg, png) logics and mathematics include constants string, xml string and file string dialogues and progress bars data lists: lists, stacks, shift registers and key maps (a.ka. dictionaries) miscellaneous: logging/debugging, process and system info Change log and files section on the PAL website (SourceForge).
A lot of these functions were created in the development of Peace, Peter's Equalizer APO Configuration Extension, which is a user interface for the system-wide audio driver called Equalizer APO.
I've been looking around the forum and testing different ways of getting a 'drop zone' to work in my script, but I can't seem to get any response from the event listener. Code compiles perfectly. Chaning the control from a label to an input- or edit-field doesn't change its behaviour, still no response when a file is dropped on there...
It might just be that I am overlooking a simple detail, so I'm hoping for an extra pair of eyes here or there who can spot why this isn't working as it should.
I have another 3500+ lines script where I have basically the same bit of code, and it seems to work in there without problems.
So, here it goes:
Global $DD_GUI = GUICreate("DicomDrop",200,200,-1,-1,BitOR($WS_SYSMENU,$WS_POPUP),$WS_EX_ACCEPTFILES) GUISetBkColor(0x030303,$DD_GUI) $DD_GUI_DRAGLABEL = GUICtrlCreateLabel("",0,0,32,32,-1, $GUI_WS_EX_PARENTDRAG) $DD_GUI_DRAGIMAGE = GUICtrlCreateIcon(@ScriptFullPath,201,0,0,32,32) $DD_GUI_TITLELABEL = GUICtrlCreateLabel("DicomDrop",50,10,100,20,$SS_CENTER) GUICtrlSetFont($DD_GUI_TITLELABEL,8,$FW_SEMIBOLD,$GUI_FONTNORMAL,"Verdana") GUICtrlSetColor($DD_GUI_TITLELABEL,0xFFFFFF) $DD_GUI_CLOSE = GUICtrlCreateButton("X",174,4,24,24,$BS_FLAT) GUICtrlSetBkColor($DD_GUI_CLOSE,0x030303) GUICtrlSetColor($DD_GUI_CLOSE,0xFFFFFF) Global $DD_GUI_DROPZONE = GUICtrlCreateLabel("",10,42,180,148) GUICtrlSetState(-1,8) GUICtrlSetBkColor($DD_GUI_DROPZONE,0x181818) GUISetState(@SW_SHOW,$DD_GUI) Local $DD_MSG = 0 While 1 $DD_MSG = GUIGetMsg() Select Case $DD_MSG = $GUI_EVENT_CLOSE ConsoleWrite(@CRLF & "Debug -- Closed by GUI_EVENT_CLOSE") DD_EXIT() Case $DD_MSG = $GUI_EVENT_DROPPED If @GUI_DropId = $DD_GUI_DROPZONE Then Local $DroppedFile = @GUI_DragFile GUIDelete() ConsoleWrite(@CRLF & "Debug -- Dropped file : " & $DroppedFile) EndIf Case $DD_MSG = $DD_GUI_CLOSE ConsoleWrite(@CRLF & "Debug -- Closed by DD_GUI_CLOSEIMAGE") DD_EXIT() EndSelect WEnd Func DD_EXIT() GUIDelete($DD_GUI) Exit EndFunc If anyone has any idea whatsoever, please let me know 🙂
Thanks in advance and kind regards,
GuiUtils: Simply create GUIs from KODA, Input Dialogs from JSON, and handle them like InputBox with one functionBy matwachich
Here is my new UDF about GUIs: it's an enhanced mixture of Advanced InputBox (deprecated) and KODA Parser (deprecated), with additional functions.
What you can do with it:
Parse KODA files and directly create GUIs (_GUIUtils_CreateFromKODA) Parse a simple JSON form definition to simply create advanced InputBoxes with any amount/type of input controls (_GUIUtils_CreateFromJSON) Created GUIs are returned as Scripting.Dictionary objects, and you have helper functions to access GUIs controls by their names (_GUIUtils_HWnd, _GUIUtils_CtrlID, _GUIUtils_HCtrl ...) A function that can make a GUI created from KODA/JSON (defined by it's $oForm object) and make it a modal InputDialogBox (just like InputBox, but returns all entered data as Scripting.Dictionary object) Functions are documented, and there are some examples.
Consider this UDF as beta, but since I'm currently using it in a small commercial project, it should become production ready in near future.
To always get the latest code version, get it from Github (more up to date than this topic).
New simple application example Fixed focused control handling in _GUIUtils_InputDialog Reset input values before returning from _GUIUtils_InputDialog Fixed CloseOnEsc in _GUIUtils_InputDialog Fixed Input not reset Fixed all ListBox items are selected Project now on GitHub https://github.com/matwachich/autoit-guiutils/
Support for nodate for Date and Time input controls (pass null value) New handling of focused control _GUIUtils_InputDialog: Now, you can specify the focused control in $oInitialData by setting "controlName:focus" = True Updated documentation of _GUIUtils_InputDialog Update 07/02/2020:
Bug corrected when setting Data input control Added: abillity to read a single input control New functions (_GUIUtils_GetInputs, _GUIUtils_WriteInputs), documentation completion. Readme file and screenshots on Github Page
This is my very first post in this forum and am also new with Autoit programming so be easy on me.
Below is the code that I am trying to get the index of the item selected. No problem getting the text.
Case $listEdition ; handle of the list local $index=0 $item=GUICTRLRead($listEdition) ; This will return the text in the list ; ============== The loop below always fails ================== ; Meaning _GUICtrlListView_GetItemSelected($listEdition, $i) always return FALSE. WHY ??????? For $i = 0 To $editionArray - 1 ; The content of the list in an array where editionArray contains total count of items If _GUICtrlListView_GetItemSelected($listEdition, $i) Then $index = $i exitloop EndIf Next ;=================================================== ConsoleWrite( "Select Edition: " & $item & " index: " & $index & @CR) ....... Please look at the comments in the code & the pix attached.
_GUICtrlListView_GetItemSelected($listEdition, $i) always returns FALSE.
Another problem is on the list. It also populate the total count of items from the Array. How can I skip this item from populating to the list ?.
Please advise and thanks
I am not able to use the $GUI_READ_EXTENDED with the Metro UDF, any work around ?
Local $aPos = [$Radio1, $Radio2] For $Radio In $aPos If GUICtrlRead($Radio) = $GUI_UNCHECKED Then ContinueLoop IniWrite($sGUIstate_IniFile, "Data", "POS", GUICtrlRead($Radio, $GUI_READ_EXTENDED)) ;; return the text of the menu item ExitLoop Next