Permalink
Browse files

fix detection of open Function

Rather than just checking if compilestring is "{ "open Function" }" use
a regular expression as the function may still contain argument
definitions (anyway, it would be much better to test the function for
its openess at inititialisation and store the result separately, so thet
could be used instead of a regex test).

Signed-off-by: Stefan Nussbaumer <st9fan@gmail.com>
  • Loading branch information...
nuss committed Dec 13, 2017
1 parent bae668c commit 5d8a844c003f38171dd33083b319e3219f24eaef
Showing with 8 additions and 8 deletions.
  1. +4 −4 CVCenter/CVWidgetEditor.sc
  2. +4 −4 CVCenter/CVWidgetMSEditor.sc
@@ -937,7 +937,7 @@ CVWidgetEditor : AbstractCVWidgetEditor {
flow3.shift(0, 5);
if (funcString != "{ \"open Function\" }", {
if ("{(.*)\"open Function\" }".matchRegexp(funcString).not, {
actionsUIs[name].nameField = StaticText(cTabView3, Point(flow3.bounds.width-173, 15)) }, {
actionsUIs[name].nameField = StaticText(cTabView3, Point(flow3.bounds.width-110, 15))
});
@@ -948,7 +948,7 @@ CVWidgetEditor : AbstractCVWidgetEditor {
.string_(""+name.asString)
;
if (funcString != "{ \"open Function\" }", {
if ("{(.*)\"open Function\" }".matchRegexp(funcString).not, {
flow3.shift(5, 0);
actionsUIs[name].activate = Button(cTabView3, Point(60, 15))
.font_(staticTextFont)
@@ -1095,7 +1095,7 @@ CVWidgetEditor : AbstractCVWidgetEditor {
flow3.shift(0, 5);
if (funcString != "{ \"open Function\" }", {
if ("{(.*)\"open Function\" }".matchRegexp(funcString).not, {
actionsUIs[name].nameField = StaticText(cTabView3, Point(flow3.bounds.width-173, 15))
}, {
actionsUIs[name].nameField = StaticText(cTabView3, Point(flow3.bounds.width-110, 15))
@@ -1109,7 +1109,7 @@ CVWidgetEditor : AbstractCVWidgetEditor {
flow3.shift(5, 0);
if (funcString != "{ \"open Function\" }", {
if ("{(.*)\"open Function\" }".matchRegexp(funcString).not, {
actionsUIs[name].activate = Button(cTabView3, Point(60, 15))
.font_(staticTextFont)
.states_([
@@ -1339,7 +1339,7 @@ CVWidgetMSEditor : AbstractCVWidgetEditor {
flow3.shift(0, 5);
if (funcString != "{ \"open Function\" }", {
if ("{(.*)\"open Function\" }".matchRegexp(funcString).not, {
actionsUIs[name].nameField = StaticText(cTabView3, Point(flow3.bounds.width-173, 15));
}, {
actionsUIs[name].nameField = StaticText(cTabView3, Point(flow3.bounds.width-110, 15));
@@ -1353,7 +1353,7 @@ CVWidgetMSEditor : AbstractCVWidgetEditor {
flow3.shift(5, 0);
if (funcString != "{ \"open Function\" }", {
if ("{(.*)\"open Function\" }".matchRegexp(funcString).not, {
actionsUIs[name].activate = Button(cTabView3, Point(60, 15))
.font_(staticTextFont)
.states_([
@@ -1493,7 +1493,7 @@ CVWidgetMSEditor : AbstractCVWidgetEditor {
flow3.shift(0, 5);
if (funcString != "{ \"open Function\" }", {
if ("{(.*)\"open Function\" }".matchRegexp(funcString).not, {
actionsUIs[name].nameField = StaticText(cTabView3, Point(flow3.bounds.width-173, 15));
}, {
actionsUIs[name].nameField = StaticText(cTabView3, Point(flow3.bounds.width-110, 15));
@@ -1507,7 +1507,7 @@ CVWidgetMSEditor : AbstractCVWidgetEditor {
flow3.shift(5, 0);
if (funcString != "{ \"open Function\" }", {
if ("{(.*)\"open Function\" }".matchRegexp(funcString).not, {
actionsUIs[name].activate = Button(cTabView3, Point(60, 15))
.font_(staticTextFont)
.states_([

0 comments on commit 5d8a844

Please sign in to comment.