xref: /trunk/main/sw/source/ui/utlui/unotools.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sw.hxx"
30 
31 #include <swtypes.hxx>
32 #include <globals.hrc>
33 #include <misc.hrc>
34 
35 #include <utlui.hrc>
36 #include <unotools.hrc>
37 #include <unotools.hxx>
38 #include <unoprnms.hxx>
39 #include <tools/debug.hxx>
40 #include <vcl/msgbox.hxx>
41 #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
42 #include <com/sun/star/view/XScreenCursor.hpp>
43 #include <com/sun/star/view/DocumentZoomType.hpp>
44 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
45 #include <com/sun/star/style/XStyle.hpp>
46 #include <com/sun/star/text/XTextDocument.hpp>
47 #include <com/sun/star/awt/PosSize.hpp>
48 #include <com/sun/star/view/XViewSettingsSupplier.hpp>
49 #include <com/sun/star/container/XNameContainer.hpp>
50 #include <com/sun/star/frame/XLayoutManager.hpp>
51 #include <comphelper/processfactory.hxx>
52 #include <sfx2/dispatch.hxx>
53 #include <svl/stritem.hxx>
54 #include <shellio.hxx>
55 #include <docsh.hxx>
56 #include <view.hxx>
57 #include <wrtsh.hxx>
58 #include <swmodule.hxx>
59 #include <TextCursorHelper.hxx>
60 #include <unocrsr.hxx>
61 #include <doc.hxx>
62 
63 #include <unomid.h>
64 
65 
66 using namespace ::com::sun::star;
67 using ::rtl::OUString;
68 
69 const sal_Char cFrameControl[] = "com.sun.star.frame.FrameControl";
70 const sal_Char cFactory[] = "private:factory/swriter";
71 /************************************************************************
72 
73 ************************************************************************/
74 
75 sal_Bool SwOneExampleFrame::bShowServiceNotAvailableMessage = sal_True;
76 
77 /* -----------------27.07.99 15:26-------------------
78 
79  --------------------------------------------------*/
80 SwOneExampleFrame::SwOneExampleFrame( Window& rWin,
81 										sal_uInt32 nFlags,
82 										const Link* pInitializedLink,
83 										String* pURL ) :
84 	aTopWindow( rWin.GetParent(), 0, this ),
85     rWindow(rWin),
86     aMenuRes(SW_RES(RES_FRMEX_MENU)),
87 
88     pModuleView(SW_MOD()->GetView()),
89 
90     nStyleFlags(nFlags),
91 	bIsInitialized(sal_False),
92 	bServiceAvailable(sal_False)
93 {
94 	if(pURL && pURL->Len())
95 		sArgumentURL = *pURL;
96 
97 	aTopWindow.SetPaintTransparent(sal_True);
98 	aTopWindow.SetPosSizePixel(rWin.GetPosPixel(), rWin.GetSizePixel());
99 	aTopWindow.SetZOrder( &rWin, WINDOW_ZORDER_FIRST );
100 
101 	if( pInitializedLink )
102 		aInitializedLink = *pInitializedLink;
103 
104 	// the controller is asynchronously set
105 	aLoadedTimer.SetTimeoutHdl(LINK(this, SwOneExampleFrame, TimeoutHdl));
106 // 		aLoadedTimer.SetTimeout(500);
107 	aLoadedTimer.SetTimeout(200);
108 
109 	rWin.Enable(sal_False);
110 	CreateControl();
111 
112 	aTopWindow.Show();
113 }
114 
115 /* -----------------------------08.12.99 13:44--------------------------------
116 
117  ---------------------------------------------------------------------------*/
118 void SwOneExampleFrame::CreateErrorMessage(Window* pParent)
119 {
120 	if(SwOneExampleFrame::bShowServiceNotAvailableMessage)
121 	{
122 		String sInfo(SW_RES(STR_SERVICE_UNAVAILABLE));
123 		sInfo += C2S(cFrameControl);
124 		InfoBox(pParent, sInfo).Execute();
125 		SwOneExampleFrame::bShowServiceNotAvailableMessage = sal_False;
126 	}
127 }
128 /* -----------------27.07.99 15:26-------------------
129 
130  --------------------------------------------------*/
131 SwOneExampleFrame::~SwOneExampleFrame()
132 {
133 	DisposeControl();
134 }
135 /* -----------------------------21.12.00 10:16--------------------------------
136 
137  ---------------------------------------------------------------------------*/
138 void	SwOneExampleFrame::CreateControl()
139 {
140 	if(_xControl.is())
141 		return ;
142 	uno::Reference< lang::XMultiServiceFactory >
143 									xMgr = comphelper::getProcessServiceFactory();
144 	uno::Reference< uno::XInterface >  xInst = xMgr->createInstance( C2U("com.sun.star.frame.FrameControl") );
145 	_xControl = uno::Reference< awt::XControl >(xInst, uno::UNO_QUERY);
146 	if(_xControl.is())
147 	{
148 		uno::Reference< awt::XWindowPeer >  xParent( rWindow.GetComponentInterface() );
149 
150 		uno::Reference< awt::XToolkit >  xToolkit( xMgr->createInstance( C2U("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY );
151 		if(xToolkit.is())
152 		{
153 			_xControl->createPeer( xToolkit, xParent );
154 
155             uno::Reference< awt::XWindow >  xWin( _xControl, uno::UNO_QUERY );
156 			xWin->setVisible( sal_False );
157 			Size aWinSize(rWindow.GetOutputSizePixel());
158 			xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
159 
160             uno::Reference< beans::XPropertySet >  xPrSet(xInst, uno::UNO_QUERY);
161 			uno::Any aURL;
162 			//
163 			// create new doc
164 			String sTempURL = C2S(cFactory);
165 			if(sArgumentURL.Len())
166 				sTempURL = sArgumentURL;
167 			aURL <<= OUString(sTempURL);
168 
169 			uno::Sequence<beans::PropertyValue> aSeq(3);
170 			beans::PropertyValue* pValues = aSeq.getArray();
171 			pValues[0].Name = C2U("ReadOnly");
172 			sal_Bool bTrue = sal_True;
173 			pValues[0].Value.setValue(&bTrue, ::getBooleanCppuType());
174 			pValues[1].Name = C2U("OpenFlags");
175 			pValues[1].Value <<= C2U("-RB");
176 			pValues[2].Name = C2U("Referer");
177 			pValues[2].Value <<= C2U("private:user");
178 			uno::Any aArgs;
179 			aArgs.setValue(&aSeq, ::getCppuType((uno::Sequence<beans::PropertyValue>*)0));
180 
181 			xPrSet->setPropertyValue( C2U("LoaderArguments"), aArgs );
182 			//save and set readonly???
183 
184 			xPrSet->setPropertyValue(C2U("ComponentURL"), aURL);
185 
186 			aLoadedTimer.Start();
187 			bServiceAvailable = sal_True;
188 		}
189 	}
190 }
191 
192 
193 /* -----------------------------21.12.00 10:16--------------------------------
194 
195  ---------------------------------------------------------------------------*/
196 void	SwOneExampleFrame::DisposeControl()
197 {
198 	_xCursor = 0;
199 	if(_xControl.is())
200 		_xControl->dispose();
201 	_xControl = 0;
202 	_xModel = 0;
203 	_xController = 0;
204 }
205 /* -----------------27.07.99 15:26-------------------
206 
207  --------------------------------------------------*/
208 IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
209 {
210 	if(!_xControl.is())
211 		return 0;
212 
213 	// now get the model
214 	uno::Reference< beans::XPropertySet >  xPrSet(_xControl, uno::UNO_QUERY);
215 	uno::Any aFrame = xPrSet->getPropertyValue(C2U("Frame"));
216     uno::Reference< frame::XFrame >  xFrm;
217     aFrame >>= xFrm;
218 
219     uno::Reference< beans::XPropertySet > xPropSet( xFrm, uno::UNO_QUERY );
220     if ( xPropSet.is() )
221     {
222         try
223         {
224             uno::Reference< frame::XLayoutManager > xLayoutManager;
225             uno::Any aValue = xPropSet->getPropertyValue(C2U("LayoutManager"));
226 	        aValue >>= xLayoutManager;
227             if ( xLayoutManager.is() )
228                 xLayoutManager->setVisible( sal_False );
229         }
230         catch ( uno::Exception& )
231         {
232         }
233     }
234 
235     _xController = xFrm->getController();
236 	if(_xController.is())
237 	{
238 		_xModel = _xController->getModel();
239 		//now the ViewOptions should be set properly
240 		uno::Reference< view::XViewSettingsSupplier >  xSettings(_xController, uno::UNO_QUERY);
241 		uno::Reference< beans::XPropertySet >  xViewProps = xSettings->getViewSettings();
242 
243 		sal_Bool bTrue = sal_True;
244 		sal_Bool bFalse = sal_False;
245 		uno::Any aTrueSet( &bTrue, ::getBooleanCppuType() );
246 		uno::Any aFalseSet( &bFalse, ::getBooleanCppuType() );
247 
248 		if( !bIsInitialized )
249 		{
250 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_BREAKS			   	)), aFalseSet);
251 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_DRAWINGS             )), aTrueSet);
252 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_FIELD_COMMANDS       )), aFalseSet);
253 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_GRAPHICS             )), aTrueSet);
254 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_PARAGRAPHS    )), aFalseSet);
255 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_TEXT          )), aFalseSet);
256 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_RULER	  		)), aFalseSet);
257 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_PARA_BREAKS          )), aFalseSet);
258 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_PROTECTED_SPACES     )), aFalseSet);
259 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_SOFT_HYPHENS         )), aFalseSet);
260 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_SPACES               )), aFalseSet);
261 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABLES               )), aTrueSet);
262 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABSTOPS             )), aFalseSet);
263 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_RULER     		)), aFalseSet);
264 
265 			if(0 ==(nStyleFlags&EX_SHOW_ONLINE_LAYOUT))
266 			{
267                 uno::Any aZoom;
268                 aZoom <<= (sal_Int16)view::DocumentZoomType::PAGE_WIDTH_EXACT;
269                 xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
270 			}
271 			else
272 			{
273 				uno::Any aZoom;
274 				aZoom <<= (sal_Int16)view::DocumentZoomType::BY_VALUE;
275 				xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
276 
277 				sal_Int16 nZoomValue = 50;
278 				if(EX_SHOW_BUSINESS_CARDS == nStyleFlags)
279 				{
280 					nZoomValue = 80;
281 				}
282 				aZoom <<= nZoomValue;
283 				xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
284 			}
285 			// set onlinelayout property behind setting the zoom
286 			xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_ONLINE_LAYOUT)),
287 					(nStyleFlags&EX_SHOW_ONLINE_LAYOUT) ? aTrueSet : aFalseSet );
288 			bIsInitialized = sal_True;
289 		}
290 
291 		uno::Reference< text::XTextDocument >  xDoc(_xModel, uno::UNO_QUERY);
292 		uno::Reference< text::XText >  xText = xDoc->getText();
293 		_xCursor = xText->createTextCursor();
294 		uno::Reference< beans::XPropertySet >  xCrsrProp(_xCursor, uno::UNO_QUERY);
295 		uno::Any aPageStyle = xCrsrProp->getPropertyValue(
296 											C2U(SW_PROP_NAME_STR(UNO_NAME_PAGE_STYLE_NAME)));
297 		OUString sPageStyle;
298 		aPageStyle >>= sPageStyle;
299 
300 		uno::Reference< style::XStyleFamiliesSupplier >  xSSupp( xDoc, uno::UNO_QUERY);
301 		uno::Reference< container::XNameAccess >  xStyles = xSSupp->getStyleFamilies();
302 		uno::Any aPFamily = xStyles->getByName( C2U("PageStyles" ) );
303         uno::Reference< container::XNameContainer >  xPFamily;
304 
305         if( 0 == (EX_SHOW_DEFAULT_PAGE == nStyleFlags)
306                 && (aPFamily >>= xPFamily) && sPageStyle.getLength() )
307 		{
308 			uno::Any aPStyle = xPFamily->getByName( sPageStyle );
309             uno::Reference< style::XStyle >  xPStyle;
310             aPStyle >>= xPStyle;
311 			uno::Reference< beans::XPropertySet >  xPProp(xPStyle, uno::UNO_QUERY);
312 			uno::Any aSize = xPProp->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SIZE)));
313             awt::Size aPSize;
314             aSize >>= aPSize;
315 			//TODO: set page width to card width
316 			aPSize.Width = 10000;
317 			aSize.setValue(&aPSize, ::getCppuType((awt::Size*)0));
318 			xPProp->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SIZE)), aSize);
319 
320             uno::Any aZero; aZero <<= (sal_Int32)0;
321             xPProp->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LEFT_MARGIN)), aZero);
322             xPProp->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_RIGHT_MARGIN)), aZero);
323 		}
324 
325 		// can only be done here - the SFX changes the ScrollBar values
326 		xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_SCROLL_BAR )), aFalseSet);
327 		xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_SCROLL_BAR )), aFalseSet);
328 
329 		if( aInitializedLink.IsSet() )
330 		{
331 			rWindow.Enable(sal_False, sal_True);
332 			//rWindow.Enable(sal_True, sal_False);
333    			aInitializedLink.Call(this);
334 		}
335 
336         uno::Reference< text::XTextViewCursorSupplier >  xCrsrSupp(_xController, uno::UNO_QUERY);
337 		uno::Reference< view::XScreenCursor >  xScrCrsr(xCrsrSupp->getViewCursor(), uno::UNO_QUERY);
338         if(xScrCrsr.is())
339             xScrCrsr->screenUp();
340 
341         uno::Reference< awt::XWindow >  xWin( _xControl, uno::UNO_QUERY );
342 		xWin->setVisible( sal_True );
343 		rWindow.Show();
344 
345 		uno::Reference< lang::XUnoTunnel> xTunnel( _xCursor, uno::UNO_QUERY);
346 		if( xTunnel.is() )
347 		{
348             OTextCursorHelper* pCrsr = reinterpret_cast<OTextCursorHelper*>( xTunnel->getSomething(
349                                         OTextCursorHelper::getUnoTunnelId() ));
350 			if( pCrsr )
351 			{
352 				SwEditShell* pSh = pCrsr->GetDoc()->GetEditShell();
353 				if( pSh->ActionCount() )
354 				{
355 					pSh->EndAllAction();
356 					pSh->UnlockPaint();
357 				}
358 			}
359 		}
360 
361 		SW_MOD()->SetView(pModuleView);
362 	}
363 	else
364 		pTimer->Start();
365 	return 0;
366 }
367 /* -----------------------------27.12.99 09:59--------------------------------
368 
369  ---------------------------------------------------------------------------*/
370 void SwOneExampleFrame::ClearDocument( sal_Bool bStartUpdateTimer )
371 {
372 	uno::Reference< lang::XUnoTunnel> xTunnel( _xCursor, uno::UNO_QUERY);
373 	if( xTunnel.is() )
374 	{
375         OTextCursorHelper* pCrsr = reinterpret_cast<OTextCursorHelper*>(xTunnel->getSomething(
376                                         OTextCursorHelper::getUnoTunnelId()) );
377 		if( pCrsr )
378 		{
379 			SwDoc* pDoc = pCrsr->GetDoc();
380 			SwEditShell* pSh = pDoc->GetEditShell();
381 			pSh->LockPaint();
382 			pSh->StartAllAction();
383 			pDoc->ClearDoc();
384 
385 			if( aLoadedTimer.IsActive() || !bStartUpdateTimer )
386 			{
387 				pSh->EndAllAction();
388 				pSh->UnlockPaint();
389 			}
390 			if( bStartUpdateTimer )
391 				aLoadedTimer.Start();
392 		}
393 		else
394 		{
395 			_xCursor->gotoStart(sal_False);
396 			_xCursor->gotoEnd(sal_True);
397 			_xCursor->setString(OUString());
398 		}
399 	}
400 }
401 /* -----------------------------15.12.99 11:09--------------------------------
402 
403  ---------------------------------------------------------------------------*/
404 static const sal_Int16 nZoomValues[] =
405 {
406 	20,
407 	40,
408 	50,
409 	75,
410 	100
411 };
412 //---------------------------------------------------------------------------
413 #define ITEM_UP		100
414 #define ITEM_DOWN	200
415 #define ITEM_ZOOM   300
416 
417 void SwOneExampleFrame::CreatePopup(const Point& rPt)
418 {
419 	PopupMenu aPop;
420 	PopupMenu aSubPop1;
421 	ResStringArray& rArr = aMenuRes.GetMenuArray();
422 
423 	aPop.InsertItem(ITEM_UP,   rArr.GetString(rArr.FindIndex(ST_MENU_UP )));
424 	aPop.InsertItem(ITEM_DOWN, rArr.GetString(rArr.FindIndex(ST_MENU_DOWN )));
425 
426 	Link aSelLk = LINK(this, SwOneExampleFrame, PopupHdl );
427 	aPop.SetSelectHdl(aSelLk);
428 	if(EX_SHOW_ONLINE_LAYOUT == nStyleFlags)
429 	{
430 		aPop.InsertItem(ITEM_ZOOM, rArr.GetString(rArr.FindIndex(ST_MENU_ZOOM   )));
431 
432 		uno::Reference< view::XViewSettingsSupplier >  xSettings(_xController, uno::UNO_QUERY);
433 		uno::Reference< beans::XPropertySet >  xViewProps = xSettings->getViewSettings();
434 
435 		uno::Any aZoom = xViewProps->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)));
436 		sal_Int16 nZoom = 0;
437 		aZoom >>= nZoom;
438 
439 		for(sal_uInt16 i = 0; i < 5; i++ )
440 		{
441 			String sTemp;
442 			sTemp = String::CreateFromInt32(nZoomValues[i]);
443 			sTemp += String::CreateFromAscii(" %");
444 			aSubPop1.InsertItem( ITEM_ZOOM + i + 1, sTemp);
445 			if(nZoom == nZoomValues[i])
446 				aSubPop1.CheckItem(ITEM_ZOOM + i + 1);
447 		}
448 		aPop.SetPopupMenu( ITEM_ZOOM, &aSubPop1 );
449 		aSubPop1.SetSelectHdl(aSelLk);
450 	}
451 	aPop.Execute( &aTopWindow, rPt );
452 
453 }
454 /* -----------------------------15.12.99 11:09--------------------------------
455 
456  ---------------------------------------------------------------------------*/
457 IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu )
458 {
459 	sal_uInt16 nId = pMenu->GetCurItemId();
460 	if( nId > ITEM_ZOOM && nId < ITEM_ZOOM + 100 )
461 	{
462 		sal_Int16 nZoom = nZoomValues[nId - ITEM_ZOOM - 1];
463 		uno::Reference< view::XViewSettingsSupplier >  xSettings(_xController, uno::UNO_QUERY);
464 		uno::Reference< beans::XPropertySet >  xViewProps = xSettings->getViewSettings();
465 
466 		uno::Any aZoom;
467 		aZoom <<= nZoom;
468 		xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
469         aZoom <<= (sal_Int16)view::DocumentZoomType::BY_VALUE;
470 		xViewProps->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
471 	}
472 	else if(ITEM_UP == nId || ITEM_DOWN == nId)
473 	{
474 		uno::Reference< text::XTextViewCursorSupplier >  xCrsrSupp(_xController, uno::UNO_QUERY);
475 		uno::Reference< view::XScreenCursor >  xScrCrsr(xCrsrSupp->getViewCursor(), uno::UNO_QUERY);
476 		if(ITEM_UP == nId)
477 			xScrCrsr->screenUp();
478 		else
479 			xScrCrsr->screenDown();
480 	}
481 	return 0;
482 };
483 /* -----------------------------15.12.99 10:37--------------------------------
484 
485  ---------------------------------------------------------------------------*/
486 SwFrmCtrlWindow::SwFrmCtrlWindow(Window* pParent, WinBits nBits,
487 								SwOneExampleFrame* 	pFrame) :
488 	Window(pParent, nBits),
489 	pExampleFrame(pFrame)
490 {
491 }
492 /* -----------------------------15.12.99 09:57--------------------------------
493 
494  ---------------------------------------------------------------------------*/
495 void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt )
496 {
497 	switch ( rCEvt.GetCommand() )
498 	{
499 		case COMMAND_CONTEXTMENU:
500 		{
501 			//#125881# quickly clicking crashes because the control is not fully initialized
502             if(pExampleFrame->GetController().is())
503                 pExampleFrame->CreatePopup(rCEvt.GetMousePosPixel());
504 		}
505 		break;
506 		case COMMAND_WHEEL:
507 		case COMMAND_STARTAUTOSCROLL:
508 		case COMMAND_AUTOSCROLL:
509 		break;
510 		default:;
511 	}
512 }
513 /* -----------------------------15.12.99 12:57--------------------------------
514 
515  ---------------------------------------------------------------------------*/
516 MenuResource::MenuResource(const ResId& rResId) :
517 	Resource(rResId),
518 	aMenuArray(ResId(1,*rResId.GetResMgr()))
519 {
520 	FreeResource();
521 }
522 
523