Skip to content

Commit

Permalink
Merge pull request #8552 from N-thony/bug_display_dataview
Browse files Browse the repository at this point in the history
Bug fixes: R-Instat crashes when clicked the Toggle Data View Open and Closed Icon
  • Loading branch information
N-thony authored Oct 18, 2023
2 parents c1cb7b3 + ae53fb2 commit 331af37
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 41 deletions.
7 changes: 5 additions & 2 deletions instat/UserControls/DataGrid/ReoGrid/ucrReoGrid.vb
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ Public MustInherit Class ucrReoGrid
For i = grdData.Worksheets.Count - 1 To 0 Step -1
Dim iGridWorkheetsPosition As Integer = i 'Needed to prevent warning
If _clsDataBook.DataFrames.Where(Function(x) x.strName = grdData.Worksheets(iGridWorkheetsPosition).Name).Count = 0 Then
grdData.RemoveWorksheet(i)
bDeleted = True
' Check if we are deleting the last worksheet
If grdData.Worksheets.Count > 1 Then
grdData.RemoveWorksheet(i)
bDeleted = True
End If
End If
Next
' Force the grid to refresh if a sheet has been deleted as there is sometimes a UI problem otherwise.
Expand Down
83 changes: 44 additions & 39 deletions instat/frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -276,53 +276,58 @@ Public Class frmMain

Public Sub UpdateLayout()

If Not mnuViewDataView.Checked _
AndAlso Not mnuViewOutput.Checked _
AndAlso Not mnuViewColumnMetadata.Checked _
AndAlso Not mnuViewDataFrameMetadata.Checked _
AndAlso Not mnuViewLogScript.Checked _
AndAlso Not mnuViewSwapDataAndMetadata.Checked Then
splOverall.Hide()
Else
splOverall.Show()

'determine splOverall contents visibility
Try
If Not mnuViewDataView.Checked _
AndAlso Not mnuViewOutput.Checked _
AndAlso Not mnuViewColumnMetadata.Checked _
AndAlso Not mnuViewDataFrameMetadata.Checked _
AndAlso Not mnuViewLogScript.Checked _
AndAlso Not mnuViewSwapDataAndMetadata.Checked Then
splOverall.Hide()
Else
splOverall.Show()

'determine splOverall contents visibility

'-------------------------------
'determine splOverall.Panel1 and it's contents visibility

If mnuViewColumnMetadata.Checked OrElse mnuViewDataFrameMetadata.Checked OrElse mnuViewLogScript.Checked Then
'expand panel 1
splOverall.Panel1Collapsed = False
'change splOverall.Panel1Collapsed contents visibilty
If mnuViewColumnMetadata.Checked OrElse mnuViewDataFrameMetadata.Checked Then
splMetadata.Panel1Collapsed = Not mnuViewColumnMetadata.Checked
splMetadata.Panel2Collapsed = Not mnuViewDataFrameMetadata.Checked
splExtraWindows.Panel1Collapsed = False
Else
splExtraWindows.Panel1Collapsed = True
End If
'expand panel 2 based on log script menu item checked status
splExtraWindows.Panel2Collapsed = Not mnuViewLogScript.Checked
Else
splOverall.Panel1Collapsed = True
End If
'-------------------------------

'-------------------------------
'determine splOverall.Panel1 and it's contents visibility
'-------------------------------
'determine splOverall.Panel2 and it's contents visibility

If mnuViewColumnMetadata.Checked OrElse mnuViewDataFrameMetadata.Checked OrElse mnuViewLogScript.Checked Then
'expand panel 1
splOverall.Panel1Collapsed = False
'change splOverall.Panel1Collapsed contents visibilty
If mnuViewColumnMetadata.Checked OrElse mnuViewDataFrameMetadata.Checked Then
splMetadata.Panel1Collapsed = Not mnuViewColumnMetadata.Checked
splMetadata.Panel2Collapsed = Not mnuViewDataFrameMetadata.Checked
splExtraWindows.Panel1Collapsed = False
If mnuViewDataView.Checked OrElse mnuViewOutput.Checked Then
splDataOutput.Panel1Collapsed = Not mnuViewDataView.Checked
splDataOutput.Panel2Collapsed = Not mnuViewOutput.Checked
splOverall.Panel2Collapsed = False
Else
splExtraWindows.Panel1Collapsed = True
splOverall.Panel2Collapsed = True
End If
'expand panel 2 based on log script menu item checked status
splExtraWindows.Panel2Collapsed = Not mnuViewLogScript.Checked
Else
splOverall.Panel1Collapsed = True
End If
'-------------------------------
'-------------------------------

'-------------------------------
'determine splOverall.Panel2 and it's contents visibility

If mnuViewDataView.Checked OrElse mnuViewOutput.Checked Then
splDataOutput.Panel1Collapsed = Not mnuViewDataView.Checked
splDataOutput.Panel2Collapsed = Not mnuViewOutput.Checked
splOverall.Panel2Collapsed = False
Else
splOverall.Panel2Collapsed = True
End If
'-------------------------------

Catch ex As Exception
MsgBox(ex.Message)
End Try

End If
mnuTbDataView.Checked = mnuViewDataView.Checked
mnuOutputWindow.Checked = mnuViewOutput.Checked
mnuLogScript.Checked = mnuViewLogScript.Checked
Expand Down
1 change: 1 addition & 0 deletions instat/ucrDataView.vb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ Public Class ucrDataView
End If
End If
RefreshWorksheet(worksheet, clsDataFrame)

Next
If strCurrWorksheet IsNot Nothing Then
_grid.ReOrderWorksheets(strCurrWorksheet)
Expand Down

0 comments on commit 331af37

Please sign in to comment.