merge the formfield patch from ooo-build
[ooovba.git] / soldep / source / objwin.cxx
blob635b43d23be1f282945e4b24abe363400eebdcb2
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: objwin.cxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <tools/list.hxx>
32 #include <tools/debug.hxx>
33 #include <vcl/svapp.hxx>
34 #include <vcl/help.hxx>
35 #include <vcl/wall.hxx>
37 #include <soldep/objwin.hxx>
38 #include <soldep/depwin.hxx>
39 //#include "depapp.hxx"
40 #include <soldep/depper.hxx>
41 //#include "prjdep.hxx"
42 #include <soldep/connctr.hxx>
43 #include <stdio.h>
45 static Color aDefaultColor = 0L;
46 static Wallpaper* pDefaultWallpaper = 0L;
48 // Initialize static class member
49 BOOL ObjectWin::msbHideMode = FALSE;
50 ULONG ObjectWin::msnGlobalViewMask = 0;
53 UINT32 aColorMap[] = {
54 COL_TRANSPARENT, //MARKMODE_DEFAULT 0
55 COL_GREEN, //MARKMODE_DEPENDING 1
56 COL_RED, //MARKMODE_NEEDED 2
57 COL_MAGENTA, //1+2
58 COL_YELLOW, //MARKMODE_ACTIVATED 4
59 COL_LIGHTGREEN, //1+4
60 COL_LIGHTRED, //2+4
61 COL_LIGHTMAGENTA, //1+2+4
62 COL_BLUE, //MARKMODE_SELECTED 8
63 COL_LIGHTGRAY, //1+8
64 COL_CYAN, //2+8
65 COL_LIGHTCYAN, //1+2+8
66 COL_LIGHTBLUE, //4+8
67 COL_BROWN, //1+4+8
68 COL_BLACK, //2+4+8
69 COL_BLUE //1+2+4+8
74 // class ObjectWin
77 /*****************************************************************************/
78 ObjectWin::ObjectWin( Window* pParent, WinBits nWinStyle )
79 /*****************************************************************************/
80 : Window( pParent, nWinStyle ),
81 msBodyText( "" ),
82 msTipText( "" ),
83 mnObjectId( 0 ),
84 mnMarkMode( 0 ),
85 mnViewMask( 0 ),
86 mbVisible( FALSE ),
87 mbMenuExecute( FALSE ),
88 mbVisited( FALSE ),
89 mnRootDist( 0 ),
90 mnHeadDist( 0 ),
91 mbFixed( FALSE )
93 SetBackground( Wallpaper( Color( COL_WHITE )));
95 aTipTimer.SetTimeout( 500 );
96 aTipTimer.SetTimeoutHdl(
97 LINK( this, ObjectWin, TipHdl ));
99 SetFont( Font( GetFont() ) );
100 Font aFont( GetFont() );
101 Size aSize = aFont.GetSize();
102 aFont.SetSize( aSize );
103 SetFont( aFont );
105 EnableClipSiblings();
106 SetZOrder( NULL, WINDOW_ZORDER_FIRST );
107 mpPopup = new PopupMenu();
108 mpPopup->InsertItem( OBJWIN_EDIT_TEXT, String::CreateFromAscii( "Details" ));
109 mpPopup->InsertItem( OBJWIN_ADD_CONNECTOR, String::CreateFromAscii( "New connection" ));
110 mpPopup->InsertItem( OBJWIN_REMOVE_WIN, String::CreateFromAscii( "Remove object" ));
111 mpPopup->InsertItem( OBJWIN_VIEW_CONTENT, String::CreateFromAscii( "View content" ));
112 // mpPopup->InsertSeparator();
113 mpPopup->SetSelectHdl( LINK( this, ObjectWin, PopupSelected ));
114 mpPopup->SetDeactivateHdl( LINK( this, ObjectWin, PopupDeactivated ));
115 mnPopupStaticItems = mpPopup->GetItemCount();
117 if ( ! pDefaultWallpaper )
119 pDefaultWallpaper = new Wallpaper( GetBackground() );
120 aDefaultColor = GetTextColor();
122 Hide();
125 /*****************************************************************************/
126 ObjectWin::~ObjectWin()
127 /*****************************************************************************/
129 while ( mConnections.Count() > 0 )
131 delete mConnections.GetObject( 0 );
135 void ObjectWin::SetHideMode(BOOL bHide)
137 msbHideMode = bHide;
138 mConnections.GetObject(0)->SetHideMode(msbHideMode);
141 BOOL ObjectWin::ToggleHideMode()
143 msbHideMode = !msbHideMode;
144 mConnections.GetObject(0)->SetHideMode(msbHideMode);
145 return msbHideMode;
148 /*****************************************************************************/
149 void ObjectWin::SetViewMask( ULONG nMask )
150 /*****************************************************************************/
152 mnViewMask = nMask;
153 // Compares
154 if ( mnViewMask & msnGlobalViewMask) {
155 mbVisible = TRUE;
156 Show();
158 else {
159 Hide();
160 mbVisible = FALSE;
162 for ( ULONG i = 0; i < mConnections.Count(); i++ )
163 mConnections.GetObject( i )->UpdateVisibility();
166 /*****************************************************************************/
167 void ObjectWin::SetBodyText( const ByteString& rNewString )
168 /*****************************************************************************/
170 msBodyText = rNewString;
173 /*****************************************************************************/
174 ByteString& ObjectWin::GetBodyText()
175 /*****************************************************************************/
177 return msBodyText;
180 /*****************************************************************************/
181 void ObjectWin::SetTipText( const ByteString& rNewString )
182 /*****************************************************************************/
184 msTipText = rNewString;
187 /*****************************************************************************/
188 ByteString& ObjectWin::GetTipText()
189 /*****************************************************************************/
191 return msTipText;
194 /*****************************************************************************/
195 Point ObjectWin::GetFixPoint( const Point& rRefPoint, BOOL bUseRealPos )
196 /*****************************************************************************/
198 Point aLocalPoint;
199 if ( bUseRealPos )
200 aLocalPoint = GetPosPixel();
201 else
202 aLocalPoint = GetCalcPosPixel();
204 Size aLocalSize = GetSizePixel();
205 Point aRetPoint;
207 USHORT nRefX = aLocalPoint.X() + aLocalSize.Width() / 2 ;
208 USHORT nRefY = aLocalPoint.Y() + aLocalSize.Height() / 2 ;
210 // always false...
211 //if ( nRefX < 0 ) nRefX = 0;
212 //if ( nRefY < 0 ) nRefY = 0;
214 if ( rRefPoint.X() > nRefX )
216 if ( rRefPoint.Y() > nRefY )
218 if ( Abs( rRefPoint.X() - nRefX ) > Abs( rRefPoint.Y() - nRefY ))
220 aRetPoint.X() = aLocalPoint.X() + aLocalSize.Width();
221 aRetPoint.Y() = nRefY;
223 else
225 aRetPoint.X() = nRefX;
226 aRetPoint.Y() = aLocalPoint.Y() + aLocalSize.Height();
229 else
231 if ( Abs( rRefPoint.X() - nRefX ) > Abs( rRefPoint.Y() - nRefY ))
233 aRetPoint.X() = aLocalPoint.X() + aLocalSize.Width();
234 aRetPoint.Y() = nRefY;
236 else
238 aRetPoint.X() = nRefX;
239 aRetPoint.Y() = aLocalPoint.Y();
243 else
245 if ( rRefPoint.Y() > nRefY )
247 if ( Abs( rRefPoint.X() - nRefX ) > Abs( rRefPoint.Y() - nRefY ))
249 aRetPoint.X() = aLocalPoint.X();
250 aRetPoint.Y() = nRefY;
252 else
254 aRetPoint.X() = nRefX;
255 aRetPoint.Y() = aLocalPoint.Y() + aLocalSize.Height();
258 else
260 if ( Abs( rRefPoint.X() - nRefX ) > Abs( rRefPoint.Y() - nRefY ))
262 aRetPoint.X() = aLocalPoint.X();
263 aRetPoint.Y() = nRefY;
265 else
267 aRetPoint.X() = nRefX;
268 aRetPoint.Y() = aLocalPoint.Y();
273 return PixelToLogic(aRetPoint);
277 /*****************************************************************************/
278 void ObjectWin::AddConnector( Connector* pNewCon )
279 /*****************************************************************************/
281 mConnections.Insert( pNewCon );
284 /*****************************************************************************/
285 BOOL ObjectWin::ConnectionExistsInAnyDirection( ObjectWin *pWin )
286 /*****************************************************************************/
288 for ( ULONG i = 0; i < mConnections.Count(); i++ )
289 if ( mConnections.GetObject( i )->GetOtherWin( this ) == pWin )
290 return TRUE;
292 return FALSE;
295 /*****************************************************************************/
296 void ObjectWin::RemoveConnector( Connector* pOldCon )
297 /*****************************************************************************/
299 mConnections.Remove( pOldCon );
302 /*****************************************************************************/
303 Connector* ObjectWin::GetConnector( ULONG nIndex )
304 /*****************************************************************************/
306 ULONG nConCount = mConnections.Count();
308 if ( nIndex < nConCount )
309 return mConnections.GetObject( nIndex );
310 return NULL;
313 /*****************************************************************************/
314 Connector* ObjectWin::GetConnector( ULONG nStartId, ULONG nEndId )
315 /*****************************************************************************/
317 if ( mnObjectId != nStartId )
318 return NULL;
320 USHORT i;
321 Connector* pCon;
322 ULONG nConCount = mConnections.Count();
324 for ( i = 0; i < nConCount; i++ )
326 pCon = mConnections.GetObject( i );
327 if ( pCon->GetOtherWin( this )->GetId() == nEndId )
328 return pCon;
330 return NULL;
333 void ObjectWin::SetAllConnectorsUnvisible()
335 Connector* pCon;
336 ULONG nConCount = mConnections.Count();
337 for ( ULONG i = 0; i < nConCount; i++ )
339 pCon = mConnections.GetObject( i );
340 if (pCon) pCon->SetVisibility( FALSE );
344 /*****************************************************************************/
345 void ObjectWin::SetMarkMode( ULONG nMarkMode )
346 /*****************************************************************************/
348 //Wallpaper aWallpaper;
350 if ( nMarkMode == MARKMODE_DEFAULT )
352 if ( pDefaultWallpaper )
354 maObjWallpaper = GetBackground();
355 maObjWallpaper.SetColor( pDefaultWallpaper->GetColor() );
356 SetBackground( maObjWallpaper );
357 SetTextColor( aDefaultColor );
360 else
362 mnMarkMode |= nMarkMode;
363 maObjWallpaper = GetBackground();
364 maObjWallpaper.SetColor( aColorMap[ mnMarkMode ] );
365 SetBackground( maObjWallpaper );
366 SetTextColor( COL_WHITE );
369 Invalidate();
372 /*****************************************************************************/
373 void ObjectWin::UnsetMarkMode( ULONG nMarkMode )
374 /*****************************************************************************/
376 //Wallpaper aWallpaper;
378 ULONG nOldMode = mnMarkMode;
379 mnMarkMode &= ( !nMarkMode );
381 if ( nOldMode != mnMarkMode ) {
382 if ( mnMarkMode == MARKMODE_DEFAULT )
384 if ( pDefaultWallpaper )
386 maObjWallpaper = GetBackground();
387 maObjWallpaper.SetColor( pDefaultWallpaper->GetColor() );
388 SetBackground( maObjWallpaper );
389 SetTextColor( aDefaultColor );
392 else
394 maObjWallpaper = GetBackground();
395 maObjWallpaper.SetColor( aColorMap[ mnMarkMode ] ); //mnMarkMode
396 SetBackground( maObjWallpaper );
397 SetTextColor( COL_WHITE );
399 Invalidate();
403 /*****************************************************************************/
404 void ObjectWin::MarkNeeded( BOOL bReset )
405 /*****************************************************************************/
407 Connector* pCon;
408 ObjectWin* pWin;
410 ULONG nConCount = mConnections.Count();
411 ULONG i;
413 for ( i = 0; i < nConCount; i++ )
415 pCon = mConnections.GetObject( i );
416 if ( pCon && !pCon->IsStart( this))
418 pWin = pCon->GetOtherWin( this );
419 if ( pWin )
421 if ( bReset )
422 pWin->UnsetMarkMode( MARKMODE_NEEDED );
423 else
424 pWin->SetMarkMode( MARKMODE_NEEDED );
425 pWin->MarkNeeded( bReset ); // recursive call
431 /*****************************************************************************/
432 void ObjectWin::MarkDepending( BOOL bReset )
433 /*****************************************************************************/
435 //if ( !bReset )
436 // return;
438 Connector* pCon;
439 ObjectWin* pWin;
441 ULONG nConCount = mConnections.Count();
442 ULONG i;
444 for ( i = 0; i < nConCount; i++ )
446 pCon = mConnections.GetObject( i );
447 if ( pCon && pCon->IsStart( this) )
449 pWin = pCon->GetOtherWin( this );
450 if ( pWin )
452 if ( bReset )
453 pWin->UnsetMarkMode( MARKMODE_DEPENDING );
454 else
455 pWin->SetMarkMode( MARKMODE_DEPENDING );
456 pWin->MarkDepending( bReset ); // recursive call
462 /*****************************************************************************/
463 void ObjectWin::Paint( const Rectangle& rRect )
464 /*****************************************************************************/
466 Size aWinSize = PixelToLogic( GetOutputSizePixel() );
467 Size aTextSize;
468 ByteString sbt = msBodyText; //debug
469 //sbt += " "; //debug
470 //sbt += ByteString::CreateFromInt32(mnMarkMode); //debug
471 aTextSize.Width() = GetTextWidth( String( msBodyText, RTL_TEXTENCODING_UTF8 ));
472 aTextSize.Height() = GetTextHeight();
473 Point aPos( aWinSize.Width() / 2 - aTextSize.Width() / 2,
474 aWinSize.Height() / 2 - aTextSize.Height() / 2 );
476 //DrawText( aPos , String( sBodyText, RTL_TEXTENCODING_UTF8 ));
477 if (msBodyText =="null") //don't paint this "window"
479 Hide();
480 Invalidate();
481 } else
482 DrawText( aPos , String( sbt, RTL_TEXTENCODING_UTF8 )); //debug
485 void ObjectWin::DrawOutput( OutputDevice* pDevice, const Point& rOffset )
486 /*****************************************************************************/
488 Size aWinSize = PixelToLogic( GetSizePixel() );
489 Size aTextSize;
490 ByteString sbt = msBodyText;
491 aTextSize.Width() = GetTextWidth( String( msBodyText, RTL_TEXTENCODING_UTF8 ));
492 aTextSize.Height() = GetTextHeight();
493 Point aPos = GetPosPixel();
494 Point aTextPos( aWinSize.Width() / 2 - aTextSize.Width() / 2,
495 aWinSize.Height() / 2 - aTextSize.Height() / 2 );
496 aTextPos += aPos;
497 aPos = pDevice->PixelToLogic( aPos ) - rOffset;
498 aTextPos = pDevice->PixelToLogic( aTextPos ) - rOffset;
499 if ( msBodyText !="null" )
501 pDevice->SetFillColor( GetBackground().GetColor() );
502 pDevice->DrawRect( Rectangle( aPos, pDevice->PixelToLogic( GetSizePixel() ) ) );
503 Font aFont( GetFont() );
504 Size aSize = aFont.GetSize();
505 aSize = pDevice->PixelToLogic( aSize );
506 aFont.SetSize( aSize );
507 pDevice->SetFont( aFont );
508 pDevice->SetTextColor( GetTextColor() );
509 pDevice->DrawText( aTextPos, String( sbt, RTL_TEXTENCODING_UTF8 ) );
513 /*****************************************************************************/
514 void ObjectWin::MouseButtonDown( const MouseEvent& rMEvt )
515 /*****************************************************************************/
517 //Notify Soldep to clear ObjectList
518 SetZOrder( NULL, WINDOW_ZORDER_FIRST );
519 GrabFocus();
521 // workaround fuer vcl-bug
522 // GetWindow( WINDOW_REALPARENT)->Invalidate();
523 // MyApp *pApp = (MyApp*)GetpApp();
524 // SolDep *pSoldep = pApp->GetSolDep();
526 maMouseOffset = rMEvt.GetPosPixel();
527 if ( rMEvt.IsLeft() )
530 if ( rMEvt.IsMod2() ) // alt + mouse click left
532 CallEventListeners( VCLEVENT_USER_MOUSEBUTTON_DOWN_ALT, this );
534 else {
535 CallEventListeners( VCLEVENT_USER_MOUSEBUTTON_DOWN, this );
537 if( rMEvt.GetClicks() == 2 )
538 CallEventListeners( VCLEVENT_USER_MOUSEBUTTON_DOWN_DBLCLICK, this );
539 else if ( !rMEvt.IsShift() && !((DepWin*)GetParent())->IsStartNewCon())
541 //((DepWin*)GetParent())->SaveSelectedObjWin(&this);
542 CaptureMouse();
547 /*****************************************************************************/
548 void ObjectWin::MouseButtonUp( const MouseEvent& rMEvt )
549 /*****************************************************************************/
551 fprintf(stdout,"ObjectWin::MouseButtonUp\n");
552 if ( rMEvt.IsLeft() )
554 if ( rMEvt.IsShift() || ((DepWin*)GetParent())->IsStartNewCon())
555 CallEventListeners( VCLEVENT_USER_MOUSEBUTTON_UP_SHFT, this );
556 // ((DepWin*)GetParent())->NewConnector( this );
557 else
559 CallEventListeners( VCLEVENT_USER_MOUSEBUTTON_UP, this );
560 if ( IsMouseCaptured() ) ReleaseMouse();
563 else if ( rMEvt.IsRight() )
565 USHORT i;
567 while ( mnPopupStaticItems < mpPopup->GetItemCount() )
569 mpPopup->RemoveItem( mnPopupStaticItems );
572 if ( mConnections.Count()) {
573 mpPopup->InsertSeparator();
575 for( i = 0; i < mConnections.Count() ; i++ )
577 mpPopup->InsertItem( mnPopupStaticItems + i + 1, String( ((mConnections.GetObject( i ))->GetOtherWin( this ))->GetBodyText(), RTL_TEXTENCODING_UTF8 ));
580 mbMenuExecute = TRUE;
581 mpPopup->Execute( GetParent(), rMEvt.GetPosPixel() + GetPosPixel());
585 /*****************************************************************************/
586 void ObjectWin::MouseMove( const MouseEvent& rMEvt )
587 /*****************************************************************************/
589 if ( IsMouseCaptured() )
591 USHORT i;
593 Point aNewWinPos( GetPosPixel() + rMEvt.GetPosPixel() - maMouseOffset );
595 aNewWinPos.X() = Max( 0L, aNewWinPos.X());
596 aNewWinPos.Y() = Max( 0L, aNewWinPos.Y());
597 SetPosPixel( aNewWinPos );
598 //int t = mConnections.Count();
600 for ( i=0; i < mConnections.Count();i++)
602 mConnections.GetObject( i )->UpdatePosition( this );
605 else // !IsMouseCaptured()
607 if ( rMEvt.IsLeaveWindow() )
608 aTipTimer.Stop();
609 else
610 aTipTimer.Start();
612 MouseEvent aNewMEvt( rMEvt.GetPosPixel() + GetPosPixel());
614 GetParent()->MouseMove( aNewMEvt ); //call to DepWin::MouseMove
618 /*****************************************************************************/
619 USHORT ObjectWin::Save( SvFileStream& rOutFile )
620 /*****************************************************************************/
622 return 0;
625 /*****************************************************************************/
626 USHORT ObjectWin::Load( SvFileStream& rInFile )
627 /*****************************************************************************/
629 return 0;
632 /*****************************************************************************/
633 void ObjectWin::SetId( ULONG nId )
634 /*****************************************************************************/
636 mnObjectId = nId;
639 /*****************************************************************************/
640 ULONG ObjectWin::GetId()
641 /*****************************************************************************/
643 return mnObjectId;
646 /*****************************************************************************/
647 void ObjectWin::UpdateConnectors()
648 /*****************************************************************************/
650 USHORT i;
652 for ( i = 0; i < mConnections.Count(); i++ )
654 mConnections.GetObject( i )->UpdatePosition( this );
658 IMPL_LINK( ObjectWin, PopupSelected, PopupMenu*, mpPopup_l )
660 USHORT nItemId = mpPopup_l->GetCurItemId();
662 switch( nItemId )
664 case OBJWIN_EDIT_TEXT :
665 DBG_ASSERT( FALSE,"edit");
666 break;
667 case OBJWIN_REMOVE_WIN :
668 // DBG_ASSERT( FALSE,"remove");
669 // DBG_ASSERT( mpDepperDontuseme,"remove");
670 //mpDepperDontuseme->RemoveObject(mpDepperDontuseme->mpObjectList, ( USHORT ) GetId());
671 break;
672 case OBJWIN_ADD_CONNECTOR :
673 // DBG_ASSERT( FALSE,"add con");
674 ((DepWin*)GetParent())->NewConnector( this );
675 break;
676 case OBJWIN_VIEW_CONTENT :
677 // DBG_ASSERT( FALSE,"view cnt");
678 // mpDepperDontuseme->ViewContent( msBodyText );
679 // TBD: CallEventListener
680 break;
681 default :
682 // DBG_ASSERT( FALSE, String (nItemId) );
683 Connector* pCon = mConnections.GetObject( nItemId - mnPopupStaticItems - 1);
684 pCon = 0;
685 // delete pCon;
686 // mpDepperDontuseme->RemoveConnector( pCon->GetStartId(), pCon->GetEndId());
687 // TBD: CallEventListener
689 break;
691 return 0;
694 /*****************************************************************************/
695 IMPL_LINK( ObjectWin, TipHdl, void *, EMTY_ARG )
696 /*****************************************************************************/
698 aTipTimer.Stop();
700 if ( msTipText.Len()) {
701 Point aPos( GetpApp()->GetAppWindow()->GetPointerPosPixel());
702 Help::ShowBalloon( GetpApp()->GetAppWindow(),
703 Point( aPos.X(), aPos.Y()),
704 String( msTipText, RTL_TEXTENCODING_UTF8 ));
706 return 0;
709 /*****************************************************************************/
710 //void ObjectWin::GetFocus()
711 /*****************************************************************************/
713 //SetMarkMode( MARKMODE_SELECTED );
716 /*****************************************************************************/
717 void ObjectWin::LoseFocus()
718 /*****************************************************************************/
720 if ( !mbMenuExecute && !msbHideMode ) {
721 UnsetMarkMode( MARKMODE_SELECTED );
722 UnsetMarkMode( MARKMODE_ACTIVATED );
723 MarkNeeded( TRUE );
724 MarkDepending( TRUE );
726 else
727 mbMenuExecute = FALSE;
730 /*****************************************************************************/
731 IMPL_LINK( ObjectWin, PopupDeactivated, PopupMenu*, mpPopup_l )
732 /*****************************************************************************/
734 mbMenuExecute = FALSE;
736 if ( !HasFocus()) {
737 UnsetMarkMode( MARKMODE_SELECTED );
738 UnsetMarkMode( MARKMODE_ACTIVATED );
739 MarkNeeded( TRUE );
740 MarkDepending( TRUE );
743 return 0;
746 /*****************************************************************************/
747 void ObjectWin::Command( const CommandEvent& rEvent)
748 /*****************************************************************************/
750 fprintf(stdout, "ObjectWin::Command");
751 // mpDepperDontuseme->GetGraphWin()->Command( rEvent );
752 // TBD: CallEventListener
756 /*****************************************************************************/
757 /*****************************************************************************/
759 ObjectList::ObjectList() : ObjWinList()
763 /*****************************************************************************/
764 void ObjectList::ResetSelectedObject()
765 /*****************************************************************************/
767 // return;
769 ULONG nCount_l = Count();
770 ObjectWin* pObjectWin = NULL;
771 for (ULONG i=0; i < nCount_l; i++ )
773 pObjectWin = GetObject( i );
774 pObjectWin->UnsetMarkMode( MARKMODE_SELECTED );
775 pObjectWin->UnsetMarkMode( MARKMODE_NEEDED );
776 pObjectWin->UnsetMarkMode( MARKMODE_DEPENDING );
777 pObjectWin->SetActualWallpaper(*pDefaultWallpaper);
778 pObjectWin->SetAllConnectorsUnvisible();
780 return;
783 /*****************************************************************************/
784 ObjectWin* ObjectList::GetPtrByName( const ByteString& rText )
785 /*****************************************************************************/
787 ULONG i = 0;
788 ULONG nCount_l = Count();
789 ObjectWin* pObjectWin = NULL;
790 while ( i < nCount_l )
792 pObjectWin = GetObject( i );
793 ByteString sPrj = pObjectWin->GetBodyText();
794 if (sPrj == rText) return pObjectWin;
795 i++;
797 return 0;