キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Here's a scripting VI for LVClass default menu

解決済み
解決策を見る

I was asked this morning for a bit of functionality that has been in LV for years but not exposed as a standalone function: how to set or clear the default menu associated with a LabVIEW class. So I did a "create subVI", cleaned up the code a bit, and put an icon on it. Figured it might be useful to other folks, so I'm posting it here. It is saved for LV 2009 and there is no password on the VI.

0 件の賞賛
メッセージ1/11
4,334件の閲覧回数
解決策
トピック作成者AristosQueue (NI)が受理

This "question" is answered.

0 件の賞賛
メッセージ2/11
4,333件の閲覧回数

Sorry if I'm being dense, but what "default menu" does this refer to? 

0 件の賞賛
メッセージ3/11
4,326件の閲覧回数

Er, this IS already exposed and I do it all the time, setting a menu for right-clicking on the object wire.......

 

Without looking at the VI posted, what exactly does it DO?

0 件の賞賛
メッセージ4/11
4,306件の閲覧回数

@for(imstuck) wrote:

Sorry if I'm being dense, but what "default menu" does this refer to? 


The popup menu that you can get when you right click on a class wire. Normally there isn't one unless the developer of the class has set one in the Class Properties dialog. This bit of code sets that menu programmatically.

0 件の賞賛
メッセージ5/11
4,258件の閲覧回数

@Intaris wrote:

Er, this IS already exposed and I do it all the time, setting a menu for right-clicking on the object wire.......


Really? How? I sure didn't know of a direct route to it. Yes, it is in the Class Properties dialog, but a method to set it programmatically?

0 件の賞賛
メッセージ6/11
4,257件の閲覧回数

I usually go the XML down-and-dirty route.  I would make a small change to the string label though:

 

Name of .mnu file to set as Default Menu -- empty string to delete existing -- be certain to save the library after running

0 件の賞賛
メッセージ7/11
4,242件の閲覧回数

@Darin.K wrote:
Name of .mnu file to set as Default Menu -- empty string to delete existing -- be certain to save the library after running

True of any scripting operation.

0 件の賞賛
メッセージ8/11
4,229件の閲覧回数

You know that, I know that, but I have plenty of evidence that many people do not.  Not that I mind the Kudos and Solutions. 

 

The real goal was to see how long a label would have to become before you resorted to a caption, free label, control description or VI description.  スマイリー ウインク

0 件の賞賛
メッセージ9/11
4,224件の閲覧回数

@Darin.K wrote:
The real goal was to see how long a label would have to become before you resorted to a caption, free label, control description or VI description.  スマイリー ウインク

Oh, that's short for me. Ask anyone on LV R&D... as length of variable name/function name increases, the probability of it being written by me rises, hitting certainty somewhere around I think 40 characters. And that's in the text languages. In G, where I'm not typing the names? Oh, I've been known to put paragraphs in labels in my own personal code. I don't ship stuff like that out to you folks because I know it isn't kosher. 🙂

0 件の賞賛
メッセージ10/11
4,210件の閲覧回数