捕鼠器和Biviariate框架<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />我有一个分析出一个双变量情节的分析。 当我通过Mousetrap操作添加一些额外的功能时,我无法选择点,我不知道为什么。 有没有办法防止这种情况或者至少要重新添加此功能?
我怎样才能解决这个问题?
dt = Open(“$ SAMPLE_DATA / Big Class.jmp”);
nw = new Window(“MouseTrap Test”,Vlb = vlistbox());
vlb << Append(biv = dt << Bivariate(Y(:height),X(:weight));
rbiv = biv << report;
rbiv [frame box(1)] << Add Graphics Script(Mousetrap(print(“test”),print(“test test”)));
biv2 = dt <<双变量(Y(:高度),X(:重量));)
回复:捕鼠器和Biviariate框架盒谢谢你,谢谢你,谢谢你。 这让我发疯了。
而且我很确定你的意思是“\!n”。 您的C#/ C ++正在显示。
回复:捕鼠器和Biviariate框架盒所以,#4然后。 对于任何阅读的人...此脚本在附加到上图的图形脚本中使用名为“MouseTrap”的函数。 当您在上方图形上使用鼠标拖动时,MouseTrap功能会捕获鼠标移动,从而阻止在“橡皮筋矩形”中正常选择点。 为了模拟选择行为,MouseTrap维护状态变量“scripton”和“startx ... othery”。 msharp 创建脚本以了解是否运行一个脚本,该脚本在添加到矩形的每个附加点上运行时间太长。 MouseTrap还使用脚本来跟踪按钮是否被按下。 如果是这样,则X,Y在startx中捕获,starty,否则在otherx,othery中捕获。 如果不是第一次,MouseTrap在where语句中使用startx ... othery来实际选择表中的行。 SelectWhere命令帐户中的Min和Max函数用于从上到下,从下到上,从左到右绘制选择矩形。
MakeRowStateHandler应该也可以执行与MouseTrap相同的eval;这里它只打印更改的行。 此代码中还有其他一些打印语句;查看日志以了解发生了什么。
//Startdt = Open( "$SAMPLE_DATA/Big Class.jmp" );script = "\[New Window("Test", Text Box("Hello"));]\";scripton = 1; // this is a better way to deal with row state changes (and not needed for the rest of the example) rs = dt<startx = .;starty = .;otherx = .;othery = .;nw = New Window( "MouseTrap Test", Vlb = V List Box() );vlb << Append( biv = dt << Bivariate( Y( :height ), X( :weight ) ); rbiv = biv << report; rbiv[frame box( 1 )] << Add Graphics Script( If( !Is Missing( startx ), Line( {startx, starty}, {otherx, starty}, {otherx, othery}, {startx, othery}, {startx, starty} ) ); Mousetrap( If( scripton, write("down\n"); startx = x; starty = y; , write("move\n"); otherx = x; othery = y; dt << selectwhere( Min( starty, othery ) < :height < Max( starty, othery ) & Min( startx, otherx ) < :weight < Max( startx, otherx ) ); ); scripton = 0; , write("up\n"); scripton = 1; startx = .; // toggle off Eval( Parse( script ) ); ); ); biv2 = dt << Bivariate( Y( :height ), X( :weight ) ););回复:捕鼠器和Biviariate框架盒所有这些都是OR语句。 我需要一个AND语句。 如何选择点并运行脚本?您列出的所有内容都会选择点或运行脚本。
更多信息,我有一个脚本,每次选择一个点时运行。 拖动并选择多个点时,如果用户很慢,脚本将多次运行。 我想阻止脚本运行,直到用户释放鼠标。 见下面的例子。
//开始
dt = Open(“$ SAMPLE_DATA / Big Class.jmp”);
script =“\ [新窗口(”测试“,文本框(”Hello“));] \”;
scripton = 1;
//选定的脚本
dt <<新栏目(“选定的剧本”,
数字,
式(
如果(选中(行状态())和脚本== 1,
的eval(解析(脚本))
)
)
);
列(dt,“选定的脚本”)<<隐藏;
//固定?!?!?
nw = new Window(“MouseTrap Test”,Vlb = vlistbox());
vlb << Append(biv = dt << Bivariate(Y(:height),X(:weight));
rbiv = biv << report;
rbiv [frame box(1)] <<添加图形脚本(Mousetrap(scripton = 0,scripton = 1));
biv2 = dt <<双变量(Y(:高度),X(:重量));
)
回复:捕鼠器和Biviariate框架盒三种方式:
1)使用当前脚本的刷子工具(按B)(在刷牙时尝试保持alt以更改刷子大小)。 当画笔工具处于活动状态时,捕鼠器不会。
2)修改脚本,将图形脚本放在图纸列表的前面
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );nw = new Window("MouseTrap Test", Vlb = vlistbox());vlb << Append(biv = dt << Bivariate( Y( :height ), X( :weight ) );rbiv = biv << report;rbiv[frame box(1)] << Add Graphics Script( 1, Mousetrap(print("test"), print("test test")));biv2 = dt << Bivariate( Y( :height ), X( :weight ) );)逻辑是:首先绘制的脚本由后续图形脚本绘制。 所以鼠标命中测试是按照相反的顺序进行的 - 如果它最后绘制它更明显,并且应该更容易用鼠标击中。 现在,如果单击一个点,标记seg将使用鼠标(您可以拖出一个选择矩形)。 如果单击一个点,捕鼠器脚本将单击该按钮。 如果单击一个点,则无法选择矩形。 您可以使用rightClick-> Customize进行实验并上下移动脚本。

(我保存了剧本并偷看了如何做上面的“1”。)
3)使用Handle而不是Mousetrap。 除非你真的需要捕鼠器才能捕获所有鼠标活动。 手柄仅捕获方形手柄上的咔嗒声。
4)如果你真的需要,我想你可以在捕鼠器中重新实现选择逻辑。 1-3看起来好多了。