我有这个 GUI,我有我做的行
我正在做的是使用行状态处理程序来检测何时有人在图形中选择了映射的形状。
这显示了他们实际选择了哪些行。
现在我在该图中也有 2 个助手“地图形状”。当他们在主图中选择某些内容时,我也需要在辅助图中突出显示它。
所以这是我的代码,我希望选择实时更新为 1 或 2,这样我就可以用另外几行来跟进它:
获取与所选行具有相同键名的 helper_rows 并也选择它们,以便用户知道它们是相关的,然后我可以为下一步中的子集获取它们。
所以我的计划:
1.获取表中所有行的列表必须有比这更好的方法......
all_rownums = subset_JMP_Master_Table << GetRowsWhere (:Name != -99999);
2. 在行状态处理程序中:获取选定的行
3. 从总行列表中减去选定的行? 获取 2 个列表:1 个是选中的行,另一个是未选中的行。
4. 将选定标志指定为 1 或 2 到选定列。
5.根据keyname + selected column = 1查找辅助行
6. 也选择辅助行并将整个内容子集用于后续步骤。
subset_JMP_Master_Table << New Column( "selected",
Numeric
, Ordinal
,set each value(0)
);
all_rownums = subset_JMP_Master_Table << GetRowsWhere (:Name != -99999);
//rows_in_subset_table = subset_JMP_Master_ Table << Select All Rows;
//show(rows_in_subset_table);
select_sync_rsh = subset_JMP_Master_Table << MakeRowStateHandler(
Function(
{a}
,if(
select_sync_script_on
,( //start doing things based on script
print(a);
r = subset_JMP_Master_Table << get selected rows;
Column(subset_JMP_Master_Table, "selected")[r] = 1;
q = subset_JMP_Master_Table << GetRowsWhere (:selected != 1);
Column(subset_JMP_Master_Table, "selected")[q] = 2;
)//end doing things based on script
)// end if
); //end function
);
您还可以使用语法1::n产生一个矩阵:
subset_JMP_Master_Table=current data table();
b = 1::nrows(subset_JMP_Master_Table);
我想你可以得到你的 rownum 矩阵
subset_JMP_Master_Table=current data table();
all_rownums = index(1,nrows(subset_JMP_Master_Table));
subset_JMP_Master_Table << New Column( "selected", Numeric, Ordinal, set each value( 0 ) );
fhg = N Rows( subset_JMP_Master_Table );
all_rownums = subset_JMP_Master_Table << GetRowsWhere( :Name != -99999 );
//rows_in_subset_table = subset_JMP_Master_ Table << Select All Rows;
//show(rows_in_subset_table);
select_sync_rsh = subset_JMP_Master_Table << MakeRowStateHandler(
Function(
{a}
,
If(
select_sync_script_on
,
(//start doing things based on script
Print( a ) ;
subset_JMP_Master_Table:selected << Set Each Value( 2 ) ; // just blanket set everything to 2
curr_selected_rows = subset_JMP_Master_Table << get selected rows ; // get the selected rows
subset_JMP_Master_Table:selected[curr_selected_rows] = 1 ; //update the selected rows to 1
)//end doing things based on script
)// end if
); //end function
); //end row state handler