#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: Clark Lawton Script Function: Delta Dashboard #ce ---------------------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include "EzMySql.au3" #include #include #include "GuiListViewEx.au3" ; Custom sortable listview library Opt("GUICloseOnESC", 1) #Region Environment and variable definitions Global $sSQL,$iRval,$jRval,$error,$lvItems,$iCntr=0,$maxItems=0 Global $lvItems[1000],$sSelect,$ID,$pos1,$r_[10],$temp,$iLV_Index,$oExcel,$tvi #endregion _WinAPI_Wow64EnableWow64FsRedirection(False) #Region ### START GUI section ### Form= $Form1 = GUICreate("Delta Dashboard", 606, 485, 500, 241,Bitor($WS_MINIMIZEBOX,$WS_MAXIMIZEBOX)) $lvMain = GUICtrlCreateListView("ID|Name |Status |System Impacted |Last updated by|When ", 0, 0, 605, 250, $LVS_SORTDESCENDING) _GUICtrlListView_SetColumnWidth($lvMain, 1, 250) _GUICtrlListView_SetColumnWidth($lvMain, 4, $LVSCW_AUTOSIZE_USEHEADER) $iLV_Index = _GUIListViewEx_Init($lvmain, $lvItems, 0, 0, False, 1 + 8) _GUIListViewEx_MsgRegister() _GUIListViewEx_SetActive($iLV_Index) $ActGroup1 = GUICtrlCreateGroup("Filter by", 25, 260, 555, 95) $r_[1] = GUICtrlCreateRadio("Populate", 70, 285) GUICtrlCreateGroup("", -99, -99, 1, 1) $ActGroup2 = GUICtrlCreateGroup("Actions", 25, 360, 555, 50) GUICtrlSetTip(-1,"Print the selected RFC") $btnExit = GUICtrlCreateButton(" Exit", 390, 375, 80, 25) GUICtrlSetImage(-1,"shell32.dll",329,0) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END GUI section ### ;msgbox(0,"Start up:","Select a filter to load data") $message = "Select a filter to load data" SplashTextOn("Start up", $message, 300, 100, 630, 350, 32, "") Sleep(1500) SplashOff() #Region ### START Main Loop ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $r_[1] _do_action(16) ; Awaiting EA Review Case $GUI_EVENT_CLOSE Exit Case $btnExit Exit EndSwitch $vRet = _GUIListViewEx_EventMonitor() If @error Then MsgBox($MB_SYSTEMMODAL, "Error", "Event error: " & @error) EndIf if @extended > 0 then msgbox(1,"Start up:","action is " & @extended) EndIf WEnd #EndRegion ### END MAIN section ### #Region ### START First Level Functions ### Func _do_action($action) ; $action=1: Populate All local $iCntr _clear_lv() $lvItems[1] = "123|The first description|Open|Gaming|Mark|12/12/2012" $lvItems[2] = "456|The second description|Closed|Audit|Bill|12/12/2012" $lvItems[3] = "789|The third description|Paused|Treasury|Bruce|12/12/2012" $lvItems[4] = "234|The fourth description|Incomplete|Finance|Gordon|12/12/2012" For $iCntr = 1 to 4 GUICtrlCreateListViewItem($lvItems[$iCntr], $lvMain) Next EndFunc #EndRegion ### END First LEvel Functions ### #Region ### Start Second Level Functions ### Func _clear_lv() local $iCntr if $maxItems>0 Then for $iCntr = 1 to $maxItems GUICtrlDelete($lvItems[$iCntr]) Next EndIf EndFunc #endRegion