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

In Accessory window Pan Zoom with mouse is not working

joseph_isreavel
1-Newbie

In Accessory window Pan Zoom with mouse is not working

I am creating an Accessory window with the command ProAccessorywindowCreate and displaying the model in it. I could not zoom or pan the model with mouse. The application hangs if I move the window. Any other window can be used or how to make the window that it allows to zoom.



Thanks in Advance.


Joseph

10 REPLIES 10

Joseph,
I would have to see your code to determine if the call to the API was made
incorrectly (however unlikely, it's a simple API). I have a few questions
though:

1. What version of Pro/ENGINEER are you using (Arch, Version, Build)?

2. What is the reason for using the accessory window vs. a "real" window
a la ProObjectwindowCreate()?

3. Did you subsequently call ProMdlDisplay() and ProWindowCurrentSet()?

4. In the 2 code examples for this API I see that the purpose of the
accessory window was to have the user select some geometry and then the
window is deleted. Is this also your use case (may be same answer to #3)?

PATRICK S WILLIAMS
Information Technology
Mechanical Engr Solutions
Missile Systems
Raytheon Company

+1 520.545.6995 (office)
+1 520.446.0244 (pager)
+1 520.545.6399 (fax)
-

6221 S Palo Verde Rd
Tucson, AZ 85706-5093 USA
www.raytheon.com

Follow Raytheon On




This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.


Patrick,


Thanks for the reply,


Here I have my answers to your questions.


1. I am presently using wildfire 4.0 M160.


2. Just I want to show the model to the user, it is just for viewing purpose only.


3. I am using the commands in this sequence. ProAccessorywindowCreate() -> ProwindowActivate() -> ProMdlDisplay() -> ProwindowRefit().



Regards,


Joseph

Hi all,


This should work:


//=============================================================


#if PRO_VER > 29





err = ProAccessorywindowWithTreeCreate( mdl_name, mdl_type, PRO_B_FALSE, &w_id);








#else




err = ProAccessorywindowCreate( mdl_name, mdl_type, &w_id);






#endif



err = ProWindowCurrentSet( w_id);


err = ProMdlDisplay( mdl);








ProWindowRefit( w_id);



//=============================================================



FV.








I agree with Feliks' code snippet. The API ProWindowActivate() can only
be called in an asynchronous graphic mode only application. It does no
good in a synchronous dll application.


Function ProWindowActivate

Description


Activates the specified window.

Hi,


This is not working for me, because I trigger the Accessory window from User Interface. I have a button called preview, in the user interface, whenI press the preview button, accessory window created.Both User Interface and accessory window present, when I try zoom or rotate the model in the Accessory window.


when I close the User Interface still the window present, I have not destroyed, now it zooms and pan is working.



Regards,


Joseph

Ah! That makes a bit more sense. Let me summarize my understanding of
the situation.

1. Your program is launched and a User Interface is shown. Is this a
ProUIDialog (.res file) user interface?
2. The user works with the User Interface and finally clicks the Preview
button. This action creates and shows the accessory window.
3. The user tries to pan/zoom in the accessory window and cannot.
4. The user closes the User Interface and tries to pan/zoom in the
accessory window and is successful.

If my understanding is correct then my suspicion is that the User
Interface was created as a modal dialog box (.DialogStyle =
PROUIDIALOGSTYLE_PARENT_MODAL). Try using some of the other .DialogStyle
values for your dialog box. Read the API Wizard under User's Guide->User
Interface: Dialogs->UI Components->Dialog Attributes and click on the
.DialogSyle link to read more about the other possible values. I hope
this helps.

typedef enum
{
PROUIDIALOGSTYLE_MENU_MODAL = 0,
PROUIDIALOGSTYLE_MODELESS =1,
PROUIDIALOGSTYLE_PARENT_MODAL =2,
PROUIDIALOGSTYLE_APPLICATION_MODAL =3,
PROUIDIALOGSTYLE_MESSAGE_MODELESS =4,
PROUIDIALOGSTYLE_MENU_MODELESS =5,
PROUIDIALOGSTYLE_WORKING =6
}ProUIDialogStyle;



PATRICK S WILLIAMS
Information Technology
Mechanical Engr Solutions
Missile Systems
Raytheon Company

+1 520.545.6995 (office)
+1 520.446.0244 (pager)
+1 520.545.6399 (fax)
-

6221 S Palo Verde Rd
Tucson, AZ 85706-5093 USA
www.raytheon.com

Follow Raytheon On




This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.


Joseph,
I created a sample application that has a simple parent modal dialog box
that allows the user to browse for an object. Then the user can click the
Preview button which creates an accessory window. I was able to pan/zoom
in the accessory window just fine. I am using WF 4.0 M130 x32. Here is
the code snippet for creating the accessory window. In short I was not
able to reproduce your issue.

void PBPreviewAction(char *dialog, char *component, ProAppData data) {

ProError pro_error =
PRO_TK_NO_ERROR;
wchar_t *wszFullPath = NULL;
ProName pro_wszName,
pro_wszExt;
ProMdl pro_mdl =
NULL;
ProMdlType pro_mdlType =
PRO_MDL_UNUSED;
int nWindowId =
0;

//Get the input panel value
pro_error = ProUIInputpanelWidestringGet(dialog, "ipPath",
&wszFullPath);

//Parse the file name
pro_error = ProFilenameParse(wszFullPath, NULL, pro_wszName,
pro_wszExt, NULL);

//Free the input panel value
pro_error = ProWstringFree(wszFullPath);

//Get the model type
if(!wcscmp(pro_wszExt, L"prt"))
pro_mdlType = PRO_MDL_PART;
else if(!wcscmp(pro_wszExt, L"asm"))
pro_mdlType = PRO_MDL_ASSEMBLY;
else
return;

//Open the model in an accessory window
pro_error = ProMdlRetrieve(pro_wszName, pro_mdlType, &pro_mdl);
pro_error = ProAccessorywindowCreate(pro_wszName,
(ProType)pro_mdlType, &nWindowId);
pro_error = ProWindowCurrentSet(nWindowId);
pro_error = ProMdlDisplay(pro_mdl);
}

PATRICK S WILLIAMS
Information Technology
Mechanical Engr Solutions
Missile Systems
Raytheon Company

+1 520.545.6995 (office)
+1 520.446.0244 (pager)
+1 520.545.6399 (fax)
-

6221 S Palo Verde Rd
Tucson, AZ 85706-5093 USA
www.raytheon.com

Follow Raytheon On




This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.


Hi,


I am using MFC UI. If I make the MFC UI non modal, UI quits immediately, after it is created. I donot understand the prob.



Regards,


Joseph

Hi,


Thanks for the reply. Hope that will work for Pro/toolkit UI, I am using MFC in my application and the User Interface is of MFC. I have tried to make the User Interface Modeless, but the UI quites very immediately after the creation.


Regards,
Joseph

Hi,


I have resolved the Issue, the Issue was I have created the dialog as local variable, so it is destroyed after the function execution is over. Now I have created the dialog as Pointer variable, so that it lives even after the function execution is finished.



Joseph

Announcements