"...The problem is that Labwindows has assigned the same control ID to
controls
in the two panels, for example, PANEL_MARKER_MIN and PANEL_2_MARKER_MIN have
the same ID, i.e. 16. If I try to use both of these controls in the same
"case" statment, I get an error "Duplicate case label '16'." ..."
UIR editor counts controls inside the single panel they are in. In your
example, PANEL_MARKER_MIN and PANEL_2_MARKER_MIN have the same ID 'cause
both are the 16th control in their panel, rare case but it happens...
There is no way to force UIR editor to assign specific IDs to controls,
unless you add in one panel decoration controls or text messages and put
them before the other control in 'panel order' (ctrl+t in the editor): with
that trick you put in one panel all controls star
ting with order 0 (that is,
with control ID starting from 1 in the .h file), while in the second you
have non-operative contrls with lower IDs and operative controls or
indicator with higher IDs. This is NOT a polite solution since it relies on
the number of controls in the panels: every time you add new controls to a
panel, you should manage how IDs are assigned to them in order to avoid this
problem...
The best solution is to have two nested cases in your code, first one to
manage different panels, second one to manage different controls:
switch (panel) {
case PANEL:
switch (control) {
case PANEL_MARKER_MIN:
break;
// other controls of PANEL must be put here
}
break;
case PANEL_2:
switch (control) {
case PANEL_2_MARKER_MIN:
break;
// Other controls of PANEL_2 here
}
break;
}
That way you avoid any possible confusion and control mismatching that can
c
ause bizarre beaviour to your progrma.
Hope that helps
Roberto