diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-06-29 17:43:01 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-06-29 22:47:09 +0900 |
commit | 3f501522a838e245431a4558af5639b602566e33 (patch) | |
tree | b2c6729bb06b8c9ea6c9fa7792abef07484167ec /sd | |
parent | Update LanguageTool to version 1.7 + passive registration (diff) | |
download | core-3f501522a838e245431a4558af5639b602566e33.tar.gz core-3f501522a838e245431a4558af5639b602566e33.zip |
removed unused TestMenu & TestPanel
Change-Id: Ibd9bea6ea749090d7d72d3da66378d4e84a0a63d
Diffstat (limited to 'sd')
-rw-r--r-- | sd/Library_sd.mk | 2 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/TestMenu.cxx | 310 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/TestMenu.hxx | 78 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/TestPanel.cxx | 172 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/TestPanel.hxx | 51 |
5 files changed, 0 insertions, 613 deletions
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 1e5be7bd01e9..2f3c0d0bc4c4 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -387,8 +387,6 @@ $(eval $(call gb_Library_add_exception_objects,sd,\ sd/source/ui/toolpanel/TaskPaneFocusManager \ sd/source/ui/toolpanel/TaskPaneShellManager \ sd/source/ui/toolpanel/TaskPaneTreeNode \ - sd/source/ui/toolpanel/TestMenu \ - sd/source/ui/toolpanel/TestPanel \ sd/source/ui/toolpanel/TitleBar \ sd/source/ui/toolpanel/TitledControl \ sd/source/ui/toolpanel/ToolPanel \ diff --git a/sd/source/ui/toolpanel/TestMenu.cxx b/sd/source/ui/toolpanel/TestMenu.cxx deleted file mode 100644 index fa6e59c00ef6..000000000000 --- a/sd/source/ui/toolpanel/TestMenu.cxx +++ /dev/null @@ -1,310 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include "TestMenu.hxx" - -#include "taskpane/TaskPaneControlFactory.hxx" - -#include <vcl/image.hxx> -#include <vcl/svapp.hxx> - -namespace sd { namespace toolpanel { - -#ifdef SHOW_COLOR_MENU -/** This factory class is used to create instances of ColorMenu. It can be - extended so that its constructor stores arguments that later are passed - to new ColorMenu objects. -*/ -class ColorMenuFactory - : public ControlFactory -{ -protected: - virtual TreeNode* InternalCreateControl( ::Window& i_rParent ) - { - return new ColorMenu (&i_rParent); - } -}; - - -ColorMenu::ColorMenu (::Window* i_pParent) - : Window (i_pParent), - TreeNode(NULL), - maSet (this), - mnPreferredColumnCount(2) -{ - WinBits aStyle = - WB_ITEMBORDER - | WB_DOUBLEBORDER - | WB_NAMEFIELD - | WB_FLATVALUESET - | WB_TABSTOP - | WB_VSCROLL; - - maSet.SetStyle (maSet.GetStyle() | aStyle); - maSet.SetExtraSpacing(2); - - Fill (); - maSet.Show(); - i_pParent->Resize(); -} - - - - -ColorMenu::~ColorMenu (void) -{ -} - - -::std::auto_ptr<ControlFactory> ColorMenu::CreateControlFactory (void) -{ - return ::std::auto_ptr<ControlFactory>(new ColorMenuFactory()); -} - - -/** The preferred size depends on the preferred number of columns, the - number of items, and the size of the items. -*/ -Size ColorMenu::GetPreferredSize (void) -{ - Size aItemSize = maSet.CalcItemSizePixel (Size()); - Size aPreferredWindowSize = maSet.CalcWindowSizePixel ( - aItemSize, - (sal_uInt16)mnPreferredColumnCount, - (sal_uInt16)CalculateRowCount (aItemSize, (sal_uInt16)mnPreferredColumnCount)); - return aPreferredWindowSize; -} - - - - -sal_Int32 ColorMenu::GetPreferredWidth (sal_Int32 nHeight) -{ - sal_Int32 nPreferredWidth = 0; - if (maSet.GetItemCount() > 0) - { - Image aImage = maSet.GetItemImage(maSet.GetItemId(0)); - Size aItemSize = maSet.CalcItemSizePixel (aImage.GetSizePixel()); - if (nHeight>0 && aItemSize.Height()>0) - { - int nRowCount = nHeight / aItemSize.Height(); - if (nRowCount <= 0) - nRowCount = 1; - int nColumnCount = (maSet.GetItemCount() + nRowCount-1) - / nRowCount; - nPreferredWidth = nColumnCount * aItemSize.Width(); - } - } - - return nPreferredWidth; -} - - - - -sal_Int32 ColorMenu::GetPreferredHeight (sal_Int32 nWidth) -{ - sal_Int32 nPreferredHeight = 0; - if (maSet.GetItemCount()>0) - { - Image aImage = maSet.GetItemImage(maSet.GetItemId(0)); - Size aItemSize = maSet.CalcItemSizePixel (aImage.GetSizePixel()); - if (nWidth>0 && aItemSize.Width()>0) - { - int nColumnCount = nWidth / aItemSize.Width(); - if (nColumnCount <= 0) - nColumnCount = 1; - else if (nColumnCount > 4) - nColumnCount = 4; - int nRowCount = (maSet.GetItemCount() + nColumnCount-1) - / nColumnCount; - nPreferredHeight = nRowCount * aItemSize.Height(); - } - } - return nPreferredHeight; -} - - - - -bool ColorMenu::IsResizable (void) -{ - return true; -} - - - - -::Window* ColorMenu::GetWindow (void) -{ - return this; -} - - - - -void ColorMenu::Resize (void) -{ - ::Window::Resize(); - Size aWindowSize = GetOutputSizePixel(); - maSet.SetPosSizePixel (Point(0,0), aWindowSize); - if (IsVisible() && aWindowSize.Width() > 0) - { - // maSet.SetPosSizePixel ( - // Point (0,0), - // aWindowSize); - - // Calculate the number of rows and columns. - if (maSet.GetItemCount() > 0) - { - Image aImage = maSet.GetItemImage(maSet.GetItemId(0)); - Size aItemSize = maSet.CalcItemSizePixel ( - aImage.GetSizePixel()); - int nColumnCount = aWindowSize.Width() / 30; - if (nColumnCount < 1) - nColumnCount = 1; - else if (nColumnCount > 4) - nColumnCount = 4; - - sal_uInt16 nRowCount = (sal_uInt16)CalculateRowCount (aItemSize, nColumnCount); - - maSet.SetColCount ((sal_uInt16)nColumnCount); - maSet.SetLineCount (nRowCount); - } - } - -} - - - - -int ColorMenu::CalculateRowCount (const Size&, int nColumnCount) -{ - int nRowCount = 0; - - if (maSet.GetItemCount()>0 && nColumnCount>0) - { - nRowCount = GetOutputSizePixel().Height() / 30; - if (nRowCount < 1) - nRowCount = 1; - } - - return nRowCount; -} - - - - -void ColorMenu::Fill (void) -{ - const StyleSettings& rSettings ( - Application::GetSettings().GetStyleSettings()); - maSet.Clear(); - maSet.SetItemWidth (30); - maSet.SetItemHeight (30); - sal_uInt16 i = 0; - maSet.InsertItem (++i, rSettings.GetFaceColor()); - maSet.SetItemText (i, String::CreateFromAscii("FaceColor")); - maSet.InsertItem (++i, rSettings.GetCheckedColor()); - maSet.SetItemText (i, String::CreateFromAscii("CheckedColor")); - maSet.InsertItem (++i, rSettings.GetLightColor()); - maSet.SetItemText (i, String::CreateFromAscii("LightColor")); - maSet.InsertItem (++i, rSettings.GetLightBorderColor()); - maSet.SetItemText (i, String::CreateFromAscii("LightBorderColor")); - maSet.InsertItem (++i, rSettings.GetShadowColor()); - maSet.SetItemText (i, String::CreateFromAscii("ShadowColor")); - maSet.InsertItem (++i, rSettings.GetDarkShadowColor()); - maSet.SetItemText (i, String::CreateFromAscii("DarkShadowColor")); - maSet.InsertItem (++i, rSettings.GetButtonTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("ButtonTextColor")); - maSet.InsertItem (++i, rSettings.GetRadioCheckTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("RadioCheckTextColor")); - maSet.InsertItem (++i, rSettings.GetGroupTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("GroupTextColor")); - maSet.InsertItem (++i, rSettings.GetLabelTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("LabelTextColor")); - maSet.InsertItem (++i, rSettings.GetInfoTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("InfoTextColor")); - maSet.InsertItem (++i, rSettings.GetWindowColor()); - maSet.SetItemText (i, String::CreateFromAscii("WindowColor")); - maSet.InsertItem (++i, rSettings.GetWindowTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("WindowTextColor")); - maSet.InsertItem (++i, rSettings.GetDialogColor()); - maSet.SetItemText (i, String::CreateFromAscii("DialogColor")); - maSet.InsertItem (++i, rSettings.GetDialogTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("DialogTextColor")); - maSet.InsertItem (++i, rSettings.GetWorkspaceColor()); - maSet.SetItemText (i, String::CreateFromAscii("WorkspaceColor")); - maSet.InsertItem (++i, rSettings.GetFieldColor()); - maSet.SetItemText (i, String::CreateFromAscii("FieldColor")); - maSet.InsertItem (++i, rSettings.GetFieldTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("FieldTextColor")); - maSet.InsertItem (++i, rSettings.GetActiveColor()); - maSet.SetItemText (i, String::CreateFromAscii("ActiveColor")); - maSet.InsertItem (++i, rSettings.GetActiveColor2()); - maSet.SetItemText (i, String::CreateFromAscii("ActiveColor2")); - maSet.InsertItem (++i, rSettings.GetActiveTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("ActiveTextColor")); - maSet.InsertItem (++i, rSettings.GetActiveBorderColor()); - maSet.SetItemText (i, String::CreateFromAscii("ActiveBorderColor")); - maSet.InsertItem (++i, rSettings.GetDeactiveColor()); - maSet.SetItemText (i, String::CreateFromAscii("DeactiveColor")); - maSet.InsertItem (++i, rSettings.GetDeactiveColor2()); - maSet.SetItemText (i, String::CreateFromAscii("DeactiveColor2")); - maSet.InsertItem (++i, rSettings.GetDeactiveTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("DeactiveTextColor")); - maSet.InsertItem (++i, rSettings.GetDeactiveBorderColor()); - maSet.SetItemText (i, String::CreateFromAscii("DeactiveBorderColor")); - maSet.InsertItem (++i, rSettings.GetHighlightColor()); - maSet.SetItemText (i, String::CreateFromAscii("HighlightColor")); - maSet.InsertItem (++i, rSettings.GetHighlightTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("HighlightTextColor")); - maSet.InsertItem (++i, rSettings.GetDisableColor()); - maSet.SetItemText (i, String::CreateFromAscii("DisableColor")); - maSet.InsertItem (++i, rSettings.GetHelpColor()); - maSet.SetItemText (i, String::CreateFromAscii("HelpColor")); - maSet.InsertItem (++i, rSettings.GetHelpTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("HelpTextColor")); - maSet.InsertItem (++i, rSettings.GetMenuColor()); - maSet.SetItemText (i, String::CreateFromAscii("MenuColor")); - maSet.InsertItem (++i, rSettings.GetMenuBarColor()); - maSet.SetItemText (i, String::CreateFromAscii("MenuBarColor")); - maSet.InsertItem (++i, rSettings.GetMenuBorderColor()); - maSet.SetItemText (i, String::CreateFromAscii("MenuBorderColor")); - maSet.InsertItem (++i, rSettings.GetMenuTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("MenuTextColor")); - maSet.InsertItem (++i, rSettings.GetMenuHighlightColor()); - maSet.SetItemText (i, String::CreateFromAscii("MenuHighlightColor")); - maSet.InsertItem (++i, rSettings.GetMenuHighlightTextColor()); - maSet.SetItemText (i, String::CreateFromAscii("MenuHighlightTextColor")); - maSet.InsertItem (++i, rSettings.GetLinkColor()); - maSet.SetItemText (i, String::CreateFromAscii("LinkColor")); - maSet.InsertItem (++i, rSettings.GetVisitedLinkColor()); - maSet.SetItemText (i, String::CreateFromAscii("VisitedLinkColor")); - maSet.InsertItem (++i, rSettings.GetHighlightLinkColor()); - maSet.SetItemText (i, String::CreateFromAscii("HighlightLinkColor")); - maSet.InsertItem (++i, rSettings.GetFontColor()); - maSet.SetItemText (i, String::CreateFromAscii("FontColor")); -} -#endif - -} } // end of namespace ::sd::toolpanel - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/toolpanel/TestMenu.hxx b/sd/source/ui/toolpanel/TestMenu.hxx deleted file mode 100644 index 24b8d7476f14..000000000000 --- a/sd/source/ui/toolpanel/TestMenu.hxx +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef SD_TASKPANE_COLOR_MENU_HXX -#define SD_TASKPANE_COLOR_MENU_HXX - -#include "taskpane/TaskPaneTreeNode.hxx" -#include <svtools/valueset.hxx> -#include <vcl/window.hxx> - -#include <memory> - - -namespace sd { namespace toolpanel { - -class ControlFactory; - -#ifdef SHOW_COLOR_MENU - -/** This demo menu shows the colors that are available from the - StyleSettings. -*/ -class ColorMenu - : public ::Window, - public TreeNode -{ -public: - ColorMenu (::Window* i_pParent); - virtual ~ColorMenu (void); - - static ::std::auto_ptr<ControlFactory> CreateControlFactory (void); - - // From ILayoutableWindow - virtual Size GetPreferredSize (void); - virtual sal_Int32 GetPreferredWidth (sal_Int32 nHeight); - virtual sal_Int32 GetPreferredHeight (sal_Int32 nWidth); - virtual bool IsResizable (void); - virtual ::Window* GetWindow (void); - - // From ::Window - virtual void Resize (void); - - using Window::GetWindow; - -private: - ValueSet maSet; - int mnPreferredColumnCount; - - /** Depending on the given number of columns and the item size - calculate the number of rows that are necessary to display all - items. - */ - int CalculateRowCount (const Size& rItemSize, int nColumnCount); - void Fill (void); -}; -#endif - -} } // end of namespace ::sd::toolpanel - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/toolpanel/TestPanel.cxx b/sd/source/ui/toolpanel/TestPanel.cxx deleted file mode 100644 index 3bbea1bcc80b..000000000000 --- a/sd/source/ui/toolpanel/TestPanel.cxx +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "TestPanel.hxx" -#include "taskpane/ScrollPanel.hxx" -#include "taskpane/TaskPaneControlFactory.hxx" - -#include <vcl/lstbox.hxx> -#include <vcl/button.hxx> - -namespace sd { namespace toolpanel { - -#ifdef SHOW_TEST_PANEL -/** This factory class is used to create instances of TestPanel. It can be - extended so that its constructor stores arguments that later are passed - to new TestPanel objects. -*/ -class TestPanelFactory - : public ControlFactory -{ -protected: - virtual TreeNode* InternalCreateControl( ::Window& i_rParent ) - { - return new TestPanel (i_rParent); - } -}; - - -class Wrapper - : public TreeNode -{ -public: - Wrapper ( - TreeNode* pParent, - Size aPreferredSize, - ::Window* pWrappedControl, - bool bIsResizable) - : TreeNode (pParent), - maPreferredSize(aPreferredSize), - mpWrappedControl(pWrappedControl), - mbIsResizable(bIsResizable) - { - mpWrappedControl->Show(); - } - virtual ~Wrapper (void) - { - delete mpWrappedControl; - } - - virtual Size GetPreferredSize (void) - { - return maPreferredSize; - } - virtual sal_Int32 GetPreferredWidth (sal_Int32 ) - { - return maPreferredSize.Width(); - } - virtual sal_Int32 GetPreferredHeight (sal_Int32 ) - { - return maPreferredSize.Height(); - } - virtual ::Window* GetWindow (void) - { - return mpWrappedControl; - } - virtual bool IsResizable (void) - { - return mbIsResizable; - } - virtual bool IsExpandable (void) const - { - return false; - } - virtual bool IsExpanded (void) const - { - return true; - } - -private: - Size maPreferredSize; - ::Window* mpWrappedControl; - bool mbIsResizable; -}; - - -TestPanel::TestPanel (::Window& i_rParent) - : SubToolPanel (i_rParent) -{ - // Create a scrollable panel with two list boxes. - ScrollPanel* pScrollPanel = new ScrollPanel (this); - - ListBox* pBox = new ListBox (pScrollPanel->GetWindow()); - for (sal_Int32 i=1; i<=20; i++) - { - rtl::OUStringBuffer aString ("Text "); - aString.append(i).append("/20"); - pBox->InsertEntry(aString.makeStringAndClear()); - } - pScrollPanel->AddControl ( - ::std::auto_ptr<TreeNode>(new Wrapper ( - pScrollPanel, Size (200,300), pBox, true)), - rtl::OUString("First ListBox"), - ""); - - pBox = new ListBox (pScrollPanel->GetWindow()); - for (sal_Int32 i=1; i<=20; i++) - { - rtl::OUStringBuffer aString("More Text "); - aString.append(i).append("/20"); - pBox->InsertEntry(aString.makeStringAndClear()); - } - pScrollPanel->AddControl ( - ::std::auto_ptr<TreeNode>(new Wrapper ( - pScrollPanel, Size (200,300), pBox, true)), - String::CreateFromAscii ("Second ListBox"), - ""); - - AddControl (::std::auto_ptr<TreeNode>(pScrollPanel)); - - // Add a fixed size button. - Button* pButton = new OKButton (this); - AddControl ( - ::std::auto_ptr<TreeNode>(new Wrapper ( - this, Size (100,30), pButton, false)), - String::CreateFromAscii ("Button Area"), - ""); -} - - - - - -TestPanel::~TestPanel (void) -{ -} - -std::auto_ptr<ControlFactory> TestPanel::CreateControlFactory (void) -{ - return std::auto_ptr<ControlFactory>(new TestPanelFactory()); -} -#endif - - -} } // end of namespace ::sd::toolpanel - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/toolpanel/TestPanel.hxx b/sd/source/ui/toolpanel/TestPanel.hxx deleted file mode 100644 index c2b39de80c1e..000000000000 --- a/sd/source/ui/toolpanel/TestPanel.hxx +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef SD_TASKPANE_TEST_PANEL_HXX -#define SD_TASKPANE_TEST_PANEL_HXX - -#include "taskpane/SubToolPanel.hxx" - - -namespace sd { namespace toolpanel { - -class ControlFactory; -class TreeNode; - -#ifdef SHOW_TEST_PANEL - -/** This panel demonstrates how to create a panel for the task pane. -*/ -class TestPanel - : public SubToolPanel -{ -public: - TestPanel (::Window& i_rParent); - virtual ~TestPanel (void); - - static std::auto_ptr<ControlFactory> CreateControlFactory (void); -}; - -#endif - -} } // end of namespace ::sd::toolpanel - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |