LayoutMenu.cxx (02c50d82) LayoutMenu.cxx (8dcb2a10)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 28 unchanged lines hidden (view full) ---

37#include "strings.hrc"
38#include "tools/SlotStateListener.hxx"
39#include "DrawController.hxx"
40#include "DrawDocShell.hxx"
41#include "DrawViewShell.hxx"
42#include "EventMultiplexer.hxx"
43#include "SlideSorterViewShell.hxx"
44#include "ViewShellBase.hxx"
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 28 unchanged lines hidden (view full) ---

37#include "strings.hrc"
38#include "tools/SlotStateListener.hxx"
39#include "DrawController.hxx"
40#include "DrawDocShell.hxx"
41#include "DrawViewShell.hxx"
42#include "EventMultiplexer.hxx"
43#include "SlideSorterViewShell.hxx"
44#include "ViewShellBase.hxx"
45#include <sfx2/sidebar/Theme.hxx>
45
46#include <comphelper/processfactory.hxx>
47#include <sfx2/app.hxx>
48#include <sfx2/dispatch.hxx>
49#include <sfx2/objface.hxx>
50#include <sfx2/request.hxx>
51#include <sfx2/viewfrm.hxx>
52#include <svl/languageoptions.hxx>

--- 91 unchanged lines hidden (view full) ---

144 mxListener(NULL),
145 mbSelectionUpdatePending(true),
146 mbIsMainViewChangePending(false),
147 mxSidebar(rxSidebar),
148 mbIsDisposed(false)
149{
150 implConstruct( *mrBase.GetDocument()->GetDocSh() );
151 OSL_TRACE("created LayoutMenu at %x", this);
46
47#include <comphelper/processfactory.hxx>
48#include <sfx2/app.hxx>
49#include <sfx2/dispatch.hxx>
50#include <sfx2/objface.hxx>
51#include <sfx2/request.hxx>
52#include <sfx2/viewfrm.hxx>
53#include <svl/languageoptions.hxx>

--- 91 unchanged lines hidden (view full) ---

145 mxListener(NULL),
146 mbSelectionUpdatePending(true),
147 mbIsMainViewChangePending(false),
148 mxSidebar(rxSidebar),
149 mbIsDisposed(false)
150{
151 implConstruct( *mrBase.GetDocument()->GetDocSh() );
152 OSL_TRACE("created LayoutMenu at %x", this);
153
154 SetStyle(GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_TABSTOP);
155
156 SetBackground(sfx2::sidebar::Theme::GetWallpaper(sfx2::sidebar::Theme::Paint_PanelBackground));
157 SetColor(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Paint_PanelBackground));
152
153#ifdef DEBUG
154 SetText(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sd:LayoutMenu")));
155#endif
156}
157
158
159
160
161void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell )
162{
163 OSL_ENSURE( mrBase.GetDocument()->GetDocSh() == &rDocumentShell,
164 "LayoutMenu::implConstruct: hmm?" );
165 // if this fires, then my assumption that the rDocumentShell parameter to our first ctor is superfluous ...
166
167 SetStyle (
168 ( GetStyle() & ~(WB_ITEMBORDER) )
169 | WB_TABSTOP
158
159#ifdef DEBUG
160 SetText(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sd:LayoutMenu")));
161#endif
162}
163
164
165
166
167void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell )
168{
169 OSL_ENSURE( mrBase.GetDocument()->GetDocSh() == &rDocumentShell,
170 "LayoutMenu::implConstruct: hmm?" );
171 // if this fires, then my assumption that the rDocumentShell parameter to our first ctor is superfluous ...
172
173 SetStyle (
174 ( GetStyle() & ~(WB_ITEMBORDER) )
175 | WB_TABSTOP
176 | WB_MENUSTYLEVALUESET
170 | WB_NO_DIRECTSELECT
171 );
172 if (mbUseOwnScrollBar)
173 SetStyle (GetStyle() | WB_VSCROLL);
174 SetExtraSpacing(2);
175 SetSelectHdl (LINK(this, LayoutMenu, ClickHandler));
176 InvalidateContent();
177

--- 209 unchanged lines hidden (view full) ---

387 }
388}
389
390
391
392
393void LayoutMenu::Paint (const Rectangle& rRect)
394{
177 | WB_NO_DIRECTSELECT
178 );
179 if (mbUseOwnScrollBar)
180 SetStyle (GetStyle() | WB_VSCROLL);
181 SetExtraSpacing(2);
182 SetSelectHdl (LINK(this, LayoutMenu, ClickHandler));
183 InvalidateContent();
184

--- 209 unchanged lines hidden (view full) ---

394 }
395}
396
397
398
399
400void LayoutMenu::Paint (const Rectangle& rRect)
401{
395 SetBackground (GetSettings().GetStyleSettings().GetWindowColor());
396
397 if (mbSelectionUpdatePending)
398 {
399 mbSelectionUpdatePending = false;
400 UpdateSelection();
401 }
402 ValueSet::Paint (rRect);
402 if (mbSelectionUpdatePending)
403 {
404 mbSelectionUpdatePending = false;
405 UpdateSelection();
406 }
407 ValueSet::Paint (rRect);
403
404 SetBackground (Wallpaper());
405}
406
407
408
409
410void LayoutMenu::Resize (void)
411{
412 Size aWindowSize = GetOutputSizePixel();

--- 38 unchanged lines hidden (view full) ---

451 SelectItem(nIndex);
452 }
453
454 ValueSet::MouseButtonDown (rEvent);
455}
456
457
458
408}
409
410
411
412
413void LayoutMenu::Resize (void)
414{
415 Size aWindowSize = GetOutputSizePixel();

--- 38 unchanged lines hidden (view full) ---

454 SelectItem(nIndex);
455 }
456
457 ValueSet::MouseButtonDown (rEvent);
458}
459
460
461
459/*
460void LayoutMenu::GetState (SfxItemSet& rItemSet)
461{
462 // Cut and paste is not supported. The SID_(CUT,COPY,PASTE) entries
463 // therefore must not show up in the context menu.
464 rItemSet.DisableItem (SID_CUT);
465 rItemSet.DisableItem (SID_COPY);
466 rItemSet.DisableItem (SID_PASTE);
467
462
468 // The SID_INSERTPAGE_LAYOUT_MENU slot depends on the SID_INSERTPAGE
469 // slot being supported elsewhere.
470 const SfxPoolItem* pItem = NULL;
471 const SfxItemState aState (
472 mrBase.GetViewFrame()->GetDispatcher()->QueryState(SID_INSERTPAGE, pItem));
473 if (aState == SFX_ITEM_DISABLED)
474 rItemSet.DisableItem(SID_INSERTPAGE_LAYOUT_MENU);
475}
476*/
477
478
479
480void LayoutMenu::InsertPageWithLayout (AutoLayout aLayout)
481{
482 ViewShell* pViewShell = mrBase.GetMainViewShell().get();
483 if (pViewShell == NULL)
484 return;
485
486 SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
487 if (pViewFrame == NULL)

--- 16 unchanged lines hidden (view full) ---

504 UpdateSelection();
505}
506
507
508
509
510void LayoutMenu::InvalidateContent (void)
511{
463void LayoutMenu::InsertPageWithLayout (AutoLayout aLayout)
464{
465 ViewShell* pViewShell = mrBase.GetMainViewShell().get();
466 if (pViewShell == NULL)
467 return;
468
469 SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
470 if (pViewFrame == NULL)

--- 16 unchanged lines hidden (view full) ---

487 UpdateSelection();
488}
489
490
491
492
493void LayoutMenu::InvalidateContent (void)
494{
512 // The number of items may have changed. Request a resize so that the
513 // vertical size of this control can be adapted.
514 // RequestResize();
515
516 // Throw away the current set and fill the menu anew according to the
517 // current settings (this includes the support for vertical writing.)
518 Fill();
519
520 if (mxSidebar.is())
521 mxSidebar->requestLayout();
522}
523

--- 465 unchanged lines hidden (view full) ---

989
990
991
992
993void LayoutMenu::DataChanged (const DataChangedEvent& rEvent)
994{
995 Fill();
996 ValueSet::DataChanged(rEvent);
495 // Throw away the current set and fill the menu anew according to the
496 // current settings (this includes the support for vertical writing.)
497 Fill();
498
499 if (mxSidebar.is())
500 mxSidebar->requestLayout();
501}
502

--- 465 unchanged lines hidden (view full) ---

968
969
970
971
972void LayoutMenu::DataChanged (const DataChangedEvent& rEvent)
973{
974 Fill();
975 ValueSet::DataChanged(rEvent);
976 SetBackground(sfx2::sidebar::Theme::GetWallpaper(sfx2::sidebar::Theme::Paint_PanelBackground));
977 SetColor(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Paint_PanelBackground));
997}
998
999
1000
1001
1002
1003} } // end of namespace ::sd::sidebar
978}
979
980
981
982
983
984} } // end of namespace ::sd::sidebar