OOO330
[LibreOffice.git] / soldep / source / objwin.cxx
blob07eab4dd4cb7af93dd0882052e1d2600226f4782
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #include <tools/list.hxx>
29 #include <tools/debug.hxx>
30 #include <vcl/svapp.hxx>
31 #include <vcl/help.hxx>
32 #include <vcl/wall.hxx>
34 #include <soldep/objwin.hxx>
35 #include <soldep/depwin.hxx>
36 //#include "depapp.hxx"
37 #include <soldep/depper.hxx>
38 //#include "prjdep.hxx"
39 #include <soldep/connctr.hxx>
40 #include <stdio.h>
42 static Color aDefaultColor = 0L;
43 static Wallpaper* pDefaultWallpaper = 0L;
45 // Initialize static class member
46 BOOL ObjectWin::msbHideMode = FALSE;
47 ULONG ObjectWin::msnGlobalViewMask = 0;
50 UINT32 aColorMap[] = {
51 RGB_COLORDATA( 0xFF, 0xFF, 0x80 ), //MARKMODE_DEFAULT 0
52 COL_GREEN, //MARKMODE_DEPENDING 1
53 COL_RED, //MARKMODE_NEEDED 2
54 COL_MAGENTA, //1+2
55 COL_GRAY, //MARKMODE_ACTIVATED 4
56 COL_LIGHTGREEN, //1+4
57 COL_LIGHTRED, //2+4
58 COL_LIGHTMAGENTA, //1+2+4
59 COL_BLUE, //MARKMODE_SELECTED 8
60 COL_LIGHTGRAY, //1+8
61 COL_CYAN, //2+8
62 COL_LIGHTCYAN, //1+2+8
63 COL_LIGHTBLUE, //4+8
64 COL_BROWN, //1+4+8
65 COL_BLACK, //2+4+8
66 COL_BLUE //1+2+4+8
71 // class ObjectWin
74 /*****************************************************************************/
75 ObjectWin::ObjectWin( Window* pParent, WinBits nWinStyle )
76 /*****************************************************************************/
77 : Window( pParent, nWinStyle ),
78 msBodyText( "" ),
79 msTipText( "" ),
80 mnObjectId( 0 ),
81 mnMarkMode( 0 ),
82 mnViewMask( 0 ),
83 mbVisible( FALSE ),
84 mbMenuExecute( FALSE ),
85 mbVisited( FALSE ),
86 mnRootDist( 0 ),
87 mnHeadDist( 0 ),
88 mbFixed( FALSE )
90 SetBackground( Wallpaper( aColorMap[0] ));
92 aTipTimer.SetTimeout( 500 );
93 aTipTimer.SetTimeoutHdl(
94 LINK( this, ObjectWin, TipHdl ));
96 SetFont( Font( GetFont() ) );
97 Font aFont( GetFont() );
98 Size aSize = aFont.GetSize();
99 aFont.SetSize( aSize );
100 SetFont( aFont );
102 EnableClipSiblings();
103 SetZOrder( NULL, WINDOW_ZORDER_FIRST );
104 mpPopup = new PopupMenu();
105 mpPopup->InsertItem( OBJWIN_EDIT_TEXT, String::CreateFromAscii( "Details" ));
106 mpPopup->InsertItem( OBJWIN_ADD_CONNECTOR, String::CreateFromAscii( "New connection" ));
107 mpPopup->InsertItem( OBJWIN_REMOVE_WIN, String::CreateFromAscii( "Remove object" ));
108 mpPopup->InsertItem( OBJWIN_VIEW_CONTENT, String::CreateFromAscii( "View content" ));
109 // mpPopup->InsertSeparator();
110 mpPopup->SetSelectHdl( LINK( this, ObjectWin, PopupSelected ));
111 mpPopup->SetDeactivateHdl( LINK( this, ObjectWin, PopupDeactivated ));
112 mnPopupStaticItems = mpPopup->GetItemCount();
114 if ( ! pDefaultWallpaper )
116 pDefaultWallpaper = new Wallpaper( GetBackground() );
117 aDefaultColor = GetTextColor();
119 Hide();
122 /*****************************************************************************/
123 ObjectWin::~ObjectWin()
124 /*****************************************************************************/
126 while ( mConnections.Count() > 0 )
128 delete mConnections.GetObject( 0 );
132 void ObjectWin::SetHideMode(BOOL bHide)
134 msbHideMode = bHide;
135 mConnections.GetObject(0)->SetHideMode(msbHideMode);
138 BOOL ObjectWin::ToggleHideMode()
140 msbHideMode = !msbHideMode;
141 mConnections.GetObject(0)->SetHideMode(msbHideMode);
142 return msbHideMode;
145 /*****************************************************************************/
146 void ObjectWin::SetViewMask( ULONG nMask )
147 /*****************************************************************************/
149 mnViewMask = nMask;
150 // Compares
151 if ( mnViewMask & msnGlobalViewMask) {
152 mbVisible = TRUE;
153 Show();
155 else {
156 Hide();
157 mbVisible = FALSE;
159 for ( ULONG i = 0; i < mConnections.Count(); i++ )
160 mConnections.GetObject( i )->UpdateVisibility();
163 /*****************************************************************************/
164 void ObjectWin::SetBodyText( const ByteString& rNewString )
165 /*****************************************************************************/
167 msBodyText = rNewString;
170 /*****************************************************************************/
171 ByteString& ObjectWin::GetBodyText()
172 /*****************************************************************************/
174 return msBodyText;
177 /*****************************************************************************/
178 void ObjectWin::SetTipText( const ByteString& rNewString )
179 /*****************************************************************************/
181 msTipText = rNewString;
184 /*****************************************************************************/
185 ByteString& ObjectWin::GetTipText()
186 /*****************************************************************************/
188 return msTipText;
191 /*****************************************************************************/
192 Point ObjectWin::GetFixPoint( const Point& rRefPoint, BOOL bUseRealPos )
193 /*****************************************************************************/
195 Point aLocalPoint;
196 if ( bUseRealPos )
197 aLocalPoint = GetPosPixel();
198 else
199 aLocalPoint = GetCalcPosPixel();
201 Size aLocalSize = GetSizePixel();
202 Point aRetPoint;
204 USHORT nRefX = aLocalPoint.X() + aLocalSize.Width() / 2 ;
205 USHORT nRefY = aLocalPoint.Y() + aLocalSize.Height() / 2 ;
207 // always false...
208 //if ( nRefX < 0 ) nRefX = 0;
209 //if ( nRefY < 0 ) nRefY = 0;
211 if ( rRefPoint.X() > nRefX )
213 if ( rRefPoint.Y() > nRefY )
215 if ( Abs( rRefPoint.X() - nRefX ) > Abs( rRefPoint.Y() - nRefY ))
217 aRetPoint.X() = aLocalPoint.X() + aLocalSize.Width();
218 aRetPoint.Y() = nRefY;
220 else
222 aRetPoint.X() = nRefX;
223 aRetPoint.Y() = aLocalPoint.Y() + aLocalSize.Height();
226 else
228 if ( Abs( rRefPoint.X() - nRefX ) > Abs( rRefPoint.Y() - nRefY ))
230 aRetPoint.X() = aLocalPoint.X() + aLocalSize.Width();
231 aRetPoint.Y() = nRefY;
233 else
235 aRetPoint.X() = nRefX;
236 aRetPoint.Y() = aLocalPoint.Y();
240 else
242 if ( rRefPoint.Y() > nRefY )
244 if ( Abs( rRefPoint.X() - nRefX ) > Abs( rRefPoint.Y() - nRefY ))
246 aRetPoint.X() = aLocalPoint.X();
247 aRetPoint.Y() = nRefY;
249 else
251 aRetPoint.X() = nRefX;
252 aRetPoint.Y() = aLocalPoint.Y() + aLocalSize.Height();
255 else
257 if ( Abs( rRefPoint.X() - nRefX ) > Abs( rRefPoint.Y() - nRefY ))
259 aRetPoint.X() = aLocalPoint.X();
260 aRetPoint.Y() = nRefY;
262 else
264 aRetPoint.X() = nRefX;
265 aRetPoint.Y() = aLocalPoint.Y();
270 return PixelToLogic(aRetPoint);
274 /*****************************************************************************/
275 void ObjectWin::AddConnector( Connector* pNewCon )
276 /*****************************************************************************/
278 mConnections.Insert( pNewCon );
281 /*****************************************************************************/
282 BOOL ObjectWin::ConnectionExistsInAnyDirection( ObjectWin *pWin )
283 /*****************************************************************************/
285 for ( ULONG i = 0; i < mConnections.Count(); i++ )
286 if ( mConnections.GetObject( i )->GetOtherWin( this ) == pWin )
287 return TRUE;
289 return FALSE;
292 /*****************************************************************************/
293 void ObjectWin::RemoveConnector( Connector* pOldCon )
294 /*****************************************************************************/
296 mConnections.Remove( pOldCon );
299 /*****************************************************************************/
300 Connector* ObjectWin::GetConnector( ULONG nIndex )
301 /*****************************************************************************/
303 ULONG nConCount = mConnections.Count();
305 if ( nIndex < nConCount )
306 return mConnections.GetObject( nIndex );
307 return NULL;
310 /*****************************************************************************/
311 Connector* ObjectWin::GetConnector( ULONG nStartId, ULONG nEndId )
312 /*****************************************************************************/
314 if ( mnObjectId != nStartId )
315 return NULL;
317 USHORT i;
318 Connector* pCon;
319 ULONG nConCount = mConnections.Count();
321 for ( i = 0; i < nConCount; i++ )
323 pCon = mConnections.GetObject( i );
324 if ( pCon->GetOtherWin( this )->GetId() == nEndId )
325 return pCon;
327 return NULL;
330 void ObjectWin::SetAllConnectorsUnvisible()
332 Connector* pCon;
333 ULONG nConCount = mConnections.Count();
334 for ( ULONG i = 0; i < nConCount; i++ )
336 pCon = mConnections.GetObject( i );
337 if (pCon) pCon->SetVisibility( FALSE );
341 /*****************************************************************************/
342 void ObjectWin::SetMarkMode( ULONG nMarkMode )
343 /*****************************************************************************/
345 //Wallpaper aWallpaper;
347 if ( nMarkMode == MARKMODE_DEFAULT )
349 if ( pDefaultWallpaper )
351 maObjWallpaper = GetBackground();
352 maObjWallpaper.SetColor( pDefaultWallpaper->GetColor() );
353 SetBackground( maObjWallpaper );
354 SetTextColor( aDefaultColor );
357 else
359 mnMarkMode |= nMarkMode;
360 maObjWallpaper = GetBackground();
361 maObjWallpaper.SetColor( aColorMap[ mnMarkMode ] );
362 SetBackground( maObjWallpaper );
363 SetTextColor( COL_WHITE );
366 Invalidate();
369 /*****************************************************************************/
370 void ObjectWin::UnsetMarkMode( ULONG nMarkMode )
371 /*****************************************************************************/
373 //Wallpaper aWallpaper;
375 ULONG nOldMode = mnMarkMode;
376 mnMarkMode &= ( !nMarkMode );
378 if ( nOldMode != mnMarkMode ) {
379 if ( mnMarkMode == MARKMODE_DEFAULT )
381 if ( pDefaultWallpaper )
383 maObjWallpaper = GetBackground();
384 maObjWallpaper.SetColor( pDefaultWallpaper->GetColor() );
385 SetBackground( maObjWallpaper );
386 SetTextColor( aDefaultColor );
389 else
391 maObjWallpaper = GetBackground();
392 maObjWallpaper.SetColor( aColorMap[ mnMarkMode ] ); //mnMarkMode
393 SetBackground( maObjWallpaper );
394 SetTextColor( COL_WHITE );
396 Invalidate();
400 /*****************************************************************************/
401 void ObjectWin::MarkNeeded( BOOL bReset )
402 /*****************************************************************************/
404 Connector* pCon;
405 ObjectWin* pWin;
407 ULONG nConCount = mConnections.Count();
408 ULONG i;
410 for ( i = 0; i < nConCount; i++ )
412 pCon = mConnections.GetObject( i );
413 if ( pCon && !pCon->IsStart( this))
415 pWin = pCon->GetOtherWin( this );
416 if ( pWin )
418 if ( bReset )
419 pWin->UnsetMarkMode( MARKMODE_NEEDED );
420 else
421 pWin->SetMarkMode( MARKMODE_NEEDED );
422 pWin->MarkNeeded( bReset ); // recursive call
428 /*****************************************************************************/
429 void ObjectWin::MarkDepending( BOOL bReset )
430 /*****************************************************************************/
432 //if ( !bReset )
433 // return;
435 Connector* pCon;
436 ObjectWin* pWin;
438 ULONG nConCount = mConnections.Count();
439 ULONG i;
441 for ( i = 0; i < nConCount; i++ )
443 pCon = mConnections.GetObject( i );
444 if ( pCon && pCon->IsStart( this) )
446 pWin = pCon->GetOtherWin( this );
447 if ( pWin )
449 if ( bReset )
450 pWin->UnsetMarkMode( MARKMODE_DEPENDING );
451 else
452 pWin->SetMarkMode( MARKMODE_DEPENDING );
453 pWin->MarkDepending( bReset ); // recursive call
459 /*****************************************************************************/
460 void ObjectWin::Paint( const Rectangle& rRect )
461 /*****************************************************************************/
463 Size aWinSize = PixelToLogic( GetOutputSizePixel() );
464 Size aTextSize;
465 ByteString sbt = msBodyText; //debug
466 //sbt += " "; //debug
467 //sbt += ByteString::CreateFromInt32(mnMarkMode); //debug
468 aTextSize.Width() = GetTextWidth( String( msBodyText, RTL_TEXTENCODING_UTF8 ));
469 aTextSize.Height() = GetTextHeight();
470 Point aPos( aWinSize.Width() / 2 - aTextSize.Width() / 2,
471 aWinSize.Height() / 2 - aTextSize.Height() / 2 );
473 //DrawText( aPos , String( sBodyText, RTL_TEXTENCODING_UTF8 ));
474 if (msBodyText =="null") //don't paint this "window"
476 Hide();
477 Invalidate();
478 } else
479 DrawText( aPos , String( sbt, RTL_TEXTENCODING_UTF8 )); //debug
482 void ObjectWin::DrawOutput( OutputDevice* pDevice, const Point& rOffset )
483 /*****************************************************************************/
485 Size aWinSize = PixelToLogic( GetSizePixel() );
486 Size aTextSize;
487 ByteString sbt = msBodyText;
488 aTextSize.Width() = GetTextWidth( String( msBodyText, RTL_TEXTENCODING_UTF8 ));
489 aTextSize.Height() = GetTextHeight();
490 Point aPos = GetPosPixel();
491 Point aTextPos( aWinSize.Width() / 2 - aTextSize.Width() / 2,
492 aWinSize.Height() / 2 - aTextSize.Height() / 2 );
493 aTextPos += aPos;
494 aPos = pDevice->PixelToLogic( aPos ) - rOffset;
495 aTextPos = pDevice->PixelToLogic( aTextPos ) - rOffset;
496 if ( msBodyText !="null" )
498 pDevice->SetFillColor( GetBackground().GetColor() );
499 pDevice->DrawRect( Rectangle( aPos, pDevice->PixelToLogic( GetSizePixel() ) ) );
500 Font aFont( GetFont() );
501 Size aSize = aFont.GetSize();
502 aSize = pDevice->PixelToLogic( aSize );
503 aFont.SetSize( aSize );
504 pDevice->SetFont( aFont );
505 pDevice->SetTextColor( GetTextColor() );
506 pDevice->DrawText( aTextPos, String( sbt, RTL_TEXTENCODING_UTF8 ) );
510 /*****************************************************************************/
511 void ObjectWin::MouseButtonDown( const MouseEvent& rMEvt )
512 /*****************************************************************************/
514 //Notify Soldep to clear ObjectList
515 SetZOrder( NULL, WINDOW_ZORDER_FIRST );
516 GrabFocus();
518 // workaround fuer vcl-bug
519 // GetWindow( WINDOW_REALPARENT)->Invalidate();
520 // MyApp *pApp = (MyApp*)GetpApp();
521 // SolDep *pSoldep = pApp->GetSolDep();
523 maMouseOffset = rMEvt.GetPosPixel();
524 if ( rMEvt.IsLeft() )
527 if ( rMEvt.IsMod2() ) // alt + mouse click left
529 CallEventListeners( VCLEVENT_USER_MOUSEBUTTON_DOWN_ALT, this );
531 else {
532 CallEventListeners( VCLEVENT_USER_MOUSEBUTTON_DOWN, this );
534 if( rMEvt.GetClicks() == 2 )
535 CallEventListeners( VCLEVENT_USER_MOUSEBUTTON_DOWN_DBLCLICK, this );
536 else if ( !rMEvt.IsShift() && !((DepWin*)GetParent())->IsStartNewCon())
538 //((DepWin*)GetParent())->SaveSelectedObjWin(&this);
539 CaptureMouse();
544 /*****************************************************************************/
545 void ObjectWin::MouseButtonUp( const MouseEvent& rMEvt )
546 /*****************************************************************************/
548 fprintf(stdout,"ObjectWin::MouseButtonUp\n");
549 if ( rMEvt.IsLeft() )
551 if ( rMEvt.IsShift() || ((DepWin*)GetParent())->IsStartNewCon())
552 CallEventListeners( VCLEVENT_USER_MOUSEBUTTON_UP_SHFT, this );
553 // ((DepWin*)GetParent())->NewConnector( this );
554 else
556 CallEventListeners( VCLEVENT_USER_MOUSEBUTTON_UP, this );
557 if ( IsMouseCaptured() ) ReleaseMouse();
560 else if ( rMEvt.IsRight() )
562 USHORT i;
564 while ( mnPopupStaticItems < mpPopup->GetItemCount() )
566 mpPopup->RemoveItem( mnPopupStaticItems );
569 if ( mConnections.Count()) {
570 mpPopup->InsertSeparator();
572 for( i = 0; i < mConnections.Count() ; i++ )
574 mpPopup->InsertItem( mnPopupStaticItems + i + 1, String( ((mConnections.GetObject( i ))->GetOtherWin( this ))->GetBodyText(), RTL_TEXTENCODING_UTF8 ));
577 mbMenuExecute = TRUE;
578 mpPopup->Execute( GetParent(), rMEvt.GetPosPixel() + GetPosPixel());
582 /*****************************************************************************/
583 void ObjectWin::MouseMove( const MouseEvent& rMEvt )
584 /*****************************************************************************/
586 if ( IsMouseCaptured() )
588 USHORT i;
590 Point aNewWinPos( GetPosPixel() + rMEvt.GetPosPixel() - maMouseOffset );
592 aNewWinPos.X() = Max( 0L, aNewWinPos.X());
593 aNewWinPos.Y() = Max( 0L, aNewWinPos.Y());
594 SetPosPixel( aNewWinPos );
595 //int t = mConnections.Count();
597 for ( i=0; i < mConnections.Count();i++)
599 mConnections.GetObject( i )->UpdatePosition( this );
602 else // !IsMouseCaptured()
604 if ( rMEvt.IsLeaveWindow() )
605 aTipTimer.Stop();
606 else
607 aTipTimer.Start();
609 MouseEvent aNewMEvt( rMEvt.GetPosPixel() + GetPosPixel());
611 GetParent()->MouseMove( aNewMEvt ); //call to DepWin::MouseMove
615 /*****************************************************************************/
616 USHORT ObjectWin::Save( SvFileStream& rOutFile )
617 /*****************************************************************************/
619 return 0;
622 /*****************************************************************************/
623 USHORT ObjectWin::Load( SvFileStream& rInFile )
624 /*****************************************************************************/
626 return 0;
629 /*****************************************************************************/
630 void ObjectWin::SetId( ULONG nId )
631 /*****************************************************************************/
633 mnObjectId = nId;
636 /*****************************************************************************/
637 ULONG ObjectWin::GetId()
638 /*****************************************************************************/
640 return mnObjectId;
643 /*****************************************************************************/
644 void ObjectWin::UpdateConnectors()
645 /*****************************************************************************/
647 USHORT i;
649 for ( i = 0; i < mConnections.Count(); i++ )
651 mConnections.GetObject( i )->UpdatePosition( this );
655 IMPL_LINK( ObjectWin, PopupSelected, PopupMenu*, mpPopup_l )
657 USHORT nItemId = mpPopup_l->GetCurItemId();
659 switch( nItemId )
661 case OBJWIN_EDIT_TEXT :
662 DBG_ASSERT( FALSE,"edit");
663 break;
664 case OBJWIN_REMOVE_WIN :
665 // DBG_ASSERT( FALSE,"remove");
666 // DBG_ASSERT( mpDepperDontuseme,"remove");
667 //mpDepperDontuseme->RemoveObject(mpDepperDontuseme->mpObjectList, ( USHORT ) GetId());
668 break;
669 case OBJWIN_ADD_CONNECTOR :
670 // DBG_ASSERT( FALSE,"add con");
671 ((DepWin*)GetParent())->NewConnector( this );
672 break;
673 case OBJWIN_VIEW_CONTENT :
674 // DBG_ASSERT( FALSE,"view cnt");
675 // mpDepperDontuseme->ViewContent( msBodyText );
676 // TBD: CallEventListener
677 break;
678 default :
679 // DBG_ASSERT( FALSE, String (nItemId) );
680 Connector* pCon = mConnections.GetObject( nItemId - mnPopupStaticItems - 1);
681 pCon = 0;
682 // delete pCon;
683 // mpDepperDontuseme->RemoveConnector( pCon->GetStartId(), pCon->GetEndId());
684 // TBD: CallEventListener
686 break;
688 return 0;
691 /*****************************************************************************/
692 IMPL_LINK( ObjectWin, TipHdl, void *, EMTY_ARG )
693 /*****************************************************************************/
695 aTipTimer.Stop();
697 if ( msTipText.Len()) {
698 Point aPos( GetpApp()->GetAppWindow()->GetPointerPosPixel());
699 Help::ShowBalloon( GetpApp()->GetAppWindow(),
700 Point( aPos.X(), aPos.Y()),
701 String( msTipText, RTL_TEXTENCODING_UTF8 ));
703 return 0;
706 /*****************************************************************************/
707 //void ObjectWin::GetFocus()
708 /*****************************************************************************/
710 //SetMarkMode( MARKMODE_SELECTED );
713 /*****************************************************************************/
714 void ObjectWin::LoseFocus()
715 /*****************************************************************************/
717 if ( !mbMenuExecute && !msbHideMode ) {
718 UnsetMarkMode( MARKMODE_SELECTED );
719 UnsetMarkMode( MARKMODE_ACTIVATED );
720 MarkNeeded( TRUE );
721 MarkDepending( TRUE );
723 else
724 mbMenuExecute = FALSE;
727 /*****************************************************************************/
728 IMPL_LINK( ObjectWin, PopupDeactivated, PopupMenu*, mpPopup_l )
729 /*****************************************************************************/
731 mbMenuExecute = FALSE;
733 if ( !HasFocus()) {
734 UnsetMarkMode( MARKMODE_SELECTED );
735 UnsetMarkMode( MARKMODE_ACTIVATED );
736 MarkNeeded( TRUE );
737 MarkDepending( TRUE );
740 return 0;
743 /*****************************************************************************/
744 void ObjectWin::Command( const CommandEvent& rEvent)
745 /*****************************************************************************/
747 fprintf(stdout, "ObjectWin::Command");
748 // mpDepperDontuseme->GetGraphWin()->Command( rEvent );
749 // TBD: CallEventListener
753 /*****************************************************************************/
754 /*****************************************************************************/
756 ObjectList::ObjectList() : ObjWinList()
760 /*****************************************************************************/
761 void ObjectList::ResetSelectedObject()
762 /*****************************************************************************/
764 // return;
766 ULONG nCount_l = Count();
767 ObjectWin* pObjectWin = NULL;
768 for (ULONG i=0; i < nCount_l; i++ )
770 pObjectWin = GetObject( i );
771 pObjectWin->UnsetMarkMode( MARKMODE_SELECTED );
772 pObjectWin->UnsetMarkMode( MARKMODE_NEEDED );
773 pObjectWin->UnsetMarkMode( MARKMODE_DEPENDING );
774 pObjectWin->SetActualWallpaper(*pDefaultWallpaper);
775 pObjectWin->SetAllConnectorsUnvisible();
777 return;
780 /*****************************************************************************/
781 ObjectWin* ObjectList::GetPtrByName( const ByteString& rText )
782 /*****************************************************************************/
784 ULONG i = 0;
785 ULONG nCount_l = Count();
786 ObjectWin* pObjectWin = NULL;
787 while ( i < nCount_l )
789 pObjectWin = GetObject( i );
790 ByteString sPrj = pObjectWin->GetBodyText();
791 if (sPrj == rText) return pObjectWin;
792 i++;
794 return 0;
797 ObjectList* ObjectList::FindTopLevelModules()
799 ObjectList* pList = new ObjectList;
800 for ( USHORT i=0; i<Count(); i++ )
802 ObjectWin* pObjectWin = GetObject( i );
803 if ( pObjectWin->IsTop() )
804 pList->Insert( pObjectWin );
807 return pList;
810 BOOL ObjectWin::IsTop()
812 ULONG nConCount = mConnections.Count();
813 for ( ULONG i = 0; i < nConCount; i++ )
815 Connector* pCon = mConnections.GetObject( i );
816 if ( pCon && pCon->IsStart( this) )
817 return FALSE;
820 return TRUE;