// Script function: Input dialog for counting how many voters voted
// Requirement: Open an images with ROIs

// Unless named starting with GlobalSino, EM, My, Self, the function commands are defined 
//by Gatan DM, please see at link: http://www.globalsino.com/EM/page2597.html

 
TagGroup GlobalSino, EMItems
 
GlobalSino = DLGCreateDialog( "Please vote by selection", EMItems )
 
TagGroup EMVote1 = DLGCreateCheckBox( "Voter A", 0)
TagGroup EMVote2 = DLGCreateCheckBox( "Voter B", 0)
TagGroup EMVote3 = DLGCreateCheckBox( "Voter C", 0)
TagGroup EMVote4 = DLGCreateCheckBox( "Voter D", 0)
 
EMItems.DLGAddElement( EMVote1 )
EMItems.DLGAddElement( EMVote2 )
EMItems.DLGAddElement( EMVote3 )
EMItems.DLGAddElement( EMVote4 )

 
if ( !Alloc( UIframe ).Init( GlobalSino ).Pose() ) exit (0)

number d = EMVote1.DLGGetValue() + EMVote2.DLGGetValue() + EMVote3.DLGGetValue() + EMVote4.DLGGetValue()
 
Result( "Voter A: " + EMVote1.DLGGetValue() + "\n" )
Result( "Voter B: " + EMVote2.DLGGetValue() + "\n" )
Result( "Voter C: " + EMVote3.DLGGetValue() + "\n" )
Result( "Voter D: " + EMVote3.DLGGetValue() + "\n" )
Result( "Totally " + d + " voted now \n" )

Result( "\n\n" )




