I want to select multiple images using a mousebox.
Below is an example that I've scripted showing how one can select an image one at a time. But since there could be potentially hundreds of pictures, I want my user to be able to select multiple images with a drag function instead of having to click each one. Any tips?
Names Default To Here( 1 );
//dtFull contains image path information
dtFull = Current Data Table();
path1 = dtFull:LocalPath[20];
path2 = dtFull:LocalPath[21];
path3 = dtFull:LocalPath[22];
path4 = dtFull:LocalPath[23];
img = New Image( path1 );
img2 = New Image( path2 );
img3 = New Image( path3 );
img4 = New Image( path4 );
selected = [0, 0, 0, 0];
New Window( "test",
H List Box(
vlb = V List Box(
mb = MouseBox(
pb = Picture Box( img ),
<<SetClickEnable( 1 ),
<<SetClick(
Function( {this, clickpt, event},
If( event == "Pressed",
selected[1] = !selected[1];
If( selected[1],
pb << Select,
pb << Deselect
);
)
)
),
),
MouseBox(
pb2 = Picture Box( img2 ),
<<SetClickEnable( 1 ),
<<SetClick(
Function( {this, clickpt, event},
If( event == "Pressed",
selected[2] = !selected[2];
If( selected[2],
pb2 << Select,
pb2 << Deselect
);
)
)
),
)
),
V List Box(
MouseBox(
pb3 = Picture Box( img3 ),
<<SetClickEnable( 1 ),
<<SetClick(
Function( {this, clickpt, event},
If( event == "Pressed",
selected[3] = !selected[3];
If( selected[3],
pb3 << Select,
pb3 << Deselect
);
)
)
)
),
MouseBox(
pb4 = Picture Box( img4 ),
<<SetClickEnable( 1 ),
<<SetClick(
Function( {this, clickpt, event},
If( event == "Pressed",
selected[4] = !selected[4];
If( selected[4],
pb4 << Select,
pb4 << Deselect
);
)
)
)
)
)
)
);