@@ -50,38 +50,6 @@ extern struct Hash_Table *TypeDictionary;
5050
5151extern Probe *dp;
5252
53- /*
54- StepEntityDescriptor *GetStepEntityDescriptor(char *e)
55- {
56-
57- // EntityDescriptor & entDesc =
58- // (EntityDescriptor *)HASHfind(EntityDictionary, StrToUpper(e));
59- // return new StepEntityDescriptor(entDesc);
60- }
61- */
62-
63- /*
64- Interactor *InsertInteractor (Interactor * i, Interactor * i2, Alignment align)
65- {
66- extern World* dp_world;
67-
68- Frame* framedInteractor = new Frame(i, 2);
69- Coord x, y;
70-
71- // if(i2->IsMapped()){
72- i2->Align(BottomCenter, i->GetShape()->width, i->GetShape()->height, x, y);
73- i2->GetRelative(x, y, dp_world);
74- dp_world->InsertTransient(framedInteractor, i2, x, y, align);
75- // } else {
76- // x = y = 0;
77- // dp_world->InsertTransient(framedInteractor, i2, x, y, align);
78- // }
79- return(framedInteractor);
80- }
81-
82- //////////////////////////////////
83-
84- */
8553void RemoveInteractor (Interactor* i, Interactor *i2)
8654{
8755 Frame* framedInteractor = (Frame*) i->Parent ();
@@ -91,8 +59,6 @@ void RemoveInteractor (Interactor* i, Interactor *i2)
9159 delete framedInteractor;
9260}
9361
94- // ////////////////////////////////////////////////////////////////////////
95-
9662Interactor* AddRightScroller (Interactor* grid)
9763{
9864 return new HBox (
@@ -161,7 +127,6 @@ void EntityDescriptorBlock::Init(const EntityDescriptor *e, ButtonState *typeMes
161127 // determine the height of the box as the highest of the attribute
162128 // box or subtype box.
163129 int entryCount = max (attrCount, subtypeCount);
164- // ////////////////
165130
166131 std::string str;
167132 char endchar;
@@ -180,57 +145,15 @@ void EntityDescriptorBlock::Init(const EntityDescriptor *e, ButtonState *typeMes
180145 str.Append (' <' );
181146 endchar = ' >' ;
182147 }
183- /* // for when inverse information is included
184- else if( ad->Inverse() == OPLOG(LTrue) )
185- {
186- str.Append('(');
187- endchar = ')';
188- }
189- */
190148 std::string tmp;
191149 str.Append ( ad->AttrExprDefStr (tmp) );
192- /* // built by hand
193- str.Append( ad->Name() );
194- str.Append( " : " );
195- if( ad->Optional() == OPLOG(LTrue) )
196- {
197- str.Append("OPTIONAL ");
198- }
199- str.Append( attrPtr->AttrDesc()->DomainType()->AttrTypeName() );
200- */
201150 str.Append ( endchar );
202151
203- // //////////////////
204- attrListBrowser->Append (str.chars ());
205-
206- /*
207- attrDefinition = str.chars();
208- const char *attrDefPtr = attrDefinition;
209-
210- char attrStr[maxAttrLen + 1];
211- attrStr[0] = 0;
212-
213- strncpy(attrStr, attrDefPtr, maxAttrLen);
214- attrStr[maxAttrLen] = 0;
215- attrListBrowser->Append(attrStr);
216-
217- // if the attr def was longer than maxAttrLen continue the definition
218- // on lines following starting 5 spaces in.
219- attrDefPtr = &attrDefPtr[maxAttrLen];
220- while(strlen(attrDefPtr) > 0)
221- {
222- memset(attrStr, ' ', 5);
223- memset(attrStr + 5, 0, maxAttrLen - 4);
224- strncat(attrStr, attrDefPtr, maxAttrLen - 5);
225- attrListBrowser->Append(attrStr);
226- attrDefPtr = &attrDefPtr[strlen(attrStr) - 5];
227- }
228- */
152+ attrListBrowser->Append (str.c_str ());
229153
230154 attrPtr = (AttrDescLinkNode *)attrPtr->NextNode ();
231155 }
232156
233- // ////////////
234157 subtypeListBrowser = new StringBrowser (subtypeBS, entryCount, maxSubtypeLen);
235158 EntityDescLinkNode *subtypePtr =
236159 (EntityDescLinkNode *)subtypeList->GetHead ();
@@ -243,9 +166,6 @@ void EntityDescriptorBlock::Init(const EntityDescriptor *e, ButtonState *typeMes
243166
244167Interactor *EntityDescriptorBlock::Body ()
245168{
246- // Message *attrsAndSubtypesTitle = new Message("attributes & subtypes");
247- // Message *attrsTitle = new Message("attributes");
248- // Message *subtypesTitle = new Message("subtypes");
249169 attrSubtypeBox = new HBox (
250170 AddRightScroller (attrListBrowser),
251171 new VBorder,
@@ -264,16 +184,13 @@ Interactor *EntityDescriptorBlock::Body()
264184 bodyBox = new VBox (
265185 new HBox (
266186 name,
267- // new HGlue(round(.02*inch), round(.02*inch), 0),
268- // attrsAndSubtypesTitle,
269187 new HBox (
270188 new HGlue (round (.5 *inch), round (.5 *inch), hfil),
271189 schemaMessage,
272190 new HGlue (round (.2 *inch), round (.2 *inch), 0 ),
273191 openCloseBut
274192 ),
275193 new HGlue (round (.02 *inch), round (.02 *inch), 0 )
276- // new HGlue(round(.5*inch), round(.5*inch), hfil)
277194 ),
278195 new HBorder,
279196 attrSubtypeBox
@@ -346,26 +263,18 @@ void EntityDescriptorBlock::Update()
346263 attrPtr = (AttrDescLinkNode *)attrPtr->NextNode ();
347264 }
348265 std::string tmp;
349- // attrStr = attrPtr->AttrDesc()->AttrExprDefStr(tmp);
350-
351- // attrStr = TypeString(attrPtr->AttrDesc());
352266 std::string tmp2;
353267 strncpy (attrStr,
354268 attrPtr->AttrDesc ()->DomainType ()->TypeString (tmp2),
355269 BUFSIZ);
356270 attrStr[BUFSIZ-1 ] = 0 ;
357271
358- // AttrDescriptorList *attrDescList = ed->ExplicitAttr();
359- // AttrDescriptor *attrDesc = attrDescList->GetHead();
360-
361- // char * attrStr = attrListBrowser->String(index);
362272 typeMsg->SetValue ((char *)attrStr);
363273 cout << " Selected attr: '" << attrStr << " '\n " ;
364274 }
365275 }
366276
367277 openCloseBS->GetValue (val);
368- // openCloseBS->SetValue(0);
369278 if (val != lastCloseVal)
370279 {
371280 if (val == 1 )
@@ -383,8 +292,6 @@ void EntityDescriptorBlock::Update()
383292 lastCloseVal = val;
384293}
385294
386- // /////////////////////////////////////////////////////////////////////////////
387-
388295EntityDescBlockNode *
389296EntityDescBlockList::PrependNode (EntityDescriptorBlock * edb)
390297{
@@ -399,23 +306,6 @@ EntityDescBlockList::PrependNode (EntityDescriptorBlock * edb)
399306 return node;
400307}
401308
402- // /////////////////////////////////////////////////////////////////////////////
403-
404- /*
405- StepEntityDescriptor::StepEntityDescriptor()
406- {
407- edbList = new EntityDescBlockList;
408- Scene::Insert(new HBorder(2));
409- entDesc = 0;
410-
411- closeBS = new ButtonState(0);
412- closeBS->Attach(this);
413- close = new PushButton("close", closeBS, 1);
414- entDesc = ed;
415-
416- }
417- */
418-
419309char *
420310StepEntityDescriptor::LongestAttrInBlock (const EntityDescriptor *entity)
421311{
@@ -439,13 +329,6 @@ StepEntityDescriptor::LongestAttrInBlock(const EntityDescriptor *entity)
439329 {
440330 attrLen = attrLen + 2 ;
441331 }
442- /*
443- // for when inverse information is else included
444- else if( attrPtr->AttrDesc()->Inverse() == OPLOG(LTrue) )
445- {
446- attrLen = attrLen + 2;
447- }
448- */
449332
450333 if (attrLen > longestLen)
451334 {
@@ -495,7 +378,6 @@ StepEntityDescriptor::FindLongestAttribute()
495378 }
496379 return longestAttrStr;
497380}
498- // ////////////////
499381
500382char *
501383StepEntityDescriptor::LongestSubtNameInBlock (const EntityDescriptor *entity)
@@ -558,7 +440,6 @@ StepEntityDescriptor::FindLongestSubtName()
558440 }
559441 return longestSubtypeStr;
560442}
561- // ////////////////
562443
563444StepEntityDescriptor::StepEntityDescriptor (const EntityDescriptor *ed)
564445{
@@ -580,8 +461,6 @@ StepEntityDescriptor::StepEntityDescriptor(const EntityDescriptor *ed)
580461 )
581462 );
582463
583-
584- // /////////////
585464 int maxAttrLen = strlen (FindLongestAttribute ());
586465 int len = 5 ;
587466 maxAttrLen = max (maxAttrLen, len);
@@ -592,7 +471,6 @@ StepEntityDescriptor::StepEntityDescriptor(const EntityDescriptor *ed)
592471 strDispBS = new ButtonState (0 );
593472 strDispBS->Attach (this );
594473 strDisp = new StringDisplay (strDispBS, " " );
595- // ////////////
596474 edbList->PrependNode (new EntityDescriptorBlock (ed, strDispBS, maxAttrLen,
597475 maxSubtypeLen));
598476
@@ -628,14 +506,6 @@ StepEntityDescriptor::StepEntityDescriptor(const EntityDescriptor *ed)
628506 );
629507}
630508
631- /*
632- StepEntityDescriptor::StepEntityDescriptor(Interactor *i) : (i)
633- {
634- edbList = new EntityDescBlockList;
635- Scene::Insert(new HBorder(2));
636- }
637- */
638-
639509void StepEntityDescriptor::Insert (Interactor *i)
640510{
641511 Scene::Insert (i);
@@ -657,12 +527,9 @@ void StepEntityDescriptor::Update()
657527 if (val == 1 )
658528 {
659529 dp->RemoveSED (this );
660- // RemoveInteractor (this, this);
661530 cout << " close entity display" << " \n " ;
662531 }
663532 char *strVal = 0 ;
664- // strDispBS->GetValue(strVal); // this no longer works with Sun
665- // C++ => error. Must assign as below DAS
666533 void * tmpVoidPtr = 0 ;
667534 strDispBS->GetValue (tmpVoidPtr);
668535 strVal = (char *) tmpVoidPtr;
@@ -672,18 +539,7 @@ void StepEntityDescriptor::Update()
672539 strDisp->Message (strVal);
673540}
674541
675- // boolean i.e. true = 1 and false = 0
676542boolean StepEntityDescriptor::IsMapped ()
677543{
678544 return (canvas != nil && canvas->status () == Canvas::mapped);
679- /*
680- if(canvas)
681- {
682- // this doesn't work
683- int bool = canvas->window()->is_mapped();
684- return bool;
685- }
686- else
687- return false;
688- */
689545}
0 commit comments