You might try something like this.
Note that if you're not using JMP17 or newer it might not work properly
combinedCols = {"A","B","C"};
New Window("Select Variables", << Type("Modal Dialog"),
<<On Validate(
window:validated
)
,
window:enable function = Function( {},
{Default Local},
majorVar = window:lbMajor << Get Selected;
minorVar = window:lbMinor << Get Selected;
If( N Items( majorVar ) & N Items( minorVar ) & majorVar != minorVar,
window:validated = 1
,
window:validated = 0
);
window:ok button << Enable( window:validated )
);
H List Box(
V List Box(
Text Box("Select Major Variable"),
window:lbMajor = List Box(combinedCols, <<Set Max Selected(1), enable function )
),
V List Box(
Text Box("Select Minor Variable"),
window:lbMinor = List Box(combinedCols, <<Set Max Selected(1), enable function)
)
),
H List Box(
window:ok button = Button Box("OK",
majorVar = window:lbMajor << Get Selected;
minorVar = window:lbMinor << Get Selected;
If( N Items( majorVar ) & N Items( minorVar ) & majorVar != minorVar,
window:validated = 1
,
window:validated = 0
);
If( window:validated,
Print("Processing with major: " || Char(majorVar) || ", minor: " || Char(minorVar));
Window("Select Variables") << Close Window;
,
Beep(); // Optional: Add a beep sound for alert
Show("Invalid Selection");
{window:lbMajor, window:lbMinor} << Select; window:lbMajor << Inval << Update Window;
Wait( 0.25 );
{window:lbMajor, window:lbMinor} << DeSelect; window:lbMajor << Inval << Update Window;
Wait( 0.25 );
{window:lbMajor, window:lbMinor} << Select; window:lbMajor << Inval << Update Window;
Wait( 0.25 );
{window:lbMajor, window:lbMinor} << DeSelect; window:lbMajor << Inval << Update Window;
)
,
<<Enable( 0 )
)
,
Button Box("Cancel", Throw("!Canceled Graph Building") )
)
);
Jordan