cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Exiting a ProMousePick() loop to exit a dialog

BobMonat
Newbie

Exiting a ProMousePick() loop to exit a dialog

I have inherited a application which creates a ProUIDialog. One of the pushbuttons activates a loop to allow the user to select items from a 3D display list.

The code for the mouse pick is:

while(1) {

status = ProMousePickGet (PRO_ANY_BUTTON, &button, screen_pt);

if ( button == PRO_MIDDLE_BUTTON || status != PRO_TK_NO_ERROR ) break;

...

}

Picking the middle mouse button exits the loop and makes the dialog active again. Is there any way to set the dialog cancel button (red X) to be enabled? I set ProUIDialogCloseActionSet() but when in the loop, picking the cancel button just rings a bell.

Any ideas?

Thanks,

Bob

Tags (2)
1 REPLY 1

Re: Exiting a ProMousePick() loop to exit a dialog

Hi all,

Bob,

Without knowing how the loop is constructed it is a shot in a dark...

I would either insert a dialog close statement in a button check block:

if( button == PRO_MIDDLE_BUTTON ... ) {

     ProUIDIalogUnload(); // check spelling

     break;

}

or use a static module level variable which would be set depending on button pressed and an observer within a dialog code to react on a variable value.

HIH.

Feliks.

Announcements