2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-15 17:28:16 +00:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-09-17 13:41:20 +00:00
|
|
|
|
2013-08-15 17:16:28 +02:00
|
|
|
#include <svtools/tabbar.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <tools/time.hxx>
|
|
|
|
#include <tools/debug.hxx>
|
2004-01-06 18:23:41 +00:00
|
|
|
#include <tools/poly.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
#include <vcl/help.hxx>
|
|
|
|
#include <vcl/decoview.hxx>
|
|
|
|
#include <vcl/button.hxx>
|
|
|
|
#include <vcl/edit.hxx>
|
2011-03-11 18:04:44 +00:00
|
|
|
#include <vcl/image.hxx>
|
2014-01-02 23:52:37 +01:00
|
|
|
#include <vcl/settings.hxx>
|
2007-06-27 13:51:52 +00:00
|
|
|
#include "svtaccessiblefactory.hxx"
|
2011-01-21 10:55:35 +01:00
|
|
|
#include <filectrl.hrc>
|
2013-08-15 17:16:28 +02:00
|
|
|
#include <svtools/svtresid.hxx>
|
|
|
|
#include <svtools/svtools.hrc>
|
2010-05-13 14:46:13 -04:00
|
|
|
#include <limits>
|
2015-03-01 16:14:58 +01:00
|
|
|
#include <utility>
|
2015-11-26 13:56:54 +00:00
|
|
|
#include <vcl/idle.hxx>
|
2010-05-13 14:46:13 -04:00
|
|
|
|
2015-05-11 14:33:01 +09:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#define TABBAR_DRAG_SCROLLOFF 5
|
|
|
|
#define TABBAR_MINSIZE 5
|
|
|
|
|
2010-11-05 10:31:15 +08:00
|
|
|
const sal_uInt16 ADDNEWPAGE_AREAWIDTH = 10;
|
2015-03-03 10:44:03 +09:00
|
|
|
const sal_uInt16 BUTTON_MARGIN = 6;
|
2003-03-27 13:40:07 +00:00
|
|
|
|
2015-05-11 14:33:01 +09:00
|
|
|
class TabDrawer
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
TabBar& mrParent;
|
|
|
|
vcl::RenderContext& mrRenderContext;
|
2015-06-23 10:29:48 +02:00
|
|
|
const StyleSettings& mrStyleSettings;
|
2015-05-11 14:33:01 +09:00
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle maRect;
|
2015-05-11 14:33:01 +09:00
|
|
|
|
|
|
|
Color maSelectedColor;
|
|
|
|
Color maCustomColor;
|
|
|
|
Color maUnselectedColor;
|
|
|
|
|
|
|
|
bool mbSelected:1;
|
|
|
|
bool mbCustomColored:1;
|
|
|
|
bool mbEnabled:1;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit TabDrawer(TabBar& rParent, vcl::RenderContext& rRenderContext)
|
|
|
|
: mrParent(rParent)
|
|
|
|
, mrRenderContext(rRenderContext)
|
|
|
|
, mrStyleSettings(rRenderContext.GetSettings().GetStyleSettings())
|
|
|
|
, mbSelected(false)
|
|
|
|
, mbCustomColored(false)
|
|
|
|
, mbEnabled(false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void drawOutputAreaBorder()
|
|
|
|
{
|
|
|
|
WinBits nWinStyle = mrParent.GetStyle();
|
|
|
|
|
|
|
|
// draw extra line if above and below border
|
|
|
|
if ((nWinStyle & WB_BORDER) || (nWinStyle & WB_TOPBORDER))
|
|
|
|
{
|
2015-06-23 10:29:48 +02:00
|
|
|
Size aOutputSize(mrParent.GetOutputSizePixel());
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aOutRect = mrParent.GetPageArea();
|
2015-05-11 14:33:01 +09:00
|
|
|
|
|
|
|
// also draw border in 3D for 3D-tabs
|
|
|
|
if (nWinStyle & WB_3DTAB)
|
|
|
|
{
|
|
|
|
mrRenderContext.SetLineColor(mrStyleSettings.GetShadowColor());
|
|
|
|
mrRenderContext.DrawLine(Point(aOutRect.Left(), 0), Point(aOutputSize.Width(), 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
// draw border (line above and line below)
|
|
|
|
mrRenderContext.SetLineColor(mrStyleSettings.GetDarkShadowColor());
|
|
|
|
mrRenderContext.DrawLine(aOutRect.TopLeft(), Point(aOutputSize.Width() - 1, aOutRect.Top()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void drawOuterFrame()
|
|
|
|
{
|
|
|
|
mrRenderContext.SetLineColor(mrStyleSettings.GetDarkShadowColor());
|
|
|
|
|
|
|
|
// set correct FillInBrush depending on status
|
|
|
|
if (mbSelected)
|
|
|
|
{
|
|
|
|
// Currently selected Tab
|
|
|
|
mrRenderContext.SetFillColor(maSelectedColor);
|
|
|
|
}
|
|
|
|
else if (mbCustomColored)
|
|
|
|
{
|
|
|
|
mrRenderContext.SetFillColor(maCustomColor);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mrRenderContext.SetFillColor(maUnselectedColor);
|
|
|
|
}
|
|
|
|
|
|
|
|
mrRenderContext.DrawRect(maRect);
|
|
|
|
}
|
|
|
|
|
|
|
|
void drawText(const OUString& aText)
|
|
|
|
{
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aRect = maRect;
|
2015-05-11 14:33:01 +09:00
|
|
|
long nTextWidth = mrRenderContext.GetTextWidth(aText);
|
|
|
|
long nTextHeight = mrRenderContext.GetTextHeight();
|
|
|
|
Point aPos = aRect.TopLeft();
|
|
|
|
aPos.X() += (aRect.getWidth() - nTextWidth) / 2;
|
|
|
|
aPos.Y() += (aRect.getHeight() - nTextHeight) / 2;
|
|
|
|
|
|
|
|
if (mbEnabled)
|
|
|
|
mrRenderContext.DrawText(aPos, aText);
|
|
|
|
else
|
2015-05-18 13:36:39 +02:00
|
|
|
mrRenderContext.DrawCtrlText(aPos, aText, 0, aText.getLength(), (DrawTextFlags::Disable | DrawTextFlags::Mnemonic));
|
2015-05-11 14:33:01 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
void drawOverTopBorder()
|
|
|
|
{
|
|
|
|
Point aTopLeft = maRect.TopLeft() + Point(1, 0);
|
|
|
|
Point aTopRight = maRect.TopRight() + Point(-1, 0);
|
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aDelRect(aTopLeft, aTopRight);
|
2015-05-11 14:33:01 +09:00
|
|
|
mrRenderContext.DrawRect(aDelRect);
|
|
|
|
}
|
|
|
|
|
|
|
|
void drawColorLine()
|
|
|
|
{
|
|
|
|
mrRenderContext.SetFillColor(maCustomColor);
|
|
|
|
mrRenderContext.SetLineColor(maCustomColor);
|
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aLineRect(maRect.BottomLeft(), maRect.BottomRight());
|
2015-05-11 14:33:01 +09:00
|
|
|
aLineRect.Top() -= 3;
|
|
|
|
|
|
|
|
mrRenderContext.DrawRect(aLineRect);
|
|
|
|
}
|
|
|
|
|
|
|
|
void drawTab()
|
|
|
|
{
|
|
|
|
drawOuterFrame();
|
|
|
|
|
|
|
|
if (mbCustomColored && mbSelected)
|
|
|
|
{
|
|
|
|
drawColorLine();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
void setRect(const tools::Rectangle& rRect)
|
2015-05-11 14:33:01 +09:00
|
|
|
{
|
|
|
|
maRect = rRect;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setSelected(bool bSelected)
|
|
|
|
{
|
|
|
|
mbSelected = bSelected;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setCustomColored(bool bCustomColored)
|
|
|
|
{
|
|
|
|
mbCustomColored = bCustomColored;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setEnabled(bool bEnabled)
|
|
|
|
{
|
|
|
|
mbEnabled = bEnabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setSelectedFillColor(const Color& rColor)
|
|
|
|
{
|
|
|
|
maSelectedColor = rColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setUnselectedFillColor(const Color& rColor)
|
|
|
|
{
|
|
|
|
maUnselectedColor = rColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setCustomColor(const Color& rColor)
|
|
|
|
{
|
|
|
|
maCustomColor = rColor;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-12-22 13:10:46 +09:00
|
|
|
} // anonymous namespace
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
struct ImplTabBarItem
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 mnId;
|
|
|
|
TabBarPageBits mnBits;
|
|
|
|
OUString maText;
|
|
|
|
OUString maHelpText;
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle maRect;
|
2015-05-17 12:24:49 +09:00
|
|
|
long mnWidth;
|
|
|
|
OString maHelpId;
|
|
|
|
bool mbShort : 1;
|
|
|
|
bool mbSelect : 1;
|
|
|
|
Color maTabBgColor;
|
|
|
|
Color maTabTextColor;
|
|
|
|
|
|
|
|
ImplTabBarItem(sal_uInt16 nItemId, const OUString& rText, TabBarPageBits nPageBits)
|
|
|
|
: mnId(nItemId)
|
|
|
|
, mnBits(nPageBits)
|
|
|
|
, maText(rText)
|
|
|
|
, mnWidth(0)
|
|
|
|
, mbShort(false)
|
|
|
|
, mbSelect(false)
|
|
|
|
, maTabBgColor(Color(COL_AUTO))
|
|
|
|
, maTabTextColor(Color(COL_AUTO))
|
|
|
|
{
|
|
|
|
}
|
2010-10-04 17:23:15 -04:00
|
|
|
|
|
|
|
bool IsDefaultTabBgColor() const
|
|
|
|
{
|
|
|
|
return maTabBgColor == Color(COL_AUTO);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsSelected(ImplTabBarItem* pCurItem) const
|
|
|
|
{
|
|
|
|
return mbSelect || (pCurItem == this);
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ImplTabButton : public PushButton
|
|
|
|
{
|
2015-02-25 14:39:42 +09:00
|
|
|
bool mbModKey : 1;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
public:
|
2015-02-25 14:34:11 +09:00
|
|
|
ImplTabButton(TabBar* pParent, WinBits nWinStyle = 0)
|
2015-02-25 14:36:37 +09:00
|
|
|
: PushButton(pParent, nWinStyle | WB_FLATBUTTON | WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOLIGHTBORDER | WB_NOPOINTERFOCUS)
|
2015-02-25 14:39:42 +09:00
|
|
|
, mbModKey(false)
|
2015-02-25 14:34:11 +09:00
|
|
|
{}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-02-25 14:34:11 +09:00
|
|
|
TabBar* GetParent() const
|
|
|
|
{
|
|
|
|
return static_cast<TabBar*>(Window::GetParent());
|
|
|
|
}
|
2013-09-13 20:13:25 +01:00
|
|
|
|
2015-02-25 14:39:42 +09:00
|
|
|
bool isModKeyPressed()
|
|
|
|
{
|
|
|
|
return mbModKey;
|
|
|
|
}
|
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool PreNotify(NotifyEvent& rNotifyEvent) override;
|
|
|
|
virtual void MouseButtonDown(const MouseEvent& rMouseEvent) override;
|
|
|
|
virtual void MouseButtonUp(const MouseEvent& rMouseEvent) override;
|
|
|
|
virtual void Command(const CommandEvent& rCommandEvent) override;
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
2015-02-25 14:34:11 +09:00
|
|
|
void ImplTabButton::MouseButtonDown(const MouseEvent& rMouseEvent)
|
2013-09-13 20:13:25 +01:00
|
|
|
{
|
2015-02-25 14:39:42 +09:00
|
|
|
mbModKey = rMouseEvent.IsMod1();
|
2015-02-25 14:34:11 +09:00
|
|
|
PushButton::MouseButtonDown(rMouseEvent);
|
2013-09-13 20:13:25 +01:00
|
|
|
}
|
|
|
|
|
2015-02-25 14:39:42 +09:00
|
|
|
void ImplTabButton::MouseButtonUp(const MouseEvent& rMouseEvent)
|
|
|
|
{
|
|
|
|
mbModKey = false;
|
|
|
|
PushButton::MouseButtonUp(rMouseEvent);
|
|
|
|
}
|
2015-02-25 14:34:11 +09:00
|
|
|
|
|
|
|
void ImplTabButton::Command(const CommandEvent& rCommandEvent)
|
2013-09-13 20:13:25 +01:00
|
|
|
{
|
2015-05-07 15:25:20 +02:00
|
|
|
if (rCommandEvent.GetCommand() == CommandEventId::ContextMenu)
|
2013-09-13 20:13:25 +01:00
|
|
|
{
|
2015-02-25 14:34:11 +09:00
|
|
|
TabBar* pParent = GetParent();
|
2015-08-31 13:41:05 +02:00
|
|
|
pParent->maScrollAreaContextHdl.Call(rCommandEvent);
|
2013-09-13 20:13:25 +01:00
|
|
|
}
|
2015-02-25 14:34:11 +09:00
|
|
|
PushButton::Command(rCommandEvent);
|
2013-09-13 20:13:25 +01:00
|
|
|
}
|
|
|
|
|
2015-02-25 14:34:11 +09:00
|
|
|
bool ImplTabButton::PreNotify(NotifyEvent& rNotifyEvent)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-02-25 14:34:11 +09:00
|
|
|
if (rNotifyEvent.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-02-25 14:34:11 +09:00
|
|
|
if (GetParent()->IsInEditMode())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
GetParent()->EndEditMode();
|
2014-01-18 00:18:52 +01:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-25 14:34:11 +09:00
|
|
|
return PushButton::PreNotify(rNotifyEvent);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
class ImplTabSizer : public vcl::Window
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-10-14 10:52:44 +02:00
|
|
|
ImplTabSizer( TabBar* pParent, WinBits nWinStyle );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-09-26 15:19:06 +02:00
|
|
|
TabBar* GetParent() const { return static_cast<TabBar*>(Window::GetParent()); }
|
2004-02-03 11:06:06 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void ImplTrack( const Point& rScreenPos );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
|
|
|
|
virtual void Tracking( const TrackingEvent& rTEvt ) override;
|
2017-03-30 20:27:55 +02:00
|
|
|
virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle& rRect ) override;
|
2004-02-03 11:06:06 +00:00
|
|
|
|
|
|
|
Point maStartPos;
|
|
|
|
long mnStartWidth;
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
2010-12-13 14:22:05 +00:00
|
|
|
ImplTabSizer::ImplTabSizer( TabBar* pParent, WinBits nWinStyle )
|
|
|
|
: Window( pParent, nWinStyle & WB_3DLOOK )
|
|
|
|
, mnStartWidth(0)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-20 14:05:50 +02:00
|
|
|
SetPointer(Pointer(PointerStyle::HSizeBar));
|
2016-10-28 23:55:53 +02:00
|
|
|
SetSizePixel(Size(7 * GetDPIScaleFactor(), 0));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2004-02-03 11:06:06 +00:00
|
|
|
void ImplTabSizer::ImplTrack( const Point& rScreenPos )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
TabBar* pParent = GetParent();
|
2004-02-03 11:06:06 +00:00
|
|
|
long nDiff = rScreenPos.X() - maStartPos.X();
|
|
|
|
pParent->mnSplitSize = mnStartWidth + (pParent->IsMirrored() ? -nDiff : nDiff);
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( pParent->mnSplitSize < TABBAR_MINSIZE )
|
|
|
|
pParent->mnSplitSize = TABBAR_MINSIZE;
|
|
|
|
pParent->Split();
|
|
|
|
pParent->Update();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ImplTabSizer::MouseButtonDown( const MouseEvent& rMEvt )
|
|
|
|
{
|
|
|
|
if ( GetParent()->IsInEditMode() )
|
|
|
|
{
|
|
|
|
GetParent()->EndEditMode();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( rMEvt.IsLeft() )
|
|
|
|
{
|
2004-02-03 11:06:06 +00:00
|
|
|
maStartPos = OutputToScreenPixel( rMEvt.GetPosPixel() );
|
|
|
|
mnStartWidth = GetParent()->GetSizePixel().Width();
|
2000-09-18 16:07:07 +00:00
|
|
|
StartTracking();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ImplTabSizer::Tracking( const TrackingEvent& rTEvt )
|
|
|
|
{
|
|
|
|
if ( rTEvt.IsTrackingEnded() )
|
|
|
|
{
|
|
|
|
if ( rTEvt.IsTrackingCanceled() )
|
|
|
|
ImplTrack( maStartPos );
|
|
|
|
GetParent()->mnSplitSize = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ImplTrack( OutputToScreenPixel( rTEvt.GetMouseEvent().GetPosPixel() ) );
|
|
|
|
}
|
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
void ImplTabSizer::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-11 14:33:01 +09:00
|
|
|
DecorationView aDecoView(&rRenderContext);
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aOutputRect(Point(0, 0), GetOutputSizePixel());
|
2015-08-11 08:42:31 +02:00
|
|
|
aDecoView.DrawHandle(aOutputRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-01-08 23:08:34 +01:00
|
|
|
// Is not named Impl. as it may be both instantiated and derived from
|
2000-09-18 16:07:07 +00:00
|
|
|
class TabBarEdit : public Edit
|
|
|
|
{
|
|
|
|
private:
|
2014-11-17 09:18:52 +00:00
|
|
|
Idle maLoseFocusIdle;
|
2014-03-24 12:47:49 +02:00
|
|
|
bool mbPostEvt;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK( ImplEndEditHdl, void*, void );
|
2017-01-23 19:37:51 +01:00
|
|
|
DECL_LINK( ImplEndTimerHdl, Timer*, void );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
public:
|
2016-10-14 10:52:44 +02:00
|
|
|
TabBarEdit( TabBar* pParent, WinBits nWinStyle );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-09-26 15:19:06 +02:00
|
|
|
TabBar* GetParent() const { return static_cast<TabBar*>(Window::GetParent()); }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-03-24 12:47:49 +02:00
|
|
|
void SetPostEvent() { mbPostEvt = true; }
|
|
|
|
void ResetPostEvent() { mbPostEvt = false; }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool PreNotify( NotifyEvent& rNEvt ) override;
|
|
|
|
virtual void LoseFocus() override;
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
TabBarEdit::TabBarEdit( TabBar* pParent, WinBits nWinStyle ) :
|
|
|
|
Edit( pParent, nWinStyle )
|
|
|
|
{
|
2014-03-24 12:47:49 +02:00
|
|
|
mbPostEvt = false;
|
2017-01-04 12:06:42 +01:00
|
|
|
maLoseFocusIdle.SetPriority( TaskPriority::REPAINT );
|
2017-01-23 19:37:51 +01:00
|
|
|
maLoseFocusIdle.SetInvokeHandler( LINK( this, TabBarEdit, ImplEndTimerHdl ) );
|
2016-07-20 10:54:30 +02:00
|
|
|
maLoseFocusIdle.SetDebugName( "svtools::TabBarEdit maLoseFocusIdle" );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-01-18 00:18:52 +01:00
|
|
|
bool TabBarEdit::PreNotify( NotifyEvent& rNEvt )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-11-26 14:53:25 +00:00
|
|
|
if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
|
|
|
|
if ( !pKEvt->GetKeyCode().GetModifier() )
|
|
|
|
{
|
|
|
|
if ( pKEvt->GetKeyCode().GetCode() == KEY_RETURN )
|
|
|
|
{
|
|
|
|
if ( !mbPostEvt )
|
|
|
|
{
|
2016-04-20 17:20:00 +02:00
|
|
|
if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), reinterpret_cast<void*>(false), true ) )
|
2014-03-24 12:47:49 +02:00
|
|
|
mbPostEvt = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2014-01-18 00:18:52 +01:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else if ( pKEvt->GetKeyCode().GetCode() == KEY_ESCAPE )
|
|
|
|
{
|
|
|
|
if ( !mbPostEvt )
|
|
|
|
{
|
2016-04-20 17:20:00 +02:00
|
|
|
if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), reinterpret_cast<void*>(true), true ) )
|
2014-03-24 12:47:49 +02:00
|
|
|
mbPostEvt = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2014-01-18 00:18:52 +01:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return Edit::PreNotify( rNEvt );
|
|
|
|
}
|
|
|
|
|
|
|
|
void TabBarEdit::LoseFocus()
|
|
|
|
{
|
|
|
|
if ( !mbPostEvt )
|
|
|
|
{
|
2016-04-20 17:20:00 +02:00
|
|
|
if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), reinterpret_cast<void*>(false), true ) )
|
2014-03-24 12:47:49 +02:00
|
|
|
mbPostEvt = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Edit::LoseFocus();
|
|
|
|
}
|
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
IMPL_LINK( TabBarEdit, ImplEndEditHdl, void*, pCancel, void )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
ResetPostEvent();
|
2014-11-17 09:18:52 +00:00
|
|
|
maLoseFocusIdle.Stop();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-11-05 12:21:07 +00:00
|
|
|
// We need this query, because the edit gets a losefocus event,
|
2000-09-18 16:07:07 +00:00
|
|
|
// when it shows the context menu or the insert symbol dialog
|
2014-02-21 12:53:51 +01:00
|
|
|
if ( !HasFocus() && HasChildPathFocus( true ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-11-17 09:18:52 +00:00
|
|
|
maLoseFocusIdle.Start();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
2015-11-10 10:25:17 +01:00
|
|
|
GetParent()->EndEditMode( pCancel != nullptr );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2017-01-23 19:37:51 +01:00
|
|
|
IMPL_LINK_NOARG(TabBarEdit, ImplEndTimerHdl, Timer *, void)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if ( HasFocus() )
|
2015-05-05 09:59:27 +02:00
|
|
|
return;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-11-05 12:21:07 +00:00
|
|
|
// We need this query, because the edit gets a losefocus event,
|
2000-09-18 16:07:07 +00:00
|
|
|
// when it shows the context menu or the insert symbol dialog
|
2014-02-21 12:53:51 +01:00
|
|
|
if ( HasChildPathFocus( true ) )
|
2014-11-17 09:18:52 +00:00
|
|
|
maLoseFocusIdle.Start();
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
2014-03-24 12:47:49 +02:00
|
|
|
GetParent()->EndEditMode( true );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2007-06-27 13:51:52 +00:00
|
|
|
struct TabBar_Impl
|
|
|
|
{
|
2015-03-20 15:00:03 +00:00
|
|
|
ScopedVclPtr<ImplTabSizer> mpSizer;
|
|
|
|
ScopedVclPtr<ImplTabButton> mpFirstButton;
|
|
|
|
ScopedVclPtr<ImplTabButton> mpPrevButton;
|
|
|
|
ScopedVclPtr<ImplTabButton> mpNextButton;
|
|
|
|
ScopedVclPtr<ImplTabButton> mpLastButton;
|
2015-05-17 11:51:14 +09:00
|
|
|
ScopedVclPtr<ImplTabButton> mpAddButton;
|
2015-03-20 15:00:03 +00:00
|
|
|
ScopedVclPtr<TabBarEdit> mpEdit;
|
|
|
|
ImplTabBarList mpItemList;
|
2015-03-08 16:54:17 +09:00
|
|
|
|
|
|
|
svt::AccessibleFactoryAccess maAccessibleFactory;
|
2007-06-27 13:51:52 +00:00
|
|
|
|
2015-03-18 13:51:37 +00:00
|
|
|
TabBar_Impl() {}
|
2015-03-08 17:27:43 +09:00
|
|
|
|
|
|
|
~TabBar_Impl()
|
|
|
|
{
|
2016-05-10 14:39:07 +02:00
|
|
|
for (ImplTabBarItem* i : mpItemList)
|
2015-03-08 18:14:06 +09:00
|
|
|
{
|
2016-05-10 14:39:07 +02:00
|
|
|
delete i;
|
2015-03-08 17:27:43 +09:00
|
|
|
}
|
2015-03-08 18:14:06 +09:00
|
|
|
mpItemList.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_uInt16 getItemSize()
|
|
|
|
{
|
|
|
|
return static_cast<sal_uInt16>(mpItemList.size());
|
2015-03-08 17:27:43 +09:00
|
|
|
}
|
2007-06-27 13:51:52 +00:00
|
|
|
};
|
|
|
|
|
2015-03-08 18:23:40 +09:00
|
|
|
TabBar::TabBar( vcl::Window* pParent, WinBits nWinStyle ) :
|
|
|
|
Window( pParent, (nWinStyle & WB_3DLOOK) | WB_CLIPCHILDREN )
|
|
|
|
{
|
|
|
|
ImplInit( nWinStyle );
|
|
|
|
maCurrentItemList = 0;
|
|
|
|
}
|
2014-02-25 20:45:41 +01:00
|
|
|
|
2015-03-08 18:23:40 +09:00
|
|
|
TabBar::~TabBar()
|
2015-01-12 15:16:05 +02:00
|
|
|
{
|
2015-03-10 09:07:06 +02:00
|
|
|
disposeOnce();
|
2015-01-12 15:16:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::dispose()
|
2015-03-08 18:23:40 +09:00
|
|
|
{
|
|
|
|
EndEditMode( true );
|
2015-03-09 14:29:30 +02:00
|
|
|
mpImpl.reset();
|
2015-01-12 15:16:05 +02:00
|
|
|
Window::dispose();
|
2015-03-08 18:23:40 +09:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2010-02-23 16:13:04 -05:00
|
|
|
const sal_uInt16 TabBar::APPEND = ::std::numeric_limits<sal_uInt16>::max();
|
|
|
|
const sal_uInt16 TabBar::PAGE_NOT_FOUND = ::std::numeric_limits<sal_uInt16>::max();
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
void TabBar::ImplInit( WinBits nWinStyle )
|
|
|
|
{
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl.reset(new TabBar_Impl);
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
mnMaxPageWidth = 0;
|
|
|
|
mnCurMaxWidth = 0;
|
|
|
|
mnOffX = 0;
|
|
|
|
mnOffY = 0;
|
2004-02-03 11:06:06 +00:00
|
|
|
mnLastOffX = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
mnSplitSize = 0;
|
|
|
|
mnSwitchTime = 0;
|
|
|
|
mnWinStyle = nWinStyle;
|
|
|
|
mnCurPageId = 0;
|
|
|
|
mnFirstPos = 0;
|
|
|
|
mnDropPos = 0;
|
|
|
|
mnSwitchId = 0;
|
|
|
|
mnEditId = 0;
|
2014-03-24 12:47:49 +02:00
|
|
|
mbFormat = true;
|
|
|
|
mbFirstFormat = true;
|
|
|
|
mbSizeFormat = true;
|
|
|
|
mbAutoEditMode = false;
|
|
|
|
mbEditCanceled = false;
|
|
|
|
mbDropPos = false;
|
|
|
|
mbInSelect = false;
|
2014-01-28 19:57:30 +01:00
|
|
|
mbMirrored = false;
|
2013-09-13 20:13:25 +01:00
|
|
|
mbScrollAlwaysEnabled = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
if ( nWinStyle & WB_3DTAB )
|
|
|
|
mnOffY++;
|
|
|
|
|
|
|
|
ImplInitControls();
|
2011-01-21 10:55:35 +01:00
|
|
|
|
2015-03-08 16:54:17 +09:00
|
|
|
if (mpImpl->mpFirstButton)
|
2017-05-18 21:14:00 +01:00
|
|
|
mpImpl->mpFirstButton->SetAccessibleName(SvtResId(STR_TABBAR_PUSHBUTTON_MOVET0HOME));
|
2015-03-08 16:54:17 +09:00
|
|
|
if (mpImpl->mpPrevButton)
|
2017-05-18 21:14:00 +01:00
|
|
|
mpImpl->mpPrevButton->SetAccessibleName(SvtResId(STR_TABBAR_PUSHBUTTON_MOVELEFT));
|
2015-03-08 16:54:17 +09:00
|
|
|
if (mpImpl->mpNextButton)
|
2017-05-18 21:14:00 +01:00
|
|
|
mpImpl->mpNextButton->SetAccessibleName(SvtResId(STR_TABBAR_PUSHBUTTON_MOVERIGHT));
|
2015-03-08 16:54:17 +09:00
|
|
|
if (mpImpl->mpLastButton)
|
2017-05-18 21:14:00 +01:00
|
|
|
mpImpl->mpLastButton->SetAccessibleName(SvtResId(STR_TABBAR_PUSHBUTTON_MOVETOEND));
|
2011-01-21 10:55:35 +01:00
|
|
|
|
2015-05-17 11:51:14 +09:00
|
|
|
if (mpImpl->mpAddButton)
|
2017-05-18 21:14:00 +01:00
|
|
|
mpImpl->mpAddButton->SetAccessibleName(SvtResId(STR_TABBAR_PUSHBUTTON_ADDTAB));
|
2015-05-17 11:51:14 +09:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
SetSizePixel( Size( 100, CalcWindowSizePixel().Height() ) );
|
2014-03-24 12:47:49 +02:00
|
|
|
ImplInitSettings( true, true );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2011-02-20 20:16:10 -08:00
|
|
|
ImplTabBarItem* TabBar::seek( size_t i )
|
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
if ( i < mpImpl->mpItemList.size() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2011-02-20 20:16:10 -08:00
|
|
|
maCurrentItemList = i;
|
2015-03-08 18:14:06 +09:00
|
|
|
return mpImpl->mpItemList[maCurrentItemList];
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2015-11-10 10:25:17 +01:00
|
|
|
return nullptr;
|
2011-02-20 20:16:10 -08:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2011-02-20 20:16:10 -08:00
|
|
|
ImplTabBarItem* TabBar::prev()
|
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
if ( maCurrentItemList > 0 )
|
|
|
|
{
|
|
|
|
return mpImpl->mpItemList[--maCurrentItemList];
|
2011-02-20 20:16:10 -08:00
|
|
|
}
|
2015-11-10 10:25:17 +01:00
|
|
|
return nullptr;
|
2011-02-20 20:16:10 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
ImplTabBarItem* TabBar::next()
|
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
if ( maCurrentItemList + 1 < mpImpl->mpItemList.size() )
|
|
|
|
{
|
|
|
|
return mpImpl->mpItemList[++maCurrentItemList];
|
2011-02-20 20:16:10 -08:00
|
|
|
}
|
2015-11-10 10:25:17 +01:00
|
|
|
return nullptr;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-03-24 12:47:49 +02:00
|
|
|
void TabBar::ImplInitSettings( bool bFont, bool bBackground )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 22:56:46 +09:00
|
|
|
// FIXME RenderContext
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
|
|
|
|
|
2015-05-17 22:56:46 +09:00
|
|
|
if (bFont)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font aToolFont;
|
2006-06-19 19:57:14 +00:00
|
|
|
aToolFont = rStyleSettings.GetToolFont();
|
|
|
|
aToolFont.SetWeight( WEIGHT_BOLD );
|
2015-05-17 22:56:46 +09:00
|
|
|
ApplyControlFont(*this, aToolFont);
|
2001-08-28 12:43:34 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// Adapt font size if window too small?
|
2015-05-17 22:56:46 +09:00
|
|
|
while (GetTextHeight() > (GetOutputSizePixel().Height() - 1))
|
2001-08-28 12:43:34 +00:00
|
|
|
{
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font aFont = GetFont();
|
2016-02-03 10:13:00 +11:00
|
|
|
if (aFont.GetFontHeight() <= 6)
|
2001-08-28 12:43:34 +00:00
|
|
|
break;
|
2016-02-03 10:13:00 +11:00
|
|
|
aFont.SetFontHeight(aFont.GetFontHeight() - 1);
|
2015-05-17 22:56:46 +09:00
|
|
|
SetFont(aFont);
|
2001-08-28 12:43:34 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 22:56:46 +09:00
|
|
|
if (bBackground)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 22:56:46 +09:00
|
|
|
ApplyControlBackground(*this, rStyleSettings.GetFaceColor());
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-11 14:33:01 +09:00
|
|
|
void TabBar::ImplGetColors(const StyleSettings& rStyleSettings,
|
|
|
|
Color& rFaceColor, Color& rFaceTextColor,
|
|
|
|
Color& rSelectColor, Color& rSelectTextColor)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-11 14:33:01 +09:00
|
|
|
if (IsControlBackground())
|
2000-09-18 16:07:07 +00:00
|
|
|
rFaceColor = GetControlBackground();
|
|
|
|
else
|
2008-10-29 09:25:50 +00:00
|
|
|
rFaceColor = rStyleSettings.GetInactiveTabColor();
|
2015-05-11 14:33:01 +09:00
|
|
|
if (IsControlForeground())
|
2000-09-18 16:07:07 +00:00
|
|
|
rFaceTextColor = GetControlForeground();
|
|
|
|
else
|
|
|
|
rFaceTextColor = rStyleSettings.GetButtonTextColor();
|
2016-06-23 15:43:34 +02:00
|
|
|
rSelectColor = rStyleSettings.GetActiveTabColor();
|
|
|
|
rSelectTextColor = rStyleSettings.GetWindowTextColor();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// For 3D-tabs the selection- and face-colours are swapped,
|
|
|
|
// as the selected tabs should appear in 3D
|
2015-05-11 14:33:01 +09:00
|
|
|
if (mnWinStyle & WB_3DTAB)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-01 16:14:58 +01:00
|
|
|
using std::swap;
|
|
|
|
swap(rFaceColor, rSelectColor);
|
|
|
|
swap(rFaceTextColor, rSelectTextColor);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-24 12:47:49 +02:00
|
|
|
bool TabBar::ImplCalcWidth()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// Sizes should only be retrieved if the text or the font was changed
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!mbSizeFormat)
|
2014-03-24 12:47:49 +02:00
|
|
|
return false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// retrieve width of tabs with bold font
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font aFont = GetFont();
|
2015-05-17 12:24:49 +09:00
|
|
|
if (aFont.GetWeight() != WEIGHT_BOLD)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
aFont.SetWeight(WEIGHT_BOLD);
|
|
|
|
SetFont(aFont);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnMaxPageWidth)
|
2000-09-18 16:07:07 +00:00
|
|
|
mnCurMaxWidth = mnMaxPageWidth;
|
2016-06-27 15:08:50 +02:00
|
|
|
else
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-09-14 19:01:02 +02:00
|
|
|
mnCurMaxWidth = mnLastOffX - mnOffX;
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnCurMaxWidth < 1)
|
2000-09-18 16:07:07 +00:00
|
|
|
mnCurMaxWidth = 1;
|
|
|
|
}
|
|
|
|
|
2014-03-24 12:47:49 +02:00
|
|
|
bool bChanged = false;
|
2016-05-10 14:39:07 +02:00
|
|
|
for (ImplTabBarItem* pItem : mpImpl->mpItemList)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
long nNewWidth = GetTextWidth(pItem->maText);
|
|
|
|
if (mnCurMaxWidth && (nNewWidth > mnCurMaxWidth))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-03-24 12:47:49 +02:00
|
|
|
pItem->mbShort = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
nNewWidth = mnCurMaxWidth;
|
|
|
|
}
|
|
|
|
else
|
2014-09-14 19:01:02 +02:00
|
|
|
{
|
2014-03-24 12:47:49 +02:00
|
|
|
pItem->mbShort = false;
|
2014-09-14 19:01:02 +02:00
|
|
|
}
|
2014-09-14 20:03:33 +02:00
|
|
|
|
|
|
|
// Padding is dependent on font height - bigger font = bigger padding
|
2016-02-03 10:13:00 +11:00
|
|
|
long nFontWidth = aFont.GetFontHeight();
|
2014-09-14 20:03:33 +02:00
|
|
|
nNewWidth += nFontWidth * 2;
|
2014-09-14 19:01:02 +02:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (pItem->mnWidth != nNewWidth)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
pItem->mnWidth = nNewWidth;
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!pItem->maRect.IsEmpty())
|
2014-03-24 12:47:49 +02:00
|
|
|
bChanged = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2014-03-24 12:47:49 +02:00
|
|
|
mbSizeFormat = false;
|
|
|
|
mbFormat = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
return bChanged;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::ImplFormat()
|
|
|
|
{
|
|
|
|
ImplCalcWidth();
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!mbFormat)
|
2000-09-18 16:07:07 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 n = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
long x = mnOffX;
|
2016-05-10 14:39:07 +02:00
|
|
|
for (ImplTabBarItem* pItem : mpImpl->mpItemList)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// At all non-visible tabs an empty rectangle is set
|
2015-05-17 12:24:49 +09:00
|
|
|
if ((n + 1 < mnFirstPos) || (x > mnLastOffX))
|
2000-09-18 16:07:07 +00:00
|
|
|
pItem->maRect.SetEmpty();
|
|
|
|
else
|
|
|
|
{
|
2014-02-03 22:15:04 +01:00
|
|
|
// Slightly before the tab before the first visible page
|
2014-01-05 22:22:55 +01:00
|
|
|
// should also be visible
|
2015-05-17 12:24:49 +09:00
|
|
|
if (n + 1 == mnFirstPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
pItem->maRect.Left() = x-pItem->mnWidth;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pItem->maRect.Left() = x;
|
|
|
|
x += pItem->mnWidth;
|
|
|
|
}
|
2014-09-14 19:01:02 +02:00
|
|
|
pItem->maRect.Right() = x;
|
|
|
|
pItem->maRect.Bottom() = maWinSize.Height() - 1;
|
2004-02-03 11:06:06 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mbMirrored)
|
2004-02-03 11:06:06 +00:00
|
|
|
{
|
|
|
|
long nTmp = mnOffX + mnLastOffX - pItem->maRect.Right();
|
|
|
|
pItem->maRect.Right() = mnOffX + mnLastOffX - pItem->maRect.Left();
|
|
|
|
pItem->maRect.Left() = nTmp;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
n++;
|
|
|
|
}
|
|
|
|
|
2014-03-24 12:47:49 +02:00
|
|
|
mbFormat = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// enable/disable button
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplEnableControls();
|
|
|
|
}
|
|
|
|
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 TabBar::ImplGetLastFirstPos()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
sal_uInt16 nCount = mpImpl->getItemSize();
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!nCount || mbSizeFormat || mbFormat)
|
2000-09-18 16:07:07 +00:00
|
|
|
return 0;
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nLastFirstPos = nCount - 1;
|
|
|
|
long nWinWidth = mnLastOffX - mnOffX - ADDNEWPAGE_AREAWIDTH;
|
|
|
|
long nWidth = mpImpl->mpItemList[nLastFirstPos]->mnWidth;
|
|
|
|
|
|
|
|
while (nLastFirstPos && (nWidth < nWinWidth))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
nLastFirstPos--;
|
2015-03-08 18:14:06 +09:00
|
|
|
nWidth += mpImpl->mpItemList[nLastFirstPos]->mnWidth;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2015-05-17 12:24:49 +09:00
|
|
|
if ((nLastFirstPos != static_cast<sal_uInt16>(mpImpl->mpItemList.size() - 1)) && (nWidth > nWinWidth))
|
2000-09-18 16:07:07 +00:00
|
|
|
nLastFirstPos++;
|
|
|
|
return nLastFirstPos;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::ImplInitControls()
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnWinStyle & WB_SIZEABLE)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 16:54:17 +09:00
|
|
|
if (!mpImpl->mpSizer)
|
|
|
|
{
|
2015-09-21 13:37:17 +01:00
|
|
|
mpImpl->mpSizer.disposeAndReset(VclPtr<ImplTabSizer>::Create( this, mnWinStyle & (WB_DRAG | WB_3DLOOK)));
|
2015-03-08 16:54:17 +09:00
|
|
|
}
|
2007-06-27 13:51:52 +00:00
|
|
|
mpImpl->mpSizer->Show();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
2015-05-17 12:24:49 +09:00
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
mpImpl->mpSizer.disposeAndClear();
|
2015-05-17 12:24:49 +09:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-20 18:29:48 +09:00
|
|
|
if ((mnWinStyle & WB_INSERTTAB) && !mpImpl->mpAddButton)
|
2015-05-17 11:51:14 +09:00
|
|
|
{
|
2015-08-19 09:11:34 +02:00
|
|
|
Link<Button*,void> aLink = LINK(this, TabBar, ImplAddClickHandler);
|
2015-09-21 13:37:17 +01:00
|
|
|
mpImpl->mpAddButton.disposeAndReset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
|
2015-05-17 11:51:14 +09:00
|
|
|
mpImpl->mpAddButton->SetClickHdl(aLink);
|
|
|
|
mpImpl->mpAddButton->SetSymbol(SymbolType::PLUS);
|
|
|
|
mpImpl->mpAddButton->Show();
|
|
|
|
}
|
|
|
|
|
2015-08-19 09:11:34 +02:00
|
|
|
Link<Button*,void> aLink = LINK( this, TabBar, ImplClickHdl );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnWinStyle & (WB_MINSCROLL | WB_SCROLL))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 16:54:17 +09:00
|
|
|
if (!mpImpl->mpPrevButton)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-09-21 13:37:17 +01:00
|
|
|
mpImpl->mpPrevButton.disposeAndReset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpPrevButton->SetClickHdl(aLink);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpPrevButton->SetSymbol(mbMirrored ? SymbolType::NEXT : SymbolType::PREV);
|
|
|
|
mpImpl->mpPrevButton->Show();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-03-08 16:54:17 +09:00
|
|
|
if (!mpImpl->mpNextButton)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-09-21 13:37:17 +01:00
|
|
|
mpImpl->mpNextButton.disposeAndReset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpNextButton->SetClickHdl(aLink);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpNextButton->SetSymbol(mbMirrored ? SymbolType::PREV : SymbolType::NEXT);
|
|
|
|
mpImpl->mpNextButton->Show();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
mpImpl->mpPrevButton.disposeAndClear();
|
|
|
|
mpImpl->mpNextButton.disposeAndClear();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnWinStyle & WB_SCROLL)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 16:54:17 +09:00
|
|
|
if (!mpImpl->mpFirstButton)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-09-21 13:37:17 +01:00
|
|
|
mpImpl->mpFirstButton.disposeAndReset(VclPtr<ImplTabButton>::Create(this));
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpFirstButton->SetClickHdl(aLink);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpFirstButton->SetSymbol(mbMirrored ? SymbolType::LAST : SymbolType::FIRST);
|
|
|
|
mpImpl->mpFirstButton->Show();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-03-08 16:54:17 +09:00
|
|
|
if (!mpImpl->mpLastButton)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-09-21 13:37:17 +01:00
|
|
|
mpImpl->mpLastButton.disposeAndReset(VclPtr<ImplTabButton>::Create(this));
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpLastButton->SetClickHdl(aLink);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpLastButton->SetSymbol(mbMirrored ? SymbolType::FIRST : SymbolType::LAST);
|
|
|
|
mpImpl->mpLastButton->Show();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-03-09 14:29:30 +02:00
|
|
|
mpImpl->mpFirstButton.disposeAndClear();
|
|
|
|
mpImpl->mpLastButton.disposeAndClear();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::ImplEnableControls()
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mbSizeFormat || mbFormat)
|
2000-09-18 16:07:07 +00:00
|
|
|
return;
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// enable/disable buttons
|
2014-03-24 12:47:49 +02:00
|
|
|
bool bEnableBtn = mbScrollAlwaysEnabled || mnFirstPos > 0;
|
2015-03-08 16:54:17 +09:00
|
|
|
if (mpImpl->mpFirstButton)
|
|
|
|
mpImpl->mpFirstButton->Enable(bEnableBtn);
|
|
|
|
if (mpImpl->mpPrevButton)
|
|
|
|
mpImpl->mpPrevButton->Enable(bEnableBtn);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-09-13 20:13:25 +01:00
|
|
|
bEnableBtn = mbScrollAlwaysEnabled || mnFirstPos < ImplGetLastFirstPos();
|
2015-03-08 16:54:17 +09:00
|
|
|
if (mpImpl->mpNextButton)
|
|
|
|
mpImpl->mpNextButton->Enable(bEnableBtn);
|
|
|
|
if (mpImpl->mpLastButton)
|
|
|
|
mpImpl->mpLastButton->Enable(bEnableBtn);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2013-09-13 20:13:25 +01:00
|
|
|
void TabBar::SetScrollAlwaysEnabled(bool bScrollAlwaysEnabled)
|
|
|
|
{
|
|
|
|
mbScrollAlwaysEnabled = bScrollAlwaysEnabled;
|
|
|
|
ImplEnableControls();
|
|
|
|
}
|
|
|
|
|
2010-11-05 10:31:15 +08:00
|
|
|
void TabBar::ImplShowPage( sal_uInt16 nPos )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
if (nPos >= mpImpl->getItemSize())
|
2014-10-14 11:32:50 +01:00
|
|
|
return;
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// calculate width
|
2000-09-18 16:07:07 +00:00
|
|
|
long nWidth = GetOutputSizePixel().Width();
|
2014-09-14 19:01:02 +02:00
|
|
|
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarItem* pItem = mpImpl->mpItemList[nPos];
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos < mnFirstPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
SetFirstPageId( pItem->mnId );
|
2015-05-17 12:24:49 +09:00
|
|
|
else if (pItem->maRect.Right() > nWidth)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
while (pItem->maRect.Right() > nWidth)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nNewPos = mnFirstPos + 1;
|
|
|
|
SetFirstPageId(GetPageId(nNewPos));
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplFormat();
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nNewPos != mnFirstPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
IMPL_LINK( TabBar, ImplClickHdl, Button*, pButton, void )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-08-19 09:11:34 +02:00
|
|
|
ImplTabButton* pBtn = static_cast<ImplTabButton*>(pButton);
|
2000-09-18 16:07:07 +00:00
|
|
|
EndEditMode();
|
|
|
|
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 nNewPos = mnFirstPos;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-03-08 16:54:17 +09:00
|
|
|
if (pBtn == mpImpl->mpFirstButton.get() || (pBtn == mpImpl->mpPrevButton.get() && pBtn->isModKeyPressed()))
|
2015-02-25 14:39:42 +09:00
|
|
|
{
|
2000-09-18 16:07:07 +00:00
|
|
|
nNewPos = 0;
|
2015-02-25 14:39:42 +09:00
|
|
|
}
|
2015-03-08 16:54:17 +09:00
|
|
|
else if (pBtn == mpImpl->mpLastButton.get() || (pBtn == mpImpl->mpNextButton.get() && pBtn->isModKeyPressed()))
|
2015-02-25 14:39:42 +09:00
|
|
|
{
|
|
|
|
sal_uInt16 nCount = GetPageCount();
|
|
|
|
if (nCount)
|
|
|
|
nNewPos = nCount - 1;
|
|
|
|
}
|
2015-03-08 16:54:17 +09:00
|
|
|
else if (pBtn == mpImpl->mpPrevButton.get())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-02-25 14:39:42 +09:00
|
|
|
if (mnFirstPos)
|
|
|
|
nNewPos = mnFirstPos - 1;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2015-03-08 16:54:17 +09:00
|
|
|
else if (pBtn == mpImpl->mpNextButton.get())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 nCount = GetPageCount();
|
2015-02-25 14:39:42 +09:00
|
|
|
if (mnFirstPos < nCount)
|
2000-09-18 16:07:07 +00:00
|
|
|
nNewPos = mnFirstPos+1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-08-19 09:11:34 +02:00
|
|
|
return;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-02-25 14:39:42 +09:00
|
|
|
if (nNewPos != mnFirstPos)
|
|
|
|
SetFirstPageId(GetPageId(nNewPos));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
IMPL_LINK_NOARG(TabBar, ImplAddClickHandler, Button*, void)
|
2015-05-17 11:51:14 +09:00
|
|
|
{
|
|
|
|
AddTabClick();
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::MouseMove(const MouseEvent& rMEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (rMEvt.IsLeaveWindow())
|
2014-03-24 12:47:49 +02:00
|
|
|
mbInSelect = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
Window::MouseMove(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::MouseButtonDown(const MouseEvent& rMEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-02-26 23:02:35 +01:00
|
|
|
// Only terminate EditModus and do not execute click
|
2014-01-05 22:22:55 +01:00
|
|
|
// if clicked inside our window,
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsInEditMode())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
EndEditMode();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nSelId = GetPageId(rMEvt.GetPosPixel());
|
2008-09-30 13:51:36 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!rMEvt.IsLeft())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
Window::MouseButtonDown(rMEvt);
|
|
|
|
if (nSelId > 0 && nSelId != mnCurPageId)
|
2008-09-30 13:51:36 +00:00
|
|
|
{
|
2016-06-23 15:43:34 +02:00
|
|
|
if (ImplDeactivatePage())
|
2008-09-30 13:51:36 +00:00
|
|
|
{
|
2016-06-23 15:43:34 +02:00
|
|
|
SetCurPageId(nSelId);
|
|
|
|
Update();
|
|
|
|
ImplActivatePage();
|
|
|
|
ImplSelect();
|
2008-09-30 13:51:36 +00:00
|
|
|
}
|
2016-06-23 15:43:34 +02:00
|
|
|
mbInSelect = true;
|
2008-09-30 13:51:36 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (rMEvt.IsMod2() && mbAutoEditMode && nSelId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (StartEditMode(nSelId))
|
2000-09-18 16:07:07 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if ((rMEvt.GetMode() & (MouseEventModifiers::MULTISELECT | MouseEventModifiers::RANGESELECT)) && (rMEvt.GetClicks() == 1))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nSelId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nSelId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2016-06-23 15:43:34 +02:00
|
|
|
bool bSelectTab = false;
|
2015-01-10 15:52:17 +01:00
|
|
|
|
2016-06-23 15:43:34 +02:00
|
|
|
if ((rMEvt.GetMode() & MouseEventModifiers::MULTISELECT) && (mnWinStyle & WB_MULTISELECT))
|
|
|
|
{
|
|
|
|
if (nSelId != mnCurPageId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-06-23 15:43:34 +02:00
|
|
|
SelectPage(nSelId, !IsPageSelected(nSelId));
|
|
|
|
bSelectTab = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2016-06-23 15:43:34 +02:00
|
|
|
}
|
|
|
|
else if (mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT))
|
|
|
|
{
|
|
|
|
bSelectTab = true;
|
|
|
|
sal_uInt16 n;
|
|
|
|
bool bSelect;
|
|
|
|
sal_uInt16 nCurPos = GetPagePos(mnCurPageId);
|
|
|
|
if (nPos <= nCurPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-06-23 15:43:34 +02:00
|
|
|
// Deselect all tabs till the clicked tab
|
|
|
|
// and select all tabs from the clicked tab
|
|
|
|
// 'till the actual position
|
|
|
|
n = 0;
|
|
|
|
while (n < nCurPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-06-24 18:57:11 +02:00
|
|
|
auto pItem = mpImpl->mpItemList[n];
|
2017-04-25 10:32:23 +02:00
|
|
|
bSelect = n >= nPos;
|
2016-06-23 15:43:34 +02:00
|
|
|
|
|
|
|
if (pItem->mbSelect != bSelect)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-06-23 15:43:34 +02:00
|
|
|
pItem->mbSelect = bSelect;
|
|
|
|
if (!pItem->maRect.IsEmpty())
|
|
|
|
Invalidate(pItem->maRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2016-06-23 15:43:34 +02:00
|
|
|
|
|
|
|
n++;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2016-06-23 15:43:34 +02:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2016-06-23 15:43:34 +02:00
|
|
|
if (nPos >= nCurPos)
|
|
|
|
{
|
|
|
|
// Select all tabs from the actual position till the clicked tab
|
|
|
|
// and deselect all tabs from the actual position
|
|
|
|
// till the last tab
|
|
|
|
sal_uInt16 nCount = mpImpl->getItemSize();
|
|
|
|
n = nCurPos;
|
|
|
|
while (n < nCount)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-06-24 18:57:11 +02:00
|
|
|
auto pItem = mpImpl->mpItemList[n];
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2017-04-25 10:32:23 +02:00
|
|
|
bSelect = n <= nPos;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2016-06-23 15:43:34 +02:00
|
|
|
if (pItem->mbSelect != bSelect)
|
|
|
|
{
|
|
|
|
pItem->mbSelect = bSelect;
|
|
|
|
if (!pItem->maRect.IsEmpty())
|
|
|
|
Invalidate(pItem->maRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2016-06-23 15:43:34 +02:00
|
|
|
n++;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2016-06-23 15:43:34 +02:00
|
|
|
|
|
|
|
// scroll the selected tab if required
|
|
|
|
if (bSelectTab)
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
ImplShowPage(nPos);
|
2016-06-23 15:43:34 +02:00
|
|
|
Update();
|
|
|
|
ImplSelect();
|
|
|
|
}
|
|
|
|
|
2014-03-24 12:47:49 +02:00
|
|
|
mbInSelect = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2015-05-17 12:24:49 +09:00
|
|
|
else if (rMEvt.GetClicks() == 2)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// call double-click-handler if required
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!rMEvt.GetModifier() && (!nSelId || (nSelId == mnCurPageId)))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 nOldCurId = mnCurPageId;
|
2000-09-18 16:07:07 +00:00
|
|
|
mnCurPageId = nSelId;
|
|
|
|
DoubleClick();
|
2014-01-05 22:22:55 +01:00
|
|
|
// check, as actual page could be switched inside
|
|
|
|
// the doubleclick-handler
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnCurPageId == nSelId)
|
2000-09-18 16:07:07 +00:00
|
|
|
mnCurPageId = nOldCurId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nSelId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// execute Select if not actual page
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nSelId != mnCurPageId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nSelId);
|
2016-06-24 18:57:11 +02:00
|
|
|
auto pItem = mpImpl->mpItemList[nPos];
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2016-06-23 15:43:34 +02:00
|
|
|
if (!pItem->mbSelect)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-06-23 15:43:34 +02:00
|
|
|
// make not valid
|
|
|
|
bool bUpdate = false;
|
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
|
|
|
bUpdate = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2016-06-23 15:43:34 +02:00
|
|
|
// deselect all selected items
|
|
|
|
for (ImplTabBarItem* i : mpImpl->mpItemList)
|
|
|
|
{
|
|
|
|
pItem = i;
|
|
|
|
if (pItem->mbSelect || (pItem->mnId == mnCurPageId))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-06-23 15:43:34 +02:00
|
|
|
pItem->mbSelect = false;
|
|
|
|
if (bUpdate)
|
|
|
|
Invalidate(pItem->maRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2016-06-23 15:43:34 +02:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2016-06-23 15:43:34 +02:00
|
|
|
if (ImplDeactivatePage())
|
|
|
|
{
|
|
|
|
SetCurPageId(nSelId);
|
|
|
|
Update();
|
|
|
|
ImplActivatePage();
|
|
|
|
ImplSelect();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2016-06-23 15:43:34 +02:00
|
|
|
|
2014-03-24 12:47:49 +02:00
|
|
|
mbInSelect = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
Window::MouseButtonDown(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::MouseButtonUp(const MouseEvent& rMEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-03-24 12:47:49 +02:00
|
|
|
mbInSelect = false;
|
2015-05-17 12:24:49 +09:00
|
|
|
Window::MouseButtonUp(rMEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
void TabBar::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rect)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-06-10 19:55:12 +02:00
|
|
|
if (rRenderContext.IsNativeControlSupported(ControlType::WindowBackground,ControlPart::Entire))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-06-10 19:55:12 +02:00
|
|
|
rRenderContext.DrawNativeControl(ControlType::WindowBackground,ControlPart::Entire,rect,
|
2015-05-11 14:33:01 +09:00
|
|
|
ControlState::ENABLED,ImplControlValue(0),OUString());
|
2010-10-04 17:23:15 -04:00
|
|
|
}
|
2014-01-05 22:22:55 +01:00
|
|
|
// calculate items and emit
|
2015-03-08 18:14:06 +09:00
|
|
|
sal_uInt16 nItemCount = mpImpl->getItemSize();
|
2010-10-04 17:23:15 -04:00
|
|
|
if (!nItemCount)
|
|
|
|
return;
|
|
|
|
|
2017-05-03 15:06:07 +02:00
|
|
|
ImplPrePaint();
|
2010-10-04 17:23:15 -04:00
|
|
|
|
|
|
|
Color aFaceColor, aSelectColor, aFaceTextColor, aSelectTextColor;
|
2015-05-11 14:33:01 +09:00
|
|
|
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
|
|
|
|
ImplGetColors(rStyleSettings, aFaceColor, aFaceTextColor, aSelectColor, aSelectTextColor);
|
|
|
|
|
|
|
|
rRenderContext.Push(PushFlags::FONT | PushFlags::CLIPREGION);
|
|
|
|
rRenderContext.SetClipRegion(vcl::Region(GetPageArea()));
|
2010-10-04 17:23:15 -04:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// select font
|
2015-05-11 14:33:01 +09:00
|
|
|
vcl::Font aFont = rRenderContext.GetFont();
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font aLightFont = aFont;
|
2015-05-11 14:33:01 +09:00
|
|
|
aLightFont.SetWeight(WEIGHT_NORMAL);
|
2010-10-04 17:23:15 -04:00
|
|
|
|
2015-05-11 14:33:01 +09:00
|
|
|
TabDrawer aDrawer(*this, rRenderContext);
|
2014-09-14 19:01:02 +02:00
|
|
|
|
2010-10-04 17:23:15 -04:00
|
|
|
aDrawer.setSelectedFillColor(aSelectColor);
|
|
|
|
aDrawer.setUnselectedFillColor(aFaceColor);
|
2014-09-14 19:01:02 +02:00
|
|
|
|
2010-10-04 17:23:15 -04:00
|
|
|
aDrawer.drawOutputAreaBorder();
|
|
|
|
|
|
|
|
// Now, start drawing the tabs.
|
|
|
|
|
|
|
|
ImplTabBarItem* pItem = ImplGetLastTabBarItem(nItemCount);
|
2015-11-10 10:25:17 +01:00
|
|
|
ImplTabBarItem* pCurItem = nullptr;
|
2015-05-11 14:33:01 +09:00
|
|
|
while (pItem)
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// emit CurrentItem last, as it covers all others
|
2015-05-11 14:33:01 +09:00
|
|
|
if (!pCurItem && (pItem->mnId == mnCurPageId))
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
|
|
|
pCurItem = pItem;
|
2011-02-20 20:16:10 -08:00
|
|
|
pItem = prev();
|
2015-05-11 14:33:01 +09:00
|
|
|
if (!pItem)
|
2000-09-18 16:07:07 +00:00
|
|
|
pItem = pCurItem;
|
2010-10-04 17:23:15 -04:00
|
|
|
continue;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2010-10-04 17:23:15 -04:00
|
|
|
bool bCurrent = pItem == pCurItem;
|
|
|
|
|
2015-05-11 14:33:01 +09:00
|
|
|
if (!pItem->maRect.IsEmpty())
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aRect = pItem->maRect;
|
2010-10-04 17:23:15 -04:00
|
|
|
bool bSelected = pItem->IsSelected(pCurItem);
|
|
|
|
// We disable custom background color in high contrast mode.
|
|
|
|
bool bCustomBgColor = !pItem->IsDefaultTabBgColor() && !rStyleSettings.GetHighContrastMode();
|
|
|
|
bool bSpecialTab = (pItem->mnBits & TPB_SPECIAL);
|
2015-08-11 08:42:31 +02:00
|
|
|
OUString aText = pItem->mbShort ? rRenderContext.GetEllipsisString(pItem->maText, mnCurMaxWidth) : pItem->maText;
|
2010-10-04 17:23:15 -04:00
|
|
|
|
|
|
|
aDrawer.setRect(aRect);
|
|
|
|
aDrawer.setSelected(bSelected);
|
|
|
|
aDrawer.setCustomColored(bCustomBgColor);
|
2016-06-23 15:43:34 +02:00
|
|
|
aDrawer.setEnabled(true);
|
2010-10-04 17:23:15 -04:00
|
|
|
aDrawer.setCustomColor(pItem->maTabBgColor);
|
|
|
|
aDrawer.drawTab();
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// actual page is drawn using a bold font
|
2015-05-11 14:33:01 +09:00
|
|
|
if (bCurrent)
|
|
|
|
rRenderContext.SetFont(aFont);
|
2010-10-04 17:23:15 -04:00
|
|
|
else
|
2015-05-11 14:33:01 +09:00
|
|
|
rRenderContext.SetFont(aLightFont);
|
2010-10-04 17:23:15 -04:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// Set the correct FillInBrush depending on status
|
|
|
|
|
2015-05-11 14:33:01 +09:00
|
|
|
if (bSelected)
|
|
|
|
rRenderContext.SetTextColor(aSelectTextColor);
|
|
|
|
else if (bCustomBgColor)
|
|
|
|
rRenderContext.SetTextColor(pItem->maTabTextColor);
|
2010-10-04 17:23:15 -04:00
|
|
|
else
|
2015-05-11 14:33:01 +09:00
|
|
|
rRenderContext.SetTextColor(aFaceTextColor);
|
2010-10-04 17:23:15 -04:00
|
|
|
|
|
|
|
// This tab is "special", and a special tab needs a blue text.
|
|
|
|
if (bSpecialTab)
|
2015-05-11 14:33:01 +09:00
|
|
|
rRenderContext.SetTextColor(Color(COL_LIGHTBLUE));
|
2010-10-04 17:23:15 -04:00
|
|
|
|
|
|
|
aDrawer.drawText(aText);
|
|
|
|
|
2015-05-11 14:33:01 +09:00
|
|
|
if (bCurrent)
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
2015-05-11 14:33:01 +09:00
|
|
|
rRenderContext.SetLineColor();
|
|
|
|
rRenderContext.SetFillColor(aSelectColor);
|
2014-12-27 20:22:01 +09:00
|
|
|
aDrawer.drawOverTopBorder();
|
2015-05-26 16:21:34 +01:00
|
|
|
break;
|
2010-10-04 17:23:15 -04:00
|
|
|
}
|
|
|
|
|
2011-02-20 20:16:10 -08:00
|
|
|
pItem = prev();
|
2010-10-04 17:23:15 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-11 14:33:01 +09:00
|
|
|
if (bCurrent)
|
2015-05-26 16:21:34 +01:00
|
|
|
break;
|
2010-10-04 17:23:15 -04:00
|
|
|
|
2015-11-10 10:25:17 +01:00
|
|
|
pItem = nullptr;
|
2010-10-04 17:23:15 -04:00
|
|
|
}
|
|
|
|
|
2015-05-11 14:33:01 +09:00
|
|
|
if (!pItem)
|
2010-10-04 17:23:15 -04:00
|
|
|
pItem = pCurItem;
|
|
|
|
}
|
2015-05-26 16:21:34 +01:00
|
|
|
rRenderContext.Pop();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::Resize()
|
|
|
|
{
|
|
|
|
Size aNewSize = GetOutputSizePixel();
|
|
|
|
|
2004-02-03 11:06:06 +00:00
|
|
|
long nSizerWidth = 0;
|
|
|
|
long nButtonWidth = 0;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// Sizer anordnen
|
2007-06-27 13:51:52 +00:00
|
|
|
if ( mpImpl->mpSizer )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2007-06-27 13:51:52 +00:00
|
|
|
Size aSizerSize = mpImpl->mpSizer->GetSizePixel();
|
2004-02-03 11:06:06 +00:00
|
|
|
Point aNewSizerPos( mbMirrored ? 0 : (aNewSize.Width()-aSizerSize.Width()), 0 );
|
2000-09-18 16:07:07 +00:00
|
|
|
Size aNewSizerSize( aSizerSize.Width(), aNewSize.Height() );
|
2007-06-27 13:51:52 +00:00
|
|
|
mpImpl->mpSizer->SetPosSizePixel( aNewSizerPos, aNewSizerSize );
|
2004-02-03 11:06:06 +00:00
|
|
|
nSizerWidth = aSizerSize.Width();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// order the scroll buttons
|
2015-10-07 11:13:20 +02:00
|
|
|
long const nHeight = aNewSize.Height();
|
2014-01-05 22:22:55 +01:00
|
|
|
// adapt font height?
|
2014-03-24 12:47:49 +02:00
|
|
|
ImplInitSettings( true, false );
|
2001-08-28 12:43:34 +00:00
|
|
|
|
2015-03-03 10:44:03 +09:00
|
|
|
long nButtonMargin = BUTTON_MARGIN * GetDPIScaleFactor();
|
|
|
|
|
|
|
|
long nX = mbMirrored ? (aNewSize.Width() - nHeight - nButtonMargin) : nButtonMargin;
|
2015-10-07 11:13:20 +02:00
|
|
|
long const nXDiff = mbMirrored ? -nHeight : nHeight;
|
2004-02-03 11:06:06 +00:00
|
|
|
|
2015-03-03 10:44:03 +09:00
|
|
|
nButtonWidth += nButtonMargin;
|
|
|
|
|
2015-10-07 11:13:20 +02:00
|
|
|
Size const aBtnSize( nHeight, nHeight );
|
|
|
|
auto setButton = [aBtnSize, nXDiff, nHeight, &nX, &nButtonWidth](
|
|
|
|
ScopedVclPtr<ImplTabButton> const & button)
|
2004-02-03 11:06:06 +00:00
|
|
|
{
|
2015-10-07 11:13:20 +02:00
|
|
|
if (button) {
|
|
|
|
button->SetPosSizePixel(Point(nX, 0), aBtnSize);
|
|
|
|
nX += nXDiff;
|
|
|
|
nButtonWidth += nHeight;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
setButton(mpImpl->mpFirstButton);
|
|
|
|
setButton(mpImpl->mpPrevButton);
|
|
|
|
setButton(mpImpl->mpNextButton);
|
|
|
|
setButton(mpImpl->mpLastButton);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 11:51:14 +09:00
|
|
|
nButtonWidth += nButtonMargin;
|
|
|
|
nX += mbMirrored ? -nButtonMargin : nButtonMargin;
|
|
|
|
|
2015-10-07 11:13:20 +02:00
|
|
|
setButton(mpImpl->mpAddButton);
|
2015-05-17 11:51:14 +09:00
|
|
|
|
2015-03-03 10:44:03 +09:00
|
|
|
nButtonWidth += nButtonMargin;
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// store size
|
2000-09-18 16:07:07 +00:00
|
|
|
maWinSize = aNewSize;
|
|
|
|
|
2004-02-03 11:06:06 +00:00
|
|
|
if( mbMirrored )
|
|
|
|
{
|
|
|
|
mnOffX = nSizerWidth;
|
|
|
|
mnLastOffX = maWinSize.Width() - nButtonWidth - 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mnOffX = nButtonWidth;
|
|
|
|
mnLastOffX = maWinSize.Width() - nSizerWidth - 1;
|
|
|
|
}
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// reformat
|
2014-03-24 12:47:49 +02:00
|
|
|
mbSizeFormat = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( IsReallyVisible() )
|
|
|
|
{
|
|
|
|
if ( ImplCalcWidth() )
|
|
|
|
Invalidate();
|
2014-02-03 22:15:04 +01:00
|
|
|
|
|
|
|
ImplFormat();
|
|
|
|
|
|
|
|
// Ensure as many tabs as possible are visible:
|
|
|
|
sal_uInt16 nLastFirstPos = ImplGetLastFirstPos();
|
|
|
|
if ( mnFirstPos > nLastFirstPos )
|
|
|
|
{
|
|
|
|
mnFirstPos = nLastFirstPos;
|
2014-03-24 12:47:49 +02:00
|
|
|
mbFormat = true;
|
2014-02-03 22:15:04 +01:00
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
// Ensure the currently selected page is visible
|
2015-05-17 12:24:49 +09:00
|
|
|
ImplShowPage(GetPagePos(mnCurPageId));
|
2014-02-03 22:15:04 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplFormat();
|
|
|
|
}
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// enable/disable button
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplEnableControls();
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
bool TabBar::PreNotify(NotifyEvent& rNEvt)
|
2015-03-05 19:36:39 +09:00
|
|
|
{
|
|
|
|
if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
|
|
|
|
{
|
2015-05-07 15:25:20 +02:00
|
|
|
if (rNEvt.GetCommandEvent()->GetCommand() == CommandEventId::Wheel)
|
2015-03-05 19:36:39 +09:00
|
|
|
{
|
|
|
|
const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
|
|
|
|
sal_uInt16 nNewPos = mnFirstPos;
|
|
|
|
if (pData->GetNotchDelta() > 0)
|
|
|
|
{
|
|
|
|
if (mnFirstPos)
|
|
|
|
nNewPos = mnFirstPos - 1;
|
|
|
|
}
|
|
|
|
else if (pData->GetNotchDelta() < 0)
|
|
|
|
{
|
|
|
|
sal_uInt16 nCount = GetPageCount();
|
|
|
|
if (mnFirstPos < nCount)
|
|
|
|
nNewPos = mnFirstPos + 1;
|
|
|
|
}
|
|
|
|
if (nNewPos != mnFirstPos)
|
|
|
|
SetFirstPageId(GetPageId(nNewPos));
|
|
|
|
}
|
|
|
|
}
|
2015-05-17 12:24:49 +09:00
|
|
|
return Window::PreNotify(rNEvt);
|
2015-03-05 19:36:39 +09:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::RequestHelp(const HelpEvent& rHEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nItemId = GetPageId(ScreenToOutputPixel(rHEvt.GetMousePosPixel()));
|
|
|
|
if (nItemId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (rHEvt.GetMode() & HelpEventMode::BALLOON)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
OUString aStr = GetHelpText(nItemId);
|
2012-09-10 23:42:29 +01:00
|
|
|
if (!aStr.isEmpty())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aItemRect = GetPageRect(nItemId);
|
2015-05-17 12:24:49 +09:00
|
|
|
Point aPt = OutputToScreenPixel(aItemRect.TopLeft());
|
2000-09-18 16:07:07 +00:00
|
|
|
aItemRect.Left() = aPt.X();
|
|
|
|
aItemRect.Top() = aPt.Y();
|
2015-05-17 12:24:49 +09:00
|
|
|
aPt = OutputToScreenPixel(aItemRect.BottomRight());
|
2000-09-18 16:07:07 +00:00
|
|
|
aItemRect.Right() = aPt.X();
|
|
|
|
aItemRect.Bottom() = aPt.Y();
|
2015-05-17 12:24:49 +09:00
|
|
|
Help::ShowBalloon(this, aItemRect.Center(), aItemRect, aStr);
|
2000-09-18 16:07:07 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2015-05-17 12:24:49 +09:00
|
|
|
else if (rHEvt.GetMode() & HelpEventMode::EXTENDED)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
OUString aHelpId(OStringToOUString(GetHelpId(nItemId), RTL_TEXTENCODING_UTF8));
|
2012-01-13 19:13:55 -02:00
|
|
|
if ( !aHelpId.isEmpty() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// trigger Help if available
|
2000-09-18 16:07:07 +00:00
|
|
|
Help* pHelp = Application::GetHelp();
|
2015-05-17 12:24:49 +09:00
|
|
|
if (pHelp)
|
|
|
|
pHelp->Start(aHelpId, this);
|
2000-09-18 16:07:07 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// show text for quick- or balloon-help
|
|
|
|
// if this is isolated or not fully visible
|
2015-05-17 12:24:49 +09:00
|
|
|
if (rHEvt.GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nItemId);
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarItem* pItem = mpImpl->mpItemList[nPos];
|
2015-05-17 12:24:49 +09:00
|
|
|
if (pItem->mbShort || (pItem->maRect.Right() - 5 > mnLastOffX))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aItemRect = GetPageRect(nItemId);
|
2015-05-17 12:24:49 +09:00
|
|
|
Point aPt = OutputToScreenPixel(aItemRect.TopLeft());
|
2000-09-18 16:07:07 +00:00
|
|
|
aItemRect.Left() = aPt.X();
|
|
|
|
aItemRect.Top() = aPt.Y();
|
2015-05-17 12:24:49 +09:00
|
|
|
aPt = OutputToScreenPixel(aItemRect.BottomRight());
|
2000-09-18 16:07:07 +00:00
|
|
|
aItemRect.Right() = aPt.X();
|
|
|
|
aItemRect.Bottom() = aPt.Y();
|
2015-03-08 18:14:06 +09:00
|
|
|
OUString aStr = mpImpl->mpItemList[nPos]->maText;
|
2012-09-10 23:42:29 +01:00
|
|
|
if (!aStr.isEmpty())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (rHEvt.GetMode() & HelpEventMode::BALLOON)
|
|
|
|
Help::ShowBalloon(this, aItemRect.Center(), aItemRect, aStr);
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
2015-05-17 12:24:49 +09:00
|
|
|
Help::ShowQuickHelp(this, aItemRect, aStr);
|
2000-09-18 16:07:07 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
Window::RequestHelp(rHEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::StateChanged(StateChangedType nType)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
Window::StateChanged(nType);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nType == StateChangedType::InitShow)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
if ( (mbSizeFormat || mbFormat) && !mpImpl->mpItemList.empty() )
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplFormat();
|
|
|
|
}
|
2015-05-17 12:24:49 +09:00
|
|
|
else if (nType == StateChangedType::Zoom ||
|
|
|
|
nType == StateChangedType::ControlFont)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
ImplInitSettings(true, false);
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
|
|
|
}
|
2015-05-17 12:24:49 +09:00
|
|
|
else if (nType == StateChangedType::ControlForeground)
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
2015-05-17 12:24:49 +09:00
|
|
|
else if (nType == StateChangedType::ControlBackground)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
ImplInitSettings(false, true);
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
|
|
|
}
|
2015-05-17 12:24:49 +09:00
|
|
|
else if (nType == StateChangedType::Mirroring)
|
2009-03-02 14:19:13 +00:00
|
|
|
{
|
|
|
|
// reacts on calls of EnableRTL, have to mirror all child controls
|
2015-03-08 16:54:17 +09:00
|
|
|
if (mpImpl->mpFirstButton)
|
|
|
|
mpImpl->mpFirstButton->EnableRTL(IsRTLEnabled());
|
|
|
|
if (mpImpl->mpPrevButton)
|
|
|
|
mpImpl->mpPrevButton->EnableRTL(IsRTLEnabled());
|
|
|
|
if (mpImpl->mpNextButton)
|
|
|
|
mpImpl->mpNextButton->EnableRTL(IsRTLEnabled());
|
|
|
|
if (mpImpl->mpLastButton)
|
|
|
|
mpImpl->mpLastButton->EnableRTL(IsRTLEnabled());
|
|
|
|
if (mpImpl->mpSizer)
|
|
|
|
mpImpl->mpSizer->EnableRTL(IsRTLEnabled());
|
2015-05-17 11:51:14 +09:00
|
|
|
if (mpImpl->mpAddButton)
|
|
|
|
mpImpl->mpAddButton->EnableRTL(IsRTLEnabled());
|
2015-03-08 16:54:17 +09:00
|
|
|
if (mpImpl->mpEdit)
|
|
|
|
mpImpl->mpEdit->EnableRTL(IsRTLEnabled());
|
2009-03-02 14:19:13 +00:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::DataChanged(const DataChangedEvent& rDCEvt)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
Window::DataChanged(rDCEvt);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (rDCEvt.GetType() == DataChangedEventType::FONTS
|
|
|
|
|| rDCEvt.GetType() == DataChangedEventType::FONTSUBSTITUTION
|
|
|
|
|| (rDCEvt.GetType() == DataChangedEventType::SETTINGS
|
|
|
|
&& rDCEvt.GetFlags() & AllSettingsFlags::STYLE))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
ImplInitSettings(true, true);
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-09-02 15:17:34 +00:00
|
|
|
void TabBar::ImplSelect()
|
|
|
|
{
|
|
|
|
Select();
|
2016-12-06 13:26:09 +02:00
|
|
|
CallEventListeners(VclEventId::TabbarPageSelected, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(mnCurPageId)));
|
2002-09-02 15:17:34 +00:00
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
void TabBar::Select()
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
maSelectHdl.Call(this);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::DoubleClick()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::Split()
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
maSplitHdl.Call(this);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2002-09-02 15:17:34 +00:00
|
|
|
void TabBar::ImplActivatePage()
|
|
|
|
{
|
|
|
|
ActivatePage();
|
|
|
|
|
2016-12-06 13:26:09 +02:00
|
|
|
CallEventListeners(VclEventId::TabbarPageActivated, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(mnCurPageId)));
|
2002-09-02 15:17:34 +00:00
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
void TabBar::ActivatePage()
|
2015-03-08 18:23:40 +09:00
|
|
|
{}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-28 16:49:12 +03:00
|
|
|
bool TabBar::ImplDeactivatePage()
|
2002-09-02 15:17:34 +00:00
|
|
|
{
|
2015-09-25 13:06:09 +02:00
|
|
|
bool bRet = DeactivatePage();
|
2002-09-02 15:17:34 +00:00
|
|
|
|
2016-12-06 13:26:09 +02:00
|
|
|
CallEventListeners(VclEventId::TabbarPageDeactivated, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(mnCurPageId)));
|
2002-09-02 15:17:34 +00:00
|
|
|
|
2015-09-25 13:06:09 +02:00
|
|
|
return bRet;
|
2002-09-02 15:17:34 +00:00
|
|
|
}
|
|
|
|
|
2017-05-03 15:06:07 +02:00
|
|
|
void TabBar::ImplPrePaint()
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
sal_uInt16 nItemCount = mpImpl->getItemSize();
|
2010-10-04 17:23:15 -04:00
|
|
|
if (!nItemCount)
|
|
|
|
return;
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// tabbar should be formatted
|
2010-10-04 17:23:15 -04:00
|
|
|
ImplFormat();
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// assure the actual tabpage becomes visible at first format
|
2015-05-11 14:33:01 +09:00
|
|
|
if (mbFirstFormat)
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
2014-03-24 12:47:49 +02:00
|
|
|
mbFirstFormat = false;
|
2010-10-04 17:23:15 -04:00
|
|
|
|
2015-05-11 14:33:01 +09:00
|
|
|
if (mnCurPageId && (mnFirstPos == 0) && !mbDropPos)
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarItem* pItem = mpImpl->mpItemList[GetPagePos(mnCurPageId)];
|
2015-05-11 14:33:01 +09:00
|
|
|
if (pItem->maRect.IsEmpty())
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// set mbDropPos (or misuse) to prevent Invalidate()
|
2014-03-24 12:47:49 +02:00
|
|
|
mbDropPos = true;
|
2015-05-11 14:33:01 +09:00
|
|
|
SetFirstPageId(mnCurPageId);
|
2014-03-24 12:47:49 +02:00
|
|
|
mbDropPos = false;
|
2015-05-11 14:33:01 +09:00
|
|
|
if (mnFirstPos != 0)
|
2010-10-04 17:23:15 -04:00
|
|
|
ImplFormat();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-11 18:04:44 +00:00
|
|
|
ImplTabBarItem* TabBar::ImplGetLastTabBarItem( sal_uInt16 nItemCount )
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// find last visible entry
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 n = mnFirstPos + 1;
|
|
|
|
if (n >= nItemCount)
|
2010-10-04 17:23:15 -04:00
|
|
|
n = nItemCount-1;
|
2015-05-17 12:24:49 +09:00
|
|
|
ImplTabBarItem* pItem = seek(n);
|
|
|
|
while (pItem)
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!pItem->maRect.IsEmpty())
|
2010-10-04 17:23:15 -04:00
|
|
|
{
|
|
|
|
n++;
|
2011-02-20 20:16:10 -08:00
|
|
|
pItem = next();
|
2010-10-04 17:23:15 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// draw all tabs (from back to front and actual last)
|
2015-05-17 12:24:49 +09:00
|
|
|
if (pItem)
|
2010-10-04 17:23:15 -04:00
|
|
|
n--;
|
2015-05-17 12:24:49 +09:00
|
|
|
else if (n >= nItemCount)
|
2010-10-04 17:23:15 -04:00
|
|
|
n = nItemCount-1;
|
2015-05-17 12:24:49 +09:00
|
|
|
pItem = seek(n);
|
2010-10-04 17:23:15 -04:00
|
|
|
return pItem;
|
|
|
|
}
|
|
|
|
|
2014-04-25 12:49:17 +02:00
|
|
|
bool TabBar::DeactivatePage()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-25 15:39:59 +02:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-25 12:49:17 +02:00
|
|
|
bool TabBar::StartRenaming()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-25 15:39:59 +02:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2014-04-25 12:49:17 +02:00
|
|
|
TabBarAllowRenamingReturnCode TabBar::AllowRenaming()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-25 15:39:59 +02:00
|
|
|
return TABBAR_RENAMING_YES;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::EndRenaming()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-02-03 11:06:06 +00:00
|
|
|
void TabBar::Mirror()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-05-17 11:51:14 +09:00
|
|
|
void TabBar::AddTabClick()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::InsertPage(sal_uInt16 nPageId, const OUString& rText,
|
|
|
|
TabBarPageBits nBits, sal_uInt16 nPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" );
|
2010-02-23 16:13:04 -05:00
|
|
|
DBG_ASSERT( GetPagePos( nPageId ) == PAGE_NOT_FOUND,
|
2000-09-18 16:07:07 +00:00
|
|
|
"TabBar::InsertPage(): PageId already exists" );
|
|
|
|
DBG_ASSERT( nBits <= TPB_SPECIAL, "TabBar::InsertPage(): nBits is wrong" );
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// create PageItem and insert in the item list
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplTabBarItem* pItem = new ImplTabBarItem( nPageId, rText, nBits );
|
2015-03-08 18:14:06 +09:00
|
|
|
if (nPos < mpImpl->mpItemList.size())
|
|
|
|
{
|
|
|
|
ImplTabBarList::iterator it = mpImpl->mpItemList.begin();
|
|
|
|
std::advance(it, nPos);
|
|
|
|
mpImpl->mpItemList.insert(it, pItem);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mpImpl->mpItemList.push_back(pItem);
|
2011-02-20 20:16:10 -08:00
|
|
|
}
|
2014-03-24 12:47:49 +02:00
|
|
|
mbSizeFormat = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// set CurPageId if required
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!mnCurPageId)
|
2000-09-18 16:07:07 +00:00
|
|
|
mnCurPageId = nPageId;
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// redraw bar
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
2002-09-02 15:17:34 +00:00
|
|
|
|
2016-12-06 13:26:09 +02:00
|
|
|
CallEventListeners(VclEventId::TabbarPageInserted, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(nPageId)));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
Color TabBar::GetTabBgColor(sal_uInt16 nPageId) const
|
2009-09-17 15:48:04 -04:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2009-09-17 15:48:04 -04:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2015-03-08 18:14:06 +09:00
|
|
|
return mpImpl->mpItemList[nPos]->maTabBgColor;
|
2009-09-17 15:48:04 -04:00
|
|
|
else
|
2015-05-17 12:24:49 +09:00
|
|
|
return Color(COL_AUTO);
|
2009-09-17 15:48:04 -04:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::SetTabBgColor(sal_uInt16 nPageId, const Color& aTabBgColor)
|
2009-09-17 15:48:04 -04:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2009-09-17 15:48:04 -04:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarItem* pItem = mpImpl->mpItemList[nPos];
|
2015-05-17 12:24:49 +09:00
|
|
|
if (aTabBgColor != Color(COL_AUTO))
|
2009-09-17 15:48:04 -04:00
|
|
|
{
|
|
|
|
pItem->maTabBgColor = aTabBgColor;
|
2015-05-17 12:24:49 +09:00
|
|
|
if (aTabBgColor.GetLuminance() <= 128) //Do not use aTabBgColor.IsDark(), because that threshold is way too low...
|
|
|
|
pItem->maTabTextColor = Color(COL_WHITE);
|
2009-09-17 15:48:04 -04:00
|
|
|
else
|
2015-05-17 12:24:49 +09:00
|
|
|
pItem->maTabTextColor = Color(COL_BLACK);
|
2009-09-17 15:48:04 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
pItem->maTabBgColor = Color(COL_AUTO);
|
|
|
|
pItem->maTabTextColor = Color(COL_AUTO);
|
2009-09-17 15:48:04 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::RemovePage(sal_uInt16 nPageId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// does item exist
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnCurPageId == nPageId)
|
2000-09-18 16:07:07 +00:00
|
|
|
mnCurPageId = 0;
|
|
|
|
|
2015-09-29 18:09:46 +02:00
|
|
|
// check if first visible page should be moved
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnFirstPos > nPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
mnFirstPos--;
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// delete item data
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarList::iterator it = mpImpl->mpItemList.begin();
|
|
|
|
std::advance(it, nPos);
|
2011-02-20 20:16:10 -08:00
|
|
|
delete *it;
|
2015-03-08 18:14:06 +09:00
|
|
|
mpImpl->mpItemList.erase(it);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// redraw bar
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
2002-09-02 15:17:34 +00:00
|
|
|
|
2016-12-06 13:26:09 +02:00
|
|
|
CallEventListeners(VclEventId::TabbarPageRemoved, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(nPageId)));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::MovePage(sal_uInt16 nPageId, sal_uInt16 nNewPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
|
|
|
Pair aPair(nPos, nNewPos);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos < nNewPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
nNewPos--;
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos == nNewPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
return;
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// does item exit
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// move tabbar item in the list
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarList::iterator it = mpImpl->mpItemList.begin();
|
|
|
|
std::advance(it, nPos);
|
2011-02-20 20:16:10 -08:00
|
|
|
ImplTabBarItem* pItem = *it;
|
2015-03-08 18:14:06 +09:00
|
|
|
mpImpl->mpItemList.erase(it);
|
|
|
|
if (nNewPos < mpImpl->mpItemList.size())
|
|
|
|
{
|
|
|
|
it = mpImpl->mpItemList.begin();
|
|
|
|
std::advance(it, nNewPos);
|
|
|
|
mpImpl->mpItemList.insert(it, pItem);
|
2015-05-17 12:24:49 +09:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
mpImpl->mpItemList.push_back(pItem);
|
2011-02-20 20:16:10 -08:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// redraw bar
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
2002-09-02 15:17:34 +00:00
|
|
|
|
2016-12-06 13:26:09 +02:00
|
|
|
CallEventListeners( VclEventId::TabbarPageMoved, static_cast<void*>(&aPair) );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::Clear()
|
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// delete all items
|
2016-05-10 14:39:07 +02:00
|
|
|
for (ImplTabBarItem* i : mpImpl->mpItemList)
|
2015-03-08 18:14:06 +09:00
|
|
|
{
|
2016-05-10 14:39:07 +02:00
|
|
|
delete i;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2015-03-08 18:14:06 +09:00
|
|
|
mpImpl->mpItemList.clear();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// remove items from the list
|
2014-03-24 12:47:49 +02:00
|
|
|
mbSizeFormat = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
mnCurPageId = 0;
|
|
|
|
mnFirstPos = 0;
|
2011-02-20 20:16:10 -08:00
|
|
|
maCurrentItemList = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// redraw bar
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
2002-09-02 15:17:34 +00:00
|
|
|
|
2016-12-06 13:26:09 +02:00
|
|
|
CallEventListeners(VclEventId::TabbarPageRemoved, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(PAGE_NOT_FOUND)));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
bool TabBar::IsPageEnabled(sal_uInt16 nPageId) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2017-04-25 10:32:23 +02:00
|
|
|
return nPos != PAGE_NOT_FOUND;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::SetPageBits(sal_uInt16 nPageId, TabBarPageBits nBits)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarItem* pItem = mpImpl->mpItemList[nPos];
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (pItem->mnBits != nBits)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
pItem->mnBits = nBits;
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// redraw bar
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
|
|
|
Invalidate(pItem->maRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
TabBarPageBits TabBar::GetPageBits(sal_uInt16 nPageId) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2015-03-08 18:14:06 +09:00
|
|
|
return mpImpl->mpItemList[nPos]->mnBits;
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
2015-04-28 10:44:39 +02:00
|
|
|
return 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 TabBar::GetPageCount() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
return mpImpl->getItemSize();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 TabBar::GetPageId(sal_uInt16 nPos) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
return nPos < mpImpl->mpItemList.size() ? mpImpl->mpItemList[nPos]->mnId : 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 TabBar::GetPagePos(sal_uInt16 nPageId) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mpImpl->mpItemList[i]->mnId == nPageId)
|
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
return static_cast<sal_uInt16>(i);
|
2011-02-20 20:16:10 -08:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2010-02-23 16:13:04 -05:00
|
|
|
return PAGE_NOT_FOUND;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 TabBar::GetPageId(const Point& rPos) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2016-05-10 14:39:07 +02:00
|
|
|
for (ImplTabBarItem* pItem : mpImpl->mpItemList)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
if (pItem->maRect.IsInside(rPos))
|
2000-09-18 16:07:07 +00:00
|
|
|
return pItem->mnId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle TabBar::GetPageRect(sal_uInt16 nPageId) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2015-03-08 18:14:06 +09:00
|
|
|
return mpImpl->mpItemList[nPos]->maRect;
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
2017-03-30 20:27:55 +02:00
|
|
|
return tools::Rectangle();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::SetCurPageId(sal_uInt16 nPageId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// do nothing if item does not exit
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// do nothing if the actual page did not change
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPageId == mnCurPageId)
|
2000-09-18 16:07:07 +00:00
|
|
|
return;
|
|
|
|
|
2017-03-02 15:17:15 +01:00
|
|
|
// make invalid
|
2014-03-24 12:47:49 +02:00
|
|
|
bool bUpdate = false;
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
2014-03-24 12:47:49 +02:00
|
|
|
bUpdate = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarItem* pItem = mpImpl->mpItemList[nPos];
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplTabBarItem* pOldItem;
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnCurPageId)
|
2015-03-08 18:14:06 +09:00
|
|
|
pOldItem = mpImpl->mpItemList[GetPagePos(mnCurPageId)];
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
2015-11-10 10:25:17 +01:00
|
|
|
pOldItem = nullptr;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// deselect previous page if page was not selected, if this is the
|
|
|
|
// only selected page
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!pItem->mbSelect && pOldItem)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 nSelPageCount = GetSelectPageCount();
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nSelPageCount == 1)
|
2014-03-24 12:47:49 +02:00
|
|
|
pOldItem->mbSelect = false;
|
|
|
|
pItem->mbSelect = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mnCurPageId = nPageId;
|
2014-03-24 12:47:49 +02:00
|
|
|
mbFormat = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// assure the actual page becomes visible
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos < mnFirstPos)
|
|
|
|
SetFirstPageId(nPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// calculate visible width
|
2004-02-03 11:06:06 +00:00
|
|
|
long nWidth = mnLastOffX;
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nWidth > ADDNEWPAGE_AREAWIDTH)
|
2003-03-27 13:40:07 +00:00
|
|
|
nWidth -= ADDNEWPAGE_AREAWIDTH;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (pItem->maRect.IsEmpty())
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplFormat();
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
while ((mbMirrored ? (pItem->maRect.Left() < mnOffX) : (pItem->maRect.Right() > nWidth)) ||
|
|
|
|
pItem->maRect.IsEmpty())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nNewPos = mnFirstPos + 1;
|
2014-01-05 22:22:55 +01:00
|
|
|
// assure at least the actual tabpages are visible as first tabpage
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nNewPos >= nPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
SetFirstPageId(nPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
2015-05-17 12:24:49 +09:00
|
|
|
SetFirstPageId(GetPageId(nNewPos));
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplFormat();
|
2014-01-05 22:22:55 +01:00
|
|
|
// abort if first page is not forwarded
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nNewPos != mnFirstPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// redraw bar
|
2015-05-17 12:24:49 +09:00
|
|
|
if (bUpdate)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
Invalidate(pItem->maRect);
|
|
|
|
if (pOldItem)
|
|
|
|
Invalidate(pOldItem->maRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::MakeVisible(sal_uInt16 nPageId)
|
2001-06-20 08:30:08 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!IsReallyVisible())
|
2001-06-20 08:30:08 +00:00
|
|
|
return;
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2001-06-20 08:30:08 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// do nothing if item does not exist
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2001-06-20 08:30:08 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos < mnFirstPos)
|
|
|
|
SetFirstPageId(nPageId);
|
2001-06-20 08:30:08 +00:00
|
|
|
else
|
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarItem* pItem = mpImpl->mpItemList[nPos];
|
2001-06-20 08:30:08 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// calculate visible area
|
2004-02-03 11:06:06 +00:00
|
|
|
long nWidth = mnLastOffX;
|
2001-06-20 08:30:08 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mbFormat || pItem->maRect.IsEmpty())
|
2001-06-20 08:30:08 +00:00
|
|
|
{
|
2014-03-24 12:47:49 +02:00
|
|
|
mbFormat = true;
|
2001-06-20 08:30:08 +00:00
|
|
|
ImplFormat();
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
while ((pItem->maRect.Right() > nWidth) ||
|
|
|
|
pItem->maRect.IsEmpty())
|
2001-06-20 08:30:08 +00:00
|
|
|
{
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 nNewPos = mnFirstPos+1;
|
2014-01-05 22:22:55 +01:00
|
|
|
// assure at least the actual tabpages are visible as first tabpage
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nNewPos >= nPos)
|
2001-06-20 08:30:08 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
SetFirstPageId(nPageId);
|
2001-06-20 08:30:08 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
2015-05-17 12:24:49 +09:00
|
|
|
SetFirstPageId(GetPageId(nNewPos));
|
2001-06-20 08:30:08 +00:00
|
|
|
ImplFormat();
|
2014-01-05 22:22:55 +01:00
|
|
|
// abort if first page is not forwarded
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nNewPos != mnFirstPos)
|
2001-06-20 08:30:08 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::SetFirstPageId(sal_uInt16 nPageId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-03-24 12:47:49 +02:00
|
|
|
// return false if item does not exist
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != mnFirstPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// assure as much pages are visible as possible
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplFormat();
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 nLastFirstPos = ImplGetLastFirstPos();
|
|
|
|
sal_uInt16 nNewPos;
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos > nLastFirstPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
nNewPos = nLastFirstPos;
|
|
|
|
else
|
|
|
|
nNewPos = nPos;
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nNewPos != mnFirstPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
mnFirstPos = nNewPos;
|
2014-03-24 12:47:49 +02:00
|
|
|
mbFormat = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// redraw bar (attention: check mbDropPos,
|
|
|
|
// as if this flag was set, we do not re-paint immediately
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode() && !mbDropPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::SelectPage(sal_uInt16 nPageId, bool bSelect)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarItem* pItem = mpImpl->mpItemList[nPos];
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (pItem->mbSelect != bSelect)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
pItem->mbSelect = bSelect;
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// redraw bar
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
|
|
|
Invalidate(pItem->maRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 TabBar::GetSelectPageCount() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
sal_uInt16 nSelected = 0;
|
2016-05-10 14:39:07 +02:00
|
|
|
for (ImplTabBarItem* pItem : mpImpl->mpItemList)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
if (pItem->mbSelect)
|
2000-09-18 16:07:07 +00:00
|
|
|
nSelected++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nSelected;
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
bool TabBar::IsPageSelected(sal_uInt16 nPageId) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2015-03-08 18:14:06 +09:00
|
|
|
return mpImpl->mpItemList[nPos]->mbSelect;
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
2014-03-24 12:47:49 +02:00
|
|
|
return false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-11 14:33:01 +09:00
|
|
|
bool TabBar::StartEditMode(sal_uInt16 nPageId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 nPos = GetPagePos( nPageId );
|
2015-03-08 16:54:17 +09:00
|
|
|
if (mpImpl->mpEdit || (nPos == PAGE_NOT_FOUND) || (mnLastOffX < 8))
|
2014-03-24 12:47:49 +02:00
|
|
|
return false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
mnEditId = nPageId;
|
2015-05-11 14:33:01 +09:00
|
|
|
if (StartRenaming())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-11 14:33:01 +09:00
|
|
|
ImplShowPage(nPos);
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplFormat();
|
|
|
|
Update();
|
|
|
|
|
2015-09-21 13:37:17 +01:00
|
|
|
mpImpl->mpEdit.disposeAndReset(VclPtr<TabBarEdit>::Create(this, WB_CENTER));
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aRect = GetPageRect( mnEditId );
|
2014-09-14 19:01:02 +02:00
|
|
|
long nX = aRect.Left();
|
|
|
|
long nWidth = aRect.GetWidth();
|
2015-05-11 14:33:01 +09:00
|
|
|
if (mnEditId != GetCurPageId())
|
2000-09-18 16:07:07 +00:00
|
|
|
nX += 1;
|
2015-05-11 14:33:01 +09:00
|
|
|
if (nX + nWidth > mnLastOffX)
|
2004-02-03 11:06:06 +00:00
|
|
|
nWidth = mnLastOffX-nX;
|
2015-05-11 14:33:01 +09:00
|
|
|
if (nWidth < 3)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
nX = aRect.Left();
|
|
|
|
nWidth = aRect.GetWidth();
|
|
|
|
}
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpEdit->SetText(GetPageText(mnEditId));
|
|
|
|
mpImpl->mpEdit->setPosSizePixel(nX, aRect.Top() + mnOffY + 1, nWidth, aRect.GetHeight() - 3);
|
2015-05-17 22:56:46 +09:00
|
|
|
vcl::Font aFont = GetPointFont(*this); // FIXME RenderContext
|
2015-05-11 14:33:01 +09:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
Color aForegroundColor;
|
|
|
|
Color aBackgroundColor;
|
|
|
|
Color aFaceColor;
|
|
|
|
Color aSelectColor;
|
|
|
|
Color aFaceTextColor;
|
|
|
|
Color aSelectTextColor;
|
2015-05-11 14:33:01 +09:00
|
|
|
|
|
|
|
ImplGetColors(Application::GetSettings().GetStyleSettings(), aFaceColor, aFaceTextColor, aSelectColor, aSelectTextColor);
|
|
|
|
|
|
|
|
if (mnEditId != GetCurPageId())
|
|
|
|
{
|
|
|
|
aFont.SetWeight(WEIGHT_LIGHT);
|
|
|
|
}
|
|
|
|
if (IsPageSelected(mnEditId) || mnEditId == GetCurPageId())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
aForegroundColor = aSelectTextColor;
|
|
|
|
aBackgroundColor = aSelectColor;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aForegroundColor = aFaceTextColor;
|
|
|
|
aBackgroundColor = aFaceColor;
|
|
|
|
}
|
2015-05-11 14:33:01 +09:00
|
|
|
if (GetPageBits( mnEditId ) & TPB_SPECIAL)
|
|
|
|
{
|
|
|
|
aForegroundColor = Color(COL_LIGHTBLUE);
|
|
|
|
}
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpEdit->SetControlFont(aFont);
|
|
|
|
mpImpl->mpEdit->SetControlForeground(aForegroundColor);
|
|
|
|
mpImpl->mpEdit->SetControlBackground(aBackgroundColor);
|
|
|
|
mpImpl->mpEdit->GrabFocus();
|
|
|
|
mpImpl->mpEdit->SetSelection(Selection(0, mpImpl->mpEdit->GetText().getLength()));
|
|
|
|
mpImpl->mpEdit->Show();
|
2014-03-24 12:47:49 +02:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mnEditId = 0;
|
2014-03-24 12:47:49 +02:00
|
|
|
return false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-08 16:54:17 +09:00
|
|
|
bool TabBar::IsInEditMode() const
|
|
|
|
{
|
2015-11-10 10:25:17 +01:00
|
|
|
return mpImpl->mpEdit.get() != nullptr;
|
2015-03-08 16:54:17 +09:00
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::EndEditMode(bool bCancel)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 16:54:17 +09:00
|
|
|
if (mpImpl->mpEdit)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// call hdl
|
2014-03-24 12:47:49 +02:00
|
|
|
bool bEnd = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
mbEditCanceled = bCancel;
|
2015-03-08 16:54:17 +09:00
|
|
|
maEditText = mpImpl->mpEdit->GetText();
|
|
|
|
mpImpl->mpEdit->SetPostEvent();
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!bCancel)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-04-25 12:49:17 +02:00
|
|
|
TabBarAllowRenamingReturnCode nAllowRenaming = AllowRenaming();
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nAllowRenaming == TABBAR_RENAMING_YES)
|
|
|
|
SetPageText(mnEditId, maEditText);
|
|
|
|
else if (nAllowRenaming == TABBAR_RENAMING_NO)
|
2014-03-24 12:47:49 +02:00
|
|
|
bEnd = false;
|
CWS-TOOLING: integrate CWS layoutdialogs2
2009-04-09 10:11:14 +0200 mba r270680 : defective merge sets seem to have brought config_office back
2009-04-02 18:00:52 +0200 mba r270429 : #i100503#: make tralay work without LD_LIBRARY_PATH
2009-04-01 13:27:58 +0200 mba r270320 : warning on Solaris fixed
2009-03-31 22:15:03 +0200 mba r270293 : CWS-TOOLING: rebase CWS layoutdialogs2 to trunk@270033 (milestone: DEV300:m45)
2009-03-16 13:05:08 +0100 mba r269526 : fixed some compiler warnings of the Sun compiler
2009-03-11 15:32:42 +0100 mba r269337 : some problems for ENABLE_LAYOUT fixed
2009-03-09 16:05:32 +0100 mba r269197 : merge conflict solved
2009-03-09 15:09:55 +0100 mba r269194 : merge conflict solved
2009-03-09 15:09:35 +0100 mba r269193 : merge conflict solved
2009-03-06 22:12:47 +0100 mba r269052 : compilation error fixed
2009-03-06 17:36:37 +0100 mba r269033 : integer warning fixed
2009-03-06 10:31:19 +0100 mba r268983 : CWS-TOOLING: rebase CWS layoutdialogs2 to trunk@268395 (milestone: DEV300:m42)
2009-03-03 20:03:59 +0100 jcn r268777 : Add Notes checkbox to find-and-replace dialog in anticipation of m40 resync.
2009-03-03 15:56:20 +0100 jcn r268737 : Apply layout-find-dialog-crash-fix.diff -- fixes crasher.
From http://svn.gnome.org/viewvc/ooo-build?view=revision&revision=15378
2009-02-06 17:41:24 +0100 mba r267479 : arrrrgh - svx headers must be included behind the magic define
2009-02-05 19:44:42 +0100 mba r267439 : seems that msvc preprocessor is thick as a brick
2009-02-05 15:15:16 +0100 mba r267425 : pch added
2009-02-05 08:14:01 +0100 mba r267409 : double defined symbols fixed
2009-02-05 08:13:14 +0100 mba r267408 : compile Languagebox and FontListbox with ENABLE_LAYOUT
2009-02-05 08:07:35 +0100 mba r267406 : warning fixed
2009-02-05 08:06:42 +0100 mba r267405 : warnings and errors fixed
2009-01-30 15:51:52 +0100 mba r267206 : export Container class to compile code in sfx2
2009-01-30 15:51:14 +0100 mba r267205 : remove LAYOUT_EXPERIMENTAL from sfx2, everything now compiles with ENABLE_LAYOUT
2009-01-28 17:01:27 +0100 mba r267069 : fixed namespace problems in sfx2
2009-01-28 16:59:48 +0100 mba r267068 : fixed namespace problems
2009-01-24 13:57:06 +0100 mba r266877 : move svx stuff to experimental
2009-01-24 13:56:11 +0100 mba r266876 : move svx stuff to experimental
2009-01-24 13:52:09 +0100 mba r266875 : put sfx stuff into experimental
2009-01-24 13:28:08 +0100 mba r266874 : put sfx stuff into experimental
2009-01-24 13:26:38 +0100 mba r266873 : help msvc++ compiler a bit
2009-01-24 13:24:43 +0100 mba r266872 : warning removed
2009-01-24 13:23:21 +0100 mba r266871 : moved svx stuff to svx; put sfx stuff into experimental
2009-01-24 13:22:04 +0100 mba r266870 : moved svx stuff to svx
2009-01-05 16:35:34 +0100 jcn r265879 : config_office/configure: Regenerate. Fixes naive builds.
2008-12-17 16:06:25 +0100 jcn r265638 : Wordcount: minor HIG tweaks.
2008-12-17 16:06:21 +0100 jcn r265637 : Zoom: minor HIG spacing tweaks.
2008-12-17 16:06:16 +0100 jcn r265636 : Zoom: fix align-test and update zoom.xml.
2008-12-17 16:06:12 +0100 jcn r265635 : Zoom: add align-test.xml to illustrate zoom alignment bug.
2008-12-17 16:06:07 +0100 jcn r265634 : Find-and-Replace: request font-style-name="Bold", does not seem to work.
2008-12-17 16:06:03 +0100 jcn r265633 : Find-and-Replace: Add alignment for combobox labels.
2008-12-17 16:05:59 +0100 jcn r265632 : Find-and-Replace: Replace pairs of <flow> with <align>. Fixes ugly non-emptiness of more-<hbox>.
2008-12-17 16:05:56 +0100 jcn r265631 : Find-and-Replace: add nice 12pt border.
2008-12-17 16:05:51 +0100 jcn r265630 : Find-and-Replace: also add rowsep at lower fixedline.
2008-12-17 16:05:47 +0100 jcn r265629 : Find-and-Replace: Add poor man's colsep and rowsep substitute spaces.
2008-12-17 16:05:43 +0100 jcn r265628 : Find-and-Replace: use <vbox cnt:x-expand="false"> for buttons.
2008-12-17 16:05:40 +0100 jcn r265627 : Find-and-Replace: add <vbox>s and use cnt:expand="false" to stop vertical button expansion.
2008-12-17 16:05:36 +0100 jcn r265626 : Find-and-Replace: use sc icon. Fixes FIND button height.
2008-12-17 16:05:31 +0100 jcn r265625 : Bugfix have empty/invisible containers not take up space.
2008-12-17 16:05:27 +0100 jcn r265624 : Find-and-replace: Fix/remove most property errors.
2008-12-17 16:05:23 +0100 jcn r265623 : Table: make x, y expand default.
2008-12-17 16:05:18 +0100 jcn r265622 : Use OSL_TRACE rather than printf. Fixes warning visibility.
2008-12-17 16:05:14 +0100 jcn r265621 : Boxtest: add <vbox><table x-expand="true"> pair to trigger property errors.
2008-12-17 16:05:10 +0100 jcn r265620 : Junk extra <table> from boxtest. Fixes visual output.
2008-12-17 16:05:05 +0100 jcn r265619 : Eradicate PROPHELPER_SET_INFO: junk static caching.
2008-12-17 16:05:01 +0100 jcn r265618 : Update awk+sed localize generation rules. Fixes multiple (wrong) titles in Find & Replace.
2008-12-17 16:04:56 +0100 jcn r265617 : Use dash (-) instead of underscore (_) to separate language modifiers. Fixes en_GB etc.
2008-12-17 16:04:51 +0100 jcn r265616 : Add "defbutton=true" to dialogs. Fixes ENTER doing default action: n#439222.
2008-12-17 16:04:45 +0100 jcn r265615 : Michael's new table-based find and replace.
2008-12-17 16:04:40 +0100 jcn r265614 : Apply Michael's boxtest patch.
2008-12-17 16:04:36 +0100 jcn r265613 : Make sort-options experimental. Part II. Fixes crasher n-44.patch. Fixes crasher: n#442036.
2008-12-17 16:04:31 +0100 jcn r265612 : Make sort-options experimental. Part I.
2008-12-17 16:04:26 +0100 jcn r265611 : Add --enable-layout-experimental configure switch. Part II. Typo in configure.in, add set_soenv entry.
2008-12-17 16:04:21 +0100 jcn r265610 : Add --enable-layout-experimental configure switch. Default off.
2008-11-26 16:25:18 +0100 mba r264417 : fixed compiler warnings
2008-11-26 15:52:02 +0100 mba r264407 : fixed compiler warnings
2008-11-26 15:40:44 +0100 mba r264402 : fixed compiler warnings
2008-11-26 14:50:47 +0100 mba r264395 : fixed compiler warnings
2008-11-26 14:39:12 +0100 mba r264393 : fixed compiler warnings
2008-11-26 14:38:49 +0100 mba r264392 : fixed compiler warnings
2008-11-26 14:38:31 +0100 mba r264391 : fixed compiler warnings
2008-11-26 14:38:13 +0100 mba r264390 : fixed compiler warnings
2008-11-26 14:37:38 +0100 mba r264389 : fixed compiler warnings
2008-11-26 10:11:17 +0100 mba r264352 : fixed compiler warnings
2008-11-26 10:06:12 +0100 mba r264351 : fixed compiler warnings
2008-11-26 09:58:28 +0100 mba r264347 : fixed compiler warnings
2008-11-26 09:50:41 +0100 mba r264345 : fixed compiler warnings
2008-11-26 09:46:10 +0100 mba r264343 : fixed compiler warnings
2008-10-22 10:57:09 +0200 mba r262584 : fixed small error resulting from resolved merged conflicts
2008-10-22 10:56:21 +0200 mba r262583 : fixed some small errors resulting from resolved merged conflicts
2008-10-20 19:29:27 +0200 jcn r262557 : layoutdialogs2: Remove stray patches.
2008-10-20 19:29:22 +0200 jcn r262556 : layoutdialogs2: Force resize also on second show after hiding.
2008-10-20 19:29:17 +0200 jcn r262555 : layoutdialogs2: Do not trigger handlers for api calls.
2008-10-20 19:29:13 +0200 jcn r262554 : layoutdialogs2: Use disable/enable instead of hide/show for currency box. Fixes monster lisbox.
2008-10-20 19:29:09 +0200 jcn r262553 : layoutdialogs2: Use line-count instead of linecount. Fixes sizing of listboxes.
2008-10-20 19:29:04 +0200 jcn r262552 : layoutdialogs2: vcl: respect line-count also for non-dropdown listbox.
2008-10-20 19:28:59 +0200 jcn r262551 : layoutdialogs2: Update to svn:r14142 patched.
2008-10-20 19:28:51 +0200 jcn r262550 : layoutdialogs2: Manual tweaks in number-format.xml.
2008-10-20 19:28:45 +0200 jcn r262549 : layoutdialogs2: Integrate Number Format tabpage into Format Cell dialog.
2008-10-20 19:28:36 +0200 jcn r262548 : layoutdialogs2: Windows build fixes. Thanks Noel.
2008-10-20 19:28:31 +0200 jcn r262547 : layoutdialogs2: Layout Format Cells/Number Format tabpage.
2008-10-20 19:28:24 +0200 jcn r262546 : layoutdialogs2: Remove sc/uiconfig/layout/localize.sdf.
2008-10-20 19:28:20 +0200 jcn r262545 : layoutdialogs2: --enable-debug link fix
2008-10-20 19:28:16 +0200 jcn r262544 : layoutdialogs2: Add missing localize.sdf dependency. Thanks, Petr.
2008-10-20 19:28:12 +0200 jcn r262543 : layoutdialogs2: svx linx fixlet.
2008-10-20 19:28:06 +0200 jcn r262542 : layoutdialogs2: Move layout/* to layout/core, vclcompat to layout/vcl. Distribute layout headers. Fixes sfx2 layout core includes.
2008-10-20 19:27:58 +0200 jcn r262541 : layoutdialogs2: Build fix for --enable-layout.
2008-10-20 19:27:54 +0200 jcn r262540 : layoutdialogs2: Generate localize.sdf files in uiconfig.
2008-10-20 19:27:47 +0200 jcn r262539 : layoutdialogs2: Minimalize deprecated String use further by using OUString.
2008-10-20 19:27:42 +0200 jcn r262538 : layoutdialogs2: Implement LocalizedString.GetToken and use it for aCalcBtn. Fixes empty label.
2008-10-20 19:27:36 +0200 jcn r262537 : layoutdialogs2: Add layout::Sfx*Dialog wrapper.
2008-10-20 19:27:29 +0200 jcn r262536 : layoutdialogs2: Introduce Closing*Dialog wrappers fixing closing with ESC.
2008-10-20 19:27:24 +0200 jcn r262535 : layoutdialogs2: Support <sfxmodelessdialog> from sfx2.
2008-10-20 19:27:17 +0200 jcn r262534 : layoutdialogs2: Rename find-&-replace.xml to find-and-replace.xml. Fixes split build with failing solenv patch.
2008-10-20 19:27:12 +0200 jcn r262533 : layoutdialogs2: Do not build sfx2 when --disable-layout.
2008-10-20 19:27:08 +0200 jcn r262532 : layoutdialogs2: Ignore ja/ too.
2008-10-20 19:27:04 +0200 jcn r262531 : layoutdialogs2: Add destructors for VCLXButton, VCLXComboBox.
2008-10-20 19:26:58 +0200 jcn r262530 : layoutdialogs2: Make dialogs closable with ESC: wordcount, zoom, message-box, move-copy-sheet, insert-sheet.
2008-10-20 19:26:52 +0200 jcn r262529 : layoutdialogs2: Move some implementations to .cxx.
2008-10-20 19:26:47 +0200 jcn r262528 : layoutdialogs2: Fix simple editor crasher.
2008-10-20 19:26:43 +0200 jcn r262527 : layoutdialogs2: Further cleanup: remove clean & delete from wrapperGone.
2008-10-20 19:26:38 +0200 jcn r262526 : layoutdialogs2: Add reset logic to ~WindowImpl, plugs ComboBox and Dialog leaks.
2008-10-20 19:26:34 +0200 jcn r262525 : layoutdialogs2: Interesting hack: only leaks ::ComboBox and ::Dialog.
2008-10-20 19:26:29 +0200 jcn r262524 : layoutdialogs2: Build fix.
2008-10-20 19:26:24 +0200 jcn r262523 : layoutdialogs2: Find&Replace duplicate disposal workaround inside layout.
2008-10-20 19:26:19 +0200 jcn r262522 : layoutdialogs2: Revert "Terrible crasher-fix hack. Do not dispose Dialog or any FocusHandler owners."
This reverts commit 5222b5b123a2e6c88494983bd875de574f365bae.
2008-10-20 19:26:14 +0200 jcn r262521 : layoutdialogs2: Terrible crasher-fix hack. Do not dispose Dialog or any FocusHandler owners.
2008-10-20 19:26:08 +0200 jcn r262520 : layoutdialogs2: Revert "ComboBox: crash down to (Dialog's) VCLXWindowImpl::DestroyOutputDevice();"
This reverts commit b423129aca295e84ef5986149b6ee71eb7ba0aa3.
2008-10-20 19:26:03 +0200 jcn r262519 : layoutdialogs2: ComboBox: crash down to (Dialog's) VCLXWindowImpl::DestroyOutputDevice();
2008-10-20 19:25:57 +0200 jcn r262518 : layoutdialogs2: Handler and debug cleanup.
2008-10-20 19:25:52 +0200 jcn r262517 : layoutdialogs2: Minimally remove FixedText workaround.
2008-10-20 19:25:47 +0200 jcn r262516 : layoutdialogs2: Preparations for FocusHdl fix.
2008-10-20 19:25:42 +0200 jcn r262515 : layoutdialogs2: Remove vclxwindows patch by using handler hackery.
2008-10-20 19:25:38 +0200 jcn r262514 : layoutdialogs2: Don't call deleted dialog. Hdler reset tweaks. Fixes Find&Replace.
2008-10-20 19:25:34 +0200 jcn r262513 : layoutdialogs2: Hdler and disposing cleanups.
2008-10-20 19:25:29 +0200 jcn r262512 : layoutdialogs2: Prevent Find&Replace window from being deleted twice.
2008-10-20 19:25:24 +0200 jcn r262511 : layoutdialogs2: Add destructor to SvxSearchDialogWrapper. Fixes second invocation crasher.
2008-10-20 19:25:19 +0200 jcn r262510 : layoutdialogs2: Make Find&Replace work (once) with minimal client code changes.
2008-10-20 19:25:13 +0200 jcn r262509 : layoutdialogs2: Add ComboBox/FixedText debug switching.
2008-10-20 19:25:08 +0200 jcn r262508 : layoutdialogs2: Add destructors resetting handlers.
2008-10-20 19:25:03 +0200 jcn r262507 : layoutdialogs2: Static cast fixes.
2008-10-20 19:24:59 +0200 jcn r262506 : layoutdialogs2: Always set button handler. Fixes pushbuttons.
2008-10-20 19:24:55 +0200 jcn r262505 : layoutdialogs2: Revert "Move FocusHandlers from Control down to ListBox, ComboBox, FixedText."
This reverts commit 8bc4b991539a74373bfb1ef8792276ada8c958e4.
2008-10-20 19:24:50 +0200 jcn r262504 : layoutdialogs2: Disable Timer for ENABLE_LAYOUT.
2008-10-20 19:24:45 +0200 jcn r262503 : layoutdialogs2: Move FocusHandlers from Control down to ListBox, ComboBox, FixedText.
2008-10-20 19:24:40 +0200 jcn r262502 : layoutdialogs2: Wider small symbol.
2008-10-20 19:24:36 +0200 jcn r262501 : layoutdialogs2: Listener and SetHandler cleanup.
2008-10-20 19:24:31 +0200 jcn r262500 : layoutdialogs2: Clear mxWindow upon deletion. Fixes Find&Replace crasher.
2008-10-20 19:24:27 +0200 jcn r262499 : layoutdialogs2: Typo, fixes build.
2008-10-20 19:24:22 +0200 jcn r262498 : layoutdialogs2: Ignore .log files too.
2008-10-20 19:24:19 +0200 jcn r262497 : layoutdialogs2: By default, work around #define protected public Resource hack.
2008-10-20 19:24:15 +0200 jcn r262496 : layoutdialogs2: Sw:Find&Replace: Remove wrong static cast. Fixes crasher.
2008-10-20 19:24:10 +0200 jcn r262495 : layoutdialogs2: Find&Replace: do not vertically expand buttons, add title.
2008-10-20 19:24:06 +0200 jcn r262494 : layoutdialogs2: Find&Replace: Remove need for ResId, set help id.
2008-10-20 19:24:01 +0200 jcn r262493 : layoutdialogs2: MoreButton: redraw upon resize, fix labels, use small symbol.
2008-10-20 19:23:57 +0200 jcn r262492 : layoutdialogs2: Support setting and querying small symbol on vcl:button.
2008-10-20 19:23:52 +0200 jcn r262491 : layoutdialogs2: Support redrawing of only this, make parent optional.
2008-10-20 19:23:48 +0200 jcn r262490 : layoutdialogs2: Add Kohei's wfield patch https://bugzilla.novell.com/attachment.cgi?id=235398. Fixes n#417840.
2008-10-20 19:23:44 +0200 jcn r262489 : layoutdialogs2: Redraw [parent] upon first time visibility.
Fixes weird listbox dropdown sizing in Find & Replace.
2008-10-20 19:23:39 +0200 jcn r262488 : layoutdialogs2: Add manual layouting for Find & Replace.
2008-10-20 19:23:35 +0200 jcn r262487 : layoutdialogs2: src2xml: use label instead of text for buttons.
Run on Find & Replace; fixes button texts.
2008-10-20 19:23:31 +0200 jcn r262486 : layoutdialogs2: Add initial auto-translated find-&-replace-.xml.
2008-10-20 19:23:26 +0200 jcn r262485 : layoutdialogs2: layout importer: handle ModelessDialog.
Fixes Find & Replace parsing error.
2008-10-20 19:23:22 +0200 jcn r262484 : layoutdialogs2: src2xml: Handle multiple widgets at same x,y.
Fixes silent removal of widgets in Find & Replace dialog.
2008-10-20 19:23:18 +0200 jcn r262483 : layoutdialogs2: src2xml: Handle hide= attribute, translate to show=.
2008-10-20 19:23:14 +0200 jcn r262482 : layoutdialogs2: Only use __PRETTY_FUNCTION__ on gcc. Fixes Windows build. Thanks Tor!
2008-10-20 19:23:10 +0200 jcn r262481 : layoutdialogs2: Add two missing SAL_CALL decorations. Fixes Windows build. Thanks Tor!
2008-10-20 19:23:05 +0200 jcn r262480 : layoutdialogs2: Build fixes for layout'ed Find & Replace dialog.
2008-10-20 19:22:54 +0200 jcn r262479 : layoutdialogs2: Do not use layout::SfxTabDialog for now.
2008-10-20 19:22:47 +0200 jcn r262478 : layoutdialogs2: Crufty sizing tweaks.
2008-10-20 19:22:42 +0200 jcn r262477 : layoutdialogs2: More debugging cleanups.
2008-10-20 19:22:37 +0200 jcn r262476 : layoutdialogs2: More cleanups that result in constant manual resizing...
2008-10-20 19:22:33 +0200 jcn r262475 : layoutdialogs2: Tabdlg cleanups.
2008-10-20 19:22:28 +0200 jcn r262474 : layoutdialogs2: Add GetOptimalSize () to InPlug. Fixes auto-sizing of tabcontrol.
2008-10-20 19:22:21 +0200 jcn r262473 : layoutdialogs2: Get VCLXTabControl to resize automatically (too tall), not mousable.
2008-10-20 19:22:13 +0200 jcn r262472 : layoutdialogs2: Respect show=false property; do not show everything.
2008-10-20 19:22:09 +0200 jcn r262471 : layoutdialogs2: Add show=false on buttons. Fixes displaying everything.
2008-10-20 19:22:05 +0200 jcn r262470 : layoutdialogs2: Move some code to reduce namespace and #if hacking.
2008-10-20 19:22:00 +0200 jcn r262469 : layoutdialogs2: Cleanup, remove unneeded #defines.
2008-10-20 19:21:56 +0200 jcn r262468 : layoutdialogs2: Replace static casts with dynamic_cast, fixes layout::SfxTabDialog.
Explicitly add 2 tabpages while adding tabpages, instead of relying on ResId.
2008-10-20 19:21:51 +0200 jcn r262467 : layoutdialogs2: Use cpp hacking to remove layout-tabdialog.hxx duplication.
2008-10-20 19:21:45 +0200 jcn r262466 : layoutdialogs2: Minimize diff between layout-tabdialog.hxx and tabdlg.hxx.
2008-10-20 19:21:41 +0200 jcn r262465 : layoutdialogs2: Remove copy of SfxTabDialog; use cpp logic to create both flavours.
2008-10-20 19:21:36 +0200 jcn r262464 : layoutdialogs2: Minimize diff between layout/sfxtabdialog.cxx and source/tabdlg.cxx.
This enables the next step: use cpp logic instead of code duplication.
2008-10-20 19:21:31 +0200 jcn r262463 : layoutdialogs2: Hello world on layout::SfxTabDialog.
2008-10-20 19:21:24 +0200 jcn r262462 : layoutdialogs2: Nice `Compiling:' message that shows the file being compiled.
2008-10-20 19:21:20 +0200 jcn r262461 : layoutdialogs2: Use layout::SfxTabDialog for sort options.
2008-10-20 19:21:15 +0200 jcn r262460 : layoutdialogs2: Update sort options tab.
2008-10-20 19:21:10 +0200 jcn r262459 : layoutdialogs2: Add layout::SfxTabDialog.
2008-10-20 19:21:04 +0200 jcn r262458 : layoutdialogs2: Cleanup previous attempt using layout::SfxTabPage == layout::TabPage.
2008-10-20 19:20:57 +0200 jcn r262457 : layoutdialogs2: Windows 2003 compile fixes, i#92397.
2008-10-20 19:20:52 +0200 jcn r262456 : layoutdialogs2: Set default radiogroup when none provided.
2008-10-20 19:20:48 +0200 jcn r262455 : layoutdialogs2: Add radiogroup to sort-options. Fixes crasher.
2008-10-20 19:20:43 +0200 jcn r262454 : layoutdialogs2: Cleanup ParentSet fix.
2008-10-20 19:20:36 +0200 jcn r262453 : layoutdialogs2: Add debugging in ParentSet. Works standalone, not integrated.
2008-10-20 19:20:31 +0200 jcn r262452 : layoutdialogs2: Revert "Have InPlug not derive from Window, but have as member."
This reverts commit 50ea26eec3fe14943f24900081ad923e72550345.
2008-10-20 19:20:25 +0200 jcn r262451 : layoutdialogs2: Have InPlug not derive from Window, but have as member.
2008-10-20 19:20:20 +0200 jcn r262450 : layoutdialogs2: Move layout plugin implementation from layout::SfxTabPage to InPlug.
2008-10-20 19:20:14 +0200 jcn r262449 : layoutdialogs2: Get all widgets to display in sfxtabpage plugin with Window::SetParent hack.
2008-10-20 19:20:09 +0200 jcn r262448 : layoutdialogs2: Two-button manual hello world with sfxtabpage plugin.
2008-10-20 19:20:03 +0200 jcn r262447 : layoutdialogs2: WIP: layout::SfxTabPage derived from SfxTabPage.
2008-10-20 19:19:55 +0200 jcn r262446 : layoutdialogs2: Always set parent after construction, fixes listbox dropdown.
2008-10-20 19:19:51 +0200 jcn r262445 : layoutdialogs2: Fix radio button crasher.
2008-10-20 19:19:47 +0200 jcn r262444 : layoutdialogs2: Implement ListBox method wrappers. Fixes filling of listbox.
2008-10-20 19:19:42 +0200 jcn r262443 : layoutdialogs2: Convert Move/Copy sheet to layout engine.
2008-10-20 19:19:35 +0200 jcn r262442 : layoutdialogs2: Also hide yes/no buttons if not used.
2008-10-20 19:19:31 +0200 jcn r262441 : layoutdialogs2: Elaborate on changing client code.
2008-10-20 19:19:26 +0200 jcn r262440 : layoutdialogs2: Implement winbits client-code compatibility for Message Boxes.
2008-10-20 19:19:21 +0200 jcn r262439 : layoutdialogs2: Add localize.sdf to toolkit uiconfig. Fixes build.
2008-10-20 19:19:17 +0200 jcn r262438 : layoutdialogs2: Do not use ti_layout twice in toolkit build.lst. Fixes build.
2008-10-20 19:19:13 +0200 jcn r262437 : layoutdialogs2: Oops, also dist toolkit-layout.zip.
2008-10-20 19:19:09 +0200 jcn r262436 : layoutdialogs2: Move layout.mk to solenv.
2008-10-20 19:19:03 +0200 jcn r262435 : layoutdialogs2: Add handy TEST file.
2008-10-20 19:18:58 +0200 jcn r262434 : layoutdialogs2: Implement MessageBox and wrappers ErrorBox, InfoBox, QueryBox, WarningBox.
2008-10-20 19:18:52 +0200 jcn r262433 : layoutdialogs2: QueryBox without image used for Delete Sheet dialog.
2008-10-20 19:18:46 +0200 jcn r262432 : layoutdialogs2: WIP QueryBox.
2008-10-20 19:18:39 +0200 jcn r262431 : layoutdialogs2: Add insert-sheet localization.
2008-10-20 19:18:34 +0200 jcn r262430 : layoutdialogs2: Run indent-region on zoom.xml, distribute it.
2008-10-20 19:18:30 +0200 jcn r262429 : layoutdialogs2: Dist xml files too.
2008-10-20 19:18:26 +0200 jcn r262428 : layoutdialogs2: Add insert-sheet.xml to workben.
2008-10-20 19:18:22 +0200 jcn r262427 : layoutdialogs2: Update layout TODO.
2008-10-20 19:18:18 +0200 jcn r262426 : layoutdialogs2: Cleanups and add comments.
2008-10-20 19:18:13 +0200 jcn r262425 : layoutdialogs2: Keep RadioButtons::RadioButton callback at HEAD of list.
Fixes radiobutton grouping.
2008-10-20 19:18:07 +0200 jcn r262424 : layoutdialogs2: Remove IMPORT_RADIOGROUP cruft.
2008-10-20 19:18:02 +0200 jcn r262423 : layoutdialogs2: Have code check fire event for radio button.
Fixes radio button grouping.
2008-10-20 19:17:58 +0200 jcn r262422 : layoutdialogs2: Enable IMPORT_RADIOGROUP flag.
2008-10-20 19:17:54 +0200 jcn r262421 : layoutdialogs2: Add radio groups to zoom.xml.
2008-10-20 19:17:50 +0200 jcn r262420 : layoutdialogs2: Move RadioGroup implementation to cxx file.
2008-10-20 19:17:45 +0200 jcn r262419 : layoutdialogs2: Manually set help id for insert table.
2008-10-20 19:17:41 +0200 jcn r262418 : layoutdialogs2: Cosmetic fixes for insert-sheet.
2008-10-20 19:17:37 +0200 jcn r262417 : layoutdialogs2: FindAndRemove now also skips translation prefix.
Fixes setting of title etc. from nontranslated xml.
2008-10-20 19:17:32 +0200 jcn r262416 : layoutdialogs2: Manually set help id for zoom and wordcount dialogs.
2008-10-20 19:17:27 +0200 jcn r262415 : layoutdialogs2: Set help-id from xml.
2008-10-20 19:17:21 +0200 jcn r262414 : layoutdialogs2: Move -DENABLE_LAYOUT from stray makefiles to settings.mk.
2008-10-20 19:17:13 +0200 jcn r262413 : layoutdialogs2: Initial conversion of insert-sheet dialog.
2008-10-20 19:17:08 +0200 jcn r262412 : layoutdialogs2: Add wrappers for {Get,Set}{Pointer,Text}.
2008-10-20 19:17:04 +0200 jcn r262411 : layoutdialogs2: Toolkit layout dialog copy updates.
2008-10-20 19:16:59 +0200 jcn r262410 : layoutdialogs2: Cleanup #include <layout*> disaster.
Fixes multiple inclusions of layout-pre, layout-post.
2008-10-20 19:16:53 +0200 jcn r262409 : layoutdialogs2: Implement Get,Set{,Smart}HelpId ().
2008-10-20 19:16:49 +0200 jcn r262408 : layoutdialogs2: Make some getters const.
2008-10-20 19:16:45 +0200 jcn r262407 : layoutdialogs2: Manual tweaks for string-input.xml.
2008-10-20 19:16:40 +0200 jcn r262406 : layoutdialogs2: Add string-input.xml.
2008-10-20 19:16:36 +0200 jcn r262405 : layoutdialogs2: Add dummy implementation for SetHelpId etc.
2008-10-20 19:16:32 +0200 jcn r262404 : layoutdialogs2: Actually say *what* file cannot be copied *where*. Sigh.
2008-10-20 19:16:27 +0200 jcn r262403 : layoutdialogs2: Thinko in macro name. Fixes compilation of strindlg.cxx.
2008-10-20 19:16:22 +0200 jcn r262402 : layoutdialogs2: Add layout includes to stringdlg and makefile.
2008-10-20 19:16:17 +0200 jcn r262401 : layoutdialogs2: Add sc/uiconfig/layout/localize.sdf
2008-10-20 19:16:13 +0200 jcn r262400 : layoutdialogs2: Oops, build sc/uiconfig/layout.
2008-10-20 19:16:09 +0200 jcn r262399 : layoutdialogs2: Have virtual destructor on Context, delete TabPage when deleting TabDialog.
2008-10-20 19:16:04 +0200 jcn r262398 : layoutdialogs2: Actually delete layout::TabPage objects when deleting SfxTabdialog.
2008-10-20 19:16:00 +0200 jcn r262397 : layoutdialogs2: Workaround for second invocation crash of sort dialog options tab.
2008-10-20 19:15:56 +0200 jcn r262396 : layoutdialogs2: Handle Reset button.
2008-10-20 19:15:51 +0200 jcn r262395 : layoutdialogs2: Also install sc xml zip file.
2008-10-20 19:15:46 +0200 jcn r262394 : layoutdialogs2: Integrate sort-options into sc.
2008-10-20 19:15:41 +0200 jcn r262393 : layoutdialogs2: Revert "Fix sfx2 compile warnings."
This reverts commit 8b55d402af7bd217db35f67b02dc92f93f3ada5d.
2008-10-20 19:15:34 +0200 jcn r262392 : layoutdialogs2: Remove debuging.
2008-10-20 19:15:30 +0200 jcn r262391 : layoutdialogs2: Pass set argument to layout::TabPage. Fixes OO.o integration crasher.
2008-10-20 19:15:24 +0200 jcn r262390 : layoutdialogs2: Ignore more.
2008-10-20 19:15:20 +0200 jcn r262389 : layoutdialogs2: Oops, make just one (1) sort-options tab.
2008-10-20 19:15:15 +0200 jcn r262388 : layoutdialogs2: Revert macroconf compile warnings.
2008-10-20 19:15:09 +0200 jcn r262387 : layoutdialogs2: Fix sfx2 compile warnings.
2008-10-20 19:15:01 +0200 jcn r262386 : layoutdialogs2: Collapsed tabpage and sort-options development.
2008-10-20 19:14:51 +0200 jcn r262385 : layoutdialogs2: Make dev300/src680 install layout switchable at compile time.
2008-10-20 19:14:47 +0200 jcn r262384 : layoutdialogs2: Update README, add README.
2008-10-20 19:14:43 +0200 jcn r262383 : layoutdialogs2: Repainting, hiding stuff.
2008-10-20 19:14:38 +0200 jcn r262382 : layoutdialogs2: Add allocateArea to VCLXTabPage.
2008-10-20 19:14:34 +0200 jcn r262381 : layoutdialogs2: Revert "Use VCLXContainer as base for VCLXTabPage."
This reverts commit 06a984434d0d2c356fd0cdaf96d6d613d5147b7c.
2008-10-20 19:14:30 +0200 jcn r262380 : layoutdialogs2: Use VCLXContainer as base for VCLXTabPage.
2008-10-20 19:14:26 +0200 jcn r262379 : layoutdialogs2: Revert "Derive VCLXTabPage from VBox."
This reverts commit 8ab66364bdc08151ce2c982c1aa03f7881d86b84.
2008-10-20 19:14:22 +0200 jcn r262378 : layoutdialogs2: Derive VCLXTabPage from VBox.
2008-10-20 19:14:17 +0200 jcn r262377 : layoutdialogs2: More cleanups and testing.
2008-10-20 19:14:12 +0200 jcn r262376 : layoutdialogs2: Get layout tabpage to nicely select. No content visible, though.
2008-10-20 19:14:07 +0200 jcn r262375 : layoutdialogs2: Support ScTabPageSortOptions in standalone test.
2008-10-20 19:14:02 +0200 jcn r262374 : layoutdialogs2: Support tabpage creation from xml.
2008-10-20 19:13:56 +0200 jcn r262373 : layoutdialogs2: Remove most TEST_LAYOUT conditionals.
2008-10-20 19:13:52 +0200 jcn r262372 : layoutdialogs2: Remove Args effort.
2008-10-20 19:13:48 +0200 jcn r262371 : layoutdialogs2: Attempt to create ArgSet.
2008-10-20 19:13:44 +0200 jcn r262370 : layoutdialogs2: Compile more.
2008-10-20 19:13:39 +0200 jcn r262369 : layoutdialogs2: Add sortdlg.
2008-10-20 19:13:35 +0200 jcn r262368 : layoutdialogs2: Oops, ID fix.
2008-10-20 19:13:30 +0200 jcn r262367 : layoutdialogs2: Build fix.
2008-10-20 19:13:26 +0200 jcn r262366 : layoutdialogs2: Revert "Use ::Window for plugin base iso ::Control."
This reverts commit 919ddaf2f52ad5e4df877a094cd1e336888d6210.
2008-10-20 19:13:21 +0200 jcn r262365 : layoutdialogs2: Plugin dialog cleanups.
2008-10-20 19:13:17 +0200 jcn r262364 : layoutdialogs2: Use ::Window for plugin base iso ::Control.
2008-10-20 19:13:12 +0200 jcn r262363 : layoutdialogs2: Use cstdio, remove cruft.
2008-10-20 19:13:07 +0200 jcn r262362 : layoutdialogs2: Remove cruft.
2008-10-20 19:13:02 +0200 jcn r262361 : layoutdialogs2: Remove sizing mess.
2008-10-20 19:12:57 +0200 jcn r262360 : layoutdialogs2: Trigger [re]draw of DialControl.
2008-10-20 19:12:53 +0200 jcn r262359 : layoutdialogs2: DialControl window behaves nicely and invisible.
2008-10-20 19:12:48 +0200 jcn r262358 : layoutdialogs2: Revert adding of setparent.
2008-10-20 19:12:43 +0200 jcn r262357 : layoutdialogs2: Add dialog::setparent to plugin.
2008-10-20 19:12:39 +0200 jcn r262356 : layoutdialogs2: Add a setProperty for VCLXPlugin.
2008-10-20 19:12:34 +0200 jcn r262355 : layoutdialogs2: Unhide plugin.
2008-10-20 19:12:30 +0200 jcn r262354 : layoutdialogs2: Revert.
2008-10-20 19:12:25 +0200 jcn r262353 : layoutdialogs2: Use window instead of control.
2008-10-20 19:12:20 +0200 jcn r262352 : layoutdialogs2: Lots of plugin settings.
2008-10-20 19:12:16 +0200 jcn r262351 : layoutdialogs2: More hacks.
2008-10-20 19:12:11 +0200 jcn r262350 : layoutdialogs2: Compile fixes.
2008-10-20 19:12:05 +0200 jcn r262349 : layoutdialogs2: Use c++ includes.
2008-10-20 19:12:00 +0200 jcn r262348 : layoutdialogs2: Junk UnoTunnel nonsense.
2008-10-20 19:11:55 +0200 jcn r262347 : layoutdialogs2: Remove more cruft.
2008-10-20 19:11:50 +0200 jcn r262346 : layoutdialogs2: Remove cruft.
2008-10-20 19:11:44 +0200 jcn r262345 : layoutdialogs2: Rename wrap to plugin.
2008-10-20 19:11:39 +0200 jcn r262344 : layoutdialogs2: All sorry tries.
2008-10-20 19:11:33 +0200 jcn r262343 : layoutdialogs2: Rename plugin to wrap.
2008-10-20 19:11:28 +0200 jcn r262342 : layoutdialogs2: Add ifdefs, no UNOTUNNEL, no crash on exit.
2008-10-20 19:11:23 +0200 jcn r262341 : layoutdialogs2: Redo all kind of Uno and XIface weirdness.
2008-10-20 19:11:17 +0200 jcn r262340 : layoutdialogs2: Remove extra UnoTunnel.
2008-10-20 19:11:12 +0200 jcn r262339 : layoutdialogs2: Plugin hello world. TODO: parenting/owning/sizing, ... etc.
2008-10-20 19:11:06 +0200 jcn r262338 : layoutdialogs2: Zoom updates.
2008-10-20 19:11:01 +0200 jcn r262337 : layoutdialogs2: Add missing controls.
2008-10-20 19:10:56 +0200 jcn r262336 : layoutdialogs2: Add .gitignore.
2009-04-21 16:06:18 +00:00
|
|
|
else // nAllowRenaming == TABBAR_RENAMING_CANCEL
|
2014-03-24 12:47:49 +02:00
|
|
|
mbEditCanceled = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// renaming not allowed, than reset edit data
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!bEnd)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 16:54:17 +09:00
|
|
|
mpImpl->mpEdit->ResetPostEvent();
|
|
|
|
mpImpl->mpEdit->GrabFocus();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// close edit and call end hdl
|
2015-03-09 14:29:30 +02:00
|
|
|
mpImpl->mpEdit.disposeAndClear();
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
EndRenaming();
|
|
|
|
mnEditId = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// reset
|
2014-11-12 14:24:10 +05:30
|
|
|
maEditText.clear();
|
2013-03-12 10:41:57 +00:00
|
|
|
mbEditCanceled = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-14 12:05:03 +01:00
|
|
|
void TabBar::SetMirrored(bool bMirrored)
|
2004-02-03 11:06:06 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mbMirrored != bMirrored)
|
2004-02-03 11:06:06 +00:00
|
|
|
{
|
|
|
|
mbMirrored = bMirrored;
|
2012-05-14 12:05:03 +01:00
|
|
|
mbSizeFormat = true;
|
2004-02-03 11:06:06 +00:00
|
|
|
ImplInitControls(); // for button images
|
2004-08-02 16:56:34 +00:00
|
|
|
Resize(); // recalculates control positions
|
2004-02-03 11:06:06 +00:00
|
|
|
Mirror();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::SetEffectiveRTL(bool bRTL)
|
2009-03-02 14:19:13 +00:00
|
|
|
{
|
2015-04-01 16:23:59 +02:00
|
|
|
SetMirrored( bRTL != AllSettings::GetLayoutRTL() );
|
2009-03-02 14:19:13 +00:00
|
|
|
}
|
|
|
|
|
2012-05-14 12:05:03 +01:00
|
|
|
bool TabBar::IsEffectiveRTL() const
|
2009-03-02 14:19:13 +00:00
|
|
|
{
|
2015-04-01 16:23:59 +02:00
|
|
|
return IsMirrored() != AllSettings::GetLayoutRTL();
|
2009-03-02 14:19:13 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::SetMaxPageWidth(long nMaxWidth)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnMaxPageWidth != nMaxWidth)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
mnMaxPageWidth = nMaxWidth;
|
2014-03-24 12:47:49 +02:00
|
|
|
mbSizeFormat = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// redraw bar
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::SetPageText(sal_uInt16 nPageId, const OUString& rText)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
mpImpl->mpItemList[nPos]->maText = rText;
|
2014-03-24 12:47:49 +02:00
|
|
|
mbSizeFormat = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// redraw bar
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
2000-09-18 16:07:07 +00:00
|
|
|
Invalidate();
|
2002-09-02 15:17:34 +00:00
|
|
|
|
2016-12-06 13:26:09 +02:00
|
|
|
CallEventListeners(VclEventId::TabbarPageTextChanged, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(nPageId)));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
OUString TabBar::GetPageText(sal_uInt16 nPageId) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2015-03-08 18:14:06 +09:00
|
|
|
return mpImpl->mpItemList[nPos]->maText;
|
2012-09-10 23:42:29 +01:00
|
|
|
return OUString();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
OUString TabBar::GetHelpText(sal_uInt16 nPageId) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
ImplTabBarItem* pItem = mpImpl->mpItemList[nPos];
|
2012-09-10 23:42:29 +01:00
|
|
|
if (pItem->maHelpText.isEmpty() && !pItem->maHelpId.isEmpty())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
Help* pHelp = Application::GetHelp();
|
2015-05-17 12:24:49 +09:00
|
|
|
if (pHelp)
|
|
|
|
pItem->maHelpText = pHelp->GetHelpText(OStringToOUString(pItem->maHelpId, RTL_TEXTENCODING_UTF8), this);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return pItem->maHelpText;
|
|
|
|
}
|
2012-09-10 23:42:29 +01:00
|
|
|
return OUString();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
OString TabBar::GetHelpId(sal_uInt16 nPageId) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nPos = GetPagePos(nPageId);
|
2013-04-07 12:06:47 +02:00
|
|
|
OString aRet;
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nPos != PAGE_NOT_FOUND)
|
2015-03-08 18:14:06 +09:00
|
|
|
return mpImpl->mpItemList[nPos]->maHelpId;
|
2010-06-04 13:46:22 +02:00
|
|
|
return aRet;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
bool TabBar::StartDrag(const CommandEvent& rCEvt, vcl::Region& rRegion)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!(mnWinStyle & WB_DRAG) || (rCEvt.GetCommand() != CommandEventId::StartDrag))
|
2014-03-24 12:47:49 +02:00
|
|
|
return false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// Check if the clicked page was selected. If this is not the case
|
|
|
|
// set it as actual entry. We check for this only at a mouse action
|
|
|
|
// if Drag and Drop can be triggered from the keyboard.
|
|
|
|
// We only do this, if Select() was not triggered, as the Select()
|
|
|
|
// could have scrolled the area
|
2015-05-17 12:24:49 +09:00
|
|
|
if (rCEvt.IsMouseEvent() && !mbInSelect)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nSelId = GetPageId(rCEvt.GetMousePosPixel());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// do not start dragging if no entry was clicked
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!nSelId)
|
2014-03-24 12:47:49 +02:00
|
|
|
return false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// check if page was selected. If not set it as actual
|
|
|
|
// page and call Select()
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!IsPageSelected(nSelId))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (ImplDeactivatePage())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
SetCurPageId(nSelId);
|
2000-09-18 16:07:07 +00:00
|
|
|
Update();
|
2002-09-02 15:17:34 +00:00
|
|
|
ImplActivatePage();
|
|
|
|
ImplSelect();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
2014-03-24 12:47:49 +02:00
|
|
|
return false;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2014-03-24 12:47:49 +02:00
|
|
|
mbInSelect = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-09-27 14:52:40 +02:00
|
|
|
vcl::Region aRegion;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// assign region
|
2000-09-18 16:07:07 +00:00
|
|
|
rRegion = aRegion;
|
|
|
|
|
2014-03-24 12:47:49 +02:00
|
|
|
return true;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 TabBar::ShowDropPos(const Point& rPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
ImplTabBarItem* pItem;
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nDropId;
|
|
|
|
sal_uInt16 nNewDropPos;
|
|
|
|
sal_uInt16 nItemCount = mpImpl->getItemSize();
|
|
|
|
sal_Int16 nScroll = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (rPos.X() > mnLastOffX-TABBAR_DRAG_SCROLLOFF)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
pItem = mpImpl->mpItemList[mpImpl->mpItemList.size() - 1];
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!pItem->maRect.IsEmpty() && (rPos.X() > pItem->maRect.Right()))
|
2015-03-08 18:14:06 +09:00
|
|
|
nNewDropPos = mpImpl->getItemSize();
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
nNewDropPos = mnFirstPos + 1;
|
2000-09-18 16:07:07 +00:00
|
|
|
nScroll = 1;
|
|
|
|
}
|
|
|
|
}
|
2015-05-17 12:24:49 +09:00
|
|
|
else if ((rPos.X() <= mnOffX) ||
|
|
|
|
(!mnOffX && (rPos.X() <= TABBAR_DRAG_SCROLLOFF)))
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnFirstPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
nNewDropPos = mnFirstPos;
|
|
|
|
nScroll = -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
nNewDropPos = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
nDropId = GetPageId(rPos);
|
|
|
|
if (nDropId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
nNewDropPos = GetPagePos(nDropId);
|
|
|
|
if (mnFirstPos && (nNewDropPos == mnFirstPos - 1))
|
2000-09-18 16:07:07 +00:00
|
|
|
nScroll = -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
nNewDropPos = nItemCount;
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mbDropPos && (nNewDropPos == mnDropPos) && !nScroll)
|
2000-09-18 16:07:07 +00:00
|
|
|
return mnDropPos;
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mbDropPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
HideDropPos();
|
2014-03-24 12:47:49 +02:00
|
|
|
mbDropPos = true;
|
2000-09-18 16:07:07 +00:00
|
|
|
mnDropPos = nNewDropPos;
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nScroll)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-11-05 10:31:15 +08:00
|
|
|
sal_uInt16 nOldFirstPos = mnFirstPos;
|
2015-05-17 12:24:49 +09:00
|
|
|
SetFirstPageId(GetPageId(mnFirstPos + nScroll));
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// draw immediately, as Paint not possible during Drag and Drop
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nOldFirstPos != mnFirstPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aRect(mnOffX, 0, mnLastOffX, maWinSize.Height());
|
2015-05-17 12:24:49 +09:00
|
|
|
SetFillColor(GetBackground().GetColor());
|
|
|
|
DrawRect(aRect);
|
2015-04-28 12:53:27 +09:00
|
|
|
Invalidate(aRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-05 22:22:55 +01:00
|
|
|
// draw drop position arrows
|
2015-05-17 12:24:49 +09:00
|
|
|
Color aBlackColor(COL_BLACK);
|
|
|
|
long nX;
|
|
|
|
long nY = (maWinSize.Height() / 2) - 1;
|
|
|
|
sal_uInt16 nCurPos = GetPagePos(mnCurPageId);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-12-28 23:52:39 +09:00
|
|
|
sal_Int32 nTriangleWidth = 3 * GetDPIScaleFactor();
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnDropPos < nItemCount)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-12-28 23:52:39 +09:00
|
|
|
SetLineColor(aBlackColor);
|
|
|
|
SetFillColor(aBlackColor);
|
|
|
|
|
2015-03-08 18:14:06 +09:00
|
|
|
pItem = mpImpl->mpItemList[mnDropPos];
|
2014-09-14 19:01:02 +02:00
|
|
|
nX = pItem->maRect.Left();
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( mnDropPos == nCurPos )
|
|
|
|
nX--;
|
|
|
|
else
|
|
|
|
nX++;
|
2015-05-17 12:24:49 +09:00
|
|
|
|
|
|
|
if (!pItem->IsDefaultTabBgColor() && !pItem->mbSelect)
|
2014-12-28 23:52:39 +09:00
|
|
|
{
|
|
|
|
SetLineColor(pItem->maTabTextColor);
|
|
|
|
SetFillColor(pItem->maTabTextColor);
|
|
|
|
}
|
|
|
|
|
2015-08-16 16:45:12 -05:00
|
|
|
tools::Polygon aPoly(3);
|
2014-12-28 23:52:39 +09:00
|
|
|
aPoly.SetPoint(Point(nX, nY), 0);
|
|
|
|
aPoly.SetPoint(Point(nX + nTriangleWidth, nY - nTriangleWidth), 1);
|
|
|
|
aPoly.SetPoint(Point(nX + nTriangleWidth, nY + nTriangleWidth), 2);
|
|
|
|
DrawPolygon(aPoly);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnDropPos > 0 && mnDropPos < nItemCount + 1)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2014-12-28 23:52:39 +09:00
|
|
|
SetLineColor(aBlackColor);
|
|
|
|
SetFillColor(aBlackColor);
|
|
|
|
|
2015-03-08 18:14:06 +09:00
|
|
|
pItem = mpImpl->mpItemList[mnDropPos - 1];
|
2014-09-14 19:01:02 +02:00
|
|
|
nX = pItem->maRect.Right();
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnDropPos == nCurPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
nX++;
|
2015-05-17 12:24:49 +09:00
|
|
|
if (!pItem->IsDefaultTabBgColor() && !pItem->mbSelect)
|
2014-12-28 23:52:39 +09:00
|
|
|
{
|
|
|
|
SetLineColor(pItem->maTabTextColor);
|
|
|
|
SetFillColor(pItem->maTabTextColor);
|
|
|
|
}
|
2015-08-16 16:45:12 -05:00
|
|
|
tools::Polygon aPoly(3);
|
2015-05-17 12:24:49 +09:00
|
|
|
aPoly.SetPoint(Point(nX, nY), 0);
|
2014-12-28 23:52:39 +09:00
|
|
|
aPoly.SetPoint(Point(nX - nTriangleWidth, nY - nTriangleWidth), 1);
|
|
|
|
aPoly.SetPoint(Point(nX - nTriangleWidth, nY + nTriangleWidth), 2);
|
|
|
|
DrawPolygon(aPoly);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return mnDropPos;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::HideDropPos()
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mbDropPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
ImplTabBarItem* pItem;
|
2015-05-17 12:24:49 +09:00
|
|
|
long nX;
|
|
|
|
long nY1 = (maWinSize.Height() / 2) - 3;
|
|
|
|
long nY2 = nY1 + 5;
|
2015-03-08 18:14:06 +09:00
|
|
|
sal_uInt16 nItemCount = mpImpl->getItemSize();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnDropPos < nItemCount)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
pItem = mpImpl->mpItemList[mnDropPos];
|
2014-09-14 19:01:02 +02:00
|
|
|
nX = pItem->maRect.Left();
|
2014-01-05 22:22:55 +01:00
|
|
|
// immediately call Paint, as it is not possible during drag and drop
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aRect( nX-1, nY1, nX+3, nY2 );
|
2014-09-27 14:52:40 +02:00
|
|
|
vcl::Region aRegion( aRect );
|
2000-09-18 16:07:07 +00:00
|
|
|
SetClipRegion( aRegion );
|
2015-04-28 12:53:27 +09:00
|
|
|
Invalidate(aRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
SetClipRegion();
|
|
|
|
}
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnDropPos > 0 && mnDropPos < nItemCount + 1)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-08 18:14:06 +09:00
|
|
|
pItem = mpImpl->mpItemList[mnDropPos - 1];
|
2014-09-14 19:01:02 +02:00
|
|
|
nX = pItem->maRect.Right();
|
2014-01-05 22:22:55 +01:00
|
|
|
// immediately call Paint, as it is not possible during drag and drop
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle aRect(nX - 2, nY1, nX + 1, nY2);
|
2015-05-17 12:24:49 +09:00
|
|
|
vcl::Region aRegion(aRect);
|
|
|
|
SetClipRegion(aRegion);
|
2015-04-28 12:53:27 +09:00
|
|
|
Invalidate(aRect);
|
2000-09-18 16:07:07 +00:00
|
|
|
SetClipRegion();
|
|
|
|
}
|
|
|
|
|
2014-03-24 12:47:49 +02:00
|
|
|
mbDropPos = false;
|
2000-09-18 16:07:07 +00:00
|
|
|
mnDropPos = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-13 09:58:40 +02:00
|
|
|
void TabBar::SwitchPage(const Point& rPos)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
sal_uInt16 nSwitchId = GetPageId(rPos);
|
|
|
|
if (!nSwitchId)
|
2000-09-18 16:07:07 +00:00
|
|
|
EndSwitchPage();
|
|
|
|
else
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (nSwitchId != mnSwitchId)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
mnSwitchId = nSwitchId;
|
2014-09-28 15:49:26 +02:00
|
|
|
mnSwitchTime = tools::Time::GetSystemTicks();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-05 22:22:55 +01:00
|
|
|
// change only after 500 ms
|
2015-05-17 12:24:49 +09:00
|
|
|
if (mnSwitchId != GetCurPageId())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (tools::Time::GetSystemTicks() > mnSwitchTime + 500)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
if (ImplDeactivatePage())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
SetCurPageId( mnSwitchId );
|
|
|
|
Update();
|
2002-09-02 15:17:34 +00:00
|
|
|
ImplActivatePage();
|
|
|
|
ImplSelect();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TabBar::EndSwitchPage()
|
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
mnSwitchTime = 0;
|
|
|
|
mnSwitchId = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
void TabBar::SetStyle(WinBits nStyle)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
mnWinStyle = nStyle;
|
|
|
|
ImplInitControls();
|
2014-01-05 22:22:55 +01:00
|
|
|
// order possible controls
|
2015-05-17 12:24:49 +09:00
|
|
|
if (IsReallyVisible() && IsUpdateMode())
|
2000-09-18 16:07:07 +00:00
|
|
|
Resize();
|
|
|
|
}
|
|
|
|
|
|
|
|
Size TabBar::CalcWindowSizePixel() const
|
|
|
|
{
|
|
|
|
long nWidth = 0;
|
|
|
|
|
2015-03-08 18:14:06 +09:00
|
|
|
if (mpImpl->mpItemList.size() > 0)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-03-26 15:31:36 +01:00
|
|
|
const_cast<TabBar*>(this)->ImplCalcWidth();
|
2016-05-10 14:39:07 +02:00
|
|
|
for (ImplTabBarItem* pItem : mpImpl->mpItemList)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
nWidth += pItem->mnWidth;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 12:24:49 +09:00
|
|
|
return Size(nWidth, GetSettings().GetStyleSettings().GetScrollBarSize());
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-03-30 20:27:55 +02:00
|
|
|
tools::Rectangle TabBar::GetPageArea() const
|
2002-09-06 11:30:44 +00:00
|
|
|
{
|
2017-03-30 20:27:55 +02:00
|
|
|
return tools::Rectangle(Point(mnOffX, mnOffY),
|
2015-05-17 12:24:49 +09:00
|
|
|
Size(mnLastOffX - mnOffX + 1, GetSizePixel().Height() - mnOffY));
|
2002-09-06 11:30:44 +00:00
|
|
|
}
|
2002-09-02 15:17:34 +00:00
|
|
|
|
2015-03-08 18:23:40 +09:00
|
|
|
css::uno::Reference<css::accessibility::XAccessible> TabBar::CreateAccessible()
|
2002-09-02 15:17:34 +00:00
|
|
|
{
|
2015-05-17 12:24:49 +09:00
|
|
|
return mpImpl->maAccessibleFactory.getFactory().createAccessibleTabBar(*this);
|
2002-09-02 15:17:34 +00:00
|
|
|
}
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|