Jump to content
Developer Wiki and Function Reference Links ×

Differentiating selecting a point object from changing a point object in the Reset Event.


Recommended Posts

I have a point PIO, that puts up a StrDialog() to ask a question when the PIO is inserted.  This is triggered in the Reset Event and only triggered if the PIO instance is new.  Unfortunately, The StrDialog is triggered when  the PIO is selected in the tool Palette and then triggered again when when the first instance is placed.  After that, the StrDialog correctly only appears when a PIO is placed.  If I select another tool, the problem reappears when the PIO is again selected in the tool palette.

 

Is there a way to differentiate the time when a point PIO is selected in the tool palette, from when it is placed in the drawing?

 

As always, TIA

Link to comment

The parent of what, and do I want the parent to be nil when I select the PIO in the palette in order to suppress the StrDialog?

 

Prior to the event Case test I have the following lines

    BooResult := GetCustomObjectInfo(PIOName, PIOHan, PIORecHan, PIOWallHan);
    vsoGetEventInfo(TheEvent, EventMessage);

 

At the beginning of the ResetEvent procedure I set the IsNew variable with

IsNew := IsNewCustomObject('RG Grid Marker');

 

In the ResetEvent procedure I draw the graphic and then have the following test:

IF (IsNew & (GetParent(PIOHan) = NIL)) THEN

           {Post the StrDialog()}

Link to comment
1 hour ago, Sam Jones said:

The parent of what, and do I want the parent to be nil when I select the PIO in the palette in order to suppress the StrDialog?

 

Prior to the event Case test I have the following lines

    BooResult := GetCustomObjectInfo(PIOName, PIOHan, PIORecHan, PIOWallHan);
    vsoGetEventInfo(TheEvent, EventMessage);

 

At the beginning of the ResetEvent procedure I set the IsNew variable with

IsNew := IsNewCustomObject('RG Grid Marker');

 

In the ResetEvent procedure I draw the graphic and then have the following test:

IF (IsNew & (GetParent(PIOHan) = NIL)) THEN

           {Post the StrDialog()}

The parent of PIOHan. 
 

You have the test backwards: In preview, the PIO will not have a parent. When placed in the drawing, the parent will be non-nil, and the type will be layer, group, symbol, etc. (If somehow the preview is also non-NIL, check they type).

 

Also be sure to test for duplications and copy/paste. IsNew may be true for both. I think you can get around it with the FirstRegen state (I don't have the constant in front of me) or by setting a hidden field to check if the object is new.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...