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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Exiting a ProMousePick() loop to exit a dialog

BobMonat
1-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

1 REPLY 1
FV
17-Peridot
17-Peridot
(To:BobMonat)

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.

Top Tags