Include Modify Note in Data Browser

I find myself wanting quickly to add or modify notes to waves when doing an overview in the Data Browser.

The code below will modify the Data Browser such that a control-click/right-click menu includes a command to Modify Note on waves. Execute the command ModifyMyBrowser() in the command line, then open the Data Browser and control/right-click on a wave to see the additional menu item(s).


Function ModifyMyBrowser()

	string brCmd, theStr = "ModifyWaveNote(%s)"
	brCmd = "CreateBrowser"
	Execute brCmd
	brCmd = "ModifyBrowser userlevel=8"
	Execute brCmd
	sprintf brCmd, "ModifyBrowser userMenu=\"Modify Note\", userMenuCommand=\"%s\"", theStr
	Execute brCmd
	brCmd = "ModifyBrowser close"
	Execute brCmd
	return 0
end

Function ModifyWaveNote(thewave)
	wave thewave
	
	string theNote, theHelp, theMenuStr
	variable theWay
	
	theHelp = "Change the wave note with this. Replace With Text clears and puts new. "
        theHelp += "Clear All Text will delete the entire wave note!"
	theMenuStr = "Append Text;Pre-pend Text;Replace With Text;Clear All Text!;"

	prompt theWay, "Modify the note by ", popup, theMenuStr
	prompt theNote, "Text: "
	doprompt/HELP=theHelp "Modify Wave Note", theWay, theNote
	
	if (!V_flag)
		switch(theWay)
			case 1:
				note thewave, theNote
				break
			case 2:
				theNote = theNote + "\r" + note(thewave)
				note/K thewave
				note thewave, theNote
				break
			case 3:
				note/K thewave
				note thewave, theNote
				break
			case 4:
				note/K thewave
				break
		endswitch
	endif
	return 0
end

Forum

Support

Gallery

Igor Pro 10

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More