{"action":"created","comment":{"url":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/comments/54712249","id":54712249,"diff_hunk":"@@ -17,73 +17,118 @@ Imports instat.Translations\n Public Class dlgSummaryBarOrPieChart\n     Private clsRggplotFunction As New RFunction\n     Private clsRgeom_summarybar As New RFunction\n-    Private clsRgeom_Piechart As New RFunction\n     Private clsRaesFunction As New RFunction\n+    Private bFirstLoad As Boolean = True\n+\n     Private Sub cmdOptions_Load(sender As Object, e As EventArgs) Handles MyBase.Load\n         ucrBase.clsRsyntax.SetOperation(\"+\")\n         clsRggplotFunction.SetRCommand(\"ggplot\")\n         clsRaesFunction.SetRCommand(\"aes\")\n         clsRggplotFunction.AddParameter(\"mapping\", clsRFunctionParameter:=clsRaesFunction)\n         ucrBase.clsRsyntax.SetOperatorParameter(True, clsRFunc:=clsRggplotFunction)\n+        clsRgeom_summarybar.SetRCommand(\"geom_bar\")\n+        ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_summarybar)\n+\n         ucrYReceiver.Selector = ucrSummarybarSelector\n         ucrFactorReceiver.Selector = ucrSummarybarSelector\n+        ucrFactorReceiver.SetDataType(\"factor\")\n         ucrSecondFactorReceiver.Selector = ucrSummarybarSelector\n+        ucrSecondFactorReceiver.SetDataType(\"factor\")\n         ucrYReceiver.SetMeAsReceiver()\n         autoTranslate(Me)\n         ucrBase.clsRsyntax.iCallType = 0\n+\n+        If bFirstLoad Then\n+            SetDefaults()\n+            bFirstLoad = False\n+\n+        End If\n     End Sub\n+    Private Sub TestOkEnabled()\n+        If rdoBarChart.Checked = True Then\n+            If Not ucrYReceiver.IsEmpty And Not ucrFactorReceiver.IsEmpty Then\n+                ucrBase.OKEnabled(True)\n+            Else\n+                ucrBase.OKEnabled(False)\n+            End If\n+        ElseIf rdoBarChart.Checked = True Then\n+            If Not ucrYReceiver.IsEmpty And Not ucrSecondFactorReceiver.IsEmpty Then\n+                ucrBase.OKEnabled(True)\n+            Else\n+                ucrBase.OKEnabled(False)\n+            End If\n+        End If\n \n+    End Sub\n+    Private Sub SetDefaults()\n+        rdoBarChart.Checked = True\n+        ucrSummarybarSelector.Reset()\n+        ucrSummarybarSelector.Focus()\n+        TestOkEnabled()\n+    End Sub\n     Private Sub grpChartOptions_CheckedChanged(sender As Object, e As EventArgs) Handles rdoBarChart.CheckedChanged, rdoPieChart.CheckedChanged\n+\n+        Dim clsTempRFunc As New RFunction\n         If rdoBarChart.Checked = True Then\n             lblFactor.Visible = True\n             ucrFactorReceiver.Visible = True\n-            clsRgeom_summarybar.SetRCommand(\"geom_bar\")\n             clsRgeom_summarybar.AddParameter(\"stat\", Chr(34) & \"identity\" & Chr(34))\n+            ucrBase.clsRsyntax.RemoveOperatorParameter(\"polar\")\n             ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_summarybar)\n \n-        Else 'rdoPieChart.Checked = True\n-            Dim clsTempOp As New ROperator\n-            Dim clsTempRFunc As New RFunction\n-            clsTempOp.SetOperation(\"+\")\n-\n+        Else rdoPieChart.Checked = True\n             clsRaesFunction.AddParameter(\"x\", Chr(34) & Chr(34))\n             lblFactor.Visible = False\n             ucrFactorReceiver.Visible = False","path":"instat/dlgSummaryBarOrPieChart.vb","position":73,"original_position":73,"commit_id":"014d6b541338f5068702f3778f3ef7d9031c7cd0","original_commit_id":"014d6b541338f5068702f3778f3ef7d9031c7cd0","user":{"login":"dannyparsons","id":11214914,"avatar_url":"https://avatars.githubusercontent.com/u/11214914?v=3","gravatar_id":"","url":"https://api.github.com/users/dannyparsons","html_url":"https://github.com/dannyparsons","followers_url":"https://api.github.com/users/dannyparsons/followers","following_url":"https://api.github.com/users/dannyparsons/following{/other_user}","gists_url":"https://api.github.com/users/dannyparsons/gists{/gist_id}","starred_url":"https://api.github.com/users/dannyparsons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dannyparsons/subscriptions","organizations_url":"https://api.github.com/users/dannyparsons/orgs","repos_url":"https://api.github.com/users/dannyparsons/repos","events_url":"https://api.github.com/users/dannyparsons/events{/privacy}","received_events_url":"https://api.github.com/users/dannyparsons/received_events","type":"User","site_admin":false},"body":"Ok thanks for the clear explanation. I understand now why you've done it this way. I think there are still other options for how we do this that would look better on the dialog. I'll discuss with Roger first and get back to you.","created_at":"2016-03-02T11:39:05Z","updated_at":"2016-03-02T11:39:05Z","html_url":"https://github.com/africanmathsinitiative/Instat/pull/995#discussion_r54712249","pull_request_url":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/995","_links":{"self":{"href":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/comments/54712249"},"html":{"href":"https://github.com/africanmathsinitiative/Instat/pull/995#discussion_r54712249"},"pull_request":{"href":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/995"}}},"pull_request":{"url":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/995","id":61367550,"html_url":"https://github.com/africanmathsinitiative/Instat/pull/995","diff_url":"https://github.com/africanmathsinitiative/Instat/pull/995.diff","patch_url":"https://github.com/africanmathsinitiative/Instat/pull/995.patch","issue_url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/995","number":995,"state":"open","locked":false,"title":"Tidying up barchartsfrom summary","user":{"login":"maxwellfundi","id":9798689,"avatar_url":"https://avatars.githubusercontent.com/u/9798689?v=3","gravatar_id":"","url":"https://api.github.com/users/maxwellfundi","html_url":"https://github.com/maxwellfundi","followers_url":"https://api.github.com/users/maxwellfundi/followers","following_url":"https://api.github.com/users/maxwellfundi/following{/other_user}","gists_url":"https://api.github.com/users/maxwellfundi/gists{/gist_id}","starred_url":"https://api.github.com/users/maxwellfundi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxwellfundi/subscriptions","organizations_url":"https://api.github.com/users/maxwellfundi/orgs","repos_url":"https://api.github.com/users/maxwellfundi/repos","events_url":"https://api.github.com/users/maxwellfundi/events{/privacy}","received_events_url":"https://api.github.com/users/maxwellfundi/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-02T08:43:24Z","updated_at":"2016-03-02T11:39:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55e13c3efea7c6e8f00099366d0c5e01daf21c6f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/995/commits","review_comments_url":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/995/comments","review_comment_url":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/995/comments","statuses_url":"https://api.github.com/repos/africanmathsinitiative/Instat/statuses/014d6b541338f5068702f3778f3ef7d9031c7cd0","head":{"label":"maxwellfundi:summaryBarTidying","ref":"summaryBarTidying","sha":"014d6b541338f5068702f3778f3ef7d9031c7cd0","user":{"login":"maxwellfundi","id":9798689,"avatar_url":"https://avatars.githubusercontent.com/u/9798689?v=3","gravatar_id":"","url":"https://api.github.com/users/maxwellfundi","html_url":"https://github.com/maxwellfundi","followers_url":"https://api.github.com/users/maxwellfundi/followers","following_url":"https://api.github.com/users/maxwellfundi/following{/other_user}","gists_url":"https://api.github.com/users/maxwellfundi/gists{/gist_id}","starred_url":"https://api.github.com/users/maxwellfundi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxwellfundi/subscriptions","organizations_url":"https://api.github.com/users/maxwellfundi/orgs","repos_url":"https://api.github.com/users/maxwellfundi/repos","events_url":"https://api.github.com/users/maxwellfundi/events{/privacy}","received_events_url":"https://api.github.com/users/maxwellfundi/received_events","type":"User","site_admin":false},"repo":{"id":51063425,"name":"Instat","full_name":"maxwellfundi/Instat","owner":{"login":"maxwellfundi","id":9798689,"avatar_url":"https://avatars.githubusercontent.com/u/9798689?v=3","gravatar_id":"","url":"https://api.github.com/users/maxwellfundi","html_url":"https://github.com/maxwellfundi","followers_url":"https://api.github.com/users/maxwellfundi/followers","following_url":"https://api.github.com/users/maxwellfundi/following{/other_user}","gists_url":"https://api.github.com/users/maxwellfundi/gists{/gist_id}","starred_url":"https://api.github.com/users/maxwellfundi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxwellfundi/subscriptions","organizations_url":"https://api.github.com/users/maxwellfundi/orgs","repos_url":"https://api.github.com/users/maxwellfundi/repos","events_url":"https://api.github.com/users/maxwellfundi/events{/privacy}","received_events_url":"https://api.github.com/users/maxwellfundi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maxwellfundi/Instat","description":"Development of the new version of Instat","fork":true,"url":"https://api.github.com/repos/maxwellfundi/Instat","forks_url":"https://api.github.com/repos/maxwellfundi/Instat/forks","keys_url":"https://api.github.com/repos/maxwellfundi/Instat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maxwellfundi/Instat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maxwellfundi/Instat/teams","hooks_url":"https://api.github.com/repos/maxwellfundi/Instat/hooks","issue_events_url":"https://api.github.com/repos/maxwellfundi/Instat/issues/events{/number}","events_url":"https://api.github.com/repos/maxwellfundi/Instat/events","assignees_url":"https://api.github.com/repos/maxwellfundi/Instat/assignees{/user}","branches_url":"https://api.github.com/repos/maxwellfundi/Instat/branches{/branch}","tags_url":"https://api.github.com/repos/maxwellfundi/Instat/tags","blobs_url":"https://api.github.com/repos/maxwellfundi/Instat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maxwellfundi/Instat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maxwellfundi/Instat/git/refs{/sha}","trees_url":"https://api.github.com/repos/maxwellfundi/Instat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maxwellfundi/Instat/statuses/{sha}","languages_url":"https://api.github.com/repos/maxwellfundi/Instat/languages","stargazers_url":"https://api.github.com/repos/maxwellfundi/Instat/stargazers","contributors_url":"https://api.github.com/repos/maxwellfundi/Instat/contributors","subscribers_url":"https://api.github.com/repos/maxwellfundi/Instat/subscribers","subscription_url":"https://api.github.com/repos/maxwellfundi/Instat/subscription","commits_url":"https://api.github.com/repos/maxwellfundi/Instat/commits{/sha}","git_commits_url":"https://api.github.com/repos/maxwellfundi/Instat/git/commits{/sha}","comments_url":"https://api.github.com/repos/maxwellfundi/Instat/comments{/number}","issue_comment_url":"https://api.github.com/repos/maxwellfundi/Instat/issues/comments{/number}","contents_url":"https://api.github.com/repos/maxwellfundi/Instat/contents/{+path}","compare_url":"https://api.github.com/repos/maxwellfundi/Instat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maxwellfundi/Instat/merges","archive_url":"https://api.github.com/repos/maxwellfundi/Instat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maxwellfundi/Instat/downloads","issues_url":"https://api.github.com/repos/maxwellfundi/Instat/issues{/number}","pulls_url":"https://api.github.com/repos/maxwellfundi/Instat/pulls{/number}","milestones_url":"https://api.github.com/repos/maxwellfundi/Instat/milestones{/number}","notifications_url":"https://api.github.com/repos/maxwellfundi/Instat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maxwellfundi/Instat/labels{/name}","releases_url":"https://api.github.com/repos/maxwellfundi/Instat/releases{/id}","deployments_url":"https://api.github.com/repos/maxwellfundi/Instat/deployments","created_at":"2016-02-04T08:50:05Z","updated_at":"2016-02-04T08:50:08Z","pushed_at":"2016-03-02T11:03:48Z","git_url":"git://github.com/maxwellfundi/Instat.git","ssh_url":"git@github.com:maxwellfundi/Instat.git","clone_url":"https://github.com/maxwellfundi/Instat.git","svn_url":"https://github.com/maxwellfundi/Instat","homepage":null,"size":7986,"stargazers_count":0,"watchers_count":0,"language":"Visual Basic","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"africanmathsinitiative:master","ref":"master","sha":"2b26f6a466674060bd37bdb4cb6ca327a0d8afa7","user":{"login":"africanmathsinitiative","id":13917566,"avatar_url":"https://avatars.githubusercontent.com/u/13917566?v=3","gravatar_id":"","url":"https://api.github.com/users/africanmathsinitiative","html_url":"https://github.com/africanmathsinitiative","followers_url":"https://api.github.com/users/africanmathsinitiative/followers","following_url":"https://api.github.com/users/africanmathsinitiative/following{/other_user}","gists_url":"https://api.github.com/users/africanmathsinitiative/gists{/gist_id}","starred_url":"https://api.github.com/users/africanmathsinitiative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/africanmathsinitiative/subscriptions","organizations_url":"https://api.github.com/users/africanmathsinitiative/orgs","repos_url":"https://api.github.com/users/africanmathsinitiative/repos","events_url":"https://api.github.com/users/africanmathsinitiative/events{/privacy}","received_events_url":"https://api.github.com/users/africanmathsinitiative/received_events","type":"Organization","site_admin":false},"repo":{"id":44009238,"name":"Instat","full_name":"africanmathsinitiative/Instat","owner":{"login":"africanmathsinitiative","id":13917566,"avatar_url":"https://avatars.githubusercontent.com/u/13917566?v=3","gravatar_id":"","url":"https://api.github.com/users/africanmathsinitiative","html_url":"https://github.com/africanmathsinitiative","followers_url":"https://api.github.com/users/africanmathsinitiative/followers","following_url":"https://api.github.com/users/africanmathsinitiative/following{/other_user}","gists_url":"https://api.github.com/users/africanmathsinitiative/gists{/gist_id}","starred_url":"https://api.github.com/users/africanmathsinitiative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/africanmathsinitiative/subscriptions","organizations_url":"https://api.github.com/users/africanmathsinitiative/orgs","repos_url":"https://api.github.com/users/africanmathsinitiative/repos","events_url":"https://api.github.com/users/africanmathsinitiative/events{/privacy}","received_events_url":"https://api.github.com/users/africanmathsinitiative/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/africanmathsinitiative/Instat","description":"Development of the new version of Instat","fork":false,"url":"https://api.github.com/repos/africanmathsinitiative/Instat","forks_url":"https://api.github.com/repos/africanmathsinitiative/Instat/forks","keys_url":"https://api.github.com/repos/africanmathsinitiative/Instat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/africanmathsinitiative/Instat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/africanmathsinitiative/Instat/teams","hooks_url":"https://api.github.com/repos/africanmathsinitiative/Instat/hooks","issue_events_url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/events{/number}","events_url":"https://api.github.com/repos/africanmathsinitiative/Instat/events","assignees_url":"https://api.github.com/repos/africanmathsinitiative/Instat/assignees{/user}","branches_url":"https://api.github.com/repos/africanmathsinitiative/Instat/branches{/branch}","tags_url":"https://api.github.com/repos/africanmathsinitiative/Instat/tags","blobs_url":"https://api.github.com/repos/africanmathsinitiative/Instat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/africanmathsinitiative/Instat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/africanmathsinitiative/Instat/git/refs{/sha}","trees_url":"https://api.github.com/repos/africanmathsinitiative/Instat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/africanmathsinitiative/Instat/statuses/{sha}","languages_url":"https://api.github.com/repos/africanmathsinitiative/Instat/languages","stargazers_url":"https://api.github.com/repos/africanmathsinitiative/Instat/stargazers","contributors_url":"https://api.github.com/repos/africanmathsinitiative/Instat/contributors","subscribers_url":"https://api.github.com/repos/africanmathsinitiative/Instat/subscribers","subscription_url":"https://api.github.com/repos/africanmathsinitiative/Instat/subscription","commits_url":"https://api.github.com/repos/africanmathsinitiative/Instat/commits{/sha}","git_commits_url":"https://api.github.com/repos/africanmathsinitiative/Instat/git/commits{/sha}","comments_url":"https://api.github.com/repos/africanmathsinitiative/Instat/comments{/number}","issue_comment_url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/comments{/number}","contents_url":"https://api.github.com/repos/africanmathsinitiative/Instat/contents/{+path}","compare_url":"https://api.github.com/repos/africanmathsinitiative/Instat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/africanmathsinitiative/Instat/merges","archive_url":"https://api.github.com/repos/africanmathsinitiative/Instat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/africanmathsinitiative/Instat/downloads","issues_url":"https://api.github.com/repos/africanmathsinitiative/Instat/issues{/number}","pulls_url":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls{/number}","milestones_url":"https://api.github.com/repos/africanmathsinitiative/Instat/milestones{/number}","notifications_url":"https://api.github.com/repos/africanmathsinitiative/Instat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/africanmathsinitiative/Instat/labels{/name}","releases_url":"https://api.github.com/repos/africanmathsinitiative/Instat/releases{/id}","deployments_url":"https://api.github.com/repos/africanmathsinitiative/Instat/deployments","created_at":"2015-10-10T12:10:32Z","updated_at":"2016-01-11T15:31:19Z","pushed_at":"2016-03-02T11:22:58Z","git_url":"git://github.com/africanmathsinitiative/Instat.git","ssh_url":"git@github.com:africanmathsinitiative/Instat.git","clone_url":"https://github.com/africanmathsinitiative/Instat.git","svn_url":"https://github.com/africanmathsinitiative/Instat","homepage":null,"size":9587,"stargazers_count":0,"watchers_count":0,"language":"Visual Basic","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":20,"forks":13,"open_issues":20,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/995"},"html":{"href":"https://github.com/africanmathsinitiative/Instat/pull/995"},"issue":{"href":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/995"},"comments":{"href":"https://api.github.com/repos/africanmathsinitiative/Instat/issues/995/comments"},"review_comments":{"href":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/995/comments"},"review_comment":{"href":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/africanmathsinitiative/Instat/pulls/995/commits"},"statuses":{"href":"https://api.github.com/repos/africanmathsinitiative/Instat/statuses/014d6b541338f5068702f3778f3ef7d9031c7cd0"}}}}