annotate lisp/oobr/tree-nx/NamedTree.m @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 //
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 // NamedTree.m -- a generic class to build tree data structures
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 // This class requires the String class, also by Don Yacktman.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 // Written by Don Yacktman (c) 1993 by Don Yacktman.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 // All rights reserved.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 //
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 // You may use and copy this class freely as long as you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 // comply with the following terms:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 // (1) If you use this class in an application which you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 // intend to sell commercially, as shareware, or otherwise,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 // you may only do so with express written permission
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 // of the author. Use in applications which will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 // be distributed free of charge is encouraged.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 // (2) You must include the source code to this object and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 // all accompanying documentation with your application,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 // or provide it to users if requested, free of charge.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 // (3) Do not remove the author's name or any of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 // copyright notices
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 //
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 #import "NamedTree.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 #import "TreeView.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 @implementation NamedTree
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 - setTreeName:string { treeName = string; return self; }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 - (const char *)treeName { return [treeName stringValue]; }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 - activateNode:sender
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 // int msgDelivered;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 // this action message is sent whenever the button associated with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 // this node is clicked by the user.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 [[sender superview] setCurrentButton:sender];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 [self act:sender];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 return self;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 - act:sender
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 const char* nodeVal = [((value) ? value : label) stringValue];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 printf("%s^^%s^^%s\n", [self treeName], "br-edit", nodeVal);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 // msgDelivered = [[NXApp appSpeaker] selectorRPC:"nxBrowserMsg"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 // paramTypes:"ccc",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 // [self treeName], "br-edit", nodeVal];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 // if (msgDelivered != 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 // fprintf(stderr, "Class display request not accepted.\n");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 return self;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 @end