Skip to content

Commit

Permalink
Merge pull request #1617 from dannyparsons/subset
Browse files Browse the repository at this point in the history
fixed bugs in display of filter/subset dialog and importing subset data
  • Loading branch information
dannyparsons authored Aug 12, 2016
2 parents fbb9e3d + 042f34b commit d50ec90
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion instat/dlgRestrict.vb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Public Class dlgRestrict
'TODO translate
Me.Text = "Subset"
Else
rdoApplyAsSubset.Enabled = True
rdoApplyAsFilter.Enabled = True
rdoApplyAsFilter.Checked = True
'TODO translate
Me.Text = "Filter"
Expand Down
4 changes: 3 additions & 1 deletion instat/frmEditor.vb
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ Public Class frmEditor
End If
End Function

Private Sub columnFilterToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles columnFilterToolStripMenuItem.Click
Private Sub columnFilterToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles columnFilterToolStripMenuItem.Click
dlgRestrict.bIsSubsetDialog = False
dlgRestrict.ShowDialog()
End Sub

Expand Down Expand Up @@ -544,6 +545,7 @@ Public Class frmEditor
End Sub

Private Sub mnuFilter_Click(sender As Object, e As EventArgs) Handles mnuFilter.Click
dlgRestrict.bIsSubsetDialog = False
dlgRestrict.ShowDialog()
End Sub

Expand Down
34 changes: 17 additions & 17 deletions instat/frmMain.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions instat/frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ Public Class frmMain
End Sub

Private Sub SelectToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles mnuOrganiseColumnReshapeSubset.Click
dlgSelect.ShowDialog()
dlgRestrict.bIsSubsetDialog = True
dlgRestrict.ShowDialog()
End Sub

Private Sub mnuModelThreeVariablesFitModel_Click(sender As Object, e As EventArgs) Handles mnuModelThreeVariablesFitModel.Click
Expand Down Expand Up @@ -463,10 +464,6 @@ Public Class frmMain
dlgFromLibrary.ShowDialog()
End Sub

Private Sub mnuManageReshapeSubset_Click(sender As Object, e As EventArgs) Handles mnuOrganiseColumnReshape.Click
dlgSubset.ShowDialog()
End Sub

Private Sub mnuManageDataRename_Click(sender As Object, e As EventArgs) Handles mnuOrganiseDataFrameRenameColumn.Click
dlgName.ShowDialog()
End Sub
Expand Down Expand Up @@ -725,6 +722,7 @@ Public Class frmMain
End Sub

Private Sub mnuManageDataFilter_Click(sender As Object, e As EventArgs) Handles mnuOrganiseDataFrameFilter.Click
dlgRestrict.bIsSubsetDialog = False
dlgRestrict.ShowDialog()
End Sub

Expand Down
7 changes: 5 additions & 2 deletions instat/static/InstatObject/R/data_object_R6.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ data_object <- R6Class("data_object",

# If no name for the data.frame has been given in the list we create a default one.
# Decide how to choose default name index
if (!self$is_metadata(data_name_label)) {
if ( ( is.null(data_name) || data_name == "" || missing(data_name))) {
if ( !(is.null(data_name) || data_name == "" || missing(data_name))) {
self$append_to_metadata(data_name_label, data_name)
}
else if (!self$is_metadata(data_name_label)) {
if (( is.null(data_name) || data_name == "" || missing(data_name))) {
self$append_to_metadata(data_name_label,paste0("data_set_",sprintf("%03d", start_point)))
if (messages) {
message(paste0("No name specified in data_tables list for data frame ", start_point, ".
Expand Down

0 comments on commit d50ec90

Please sign in to comment.