Jump to content

Recommended Posts

Posted

I'm trying to do a pop up for history of something that is selected, I've already parsed the data into a string that has CRLF and TAB to format it a bit (which I can easily change to something else) but I'm trying to come up with a good way of displaying the information. I was thinking about a GUI, but I'd have to make it a static size and then make it scroll in case the text spills over (I do have a UDF for scrolling GUIs from Melba) or maybe a tool tip, but I'm not sure what would work/look better. There can be potentially 60+ fields with changes so I'm trying to make it not look horrible. Anyone have any suggestions? 

 

This is an example of what the data looks like:

Case ID change log

     Field 1

         Changed from ABC to EFG by Joe Blow on 10/20/2015 9:00 AM

     Field 2

         Changed from ABC to EFG by Joe Blow on 10/20/2015 9:00 AM

     Field 4

         Changed from ABC to EFG by Joe Blow on 10/20/2015 9:00 AM

     Field 7

         Changed from ABC to EFG by Joe Blow on 10/20/2015 9:00 AM

Posted

Yes, you can wrap but the problem is sometimes there are 10 elements that changed, sometimes there are 40 so generating a gui with a size that fits the screen is very difficult. The other issue is that some fields have up to 180,000 characters so trying to scroll down through that is brutal. I ended up going with a pop up gui and used a listview to render the data in a way that can be scaled by the user... to hard to handle all the edge cases because the data that changes is so varied.

This is what it looks like:

$hPOS = MouseGetPos()
    Global $GUIHistory = GUICreate("", 605, 30, $hPOS[0], $hPOS[1], $WS_POPUP, -1,$parent)
    $LabHeader = GUICtrlCreateLabel($Header, 8, 8, 285, 30)
    $btX = GUICtrlCreateButton('X', 580, 3, 20, 20)
    $BtApprove = GUICtrlCreateButton('Click to approve', 300, 3, 125, 27)
    If $nStatus<>3 then GUICtrlSetState($BtApprove,$gui_HIDE)
    GUISetState(@SW_SHOW)

    Global $GUIHistory2 = GUICreate("", 605, 292, $hPOS[0], $hPOS[1]+30, $WS_POPUP, -1,$GUIHistory)
    For $z=UBound($adata)-1 to 1 step -1
        if $adata[$z][0]=$adata[$z-1][0] then $adata[$z][0]=''
    Next
    $ListChangelog = GUICtrlCreateListView("", 1, 1, 601, 289)
    _GUICtrlListView_AddColumn($ListChangelog,"Field",100)
    _GUICtrlListView_AddColumn($ListChangelog,"Changed From",150)
    _GUICtrlListView_AddColumn($ListChangelog,"Changed To",150)
    _GUICtrlListView_AddColumn($ListChangelog,"By",75)
    _GUICtrlListView_AddColumn($ListChangelog,"At",130)
    _GUICtrlListView_AddArray($ListChangelog,$adata)

    GUISetState(@SW_SHOW)
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $btX,$GUI_EVENT_CLOSE
                GUIDelete($GUIHistory)
                GUIDelete($GUIHistory2)
                ExitLoop
            Case $btApprove
                ApproveEntry($nID)
                RefreshBoW($idBoWList)
                GUIDelete($GUIHistory)
                GUIDelete($GUIHistory2)
                ExitLoop
        EndSwitch
    WEnd

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...