office-gobmx/sd/source/ui/toolpanel/TitledControl.cxx

513 lines
12 KiB
C++
Raw Normal View History

/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
#include "taskpane/TitledControl.hxx"
#include "AccessibleTreeNode.hxx"
#include "taskpane/ControlContainer.hxx"
#include "TaskPaneFocusManager.hxx"
#include "taskpane/TaskPaneControlFactory.hxx"
#include <vcl/ctrl.hxx>
#include <vcl/svapp.hxx>
namespace sd { namespace toolpanel {
TitledControl::TitledControl (
TreeNode* pParent,
::std::auto_ptr<TreeNode> pControl,
const String& rTitle,
const ClickHandler& rClickHandler,
TitleBar::TitleBarType eType)
: ::Window (pParent->GetWindow(), WB_TABSTOP),
TreeNode(pParent),
msTitle(rTitle),
mbVisible(true),
mpUserData(NULL),
mpControlFactory(NULL),
mpClickHandler(new ClickHandler(rClickHandler)),
mbExpansionModeIsToggle(eType!=TitleBar::TBT_CONTROL_TITLE)
{
if (pControl.get() != NULL)
{
mpControlContainer->AddControl (::std::auto_ptr<TreeNode> (
new TitleBar (this, rTitle, eType, pControl->IsExpandable())));
pControl->SetParentNode (this);
}
mpControlContainer->AddControl (pControl);
FocusManager::Instance().RegisterDownLink(this, GetControl()->GetWindow());
FocusManager::Instance().RegisterUpLink(GetControl()->GetWindow(), this);
SetBackground (Wallpaper());
GetTitleBar()->GetWindow()->Show ();
GetTitleBar()->GetWindow()->AddEventListener (
LINK(this,TitledControl,WindowEventListener));
UpdateStates ();
}
TitledControl::TitledControl (
TreeNode* pParent,
::std::auto_ptr<ControlFactory> pControlFactory,
const String& rTitle,
const ClickHandler& rClickHandler,
TitleBar::TitleBarType eType)
: ::Window (pParent->GetWindow(), WB_TABSTOP),
TreeNode(pParent),
msTitle (rTitle),
mbVisible (true),
mpUserData (NULL),
mpControlFactory(pControlFactory),
mpClickHandler(new ClickHandler(rClickHandler)),
mbExpansionModeIsToggle(eType!=TitleBar::TBT_CONTROL_TITLE)
{
mpControlContainer->AddControl (::std::auto_ptr<TreeNode> (
new TitleBar (this, rTitle, eType, true)));
// The second control is created on demand, i.e. when GetControl(true)
// is called the first time.
SetBackground (Wallpaper());
GetTitleBar()->GetWindow()->Show ();
GetTitleBar()->GetWindow()->AddEventListener (
LINK(this,TitledControl,WindowEventListener));
UpdateStates ();
}
TitledControl::~TitledControl (void)
{
GetTitleBar()->GetWindow()->RemoveEventListener (
LINK(this,TitledControl,WindowEventListener));
}
Size TitledControl::GetPreferredSize (void)
{
Size aPreferredSize;
if (GetControl(false) != NULL)
{
aPreferredSize = GetControl()->GetPreferredSize();
if ( ! IsExpanded())
aPreferredSize.Height() = 0;
}
else
aPreferredSize = Size (GetSizePixel().Width(), 0);
if (aPreferredSize.Width() == 0)
aPreferredSize.Width() = 300;
aPreferredSize.Height() += GetTitleBar()->GetPreferredHeight(
aPreferredSize.Width());
return aPreferredSize;
}
sal_Int32 TitledControl::GetPreferredWidth (sal_Int32 nHeight)
{
int nPreferredWidth = 0;
if (GetControl(false) != NULL)
nPreferredWidth = GetControl()->GetPreferredWidth(
nHeight - GetTitleBar()->GetWindow()->GetSizePixel().Height());
else
nPreferredWidth = GetSizePixel().Width();
if (nPreferredWidth == 0)
nPreferredWidth = 300;
return nPreferredWidth;
}
sal_Int32 TitledControl::GetPreferredHeight (sal_Int32 nWidth)
{
int nPreferredHeight = 0;
if (IsExpanded() && GetControl(false)!=NULL)
nPreferredHeight = GetControl()->GetPreferredHeight(nWidth);
nPreferredHeight += GetTitleBar()->GetPreferredHeight(nWidth);
return nPreferredHeight;
}
bool TitledControl::IsResizable (void)
{
return IsExpanded()
&& GetControl()->IsResizable();
}
::Window* TitledControl::GetWindow (void)
{
return this;
}
void TitledControl::Resize (void)
{
Size aWindowSize (GetOutputSizePixel());
int nTitleBarHeight
= GetTitleBar()->GetPreferredHeight(aWindowSize.Width());
GetTitleBar()->GetWindow()->SetPosSizePixel (
Point (0,0),
Size (aWindowSize.Width(), nTitleBarHeight));
TreeNode* pControl = GetControl(false);
if (pControl != NULL
&& pControl->GetWindow() != NULL
&& pControl->GetWindow()->IsVisible())
{
pControl->GetWindow()->SetPosSizePixel (
Point (0,nTitleBarHeight),
Size (aWindowSize.Width(), aWindowSize.Height()-nTitleBarHeight));
}
}
void TitledControl::GetFocus (void)
{
::Window::GetFocus();
if (GetTitleBar() != NULL)
GetTitleBar()->SetFocus (true);
}
void TitledControl::LoseFocus (void)
{
::Window::LoseFocus();
if (GetTitleBar() != NULL)
GetTitleBar()->SetFocus (false);
}
void TitledControl::KeyInput (const KeyEvent& rEvent)
{
KeyCode nCode = rEvent.GetKeyCode();
if (nCode == KEY_SPACE)
{
// Toggle the expansion state of the control (when toggling is
// supported.) The focus remains on this control.
GetParentNode()->GetControlContainer().SetExpansionState (
this,
ControlContainer::ES_TOGGLE);
}
else if (nCode == KEY_RETURN)
{
// Return, also called enter, enters the control and puts the
// focus to the first child. If the control is not yet
// expanded then do that first.
GetParentNode()->GetControlContainer().SetExpansionState (
this,
ControlContainer::ES_EXPAND);
if ( ! FocusManager::Instance().TransferFocus(this,nCode))
{
// When already expanded then put focus on first child.
TreeNode* pControl = GetControl(false);
if (pControl!=NULL && IsExpanded())
if (pControl->GetWindow() != NULL)
pControl->GetWindow()->GrabFocus();
}
}
else if (nCode == KEY_ESCAPE)
{
if ( ! FocusManager::Instance().TransferFocus(this,nCode))
// Put focus to parent.
GetParent()->GrabFocus();
}
else
Window::KeyInput (rEvent);
}
const String& TitledControl::GetTitle (void) const
{
return msTitle;
}
bool TitledControl::Expand (bool bExpanded)
{
bool bExpansionStateChanged (false);
CWS-TOOLING: integrate CWS impress174 2009-08-27 18:21:38 +0200 af r275502 : #i73289# Fixed detection of the cases when the layout menu is be disabled. 2009-08-24 17:45:50 +0200 sj r275326 : #i103360# only setting filltype if there is also a correct fill element 2009-08-24 16:11:06 +0200 cl r275322 : #i73871# only remove replaced objects from mark list if replaced by SdrEditView::ReplaceObjectAtView(). see issue for reason 2009-08-24 15:03:33 +0200 cl r275319 : fixed merge error 2009-08-20 12:45:29 +0200 sj r275174 : CWS-TOOLING: rebase CWS impress174 to trunk@275001 (milestone: DEV300:m55) 2009-08-19 15:54:47 +0200 sj r275153 : #158486# text of flipped shapes is not flipped in word 2009-08-17 17:30:16 +0200 sj r275063 : #158486# also correcting text bound for additional text rotation 2009-08-05 11:09:32 +0200 sj r274643 : #i102797# adapted customshape coloring (fixed fontwork) 2009-08-04 14:17:36 +0200 sj r274620 : #i99501# pdf export: fixed export of rotated graphics 2009-07-30 16:15:44 +0200 sj r274494 : #158653# binary ppt import: fixed table border lines 2009-07-27 18:28:02 +0200 sj r274376 : added shape text clipping for customshapes 2009-07-20 18:09:14 +0200 sj r274154 : #i101918# fixed gallery preview (now taking the correct mapmode) 2009-07-13 18:00:58 +0200 cl r273948 : #i103238# clear hard set attributes only if new style set is manually applied 2009-07-13 17:58:07 +0200 cl r273947 : #i73289# do not expand a toolpanel when it gets enabled 2009-07-08 12:39:49 +0200 sj r273827 : #i101566# applied patch from cmc to solve font width inconsistencies 2009-07-08 12:11:13 +0200 sj r273826 : #i87727# added PDFDialog service 2009-07-06 17:22:40 +0200 sj r273755 : #i103360# fixed a merge problem, no more looping when loading transparence gradients on background page 2009-07-03 14:42:07 +0200 sj r273701 : #102797# added patch from thb (Adapted customshape coloring) 2009-07-03 14:09:44 +0200 sj r273696 : #102797# removed warning 2009-07-03 14:01:47 +0200 sj r273695 : #102797# added patch from thb (Adapted customshape coloring) 2009-07-03 13:13:39 +0200 sj r273688 : #102797# added patch from thb (Adapted customshape coloring) 2009-07-03 11:25:30 +0200 sj r273684 : #i103278# fixed import of lines 2009-07-01 16:23:47 +0200 cl r273599 : #i96820# correctly call setChanged on model if table is modified 2009-07-01 14:43:09 +0200 cl r273588 : #i8770# Patch: fix missing type provider for pdf export dialog 2009-07-01 14:40:28 +0200 cl r273586 : #i73871# activate picture bar after converting shape to bitmap 2009-07-01 14:39:05 +0200 cl r273584 : #i73871# activate picture bar after converting shape to bitmap 2009-07-01 14:04:53 +0200 cl r273578 : #i73289# PATCH: Disable layout pane on the masterslide
2009-09-09 04:19:53 -05:00
if (IsExpandable() && IsEnabled())
{
if (GetTitleBar()->IsExpanded() != bExpanded)
bExpansionStateChanged |= GetTitleBar()->Expand (bExpanded);
// Get the control. Use the bExpanded parameter as argument to
// indicate that a control is created via its factory only when it
// is to be expanded. When it is collapsed this is not necessary.
TreeNode* pControl = GetControl(bExpanded);
if (pControl != NULL
&& GetControl()->IsExpanded() != bExpanded)
{
bExpansionStateChanged |= pControl->Expand (bExpanded);
}
if (bExpansionStateChanged)
UpdateStates();
}
return bExpansionStateChanged;
}
bool TitledControl::IsExpandable (void) const
{
const TreeNode* pControl = GetConstControl(false);
if (pControl != NULL)
return pControl->IsExpandable();
else
// When a control factory is given but the control has not yet been
// created we assume that the control is expandable.
return true;
}
bool TitledControl::IsExpanded (void) const
{
const TreeNode* pControl = GetConstControl(false);
if (pControl != NULL)
return pControl->IsExpanded();
else
return false;
}
void TitledControl::SetEnabledState(bool bFlag)
{
if (!bFlag)
{
GetParentNode()->GetControlContainer().SetExpansionState (
this,
ControlContainer::ES_COLLAPSE);
Disable();
}
else
{
/*
GetParentNode()->GetControlContainer().SetExpansionState (
this,
ControlContainer::ES_EXPAND);
*/
Enable();
}
GetTitleBar()->SetEnabledState(bFlag);
}
void TitledControl::SetUserData (void* pUserData)
{
mpUserData = pUserData;
}
void* TitledControl::GetUserData (void) const
{
return mpUserData;
}
bool TitledControl::IsShowing (void) const
{
return mbVisible;
}
void TitledControl::Show (bool bVisible)
{
if (mbVisible != bVisible)
{
mbVisible = bVisible;
UpdateStates ();
}
}
void TitledControl::UpdateStates (void)
{
if (mbVisible)
GetWindow()->Show();
else
GetWindow()->Hide();
TreeNode* pControl = GetControl(false);
if (pControl!=NULL && pControl->GetWindow() != NULL)
CWS-TOOLING: integrate CWS cmcfixes51 2008-12-08 10:12:55 +0100 cmc r264975 : #i96203# protect with ifdefs to avoid unused symbol on mac 2008-12-05 12:23:47 +0100 cmc r264898 : CWS-TOOLING: rebase CWS cmcfixes51 to trunk@264807 (milestone: DEV300:m37) 2008-12-01 14:45:17 +0100 cmc r264606 : #i76655# ehlos apparently required 2008-11-28 17:49:30 +0100 cmc r264567 : #i96655# remove newly unused method 2008-11-28 10:41:28 +0100 cmc r264531 : #i96647# better ppc-bridges flushCode impl 2008-11-27 12:58:40 +0100 cmc r264478 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 12:32:49 +0100 cmc r264476 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 12:26:02 +0100 cmc r264475 : #i96655# redundant old table export helpers 2008-11-27 11:49:06 +0100 cmc r264473 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:38:35 +0100 cmc r264471 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:14:21 +0100 cmc r264467 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:06:22 +0100 cmc r264464 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:58:18 +0100 cmc r264462 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:41:44 +0100 cmc r264461 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:19:24 +0100 cmc r264460 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:13:39 +0100 cmc r264459 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:06:14 +0100 cmc r264458 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:59:54 +0100 cmc r264457 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:52:51 +0100 cmc r264456 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:48:26 +0100 cmc r264454 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:40:20 +0100 cmc r264452 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:35:26 +0100 cmc r264451 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:31:00 +0100 cmc r264450 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:24:08 +0100 cmc r264449 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:26:15 +0100 cmc r264443 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:21:01 +0100 cmc r264442 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:09:40 +0100 cmc r264441 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 23:51:56 +0100 cmc r264440 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 23:49:09 +0100 cmc r264439 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 18:09:54 +0100 cmc r264432 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 18:07:40 +0100 cmc r264431 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:28:02 +0100 cmc r264429 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:27:39 +0100 cmc r264428 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:18:36 +0100 cmc r264426 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 16:22:16 +0100 cmc r264415 : #i96624# make implicit braces and brackets explicit to avoid warnings 2008-11-26 16:00:23 +0100 cmc r264409 : #i90426# remove warnings from svtools 2008-11-26 15:59:17 +0100 cmc r264408 : #i90426# remove warnings 2008-11-26 15:47:32 +0100 cmc r264404 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:46:57 +0100 cmc r264394 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:19:50 +0100 cmc r264387 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:15:26 +0100 cmc r264386 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:11:26 +0100 cmc r264384 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 13:44:23 +0100 cmc r264380 : #i96084# comfirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 13:12:24 +0100 cmc r264372 : #i96604# silence new warnings 2008-11-26 12:35:02 +0100 cmc r264369 : #i96203# make qstarter work in 3-layer land 2008-11-26 12:33:04 +0100 cmc r264368 : #i96170# ensure gtypes are up and running
2008-12-11 01:05:03 -06:00
{
if (IsVisible() && IsExpanded())
pControl->GetWindow()->Show();
else
pControl->GetWindow()->Hide();
CWS-TOOLING: integrate CWS cmcfixes51 2008-12-08 10:12:55 +0100 cmc r264975 : #i96203# protect with ifdefs to avoid unused symbol on mac 2008-12-05 12:23:47 +0100 cmc r264898 : CWS-TOOLING: rebase CWS cmcfixes51 to trunk@264807 (milestone: DEV300:m37) 2008-12-01 14:45:17 +0100 cmc r264606 : #i76655# ehlos apparently required 2008-11-28 17:49:30 +0100 cmc r264567 : #i96655# remove newly unused method 2008-11-28 10:41:28 +0100 cmc r264531 : #i96647# better ppc-bridges flushCode impl 2008-11-27 12:58:40 +0100 cmc r264478 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 12:32:49 +0100 cmc r264476 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 12:26:02 +0100 cmc r264475 : #i96655# redundant old table export helpers 2008-11-27 11:49:06 +0100 cmc r264473 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:38:35 +0100 cmc r264471 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:14:21 +0100 cmc r264467 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 11:06:22 +0100 cmc r264464 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:58:18 +0100 cmc r264462 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:41:44 +0100 cmc r264461 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:19:24 +0100 cmc r264460 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:13:39 +0100 cmc r264459 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 10:06:14 +0100 cmc r264458 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:59:54 +0100 cmc r264457 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:52:51 +0100 cmc r264456 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:48:26 +0100 cmc r264454 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:40:20 +0100 cmc r264452 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:35:26 +0100 cmc r264451 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:31:00 +0100 cmc r264450 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 09:24:08 +0100 cmc r264449 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:26:15 +0100 cmc r264443 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:21:01 +0100 cmc r264442 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-27 00:09:40 +0100 cmc r264441 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 23:51:56 +0100 cmc r264440 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 23:49:09 +0100 cmc r264439 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 18:09:54 +0100 cmc r264432 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 18:07:40 +0100 cmc r264431 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:28:02 +0100 cmc r264429 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:27:39 +0100 cmc r264428 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 17:18:36 +0100 cmc r264426 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 16:22:16 +0100 cmc r264415 : #i96624# make implicit braces and brackets explicit to avoid warnings 2008-11-26 16:00:23 +0100 cmc r264409 : #i90426# remove warnings from svtools 2008-11-26 15:59:17 +0100 cmc r264408 : #i90426# remove warnings 2008-11-26 15:47:32 +0100 cmc r264404 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:46:57 +0100 cmc r264394 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:19:50 +0100 cmc r264387 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:15:26 +0100 cmc r264386 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 14:11:26 +0100 cmc r264384 : #i96084# confirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 13:44:23 +0100 cmc r264380 : #i96084# comfirm existing logic with explicit brackets to remove new gcc warnings 2008-11-26 13:12:24 +0100 cmc r264372 : #i96604# silence new warnings 2008-11-26 12:35:02 +0100 cmc r264369 : #i96203# make qstarter work in 3-layer land 2008-11-26 12:33:04 +0100 cmc r264368 : #i96170# ensure gtypes are up and running
2008-12-11 01:05:03 -06:00
}
}
IMPL_LINK(TitledControl, WindowEventListener,
VclSimpleEvent*, pEvent)
{
if (pEvent!=NULL && pEvent->ISA(VclWindowEvent))
{
VclWindowEvent* pWindowEvent = static_cast<VclWindowEvent*>(pEvent);
switch (pWindowEvent->GetId())
{
case VCLEVENT_WINDOW_MOUSEBUTTONUP:
CWS-TOOLING: integrate CWS impress174 2009-08-27 18:21:38 +0200 af r275502 : #i73289# Fixed detection of the cases when the layout menu is be disabled. 2009-08-24 17:45:50 +0200 sj r275326 : #i103360# only setting filltype if there is also a correct fill element 2009-08-24 16:11:06 +0200 cl r275322 : #i73871# only remove replaced objects from mark list if replaced by SdrEditView::ReplaceObjectAtView(). see issue for reason 2009-08-24 15:03:33 +0200 cl r275319 : fixed merge error 2009-08-20 12:45:29 +0200 sj r275174 : CWS-TOOLING: rebase CWS impress174 to trunk@275001 (milestone: DEV300:m55) 2009-08-19 15:54:47 +0200 sj r275153 : #158486# text of flipped shapes is not flipped in word 2009-08-17 17:30:16 +0200 sj r275063 : #158486# also correcting text bound for additional text rotation 2009-08-05 11:09:32 +0200 sj r274643 : #i102797# adapted customshape coloring (fixed fontwork) 2009-08-04 14:17:36 +0200 sj r274620 : #i99501# pdf export: fixed export of rotated graphics 2009-07-30 16:15:44 +0200 sj r274494 : #158653# binary ppt import: fixed table border lines 2009-07-27 18:28:02 +0200 sj r274376 : added shape text clipping for customshapes 2009-07-20 18:09:14 +0200 sj r274154 : #i101918# fixed gallery preview (now taking the correct mapmode) 2009-07-13 18:00:58 +0200 cl r273948 : #i103238# clear hard set attributes only if new style set is manually applied 2009-07-13 17:58:07 +0200 cl r273947 : #i73289# do not expand a toolpanel when it gets enabled 2009-07-08 12:39:49 +0200 sj r273827 : #i101566# applied patch from cmc to solve font width inconsistencies 2009-07-08 12:11:13 +0200 sj r273826 : #i87727# added PDFDialog service 2009-07-06 17:22:40 +0200 sj r273755 : #i103360# fixed a merge problem, no more looping when loading transparence gradients on background page 2009-07-03 14:42:07 +0200 sj r273701 : #102797# added patch from thb (Adapted customshape coloring) 2009-07-03 14:09:44 +0200 sj r273696 : #102797# removed warning 2009-07-03 14:01:47 +0200 sj r273695 : #102797# added patch from thb (Adapted customshape coloring) 2009-07-03 13:13:39 +0200 sj r273688 : #102797# added patch from thb (Adapted customshape coloring) 2009-07-03 11:25:30 +0200 sj r273684 : #i103278# fixed import of lines 2009-07-01 16:23:47 +0200 cl r273599 : #i96820# correctly call setChanged on model if table is modified 2009-07-01 14:43:09 +0200 cl r273588 : #i8770# Patch: fix missing type provider for pdf export dialog 2009-07-01 14:40:28 +0200 cl r273586 : #i73871# activate picture bar after converting shape to bitmap 2009-07-01 14:39:05 +0200 cl r273584 : #i73871# activate picture bar after converting shape to bitmap 2009-07-01 14:04:53 +0200 cl r273578 : #i73289# PATCH: Disable layout pane on the masterslide
2009-09-09 04:19:53 -05:00
if (IsEnabled())
(*mpClickHandler)(*this);
break;
}
}
return 0;
}
TreeNode* TitledControl::GetControl (bool bCreate)
{
TreeNode* pNode = mpControlContainer->GetControl(1);
if (pNode==NULL && mpControlFactory.get()!=NULL && bCreate)
{
// We have to create the control with the factory object.
::std::auto_ptr<TreeNode> pControl (mpControlFactory->CreateControl(this));//GetParentNode()));
if (pControl.get() != NULL)
{
pControl->SetParentNode(this);
mpControlContainer->AddControl(pControl);
pNode = mpControlContainer->GetControl(1);
FocusManager::Instance().RegisterDownLink(this, pNode->GetWindow());
FocusManager::Instance().RegisterUpLink(pNode->GetWindow(), this);
}
}
return pNode;
}
const TreeNode* TitledControl::GetConstControl (bool bCreate) const
{
return const_cast<TitledControl*>(this)->GetControl(bCreate);
}
TitleBar* TitledControl::GetTitleBar (void)
{
return static_cast<TitleBar*>(mpControlContainer->GetControl(0));
}
::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible> TitledControl::CreateAccessibleObject (
const ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible>& )
{
return new ::accessibility::AccessibleTreeNode(
*this,
GetTitle(),
GetTitle(),
::com::sun::star::accessibility::AccessibleRole::LIST_ITEM);
}
//===== TitledControlStandardClickHandler =====================================
TitledControlStandardClickHandler::TitledControlStandardClickHandler (
ControlContainer& rControlContainer,
ControlContainer::ExpansionState eExpansionState)
: mrControlContainer(rControlContainer),
meExpansionState(eExpansionState)
{
}
void TitledControlStandardClickHandler::operator () (TitledControl& rTitledControl)
{
// Toggle expansion.
mrControlContainer.SetExpansionState (&rTitledControl, meExpansionState);
}
} } // end of namespace ::sd::toolpanel