Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Code Generation

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
dzamoshnikov Posted - Sep 07 2014 : 7:25:52 PM
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)?


1   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Sep 10 2014 : 6:44:01 PM
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

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000