Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Code Generation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dzamoshnikov
Starting Member

USA
1 Posts

Posted - Sep 07 2014 :  7:25:52 PM  Show Profile  Reply with Quote
I'm trying to create a solidworks addin. When I create a menu I have to create a call back using the name I place in the create menu function. Can I do something in visual assist that automatically creates a callback function from the selection?

Add menu Item
---
mCommandGroup.AddCommandItem2("PDF", 0, "", "Save model as PDF", 0, "PDFItemClicked", "PDFEnable", 1001, itemType);

"PDFItemClicked" is one callback.
"PDFEnable" is another callback.

"PDFItemClicked" Callback
---
public void PDFItemClicked() { }

"PDFEnable" Callback
---
public int PDFEnable()
{
// disable the PDF
return 0;
}

***
These callbacks are defined in a separate class; the taskpanehost class.

Is it possible to add these callbacks to a separate class by just highlighting the "PDFItemClicked" text, right clicking, and selecting "Create callback"? Will it automatically be created in the correct class (file)?


accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 10 2014 :  6:44:01 PM  Show Profile  Reply with Quote
You can't do that in 1 step. The closest you can get is via creating a snippet:

public int $clipboard$()
{
return 0;
}

Just put the callback's name on the clipboard (ctrl+C) and when you're at the correct place, you just need to insert the correct snippet either via typing it's shortcut or via selecting from the menu.

To open the snippet editor just use VASSISTX -> Tools -> Edit VA Snippets...

You can learn more about snippets here:
http://docs.wholetomato.com/default.asp?W171
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000