I must be using a different version of CVI that you 5.5 because upon running the program I get a NON_FATAL RUN TIME ERROR at the LoadPanel function. The .uir file must contain a new or upgraded control type. But I appreceiate your efforts on my behalf. I found a way to move controls and have attached the code segments below.
Maybe they will become useful for you or someone else one day. Thanks again! Dale
In the control callback function a global variable is set to the selected control value. i.e. Control = control;
Then the panel callback function is called and it does all the work.
int CVICALLBACK Panel (int panel, int event, void *callbackData,
int eventData1, int eventData2)
{
int status;
int keyMods, rightState, leftState, x, y;
if ( Control == 0 ) return 0; //if no control exit function
if ( Control == PANEL_QUITBUTTON ) return 0; //exit function if Quit button clicked
switch (event)
{
case EVENT_LEFT_CLICK:
SetCtrlAttribute (panel, Control, ATTR_CTRL_VAL, 1); //change control color (LED)
do
{
status = GetRelativeMouseState (panel, 0, &x, &y, &leftState, &rightState,keyMods);
SetCtrlAttribute (panel, Control, ATTR_LEFT, x - 20);
SetCtrlAttribute (panel, Control, ATTR_TOP, y - 20);
SetCtrlAttribute (panel, Control, ATTR_ZPLANE_POSITION, 0);
ProcessDrawEvents ();
} while(leftState == DOWN );
SetCtrlAttribute (panel, Control, ATTR_CTRL_VAL, 0); //change color back to default
Reorder(Control, x, y);
break;
case EVENT_CLOSE:
QuitUserInterface (0);
break;
}
return 0;
}