ftp.nice.ch/pub/next/audio/editor/Resound.2.5.NIHS.b.tar.gz#/Resound.2.5/APIExamples/Math/ModuleMenuNode.h

This is ModuleMenuNode.h in view mode; [Download] [Up]

/* 

ModuleMenuNode (version 2.2)

Part of the Resound 2.2 API
Sean Luke
Last Revision: December 15, 1993

Copyright 1995, Sean Luke
This code may be used, modified, or distributed freely without 
permission of the author.


This object stores menu information to be passed to Resound from modules.  Future versions will eliminate this node (I hope), when IB is able to generate menus without an application (or I learn to).

The Module Menu Node is a tree node.  The root (top) node of the tree should be set with a blank Name.  This node contains all the menu items to be added directly to Resound's Modules menu.  Children nodes have names, and the menu items _they_ contain are for custom submenus off of the Modules Menu.

Let's say you want to make two menu options in the Modules menu.  One is just a standard menu option, called "Tweak".  The other displays a submenu, called "Twist", with submenu items "Bend", "Break", and "Bust".  You'd generate a tree like this:

(Root Node):
	Name			""		(empty string)
	Receiver		NULL	(indicates this node has submenus)
	Message			(not set)
	Length			2		(for Tweak and Twist)
	Submenu[0]		points to the node Tweak
	Submenu[1]		points to the node Twist
	
Tweak:
	Name			"Tweak"
	Receiver		points to the object that will receive the Tweak message
	Message			selector to the message sent to Tweak's receiver
	Length			0
	Submenu...		(not set)
	
Twist:
	Name			"Twist"
	Receiver		NULL	(indicates this node has submenus)
	Message			(not set)
	Length			3		(for Bend, Break, and Bust)
	Submenu[0]		points to the node Bend
	Submenu[1]		points to the node Break
	Submenu[2]		points to the node Bust	

Bend:
	Name			"Bend"
	Receiver		points to the object that will receive the Bend message
	Message			selector to the message sent to Bend's receiver
	Length			0
	Submenu...		(not set)
	
Break:
	Name			"Break"
	Receiver		points to the object that will receive the Break message
	Message			selector to the message sent to Break's receiver
	Length			0
	Submenu...		(not set)
	
Bust:
	Name			"Bust"
	Receiver		points to the object that will receive the Bust message
	Message			selector to the message sent to Bust's receiver
	Length			0
	Submenu...		(not set)
	

*/




#import <objc/Object.h>
#define MODULE_MENU_NODE_ARRAY_MAX  256
#define MODULE_MENU_NODE_STRING_MAX 256

@interface ModuleMenuNode:Object


/* DATA */

{
	// If Name is empty, then the menu is the list of initial menu choices.
	
	char Name [MODULE_MENU_NODE_STRING_MAX];	// Name to be put in menu
	
	
	
	// if Receiver is NULL, then the menu has submenus
	
	id   Receiver;								// Receiver of method
	SEL	 Message;								// Selector to be sent
	
	
	
	// if Length is 0, then there are no items in the submenu
	// if Receiver is NULL, then Length should not be 0
	
	int  Length;								// Length of Array
	id   Submenu [MODULE_MENU_NODE_ARRAY_MAX];	// The Submenu Array	
}



/*  METHODS */

- init;
- free;

// get various data

- (const char*) getName;
- getReceiver;
- (SEL) getMessage;
- (int) getLength;
- getSubmenu: (int) this_index;


// set various data

- setName: (char *) this_name;
- setReceiver: this_receiver;
- setMessage: (SEL) this_message;
- setLength:(int) this_length;
- setSubmenu: (int) this_index : this_node;


@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.