When I have a larger amount of equal controls (e.g. channels), I usually
place only one of the controls into the .uir file, and then build the
remaining controls programmatically in a loop, using the DuplicateCtrl()
function. The advantages are, that I can set (and change) the control
attributes (position, size, label, colors, callbackfunction ... ) only at
one place in the .uir file, and besides I can store the control ids in an
array from where the controls can be easily accessed.
digOutPanel = LoadPanel (0, "DigitalPanel.uir", DIGO_PANEL);
/* buttons for digital outputs */
GetCtrlAttribute (digOutPanel, DIGO_PANEL_SETOUT, ATTR_WIDTH, &width);
GetCtrlAttribute (digOutPanel, DIGO_PANEL_SETOUT, ATTR_LEFT, &left);
digOutSet[0]=DIGO_PANEL_SETOUT;
for(
i = 1; i < MAX_DO; i++)
{
sprintf(buf, "%02d", i);
digOutSet[i] = DuplicateCtrl (digOutPanel, DIGO_PANEL_SETOUT,
digOutPanel, buf, VAL_KEEP_SAME_POSITION, left + (width+2)*i);
}
Regards,
Manfred
zener schrieb in im Newsbeitrag:
50650000000800000026180000-984882144000@quiq.com...
> I would like to place data into several controls in one panel. These
> controls are labeled CTR_0 through CTR_63 . I would like to use a
> function like:
>
> int value[64]
>
> for (x=0; x<64; x++)
> SetCtrlValue (panelHandle, PANEL_CTR_x, value[x]);
>
> Anyone have an idea short of setting each one on a seperate line?
>
> Any help would be appreciated.