bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / utlui / unotools.cxx
bloba0fd65d2b7c8a52c10fc34c93a505425e3ef9752
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <swtypes.hxx>
22 #include <globals.hrc>
23 #include <misc.hrc>
25 #include <utlui.hrc>
26 #include <unotools.hrc>
27 #include <unotools.hxx>
28 #include <unoprnms.hxx>
29 #include <osl/diagnose.h>
30 #include <vcl/msgbox.hxx>
31 #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
32 #include <com/sun/star/view/XScreenCursor.hpp>
33 #include <com/sun/star/view/DocumentZoomType.hpp>
34 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
35 #include <com/sun/star/style/XStyle.hpp>
36 #include <com/sun/star/text/XTextDocument.hpp>
37 #include <com/sun/star/awt/Toolkit.hpp>
38 #include <com/sun/star/awt/PosSize.hpp>
39 #include <com/sun/star/view/XViewSettingsSupplier.hpp>
40 #include <com/sun/star/container/XNameContainer.hpp>
41 #include <com/sun/star/frame/XLayoutManager.hpp>
42 #include <comphelper/processfactory.hxx>
43 #include <sfx2/dispatch.hxx>
44 #include <svl/stritem.hxx>
45 #include <shellio.hxx>
46 #include <docsh.hxx>
47 #include <view.hxx>
48 #include <wrtsh.hxx>
49 #include <swmodule.hxx>
50 #include <TextCursorHelper.hxx>
51 #include <unocrsr.hxx>
52 #include <doc.hxx>
54 #include <unomid.h>
56 using namespace ::com::sun::star;
58 const sal_Char cFrameControl[] = "com.sun.star.frame.FrameControl";
59 const sal_Char cFactory[] = "private:factory/swriter";
61 bool SwOneExampleFrame::bShowServiceNotAvailableMessage = true;
63 SwOneExampleFrame::SwOneExampleFrame( Window& rWin,
64 sal_uInt32 nFlags,
65 const Link* pInitializedLink,
66 String* pURL ) :
67 aTopWindow(&rWin, this),
68 aMenuRes(SW_RES(RES_FRMEX_MENU)),
69 pModuleView(SW_MOD()->GetView()),
70 nStyleFlags(nFlags),
71 bIsInitialized(sal_False),
72 bServiceAvailable(sal_False)
74 if (pURL && pURL->Len())
75 sArgumentURL = *pURL;
77 aTopWindow.SetPosSizePixel(Point(0, 0), rWin.GetSizePixel());
79 if( pInitializedLink )
80 aInitializedLink = *pInitializedLink;
82 // the controller is asynchronously set
83 aLoadedTimer.SetTimeoutHdl(LINK(this, SwOneExampleFrame, TimeoutHdl));
84 aLoadedTimer.SetTimeout(200);
86 CreateControl();
88 aTopWindow.Show();
91 void SwOneExampleFrame::CreateErrorMessage(Window* pParent)
93 if(SwOneExampleFrame::bShowServiceNotAvailableMessage)
95 String sInfo(SW_RES(STR_SERVICE_UNAVAILABLE));
96 sInfo += OUString(cFrameControl);
97 InfoBox(pParent, sInfo).Execute();
98 SwOneExampleFrame::bShowServiceNotAvailableMessage = false;
102 SwOneExampleFrame::~SwOneExampleFrame()
104 DisposeControl();
107 void SwOneExampleFrame::CreateControl()
109 if(_xControl.is())
110 return ;
111 uno::Reference< lang::XMultiServiceFactory >
112 xMgr = comphelper::getProcessServiceFactory();
113 uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
114 uno::Reference< uno::XInterface > xInst = xMgr->createInstance( "com.sun.star.frame.FrameControl" );
115 _xControl = uno::Reference< awt::XControl >(xInst, uno::UNO_QUERY);
116 if(_xControl.is())
118 uno::Reference< awt::XWindowPeer > xParent( aTopWindow.GetComponentInterface() );
120 uno::Reference< awt::XToolkit > xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW );
122 _xControl->createPeer( xToolkit, xParent );
124 uno::Reference< awt::XWindow > xWin( _xControl, uno::UNO_QUERY );
125 xWin->setVisible(sal_False);
126 Size aWinSize(aTopWindow.GetOutputSizePixel());
127 xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
129 uno::Reference< beans::XPropertySet > xPrSet(xInst, uno::UNO_QUERY);
130 uno::Any aURL;
131 // create new doc
132 OUString sTempURL(cFactory);
133 if(sArgumentURL.Len())
134 sTempURL = sArgumentURL;
135 aURL <<= sTempURL;
137 uno::Sequence<beans::PropertyValue> aSeq(3);
138 beans::PropertyValue* pValues = aSeq.getArray();
139 pValues[0].Name = "ReadOnly";
140 sal_Bool bTrue = sal_True;
141 pValues[0].Value.setValue(&bTrue, ::getBooleanCppuType());
142 pValues[1].Name = "OpenFlags";
143 pValues[1].Value <<= OUString("-RB");
144 pValues[2].Name = "Referer";
145 pValues[2].Value <<= OUString("private:user");
146 uno::Any aArgs;
147 aArgs.setValue(&aSeq, ::getCppuType((uno::Sequence<beans::PropertyValue>*)0));
149 xPrSet->setPropertyValue( "LoaderArguments", aArgs );
150 //save and set readonly???
152 xPrSet->setPropertyValue("ComponentURL", aURL);
154 aLoadedTimer.Start();
155 bServiceAvailable = sal_True;
159 void SwOneExampleFrame::DisposeControl()
161 _xCursor = 0;
162 if(_xControl.is())
163 _xControl->dispose();
164 _xControl = 0;
165 _xModel = 0;
166 _xController = 0;
169 static void disableScrollBars(uno::Reference< beans::XPropertySet > xViewProps,
170 bool bEnableOnlineMode)
172 //the scrollbar logic is kind of busted looking in writer, when the hori scrollbar
173 //property is changed then the hori scrollbar is enabled if the property is
174 //true or browse (online) mode is enabled. So...
175 //disable online mode
176 //turn off scrollbars
177 //turn back on online mode if that's what we want
178 //which subverts the (dodgy/buggy) scrollbar setting
180 //To reproduce this problem, in edit->autotext and click through
181 //the examples and see if the preview gets a horizontal scrollbar
182 uno::Any aFalseSet(uno::makeAny(sal_False));
183 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_ONLINE_LAYOUT)), aFalseSet);
185 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_SCROLL_BAR )), aFalseSet);
186 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_SCROLL_BAR )), aFalseSet);
188 if (bEnableOnlineMode)
190 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_ONLINE_LAYOUT)), uno::makeAny(sal_True));
194 IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
196 if(!_xControl.is())
197 return 0;
199 // now get the model
200 uno::Reference< beans::XPropertySet > xPrSet(_xControl, uno::UNO_QUERY);
201 uno::Any aFrame = xPrSet->getPropertyValue("Frame");
202 uno::Reference< frame::XFrame > xFrm;
203 aFrame >>= xFrm;
205 uno::Reference< beans::XPropertySet > xPropSet( xFrm, uno::UNO_QUERY );
206 if ( xPropSet.is() )
210 uno::Reference< frame::XLayoutManager > xLayoutManager;
211 uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
212 aValue >>= xLayoutManager;
213 if ( xLayoutManager.is() )
214 xLayoutManager->setVisible( sal_False );
216 catch (const uno::Exception&)
221 _xController = xFrm->getController();
222 if(_xController.is())
224 _xModel = _xController->getModel();
225 //now the ViewOptions should be set properly
226 uno::Reference< view::XViewSettingsSupplier > xSettings(_xController, uno::UNO_QUERY);
227 uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings();
229 sal_Bool bTrue = sal_True;
230 sal_Bool bFalse = sal_False;
231 uno::Any aTrueSet( &bTrue, ::getBooleanCppuType() );
232 uno::Any aFalseSet( &bFalse, ::getBooleanCppuType() );
234 if( !bIsInitialized )
236 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_BREAKS)), aFalseSet);
237 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_DRAWINGS)), aTrueSet);
238 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_FIELD_COMMANDS)), aFalseSet);
239 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_GRAPHICS)), aTrueSet);
240 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_PARAGRAPHS)), aFalseSet);
241 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HIDDEN_TEXT)), aFalseSet);
242 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_HORI_RULER)), aFalseSet);
243 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_PARA_BREAKS)), aFalseSet);
244 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_PROTECTED_SPACES)), aFalseSet);
245 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_SOFT_HYPHENS)), aFalseSet);
246 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_SPACES)), aFalseSet);
247 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABLES)), aTrueSet);
248 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_TABSTOPS)), aFalseSet);
249 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SHOW_VERT_RULER)), aFalseSet);
251 if(0 ==(nStyleFlags&EX_SHOW_ONLINE_LAYOUT))
253 uno::Any aZoom;
254 aZoom <<= (sal_Int16)view::DocumentZoomType::PAGE_WIDTH_EXACT;
255 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
257 else
259 uno::Any aZoom;
260 aZoom <<= (sal_Int16)view::DocumentZoomType::BY_VALUE;
261 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
263 sal_Int16 nZoomValue = 50;
264 if(EX_SHOW_BUSINESS_CARDS == nStyleFlags)
266 nZoomValue = 80;
268 aZoom <<= nZoomValue;
269 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
272 // set onlinelayout property after setting the zoom
273 disableScrollBars(xViewProps, nStyleFlags&EX_SHOW_ONLINE_LAYOUT);
274 bIsInitialized = sal_True;
277 uno::Reference< text::XTextDocument > xDoc(_xModel, uno::UNO_QUERY);
278 uno::Reference< text::XText > xText = xDoc->getText();
279 _xCursor = xText->createTextCursor();
281 //From here, a cursor is defined, which goes through the template,
282 //and overwrites the template words where it is necessary.
284 uno::Reference< lang::XUnoTunnel> xTunnel( _xCursor, uno::UNO_QUERY);
285 if( xTunnel.is() )
287 OTextCursorHelper* pCrsr = reinterpret_cast<OTextCursorHelper*>( xTunnel->getSomething(
288 OTextCursorHelper::getUnoTunnelId() ));
289 if( pCrsr )
291 SwEditShell* pSh = pCrsr->GetDoc()->GetEditShell();
295 if (pSh->GetCurWord() == String("HEADING1"))
297 pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_HEADING1));
299 else if (pSh->GetCurWord() == String("ENTRY1"))
301 pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_ENTRY1));
303 else if (pSh->GetCurWord() == String("HEADING11"))
305 pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_HEADING11));
307 else if (pSh->GetCurWord() == String("ENTRY11"))
309 pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_ENTRY11));
311 else if (pSh->GetCurWord() == String("HEADING12"))
313 pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_HEADING12));
315 else if (pSh->GetCurWord() == String("ENTRY12"))
317 pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_ENTRY12));
319 else if (pSh->GetCurWord() == String("TABLE1"))
321 pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_TABLE1));
323 else if (pSh->GetCurWord() == String("IMAGE1"))
325 pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_IMAGE1));
327 else
330 while(pSh->Right(sal_uInt16(1), sal_uInt16(1), sal_True) == sal_True);
334 uno::Reference< beans::XPropertySet > xCrsrProp(_xCursor, uno::UNO_QUERY);
335 uno::Any aPageStyle = xCrsrProp->getPropertyValue(
336 OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_PAGE_STYLE_NAME)));
337 OUString sPageStyle;
338 aPageStyle >>= sPageStyle;
340 uno::Reference< style::XStyleFamiliesSupplier > xSSupp( xDoc, uno::UNO_QUERY);
341 uno::Reference< container::XNameAccess > xStyles = xSSupp->getStyleFamilies();
342 uno::Any aPFamily = xStyles->getByName( "PageStyles" );
343 uno::Reference< container::XNameContainer > xPFamily;
345 if( 0 == (EX_SHOW_DEFAULT_PAGE == nStyleFlags)
346 && (aPFamily >>= xPFamily) && !sPageStyle.isEmpty() )
348 uno::Any aPStyle = xPFamily->getByName( sPageStyle );
349 uno::Reference< style::XStyle > xPStyle;
350 aPStyle >>= xPStyle;
351 uno::Reference< beans::XPropertySet > xPProp(xPStyle, uno::UNO_QUERY);
352 uno::Any aSize = xPProp->getPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SIZE)));
353 awt::Size aPSize;
354 aSize >>= aPSize;
355 //TODO: set page width to card width
356 aPSize.Width = 10000;
357 aSize.setValue(&aPSize, ::getCppuType((awt::Size*)0));
358 xPProp->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_SIZE)), aSize);
360 uno::Any aZero; aZero <<= (sal_Int32)0;
361 xPProp->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_LEFT_MARGIN)), aZero);
362 xPProp->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RIGHT_MARGIN)), aZero);
365 uno::Reference< awt::XWindow > xWin( _xControl, uno::UNO_QUERY );
366 Size aWinSize(aTopWindow.GetOutputSizePixel());
367 xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
369 // can only be done here - the SFX changes the ScrollBar values
370 disableScrollBars(xViewProps, nStyleFlags&EX_SHOW_ONLINE_LAYOUT);
372 if (aInitializedLink.IsSet())
373 aInitializedLink.Call(this);
375 uno::Reference< text::XTextViewCursorSupplier > xCrsrSupp(_xController, uno::UNO_QUERY);
376 uno::Reference< view::XScreenCursor > xScrCrsr(xCrsrSupp->getViewCursor(), uno::UNO_QUERY);
377 if(xScrCrsr.is())
378 xScrCrsr->screenUp();
380 xWin->setVisible( sal_True );
381 aTopWindow.Show();
383 if( xTunnel.is() )
385 OTextCursorHelper* pCrsr = reinterpret_cast<OTextCursorHelper*>( xTunnel->getSomething(
386 OTextCursorHelper::getUnoTunnelId() ));
387 if( pCrsr )
389 SwEditShell* pSh = pCrsr->GetDoc()->GetEditShell();
390 if( pSh->ActionCount() )
392 pSh->EndAllAction();
393 pSh->UnlockPaint();
398 SW_MOD()->SetView(pModuleView);
400 else
401 pTimer->Start();
402 return 0;
405 void SwOneExampleFrame::ClearDocument( sal_Bool bStartUpdateTimer )
407 uno::Reference< lang::XUnoTunnel> xTunnel( _xCursor, uno::UNO_QUERY);
408 if( xTunnel.is() )
410 OTextCursorHelper* pCrsr = reinterpret_cast<OTextCursorHelper*>(xTunnel->getSomething(
411 OTextCursorHelper::getUnoTunnelId()) );
412 if( pCrsr )
414 SwDoc* pDoc = pCrsr->GetDoc();
415 SwEditShell* pSh = pDoc->GetEditShell();
416 pSh->LockPaint();
417 pSh->StartAllAction();
418 pDoc->ClearDoc();
420 if( aLoadedTimer.IsActive() || !bStartUpdateTimer )
422 pSh->EndAllAction();
423 pSh->UnlockPaint();
425 if( bStartUpdateTimer )
426 aLoadedTimer.Start();
428 else
430 _xCursor->gotoStart(sal_False);
431 _xCursor->gotoEnd(sal_True);
432 _xCursor->setString(OUString());
437 static const sal_Int16 nZoomValues[] =
446 #define ITEM_UP 100
447 #define ITEM_DOWN 200
448 #define ITEM_ZOOM 300
450 void SwOneExampleFrame::CreatePopup(const Point& rPt)
452 PopupMenu aPop;
453 PopupMenu aSubPop1;
454 ResStringArray& rArr = aMenuRes.GetMenuArray();
456 aPop.InsertItem(ITEM_UP, rArr.GetString(rArr.FindIndex(ST_MENU_UP )));
457 aPop.InsertItem(ITEM_DOWN, rArr.GetString(rArr.FindIndex(ST_MENU_DOWN )));
459 Link aSelLk = LINK(this, SwOneExampleFrame, PopupHdl );
460 aPop.SetSelectHdl(aSelLk);
461 if(EX_SHOW_ONLINE_LAYOUT == nStyleFlags)
463 aPop.InsertItem(ITEM_ZOOM, rArr.GetString(rArr.FindIndex(ST_MENU_ZOOM )));
465 uno::Reference< view::XViewSettingsSupplier > xSettings(_xController, uno::UNO_QUERY);
466 uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings();
468 uno::Any aZoom = xViewProps->getPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)));
469 sal_Int16 nZoom = 0;
470 aZoom >>= nZoom;
472 for (sal_uInt16 i = 0;
473 i < (sizeof(nZoomValues)/sizeof(nZoomValues[0])); ++i)
475 String sTemp;
476 sTemp = OUString::number(nZoomValues[i]);
477 sTemp += OUString(" %");
478 aSubPop1.InsertItem( ITEM_ZOOM + i + 1, sTemp);
479 if(nZoom == nZoomValues[i])
480 aSubPop1.CheckItem(ITEM_ZOOM + i + 1);
482 aPop.SetPopupMenu( ITEM_ZOOM, &aSubPop1 );
483 aSubPop1.SetSelectHdl(aSelLk);
485 aPop.Execute( &aTopWindow, rPt );
489 IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu )
491 sal_uInt16 nId = pMenu->GetCurItemId();
492 if ((nId > ITEM_ZOOM) &&
493 (nId <= (ITEM_ZOOM + (sizeof(nZoomValues)/sizeof(nZoomValues[0])))))
495 sal_Int16 nZoom = nZoomValues[nId - ITEM_ZOOM - 1];
496 uno::Reference< view::XViewSettingsSupplier > xSettings(_xController, uno::UNO_QUERY);
497 uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings();
499 uno::Any aZoom;
500 aZoom <<= nZoom;
501 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_VALUE)), aZoom);
502 aZoom <<= (sal_Int16)view::DocumentZoomType::BY_VALUE;
503 xViewProps->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_ZOOM_TYPE)), aZoom);
505 else if(ITEM_UP == nId || ITEM_DOWN == nId)
507 uno::Reference< text::XTextViewCursorSupplier > xCrsrSupp(_xController, uno::UNO_QUERY);
508 uno::Reference< view::XScreenCursor > xScrCrsr(xCrsrSupp->getViewCursor(), uno::UNO_QUERY);
509 if(ITEM_UP == nId)
510 xScrCrsr->screenUp();
511 else
512 xScrCrsr->screenDown();
514 return 0;
517 SwFrmCtrlWindow::SwFrmCtrlWindow(Window* pParent, SwOneExampleFrame* pFrame)
518 : VclEventBox(pParent)
519 , pExampleFrame(pFrame)
521 set_expand(true);
522 set_fill(true);
525 void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt )
527 switch ( rCEvt.GetCommand() )
529 case COMMAND_CONTEXTMENU:
531 //#125881# quickly clicking crashes because the control is not fully initialized
532 if(pExampleFrame->GetController().is())
533 pExampleFrame->CreatePopup(rCEvt.GetMousePosPixel());
535 break;
536 case COMMAND_WHEEL:
537 case COMMAND_STARTAUTOSCROLL:
538 case COMMAND_AUTOSCROLL:
539 break;
540 default:;
544 Size SwFrmCtrlWindow::GetOptimalSize() const
546 return LogicToPixel(Size(82, 124), MapMode(MAP_APPFONT));
549 void SwFrmCtrlWindow::Resize()
551 VclEventBox::Resize();
552 pExampleFrame->ClearDocument(true);
555 MenuResource::MenuResource(const ResId& rResId) :
556 Resource(rResId),
557 aMenuArray(ResId(1,*rResId.GetResMgr()))
559 FreeResource();
562 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */