From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Project Template Customization | Capturing the 'Finish' button click event from the NewProjectDialog.vi

Solved!
Go to solution

Hi,

We have created a project template in LabVIEW. I need to show a pop-up when the user clicks on 'Finish' in the create project dialog after configuring his project, saying that "the project is getting created". I have already used 'AfterPage2NoUI' to run the PostCopyScripting.vi.

Is there a way to run the pop-up.vi immediately on the click of the 'Finish' Button. Is there any event generated that is only specific for 'Finish' button (that is not common to cancel and back button click). There is a user event 'Quit' generated but that is common for cancel and finish.

Message 1 of 9
(2,073 Views)
Solution
Accepted by topic author NikithaSairam

Not exactly sure in what context you want do this.

 

The wizard window is just a VI, "ProjectWizard Host.vi". So you can (dynamically) start a VI, that watches VI Activation events. You do need scripting options enabled for that event to show. When it get's such an event, check if the VI that's activated is "ProjectWizard Host.vi". If so, open a reference to that VI. Make sure to wire VIAppRef to the application reference input of Open VI Reference.

 

Once you have the VI's reference, you can dynamically register for value change events of all the controls on the VI, including Finish (I presume, but Next, Back, Cancel and Help worked).

 

Something like the attached VI. Run before entering the wizard. You might just get a popup when you press Finish... Build in 2013, so things might have changed...

Message 2 of 9
(2,048 Views)

When you make your SpecPage class for your custom page, inherit from the following class:

 

resource\dialog\NewProjectWizard\SpecPage\ConfirmQuitSpecPage\ConfirmQuitSpecPage.lvclass

 

This gives you access to override the "Fire Quit Event" VI, which fires whenever the Finish button is clicked.

 

Message 3 of 9
(2,041 Views)

Thanks for your reply. But I need to capture the event in my spec page that runs only after the project wizard is launched. Is there a way to capture it in spec page.vi?

Message 4 of 9
(2,019 Views)

The fire quit event seems to be trigggered even when cancel is pressed. 

Message 5 of 9
(2,017 Views)

@NikithaSairam wrote:

The fire quit event seems to be trigggered even when cancel is pressed. 


That could be. The Cancel might send a value (signaling) to the finish. E.g. Cancel would dismiss changes, then call finish to continue as finish would...

 

You'd have to catch both Finish and Cancel, and if Cancel is pressed first, take appropriate actions.

Message 6 of 9
(2,009 Views)

If you click Finish, then the 'Force Quit' input of the Fire Quit Event.vi will be FALSE.

If you click Cancel, then the 'Force Quit' input of the Fire Quit Event.vi will be TRUE.

 

Hopefully you can use that info to tell if it was a Cancel or a Finish.

0 Kudos
Message 7 of 9
(1,995 Views)

@Darren wrote:

If you click Finish, then the 'Force Quit' input of the Fire Quit Event.vi will be FALSE.

If you click Cancel, then the 'Force Quit' input of the Fire Quit Event.vi will be TRUE.

 

Hopefully you can use that info to tell if it was a Cancel or a Finish.


Hi Darren, 

I tried that and the Force Quit is TRUE for both 'Finish' and 'Cancel'.

0 Kudos
Message 8 of 9
(1,987 Views)

wiebe@CARYA wrote:

Not exactly sure in what context you want do this.

 

The wizard window is just a VI, "ProjectWizard Host.vi". So you can (dynamically) start a VI, that watches VI Activation events. You do need scripting options enabled for that event to show. When it get's such an event, check if the VI that's activated is "ProjectWizard Host.vi". If so, open a reference to that VI. Make sure to wire VIAppRef to the application reference input of Open VI Reference.

 

Once you have the VI's reference, you can dynamically register for value change events of all the controls on the VI, including Finish (I presume, but Next, Back, Cancel and Help worked).

 

Something like the attached VI. Run before entering the wizard. You might just get a popup when you press Finish... Build in 2013, so things might have changed...


I opened the reference of the NewProjectDialog.vi in spec page.vi using its path and registered for the value change events of the controls and it is working fine. Thanks Smiley Happy

0 Kudos
Message 9 of 9
(1,984 Views)