Jump to content

Melba23

Moderators
  • Posts

    31,239
  • Joined

  • Days Won

    313

Everything posted by Melba23

  1. wincot, Use FileReadToArray to get the content of the file into a variable and you can then manipulate the array as you wish. M23
  2. mr-es335, Ans 1: The coders who use AutoIt. Ans 2.1: It refers to the preceding optional parameter(s). Ans 2.2: Functions return a value (which might be as simple as 1/0 indicating success/failure, but could be an array or other complex variable) and the at the same time set the @error flag to 0 (success) or a non-zero value (usually indicating failure mode). If the @error flag is set, then the return value of the function could be anything at all and so should not be used. Clearer? As to your 3 comments: 1. We have been complimented on the content and clarity of our help file, but there sometimes those who find it too complex...... 2 & 3: See this quote. M23
  3. Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states: Moderation Team
  4. Moved to the appropriate forum. Moderation Team
  5. Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team
  6. mr-es335, I would also say that a function is a block of code intended to be used several times within the same script - if it to be used just the once then there would be be little point in creating one as you might as well add the relevant lines in the main script where required. The exception would be if you were writing a library - such as the standard include files that come with AutoIt - which are designed to offer simplicity of use to the user by allowing complicated functions to be called by a one-line command from another script. M23
  7. Hi, The rule is still in force and Melba still cleans up. M23
  8. All, The problem was that the data contained the default Data Separation Character ("|") which the UDF (and AutoIt) was interpreting as a column delimiter. The solution was to change the default separator character using Opt. M23
  9. CodeWriter, Can you let me have a copy of some of the data you are trying to insert so that I can have a play and see if I can come up with a solution - via PM if you do not want to post in open forum. M23
  10. CodeWriter, Sorry to hear that - but glad it was not my UDF at fault! M23
  11. CodeWriter, I have added a few lines to your snippet so it runs (please post runnable code in future) and it loads a 4x4 array with no problems: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIGdi.au3> #include <FontConstants.au3> #include "GUIListViewEx.au3" Global $Gmacro[4][4] =[[1,2,3,4],[5,6,7,8],["a","b","c","d"],["w","x","y","z"]] ; Create GUI: Local $hMacroGUI, $vData, $hMacro, $iEditMode = 0, $bEdited = False $hMacroGUI = GUICreate("Active Macros", 1520, 945, 25, 25) ; Create ListView using GUICtrlListViewEx.au3 UDF: $hMacro = _GUICtrlListView_Create($hMacroGUI, "", 5, 5, 1510, 890, BitOR($LVS_DEFAULT, $WS_BORDER)) _GUICtrlListView_SetExtendedListViewStyle($hMacro, $LVS_EX_FULLROWSELECT) _GUICtrlListView_AddColumn($hMacro, "Column1", 200) _GUICtrlListView_AddColumn($hMacro, "Column2", 250) _GUICtrlListView_AddColumn($hMacro, "Column3", 400) _GUICtrlListView_AddColumn($hMacro, "Column4", 3000) ; Set font: Local $hFont = _WinAPI_CreateFont(19, 7, 0, 0, $FW_NORMAL, False, False, False, $DEFAULT_CHARSET, _ $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, "Helvetica") _WinAPI_SetFont($hMacro, $hFont, True) ; Populate the ListView: Local $limit = UBound($Gmacro) - 1 For $i = 0 To $limit _GUICtrlListView_AddItem($hMacro, $Gmacro[$i][0]) _GUICtrlListView_AddSubItem($hMacro, $i, $Gmacro[$i][1], 1) _GUICtrlListView_AddSubItem($hMacro, $i, $Gmacro[$i][2], 2) _GUICtrlListView_AddSubItem($hMacro, $i, $Gmacro[$i][3], 3) Next ; Initialize the GUIListViewEx UDF: (16: enable color header, 32: user colored items) Local $iLV = _GUIListViewEx_Init($hMacro, $Gmacro, 0, 0xFF0000, True, 16 + 32) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd M23
  12. CodeWriter, Nothing as far as I know! M23
  13. CodeWriter, Indeed there is a problem with header colours running in x64. Can you not just run as x32, where the problem does not occur? M23
  14. pixelsearch, As so often - good spot! DStark, It is always recommended to use _GUICtrlListView_SetExtendedListViewStyle rather than setting the extended style parameter when creating the ListView. MS, in their wisdom, made some of the extended ListView styles the same value as some of the extended GUI styles and Windows will interpret the value as the latter when used at creation time. M23.
  15. Moved to the appropriate forum. Moderation Team
  16. mecartron, You will need to get the client area coordinates of the listview item and then convert them to screen coordinates to create the combo GUI in the correct place. Change the first part of the user function to this: Func _UserFunc($hHandle, $iIndex, $iRow, $iColumn) ; Get coordinates of the item clicked - note this is whole row, not the subitem $aRect = _GUICtrlListView_GetItemRect($hHandle, $iRow) ; Convert the coordinates from GUI client area to screen Local $tPoint = DllStructCreate("int X;int Y") DllStructSetData($tPoint, "X", 190) ; We know the width of the first 2 columns DllStructSetData($tPoint, "Y", $aRect[1]) ; And we get this value from the earlier function call ; Now use the API to convert the coordinates _WinAPI_ClientToScreen($hHandle, $tPoint) ; Create a combo dialog using the converted coordinates $hGUICombo = GUICreate("", 90, 25, DllStructGetData($tPoint, "X") , DllStructGetData($tPoint, "Y"), $WS_POPUP) ; Create the combo and fill it with the data for the specified row $cCombo = GUICtrlCreateCombo("", 0, 0, 80, 20) GUICtrlSetData($cCombo, $aComboData[$iRow]) GUISetState() All clear? M23
  17. mecartron, Please post a shortish, runnable script which shows the problem as I do not really understand your desription of the problem. M23 Edit: Here is a short example showing how I would get different combo contents for each row: #include <GUIConstantsEx.au3> #include "GUIListViewEx.au3" ; Create an array to hold the required data for the combo depending on the row Global $aComboData[10] = ["0|1|2", "1|2|3", "2|3|4", "3|4|5", "4|5|6", "5|6|7", "6|7|8", "7|8|9", "8|9|0", "9|0|1"] $hGUI = GUICreate("Tool", 500, 400) $cLV_1 = GUICtrlCreateListView("Stt Auto|time|start|End|HD", 10, 30, 485, 330, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS)) _GUICtrlListView_SetExtendedListViewStyle($cLV_1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) _GUICtrlListView_SetColumnWidth($cLV_1, 0, 100) _GUICtrlListView_SetColumnWidth($cLV_1, 1, 90) _GUICtrlListView_SetColumnWidth($cLV_1, 2, 90) _GUICtrlListView_SetColumnWidth($cLV_1, 3, 90) _GUICtrlListView_SetColumnWidth($cLV_1, 4, 90) ; Create array and fill listview Global $aLVArray_1[10][5] For $i = 0 To 9 $sData = "Auto "& $i&"||ht|6" GUICtrlCreateListViewItem($sData, $cLV_1) Next ; Initiate ListView $iLVIndex_1 = _GUIListViewEx_Init($cLV_1, $aLVArray_1) ; Set column edit status _GUIListViewEx_SetEditStatus($iLVIndex_1, 2, 9, _UserFunc) ; 9 = User function _GUIListViewEx_MsgRegister() GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch _GUIListViewEx_EventMonitor() WEnd Func _UserFunc($hHandle, $iIndex, $iRow, $iColumn) ; Create a combo dialog - title shows row number doubleclicked $hGUICombo = GUICreate($iRow, 200, 200) ; Create the combo and fill it with the data for the specified row $cCombo = GUICtrlCreateCombo("", 10, 10, 180, 180) GUICtrlSetData($cCombo, $aComboData[$iRow]) GUISetState() While 1 Switch GUIGetMsg() Case $cCombo ConsoleWrite("You selected value: " & GUICtrlRead($cCombo) & @CRLF) Case $GUI_EVENT_CLOSE GUIDelete($hGUICombo) Return EndSwitch WEnd EndFunc
  18. Nine, There is no difference because in both cases the EMB is sufficently large to fit the unbroken string. Try running this and you will see a difference: #include "ExtMsgBox.au3" #include <String.au3> ; Create long string Local $sResult = _StringRepeat("1234567890", 14) ; Check of string length $aRet = _StringSize($sResult) ConsoleWrite($aRet[2] & @CRLF) ; I get 840 pixels as the width of the string ; Try EMB with $iWidth_Abs too small _ExtMsgBoxSet(1, 0, Default, Default, Default, Default, 500) $iRet = _ExtMsgBox(64, "Ok", "Test", $sResult) ConsoleWrite($iRet & " - " & @error & @CRLF) ; Should fail with "-1 - 6" return ; Now try with increased max width _ExtMsgBoxSet(1, 0, Default, Default, Default, Default, 1000) ; And it works! $iRet = _ExtMsgBox(64, "Ok", "Test", $sResult) ConsoleWrite($iRet & " - " & @error & @CRLF) The width parameters work like this: - There is a minimum width of 370 pixels (hard coded) to make sure there is always room for at least a bit of text and a reasonably sized button. - The normal maximum width is also set to 370 as it is expected that messages are not normally hugely long and can easily be broken (using StringSize) to fit, although this can be increased using the $iWidth parameter in _ExtMsgBoxSet to cater for longer messages where you need to avoid a tall, thin EMB. - Finally, if you think there might be a long section of characters which cannot be broken by StringSize (as in this case) then you need to set an absolute width which will allow the EMB to expand so it can display the unbroken string - this is limited to @DesktopWidth - 20 to make sure that the EMB actually fits on the display. Clearer now? M23
  19. Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states: Moderation Team
  20. mr-es335, I rather pride myself on the clarity of my UDF function headers, so I am somewhat disappointed to hear that you are having difficulties in understanding the various parameter values. If you would explain just which of the explanations are causing you probems I will attempt to explain. As to your requirement to display 140 characters in an ExtMsgBox, I suggest you choose a font and then use my StringSize UDF (which is included in the ExtMsgBox download) to measure just how wide this string would be. You can then use this value as the $iWidth_Abs parameter - althugh I would suggest adding a decent margin on either side! M23
  21. RAMzor, Thanks for that - I am happy for the thread to continue. M23
  22. RAMzor, I see from a cursory Google search that the Unreal Editor does indeed have uses other than gaming, but I would appreciate some information from you (via PM if you prefer) as to what exactly you are intending to do with it. Why do you need to automate it? What sort of imaging are you dealing with? We would like to help, so please provide us with the data to allow us to do so. M23
  23. Moved to the appropriate forum. Moderation Team
×
×
  • Create New...