Jump to content

Search the Community

Showing results for tags 'Popup Menu ListView'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 1 result

  1. I have encountered a problem which I am struggling to overcome. My ListView Popup menu was working fine until I altered the number of rows in the test data. I started out with 3000 rows and had several working functions, all accessible from the menu which appears when you click on the column header. I didn't notice anything wrong until I tried 300 rows at which point clicking the the menu items stopped sending messages. The Help File example for _GUICtrlMenu_CreatePopup() uses WM_COMMAND messages and the menu appears as a context menu. I have altered that. The functions called from the menu all have multiple array parameters mainly status, undo/redo buffer action, occurence and type etc... I don't want to have to declare all these variables in the Global scope. For this reproducer I have replaced these functions with message boxes. To understand the problem I am experiencing, alter the 11th line by changing the For Loop repeat value to 300 instead of 1000. You will find the menu stops working. If anyone knows what I am doing wrong, please tell me because I have no idea! #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> ;#include <Array.au3> #Include <GuiMenu.au3> ;#include <StaticConstants.au3> _Run() Func _SetData($hListView) For $i = 0 To 1000 ; <== Change this value to 300 GUICtrlCreateListViewItem( _ $i + 1 &"|"& _ "B_" & $i+Random(100,700, 1) &"|"& _ "C_" & $i+Random(100,700, 1) &"|"& _ "D_" & $i+Random(100,700, 1) &"|"& _ "M_" & $i+Random(100,700, 1) , $hListView) Next EndFunc Func _Run() Local $bStyle = BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX) Local $hDataBuzz = GUICreate(" AU3 Databuzz", @DesktopWidth*.9,@DesktopHeight*.8, Default, Default, $bStyle) Local $sHeadings = "Index" For $i = 1 To 4 $sHeadings &= "| " Next $hListView = GUICtrlCreateListView($sHeadings, 0, 0, @DesktopWidth*.9, @DesktopHeight*.8 -38, _ BitOR($LVS_REPORT,$LVS_SHOWSELALWAYS)) _GUICtrlListView_SetExtendedListViewStyle($hListView, _ BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES)) GUICtrlSetResizing ($hListView, $GUI_DOCKBOTTOM) _GUICtrlListView_HideColumn($hListView, 0) _SetData($hListView) ; For Testing Local $iSelectedCol = 0 GUISetState(@SW_SHOW) Local $ahLVMenu[5] = [1000,1001,1002,1003,1004] ; Column popup menu ;================================================================================ While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $hListView Then $iSelectedCol = GUICtrlGetState($hListView) If $iSelectedCol > 0 Then _LV_PopUpMenu($hDataBuzz, $hListView, $iSelectedCol, $ahLVMenu) EndIf Switch $msg Case $ahLVMenu[0] MsgBox(0, "","Rename") Case $ahLVMenu[1] MsgBox(0, "", "Align") Case $ahLVMenu[2] MsgBox(0, "", "Sort") Case $ahLVMenu[3] MsgBox(0, "", "Move") Case $ahLVMenu[4] MsgBox(0, "", "Delete") EndSwitch WEnd ;=============================================================================== EndFunc Func _LV_PopUpMenu($hDataBuzz, $hListView, $iSelectedCol, $ahLVMenu) Local $aLVData = _GUICtrlListView_GetColumn($hListView, $iSelectedCol) Local $hMenu, $sHeader = $aLVData[5] If $sHeader = " " Then $sHeader = "Col " & $iSelectedCol $hMenu = _GUICtrlMenu_CreatePopup (40) _GUICtrlMenu_InsertMenuItem ($hMenu, 0, "Renane " & $sHeader, $ahLVMenu[0]) _GUICtrlMenu_InsertMenuItem ($hMenu, 1, "Align Right", $ahLVMenu[1]) _GUICtrlMenu_InsertMenuItem ($hMenu, 2, "Sort By " & $sHeader, $ahLVMenu[2]) _GUICtrlMenu_InsertMenuItem ($hMenu, 3, "Move " & $sHeader, $ahLVMenu[3]) _GUICtrlMenu_InsertMenuItem ($hMenu, 4, "Delete " & $sHeader, $ahLVMenu[4]) _GUICtrlMenu_TrackPopupMenu ($hMenu, $hDataBuzz) _GUICtrlMenu_DestroyMenu ($hMenu) Return True EndFunc ;==>_LV_PopUpMenu
×
×
  • Create New...