Jump to content

Melba23

Moderators
  • Posts

    31,235
  • Joined

  • Days Won

    312

Everything posted by Melba23

  1. TomTheGeek, The compiled script in the OP has been removed again. Please do not put it back a third time. M23
  2. Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states: Moderation Team
  3. mr-es335, A number of solutions in this thread: M23
  4. liro, The person you are addressing has not been here for nearly 12 years. Start a new thread if you want any help please. M23
  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. TwoCanoe, For simplicity, I would use a dummy input like this: #include <GUIConstantsEx.au3> #include <EditConstants.au3> Local $sMyHex = "0000FF" $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput(String($sMyHex), 10, 100, 100, 20, $ES_CENTER) $cDummyInput = GUICtrlCreateInput(Dec($sMyHex), 110, 100, 20, 20) $cUpDown = GUICtrlCreateUpdown($cDummyInput) GUICtrlSetState($cDummyInput, $GUI_FOCUS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cDummyInput GUICtrlSetData($cInput, Hex(Number(GUICtrlRead($cDummyInput)), 6)) EndSwitch WEnd Increase the width of the dummy input to see what is going on. M23
  7. [New VERSION] - 11 Dec 24 Added: New function _GUIListViewEx_EditProcessActive which returns the handle of the ListView concerned if an element is being edited. Usage scenario: prevent HotKeys from working when editing is underway. Fixed: A couple of bugs with columns: added columns were automatically sortable; dragging columns meant editing pop-up could appear in wrong place. Thanks to ValentinM for the reports. New UDF in the first post. M23
  8. ValentinM, Spendid news! I will release a new version soon. M23
  9. ValentinM, Spendid news! I will release a new version soon. M23
  10. ValentinM, Good day yesterday with the nietos and I think I have a new solution for you today - the scrolling problem was exactly what I thought it might be and the solution was pretty easy to code. Here is a new Beta: GUIListViewEx_Mod.au3 And the example I have been using to test which works perfectly for me: GLVEx_Ex.au3 If you still have problems, please let me see the code you are using to create, load and initialise your ListView to see if I can spot the reason. M23 Edit: Found an edge case in testing - working on it. Edit 2: New Beta uploaded.
  11. ValentinM, Oh dear, it worked nicely for for me - I will take another look. And also at the horizontal scrolling problem - I think I know why that happens (fingers firmly crossed). But I am very busy today (looking after my grandchildren) so I will not have time until tomorrow - please be patient. M23
  12. ValentinM, Good spot! Looking into it. M23 Edit: Found the problem - _GUICtrlListView_GetSubItemRect requires a 1-based index - and so when SubItem 0 is passed it returns the coordinates for the whole item. Thus even when the columns are reordered it gives an X-value of 0 for SubItem 0. Now to work out how to get around this! Edit 2: Try this Beta:
  13. 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
  14. FREEON, 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 server 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. M23
  15. FREE0N, Welcome to the AutoIt forums. This script appears to me to be automating a game server (Steam) - is that indeed the case? M23
  16. Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states: Moderation Team
  17. WildByDesign, Yes, header colour and 64-bit do not work nicely together - sorry about that. There is a post somewhere in this thread where someone more knowledgeable than myself in these matters explains why. But rover's code was usually pretty solid so using it should not give you any problems. M23 Edit: His final comment: "This is not necessarily completely trivial" is a wonderful piece of understatement!
  18. WildByDesign, Of course there is! But it gets a bit more complicated as we have to use user-drawn colours for the whole ListView. Here is an expanded version of the above example showing how you can do it: #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx_Mod.au3" ; Determine row back colours Global $iEvenBkCol = "0x00FFFF" Global $iOddBkCol = "0xFEFEFE" ; Create GUI $hGUI = GUICreate("LVEx Example", 640, 510) ; Create ListView $cListView = GUICtrlCreateListView("Tom|Dick|Harry", 10, 40, 300, 300, $LVS_SHOWSELALWAYS) _GUICtrlListView_SetExtendedListViewStyle($cListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) _GUICtrlListView_SetColumnWidth($cListView, 0, 93) _GUICtrlListView_SetColumnWidth($cListView, 1, 93) _GUICtrlListView_SetColumnWidth($cListView, 2, 93) ; Create data array and fill listview Global $aLV_List[10] For $i = 0 To UBound($aLV_List) - 1 $aLV_List[$i] = "Tom " & $i & "|Dick " & $i & "|Harry " & $i GUICtrlCreateListViewItem($aLV_List[$i], $cListView) Next ; Initiate LVEx $iLV_Index = _GUIListViewEx_Init($cListView, $aLV_List, Default, Default, True, 16 + 32) ; Retrieve existing colour array - content will be overwritten in the function Global $aLVCol = _GUIListViewEx_ReturnArray($iLV_Index, 2) ; And load it _LoadColour() ; Create header data array Global $aHdrData[][] = [["Blk Tom", "Red Dick", "Blk Harry"], _ ; As colour is enabled, these will replace original titles ["", "0xFF0000;", ""], _ ; Cols 0 & 3 will use default colours ["", "", ""], _ ; All cols text editable [0, 0, 0]] ; All cols resizeable ; And load it _GUIListViewEx_LoadHdrData($iLV_Index, $aHdrData) _GUIListViewEx_MsgRegister() GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch $sRet = _GUIListViewEx_EventMonitor() ; Check for row drag/drop If $sRet <> "" And @extended = 4 Then ; If so, reset row colours _LoadColour() EndIf WEnd Func _LoadColour() Local $sColData ; Alternate row colour For $i = 0 To UBound($aLVCol) - 1 ; Set required colour for row If BitAND($i,1) Then $sColData = ";" & $iOddBkCol Else $sColData = ";" & $iEvenBkCol EndIf ; Fill row For $j = 0 To UBound($aLVCol, 2) - 1 $aLVCol[$i][$j] = $sColData Next Next ; Load colour data array _GUIListViewEx_LoadColour($iLV_Index, $aLVCol) EndFunc Please ask if you have any questions. M23
  19. WildByDesign, Actually you can apply the correct style to the ListView content without using GUICtrlCreateListViewItem. AutoIt kindly stores the ControlID of the row in the "parameter" value of each row within a native ListView - so all you have to do is loop through them as shown in this example: #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx_Mod.au3" ; Create GUI $hGUI = GUICreate("LVEx Example", 640, 510) ; Create ListView $cListView = GUICtrlCreateListView("Tom|Dick|Harry", 10, 40, 300, 300, $LVS_SHOWSELALWAYS) _GUICtrlListView_SetExtendedListViewStyle($cListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) _GUICtrlListView_SetColumnWidth($cListView, 0, 93) _GUICtrlListView_SetColumnWidth($cListView, 1, 93) _GUICtrlListView_SetColumnWidth($cListView, 2, 93) GUICtrlSetBkColor($cListView, 0xFF0000) ; Set ListView back colour <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSetBkColor($cListView, $GUI_BKCOLOR_LV_ALTERNATE) ; Set up alternate line colouring <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; Create array and fill listview Global $aLV_List[10] For $i = 0 To UBound($aLV_List) - 1 $aLV_List[$i] = "Tom " & $i & "|Dick " & $i & "|Harry " & $i GUICtrlCreateListViewItem($aLV_List[$i], $cListView) Next ; Now set up alternate line colour <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $i = 0 To _GUICtrlListView_GetItemCount($cListView) -1 GUICtrlSetBkColor(_GUICtrlListView_GetItemParam($cListView, $i), 0x00CC00) Next ; Initiate LVEx $iLV_Index = _GUIListViewEx_Init($cListView, $aLV_List) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch _GUIListViewEx_EventMonitor() WEnd I hope that helps. M23
  20. WildByDesign, I do not understand the above. _GUIListViewEx_ReadToArray creates an array from the content of an existing ListView to correctly initialise the content within the UDF. How does your data get into the ListView so that the function can read it if you do not create the items at some point? Perhaps posting the lines of your script referring to the ListView creation, loading and initialisation would be helpful in clarifiying what is happening. M23
  21. mr-es335, Although the snippet above works, I wonder why you find it necessary to use Call - you can call the function directly as follows: _Me() Func _Me() _You("Take me To lunch!") EndFunc ;==>_Me Func _You($Msg) MsgBox(0, "You", $Msg) EndFunc ;==>_You M23
  22. WildByDesign, You can set alternating colour rows in native ListViews (created using GUICtrlCreateListView) as follows: ; Create the ListView $cListView = GUICtrlCreateListView(................) ; Now set the required backcolour for the ListView (obviously change the colour as you wish): GUICtrlSetBkColor($cListView, 0xFF0000) ; Then tell the ListView to use alternating row colours GUICtrlSetBkColor($cListView, $GUI_BKCOLOR_LV_ALTERNATE) ; And then when you create each ListViewItem set their colour to the required alternate colour GUICtrlCreateListViewItem($sItemText, $cListView) GUICtrlSetBkColor(-1, 0x00CC00) Obviously you cannot then use my UDF to alter the colours of the ListView - you just have to leave Windows to deal with it! If you use a UDF-created ListView (created using _GUICtrlListView_Create) then you would have to use the UDF to colour the rows, but it becomes very complex. So I would recommend that you stick to the native control if you can. M23
  23. 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
  24. ValentinM, Which is what I suspected and why I asked. If you were to use modifiers for your HotKey than you would be able to use the simple {DELETE} key within the edit. That is why the modifiers exist. M23
×
×
  • Create New...