1 /***********************************************************************/
2 /* Open Visualization Data Explorer */
3 /* (C) Copyright IBM Corp. 1989,1999 */
4 /* ALL RIGHTS RESERVED */
5 /* This code licensed under the */
6 /* "IBM PUBLIC LICENSE - Open Visualization Data Explorer" */
7 /***********************************************************************/
8
9 #include <dxconfig.h>
10 #include "../base/defines.h"
11
12
13
14
15 #include "SelectionNode.h"
16 #include "SelectionInstance.h"
17 #include "SelectionAttrDialog.h"
18
19
appendOptionPair(const char * value,const char * name)20 boolean SelectionInstance::appendOptionPair(const char *value, const char *name)
21 {
22 SelectionNode *n = (SelectionNode*)this->getNode();
23 return n->appendOptionPair(value,name);
24 }
getOptionCount()25 int SelectionInstance::getOptionCount()
26 {
27 SelectionNode *n = (SelectionNode*)this->getNode();
28 return n->getOptionCount();
29 }
getValueOptionsAttribute()30 const char *SelectionInstance::getValueOptionsAttribute()
31 {
32 SelectionNode *n = (SelectionNode*)this->getNode();
33 return n->getValueOptionsAttribute();
34 }
getOptionValueString(int optind)35 char *SelectionInstance::getOptionValueString(int optind)
36 {
37 SelectionNode *n = (SelectionNode*)this->getNode();
38 return n->getOptionValueString(optind);
39 }
40
getOptionNameString(int optind,boolean keep_quotes)41 char *SelectionInstance::getOptionNameString(int optind, boolean keep_quotes)
42 {
43 SelectionNode *n = (SelectionNode*)this->getNode();
44 return n->getOptionNameString(optind, keep_quotes);
45 }
46
47 //
48 // Return TRUE/FALSE indicating if this class of interactor instance has
49 // a set attributes dialog (i.e. this->newSetAttrDialog returns non-NULL).
50 //
hasSetAttrDialog()51 boolean SelectionInstance::hasSetAttrDialog()
52 {
53 return TRUE;
54 }
55
56 //
57 // Create the default set attributes dialog box for this class of
58 // Interactor.
59 //
newSetAttrDialog(Widget parent)60 SetAttrDialog *SelectionInstance::newSetAttrDialog(Widget parent)
61 {
62 Node *n = this->getNode();
63 char *name = (char*)n->getClassName();
64 ASSERT(name);
65 name = DuplicateString(name);
66 char *p = strstr(name,"Node");
67 if (p)
68 *p = '\0';
69 char title[128];
70 sprintf(title,"Set %s Attributes...",name);
71 SetAttrDialog *d = new SelectionAttrDialog(parent, title, this);
72 delete name;
73 return d;
74 }
75
76
77